Skip to main content

Web App System Management - Deploy and manage web applications on Linux servers

Project description

WASM - Web App System Management

WASM Logo

Deploy, manage, and monitor web applications with ease

Installation โ€ข Quick Start โ€ข Features โ€ข Documentation


๐Ÿš€ What is WASM?

WASM (Web App System Management) is a powerful CLI tool designed to simplify the deployment and management of web applications on Linux servers. It automates the entire process from cloning your code to serving it with Nginx/Apache, including SSL certificates and systemd services.

Key Capabilities

  • ๐ŸŒ Site Management - Create and manage Nginx/Apache virtual hosts
  • ๐Ÿ”’ SSL Certificates - Automated Let's Encrypt certificates via Certbot
  • โš™๏ธ Service Management - Create and control systemd services
  • ๐Ÿš€ One-Command Deployment - Deploy full-stack applications instantly
  • ๐ŸŽฏ Multi-Framework Support - Next.js, Node.js, Vite, Python, and more
  • ๐Ÿงญ Interactive Mode - Guided step-by-step deployment wizard

๐Ÿ“ฆ Installation

Ubuntu/Debian - From PPA (Recommended)

sudo add-apt-repository ppa:yago2003/wasm
sudo apt update
sudo apt install wasm

Supported Ubuntu versions:

  • Ubuntu 24.04 LTS (Noble Numbat)
  • Ubuntu 24.10 (Plucky Puffin)
  • Ubuntu 25.04 (Questing Qetzal)

Fedora - From OBS Repository

# Add repository
sudo dnf config-manager --add-repo \
  https://download.opensuse.org/repositories/home:/Perkybeet/Fedora_40/home:Perkybeet.repo

# Install
sudo dnf install wasm-cli

openSUSE - From OBS Repository

# Tumbleweed
sudo zypper ar -f \
  https://download.opensuse.org/repositories/home:/Perkybeet/openSUSE_Tumbleweed/ \
  home_Perkybeet
sudo zypper install wasm-cli

# Leap 15.6
sudo zypper ar -f \
  https://download.opensuse.org/repositories/home:/Perkybeet/openSUSE_Leap_15.6/ \
  home_Perkybeet
sudo zypper install wasm-cli

Debian - From OBS Repository

# Add repository key
curl -fsSL https://download.opensuse.org/repositories/home:/Perkybeet/Debian_12/Release.key | \
  gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_Perkybeet.gpg > /dev/null

# Add repository
echo 'deb https://download.opensuse.org/repositories/home:/Perkybeet/Debian_12/ /' | \
  sudo tee /etc/apt/sources.list.d/home_Perkybeet.list

# Install
sudo apt update
sudo apt install wasm-cli

From .deb Package

wget https://github.com/Perkybeet/wasm/releases/latest/download/wasm_0.8.2_all.deb
sudo dpkg -i wasm_0.8.2_all.deb
sudo apt install -f  # Install dependencies if needed

From PyPI

pip install wasm-cli

From Source

git clone https://github.com/your-org/wasm.git
cd wasm
pip install -e .

๐Ÿƒ Quick Start

Deploy a Next.js Application

# One-liner deployment
wasm webapp create \
  --domain myapp.example.com \
  --source git@github.com:user/my-nextjs-app.git \
  --type nextjs \
  --port 3000

# Short version
wasm wp create -d myapp.example.com -s git@github.com:user/app.git -t nextjs -p 3000

Interactive Mode

For a guided experience, simply run:

wasm

Or explicitly:

wasm --interactive

You'll be guided through all the options step by step:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚           WASM - Web App System Management      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

? What would you like to do?
โฏ ๐Ÿš€ Deploy a Web Application
  ๐ŸŒ Manage Sites (Nginx/Apache)
  โš™๏ธ  Manage Services
  ๐Ÿ”’ Manage SSL Certificates
  ๐Ÿ“Š View Status Dashboard
  โšก Exit

? Select application type:
โฏ Next.js
  Node.js (Express, Fastify, etc.)
  Vite (React, Vue, Svelte)
  Python (Django, Flask, FastAPI)
  Static Site
  Custom

