Skip to content

javimosch/linuxify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linuxify

Lightweight Linux system optimizer - manage services, extensions, and disk space with an intuitive web UI

License: MIT Node.js Version

🚀 Features

  • Service Management - Enable/disable non-critical system services
  • Extension Control - Manage GNOME shell extensions (UI + system)
  • Disk Cleanup - One-click cleanup tasks (APT cache, thumbnails, logs, etc.)
  • Real-time Monitoring - Live system stats (uptime, load, memory, CPU, disk)
  • Critical Protection - Cannot disable critical system services
  • Tabbed Interface - Single-page layout prevents scroll conflicts
  • Auto-refresh - Updates every 5 seconds
  • Responsive Design - Works on desktop and mobile

📋 Requirements

  • Linux (Ubuntu, Debian, AnduinOS, etc.)
  • Node.js >= 16
  • npm or yarn
  • sudo access (for system operations)

🔧 Installation

Quick Start (Recommended)

The easiest way to get started with Linuxify is using npx:

npx linuxify

This will:

  1. Show an interactive setup wizard to choose your preferred setup mode
  2. Configure either sudoers or run directly with sudo
  3. Start the application automatically

Installation Options

Two setup modes are available. The setup wizard will guide you through both options:

1. Sudoers Mode (Recommended for security-conscious users)

npx linuxify
# Select option "1" when prompted
  • ✅ Configure sudoers file once during setup
  • ✅ Run Linuxify as regular user afterwards
  • ✅ Commands execute with limited, scoped sudo permissions
  • ⚠️ Requires understanding of sudoers configuration
  • ⚠️ Exposes commands to sudoers file (potential privilege escalation vector if other apps exploit sudoers)

2. Sudo Run Mode (Simpler, full control)

Method 1: Preserve PATH (Recommended)

cd linuxify
sudo PATH=$PATH bash bin/linuxify.sh

Method 2: Preserve entire environment

cd linuxify
sudo -E bash bin/linuxify.sh

Method 3: Use full path to node

cd linuxify
sudo $(which node) bin/linuxify

The PATH=$PATH or -E flag tells sudo to preserve your environment variables so it can find Node.js, even with NVM, Homebrew, or other custom installations.

  • ✅ No sudoers configuration needed
  • ✅ Simplest setup (just one command with sudo)
  • ✅ Full root privileges, complete control
  • ⚠️ Web interface runs as root (security consideration)
  • ⚠️ Should only be accessed from localhost
  • ⚠️ Should not be exposed to network/internet

3. Skip Setup (Manual configuration later)

npx linuxify
# Select option "0" when prompted
  • Run without any setup
  • Configure manually later with npx linuxify --setup or sudo bash setup.sh

Manual Installation

# Clone or navigate to project
cd linuxify

# Install dependencies
npm install

# Start with setup wizard
npm run cli

# Or start directly (skip setup)
npm start

⚙️ Setup Modes & Sudo Configuration

Mode 1: Sudoers Mode (Recommended)

This is the traditional approach where you configure the sudoers file once, then run Linuxify as a regular user.

Automatic Setup (Recommended)

When you run npx linuxify and select sudoers mode:

  1. The setup wizard displays the required sudoers rules
  2. Automatically edits the sudoers file (just enter your sudo password)
  3. Verifies the configuration with validation
  4. Tests if passwordless sudo is working

The wizard uses a secure bash script that:

  • Validates sudoers syntax before applying changes
  • Creates backups of your sudoers file
  • Uses /etc/sudoers.d/linuxify (safer approach when available)
  • Falls back to direct editing only if needed
  • Shows clear success/error messages

Manual Setup (Alternative)

If you prefer manual setup:

sudo bash setup.sh

Or for interactive sudoers editing:

sudo visudo

Add at the end of the file:

# Linuxify - systemctl commands
%sudo ALL=(ALL) NOPASSWD: /bin/systemctl disable *
%sudo ALL=(ALL) NOPASSWD: /bin/systemctl stop *
%sudo ALL=(ALL) NOPASSWD: /bin/systemctl mask *
%sudo ALL=(ALL) NOPASSWD: /bin/systemctl unmask *
%sudo ALL=(ALL) NOPASSWD: /bin/systemctl enable *
%sudo ALL=(ALL) NOPASSWD: /bin/systemctl start *
%sudo ALL=(ALL) NOPASSWD: /bin/systemctl restart *
%sudo ALL=(ALL) NOPASSWD: /bin/systemctl reload *

# Linuxify - cleanup commands
%sudo ALL=(ALL) NOPASSWD: /usr/bin/apt clean
%sudo ALL=(ALL) NOPASSWD: /usr/bin/apt autoremove -y
%sudo ALL=(ALL) NOPASSWD: /usr/bin/apt autoremove --purge -y
%sudo ALL=(ALL) NOPASSWD: /usr/bin/journalctl --vacuum-time=7d
%sudo ALL=(ALL) NOPASSWD: /usr/bin/journalctl --vacuum-size=500M
%sudo ALL=(ALL) NOPASSWD: /usr/bin/flatpak remove --unused -y
%sudo ALL=(ALL) NOPASSWD: /usr/bin/dnf clean all
%sudo ALL=(ALL) NOPASSWD: /usr/bin/pacman -Sc --noconfirm
%sudo ALL=(ALL) NOPASSWD: /usr/bin/rm -rf /tmp/*
%sudo ALL=(ALL) NOPASSWD: /usr/bin/rm -rf /var/tmp/*
%sudo ALL=(ALL) NOPASSWD: /usr/bin/rm -rf /root/.cache
%sudo ALL=(ALL) NOPASSWD: /usr/bin/find /root -name "*.old" -delete

To verify sudoers was applied correctly:

sudo -n systemctl status systemd

If this runs without asking for a password, sudoers is configured correctly!

Mode 2: Sudo Run Mode

This approach runs Linuxify directly as root with full privileges, without needing sudoers configuration.

Setup

cd linuxify
sudo PATH=$PATH bash bin/linuxify.sh

Or to preserve the entire environment:

cd linuxify
sudo -E bash bin/linuxify.sh

Why PATH preservation matters:

  • sudo strips environment variables for security
  • Without it, sudo can't find node from NVM, Homebrew, etc.
  • PATH=$PATH or -E explicitly tells sudo to preserve these
  • The bash wrapper then finds and executes node properly

Security Considerations:

  • ⚠️ The web interface runs as root (all operations have full system access)
  • ⚠️ Only access from localhost (127.0.0.1) - do not expose to network
  • ⚠️ Do not expose to internet or untrusted networks
  • ✅ Simpler setup - no sudoers configuration needed
  • ✅ Useful for one-time administrative tasks
  • ✅ Full control without privilege escalation concerns

When to Use:

  • Initial system setup/optimization before users are added
  • Running as system administrator on local machine only
  • One-time cleanup/optimization tasks
  • When you want to avoid sudoers configuration complexity

Standalone Setup Script

To configure sudoers without starting the app:

sudo bash setup.sh

This script:

  • ✓ Validates sudoers syntax before applying
  • ✓ Creates automatic backups
  • ✓ Prefers /etc/sudoers.d/linuxify for safer configuration
  • ✓ Verifies the final configuration
  • ✓ Shows clear success/error messages
  • ✓ Handles both systemctl and cleanup commands

📊 Tabs Overview

Services

  • Optimizable - Non-critical services you can safely disable
  • All Services - Complete system services list
  • Critical services are protected (cannot be disabled)

Extensions

  • UI Extensions - GNOME shell cosmetic/UI extensions (heavy hitters like blur-my-shell, arcmenu)
  • Other Extensions - System extensions (keyboard layout, keyboard indicators)

Disk Cleanup

One-click cleanup actions:

  • APT cache & autoremove
  • Desktop thumbnails & trash
  • NPM, Yarn, Pip caches
  • Flatpak unused packages
  • Journal logs (7+ days)
  • Old kernels

Quick Actions

  • Disable all UI extensions (preserves dash-to-panel)
  • Force refresh system data

🎯 System Stats

Real-time display of:

  • Uptime - System uptime duration
  • Load Average - CPU load (color-coded: green < 0.5, yellow < 1.0, red > 1.0)
  • Memory - Used / Total RAM
  • CPU - Processor model
  • Disk - Available / Total / Used space

🏗️ Architecture

linuxify/
├── server.js              # Express server
├── package.json          # Dependencies
├── modules/
│   ├── services.js       # Service management
│   ├── extensions.js     # GNOME extension control
│   └── system.js         # System info & cleanup
├── views/
│   └── index.ejs         # Main UI (Vue 3)
├── docs/
│   ├── index.html        # Landing page
│   └── docs.html         # Advanced documentation
└── README.md             # This file

🛠️ Tech Stack

  • Backend: Node.js + Express
  • Frontend: Vue 3 (CDN) + EJS templates
  • Styling: Tailwind CSS + DaisyUI
  • Task Runner: npm scripts + nodemon

📝 Configuration

Edit server.js to change:

  • Port: const PORT = 3000; (line 7)
  • Refresh interval: setInterval(refresh, 5000); (line 338 in index.ejs)

⚠️ Safety Considerations

  • Critical Services - Marked red, cannot be toggled
  • Non-critical Only - Services tab filters by default to safe options
  • Cleanup Tasks - All non-destructive, safe to run multiple times
  • Read-only Operations - Monitoring and info gathering don't modify system

🐛 Troubleshooting

"sudo: no password provided"

Run through sudoers configuration above to allow passwordless sudo for specific commands.

Port 3000 already in use

Change PORT in server.js or kill existing process:

fuser -k 3000/tcp

Extensions not showing

Some extensions may be installed in system directories. Refresh browser cache.

Disk cleanup not freeing space

Some services may lock files. Try one task at a time and wait a moment.

📄 License

MIT - See LICENSE file

👤 Author

arancibiajav@gmail.com

🤝 Contributing

Contributions welcome! Feel free to open issues and pull requests.

🔗 Links


Linuxify - Keep your Linux system optimized, one click at a time.

About

Lightweight Linux system optimizer - manage services, extensions, and disk space with an intuitive web UI

Resources

License

Stars

Watchers

Forks

Contributors