mirror of
https://github.com/TheRealOwenRees/chess-endgame-trainer.git
synced 2026-11-18 11:42:07 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8897fa5ae | ||
|
|
73ba25afe3 | ||
|
|
be57f21729
|
||
|
|
ee687dfb2d
|
||
|
|
fa90e1102d
|
@@ -4,6 +4,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -21,7 +22,7 @@ jobs:
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:18.0
|
image: postgres:18.6
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
@@ -34,10 +35,10 @@ jobs:
|
|||||||
--health-retries 10
|
--health-retries 10
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
|
||||||
- uses: jdx/mise-action@v2
|
- uses: jdx/mise-action@b44d12e7d0d8ee7461bb893e1b1993500433185b #v5.2.7
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
deps
|
deps
|
||||||
@@ -66,10 +67,10 @@ jobs:
|
|||||||
SES_SECRET_ACCESS_KEY: build
|
SES_SECRET_ACCESS_KEY: build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v7
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
|
||||||
- uses: jdx/mise-action@v2
|
- uses: jdx/mise-action@b44d12e7d0d8ee7461bb893e1b1993500433185b #v5.2.7
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
deps
|
deps
|
||||||
@@ -94,3 +95,43 @@ jobs:
|
|||||||
name: chesstrainer-release
|
name: chesstrainer-release
|
||||||
path: chesstrainer-release.tar.gz
|
path: chesstrainer-release.tar.gz
|
||||||
retention-days: 7
|
retention-days: 7
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Deploy
|
||||||
|
needs: build-release
|
||||||
|
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
environment: production
|
||||||
|
concurrency:
|
||||||
|
group: production
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 #v8.0.2
|
||||||
|
with:
|
||||||
|
name: chesstrainer-release
|
||||||
|
|
||||||
|
- name: Install SSH key
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
printf '%s\n' "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
printf '%s\n' "${{ secrets.VPS_KNOWN_HOSTS }}" > ~/.ssh/known_hosts
|
||||||
|
chmod 644 ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
- name: Upload release
|
||||||
|
run: |
|
||||||
|
scp -i ~/.ssh/id_ed25519 -o BatchMode=yes \
|
||||||
|
chesstrainer-release.tar.gz \
|
||||||
|
"${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}:/tmp/chesstrainer-release.tar.gz"
|
||||||
|
|
||||||
|
- name: Activate release
|
||||||
|
run: |
|
||||||
|
ssh -i ~/.ssh/id_ed25519 -o BatchMode=yes \
|
||||||
|
"${{ secrets.VPS_USER }}@${{ secrets.VPS_HOST }}" \
|
||||||
|
'sudo -n /opt/chesstrainer/src/deploy/activate /tmp/chesstrainer-release.tar.gz'
|
||||||
|
|
||||||
|
- name: Public smoke test
|
||||||
|
run: |
|
||||||
|
curl -fsS https://innersquare.app/health
|
||||||
|
curl -fsS -o /dev/null https://innersquare.app/
|
||||||
|
|||||||
@@ -21,6 +21,10 @@ mix tablebase.fetch --path /path/to/syzygy/3-4-5 # once per host (~939 MB)
|
|||||||
export TABLEBASE_PATH=/path/to/syzygy/3-4-5 # set per environment
|
export TABLEBASE_PATH=/path/to/syzygy/3-4-5 # set per environment
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On the production VPS the directory is `/opt/chesstrainer/tablebases`, owned by
|
||||||
|
the `chesstrainer` user. Set `TABLEBASE_PATH` in `/etc/chesstrainer/env` and
|
||||||
|
restart the service; the value is read at boot.
|
||||||
|
|
||||||
See [docs/tablebases.md](docs/tablebases.md) for the full reference — dev vs
|
See [docs/tablebases.md](docs/tablebases.md) for the full reference — dev vs
|
||||||
VPS paths, `mix tablebase.check`, and boot logging.
|
VPS paths, `mix tablebase.check`, and boot logging.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,105 @@
|
|||||||
|
// Cookieless Matomo for anonymous public pages. The server only renders the
|
||||||
|
// #matomo-config element for anonymous visitors, so account and admin pages
|
||||||
|
// never load a tracker.
|
||||||
|
|
||||||
|
const OPT_OUT_KEY = "matomo_optout";
|
||||||
|
|
||||||
|
export function isOptedOut() {
|
||||||
|
try {
|
||||||
|
return localStorage.getItem(OPT_OUT_KEY) === "1";
|
||||||
|
} catch (_error) {
|
||||||
|
// If storage is unavailable we cannot remember an opt-out. Fail closed.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function setOptedOut(optedOut) {
|
||||||
|
try {
|
||||||
|
if (optedOut) {
|
||||||
|
localStorage.setItem(OPT_OUT_KEY, "1");
|
||||||
|
} else {
|
||||||
|
localStorage.removeItem(OPT_OUT_KEY);
|
||||||
|
}
|
||||||
|
} catch (_error) {
|
||||||
|
// Nothing else to do; the current page remains untracked.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateUI() {
|
||||||
|
const optOutButton = document.getElementById("analytics-opt-out");
|
||||||
|
const optInButton = document.getElementById("analytics-opt-in");
|
||||||
|
const status = document.getElementById("analytics-status");
|
||||||
|
|
||||||
|
if (!optOutButton && !optInButton && !status) return;
|
||||||
|
|
||||||
|
const optedOut = isOptedOut();
|
||||||
|
|
||||||
|
if (optOutButton) optOutButton.hidden = optedOut;
|
||||||
|
if (optInButton) optInButton.hidden = !optedOut;
|
||||||
|
if (status) {
|
||||||
|
status.textContent = optedOut
|
||||||
|
? "Analytics is currently off in this browser."
|
||||||
|
: "Analytics is currently on in this browser.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isPrivatePath() {
|
||||||
|
return window.location.pathname.startsWith("/admin");
|
||||||
|
}
|
||||||
|
|
||||||
|
function trackPageView() {
|
||||||
|
if (isPrivatePath() || isOptedOut() || !window._paq) return;
|
||||||
|
|
||||||
|
window._paq.push(["setCustomUrl", window.location.href]);
|
||||||
|
window._paq.push(["trackPageView"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadTracker() {
|
||||||
|
const config = document.getElementById("matomo-config");
|
||||||
|
if (!config || isPrivatePath() || isOptedOut()) return;
|
||||||
|
|
||||||
|
const url = config.dataset.url;
|
||||||
|
const siteId = config.dataset.siteId;
|
||||||
|
if (!url || !siteId) return;
|
||||||
|
|
||||||
|
const _paq = (window._paq = window._paq || []);
|
||||||
|
_paq.push(["disableCookies"]);
|
||||||
|
_paq.push(["setDoNotTrack", true]);
|
||||||
|
_paq.push(["trackPageView"]);
|
||||||
|
_paq.push(["setTrackerUrl", `${url}matomo.php`]);
|
||||||
|
_paq.push(["setSiteId", siteId]);
|
||||||
|
|
||||||
|
const script = document.createElement("script");
|
||||||
|
script.async = true;
|
||||||
|
script.src = `${url}matomo.js`;
|
||||||
|
document.head.appendChild(script);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleClick(event) {
|
||||||
|
const target = event.target instanceof Element ? event.target : null;
|
||||||
|
if (!target) return;
|
||||||
|
|
||||||
|
if (target.closest("#analytics-opt-out")) {
|
||||||
|
event.preventDefault();
|
||||||
|
setOptedOut(true);
|
||||||
|
updateUI();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target.closest("#analytics-opt-in")) {
|
||||||
|
event.preventDefault();
|
||||||
|
setOptedOut(false);
|
||||||
|
// The tracker was not loaded while opted out. Reload to start it.
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function initAnalytics() {
|
||||||
|
if (window.__matomoInitialised) return;
|
||||||
|
window.__matomoInitialised = true;
|
||||||
|
|
||||||
|
loadTracker();
|
||||||
|
window.addEventListener("phx:navigate", trackPageView);
|
||||||
|
document.addEventListener("click", handleClick);
|
||||||
|
updateUI();
|
||||||
|
}
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
import "phoenix_html";
|
import "phoenix_html";
|
||||||
// Plain-DOM mobile navigation (works on controller and LiveView pages).
|
// Plain-DOM mobile navigation (works on controller and LiveView pages).
|
||||||
import "./nav";
|
import "./nav";
|
||||||
|
// Cookieless Matomo for anonymous public pages.
|
||||||
|
import { initAnalytics } from "./analytics";
|
||||||
// Establish Phoenix Socket and LiveView configuration.
|
// Establish Phoenix Socket and LiveView configuration.
|
||||||
import { Socket } from "phoenix";
|
import { Socket } from "phoenix";
|
||||||
import { LiveSocket } from "phoenix_live_view";
|
import { LiveSocket } from "phoenix_live_view";
|
||||||
@@ -58,6 +60,8 @@ liveSocket.connect();
|
|||||||
// >> liveSocket.disableLatencySim()
|
// >> liveSocket.disableLatencySim()
|
||||||
window.liveSocket = liveSocket;
|
window.liveSocket = liveSocket;
|
||||||
|
|
||||||
|
initAnalytics();
|
||||||
|
|
||||||
// The lines below enable quality of life phoenix_live_reload
|
// The lines below enable quality of life phoenix_live_reload
|
||||||
// development features:
|
// development features:
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -2,3 +2,6 @@
|
|||||||
// page. Keep this small: no Phoenix Socket, LiveView, hooks, or topbar.
|
// page. Keep this small: no Phoenix Socket, LiveView, hooks, or topbar.
|
||||||
import "phoenix_html";
|
import "phoenix_html";
|
||||||
import "./nav";
|
import "./nav";
|
||||||
|
import { initAnalytics } from "./analytics";
|
||||||
|
|
||||||
|
initAnalytics();
|
||||||
|
|||||||
@@ -121,6 +121,10 @@ if config_env() == :prod do
|
|||||||
System.get_env("SES_SECRET_ACCESS_KEY") ||
|
System.get_env("SES_SECRET_ACCESS_KEY") ||
|
||||||
raise("environment variable SES_SECRET_ACCESS_KEY is missing")
|
raise("environment variable SES_SECRET_ACCESS_KEY is missing")
|
||||||
|
|
||||||
|
config :chesstrainer, :matomo,
|
||||||
|
url: System.get_env("MATOMO_URL"),
|
||||||
|
site_id: System.get_env("MATOMO_SITE_ID")
|
||||||
|
|
||||||
config :chesstrainer, Chesstrainer.Repo,
|
config :chesstrainer, Chesstrainer.Repo,
|
||||||
# ssl: true,
|
# ssl: true,
|
||||||
url: database_url,
|
url: database_url,
|
||||||
|
|||||||
+128
-4
@@ -19,7 +19,7 @@ Internet
|
|||||||
| Elixir | 1.19.5-otp-28 |
|
| Elixir | 1.19.5-otp-28 |
|
||||||
| Rust | 1.98.1 |
|
| Rust | 1.98.1 |
|
||||||
| Node.js | 24 (asset build only) |
|
| Node.js | 24 (asset build only) |
|
||||||
| Postgres | `postgres:18.0`, pinned directly in the unified compose |
|
| Postgres | `postgres:18.6`, pinned directly in the unified compose |
|
||||||
| Caddy | 2.11.9 |
|
| Caddy | 2.11.9 |
|
||||||
| Docker | 29.9.3 |
|
| Docker | 29.9.3 |
|
||||||
| Docker Compose | v5.7.0 |
|
| Docker Compose | v5.7.0 |
|
||||||
@@ -137,14 +137,23 @@ SES_SECRET_ACCESS_KEY=...
|
|||||||
MATOMO_URL=https://analytics.owenrees.eu/
|
MATOMO_URL=https://analytics.owenrees.eu/
|
||||||
MATOMO_SITE_ID=6
|
MATOMO_SITE_ID=6
|
||||||
|
|
||||||
|
TABLEBASE_PATH=/opt/chesstrainer/tablebases
|
||||||
|
|
||||||
# Optional:
|
# Optional:
|
||||||
# TABLEBASE_PATH=/path/to/syzygy
|
|
||||||
# RELEASE_COOKIE=...
|
# RELEASE_COOKIE=...
|
||||||
```
|
```
|
||||||
|
|
||||||
The production endpoint binds to `127.0.0.1` only. Caddy is the public
|
The production endpoint binds to `127.0.0.1` only. Caddy is the public
|
||||||
entry point.
|
entry point.
|
||||||
|
|
||||||
|
## Matomo analytics
|
||||||
|
|
||||||
|
Set `MATOMO_URL` and `MATOMO_SITE_ID` to enable cookieless analytics on public
|
||||||
|
pages and the guest trainer. Signed-in account and admin pages are excluded.
|
||||||
|
|
||||||
|
The privacy controls, Matomo server settings, retention, and opt-out behaviour
|
||||||
|
are documented in `docs/analytics.md`.
|
||||||
|
|
||||||
Generate the two secrets:
|
Generate the two secrets:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -191,6 +200,49 @@ volumes:
|
|||||||
- chesstrainer_pgdata:/var/lib/postgresql
|
- chesstrainer_pgdata:/var/lib/postgresql
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Local tablebases (optional)
|
||||||
|
|
||||||
|
The production tablebase directory is `/opt/chesstrainer/tablebases`. Keep the
|
||||||
|
`.rtbw`/`.rtbz` files flat in that directory, and make sure the `chesstrainer`
|
||||||
|
user can read them:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo install -d -o chesstrainer -g chesstrainer /opt/chesstrainer/tablebases
|
||||||
|
sudo chown -R chesstrainer:chesstrainer /opt/chesstrainer/tablebases
|
||||||
|
sudo chmod -R u=rwX,g=rX,o= /opt/chesstrainer/tablebases
|
||||||
|
```
|
||||||
|
|
||||||
|
Set the path in `/etc/chesstrainer/env`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
TABLEBASE_PATH=/opt/chesstrainer/tablebases
|
||||||
|
```
|
||||||
|
|
||||||
|
Then restart the service, because `TABLEBASE_PATH` is read at boot:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo systemctl restart chesstrainer
|
||||||
|
```
|
||||||
|
|
||||||
|
Check `/health`. It should move from `degraded` / `not_configured` to
|
||||||
|
`ok` / `local`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -s http://127.0.0.1:4100/health
|
||||||
|
sudo journalctl -u chesstrainer -n 50 --no-pager | grep -i tablebase
|
||||||
|
```
|
||||||
|
|
||||||
|
If the path is missing, unreadable, or empty, the app falls back to Lichess and
|
||||||
|
health stays `degraded` but still returns 200.
|
||||||
|
|
||||||
|
To refresh the files:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mix tablebase.fetch --path /opt/chesstrainer/tablebases
|
||||||
|
sudo chown -R chesstrainer:chesstrainer /opt/chesstrainer/tablebases
|
||||||
|
sudo systemctl restart chesstrainer
|
||||||
|
```
|
||||||
|
|
||||||
## First-time setup
|
## First-time setup
|
||||||
|
|
||||||
Run as root or with sudo:
|
Run as root or with sudo:
|
||||||
@@ -223,13 +275,13 @@ Add the `chesstrainer-db` service and `chesstrainer_pgdata` volume from
|
|||||||
The image is pinned directly in the unified compose:
|
The image is pinned directly in the unified compose:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
image: postgres:18.0
|
image: postgres:18.6
|
||||||
```
|
```
|
||||||
|
|
||||||
For an immutable pin, replace it with the exact digest:
|
For an immutable pin, replace it with the exact digest:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
image: postgres:18.0@sha256:...
|
image: postgres:18.6@sha256:...
|
||||||
```
|
```
|
||||||
|
|
||||||
There is no `POSTGRES_IMAGE` environment variable involved.
|
There is no `POSTGRES_IMAGE` environment variable involved.
|
||||||
@@ -383,6 +435,78 @@ KEEP_RELEASES=5 \
|
|||||||
sudo -E /opt/chesstrainer/src/deploy/activate /tmp/chesstrainer-release.tar.gz
|
sudo -E /opt/chesstrainer/src/deploy/activate /tmp/chesstrainer-release.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## GitHub Actions CD
|
||||||
|
|
||||||
|
Merging to `main` (or running the workflow manually) tests, builds, uploads,
|
||||||
|
and deploys the release. The deploy job uses SSH as `owen`.
|
||||||
|
|
||||||
|
### Deploy key
|
||||||
|
|
||||||
|
Generate a dedicated key, not your personal one:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh-keygen -t ed25519 -C "github-actions-chesstrainer" \
|
||||||
|
-f ~/.ssh/chesstrainer_deploy -N ""
|
||||||
|
ssh-copy-id -i ~/.ssh/chesstrainer_deploy.pub owen@<VPS_HOST>
|
||||||
|
```
|
||||||
|
|
||||||
|
`VPS_HOST` must be the public IP or DNS name reachable from GitHub. Do not use
|
||||||
|
a local SSH alias such as `personal-projects`.
|
||||||
|
|
||||||
|
### Passwordless sudo for the deploy scripts
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo visudo -f /etc/sudoers.d/chesstrainer-deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
```text
|
||||||
|
owen ALL=(root) NOPASSWD: /opt/chesstrainer/src/deploy/activate, /opt/chesstrainer/src/deploy/rollback
|
||||||
|
```
|
||||||
|
|
||||||
|
Validate:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo chown root:root /etc/sudoers.d/chesstrainer-deploy
|
||||||
|
sudo chmod 0440 /etc/sudoers.d/chesstrainer-deploy
|
||||||
|
sudo visudo -c
|
||||||
|
sudo -n -l /opt/chesstrainer/src/deploy/activate
|
||||||
|
sudo -n -l /opt/chesstrainer/src/deploy/rollback
|
||||||
|
```
|
||||||
|
|
||||||
|
### GitHub environment
|
||||||
|
|
||||||
|
Create the **production** environment, optionally with required reviewers, and
|
||||||
|
add environment secrets:
|
||||||
|
|
||||||
|
| Secret | Value |
|
||||||
|
|---|---|
|
||||||
|
| `VPS_HOST` | public VPS IP or DNS name |
|
||||||
|
| `VPS_USER` | `owen` |
|
||||||
|
| `VPS_SSH_KEY` | private deploy key |
|
||||||
|
| `VPS_KNOWN_HOSTS` | `ssh-keyscan -H <VPS_HOST>` output |
|
||||||
|
|
||||||
|
Generate known_hosts with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ssh-keyscan -H <VPS_HOST>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Workflow
|
||||||
|
|
||||||
|
The workflow:
|
||||||
|
|
||||||
|
1. Runs `mix precommit` against Postgres.
|
||||||
|
2. Builds the release artifact on `ubuntu-24.04`.
|
||||||
|
3. On `main` or `workflow_dispatch`, uploads the tarball, installs the SSH key,
|
||||||
|
runs `sudo -n .../activate`, and performs public smoke checks.
|
||||||
|
4. A failed activation health check rolls back to the previous release.
|
||||||
|
|
||||||
|
Manual dispatch is available from the Actions UI or:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gh workflow run ci.yml --ref main
|
||||||
|
```
|
||||||
|
|
||||||
## Rollback
|
## Rollback
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|||||||
@@ -3,12 +3,12 @@
|
|||||||
#
|
#
|
||||||
# Pin the Postgres image directly in the unified file. Replace the tag with
|
# Pin the Postgres image directly in the unified file. Replace the tag with
|
||||||
# an exact digest if you want immutable image pinning:
|
# an exact digest if you want immutable image pinning:
|
||||||
# image: postgres:18.0@sha256:...
|
# image: postgres:18.6@sha256:...
|
||||||
|
|
||||||
services:
|
services:
|
||||||
chesstrainer-db:
|
chesstrainer-db:
|
||||||
container_name: chesstrainer-db
|
container_name: chesstrainer-db
|
||||||
image: postgres:18.0
|
image: postgres:18.6
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file: /etc/chesstrainer/postgres.env
|
env_file: /etc/chesstrainer/postgres.env
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ deploy/static/
|
|||||||
├── index.html # page + inline CSS; uses the app's real brand tokens
|
├── index.html # page + inline CSS; uses the app's real brand tokens
|
||||||
├── privacy.html # privacy policy, served at /privacy
|
├── privacy.html # privacy policy, served at /privacy
|
||||||
├── terms-conditions.html # terms, served at /terms-conditions
|
├── terms-conditions.html # terms, served at /terms-conditions
|
||||||
|
├── mentions-legales.html # French legal notice, served at /mentions-legales
|
||||||
├── legal.css # shared styles for the legal pages
|
├── legal.css # shared styles for the legal pages
|
||||||
├── fonts/ # DM Sans + DM Serif Display woff2 files
|
├── fonts/ # DM Sans + DM Serif Display woff2 files
|
||||||
├── favicon.ico # copied from priv/static
|
├── favicon.ico # copied from priv/static
|
||||||
@@ -17,8 +18,9 @@ deploy/static/
|
|||||||
└── README.md
|
└── README.md
|
||||||
```
|
```
|
||||||
|
|
||||||
The Caddyfile uses `try_files {path}.html {path}` so `/privacy` and
|
The Caddyfile uses `try_files {path}.html {path}` so `/privacy`,
|
||||||
`/terms-conditions` serve the matching `.html` files without a redirect.
|
`/terms-conditions`, and `/mentions-legales` serve the matching `.html` files
|
||||||
|
without a redirect.
|
||||||
|
|
||||||
## Preview locally
|
## Preview locally
|
||||||
|
|
||||||
|
|||||||
@@ -699,6 +699,7 @@
|
|||||||
<nav class="footer-links" aria-label="Legal">
|
<nav class="footer-links" aria-label="Legal">
|
||||||
<a href="/privacy">Privacy</a>
|
<a href="/privacy">Privacy</a>
|
||||||
<a href="/terms-conditions">Terms</a>
|
<a href="/terms-conditions">Terms</a>
|
||||||
|
<a href="/mentions-legales">Mentions légales</a>
|
||||||
</nav>
|
</nav>
|
||||||
<small>© 2026 Inner Square Chess</small>
|
<small>© 2026 Inner Square Chess</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -201,6 +201,28 @@ main {
|
|||||||
opacity: 0.75;
|
opacity: 0.75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.analytics-buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 12px;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.analytics-buttons button {
|
||||||
|
padding: 10px 16px;
|
||||||
|
border: 1px solid var(--color-hairline);
|
||||||
|
border-radius: 8px;
|
||||||
|
background: var(--color-canvas-raised);
|
||||||
|
color: var(--color-body);
|
||||||
|
font: inherit;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.analytics-buttons button:hover {
|
||||||
|
background: var(--color-canvas);
|
||||||
|
}
|
||||||
|
|
||||||
.site-footer {
|
.site-footer {
|
||||||
width: min(1180px, calc(100% - 48px));
|
width: min(1180px, calc(100% - 48px));
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|||||||
@@ -0,0 +1,108 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>Mentions légales — Inner Square Chess</title>
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Éditeur, hébergeur et informations légales du site Inner Square Chess."
|
||||||
|
/>
|
||||||
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
|
<meta name="theme-color" content="#f4f0e6" />
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:site_name" content="Inner Square Chess" />
|
||||||
|
<meta property="og:title" content="Mentions légales — Inner Square Chess" />
|
||||||
|
<meta
|
||||||
|
property="og:description"
|
||||||
|
content="Éditeur, hébergeur et informations légales du site Inner Square Chess."
|
||||||
|
/>
|
||||||
|
<meta name="twitter:card" content="summary" />
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
<link rel="stylesheet" href="/legal.css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<header>
|
||||||
|
<nav class="nav-wrap" aria-label="Main navigation">
|
||||||
|
<a class="brand" href="/" aria-label="Inner Square Chess home">
|
||||||
|
<span class="brand-mark" aria-hidden="true">♞</span>
|
||||||
|
<span>INNERSQUARE</span>
|
||||||
|
</a>
|
||||||
|
<span class="status">Launching soon</span>
|
||||||
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main id="main-content">
|
||||||
|
<article class="legal" lang="fr">
|
||||||
|
<h1>Mentions légales</h1>
|
||||||
|
<p class="legal-meta">Dernière mise à jour : 10 novembre 2026</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Ces mentions sont publiées en application de l'article 6-III de la loi
|
||||||
|
n° 2004-575 du 21 juin 2004 pour la confiance dans l'économie numérique.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Éditeur du site</h2>
|
||||||
|
<p>
|
||||||
|
Le site <a href="/">innersquare.app</a>, édité sous le nom commercial
|
||||||
|
« Inner Square Chess », est édité par :
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Owen REES</strong>, entrepreneur individuel (EI)</li>
|
||||||
|
<li>Adresse : [adresse à compléter]</li>
|
||||||
|
<li>SIRET : 929 553 774 00019</li>
|
||||||
|
<li>Téléphone : <a href="tel:+33683019513">+33 6 83 01 95 13</a></li>
|
||||||
|
<li>
|
||||||
|
Courriel :
|
||||||
|
<a href="mailto:support@innersquare.app">support@innersquare.app</a>
|
||||||
|
</li>
|
||||||
|
<li>TVA non applicable, article 293 B du Code général des impôts.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Directeur de la publication</h2>
|
||||||
|
<p>Owen REES.</p>
|
||||||
|
|
||||||
|
<h2>Hébergeur</h2>
|
||||||
|
<p>
|
||||||
|
Hetzner Online GmbH<br />
|
||||||
|
Industriestraße 25<br />
|
||||||
|
91710 Gunzenhausen<br />
|
||||||
|
Allemagne<br />
|
||||||
|
Téléphone : <a href="tel:+4998315050">+49 9831 505-0</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Propriété intellectuelle</h2>
|
||||||
|
<p>
|
||||||
|
Les contenus du site — textes, interface, code, éléments graphiques, ainsi
|
||||||
|
que les positions et solutions d'échecs — sont protégés par le droit
|
||||||
|
d'auteur et restent la propriété de l'éditeur ou de ses concédants. Toute
|
||||||
|
reproduction ou réutilisation non autorisée est interdite.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Données personnelles</h2>
|
||||||
|
<p>
|
||||||
|
Les données traitées, les finalités, les durées de conservation et vos
|
||||||
|
droits sont décrits dans la
|
||||||
|
<a href="/privacy">politique de confidentialité</a>, disponible en anglais.
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="site-footer">
|
||||||
|
<div class="footer-brand">
|
||||||
|
<a class="brand" href="/" aria-label="Inner Square Chess home">
|
||||||
|
<span class="brand-mark" aria-hidden="true">♞</span>
|
||||||
|
<span>INNERSQUARE</span>
|
||||||
|
</a>
|
||||||
|
<p>Short, focused endgame training.</p>
|
||||||
|
</div>
|
||||||
|
<nav class="footer-links" aria-label="Legal">
|
||||||
|
<a href="/privacy">Privacy</a>
|
||||||
|
<a href="/terms-conditions">Terms</a>
|
||||||
|
<a href="/mentions-legales">Mentions légales</a>
|
||||||
|
</nav>
|
||||||
|
<small>© 2026 Inner Square Chess</small>
|
||||||
|
</footer>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
+161
-23
@@ -36,7 +36,7 @@
|
|||||||
<main id="main-content">
|
<main id="main-content">
|
||||||
<article class="legal">
|
<article class="legal">
|
||||||
<h1>Privacy Policy</h1>
|
<h1>Privacy Policy</h1>
|
||||||
<p class="legal-meta">Last updated: 6 November 2026</p>
|
<p class="legal-meta">Last updated: 10 November 2026</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Inner Square Chess is an endgame training site. This policy explains what
|
Inner Square Chess is an endgame training site. This policy explains what
|
||||||
@@ -45,6 +45,17 @@
|
|||||||
guest trainer.
|
guest trainer.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h2>Data controller</h2>
|
||||||
|
<p>
|
||||||
|
The controller responsible for your personal information is Owen REES,
|
||||||
|
an entrepreneur individuel (EI) established in France, trading as
|
||||||
|
Inner Square Chess. Our business register number (SIRET) is
|
||||||
|
929 553 774 00019. You can contact us about anything in
|
||||||
|
this policy, or about your data, at
|
||||||
|
<a href="mailto:support@innersquare.app">support@innersquare.app</a>
|
||||||
|
or <a href="tel:+33683019513">+33 6 83 01 95 13</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>What we collect</h2>
|
<h2>What we collect</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@@ -66,9 +77,18 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Technical data.</strong>
|
<strong>Technical data.</strong>
|
||||||
Our hosting and server infrastructure may keep standard request logs
|
We do not keep our own access logs. The companies that host the site
|
||||||
(IP address, browser, timestamps) for security and troubleshooting.
|
and run our content delivery network keep short-lived request logs
|
||||||
These logs are rotated regularly.
|
(IP address, browser, timestamps) for security, abuse prevention, and
|
||||||
|
troubleshooting, under their own retention policies.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Usage data.</strong>
|
||||||
|
On public pages and the guest trainer, we use a self-hosted Matomo
|
||||||
|
instance to understand aggregate usage. Matomo is configured without
|
||||||
|
cookies, with IP addresses shortened before storage, and to respect
|
||||||
|
Do Not Track. We do not use user IDs, track signed-in account pages,
|
||||||
|
or share this data with third parties.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Messages you send us.</strong>
|
<strong>Messages you send us.</strong>
|
||||||
@@ -85,20 +105,56 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>a session cookie that keeps you signed in;</li>
|
<li>a session cookie that keeps you signed in;</li>
|
||||||
<li>a CSRF token that protects forms from cross-site requests;</li>
|
<li>a CSRF token that protects forms from cross-site requests;</li>
|
||||||
|
<li>
|
||||||
|
a security cookie that our content delivery network, Cloudflare, may
|
||||||
|
set when it checks that a request is not automated abuse;
|
||||||
|
</li>
|
||||||
<li>a colour-mode preference stored in your browser.</li>
|
<li>a colour-mode preference stored in your browser.</li>
|
||||||
|
<li>
|
||||||
|
an analytics opt-out preference stored in your browser's local
|
||||||
|
storage, if you choose to opt out.
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
We do not use advertising cookies, third-party analytics, or cross-site
|
We do not use advertising cookies, analytics cookies, or cross-site
|
||||||
tracking. You can clear these entries at any time in your browser
|
tracking. The only cookie not set by this site is Cloudflare's security
|
||||||
settings; doing so will sign you out and reset your colour mode.
|
check described above; our analytics is self-hosted Matomo and is
|
||||||
|
configured without cookies. You can clear these entries at any time in
|
||||||
|
your browser settings; doing so will sign you out, reset your colour
|
||||||
|
mode, and reset your analytics preference.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h2>Analytics</h2>
|
||||||
|
<p>
|
||||||
|
We use a self-hosted Matomo instance at
|
||||||
|
<a href="https://analytics.owenrees.eu/">analytics.owenrees.eu</a>
|
||||||
|
to understand aggregate use of the public site and guest trainer. It is
|
||||||
|
configured without cookies, with IP addresses shortened before storage,
|
||||||
|
and to respect Do Not Track. We do not use user IDs, track signed-in
|
||||||
|
account pages, or share this data with third parties.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Raw analytics data is retained for up to 180 days. We process it on the
|
||||||
|
basis of our legitimate interests in improving the service. You can
|
||||||
|
object at any time using the control below or by emailing
|
||||||
|
<a href="mailto:support@innersquare.app">support@innersquare.app</a>.
|
||||||
|
</p>
|
||||||
|
<p id="analytics-status">Analytics is currently on in this browser.</p>
|
||||||
|
<div class="analytics-buttons">
|
||||||
|
<button id="analytics-opt-out" type="button">Opt out of analytics</button>
|
||||||
|
<button id="analytics-opt-in" type="button" hidden>Opt back in</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2>How we use your information</h2>
|
<h2>How we use your information</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>To create and secure your account and sign you in.</li>
|
<li>To create and secure your account and sign you in.</li>
|
||||||
<li>To run the trainer and remember your progress.</li>
|
<li>To run the trainer and remember your progress.</li>
|
||||||
<li>To send service emails, such as confirmation and password reset links.</li>
|
<li>To send service emails, such as confirmation and password reset links.</li>
|
||||||
<li>To send occasional endgame tips and site news, if you opted in.</li>
|
<li>To send occasional endgame tips and site news, if you opted in.</li>
|
||||||
|
<li>
|
||||||
|
To understand aggregate use of the public site and guest trainer, and
|
||||||
|
improve the service.
|
||||||
|
</li>
|
||||||
<li>To keep the site available, prevent abuse, and fix faults.</li>
|
<li>To keep the site available, prevent abuse, and fix faults.</li>
|
||||||
<li>To respond when you ask for help.</li>
|
<li>To respond when you ask for help.</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -130,13 +186,41 @@
|
|||||||
to object to this processing; to do so, contact us using the address below.
|
to object to this processing; to do so, contact us using the address below.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h2 id="hosting-and-infrastructure">Hosting and infrastructure</h2>
|
||||||
|
<p>
|
||||||
|
The site runs on a virtual private server operated for us by Hetzner
|
||||||
|
inside the European Union. Our database runs on the same server, our
|
||||||
|
transactional email is sent through Amazon SES in the EU, and our
|
||||||
|
self-hosted Matomo analytics runs on infrastructure we control in the
|
||||||
|
EU.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
We also use Cloudflare as our content delivery network and security
|
||||||
|
proxy. Because Cloudflare sits between your browser and our server, it
|
||||||
|
processes your IP address, the requested URL, and request headers.
|
||||||
|
Cloudflare is a US company, so that request data may be transferred
|
||||||
|
outside the UK and EEA. The transfer relies on the EU–US Data Privacy
|
||||||
|
Framework and standard contractual clauses. Cloudflare and Hetzner each
|
||||||
|
keep their own logs under their own retention policies; we do not
|
||||||
|
receive or keep them.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
These providers act as our processors under data protection law. We
|
||||||
|
share with them only what they need to run the service, and we remain
|
||||||
|
responsible for how your information is handled.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>Sharing</h2>
|
<h2>Sharing</h2>
|
||||||
<p>
|
<p>
|
||||||
We do not sell your personal information. We share it only with providers
|
We do not sell your personal information. We share it only with the
|
||||||
who help us run the site — for example hosting, database, and email
|
providers described under
|
||||||
delivery providers — and only as far as they need it to perform that work.
|
<a href="#hosting-and-infrastructure">hosting and infrastructure</a>
|
||||||
We may also disclose information where the law requires it or to protect
|
— our hosting, content delivery, database, and email delivery providers
|
||||||
the rights and safety of our users.
|
— and only as far as they need it to perform that work. Self-hosted
|
||||||
|
Matomo analytics is operated by us on infrastructure we control; we do
|
||||||
|
not share that data with third parties. We may also disclose
|
||||||
|
information where the law requires it or to protect the rights and
|
||||||
|
safety of our users.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Retention</h2>
|
<h2>Retention</h2>
|
||||||
@@ -144,23 +228,28 @@
|
|||||||
We keep account and training data while your account is open. If you
|
We keep account and training data while your account is open. If you
|
||||||
delete your account, we remove your personal information within a
|
delete your account, we remove your personal information within a
|
||||||
reasonable period, except where we must keep records for legal, security,
|
reasonable period, except where we must keep records for legal, security,
|
||||||
or accounting reasons.
|
or accounting reasons. We retain raw analytics data for up to 180 days.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Two exceptions are worth naming. If you unsubscribe from the mailing
|
||||||
|
list, or ask us not to email you, we keep your address on a suppression
|
||||||
|
list so that we do not contact you again; we hold only what is needed to
|
||||||
|
recognise the address. We also keep database backups for disaster
|
||||||
|
recovery, stored off the primary server, so a deleted account may remain
|
||||||
|
in a backup for some time after deletion. We do not use backups to
|
||||||
|
restore individual accounts, and we delete them once they are no longer
|
||||||
|
needed.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Your rights</h2>
|
<h2>Your rights</h2>
|
||||||
<p>
|
<p>
|
||||||
Depending on where you live, you may have the right to access, correct,
|
Depending on where you live, you may have the right to access, correct,
|
||||||
delete, restrict, or export your personal information, and to object to
|
delete, restrict, or export your personal information, and to object to
|
||||||
some uses of it. To make a request, contact us using the address below. If
|
some uses of it. You can object to analytics processing at any time using
|
||||||
you are in the UK or EU and are unhappy with our response, you can complain
|
the control on this page or by contacting us. To make a request, contact
|
||||||
to your local data protection authority.
|
us using the address below. If you are in the UK or EU and are unhappy
|
||||||
</p>
|
with our response, you can complain to your local data protection
|
||||||
|
authority.
|
||||||
<h2>Children</h2>
|
|
||||||
<p>
|
|
||||||
The service is not directed at children under 13, and we do not knowingly
|
|
||||||
collect their personal information. If you believe a child has created an
|
|
||||||
account, contact us and we will remove it.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Changes</h2>
|
<h2>Changes</h2>
|
||||||
@@ -189,8 +278,57 @@
|
|||||||
<nav class="footer-links" aria-label="Legal">
|
<nav class="footer-links" aria-label="Legal">
|
||||||
<a href="/privacy">Privacy</a>
|
<a href="/privacy">Privacy</a>
|
||||||
<a href="/terms-conditions">Terms</a>
|
<a href="/terms-conditions">Terms</a>
|
||||||
|
<a href="/mentions-legales">Mentions légales</a>
|
||||||
</nav>
|
</nav>
|
||||||
<small>© 2026 Inner Square Chess</small>
|
<small>© 2026 Inner Square Chess</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var key = "matomo_optout";
|
||||||
|
var optOut = document.getElementById("analytics-opt-out");
|
||||||
|
var optIn = document.getElementById("analytics-opt-in");
|
||||||
|
var status = document.getElementById("analytics-status");
|
||||||
|
|
||||||
|
function optedOut() {
|
||||||
|
try {
|
||||||
|
return localStorage.getItem(key) === "1";
|
||||||
|
} catch (error) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
var off = optedOut();
|
||||||
|
if (optOut) optOut.hidden = off;
|
||||||
|
if (optIn) optIn.hidden = !off;
|
||||||
|
if (status) {
|
||||||
|
status.textContent = off
|
||||||
|
? "Analytics is currently off in this browser."
|
||||||
|
: "Analytics is currently on in this browser.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optOut) {
|
||||||
|
optOut.addEventListener("click", function () {
|
||||||
|
try {
|
||||||
|
localStorage.setItem(key, "1");
|
||||||
|
} catch (error) {}
|
||||||
|
update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optIn) {
|
||||||
|
optIn.addEventListener("click", function () {
|
||||||
|
try {
|
||||||
|
localStorage.removeItem(key);
|
||||||
|
} catch (error) {}
|
||||||
|
update();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
update();
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -36,13 +36,19 @@
|
|||||||
<main id="main-content">
|
<main id="main-content">
|
||||||
<article class="legal">
|
<article class="legal">
|
||||||
<h1>Terms & Conditions</h1>
|
<h1>Terms & Conditions</h1>
|
||||||
<p class="legal-meta">Last updated: 6 November 2026</p>
|
<p class="legal-meta">Last updated: 10 November 2026</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
These terms govern your use of Inner Square Chess. By browsing the site,
|
These terms govern your use of Inner Square Chess. By browsing the site,
|
||||||
using the guest trainer, or creating an account, you agree to them. If you
|
using the guest trainer, or creating an account, you agree to them. If you
|
||||||
do not agree, please do not use the service.
|
do not agree, please do not use the service.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
Inner Square Chess is operated by Owen REES, entrepreneur individuel (EI),
|
||||||
|
established in France, business register number (SIRET)
|
||||||
|
929 553 774 00019. Full publisher details are on the
|
||||||
|
<a href="/mentions-legales">mentions légales</a> page.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>The service</h2>
|
<h2>The service</h2>
|
||||||
<p>
|
<p>
|
||||||
@@ -60,6 +66,10 @@
|
|||||||
<h2>Accounts</h2>
|
<h2>Accounts</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>You must be at least 13 years old to create an account.</li>
|
<li>You must be at least 13 years old to create an account.</li>
|
||||||
|
<li>
|
||||||
|
If you are under 16 and in the UK or EU, you may only use an account
|
||||||
|
with the consent of a parent or guardian.
|
||||||
|
</li>
|
||||||
<li>Give accurate information and keep it up to date.</li>
|
<li>Give accurate information and keep it up to date.</li>
|
||||||
<li>Keep your password private and tell us promptly about unauthorised use.</li>
|
<li>Keep your password private and tell us promptly about unauthorised use.</li>
|
||||||
<li>You are responsible for activity that happens under your account.</li>
|
<li>You are responsible for activity that happens under your account.</li>
|
||||||
@@ -163,6 +173,7 @@
|
|||||||
<nav class="footer-links" aria-label="Legal">
|
<nav class="footer-links" aria-label="Legal">
|
||||||
<a href="/privacy">Privacy</a>
|
<a href="/privacy">Privacy</a>
|
||||||
<a href="/terms-conditions">Terms</a>
|
<a href="/terms-conditions">Terms</a>
|
||||||
|
<a href="/mentions-legales">Mentions légales</a>
|
||||||
</nav>
|
</nav>
|
||||||
<small>© 2026 Inner Square Chess</small>
|
<small>© 2026 Inner Square Chess</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
container_name: chesstrainer_dev-db
|
container_name: chesstrainer_dev-db
|
||||||
image: postgres:18.0
|
image: postgres:18.6
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=postgres
|
- POSTGRES_USER=postgres
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
# Analytics
|
||||||
|
|
||||||
|
We use a self-hosted Matomo instance for privacy-conscious analytics on public
|
||||||
|
pages and the guest trainer.
|
||||||
|
|
||||||
|
## What is collected
|
||||||
|
|
||||||
|
- Page views on anonymous public pages and the guest trainer.
|
||||||
|
- Standard request data Matomo needs to count a visit, with IP anonymisation.
|
||||||
|
|
||||||
|
We do **not**:
|
||||||
|
|
||||||
|
- set Matomo cookies,
|
||||||
|
- use user IDs,
|
||||||
|
- track signed-in account, profile, or admin pages,
|
||||||
|
- enable cross-site or advertising features,
|
||||||
|
- share analytics data with third parties.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The app reads these environment variables at boot:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
MATOMO_URL=https://analytics.owenrees.eu/
|
||||||
|
MATOMO_SITE_ID=6
|
||||||
|
```
|
||||||
|
|
||||||
|
They are configured in `config/runtime.exs` for production only. If either is
|
||||||
|
missing, no analytics config is rendered and no tracker is loaded.
|
||||||
|
|
||||||
|
The root layout renders a hidden `#matomo-config` element only when the visitor
|
||||||
|
is anonymous. `assets/js/analytics.js` initialises Matomo cookieless from that
|
||||||
|
element. Signed-in users never receive the element.
|
||||||
|
|
||||||
|
## Matomo settings
|
||||||
|
|
||||||
|
In the Matomo administration UI:
|
||||||
|
|
||||||
|
1. **Administration → Websites → Manage**
|
||||||
|
- URL: `https://innersquare.app`
|
||||||
|
- Site ID: `6`
|
||||||
|
- Timezone: match the site
|
||||||
|
2. **Administration → Privacy → Anonymize data**
|
||||||
|
- Enable IP anonymisation (at least the last byte; 2 bytes is safer)
|
||||||
|
- Disable tracking cookies
|
||||||
|
- Respect Do Not Track
|
||||||
|
- Do not use user IDs
|
||||||
|
- Set raw data retention to **180 days**
|
||||||
|
3. **Administration → System check / trusted hosts**
|
||||||
|
- Add `innersquare.app` and `www.innersquare.app` if host validation is on.
|
||||||
|
4. Do not enable ecommerce, advertising, or cross-domain tracking.
|
||||||
|
|
||||||
|
The JavaScript also calls:
|
||||||
|
|
||||||
|
```js
|
||||||
|
_paq.push(["disableCookies"]);
|
||||||
|
_paq.push(["setDoNotTrack", true]);
|
||||||
|
```
|
||||||
|
|
||||||
|
## Opt-out
|
||||||
|
|
||||||
|
The privacy page has an **Analytics** section with an opt-out control. The
|
||||||
|
preference is stored in `localStorage["matomo_optout"]`, not a cookie. When set,
|
||||||
|
the tracker is never loaded and LiveView page views are skipped.
|
||||||
|
|
||||||
|
The preference is local to the browser. Clearing site data resets it. Users can
|
||||||
|
also object by emailing `support@innersquare.app`.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
On an anonymous public page:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -s https://innersquare.app/ | grep -c matomo-config
|
||||||
|
```
|
||||||
|
|
||||||
|
should return `1`.
|
||||||
|
|
||||||
|
In the browser:
|
||||||
|
|
||||||
|
- `matomo.js` and `matomo.php` load once.
|
||||||
|
- Matomo Real-time shows the page view.
|
||||||
|
- No `_pk_*` cookies are created.
|
||||||
|
- Opting out sets `matomo_optout=1` in localStorage and stops further requests.
|
||||||
|
- Signed-in pages produce no Matomo config or requests.
|
||||||
|
- A DNT browser setting suppresses tracking.
|
||||||
|
|
||||||
|
## Legal basis
|
||||||
|
|
||||||
|
Analytics runs on the basis of legitimate interests in improving the service.
|
||||||
|
The privacy policy discloses it, explains the data, and provides the opt-out.
|
||||||
|
This document is an engineering configuration guide, not legal advice; keep a
|
||||||
|
short legitimate-interest assessment on file.
|
||||||
+19
-2
@@ -23,10 +23,27 @@ machine and a VPS will point at different copies.
|
|||||||
export TABLEBASE_PATH=/home/you/Downloads/tablebase
|
export TABLEBASE_PATH=/home/you/Downloads/tablebase
|
||||||
mix phx.server
|
mix phx.server
|
||||||
|
|
||||||
# Production (release)
|
# Production (release), behind systemd
|
||||||
TABLEBASE_PATH=/data/syzygy/3-4-5 bin/chesstrainer start
|
TABLEBASE_PATH=/opt/chesstrainer/tablebases bin/chesstrainer start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
On the production VPS the directory is `/opt/chesstrainer/tablebases`, owned by
|
||||||
|
the `chesstrainer` user. Set `TABLEBASE_PATH` in `/etc/chesstrainer/env` rather
|
||||||
|
than an interactive shell, then restart `chesstrainer.service` — the value is
|
||||||
|
read at boot.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo chown -R chesstrainer:chesstrainer /opt/chesstrainer/tablebases
|
||||||
|
sudo chmod -R u=rwX,g=rX,o= /opt/chesstrainer/tablebases
|
||||||
|
sudo systemctl restart chesstrainer
|
||||||
|
curl -s http://127.0.0.1:4100/health
|
||||||
|
```
|
||||||
|
|
||||||
|
Healthy local tablebases report `tablebase: "local"` and `status: "ok"`. A
|
||||||
|
missing, empty, or unreadable directory reports `tablebase: "fallback"` or
|
||||||
|
`"not_configured"` and `status: "degraded"`, still with HTTP 200 because the
|
||||||
|
Lichess fallback is available.
|
||||||
|
|
||||||
The value must reach the process. A bare `TABLEBASE_PATH=...` line in bash
|
The value must reach the process. A bare `TABLEBASE_PATH=...` line in bash
|
||||||
only sets a shell variable and is **not** exported to `mix` or the release —
|
only sets a shell variable and is **not** exported to `mix` or the release —
|
||||||
use `export`, or prefix the command. For a release, systemd unit or container,
|
use `export`, or prefix the command. For a release, systemd unit or container,
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ defmodule ChesstrainerWeb.Layouts do
|
|||||||
<nav class="footer-links" aria-label="Footer">
|
<nav class="footer-links" aria-label="Footer">
|
||||||
<a href="/privacy">Privacy Policy</a>
|
<a href="/privacy">Privacy Policy</a>
|
||||||
<a href="/terms-conditions">Terms & Conditions</a>
|
<a href="/terms-conditions">Terms & Conditions</a>
|
||||||
|
<a href="/mentions-legales">Mentions légales</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<small>© {@year} {Branding.name()}</small>
|
<small>© {@year} {Branding.name()}</small>
|
||||||
@@ -296,4 +297,48 @@ defmodule ChesstrainerWeb.Layouts do
|
|||||||
</div>
|
</div>
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@doc """
|
||||||
|
Renders the Matomo configuration for anonymous public pages.
|
||||||
|
|
||||||
|
The actual tracker is initialised by `assets/js/analytics.js`. Signed-in
|
||||||
|
visitors never get the config element, so account and admin pages are not
|
||||||
|
tracked.
|
||||||
|
"""
|
||||||
|
attr :current_scope, :map, default: nil
|
||||||
|
|
||||||
|
def analytics(assigns) do
|
||||||
|
config = Application.get_env(:chesstrainer, :matomo, [])
|
||||||
|
url = normalize_matomo_url(config[:url])
|
||||||
|
site_id = config[:site_id]
|
||||||
|
user = Map.get(assigns, :current_scope) && assigns.current_scope.user
|
||||||
|
|
||||||
|
assigns =
|
||||||
|
assign(assigns,
|
||||||
|
matomo_url: url,
|
||||||
|
matomo_site_id: site_id && to_string(site_id),
|
||||||
|
analytics_enabled:
|
||||||
|
is_binary(url) and url != "" and site_id not in [nil, ""] and is_nil(user)
|
||||||
|
)
|
||||||
|
|
||||||
|
~H"""
|
||||||
|
<div
|
||||||
|
:if={@analytics_enabled}
|
||||||
|
id="matomo-config"
|
||||||
|
data-url={@matomo_url}
|
||||||
|
data-site-id={@matomo_site_id}
|
||||||
|
hidden
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
"""
|
||||||
|
end
|
||||||
|
|
||||||
|
defp normalize_matomo_url(url) when is_binary(url) do
|
||||||
|
case String.trim(url) do
|
||||||
|
"" -> nil
|
||||||
|
url -> String.trim_trailing(url, "/") <> "/"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp normalize_matomo_url(_url), do: nil
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -76,5 +76,6 @@
|
|||||||
<Layouts.navbar current_scope={@current_scope} />
|
<Layouts.navbar current_scope={@current_scope} />
|
||||||
{@inner_content}
|
{@inner_content}
|
||||||
<Layouts.footer />
|
<Layouts.footer />
|
||||||
|
<Layouts.analytics current_scope={@current_scope} />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -57,6 +57,19 @@ defmodule ChesstrainerWeb.PageController do
|
|||||||
|> render(:terms_conditions)
|
|> render(:terms_conditions)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mentions_legales(conn, _params) do
|
||||||
|
conn
|
||||||
|
|> assign(:js_entry, ~p"/assets/js/marketing.js")
|
||||||
|
|> assign(:page_title, Branding.title("Mentions légales"))
|
||||||
|
|> assign(:title_suffix, "")
|
||||||
|
|> assign(
|
||||||
|
:meta_description,
|
||||||
|
"Éditeur, hébergeur et informations légales de #{Branding.name()}."
|
||||||
|
)
|
||||||
|
|> assign(:canonical_url, current_url(conn))
|
||||||
|
|> render(:mentions_legales)
|
||||||
|
end
|
||||||
|
|
||||||
def not_found(conn, _params) do
|
def not_found(conn, _params) do
|
||||||
conn
|
conn
|
||||||
|> put_status(:not_found)
|
|> put_status(:not_found)
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<Layouts.flash_group flash={@flash} />
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<article class="legal" lang="fr">
|
||||||
|
<h1>Mentions légales</h1>
|
||||||
|
<p class="legal-meta">Dernière mise à jour : 10 novembre 2026</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Ces mentions sont publiées en application de l'article 6-III de la loi
|
||||||
|
n° 2004-575 du 21 juin 2004 pour la confiance dans l'économie numérique.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Éditeur du site</h2>
|
||||||
|
<p>
|
||||||
|
Le site <a href="/">innersquare.app</a>, édité sous le nom commercial
|
||||||
|
« {Branding.name()} », est édité par :
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Owen REES</strong>, entrepreneur individuel (EI)</li>
|
||||||
|
<%!-- <li>Adresse : [adresse à compléter]</li> --%>
|
||||||
|
<li>SIRET : 929 553 774 00019</li>
|
||||||
|
<li>Téléphone : <a href="tel:+33683019513">+33 6 83 01 95 13</a></li>
|
||||||
|
<li>
|
||||||
|
Courriel :
|
||||||
|
<a href={"mailto:" <> Branding.support_email()}>{Branding.support_email()}</a>
|
||||||
|
/ <a href="mailto:owenrees.dev@gmail.com">owenrees.dev@gmail.com</a>
|
||||||
|
</li>
|
||||||
|
<li>TVA non applicable, article 293 B du Code général des impôts.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h2>Directeur de la publication</h2>
|
||||||
|
<p>Owen REES.</p>
|
||||||
|
|
||||||
|
<h2>Hébergeur</h2>
|
||||||
|
<p>
|
||||||
|
Hetzner Online GmbH<br /> Industriestraße 25<br /> 91710 Gunzenhausen<br /> Allemagne<br />
|
||||||
|
Téléphone : <a href="tel:+4998315050">+49 9831 505-0</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Propriété intellectuelle</h2>
|
||||||
|
<p>
|
||||||
|
Les contenus du site — textes, interface, code, éléments graphiques, ainsi
|
||||||
|
que les positions et solutions d'échecs — sont protégés par le droit
|
||||||
|
d'auteur et restent la propriété de l'éditeur ou de ses concédants. Toute
|
||||||
|
reproduction ou réutilisation non autorisée est interdite.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<h2>Données personnelles</h2>
|
||||||
|
<p>
|
||||||
|
Les données traitées, les finalités, les durées de conservation et vos
|
||||||
|
droits sont décrits dans la <a href="/privacy">politique de confidentialité</a>, disponible en anglais.
|
||||||
|
</p>
|
||||||
|
</article>
|
||||||
|
</main>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<main>
|
<main>
|
||||||
<article class="legal">
|
<article class="legal">
|
||||||
<h1>Privacy Policy</h1>
|
<h1>Privacy Policy</h1>
|
||||||
<p class="legal-meta">Last updated: 6 November 2026</p>
|
<p class="legal-meta">Last updated: 10 November 2026</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{Branding.name()} is an endgame training site. This policy explains what
|
{Branding.name()} is an endgame training site. This policy explains what
|
||||||
@@ -12,6 +12,16 @@
|
|||||||
guest trainer.
|
guest trainer.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h2>Data controller</h2>
|
||||||
|
<p>
|
||||||
|
The controller responsible for your personal information is Owen REES, an
|
||||||
|
entrepreneur individuel (EI) established in France, trading as {Branding.name()}. Our business register number (SIRET) is
|
||||||
|
929 553 774 00019. You can contact us about anything in this
|
||||||
|
policy, or about your data, at
|
||||||
|
<a href={"mailto:" <> Branding.support_email()}>{Branding.support_email()}</a>
|
||||||
|
or <a href="tel:+33683019513">+33 6 83 01 95 13</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>What we collect</h2>
|
<h2>What we collect</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
@@ -33,9 +43,18 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Technical data.</strong>
|
<strong>Technical data.</strong>
|
||||||
Our hosting and server infrastructure may keep standard request logs
|
We do not keep our own access logs. The companies that host the site
|
||||||
(IP address, browser, timestamps) for security and troubleshooting.
|
and run our content delivery network keep short-lived request logs
|
||||||
These logs are rotated regularly.
|
(IP address, browser, timestamps) for security, abuse prevention, and
|
||||||
|
troubleshooting, under their own retention policies.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Usage data.</strong>
|
||||||
|
On public pages and the guest trainer, we use a self-hosted Matomo
|
||||||
|
instance to understand aggregate usage. Matomo is configured without
|
||||||
|
cookies, with IP addresses shortened before storage, and to respect Do
|
||||||
|
Not Track. We do not use user IDs, track signed-in account pages, or
|
||||||
|
share this data with third parties.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Messages you send us.</strong>
|
<strong>Messages you send us.</strong>
|
||||||
@@ -52,20 +71,68 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>a session cookie that keeps you signed in;</li>
|
<li>a session cookie that keeps you signed in;</li>
|
||||||
<li>a CSRF token that protects forms from cross-site requests;</li>
|
<li>a CSRF token that protects forms from cross-site requests;</li>
|
||||||
|
<li>
|
||||||
|
a security cookie that our content delivery network, Cloudflare, may set
|
||||||
|
when it checks that a request is not automated abuse;
|
||||||
|
</li>
|
||||||
<li>a colour-mode preference stored in your browser.</li>
|
<li>a colour-mode preference stored in your browser.</li>
|
||||||
|
<li>
|
||||||
|
an analytics opt-out preference stored in your browser's local storage,
|
||||||
|
if you choose to opt out.
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
We do not use advertising cookies, third-party analytics, or cross-site
|
We do not use advertising cookies, analytics cookies, or cross-site
|
||||||
tracking. You can clear these entries at any time in your browser
|
tracking. The only cookie not set by this site is Cloudflare's security
|
||||||
settings; doing so will sign you out and reset your colour mode.
|
check described above; our analytics is self-hosted Matomo and is
|
||||||
|
configured without cookies. You can clear these entries at any time in
|
||||||
|
your browser settings; doing so will sign you out, reset your colour mode,
|
||||||
|
and reset your analytics preference.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h2>Analytics</h2>
|
||||||
|
<p>
|
||||||
|
We use a self-hosted Matomo instance at
|
||||||
|
<a href="https://analytics.owenrees.eu/">analytics.owenrees.eu</a>
|
||||||
|
to understand aggregate use of the public site and guest trainer. It is
|
||||||
|
configured without cookies, with IP addresses shortened before storage,
|
||||||
|
and to respect Do Not Track. We do not use user IDs, track signed-in
|
||||||
|
account pages, or share this data with third parties.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Raw analytics data is retained for up to 180 days. We process it on the
|
||||||
|
basis of our legitimate interests in improving the service. You can
|
||||||
|
object at any time using the control below or by emailing <a href={"mailto:" <> Branding.support_email()}>{Branding.support_email()}</a>.
|
||||||
|
</p>
|
||||||
|
<p id="analytics-status">Analytics is currently on in this browser.</p>
|
||||||
|
<div class="flex flex-wrap gap-3">
|
||||||
|
<button
|
||||||
|
id="analytics-opt-out"
|
||||||
|
type="button"
|
||||||
|
class="inline-flex items-center justify-center rounded-md border border-base-300 bg-base-100 px-4 py-2 text-sm font-semibold text-base-content hover:bg-base-200"
|
||||||
|
>
|
||||||
|
Opt out of analytics
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
id="analytics-opt-in"
|
||||||
|
type="button"
|
||||||
|
hidden
|
||||||
|
class="inline-flex items-center justify-center rounded-md border border-base-300 bg-base-100 px-4 py-2 text-sm font-semibold text-base-content hover:bg-base-200"
|
||||||
|
>
|
||||||
|
Opt back in
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2>How we use your information</h2>
|
<h2>How we use your information</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>To create and secure your account and sign you in.</li>
|
<li>To create and secure your account and sign you in.</li>
|
||||||
<li>To run the trainer and remember your progress.</li>
|
<li>To run the trainer and remember your progress.</li>
|
||||||
<li>To send service emails, such as confirmation and password reset links.</li>
|
<li>To send service emails, such as confirmation and password reset links.</li>
|
||||||
<li>To send occasional endgame tips and site news, if you opted in.</li>
|
<li>To send occasional endgame tips and site news, if you opted in.</li>
|
||||||
|
<li>
|
||||||
|
To understand aggregate use of the public site and guest trainer, and
|
||||||
|
improve the service.
|
||||||
|
</li>
|
||||||
<li>To keep the site available, prevent abuse, and fix faults.</li>
|
<li>To keep the site available, prevent abuse, and fix faults.</li>
|
||||||
<li>To respond when you ask for help.</li>
|
<li>To respond when you ask for help.</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -97,13 +164,38 @@
|
|||||||
to object to this processing; to do so, contact us using the address below.
|
to object to this processing; to do so, contact us using the address below.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h2 id="hosting-and-infrastructure">Hosting and infrastructure</h2>
|
||||||
|
<p>
|
||||||
|
The site runs on a virtual private server operated for us by Hetzner
|
||||||
|
inside the European Union. Our database runs on the same server, our
|
||||||
|
transactional email is sent through Amazon SES in the EU, and our
|
||||||
|
self-hosted Matomo analytics runs on infrastructure we control in the EU.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
We also use Cloudflare as our content delivery network and security proxy.
|
||||||
|
Because Cloudflare sits between your browser and our server, it processes
|
||||||
|
your IP address, the requested URL, and request headers. Cloudflare is a
|
||||||
|
US company, so that request data may be transferred outside the UK and
|
||||||
|
EEA. The transfer relies on the EU–US Data Privacy Framework and standard
|
||||||
|
contractual clauses. Cloudflare and Hetzner each keep their own logs
|
||||||
|
under their own retention policies; we do not receive or keep them.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
These providers act as our processors under data protection law. We share
|
||||||
|
with them only what they need to run the service, and we remain
|
||||||
|
responsible for how your information is handled.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>Sharing</h2>
|
<h2>Sharing</h2>
|
||||||
<p>
|
<p>
|
||||||
We do not sell your personal information. We share it only with providers
|
We do not sell your personal information. We share it only with the
|
||||||
who help us run the site — for example hosting, database, and email
|
providers described under
|
||||||
delivery providers — and only as far as they need it to perform that work.
|
<a href="#hosting-and-infrastructure">hosting and infrastructure</a>
|
||||||
We may also disclose information where the law requires it or to protect
|
— our hosting, content delivery, database, and email delivery providers —
|
||||||
the rights and safety of our users.
|
and only as far as they need it to perform that work. Self-hosted Matomo
|
||||||
|
analytics is operated by us on infrastructure we control; we do not share
|
||||||
|
that data with third parties. We may also disclose information where the
|
||||||
|
law requires it or to protect the rights and safety of our users.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Retention</h2>
|
<h2>Retention</h2>
|
||||||
@@ -111,23 +203,27 @@
|
|||||||
We keep account and training data while your account is open. If you
|
We keep account and training data while your account is open. If you
|
||||||
delete your account, we remove your personal information within a
|
delete your account, we remove your personal information within a
|
||||||
reasonable period, except where we must keep records for legal, security,
|
reasonable period, except where we must keep records for legal, security,
|
||||||
or accounting reasons.
|
or accounting reasons. We retain raw analytics data for up to 180 days.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Two exceptions are worth naming. If you unsubscribe from the mailing list,
|
||||||
|
or ask us not to email you, we keep your address on a suppression list so
|
||||||
|
that we do not contact you again; we hold only what is needed to recognise
|
||||||
|
the address. We also keep database backups for disaster recovery, stored
|
||||||
|
off the primary server, so a deleted account may remain in a backup for
|
||||||
|
some time after deletion. We do not use backups to restore individual
|
||||||
|
accounts, and we delete them once they are no longer needed.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Your rights</h2>
|
<h2>Your rights</h2>
|
||||||
<p>
|
<p>
|
||||||
Depending on where you live, you may have the right to access, correct,
|
Depending on where you live, you may have the right to access, correct,
|
||||||
delete, restrict, or export your personal information, and to object to
|
delete, restrict, or export your personal information, and to object to
|
||||||
some uses of it. To make a request, contact us using the address below. If
|
some uses of it. You can object to analytics processing at any time using
|
||||||
you are in the UK or EU and are unhappy with our response, you can complain
|
the control on this page or by contacting us. To make a request, contact
|
||||||
to your local data protection authority.
|
us using the address below. If you are in the UK or EU and are unhappy
|
||||||
</p>
|
with our response, you can complain to your local data protection
|
||||||
|
authority.
|
||||||
<h2>Children</h2>
|
|
||||||
<p>
|
|
||||||
The service is not directed at children under 13, and we do not knowingly
|
|
||||||
collect their personal information. If you believe a child has created an
|
|
||||||
account, contact us and we will remove it.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Changes</h2>
|
<h2>Changes</h2>
|
||||||
|
|||||||
@@ -3,13 +3,20 @@
|
|||||||
<main>
|
<main>
|
||||||
<article class="legal">
|
<article class="legal">
|
||||||
<h1>Terms & Conditions</h1>
|
<h1>Terms & Conditions</h1>
|
||||||
<p class="legal-meta">Last updated: 6 November 2026</p>
|
<p class="legal-meta">Last updated: 10 November 2026</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
These terms govern your use of {Branding.name()}. By browsing the site, using
|
These terms govern your use of {Branding.name()}. By browsing the site, using
|
||||||
the guest trainer, or creating an account, you agree to them. If you do not
|
the guest trainer, or creating an account, you agree to them. If you do not
|
||||||
agree, please do not use the service.
|
agree, please do not use the service.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
{Branding.name()} is operated by Owen REES, entrepreneur individuel (EI),
|
||||||
|
established in France, business register number (SIRET)
|
||||||
|
929 553 774 00019. Full publisher details are on the
|
||||||
|
<a href="/mentions-legales">mentions légales</a>
|
||||||
|
page.
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>The service</h2>
|
<h2>The service</h2>
|
||||||
<p>
|
<p>
|
||||||
@@ -26,6 +33,10 @@
|
|||||||
<h2>Accounts</h2>
|
<h2>Accounts</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li>You must be at least 13 years old to create an account.</li>
|
<li>You must be at least 13 years old to create an account.</li>
|
||||||
|
<li>
|
||||||
|
If you are under 16 and in the UK or EU, you may only use an account
|
||||||
|
with the consent of a parent or guardian.
|
||||||
|
</li>
|
||||||
<li>Give accurate information and keep it up to date.</li>
|
<li>Give accurate information and keep it up to date.</li>
|
||||||
<li>Keep your password private and tell us promptly about unauthorised use.</li>
|
<li>Keep your password private and tell us promptly about unauthorised use.</li>
|
||||||
<li>You are responsible for activity that happens under your account.</li>
|
<li>You are responsible for activity that happens under your account.</li>
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ defmodule ChesstrainerWeb.SitemapController do
|
|||||||
urls = [
|
urls = [
|
||||||
url(conn, ~p"/"),
|
url(conn, ~p"/"),
|
||||||
url(conn, ~p"/privacy"),
|
url(conn, ~p"/privacy"),
|
||||||
url(conn, ~p"/terms-conditions")
|
url(conn, ~p"/terms-conditions"),
|
||||||
|
url(conn, ~p"/mentions-legales")
|
||||||
]
|
]
|
||||||
|
|
||||||
conn
|
conn
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ defmodule ChesstrainerWeb.Plugs.Prelaunch do
|
|||||||
/
|
/
|
||||||
/privacy
|
/privacy
|
||||||
/terms-conditions
|
/terms-conditions
|
||||||
|
/mentions-legales
|
||||||
/health
|
/health
|
||||||
/robots.txt
|
/robots.txt
|
||||||
/sitemap.xml
|
/sitemap.xml
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ defmodule ChesstrainerWeb.Router do
|
|||||||
get "/", PageController, :home
|
get "/", PageController, :home
|
||||||
get "/privacy", PageController, :privacy
|
get "/privacy", PageController, :privacy
|
||||||
get "/terms-conditions", PageController, :terms_conditions
|
get "/terms-conditions", PageController, :terms_conditions
|
||||||
|
get "/mentions-legales", PageController, :mentions_legales
|
||||||
post "/mailing-list", MailingListController, :create
|
post "/mailing-list", MailingListController, :create
|
||||||
get "/mailing-list/confirm/:token", MailingListController, :confirm
|
get "/mailing-list/confirm/:token", MailingListController, :confirm
|
||||||
post "/admin/log-in", UserSessionController, :create_admin
|
post "/admin/log-in", UserSessionController, :create_admin
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
defmodule ChesstrainerWeb.LayoutsTest do
|
defmodule ChesstrainerWeb.LayoutsTest do
|
||||||
use ChesstrainerWeb.ConnCase, async: true
|
use ChesstrainerWeb.ConnCase, async: false
|
||||||
|
|
||||||
import Phoenix.LiveViewTest
|
import Phoenix.LiveViewTest
|
||||||
|
|
||||||
@@ -66,4 +66,48 @@ defmodule ChesstrainerWeb.LayoutsTest do
|
|||||||
refute html =~ ~r/<button[^>]*class="nav-cta"/
|
refute html =~ ~r/<button[^>]*class="nav-cta"/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "analytics/1" do
|
||||||
|
setup do
|
||||||
|
previous = Application.get_env(:chesstrainer, :matomo)
|
||||||
|
on_exit(fn -> restore_env(:matomo, previous) end)
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
|
||||||
|
test "renders the Matomo config for anonymous visitors" do
|
||||||
|
Application.put_env(:chesstrainer, :matomo,
|
||||||
|
url: "https://analytics.owenrees.eu/",
|
||||||
|
site_id: "6"
|
||||||
|
)
|
||||||
|
|
||||||
|
html = render_component(&Layouts.analytics/1, %{current_scope: nil})
|
||||||
|
|
||||||
|
assert html =~ ~s(id="matomo-config")
|
||||||
|
assert html =~ ~s(data-url="https://analytics.owenrees.eu/")
|
||||||
|
assert html =~ ~s(data-site-id="6")
|
||||||
|
end
|
||||||
|
|
||||||
|
test "does not render for signed-in users" do
|
||||||
|
Application.put_env(:chesstrainer, :matomo,
|
||||||
|
url: "https://analytics.owenrees.eu/",
|
||||||
|
site_id: "6"
|
||||||
|
)
|
||||||
|
|
||||||
|
scope = Scope.for_user(%User{username: "alice"})
|
||||||
|
html = render_component(&Layouts.analytics/1, %{current_scope: scope})
|
||||||
|
|
||||||
|
refute html =~ ~s(id="matomo-config")
|
||||||
|
end
|
||||||
|
|
||||||
|
test "does not render when Matomo is unconfigured" do
|
||||||
|
Application.delete_env(:chesstrainer, :matomo)
|
||||||
|
|
||||||
|
html = render_component(&Layouts.analytics/1, %{current_scope: nil})
|
||||||
|
|
||||||
|
refute html =~ ~s(id="matomo-config")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
defp restore_env(key, nil), do: Application.delete_env(:chesstrainer, key)
|
||||||
|
defp restore_env(key, value), do: Application.put_env(:chesstrainer, key, value)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -99,12 +99,21 @@ defmodule ChesstrainerWeb.PageControllerTest do
|
|||||||
document = LazyHTML.from_document(html)
|
document = LazyHTML.from_document(html)
|
||||||
|
|
||||||
assert LazyHTML.text(LazyHTML.query(document, "h1")) == "Privacy Policy"
|
assert LazyHTML.text(LazyHTML.query(document, "h1")) == "Privacy Policy"
|
||||||
assert html =~ "Last updated: 6 November 2026"
|
assert html =~ "Last updated: 10 November 2026"
|
||||||
assert html =~ "What we collect"
|
assert html =~ "What we collect"
|
||||||
assert html =~ "Cookies and local storage"
|
assert html =~ "Cookies and local storage"
|
||||||
|
assert html =~ "Analytics"
|
||||||
|
assert html =~ "self-hosted Matomo"
|
||||||
|
assert html =~ "without cookies"
|
||||||
|
assert html =~ ~s(id="analytics-opt-out")
|
||||||
assert html =~ "Guest puzzle limit"
|
assert html =~ "Guest puzzle limit"
|
||||||
assert html =~ "HMAC-SHA256"
|
assert html =~ "HMAC-SHA256"
|
||||||
assert html =~ "Article 6(1)(f) GDPR"
|
assert html =~ "Article 6(1)(f) GDPR"
|
||||||
|
assert html =~ "Hosting and infrastructure"
|
||||||
|
assert html =~ "Cloudflare"
|
||||||
|
assert html =~ "Data controller"
|
||||||
|
assert html =~ "suppression list"
|
||||||
|
refute html =~ "not directed at children"
|
||||||
|
|
||||||
assert LazyHTML.text(LazyHTML.query(document, "title")) ==
|
assert LazyHTML.text(LazyHTML.query(document, "title")) ==
|
||||||
Branding.title("Privacy Policy")
|
Branding.title("Privacy Policy")
|
||||||
@@ -120,10 +129,11 @@ defmodule ChesstrainerWeb.PageControllerTest do
|
|||||||
document = LazyHTML.from_document(html)
|
document = LazyHTML.from_document(html)
|
||||||
|
|
||||||
assert LazyHTML.text(LazyHTML.query(document, "h1")) == "Terms & Conditions"
|
assert LazyHTML.text(LazyHTML.query(document, "h1")) == "Terms & Conditions"
|
||||||
assert html =~ "Last updated: 6 November 2026"
|
assert html =~ "Last updated: 10 November 2026"
|
||||||
assert html =~ "Acceptable use"
|
assert html =~ "Acceptable use"
|
||||||
assert html =~ "Governing law"
|
assert html =~ "Governing law"
|
||||||
assert html =~ "fixed number of puzzles per UTC day"
|
assert html =~ "fixed number of puzzles per UTC day"
|
||||||
|
assert html =~ "consent of a parent or guardian"
|
||||||
assert html =~ ~p"/privacy"
|
assert html =~ ~p"/privacy"
|
||||||
|
|
||||||
assert LazyHTML.text(LazyHTML.query(document, "title")) ==
|
assert LazyHTML.text(LazyHTML.query(document, "title")) ==
|
||||||
@@ -135,6 +145,27 @@ defmodule ChesstrainerWeb.PageControllerTest do
|
|||||||
assert URI.parse(canonical).path == "/terms-conditions"
|
assert URI.parse(canonical).path == "/terms-conditions"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "GET /mentions-legales renders the French legal notice", %{conn: conn} do
|
||||||
|
html = conn |> get(~p"/mentions-legales") |> html_response(200)
|
||||||
|
document = LazyHTML.from_document(html)
|
||||||
|
|
||||||
|
assert LazyHTML.text(LazyHTML.query(document, "h1")) == "Mentions légales"
|
||||||
|
assert html =~ "Owen REES"
|
||||||
|
assert html =~ "929"
|
||||||
|
assert html =~ "293 B"
|
||||||
|
assert html =~ "Hetzner Online GmbH"
|
||||||
|
assert html =~ "Directeur de la publication"
|
||||||
|
assert html =~ ~p"/privacy"
|
||||||
|
|
||||||
|
assert LazyHTML.text(LazyHTML.query(document, "title")) ==
|
||||||
|
Branding.title("Mentions légales")
|
||||||
|
|
||||||
|
assert [canonical] =
|
||||||
|
LazyHTML.attribute(LazyHTML.query(document, ~s(link[rel="canonical"])), "href")
|
||||||
|
|
||||||
|
assert URI.parse(canonical).path == "/mentions-legales"
|
||||||
|
end
|
||||||
|
|
||||||
test "branding is read from application config", %{conn: conn} do
|
test "branding is read from application config", %{conn: conn} do
|
||||||
previous = Application.get_env(:chesstrainer, :branding)
|
previous = Application.get_env(:chesstrainer, :branding)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ defmodule ChesstrainerWeb.SitemapControllerTest do
|
|||||||
assert body =~ "<loc>#{base_url}/</loc>"
|
assert body =~ "<loc>#{base_url}/</loc>"
|
||||||
assert body =~ "<loc>#{base_url}/privacy</loc>"
|
assert body =~ "<loc>#{base_url}/privacy</loc>"
|
||||||
assert body =~ "<loc>#{base_url}/terms-conditions</loc>"
|
assert body =~ "<loc>#{base_url}/terms-conditions</loc>"
|
||||||
assert length(:binary.matches(body, "<url>")) == 3
|
assert body =~ "<loc>#{base_url}/mentions-legales</loc>"
|
||||||
|
assert length(:binary.matches(body, "<url>")) == 4
|
||||||
end
|
end
|
||||||
|
|
||||||
test "is served as XML", %{conn: conn} do
|
test "is served as XML", %{conn: conn} do
|
||||||
|
|||||||
Reference in New Issue
Block a user