Home page for monoexp.com. Showcase linking to different projects.

bajdev 584ff50a6d Merge branch 'feature/canonical-and-setup-fixes' of bajdev/home into main 2 時間 前
nginx 4d461fa58f Add static home page, nginx vhost and setup README 13 時間 前
public 221dee17c1 Add a canonical URL and fix two setup steps 2 時間 前
pull-releases 221dee17c1 Add a canonical URL and fix two setup steps 2 時間 前
LICENSE ce3a92c4bd Initial commit 15 時間 前
README.md 221dee17c1 Add a canonical URL and fix two setup steps 2 時間 前

README.md

home

Home page for monoexp.com. Showcase linking to different projects.

Plain HTML and CSS, no build step and no JavaScript.

Layout

public/            what gets deployed (the site root)
  index.html       the page: about section, then project cards
  style.css        all styles, light and dark via prefers-color-scheme
  favicon.svg
nginx/
  monoexp.com.conf reference copy of the server's vhost file
pull-releases/     one record per pull request, with screenshots

Adding a project

Copy one <li class="project"> block in public/index.html and change:

  • the title in <h3>
  • the tag (language or kind), e.g. Go
  • the one- or two-sentence description
  • the Visit link to https://<name>.monoexp.com/ (leave it out for source-only projects)
  • the Source link to https://git.monoexp.com/bajdev/<repo>

Open a PR; merging it deploys the page automatically (the site is on the merge-to-deploy pipeline).

Hosting

Canonical URL https://monoexp.com
www.monoexp.com 301 redirect to the apex
Site root /srv/www/vhosts/monoexp.com
nginx file /etc/nginx/vhosts.d/monoexp.com.conf
Certificate monoexp-home (covers monoexp.com and www.monoexp.com)

DNS needs no change: the @ and * A records at Hover already point here.

First-time setup (as the Admin over SSH)

  1. Certificate. The issue-cert wrapper only accepts subdomains, so the apex goes through certbot directly:

    sudo certbot certonly --webroot -w /srv/www/acme --cert-name monoexp-home \
     -d monoexp.com -d www.monoexp.com --deploy-hook 'systemctl reload nginx'
    

Port 80 already serves /.well-known/acme-challenge/ for every .monoexp.com name, the apex included.

  1. Site folder and first deploy.

Create the folder group-writable. It inherits the webops group from /srv/www/vhosts, and mode 2775 lets every webops member, Claude included, write to it:

   mkdir -m 2775 /srv/www/vhosts/monoexp.com

Then do the first deploy, either yourself:

   git clone https://git.monoexp.com/bajdev/home.git ~/src/home
   rsync -a --delete ~/src/home/public/ /srv/www/vhosts/monoexp.com/

The clone uses HTTPS because the repo is public, so no SSH key is needed.

or by asking Claude, which runs this from its own account:

   rsync -rlt -O --delete ~/src/home/public/ /srv/www/vhosts/monoexp.com/

That's deploy-static without the parts that need to own the folder: -rlt -O copies files and links with their times, but never tries to change the folder's own permissions or timestamp, which only its owner (the Admin) can do. Plain deploy-static uses rsync -a, which would copy the files and then fail on the folder.

Pick one, not both: whoever deploys first owns the files, and the other account then can't update them. Merge-to-deploy hands them to the deploy user afterwards either way.

  1. nginx.

    sudo install -o root -g root -m 644 ~/src/home/nginx/monoexp.com.conf /etc/nginx/vhosts.d/
    sudo nginx -t && sudo systemctl reload nginx
    
  2. Check.

    curl -sI https://monoexp.com | head -1          # HTTP/2 200
    curl -sI https://www.monoexp.com | grep -i location   # https://monoexp.com/
    curl -sI http://monoexp.com | grep -i location        # https://monoexp.com/
    

Merge-to-deploy

Same steps as any other site on the pipeline (see the VPS setup plan, Phase 7):

  1. In bajdev/devops, add bajdev/home to sites.json through a PR, as a static site:

    "bajdev/home": { "kind": "static", "host": "monoexp.com" }
    

A static site publishes the repo's public/ folder by default. To publish a different folder, add "dir": "<folder>". Merge, then reinstall the file: sudo install -o root -g root -m 644 sites.json /etc/deployd/sites.json

  1. Hand the deployed files to the deploy user: sudo chown -R deploy /srv/www/vhosts/monoexp.com
  2. In Gogs, on bajdev/home: add deploy (and claude, if Claude will work on it) as Write collaborators, turn on branch protection for main, and add a webhook: payload URL http://127.0.0.1:9000/deploy, content type application/json, the secret from /etc/deployd/secret.env, and only the Pull Request event.
  3. Merge a small test PR and check for a deploy/… tag and a line in /var/log/deploys.log.