? Enter the domain name: myapp.example.com
? Enter the source (Git URL or path): git@github.com:user/app.git
? Enter the port number: 3000
? Configure SSL certificate? Yes

[1/7] ๐Ÿ“ฅ Cloning repository...
[2/7] ๐Ÿ“ฆ Installing dependencies...
[3/7] ๐Ÿ”จ Building application...
[4/7] ๐ŸŒ Creating Nginx configuration...
[5/7] ๐Ÿ”’ Obtaining SSL certificate...
[6/7] โš™๏ธ  Creating systemd service...
[7/7] ๐Ÿš€ Starting application...

โœ… Deployment complete!

   URL: https://myapp.example.com
   Status: Running
   Service: wasm-myapp-example-com

๐Ÿ“‹ Features

Web Application Deployment

# Create a new web application
wasm webapp create [options]

Options:
  -d, --domain DOMAIN     Target domain (e.g., example.com)
  -s, --source SOURCE     Git URL or local path to source code
  -t, --type TYPE         Application type (nextjs, nodejs, vite, python, static)
  -p, --port PORT         Application port (default: auto-assigned)
  -w, --webserver SERVER  Web server (nginx, apache) [default: nginx]
  --no-ssl                Skip SSL certificate configuration
  --branch BRANCH         Git branch to deploy [default: main]
  --env-file FILE         Path to .env file to use
  -v, --verbose           Enable verbose output

# List deployed applications
wasm webapp list

# Get application status
wasm webapp status myapp.example.com

# Restart application
wasm webapp restart myapp.example.com

# Remove application
wasm webapp delete myapp.example.com

# Update application (pull & rebuild)
wasm webapp update myapp.example.com

Site Management

# Create a site (without deploying an app)
wasm site create -d example.com -w nginx

# List all sites
wasm site list

# Enable/disable site
wasm site enable example.com
wasm site disable example.com

# Delete site
wasm site delete example.com

# Show site configuration
wasm site show example.com

Service Management

# Create a custom service
wasm service create --name myservice --command "/usr/bin/myapp" --user www-data

# List managed services
wasm service list

# Control services
wasm service start myservice
wasm service stop myservice
wasm service restart myservice

# View service status
wasm service status myservice

# View service logs
wasm service logs myservice
wasm service logs myservice --follow
wasm service logs myservice --lines 100

# Delete service
wasm service delete myservice

SSL Certificate Management

# Obtain certificate for a domain
wasm cert create -d example.com

# List certificates
wasm cert list

# Renew all certificates
wasm cert renew

# Revoke a certificate
wasm cert revoke example.com

# Show certificate info
wasm cert info example.com

๐ŸŽฏ Supported Application Types

Type Framework Auto-Detection
nextjs Next.js next.config.js
nodejs Express, Fastify, Koa, etc. package.json with start script
vite React, Vue, Svelte (Vite) vite.config.js
python Django, Flask, FastAPI requirements.txt, pyproject.toml
static HTML/CSS/JS index.html

Each type has a specific deployment workflow that includes:

  • Dependency installation
  • Build process
  • Environment configuration
  • Service setup
  • Health checks

โš™๏ธ Configuration

Global Configuration

Configuration file location: /etc/wasm/config.yaml

# Default web server
webserver: nginx

# Default apps directory
apps_directory: /var/www/apps

# Default user for services
service_user: www-data

# SSL settings
ssl:
  enabled: true
  provider: certbot
  email: admin@example.com
  
# Logging
logging:
  level: info
  file: /var/log/wasm/wasm.log

# Node.js settings
nodejs:
  default_version: 20
  use_nvm: false

# Python settings
python:
  default_version: "3.11"
  use_venv: true

Per-Project Configuration

You can include a .wasm.yaml file in your project root:

type: nextjs
port: 3000
build_command: npm run build
start_command: npm run start
env_vars:
  NODE_ENV: production
health_check:
  path: /api/health
  timeout: 30

๐Ÿ“Š Verbose Mode

Add --verbose or -v for detailed output:

wasm webapp create -d example.com -s git@github.com:user/app.git -t nextjs -v

Verbose output example:

