Skip to content

Releases: omar00050/easy-devops

V1.0.2 🛠️⚙️

Choose a tag to compare

@omar00050 omar00050 released this 05 Apr 15:21

[1.0.2] — 2026-04-05

Fixed

nginx -t no longer needs sudo (and never did)

  • Root cause: nginx -t only reads world-readable config files (/etc/nginx/nginx.conf is 644). It was never necessary to run it with sudo. All sudo prefixes have been removed from every nginx -t call across cli/managers/nginx-manager.js, cli/managers/domain-manager.js, dashboard/routes/domains.js, and dashboard/lib/nginx-service.js.
  • Why it was breaking: The dashboard runs headless (no TTY), so sudo nginx -t triggered "a terminal is required to read the password" → the test was always reported as failed even with valid configs.

nginx -t PID file false-negative (/run/nginx.pid Permission Denied)

  • Root cause: When run as a non-root user, nginx -t writes "syntax is ok" to stderr then attempts to write /run/nginx.pid — which requires root. This causes nginx to exit with code 1 even though the config is perfectly valid.
  • Fix: isNginxTestOk(result) added to core/platform.js. Returns true if result.success OR if the output contains "syntax is ok". All 11 nginx config-test result checks now use this function instead of checking exit code directly.
  • Tip: Always use isNginxTestOk(result) — never rely on result.success alone when checking nginx -t results on Linux.

sudo -n for all systemctl calls in the dashboard

  • The dashboard API runs as a background Express server with no attached terminal. All sudo systemctl calls in dashboard/lib/nginx-service.js now use sudo -n (non-interactive). If NOPASSWD is not configured, the call fails immediately with a clear message instead of hanging.
  • isSudoPermissionError() updated to catch "sudo:" prefix in output (covers sudo: a password is required, sudo: a terminal is required, and other sudo error variants).

Linux permissions setup in Settings

  • Problem: On Linux, sudo -n systemctl start/stop/reload/restart nginx always fails until NOPASSWD sudoers rules are configured. Previously there was no way to configure this from the app.
  • Fix: New one-time setup flow:
    • CLI: Settings → Setup Linux Permissions — uses runInteractive('sudo -v') to authenticate, then writes /etc/sudoers.d/easy-devops with NOPASSWD rules for systemctl and the detected nginx binary path.
    • Dashboard: Settings → Linux Permissions card — password field + "Setup Permissions" button. Uses POST /api/settings/permissions/setup which pipes the password to sudo -S via spawn stdin (no terminal needed).
    • New core/permissions.js module: setupLinuxPermissions(), checkPermissionsConfigured().
    • Status badge shows "✓ Configured" or "⚠ Required". CLI menu shows "✅ configured" or "⚠ required" in the menu item label.

Dynamic nginx binary path detection

  • which nginx is called via findNginxPath() in both core/permissions.js and dashboard/lib/nginx-service.js to detect the real nginx binary path at runtime.
  • The SUDO_RULES written to /etc/sudoers.d/easy-devops include the detected path (e.g. /usr/sbin/nginx) rather than hard-coding /usr/bin/nginx.
  • Dashboard nginx test/start/save-config flows use the detected path for nginx -t.

ssl-manager.js mkdir under /etc/ directories

  • On Linux, creating directories under /etc/easy-devops/ requires root. ssl-manager.js mkdir calls now use sudo -n mkdir -p followed by sudo -n chown to restore ownership, instead of failing with EACCES.

Added

  • core/permissions.js — new module with setupLinuxPermissions() and checkPermissionsConfigured().
  • GET /api/settings/permissions — returns { configured: boolean }.
  • POST /api/settings/permissions/setup — accepts { password }, runs sudo -S setup, returns { success: true } or { error }.
  • isNginxTestOk(result) exported from core/platform.js — the correct semantic check for nginx config validity on all platforms.

Easy DevOps frest v0.1.0

Choose a tag to compare

@omar00050 omar00050 released this 30 Mar 05:47
a2a4bf2

Easy DevOps

npm version
License: MIT
Node.js

A unified DevOps management tool with interactive CLI and web dashboard for managing Nginx, SSL certificates, and Node.js on Linux and Windows servers.

Features

  • 🖥️ Interactive CLI — Arrow-key menus with real-time status indicators
  • 📊 Web Dashboard — Modern Vue 3 interface with dark/light themes
  • 🌐 Nginx Management — Start/stop/reload, config editor, error logs
  • 🔒 SSL Certificate Management — Let's Encrypt via Certbot, expiry tracking
  • 🔗 Domain Management — Reverse proxy configurations with SSL, WebSocket, gzip, rate limiting
  • 📦 Node.js Manager — Version switching via nvm, global package management
  • 🔄 Real-time Updates — Socket.io powered status updates in dashboard
  • 💿 SQLite Storage — Persistent configuration via good.db

Requirements

  • Node.js 18+ (with npm)
  • Linux (Debian/Ubuntu) or Windows
  • Optional: Nginx, Certbot, nvm (installed separately or via the tool)

Installation

Quick Install (One-Line)

If you have Node.js 18+ installed, run:

npm install -g easy-devops && easy-devops

If you don't have Node.js yet, use the bootstrap installer:

Linux / macOS

curl -fsSL https://raw.githubusercontent.com/omar00050/Easy-DevOps/main/install.sh | bash

Or with wget:

wget -qO- https://raw.githubusercontent.com/omar00050/Easy-DevOps/main/install.sh | bash

Windows (PowerShell)

Invoke-WebRequest -Uri "https://raw.githubusercontent.com/omar00050/Easy-DevOps/main/install.ps1" -OutFile "install.ps1"; ./install.ps1

Or from Command Prompt:

powershell -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/omar00050/Easy-DevOps/main/install.ps1' -OutFile 'install.ps1'; ./install.ps1"

What the installer does:

  1. Checks for Node.js 18+ (installs via nvm if missing)
  2. Installs Easy DevOps globally via npm
  3. Launches the interactive CLI

Via npm (Recommended)

npm install -g easy-devops
easy-devops

From Source

git clone https://github.com/omar00050/Easy-DevOps.git
cd Easy-DevOps
npm install
npm start

Quick Start

# Start the interactive CLI
easy-devops

# Or run directly
npx easy-devops

Usage

CLI Overview

╔══════════════════════════════╗
║      Easy DevOps v0.1.0     ║
╚══════════════════════════════╝

nginx: ✅ v1.26.2 | certbot: ✅ v2.9.0 | node: v22.21.1

? Select an option:
  📦 Node.js Manager
  🌐 Nginx Manager
  🔒 SSL Manager
  🔗 Domain Manager
  🎛️ Open Dashboard
  ⚙️ Settings
  ✖ Exit

Press Ctrl+C at any prompt to exit cleanly.


Node.js Manager

Manage your Node.js runtime using nvm (Unix) or nvm-windows (Windows).

Option Description
Switch Node version Lists available LTS versions and switches to the selected one
Manage global packages Install, uninstall, or list globally installed npm packages
Update npm Updates npm to the latest version

Nginx Manager

Control the Nginx web server from the CLI.

Option Description
Reload nginx Tests the config then sends a graceful reload signal
Restart nginx Tests the config then performs a full stop/start
Test config Runs nginx -t and displays the result
View error log Shows the last 50 lines of the Nginx error log
Install nginx Installs Nginx via apt-get (Linux) or winget (Windows)

Domain Manager

Manage Nginx reverse proxy configurations from CLI or dashboard.

Option Description
List Domains Show all configured domains in a table
Add Domain Interactive prompts for domain configuration
Edit Domain Modify existing domain settings
Delete Domain Remove domain with confirmation

Domain Configuration Options:

  • SSL/HTTPS with auto-renewal tracking
  • WebSocket support (ws upstream type)
  • Gzip compression
  • Rate limiting (requests/second + burst)
  • Security headers (X-Frame-Options, etc.)
  • Custom timeout and body size limits
  • Domain-specific access logs

SSL Manager

Manage Let's Encrypt SSL certificates using Certbot.

Status Meaning
✅ green Valid, expires in > 30 days
⚠️ yellow Expiring soon (10–30 days)
❌ red Critical (< 10 days)

Note: Renewing a certificate temporarily stops Nginx to free port 80, then restarts it automatically.


Web Dashboard

Start the web dashboard:

# From CLI menu: Select "🎛️ Open Dashboard" → "Start dashboard"
# Or directly:
npm run dashboard

Access at http://localhost:3000 (or configured port).

Dashboard Pages

Page Features
Overview System status cards for Nginx, SSL, Domains
Nginx Start/stop controls, config editor, error logs
SSL Certificate list, renewal actions, expiry badges
Domains Add/edit form with collapsible sections, table view
Settings Port, password, directory configuration

API Endpoints

The dashboard exposes RESTful API endpoints:

Endpoint Method Description
/api/nginx/status GET Get nginx running status
/api/nginx/start POST Start nginx
/api/nginx/stop POST Stop nginx
/api/nginx/reload POST Graceful reload
/api/nginx/configs GET List config files
/api/nginx/config/:file GET/POST Read/write config file
/api/domains GET/POST List/create domains
/api/domains/:name GET/PUT/DELETE Domain CRUD
/api/ssl GET List certificates
/api/ssl/renew/:domain POST Renew certificate
/api/settings GET/POST Dashboard settings

Configuration

All configuration is stored in data/easy-devops.sqlite:

Key Contents
config Dashboard port, password, Nginx/Certbot directories
system-detection Cached system info (OS, Node, nginx, certbot)
domains Array of domain configurations

Project Structure

easy-devops/
├── cli/
│   ├── index.js          # CLI entry point
│   ├── managers/         # Business logic modules
│   └── menus/            # Menu dispatcher stubs
├── core/
│   ├── config.js         # Configuration loader
│   ├── db.js             # SQLite database (good.db)
│   ├── detector.js       # System environment detection
│   └── shell.js          # Cross-platform shell executor
├── dashboard/
│   ├── server.js         # Express + Socket.io server
│   ├── routes/           # API endpoints
│   ├── lib/              # Service helpers
│   ├── views/            # EJS templates
│   └── public/           # Static assets (Vue app)
├── data/
│   └── easy-devops.sqlite
└── lib/
    └── installer/        # Bootstrap scripts

Platform Support

Feature Linux Windows
CLI Interface
Web Dashboard
Nginx Management
SSL (Certbot)
Node.js (nvm) ✅ (nvm-windows)
System Service systemd Task Scheduler

Development

# Clone and install
git clone https://github.com/omar00050/Easy-DevOps.git
cd Easy-DevOps
npm install

# Run CLI
npm start

# Run dashboard
npm run dashboard

# System info only
npm run system-info

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Author

Omar Farghaly


Support

If you encounter any issues or have questions, please open an issue on GitHub.