this is the existing python atlasserver, replacement to docsend
  • JavaScript 80.7%
  • Python 8.9%
  • HTML 7.8%
  • CSS 1.6%
  • Shell 0.6%
  • Other 0.3%
Find a file
Jan De Landtsheer 15812c96f6
docs: add rsync site deployment section to README
Document the end-to-end CI/CD flow for pushing built static sites
into the running container via the built-in rsync daemon.
2026-02-26 16:09:34 +01:00
.claude ... 2025-12-08 16:54:18 +01:00
cfg_template chore: use ${HOME} instead of ~ for sites_dir path 2025-12-08 21:34:53 +01:00
content ... 2025-12-08 16:54:18 +01:00
docker fix: add git-lfs to Docker image for LFS-tracked files 2025-12-17 17:37:21 +01:00
docs init 2025-12-08 14:12:32 +01:00
filewidget init 2025-12-08 14:12:32 +01:00
specs init 2025-12-08 14:12:32 +01:00
src fix: use persistent volume for git content clone 2025-12-17 17:46:43 +01:00
static fix: handle corrupted PDF cache when server returns 304 2025-12-17 17:11:47 +01:00
templates ... 2025-12-11 09:30:08 +01:00
.dockerignore docker 2025-12-08 16:01:03 +01:00
.gitattributes Add Git LFS tracking for documents and images 2025-12-08 14:10:26 +01:00
.gitignore ... 2025-12-08 16:54:18 +01:00
install.sh ... 2025-12-08 18:03:43 +01:00
pipenv.sh ... 2025-12-11 08:43:54 +01:00
pyproject.toml ... 2025-12-08 16:54:18 +01:00
README.md docs: add rsync site deployment section to README 2026-02-26 16:09:34 +01:00
start_server.sh ... 2025-12-11 08:43:54 +01:00
start_server_debug.sh ... 2025-12-11 08:43:54 +01:00
uv.lock ... 2025-12-08 16:54:18 +01:00

knowledgecenter

Installation & Setup

to test as docker

docker run -p 9922:9922 -v /path/to/content:/content -e ATLAS_CONTENT_PATH=/content atlasserver:latest

to run natively

export ATLAS_CONTENT_PATH="${HOME}/code/forge.ourworld.tf/forge.ourworld.tf/ourworld/atlas_ourworld"
${HOME}/code/forge.ourworld.tf/lhumina_research/atlasserver/start_server_debug.sh

First Time Setup

./install.sh

This will:

  • Install uv if not present
  • Create a Python virtual environment
  • Install all dependencies from pyproject.toml
  • Use local herolib if available at ~/code/forge.ourworld.tf/lhumina_research/herolib_python

Force Update herolib

If you need to update to the latest herolib from git (e.g., after upstream changes):

./install.sh --force

This forces a clean reinstall of herolib from the git repository, bypassing the cache.

Starting the Server

Production mode:

./start_server.sh

Server runs on port 9922 at http://localhost:9922

Development mode:

./start_server_debug.sh

Runs with debug mode enabled and auto-reload on code changes.

ngrok

to be able to test on own environment

ngrok login
ngrok http 9022

it lets me expose a local development server to the internet, which is useful for testing webhooks and other integrations.

example url https://e68c72dd903a.ngrok-free.app = ngrok url

then go e.g. to https://e68c72dd903a.ngrok-free.app/info/welcome

now we can test the registration flow

now put your ngrok URL in cfg/dev.toml

to start in development mode do start_server_debug.sh

Rsync Site Deployment (CI/CD)

Atlas Server includes a built-in rsync daemon that allows Forgejo CI pipelines to push built static sites directly into the running container. No restart required — Flask picks up the new files immediately.

How it works

Forgejo CI (website repo)
    │
    │  git push triggers CI build
    │
    ▼
CI runner builds static site
    │
    │  rsync -avz --port=8873 ...
    │    ./dist/ atlas@server::sites/
    │
    ▼
Atlas Server container (port 8873)
    │
    │  rsync daemon writes to ~/hero/www/info/
    │
    ▼
Flask app (port 9922)
    │
    │  [[sites]] path = "${HOME}/hero/www/info"
    │
    ▼
Users browse the site

Server-side configuration

Enable rsync in your content repo's TOML config (e.g. cfg/prod.toml):

[rsync]
enabled = true
secret = "your-secret-password"
port = 8873
sites_dir = "${HOME}/hero/www/info"

The rsync secret is stored in the TOML config file. At container startup, start_rsync.py reads this config and starts an rsync daemon on port 8873 with the configured credentials.

When running the container, expose the rsync port alongside the web port:

docker run -p 9922:9922 -p 8873:8873 \
  -e ATLAS_CONTENT_GITURL=git@forge.ourworld.tf:ourworld/atlas_ourworld.git \
  -e ATLAS_GIT_DEPLOY_KEY="${ATLAS_GIT_DEPLOY_KEY}" \
  atlasserver:latest

CI-side: pushing sites

In your Forgejo CI pipeline, after building the site:

echo "your-secret-password" > /tmp/rsync-password
chmod 600 /tmp/rsync-password

rsync -avz --port=8873 --delete \
  --password-file=/tmp/rsync-password \
  /path/to/built/sites/ \
  atlas@your-server.com::sites/

rm /tmp/rsync-password
  • atlas@ — the rsync user (hardcoded in the daemon config)
  • ::sites/ — the rsync module name
  • --delete — removes files on the server that no longer exist in the build output

Registering sites in the config

Synced sites land in sites_dir. Reference them in the TOML config so Flask serves them:

[[sites]]
path = "${HOME}/hero/www/info/mysite"
name = "mysite"

[[sites]]
path = "${HOME}/hero/www/info/docs"
name = "docs"

python tips

import pudb; pudb.set_trace()