[1/7] ๐Ÿ“ฅ Cloning repository...
      โ”œโ”€ Source: git@github.com:user/app.git
      โ”œโ”€ Branch: main
      โ”œโ”€ Target: /var/www/apps/example-com
      โ””โ”€ Completed in 4.2s

[2/7] ๐Ÿ“ฆ Installing dependencies...
      โ”œโ”€ Package manager: npm
      โ”œโ”€ Command: npm ci --production=false
      โ”œโ”€ Packages installed: 1,247
      โ””โ”€ Completed in 45.3s

[3/7] ๐Ÿ”จ Building application...
      โ”œโ”€ Command: npm run build
      โ”œโ”€ Output directory: .next
      โ”œโ”€ Build size: 12.4 MB
      โ””โ”€ Completed in 32.1s
...

๐Ÿ—‚๏ธ Directory Structure

WASM organizes deployed applications as follows:

/var/www/apps/
โ”œโ”€โ”€ example-com/
โ”‚   โ”œโ”€โ”€ current/          # Current deployment (symlink)
โ”‚   โ”œโ”€โ”€ releases/         # Previous releases (for rollback)
โ”‚   โ”‚   โ”œโ”€โ”€ 20241215120000/
โ”‚   โ”‚   โ””โ”€โ”€ 20241214150000/
โ”‚   โ”œโ”€โ”€ shared/           # Shared files (uploads, logs)
โ”‚   โ””โ”€โ”€ .env              # Environment variables
โ”‚
โ””โ”€โ”€ another-app/
    โ””โ”€โ”€ ...

๐Ÿ”ง Requirements

System Requirements

  • OS: Ubuntu 20.04+, Debian 11+
  • Python: 3.10+
  • Privileges: sudo access for service management

Optional Dependencies

  • nginx or apache2 - Web server
  • certbot - SSL certificates
  • git - Source code management
  • nodejs / nvm - For Node.js applications
  • python3-venv - For Python applications

WASM will check and prompt for missing dependencies during installation.


๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

# Development setup
git clone https://github.com/Perkybeet/wasm.git
cd wasm
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"

# Run tests
pytest

# Build .deb package
make debian

# Build and upload to PPA (all distributions)
make ppa-upload

# Or for specific distributions
./build-and-upload-ppa.sh noble plucky

For detailed information about building and uploading to PPA, see docs/PPA_UPLOAD.md.


๐Ÿ“œ License

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


๐Ÿ™ Acknowledgments


Made with โค๏ธ for the DevOps community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wasm_cli-0.10.5.tar.gz (125.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wasm_cli-0.10.5-py3-none-any.whl (138.1 kB view details)

Uploaded Python 3

File details

Details for the file wasm_cli-0.10.5.tar.gz.

File metadata

  • Download URL: wasm_cli-0.10.5.tar.gz
  • Upload date:
  • Size: 125.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wasm_cli-0.10.5.tar.gz
Algorithm Hash digest
SHA256 97f0a22b1c012466852243501b8774890dd156f006a71d84400fd2a59669796a
MD5 c80937052f5072a5e5fdea2d809abb2e
BLAKE2b-256 1d102dfa2bab7c5db4e3e902bee822730abcb86738441dc73f01ef9085eaec94

See more details on using hashes here.

Provenance

The following attestation bundles were made for wasm_cli-0.10.5.tar.gz:

Publisher: release.yml on Perkybeet/wasm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wasm_cli-0.10.5-py3-none-any.whl.

File metadata

  • Download URL: wasm_cli-0.10.5-py3-none-any.whl
  • Upload date:
  • Size: 138.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wasm_cli-0.10.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ecb2f3c87421ca12db6e01ded9dcd6dcc00e1aa7b745ab1b40610282f2fec45b
MD5 75df25c0b375d8de216400a32ee62795
BLAKE2b-256 04779f5df24f92df358e2230d80dcab150dd4528eadd45f528b46b289e6a7529

See more details on using hashes here.

Provenance

The following attestation bundles were made for wasm_cli-0.10.5-py3-none-any.whl:

Publisher: release.yml on Perkybeet/wasm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page