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

OBS Build Status PyPI Version Python Version License GitHub Stars PyPI Downloads GitHub Issues

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 OBS Repository (Recommended)

# Add repository key
curl -fsSL https://download.opensuse.org/repositories/home:/Perkybeet/xUbuntu_24.04/Release.key | \
  gpg --dearmor | sudo tee /usr/share/keyrings/wasm.gpg > /dev/null

# Add repository (Ubuntu 24.04)
echo 'deb [signed-by=/usr/share/keyrings/wasm.gpg] https://download.opensuse.org/repositories/home:/Perkybeet/xUbuntu_24.04/ /' | \
  sudo tee /etc/apt/sources.list.d/wasm.list

# Install
sudo apt update
sudo apt install wasm

Supported Ubuntu versions:

  • Ubuntu 22.04 LTS (Jammy Jellyfish)
  • Ubuntu 24.04 LTS (Noble Numbat)

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/Perkybeet/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 and upload to OBS (all distributions)
make obs-upload

# Check OBS build status
make obs-status

For detailed information about building and uploading to OBS, see docs/OBS_SETUP.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.11.4.tar.gz (1.6 MB 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.11.4-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wasm_cli-0.11.4.tar.gz
Algorithm Hash digest
SHA256 110c6602a3a563352b281fab207112698d61ec53d71d451e9c5a245e82ee4510
MD5 382c4c08ff3938d65fda0e81a8436918
BLAKE2b-256 600c171ffd79c2b682db3b2fab5d7b2e58d7def9d86e3c5866ed2065e6f2332b

See more details on using hashes here.

Provenance

The following attestation bundles were made for wasm_cli-0.11.4.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.11.4-py3-none-any.whl.

File metadata

  • Download URL: wasm_cli-0.11.4-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • 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.11.4-py3-none-any.whl
Algorithm Hash digest
SHA256 53f3e7e4dec61cab1764096bc09b7c8734d73f57260c3a5390ef3d7477e740b1
MD5 aa65a5d68afe8e38b142a9ae6fab0f1a
BLAKE2b-256 c53a41c36ccec07c947ef485362ed8fd736d6563b3afb8e64656da934b37e409

See more details on using hashes here.

Provenance

The following attestation bundles were made for wasm_cli-0.11.4-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