Skip to content

asharahmed/website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

246 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Website

Static site + status portal.

This repo contains:

  • The web root content served by Nginx.
  • A /status portal with system metrics and service health.
  • Ops assets (systemd units, metrics script, Docker option).

Screenshot

Home

Home preview

Status

Status preview

Step-by-step setup (host install)

  1. Clone the repo on the server.
  2. Run the ops installer:
sudo ./ops/install.sh
  1. Ensure Nginx serves /var/www/html and has a stub_status endpoint:
location = /status/nginx {
    stub_status;
    access_log off;
}
  1. Validate Nginx:
sudo nginx -t
  1. Visit /status.

Step-by-step setup (hybrid Docker)

This runs the static site in a container while metrics stay on the host.

  1. Run the host install first (metrics + web root):
sudo ./ops/install.sh
  1. Start the container:
make status-up
  1. Configure host Nginx to proxy / to the container:
sudo ./ops/docker/proxy-install.sh
  1. Validate Nginx:
sudo nginx -t
  1. Visit /status.

Deploy

Run:

./scripts/deploy.sh

This syncs the repo contents to /var/www/html. The deploy excludes status/metrics.json so host metrics aren't wiped.

Pipeline

Run CI checks and deploy in one step:

./scripts/pipeline.sh

To bypass git safety checks during deploy:

./scripts/deploy.sh --force

GitHub Actions Deploy

On pushes:

  • beta: deploys to the beta host only.
  • main: deploys to production, then attempts a clean merge into beta; if clean, deploys beta.

The workflow:

  • Runs linting, link checks, and Playwright smoke tests.
  • Syncs runtime files to the server via rsync (non-runtime files excluded).
  • Runs a lightweight uptime check on / and /status/.
  • Runs a server-side health check to validate /var/www/html/status/metrics.json.

Required secrets:

  • DEPLOY_HOST, DEPLOY_USER, DEPLOY_KEY_B64 (beta)
  • PROD_DEPLOY_KEY_B64 (prod)

On pull requests, a dry-run rsync preview is executed.

Branch Protection (Recommended)

Use GitHub branch protection on main with required status checks for:

  • Lint (HTML/CSS)
  • Link check
  • Playwright smoke tests

This prevents untested changes from reaching deploy.

Local Development

Quick Start (Docker)

Run the site locally with mock metrics (no production dependencies required):

docker compose -f docker-compose.dev.yml up

Access at http://localhost:8080

For live-updating mock metrics (simulates real server behavior):

docker compose -f docker-compose.dev.yml --profile live up

Quick Start (Python)

Serve files directly without Docker:

python3 -m http.server 8080

Note: Status page metrics won't update without the metrics generator.

Running Tests

Install dev tooling:

npm install

Run checks:

npm run lint:html
npm run lint:css
npm run lint:vibe
npm run test:links
npm run test:e2e

Operations

  • Metrics generator: /usr/local/bin/status-metrics.sh
  • Timer: status-metrics.timer (10-second interval)
  • Metrics JSON: /var/www/html/status/metrics.json
  • Status UI: /status
  • Nginx stub_status: /status/nginx

Docker (Optional)

Hybrid container setup lives in ops/docker. See ops/docker/README.md.

About

A personal website + status portal.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •