chessbaseLinux/website
vrubelroman c8e33e4ecd
Some checks are pending
CI / macos-build (push) Waiting to run
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
Website deploy: run the image tagged current, so plain compose commands work on the server
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 11:15:37 +03:00
..
deploy Website deploy: run the image tagged current, so plain compose commands work on the server 2026-10-19 11:15:37 +03:00
docker Website container: own the mounted data/, run as an unprivileged user; health start period 2026-10-19 11:11:32 +03:00
server Website: one page in six languages, downloads via the server, download statistics 2026-10-19 11:00:10 +03:00
shots Website: one page in six languages, downloads via the server, download statistics 2026-10-19 11:00:10 +03:00
site Website: one page in six languages, downloads via the server, download statistics 2026-10-19 11:00:10 +03:00
static Website: one page in six languages, downloads via the server, download statistics 2026-10-19 11:00:10 +03:00
.dockerignore Website: one page in six languages, downloads via the server, download statistics 2026-10-19 11:00:10 +03:00
.env.example Website: production compose (port 8140) and deploy script with rollback 2026-10-19 11:12:41 +03:00
.gitignore Website: one page in six languages, downloads via the server, download statistics 2026-10-19 11:00:10 +03:00
docker-compose.yml Website: one page in six languages, downloads via the server, download statistics 2026-10-19 11:00:10 +03:00
Dockerfile Website container: own the mounted data/, run as an unprivileged user; health start period 2026-10-19 11:11:32 +03:00
README.md Website: one page in six languages, downloads via the server, download statistics 2026-10-19 11:00:10 +03:00

ChessPenguin website

One page in six languages (/, /ru/, /fr/, /de/, /es/, /it/), downloads that go through this server to the latest GitHub release, and download statistics at /stats. Internal: kept in Forgejo only (excluded from the GitHub mirror by scripts/publish-github.sh).

Run

cp .env.example .env      # set SITE_URL, STATS_PASSWORD, TZ
docker compose up -d --build

The server listens on 127.0.0.1:${HOST_PORT} (8080). data/ keeps the statistics (downloads.sqlite) and the geolocation databases, which the container downloads on start when they are missing or older than 35 days (DB-IP Lite City, CC BY 4.0; the footer credits DB-IP as the licence requires). Update the site: git pull && docker compose up -d --build.

nginx

server {
    listen 443 ssl;
    http2 on;
    server_name chesspenguin.example.org;
    # ssl_certificate ...; ssl_certificate_key ...;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

The visitor address is read from X-Forwarded-For / X-Real-IP (TRUST_PROXY=1) only to look up the country, region and city; the address itself is never stored.

Downloads

/download/<platform> (windows, macos, deb, rpm, arch, appimage, flatpak, tarball, checksums) records the download and answers with a redirect to the asset of the latest release, so the browser starts downloading at once and the visitor stays on the site. The release list is cached for 10 minutes; a new GitHub release appears on the site by itself. If GitHub is unreachable, the link leads to the releases page.

Statistics

/stats (basic auth STATS_USER / STATS_PASSWORD): totals for today, 7 and 30 days and all time, by platform, version, country, region and city, language, a 30-day chart and the latest downloads. /stats.csv exports every row. Each row: UTC time, platform, version, file, country, region, city, page language, referrer host.

Development

cd server && cargo build
STATIC_DIR=../static SITE_DIR=../site DB_PATH=../data-dev/d.sqlite \
  GEOIP_DB=../data-dev/dbip-city-ipv4.mmdb STATS_PASSWORD=secret PORT=18080 \
  target/debug/chesspenguin-site

Texts: site/index.html (template), site/i18n/<lang>.json (English is the fallback for a missing key); translations are loaded at start, so restart after editing.

Screenshots: shots/make-screenshots.sh takes them with the release build of the app and its dev hooks (docs/dev/desktop.md) into shots/raw/ (not committed), then python3 -I shots/derive.py makes the WebP/JPEG/PNG sizes and static/og-image.png. The games are public domain with our own comments; the large database appears only as a table of game data under a neutral name, never with its annotations.