diff --git a/.dockerignore b/.dockerignore index 767471fe..dfad8e6d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,5 +6,5 @@ publish/ tests/ docs/ .git/ -.github/ +.gitea/ **/*.user diff --git a/deploy/releases-repo/.github/ISSUE_TEMPLATE/bug_report.yml b/.gitea/ISSUE_TEMPLATE/bug_report.yml similarity index 84% rename from deploy/releases-repo/.github/ISSUE_TEMPLATE/bug_report.yml rename to .gitea/ISSUE_TEMPLATE/bug_report.yml index 770d90b9..43679641 100644 --- a/deploy/releases-repo/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.gitea/ISSUE_TEMPLATE/bug_report.yml @@ -1,21 +1,21 @@ name: Bug report -description: Something in Titano, the Uploader or the Server does not work as expected. +about: Something in Chronos, the Uploader or the Server does not work as expected. title: "[Bug] " labels: ["bug"] body: - type: markdown attributes: value: | - Thanks for taking the time. Security problems go to the *Security* tab (see SECURITY.md), not here. + Thanks for taking the time. Security problems are reported privately (see SECURITY.md), never here. - type: dropdown id: program attributes: label: Program options: - - Titano (desktop) - - Titano Uploader - - Titano Server (Docker / Unraid) - - Titano Server (Windows) + - Chronos (desktop) + - Chronos Uploader + - Chronos Server (Docker / Unraid) + - Chronos Server (Windows) - Setup / update validations: required: true diff --git a/deploy/releases-repo/.github/ISSUE_TEMPLATE/config.yml b/.gitea/ISSUE_TEMPLATE/config.yml similarity index 65% rename from deploy/releases-repo/.github/ISSUE_TEMPLATE/config.yml rename to .gitea/ISSUE_TEMPLATE/config.yml index 06f85e6a..67374efb 100644 --- a/deploy/releases-repo/.github/ISSUE_TEMPLATE/config.yml +++ b/.gitea/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - name: Report a security vulnerability - url: https://github.com/alby96/titano-releases/security/advisories/new + url: https://gitea.encke-hake.ts.net/BalboSoft/Chronos/src/branch/main/SECURITY.md about: Please report security problems privately, never in a public issue. diff --git a/deploy/releases-repo/.github/ISSUE_TEMPLATE/translation_review.yml b/.gitea/ISSUE_TEMPLATE/translation_review.yml similarity index 94% rename from deploy/releases-repo/.github/ISSUE_TEMPLATE/translation_review.yml rename to .gitea/ISSUE_TEMPLATE/translation_review.yml index 4ef53de2..3d0c14d3 100644 --- a/deploy/releases-repo/.github/ISSUE_TEMPLATE/translation_review.yml +++ b/.gitea/ISSUE_TEMPLATE/translation_review.yml @@ -1,5 +1,5 @@ name: Translation review -description: A wrong, unclear or too long text in a translated version of Titano. +about: A wrong, unclear or too long text in a translated version of Chronos. title: "[Translation] " labels: ["translation"] body: diff --git a/.github/scripts/check-yaml.rb b/.gitea/scripts/check-yaml.rb similarity index 77% rename from .github/scripts/check-yaml.rb rename to .gitea/scripts/check-yaml.rb index 8e82d3c1..c4b8a79b 100644 --- a/.github/scripts/check-yaml.rb +++ b/.gitea/scripts/check-yaml.rb @@ -1,11 +1,11 @@ -# Parses YAML files and checks the shape of GitHub issue forms, so a broken workflow, compose file or issue form fails -# CI instead of being skipped by GitHub (an issue form that does not parse is simply not offered). -# Usage: ruby .github/scripts/check-yaml.rb FILE... +# Parses YAML files and checks the shape of Gitea issue forms, so a broken workflow, compose file or issue form fails +# CI instead of failing on Gitea (an issue form that does not parse is simply not offered). +# Usage: ruby .gitea/scripts/check-yaml.rb FILE... require "yaml" def issue_form_problem(doc) return "the form is not a mapping" unless doc.is_a?(Hash) - return "the form needs a name and a description" unless doc["name"].is_a?(String) && doc["description"].is_a?(String) + return "the form needs a name and an about text" unless doc["name"].is_a?(String) && doc["about"].is_a?(String) return "the form needs a body list" unless doc["body"].is_a?(Array) && !doc["body"].empty? ids = [] diff --git a/.github/scripts/installer-test.ps1 b/.gitea/scripts/installer-test.ps1 similarity index 79% rename from .github/scripts/installer-test.ps1 rename to .gitea/scripts/installer-test.ps1 index 98cf8f9b..126ecbcd 100644 --- a/.github/scripts/installer-test.ps1 +++ b/.gitea/scripts/installer-test.ps1 @@ -1,5 +1,5 @@ # Installs, runs, upgrades and removes the packed installers on a clean Windows runner (BRIEF §18): silent mode, -# folder with a space, Add/Remove Programs entry, shortcuts, the .titano file type, upgrade in place (files of the +# folder with a space, Add/Remove Programs entry, shortcuts, the .chronos file type, upgrade in place (files of the # previous version removed), user data kept, the uninstaller removing itself, and the documented exit codes. param( [Parameter(Mandatory)] [string] $Setup1, @@ -48,14 +48,14 @@ function Get-DefaultValue([string] $Key) { return (Get-Item -LiteralPath $Key).GetValue('') } -$dir = Join-Path $env:RUNNER_TEMP 'Titano Test' -$entryKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Titano' +$dir = Join-Path $env:RUNNER_TEMP 'Chronos Test' +$entryKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Chronos' $programs = [Environment]::GetFolderPath('Programs') $desktop = [Environment]::GetFolderPath('DesktopDirectory') $links = @( - (Join-Path $programs 'Titano.lnk'), (Join-Path $programs 'Titano Uploader.lnk'), - (Join-Path $desktop 'Titano.lnk'), (Join-Path $desktop 'Titano Uploader.lnk')) -$userData = Join-Path $env:LOCALAPPDATA 'Titano' + (Join-Path $programs 'Chronos.lnk'), (Join-Path $programs 'Chronos Uploader.lnk'), + (Join-Path $desktop 'Chronos.lnk'), (Join-Path $desktop 'Chronos Uploader.lnk')) +$userData = Join-Path $env:LOCALAPPDATA 'Chronos' $userFile = Join-Path $userData 'kept-by-setup.txt' New-Item -ItemType Directory -Force -Path $userData | Out-Null Set-Content -LiteralPath $userFile -Value 'user data' @@ -66,19 +66,19 @@ Assert-True ((Invoke-Program $Setup1 @('/S', '/uninstall')) -eq 6) 'removing a p Write-Host "--- Install $Version1 into '$dir'" Assert-True ((Invoke-Program $Setup1 @('/S', "/DIR=$dir")) -eq 0) 'silent install exits with 0' -foreach ($file in 'Titano.exe', 'Titano.Uploader.exe', 'Uninstall Titano.exe', 'install-log.json', 'legacy.txt') { +foreach ($file in 'Chronos.exe', 'Chronos.Uploader.exe', 'Uninstall Chronos.exe', 'install-log.json', 'legacy.txt') { Assert-True (Test-Path -LiteralPath (Join-Path $dir $file)) "$file installed" } $entry = Get-ItemProperty -LiteralPath $entryKey Assert-True ($entry.DisplayVersion -eq $Version1) "Add/Remove Programs lists version $Version1" Assert-True ($entry.InstallLocation -eq $dir) 'Add/Remove Programs lists the chosen folder' -Assert-True ($entry.QuietUninstallString -eq "`"$(Join-Path $dir 'Uninstall Titano.exe')`" /uninstall /S") 'quiet uninstall command points at the uninstaller' +Assert-True ($entry.QuietUninstallString -eq "`"$(Join-Path $dir 'Uninstall Chronos.exe')`" /uninstall /S") 'quiet uninstall command points at the uninstaller' foreach ($link in $links) { Assert-True (Test-Path -LiteralPath $link) "shortcut '$link' created" } -Assert-True ((Get-DefaultValue 'HKCU:\Software\Classes\.titano') -eq 'Titano.Project') '.titano opens with Titano' -Assert-True ((Get-DefaultValue 'HKCU:\Software\Classes\Titano.Project\shell\open\command') -eq "`"$(Join-Path $dir 'Titano.exe')`" `"%1`"") 'Titano.Project opens the installed Titano.exe' +Assert-True ((Get-DefaultValue 'HKCU:\Software\Classes\.chronos') -eq 'Chronos.Project') '.chronos opens with Chronos' +Assert-True ((Get-DefaultValue 'HKCU:\Software\Classes\Chronos.Project\shell\open\command') -eq "`"$(Join-Path $dir 'Chronos.exe')`" `"%1`"") 'Chronos.Project opens the installed Chronos.exe' Write-Host '--- Run the installed programs' -foreach ($program in 'Titano.exe', 'Titano.Uploader.exe') { +foreach ($program in 'Chronos.exe', 'Chronos.Uploader.exe') { $before = @(Get-ChildItem -Path $Screenshots -Filter *.png -ErrorAction SilentlyContinue).Count $code = Invoke-Program (Join-Path $dir $program) @('--capture', $Screenshots) $count = @(Get-ChildItem -Path $Screenshots -Filter *.png -ErrorAction SilentlyContinue).Count - $before @@ -89,25 +89,25 @@ Write-Host "--- Upgrade in place to $Version2" Assert-True ((Invoke-Program $Setup2 @('/S')) -eq 0) 'silent upgrade exits with 0' Assert-True ((Get-ItemProperty -LiteralPath $entryKey).DisplayVersion -eq $Version2) "Add/Remove Programs lists version $Version2" Assert-True ((Get-Content -Raw -LiteralPath (Join-Path $dir 'install-log.json') | ConvertFrom-Json).version -eq $Version2) "install log records version $Version2" -Assert-True (Test-Path -LiteralPath (Join-Path $dir 'Titano.exe')) 'Titano.exe still installed' +Assert-True (Test-Path -LiteralPath (Join-Path $dir 'Chronos.exe')) 'Chronos.exe still installed' Assert-True (-not (Test-Path -LiteralPath (Join-Path $dir 'legacy.txt'))) 'a file only the previous version had is removed' foreach ($link in $links) { Assert-True (Test-Path -LiteralPath $link) "shortcut '$link' kept" } Assert-True (Test-Path -LiteralPath $userFile) 'user data kept by the upgrade' Write-Host '--- Uninstall with the installed uninstaller' -Assert-True ((Invoke-Program (Join-Path $dir 'Uninstall Titano.exe') @('/uninstall', '/S')) -eq 0) 'silent uninstall exits with 0' +Assert-True ((Invoke-Program (Join-Path $dir 'Uninstall Chronos.exe') @('/uninstall', '/S')) -eq 0) 'silent uninstall exits with 0' Assert-True (Wait-Removed $dir) 'install folder removed, uninstaller included' Assert-True (-not (Test-Path -LiteralPath $entryKey)) 'Add/Remove Programs entry removed' foreach ($link in $links) { Assert-True (-not (Test-Path -LiteralPath $link)) "shortcut '$link' removed" } -Assert-True (-not (Test-Path -LiteralPath 'HKCU:\Software\Classes\Titano.Project')) 'Titano.Project file type removed' -Assert-True ($null -eq (Get-DefaultValue 'HKCU:\Software\Classes\.titano')) '.titano no longer opens with Titano' +Assert-True (-not (Test-Path -LiteralPath 'HKCU:\Software\Classes\Chronos.Project')) 'Chronos.Project file type removed' +Assert-True ($null -eq (Get-DefaultValue 'HKCU:\Software\Classes\.chronos')) '.chronos no longer opens with Chronos' Assert-True (Test-Path -LiteralPath $userFile) 'user data kept by the uninstall' Write-Host '--- Uploader installer: default folder, removal through the installer itself' -$uploaderDir = Join-Path $env:LOCALAPPDATA 'Programs\Titano Uploader' -$uploaderKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\TitanoUploader' +$uploaderDir = Join-Path $env:LOCALAPPDATA 'Programs\Chronos Uploader' +$uploaderKey = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\ChronosUploader' Assert-True ((Invoke-Program $UploaderSetup @('/S')) -eq 0) 'silent Uploader install exits with 0' -Assert-True (Test-Path -LiteralPath (Join-Path $uploaderDir 'Titano.Uploader.exe')) 'Uploader installed in %LOCALAPPDATA%\Programs\Titano Uploader' +Assert-True (Test-Path -LiteralPath (Join-Path $uploaderDir 'Chronos.Uploader.exe')) 'Uploader installed in %LOCALAPPDATA%\Programs\Chronos Uploader' Assert-True (Test-Path -LiteralPath $uploaderKey) 'Uploader listed in Add/Remove Programs' Assert-True ((Invoke-Program $UploaderSetup @('/uninstall', '/S')) -eq 0) 'silent Uploader removal exits with 0' Assert-True (Wait-Removed $uploaderDir) 'Uploader folder removed' diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 00000000..a0cf340d --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,342 @@ +name: CI + +# Gitea Actions (BRIEF §19.1, amended 2026-10-23, R3). The runner is act_runner in Docker mode on the Linux server +# that also runs Gitea: every job runs in a container, one job at a time. The .NET jobs use the SDK image (kept by the +# host after the first pull) and check out with git, because JavaScript actions need Node.js, which that image lacks; +# nothing is uploaded as an artifact or cached. Builds use BUILD_CPUS cores so the host keeps memory for Gitea. +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +env: + DOTNET_NOLOGO: "1" + DOTNET_CLI_TELEMETRY_OPTOUT: "1" + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" + TOOLS: src/Chronos.Tools/bin/Release/net10.0/Chronos.Tools.dll + BUILD_CPUS: "4" + # The runner shares its CPU and disks with the server's other services: timed tests get three times their budget + # (Chronos.Testing TestTiming); the performance gates of perf.yml keep theirs. + CHRONOS_TEST_TIME_FACTOR: "3" + +jobs: + build: + name: Build and test + runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/dotnet/sdk:10.0 + timeout-minutes: 90 + defaults: + run: + shell: bash + steps: + - name: Checkout + env: + TOKEN: ${{ github.token }} + run: | + git config --global --add safe.directory "$PWD" + git init -q . + git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}" + git checkout -q FETCH_HEAD + git log -1 --format='%h %s' + + # Chronos.Data binds the system SQLite library (BRIEF §6.2), which the SDK image lacks. + - name: System SQLite + run: apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends libsqlite3-0 > /dev/null + + - name: .NET info + run: dotnet --info + + # The Windows projects compile here too (EnableWindowsTargeting); their tests need Windows (job windows below). + - name: Build (warnings are errors) + run: dotnet build Chronos.slnx -c Release -m:"$BUILD_CPUS" + + - name: Zero-package guard + run: dotnet "$TOOLS" package-guard + + - name: Localization check + run: dotnet "$TOOLS" i18n check + + - name: XAML lint + run: dotnet "$TOOLS" xaml-lint + + - name: Format check + run: dotnet format whitespace Chronos.slnx --verify-no-changes + + # Missing samples become "RAW fixture missing" warnings in the log; the tests that need them skip. + - name: Fetch CC0 fixtures + run: dotnet "$TOOLS" fixtures --allow-missing + + - name: Test · Core + run: dotnet run --project tests/Chronos.Core.Tests -c Release --no-build -- --junit out/junit/core.xml + + - name: Test · Data (SQLite) + run: dotnet run --project tests/Chronos.Data.Tests -c Release --no-build -- --junit out/junit/data.xml + + - name: Test · Server + run: dotnet run --project tests/Chronos.Server.Tests -c Release --no-build -- --junit out/junit/server.xml + + - name: Test · Tools + run: dotnet run --project tests/Chronos.Tools.Tests -c Release --no-build -- --junit out/junit/tools.xml + + # The release cross-compiles the Windows programs on Linux (BRIEF §18, amended 2026-10-23, R3): every push checks + # that they still publish with their icon, version and manifest, and that the installer packs. ReadyToRun is + # left out here (only start-up time differs) to keep the run short. + - name: Windows programs (win-x64, cross-compiled) + run: | + common="-c Release -r win-x64 --self-contained -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRun=false -m:$BUILD_CPUS" + for p in Chronos.App Chronos.Uploader Chronos.Setup; do + dotnet publish "src/$p/$p.csproj" $common -o "out/publish/$p" + done + dotnet "$TOOLS" pack-installer --setup out/publish/Chronos.Setup/Chronos.Setup.exe --product Chronos \ + --component "Chronos=out/publish/Chronos.App" --component "Uploader=out/publish/Chronos.Uploader" \ + --version 0.0.0 --out out/installers/Chronos-Setup-ci.exe + dotnet "$TOOLS" pe-check out/publish/Chronos.App/Chronos.exe out/publish/Chronos.Uploader/Chronos.Uploader.exe \ + out/publish/Chronos.Setup/Chronos.Setup.exe out/installers/Chronos-Setup-ci.exe + + # The wire tests of MD5, cleartext, trust and TLS (BRIEF §6.3) run against a service container that postgres-ci + # prepares through SQL; a server that refuses TLS fails them instead of skipping them. + postgres: + name: PostgreSQL ${{ matrix.pg }} integration + needs: build + strategy: + fail-fast: false + matrix: + pg: ["16", "17"] + runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/dotnet/sdk:10.0 + timeout-minutes: 45 + services: + postgres: + image: postgres:${{ matrix.pg }} + env: + POSTGRES_USER: chronos + POSTGRES_PASSWORD: chronos-ci + POSTGRES_DB: chronos_test + defaults: + run: + shell: bash + env: + CHRONOS_TEST_PG: Host=postgres;Port=5432;Database=chronos_test;Username=chronos;Password=chronos-ci;SslMode=disable + CHRONOS_TEST_PG_MD5: Host=postgres;Port=5432;Database=chronos_test;Username=chronos_md5;Password=md5-ci;SslMode=disable + CHRONOS_TEST_PG_CLEARTEXT: Host=postgres;Port=5432;Database=chronos_test;Username=chronos_clear;Password=clear-ci;SslMode=disable + CHRONOS_TEST_PG_TRUST: Host=postgres;Port=5432;Database=chronos_test;Username=chronos_trust;SslMode=disable + CHRONOS_TEST_PG_TLS: "1" + steps: + - name: Checkout + env: + TOKEN: ${{ github.token }} + run: | + git config --global --add safe.directory "$PWD" + git init -q . + git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}" + git checkout -q FETCH_HEAD + + # Chronos.Data binds the system SQLite library (BRIEF §6.2), which the SDK image lacks. + - name: System SQLite + run: apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends libsqlite3-0 > /dev/null + + - name: Configure PostgreSQL (MD5, cleartext, trust, TLS) + run: | + dotnet run --project src/Chronos.Tools -c Release -- postgres-ci --connection "$CHRONOS_TEST_PG" --host postgres --certificates "$RUNNER_TEMP/pg-tls" + echo "CHRONOS_TEST_PG_ROOT_CERT=$RUNNER_TEMP/pg-tls/server.crt" >> "$GITHUB_ENV" + + - name: Test · Data (PostgreSQL) + run: dotnet run --project tests/Chronos.Data.Tests -c Release -- --junit out/junit/data-pg${{ matrix.pg }}.xml + + - name: Test · Server (PostgreSQL) + run: dotnet run --project tests/Chronos.Server.Tests -c Release -- --junit out/junit/server-pg${{ matrix.pg }}.xml + + # The runner's own image has the docker CLI and talks to the host's daemon: the image is built there and runs with + # PostgreSQL 17 on a network of this job, which the job container joins to reach it. Everything the job creates is + # labelled with the job container's id: a cancelled or timed-out job skips its clean-up step, so the next job removes + # what a job that no longer exists left on the host. + docker: + name: Docker image + needs: build + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - name: Remove what cancelled jobs left + run: | + echo "NAME=chronos-ci-$(hostname)" >> "$GITHUB_ENV" + for c in $(docker ps -aq --filter label=chronos-ci.job); do + job="$(docker inspect -f '{{index .Config.Labels "chronos-ci.job"}}' "$c")" + docker inspect "$job" > /dev/null 2>&1 || docker rm -f -v "$c" + done + for n in $(docker network ls -q --filter label=chronos-ci.job); do + job="$(docker network inspect -f '{{index .Labels "chronos-ci.job"}}' "$n")" + docker inspect "$job" > /dev/null 2>&1 || docker network rm "$n" + done + for i in $(docker image ls -q --filter label=chronos-ci.job | sort -u); do + job="$(docker image inspect -f '{{index .Config.Labels "chronos-ci.job"}}' "$i")" + docker inspect "$job" > /dev/null 2>&1 || docker image rm -f "$i" + done + + - name: Checkout + env: + TOKEN: ${{ github.token }} + run: | + git config --global --add safe.directory "$PWD" + git init -q . + git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}" + git checkout -q FETCH_HEAD + + - name: Build image + run: | + docker buildx version + docker build -f deploy/docker/Dockerfile --build-arg CHRONOS_VERSION=0.0.0-ci --label chronos-ci.job="$(hostname)" -t "$NAME:image" . + + - name: Smoke test (/health) + run: | + docker network create --label chronos-ci.job="$(hostname)" "$NAME" + docker network connect "$NAME" "$(hostname)" + docker run -d --name "$NAME-pg" --network "$NAME" --label chronos-ci.job="$(hostname)" \ + -e POSTGRES_USER=chronos -e POSTGRES_PASSWORD=chronos-ci -e POSTGRES_DB=chronos postgres:17 + for i in $(seq 1 60); do + if docker exec "$NAME-pg" pg_isready -q -U chronos -d chronos; then break; fi + sleep 2 + done + docker run -d --name "$NAME-server" --network "$NAME" --label chronos-ci.job="$(hostname)" \ + -e CHRONOS_DB_HOST="$NAME-pg" -e CHRONOS_DB_USER=chronos -e CHRONOS_DB_PASSWORD=chronos-ci -e CHRONOS_DB_NAME=chronos \ + -e CHRONOS_ADMIN_USER=admin -e CHRONOS_ADMIN_PASSWORD=ci-password-1234 "$NAME:image" + for i in $(seq 1 60); do + if curl -fsS --max-time 10 "http://$NAME-server:8080/health"; then echo; break; fi + sleep 2 + done + curl -fsS --max-time 10 "http://$NAME-server:8080/api/v1/server/info" + echo + curl -fsSk --max-time 10 "https://$NAME-server:8443/health" + echo + test "$(docker inspect --format '{{.State.Running}}' "$NAME-server")" = "true" + + - name: Container logs and clean-up + if: always() + run: | + docker logs "$NAME-server" || true + docker rm -f -v "$NAME-server" "$NAME-pg" || true + docker network disconnect "$NAME" "$(hostname)" || true + docker network rm "$NAME" || true + docker image rm "$NAME:image" || true + + # Gitea fails a workflow that does not parse and offers no issue form that does not. The sources come as an archive: + # the Ruby image has no git. + yaml: + name: YAML check + runs-on: ubuntu-latest + container: + image: ruby:3.3-alpine + timeout-minutes: 15 + steps: + - name: Workflows, compose file and public issue forms + env: + TOKEN: ${{ github.token }} + run: | + wget -q --header "Authorization: token $TOKEN" -O /tmp/sources.tar.gz \ + "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/archive/${{ github.sha }}.tar.gz" + mkdir -p /tmp/sources && tar -xzf /tmp/sources.tar.gz -C /tmp/sources + cd /tmp/sources/*/ + ruby .gitea/scripts/check-yaml.rb .gitea/workflows/*.yml .gitea/ISSUE_TEMPLATE/*.yml deploy/docker/docker-compose.yml + + # Windows-only tests, screenshots and the installer test (BRIEF §18, §20.2) need a Windows runner: register an + # act_runner on a Windows PC in host mode with a label (for example "windows") and set the repository variable + # WINDOWS_RUNNER to that label. Without it the job is skipped. The PC needs the .NET SDK of global.json, Git for + # Windows in its default folder (C:/Program Files/Git) and PowerShell 7. + windows: + name: Windows tests and installer + needs: build + if: ${{ vars.WINDOWS_RUNNER != '' }} + runs-on: ${{ vars.WINDOWS_RUNNER || 'windows' }} + timeout-minutes: 90 + permissions: + contents: write + # act finds a shell on PATH, where Git for Windows puts no bash.exe by default (and WSL's launcher may come + # first): Git Bash by its path, whose wrapper also puts its tools (base64, printf) on PATH. + defaults: + run: + shell: '"C:/Program Files/Git/bin/bash.exe" --noprofile --norc -e -o pipefail {0}' + steps: + - name: Checkout + env: + TOKEN: ${{ github.token }} + run: | + # A host-mode runner keeps its work folder between runs: reuse the clone. + git init -q . + git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" 2>/dev/null || + git remote set-url origin "${{ github.server_url }}/${{ github.repository }}.git" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}" + git checkout -q -f FETCH_HEAD + git clean -q -fdx + + - name: Build + run: dotnet build Chronos.slnx -c Release + + - name: Test · Core.Windows + run: dotnet run --project tests/Chronos.Core.Windows.Tests -c Release --no-build -- --junit out/junit/core-windows.xml + + - name: Test · App + run: dotnet run --project tests/Chronos.App.Tests -c Release --no-build -- --junit out/junit/app.xml + + - name: Screenshots + if: ${{ !cancelled() }} + timeout-minutes: 10 + run: | + rm -rf out/screenshots + for exe in src/Chronos.App/bin/Release/net10.0-windows/Chronos.exe src/Chronos.Uploader/bin/Release/net10.0-windows/Chronos.Uploader.exe \ + src/Chronos.Setup/bin/Release/net10.0-windows/Chronos.Setup.exe; do + "$exe" --capture out/screenshots & + wait $! || { echo "::error title=Screenshots::$(basename "$exe") --capture exited with $?"; exit 1; } + done + ls out/screenshots + + # Same-repository pull requests: the pictures go to the ci-screenshots branch (one commit, overwritten each run), + # where tests/visual/baselines/README.md takes new baselines from. Before the diff, which may fail the job. + - name: Publish to the ci-screenshots branch + if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} + working-directory: out/screenshots + env: + TOKEN: ${{ github.token }} + run: | + git init -q -b ci-screenshots + git config user.name "chronos-ci" + git config user.email "chronos-ci@noreply.invalid" + git add -A + git commit -q -m "Screenshots of ${{ github.event.pull_request.head.sha }}" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" push -q -f \ + "${{ github.server_url }}/${{ github.repository }}.git" HEAD:refs/heads/ci-screenshots + + # BRIEF §20.2 visual regression against tests/visual/baselines (a warning only until baselines are committed). + - name: Screenshot diff + if: ${{ !cancelled() }} + run: dotnet src/Chronos.Tools/bin/Release/net10.0/Chronos.Tools.dll screenshots diff out/screenshots --baseline tests/visual/baselines --out out/screenshot-diff + + - name: Install, run, upgrade and remove + shell: pwsh + run: | + foreach ($p in 'Chronos.App', 'Chronos.Uploader', 'Chronos.Setup') { + dotnet publish "src/$p/$p.csproj" -c Release -r win-x64 --self-contained -p:PublishSingleFile=true ` + -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRun=false -o "out/publish/$p" + if ($LASTEXITCODE -ne 0) { throw "dotnet publish $p failed" } + } + Remove-Item -Recurse -Force out/app-v1, out/installers -ErrorAction SilentlyContinue + Copy-Item -Recurse out/publish/Chronos.App out/app-v1 + Set-Content -LiteralPath out/app-v1/legacy.txt -Value 'only in version 1' + $tools = 'src/Chronos.Tools/bin/Release/net10.0/Chronos.Tools.dll' + $installers = @( + @('--product', 'Chronos', '--version', '1.0.0', '--component', 'Chronos=out/app-v1', + '--component', 'Uploader=out/publish/Chronos.Uploader', '--out', 'out/installers/Chronos-Setup-1.0.0.exe'), + @('--product', 'Chronos', '--version', '1.0.1', '--component', 'Chronos=out/publish/Chronos.App', + '--component', 'Uploader=out/publish/Chronos.Uploader', '--out', 'out/installers/Chronos-Setup-1.0.1.exe'), + @('--product', 'Chronos Uploader', '--version', '1.0.1', '--component', 'Uploader=out/publish/Chronos.Uploader', + '--out', 'out/installers/Chronos-Uploader-Setup-1.0.1.exe')) + foreach ($installer in $installers) { + dotnet $tools pack-installer --setup out/publish/Chronos.Setup/Chronos.Setup.exe @installer + if ($LASTEXITCODE -ne 0) { throw "pack-installer $installer failed" } + } + ./.gitea/scripts/installer-test.ps1 -Setup1 out/installers/Chronos-Setup-1.0.0.exe -Setup2 out/installers/Chronos-Setup-1.0.1.exe ` + -UploaderSetup out/installers/Chronos-Uploader-Setup-1.0.1.exe -Version1 1.0.0 -Version2 1.0.1 -Screenshots out/installer-screenshots diff --git a/.gitea/workflows/docker.yml b/.gitea/workflows/docker.yml new file mode 100644 index 00000000..7d6c5f3f --- /dev/null +++ b/.gitea/workflows/docker.yml @@ -0,0 +1,57 @@ +name: Nightly image + +# The server image of main as :nightly in the Gitea container registry (BRIEF §19.5, amended 2026-10-23, R3). Built by +# the host's daemon through the runner's own image, as in release.yml (linux/amd64). +on: + schedule: + - cron: "17 2 * * *" + workflow_dispatch: + +permissions: + contents: read + packages: write + +env: + PUBLIC_URL: ${{ vars.PUBLIC_URL || 'https://gitea.encke-hake.ts.net' }} + +jobs: + nightly: + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - name: Checkout + env: + TOKEN: ${{ github.token }} + run: | + git config --global --add safe.directory "$PWD" + git init -q . + git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}" + git checkout -q FETCH_HEAD + + - name: Sign in to the registry + env: + REGISTRY: ${{ vars.REGISTRY }} + USER: ${{ vars.REGISTRY_USER || github.actor }} + TOKEN: ${{ secrets.REGISTRY_TOKEN || github.token }} + run: | + registry="${REGISTRY:-$(printf '%s' "$PUBLIC_URL" | sed -E 's#^[a-z]+://##; s#/.*$##')}" + owner="$(printf '%s' "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" + { echo "REGISTRY_HOST=$registry"; echo "IMAGE=$registry/$owner/chronos-server"; } >> "$GITHUB_ENV" + if ! printf '%s' "$TOKEN" | docker login "$registry" -u "$USER" --password-stdin; then + # The workflow's own token (user gitea-actions) has no package permission on an organisation's registry. + echo "::error title=Registry::Sign-in to $registry refused. Add the repository secret REGISTRY_TOKEN: an access token of a user who can write the owner's packages (scope package: read and write)." + exit 1 + fi + + - name: Build and push + run: | + docker build -f deploy/docker/Dockerfile --build-arg CHRONOS_VERSION="0.0.0-nightly.${{ github.run_number }}" -t "$IMAGE:nightly" . + docker push "$IMAGE:nightly" + + - name: Clean up + if: always() + run: | + docker image rm "$IMAGE:nightly" 2> /dev/null || true + docker logout "$REGISTRY_HOST" || true diff --git a/.gitea/workflows/perf.yml b/.gitea/workflows/perf.yml new file mode 100644 index 00000000..0d4bd6f4 --- /dev/null +++ b/.gitea/workflows/perf.yml @@ -0,0 +1,64 @@ +name: Performance gates + +# BRIEF §1.1 and the Phase 2/3 gates on a synthetic 500,000-photo library (SQLite and PostgreSQL 17) and a +# 100,000-frame archive rebuild from sidecars. Too slow for every push: weekly and on demand. The timings are printed +# at the end of the log (Gitea shows no job summary). +on: + schedule: + - cron: "41 3 * * 1" + workflow_dispatch: + +permissions: + contents: read + +env: + DOTNET_NOLOGO: "1" + DOTNET_CLI_TELEMETRY_OPTOUT: "1" + +jobs: + perf: + name: Library and rebuild gates + runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/dotnet/sdk:10.0 + timeout-minutes: 120 + services: + postgres: + image: postgres:17 + env: + POSTGRES_USER: chronos + POSTGRES_PASSWORD: chronos-ci + POSTGRES_DB: chronos_perf + defaults: + run: + shell: bash + env: + CHRONOS_PERF: "1" + CHRONOS_TEST_PG: Host=postgres;Port=5432;Database=chronos_perf;Username=chronos;Password=chronos-ci;SslMode=disable + steps: + - name: Checkout + env: + TOKEN: ${{ github.token }} + run: | + git config --global --add safe.directory "$PWD" + git init -q . + git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "${{ github.sha }}" + git checkout -q FETCH_HEAD + + # Chronos.Data binds the system SQLite library (BRIEF §6.2), which the SDK image lacks. + - name: System SQLite + run: apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends libsqlite3-0 > /dev/null + + - name: Build + run: dotnet build tests/Chronos.Data.Tests -c Release -m:4 + + - name: Perf tests (SQLite, PostgreSQL 17) + run: | + dotnet run --project tests/Chronos.Data.Tests -c Release --no-build -- --filter category:perf --verbose --junit out/junit/perf.xml | tee out-perf.log + + - name: Timings + if: always() + run: | + echo "Performance gates" + if grep -q "perf:" out-perf.log 2>/dev/null; then grep -h "perf:" out-perf.log | sed 's/^ *//'; else echo "no timings recorded"; fi diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 00000000..40b3b888 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,309 @@ +name: Release + +# A tag vMAJOR.MINOR.PATCH[-PRERELEASE] builds, tests and publishes everything (BRIEF §19.3, amended 2026-10-23, R3) +# on the Linux runner: the Windows programs cross-compiled (installers, portable and server zips), SHA256SUMS and +# release notes on the Gitea release, then the server image in the Gitea container registry. Pre-releases get no +# :latest image and are ignored by the in-app update check. +on: + push: + tags: ["v*"] + workflow_dispatch: + inputs: + tag: + description: "Existing tag to (re)publish, e.g. v0.2.0" + required: true + +permissions: + contents: write + packages: write + +env: + DOTNET_NOLOGO: "1" + DOTNET_CLI_TELEMETRY_OPTOUT: "1" + TOOLS: src/Chronos.Tools/bin/Release/net10.0/Chronos.Tools.dll + BUILD_CPUS: "4" + # Timed tests get three times their budget on the shared runner (Chronos.Testing TestTiming, as in ci.yml). + CHRONOS_TEST_TIME_FACTOR: "3" + TAG: ${{ github.event.inputs.tag || github.ref_name }} + # Where people and programs reach Gitea (the runner itself uses github.server_url). Variable PUBLIC_URL overrides it. + PUBLIC_URL: ${{ vars.PUBLIC_URL || 'https://gitea.encke-hake.ts.net' }} + # The repository (owner/name on this Gitea) that receives the release: this one, or RELEASES_REPO together with the + # RELEASES_TOKEN secret (an access token with write access to it). Every build embeds its address as + # ChronosReleasesUrl, so the update check, licence and issue links read the repository published to. + RELEASES_REPO: ${{ vars.RELEASES_REPO || github.repository }} + +jobs: + release: + name: Build, test and publish + runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/dotnet/sdk:10.0 + timeout-minutes: 150 + defaults: + run: + shell: bash + env: + # Secrets cannot appear in step conditions: expose only whether signing is configured. + HAS_SIGNING: ${{ secrets.SIGN_PFX_BASE64 != '' }} + outputs: + version: ${{ steps.version.outputs.version }} + latest: ${{ steps.publish.outputs.latest }} + steps: + - name: Version + id: version + run: | + if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then + echo "::error title=Release::Tag '$TAG' is not vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-PRERELEASE" + exit 1 + fi + version="${TAG#v}" + prerelease=false + if [[ "$version" == *-* ]]; then prerelease=true; fi + echo "version=$version" >> "$GITHUB_OUTPUT" + { echo "VERSION=$version"; echo "PRERELEASE=$prerelease"; } >> "$GITHUB_ENV" + + # Full history and tags: the release notes list the commits since the previous tag. + - name: Checkout + env: + TOKEN: ${{ github.token }} + run: | + git config --global --add safe.directory "$PWD" + git init -q . + git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --tags origin + git checkout -q "refs/tags/$TAG" + git log -1 --format='%h %s' + + # Chronos.Data binds the system SQLite library (BRIEF §6.2), which the SDK image lacks. + - name: System SQLite + run: apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends libsqlite3-0 > /dev/null + + - name: Release target + env: + HAS_RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN != '' }} + run: | + target="$RELEASES_REPO" + if [ "$target" != "${{ github.repository }}" ] && [ "$HAS_RELEASES_TOKEN" != "true" ]; then + echo "::warning title=Release::RELEASES_TOKEN is not set: publishing to ${{ github.repository }} instead of $target." + target="${{ github.repository }}" + fi + { echo "TARGET=$target"; echo "CHRONOS_RELEASES_URL=${PUBLIC_URL%/}/$target"; } >> "$GITHUB_ENV" + echo "Release $TAG of $target; programs link ${PUBLIC_URL%/}/$target" + + - name: Build and test + run: | + dotnet build Chronos.slnx -c Release -m:"$BUILD_CPUS" -p:ChronosVersion="$VERSION" -p:ChronosReleasesUrl="$CHRONOS_RELEASES_URL" + dotnet "$TOOLS" package-guard + dotnet "$TOOLS" i18n check + for t in Core Data Server Tools; do + dotnet run --project "tests/Chronos.$t.Tests" -c Release --no-build -- --junit "out/junit/$t.xml" + done + + # Cross-compiled on Linux (EnableWindowsTargeting); pe-check stops the release if a program lost its icon, + # version information or DPI-aware manifest. + - name: Publish self-contained programs (win-x64) + run: | + common="-c Release -r win-x64 --self-contained -p:ChronosVersion=$VERSION -p:ChronosReleasesUrl=$CHRONOS_RELEASES_URL -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none -m:$BUILD_CPUS" + dotnet publish src/Chronos.App/Chronos.App.csproj $common -p:PublishReadyToRun=true -o out/publish/app + dotnet publish src/Chronos.Uploader/Chronos.Uploader.csproj $common -p:PublishReadyToRun=true -o out/publish/uploader + dotnet publish src/Chronos.Server/Chronos.Server.csproj $common -o out/publish/server + dotnet publish src/Chronos.Setup/Chronos.Setup.csproj $common -p:PublishReadyToRun=true -o out/publish/setup + dotnet "$TOOLS" pe-check out/publish/app/Chronos.exe out/publish/uploader/Chronos.Uploader.exe out/publish/setup/Chronos.Setup.exe + + # Authenticode with osslsigncode, the Linux counterpart of signtool (BRIEF §18); unsigned builds are still released. + - name: Sign programs + if: env.HAS_SIGNING == 'true' + env: + SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }} + SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }} + run: | + apt-get update -qq && apt-get install -y -qq osslsigncode > /dev/null + pfx="$RUNNER_TEMP/sign.pfx" + trap 'rm -f "$pfx"' EXIT + printf '%s' "$SIGN_PFX" | base64 -d > "$pfx" + for exe in out/publish/*/*.exe; do + osslsigncode sign -pkcs12 "$pfx" -pass "$SIGN_PASSWORD" -h sha256 -ts http://timestamp.digicert.com -in "$exe" -out "$exe.signed" + mv "$exe.signed" "$exe" + done + + - name: Package installers and archives + run: | + mkdir -p out/release + dotnet "$TOOLS" pack-installer --setup out/publish/setup/Chronos.Setup.exe --product Chronos \ + --component "Chronos=out/publish/app" --component "Uploader=out/publish/uploader" --component "Server=out/publish/server" \ + --version "$VERSION" --out "out/release/Chronos-Setup-$VERSION.exe" + dotnet "$TOOLS" pack-installer --setup out/publish/setup/Chronos.Setup.exe --product "Chronos Uploader" \ + --component "Uploader=out/publish/uploader" --version "$VERSION" --out "out/release/Chronos-Uploader-Setup-$VERSION.exe" + dotnet "$TOOLS" zip out/publish/server --out "out/release/Chronos-Server-win-x64-$VERSION.zip" + # The portable build keeps its data next to Chronos.exe because of portable.txt (never inside the installer). + cp -R out/publish/app out/portable + printf 'Chronos portable mode: settings, index and logs are kept in the data folder next to Chronos.exe.\r\n' > out/portable/portable.txt + dotnet "$TOOLS" zip out/portable --out "out/release/Chronos-win-x64-portable-$VERSION.zip" + dotnet "$TOOLS" pe-check out/release/*.exe + ls -l out/release + + - name: Sign installers + if: env.HAS_SIGNING == 'true' + env: + SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }} + SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }} + run: | + pfx="$RUNNER_TEMP/sign.pfx" + trap 'rm -f "$pfx"' EXIT + printf '%s' "$SIGN_PFX" | base64 -d > "$pfx" + for exe in out/release/*.exe; do + osslsigncode sign -pkcs12 "$pfx" -pass "$SIGN_PASSWORD" -h sha256 -ts http://timestamp.digicert.com -in "$exe" -out "$exe.signed" + mv "$exe.signed" "$exe" + done + + - name: Unsigned build notice + if: env.HAS_SIGNING != 'true' + run: echo "::notice title=Signing::SIGN_PFX_BASE64 is not set; the installers are unsigned." + + - name: Release notes + run: | + # A stable release lists everything since the previous stable one, not only what followed its last pre-release. + if [[ "$TAG" == *-* ]]; then + previous="$(git describe --tags --abbrev=0 "$TAG^" 2>/dev/null || true)" + else + previous="$(git describe --tags --abbrev=0 --exclude '*-*' "$TAG^" 2>/dev/null || true)" + fi + range="${previous:+$previous..}$TAG" + git log --no-merges --format='%h%x09%s' "$range" | dotnet "$TOOLS" changelog --title "Chronos $VERSION" --out out/release-notes.md + cat out/release-notes.md + + - name: Checksums + working-directory: out/release + run: | + rm -f SHA256SUMS + sha256sum -- * > "$RUNNER_TEMP/SHA256SUMS" + mv "$RUNNER_TEMP/SHA256SUMS" SHA256SUMS + cat SHA256SUMS + + # Created as a draft, published once every file is uploaded and listed at its size (gitea-release). + - name: Gitea release + id: publish + env: + AUTO_TOKEN: ${{ github.token }} + RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }} + run: | + token="$AUTO_TOKEN" + if [ "$TARGET" != "${{ github.repository }}" ]; then token="$RELEASES_TOKEN"; fi + GITEA_TOKEN="$token" dotnet "$TOOLS" gitea-release --server "${{ github.server_url }}" --repo "$TARGET" --tag "$TAG" \ + --title "Chronos $VERSION" --notes-file out/release-notes.md --assets out/release --prerelease "$PRERELEASE" + # The public content and the image's :latest follow the highest stable version (not Gitea's "latest", which + # is the most recently created one): re-publishing an older tag or publishing a pre-release never rolls them back. + stable="$(curl -fsS -H "Authorization: token $token" "${{ github.server_url }}/api/v1/repos/$TARGET/releases?draft=false&pre-release=false&limit=50")" + newest="$(printf '%s' "$stable" | grep -o '"tag_name":"v[^"]*"' | cut -d '"' -f 4 | sed 's/^v//' | sort -V | tail -n 1 || true)" + newest="${newest:+v$newest}" + latest=false + if [ "$PRERELEASE" = "false" ] && [ "$newest" = "$TAG" ]; then latest=true; fi + echo "Newest stable release of $TARGET: ${newest:-none}; $TAG moves the public content and :latest: $latest" + echo "latest=$latest" >> "$GITHUB_OUTPUT" + echo "LATEST=$latest" >> "$GITHUB_ENV" + + # Only with a separate releases repository (RELEASES_REPO and RELEASES_TOKEN, BRIEF §19.4): its README, EULA, + # security policy, issue forms, Unraid template, compose file, i18n/ and SHA256SUMS follow the newest stable + # release, with links to that repository and image. + - name: Update the public releases repository + if: env.LATEST == 'true' && env.TARGET != github.repository + env: + TOKEN: ${{ secrets.RELEASES_TOKEN }} + run: | + server="${{ github.server_url }}" + branch="$(curl -fsS -H "Authorization: token $TOKEN" "$server/api/v1/repos/$TARGET" | grep -o '"default_branch":"[^"]*"' | head -n 1 | cut -d '"' -f 4)" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" clone -q --depth 1 "$server/$TARGET.git" public + git -C public checkout -q -B "$branch" + cp -R deploy/releases-repo/. public/ + cp EULA.md SECURITY.md public/ + mkdir -p public/.gitea + rm -rf public/.gitea/ISSUE_TEMPLATE + cp -R .gitea/ISSUE_TEMPLATE public/.gitea/ISSUE_TEMPLATE + mkdir -p public/unraid public/docker + cp deploy/unraid/chronos.xml public/unraid/chronos.xml + # Unraid keeps a template's icon as a PNG: the 256 px one the build generated (make-icon), not the SVG source. + cp artifacts/icons/chronos-server-256.png public/unraid/chronos-server.png + # The screenshots of the public README are the approved baselines, once committed (tests/visual/baselines). + mkdir -p public/screenshots + for shot in library jobs settings-rendering server uploader-queue; do + if [ -f "tests/visual/baselines/$shot-dark.png" ]; then cp "tests/visual/baselines/$shot-dark.png" public/screenshots/; fi + done + cp deploy/docker/docker-compose.yml deploy/docker/.env.example public/docker/ + rm -rf public/i18n + cp -R i18n public/i18n + cp out/release/SHA256SUMS public/SHA256SUMS + registry="${{ vars.REGISTRY }}" + registry="${registry:-$(printf '%s' "$PUBLIC_URL" | sed -E 's#^[a-z]+://##; s#/.*$##')}" + owner="$(printf '%s' "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" + public="${PUBLIC_URL%/}" + find public -path public/.git -prune -o -type f \( -name '*.md' -o -name '*.yml' -o -name '*.xml' \) -print0 | + xargs -0 -r sed -i -e "s#https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/unraid/#$public/$TARGET/raw/branch/$branch/unraid/#g" \ + -e "s#https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/branding/chronos-server.svg#$public/$TARGET/raw/branch/$branch/unraid/chronos-server.png#g" \ + -e "s#https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/docker/#$public/$TARGET/raw/branch/$branch/docker/#g" \ + -e "s#https://gitea.encke-hake.ts.net/BalboSoft/Chronos\([^-A-Za-z0-9_.]\|\$\)#$public/$TARGET\1#g" \ + -e "s#gitea.encke-hake.ts.net/balbosoft/chronos-server#$registry/$owner/chronos-server#g" -e "s#docker login gitea.encke-hake.ts.net#docker login $registry#g" + cd public + git config user.name "chronos-release" + git config user.email "chronos-release@noreply.invalid" + git add -A + if git diff --cached --quiet; then + echo "Public repository already up to date." + else + git commit -q -m "chore: update for $TAG" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" push -q origin "HEAD:$branch" + fi + + # The server image (BRIEF §19.3) goes to the Gitea container registry of the repository owner once the release job's + # tests passed. The runner's own image has the docker CLI and builds with the host's daemon (linux/amd64; arm64 would + # need QEMU emulation installed on the host). REGISTRY, REGISTRY_USER and the REGISTRY_TOKEN secret override the + # registry (default: the host of PUBLIC_URL), the user and the token (default: the workflow's own). + image: + name: Server image + needs: release + runs-on: ubuntu-latest + timeout-minutes: 60 + env: + VERSION: ${{ needs.release.outputs.version }} + LATEST: ${{ needs.release.outputs.latest }} + steps: + - name: Checkout + env: + TOKEN: ${{ github.token }} + run: | + git config --global --add safe.directory "$PWD" + git init -q . + git remote add origin "${{ github.server_url }}/${{ github.repository }}.git" + git -c http.extraheader="Authorization: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)" fetch -q --depth=1 origin "refs/tags/$TAG:refs/tags/$TAG" + git checkout -q "refs/tags/$TAG" + + - name: Sign in to the registry + env: + REGISTRY: ${{ vars.REGISTRY }} + USER: ${{ vars.REGISTRY_USER || github.actor }} + TOKEN: ${{ secrets.REGISTRY_TOKEN || github.token }} + run: | + registry="${REGISTRY:-$(printf '%s' "$PUBLIC_URL" | sed -E 's#^[a-z]+://##; s#/.*$##')}" + owner="$(printf '%s' "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" + { echo "REGISTRY_HOST=$registry"; echo "IMAGE=$registry/$owner/chronos-server"; } >> "$GITHUB_ENV" + if ! printf '%s' "$TOKEN" | docker login "$registry" -u "$USER" --password-stdin; then + # The workflow's own token (user gitea-actions) has no package permission on an organisation's registry. + echo "::error title=Registry::Sign-in to $registry refused. Add the repository secret REGISTRY_TOKEN: an access token of a user who can write the owner's packages (scope package: read and write)." + exit 1 + fi + + - name: Build and push + run: | + docker build -f deploy/docker/Dockerfile --build-arg CHRONOS_VERSION="$VERSION" -t "$IMAGE:$VERSION" . + docker push "$IMAGE:$VERSION" + # Compose and Unraid users follow :latest: it moves only to the newest stable release. + if [ "$LATEST" = "true" ]; then + docker tag "$IMAGE:$VERSION" "$IMAGE:latest" + docker push "$IMAGE:latest" + fi + echo "Image: $IMAGE:$VERSION$([ "$LATEST" = "true" ] && echo " and :latest")" + + - name: Clean up + if: always() + run: | + docker image rm "$IMAGE:$VERSION" "$IMAGE:latest" 2> /dev/null || true + docker logout "$REGISTRY_HOST" || true diff --git a/.github/scripts/postgres-ci-setup.sh b/.github/scripts/postgres-ci-setup.sh deleted file mode 100644 index 78239047..00000000 --- a/.github/scripts/postgres-ci-setup.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env bash -# Prepares a PostgreSQL service container for the wire-protocol tests that need more than the image's defaults -# (BRIEF §6.3): one role per authentication method (MD5, cleartext, trust) with its pg_hba line ahead of the image's -# catch-all SCRAM line, and TLS with a self-signed certificate valid for localhost and 127.0.0.1. -# Usage: bash .github/scripts/postgres-ci-setup.sh CONTAINER SUPERUSER DATABASE CERTIFICATE_FOLDER -# The certificate (server.crt) stays in CERTIFICATE_FOLDER: the verify-full test trusts it as its root. -set -euo pipefail -container=$1 -superuser=$2 -database=$3 -certificates=$4 - -sql() { docker exec -i "$container" psql -v ON_ERROR_STOP=1 -U "$superuser" -d "$database" -Atq "$@"; } - -mkdir -p "$certificates" -openssl req -x509 -newkey rsa:2048 -nodes -days 2 -subj "/CN=localhost" \ - -addext "subjectAltName=DNS:localhost,IP:127.0.0.1" \ - -keyout "$certificates/server.key" -out "$certificates/server.crt" 2>/dev/null - -data=$(sql -c "SHOW data_directory") -hba=$(sql -c "SHOW hba_file") -docker cp "$certificates/server.crt" "$container:$data/server.crt" -docker cp "$certificates/server.key" "$container:$data/server.key" -# The server refuses a key that others can read. -docker exec "$container" sh -c "chown postgres:postgres '$data/server.crt' '$data/server.key' && chmod 600 '$data/server.key'" - -# The first matching line wins, so these go above the image's 'host all all all scram-sha-256'. -docker exec "$container" sh -c "{ printf '%s\n' 'host all titano_md5 all md5' 'host all titano_clear all password' \ - 'host all titano_trust all trust'; cat '$hba'; } > /tmp/pg_hba.conf && cat /tmp/pg_hba.conf > '$hba'" - -sql > /dev/null <<'SQL' -SET password_encryption = 'md5'; -CREATE ROLE titano_md5 LOGIN PASSWORD 'md5-ci'; -RESET password_encryption; -CREATE ROLE titano_clear LOGIN PASSWORD 'clear-ci'; -CREATE ROLE titano_trust LOGIN; -ALTER SYSTEM SET ssl = on; -SELECT pg_reload_conf(); -SQL - -# A reload that fails keeps the old settings silently: report the rejected lines, then wait for TLS to be on. -errors=$(sql -c "SELECT line_number || ': ' || error FROM pg_hba_file_rules WHERE error IS NOT NULL - UNION ALL SELECT name || ': ' || error FROM pg_file_settings WHERE error IS NOT NULL") -if [ -n "$errors" ]; then - echo "::error title=PostgreSQL setup::$errors" - exit 1 -fi -for _ in $(seq 1 20); do - if [ "$(sql -c "SHOW ssl")" = "on" ]; then - echo "PostgreSQL in $container: MD5, cleartext and trust roles, TLS on" - exit 0 - fi - sleep 0.5 -done -echo "::error title=PostgreSQL setup::TLS did not turn on after the reload" -exit 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 4ff097e7..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,368 +0,0 @@ -name: CI - -on: - push: - branches: [main] - pull_request: - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ci-${{ github.ref }} - cancel-in-progress: true - -env: - DOTNET_NOLOGO: "1" - DOTNET_CLI_TELEMETRY_OPTOUT: "1" - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1" - TOOLS: src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll - -jobs: - build: - name: Build and test (${{ matrix.os }}) - strategy: - fail-fast: false - matrix: - os: [windows-latest, ubuntu-latest] - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/setup-dotnet@v4 - with: - global-json-file: global.json - - - name: .NET info - run: dotnet --info - - - name: Restore fixtures cache - uses: actions/cache@v4 - with: - path: tests/fixtures/external - key: fixtures-${{ hashFiles('tests/fixtures/manifest.json') }} - - - name: Build (warnings are errors) - run: dotnet build Titano.slnx -c Release - - - name: Zero-package guard - run: dotnet "$TOOLS" package-guard - - - name: Localization check - run: dotnet "$TOOLS" i18n check - - - name: XAML lint - run: dotnet "$TOOLS" xaml-lint - - - name: Format check - if: runner.os == 'Windows' - run: dotnet format whitespace Titano.slnx --verify-no-changes - - # GitHub silently skips a workflow or issue form that does not parse; the public issue forms ship with releases. - - name: YAML check (workflows, compose, public issue forms) - if: runner.os == 'Linux' - run: ruby .github/scripts/check-yaml.rb .github/workflows/*.yml deploy/docker/docker-compose.yml deploy/releases-repo/.github/ISSUE_TEMPLATE/*.yml - - # Missing samples become "RAW fixture missing" warning annotations; the tests that need them skip. - - name: Fetch CC0 fixtures - run: dotnet "$TOOLS" fixtures --allow-missing - - - name: Test · Core - run: dotnet run --project tests/Titano.Core.Tests -c Release --no-build -- --junit out/junit/core.xml - - - name: Test · Data (SQLite) - run: dotnet run --project tests/Titano.Data.Tests -c Release --no-build -- --junit out/junit/data.xml - - - name: Test · Server - run: dotnet run --project tests/Titano.Server.Tests -c Release --no-build -- --junit out/junit/server.xml - - - name: Test · Tools - run: dotnet run --project tests/Titano.Tools.Tests -c Release --no-build -- --junit out/junit/tools.xml - - - name: Test · Core.Windows - if: runner.os == 'Windows' - run: dotnet run --project tests/Titano.Core.Windows.Tests -c Release --no-build -- --junit out/junit/core-windows.xml - - - name: Test · App - if: runner.os == 'Windows' - run: dotnet run --project tests/Titano.App.Tests -c Release --no-build -- --junit out/junit/app.xml - - - name: Screenshots - # Also after a failed test step: the pictures are what explains a failing screen test. - if: runner.os == 'Windows' && !cancelled() - timeout-minutes: 10 - run: | - set +e - failed=0 - for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe \ - src/Titano.Setup/bin/Release/net10.0-windows/Titano.Setup.exe; do - name=$(basename "$exe" .exe) - before=$(ls out/screenshots/*.png 2>/dev/null | wc -l) - "$exe" --capture out/screenshots 2> "out/capture-$name.log" & - wait $! - code=$? - cat "out/capture-$name.log" - count=$(( $(ls out/screenshots/*.png 2>/dev/null | wc -l) - before )) - echo "$name capture exit code $code, $count screenshot(s)" - # A capture that crashed or wrote nothing fails the job; the pictures it did write are still published. - if [ "$code" -ne 0 ] || [ "$count" -eq 0 ]; then - echo "::error title=Screenshots::$name --capture failed (exit $code, $count screenshot(s))" - failed=1 - fi - done - exit $failed - - # BRIEF §20.2 visual regression against tests/visual/baselines: a screen beyond the tolerance fails, and so does one - # without a baseline once any baseline is committed; before the first ones the step warns that it compared nothing - # (the baselines README says how to add them). - - name: Screenshot diff - if: runner.os == 'Windows' && !cancelled() && hashFiles('out/screenshots/*.png') != '' - run: dotnet "$TOOLS" screenshots diff out/screenshots --baseline tests/visual/baselines --out out/screenshot-diff - - - name: Upload screenshot diffs - if: runner.os == 'Windows' && !cancelled() && hashFiles('out/screenshot-diff/*.png') != '' - continue-on-error: true - uses: actions/upload-artifact@v4 - with: - name: screenshot-diff - path: out/screenshot-diff/ - retention-days: 7 - - # Handed to the screenshots job through the cache: it does not count against the artifact storage quota. - - name: Keep screenshots for the screenshots job - if: runner.os == 'Windows' && !cancelled() && hashFiles('out/screenshots/*.png') != '' - continue-on-error: true - uses: actions/cache/save@v4 - with: - path: out/screenshots - key: screenshots-${{ github.run_id }}-${{ github.run_attempt }} - enableCrossOsArchive: true - - - name: Publish desktop programs (win-x64, self-contained single file) - if: runner.os == 'Windows' - run: | - for p in Titano.App Titano.Uploader; do - dotnet publish "src/$p/$p.csproj" -c Release -r win-x64 --self-contained \ - -p:PublishSingleFile=true -p:PublishReadyToRun=true -p:IncludeNativeLibrariesForSelfExtract=true \ - -o "out/publish/$p" - done - dotnet publish src/Titano.Server/Titano.Server.csproj -c Release -r win-x64 --self-contained \ - -p:PublishSingleFile=true -o out/publish/Titano.Server - - # Artifacts are conveniences: a full artifact storage quota must not fail a job whose checks passed, and short - # retention keeps the storage from filling up again. - - name: Upload test results - if: always() - continue-on-error: true - uses: actions/upload-artifact@v4 - with: - name: test-results-${{ matrix.os }} - path: out/junit/ - if-no-files-found: ignore - retention-days: 7 - - - name: Upload Windows programs - if: runner.os == 'Windows' - continue-on-error: true - uses: actions/upload-artifact@v4 - with: - name: titano-win-x64-${{ github.sha }} - path: out/publish/ - retention-days: 3 - - screenshots: - name: Screenshots branch - # Same-repository pull requests only: forks never get a writable token. - if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }} - needs: build - runs-on: ubuntu-latest - permissions: - contents: write - steps: - # Absent when the build broke before the capture step: nothing to publish then. - - uses: actions/cache/restore@v4 - with: - path: out/screenshots - key: screenshots-${{ github.run_id }}-${{ github.run_attempt }} - enableCrossOsArchive: true - - name: Publish to the ci-screenshots branch (one commit, overwritten each run) - if: hashFiles('out/screenshots/*.png') != '' - working-directory: out/screenshots - run: | - git init -q -b ci-screenshots - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add -A - git commit -q -m "Screenshots of ${{ github.event.pull_request.head.sha }}" - git push -q -f "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" HEAD:refs/heads/ci-screenshots - - # BRIEF §18 on a clean runner: the real installers (published programs, TPK1 payload) installed silently, run, - # upgraded in place, uninstalled; .github/scripts/installer-test.ps1 checks every step. - installer: - name: Installer (windows-latest) - runs-on: windows-latest - timeout-minutes: 45 - defaults: - run: - shell: pwsh - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-dotnet@v4 - with: - global-json-file: global.json - - # As release.yml publishes them, without ReadyToRun (only start-up time differs). - - name: Publish App, Uploader and Setup (win-x64, self-contained single file) - run: | - foreach ($p in 'Titano.App', 'Titano.Uploader', 'Titano.Setup') { - dotnet publish "src/$p/$p.csproj" -c Release -r win-x64 --self-contained -p:PublishSingleFile=true ` - -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishReadyToRun=false -o "out/publish/$p" - if ($LASTEXITCODE -ne 0) { throw "dotnet publish $p failed" } - } - - - name: Build Titano.Tools - run: | - dotnet build src/Titano.Tools/Titano.Tools.csproj -c Release - if ($LASTEXITCODE -ne 0) { throw 'Titano.Tools did not build' } - - # Version 1 ships one more file than version 2: the upgrade must remove it. - - name: Pack the installers - run: | - Copy-Item -Recurse out/publish/Titano.App out/app-v1 - Set-Content -LiteralPath out/app-v1/legacy.txt -Value 'only in version 1' - $installers = @( - @('--product', 'Titano', '--version', '1.0.0', '--component', 'Titano=out/app-v1', - '--component', 'Uploader=out/publish/Titano.Uploader', '--out', 'out/installers/Titano-Setup-1.0.0.exe'), - @('--product', 'Titano', '--version', '1.0.1', '--component', 'Titano=out/publish/Titano.App', - '--component', 'Uploader=out/publish/Titano.Uploader', '--out', 'out/installers/Titano-Setup-1.0.1.exe'), - @('--product', 'Titano Uploader', '--version', '1.0.1', '--component', 'Uploader=out/publish/Titano.Uploader', - '--out', 'out/installers/Titano-Uploader-Setup-1.0.1.exe')) - foreach ($installer in $installers) { - dotnet $env:TOOLS pack-installer --setup out/publish/Titano.Setup/Titano.Setup.exe @installer - if ($LASTEXITCODE -ne 0) { throw "pack-installer $installer failed" } - } - - - name: Install, run, upgrade and remove - run: | - ./.github/scripts/installer-test.ps1 -Setup1 out/installers/Titano-Setup-1.0.0.exe -Setup2 out/installers/Titano-Setup-1.0.1.exe ` - -UploaderSetup out/installers/Titano-Uploader-Setup-1.0.1.exe -Version1 1.0.0 -Version2 1.0.1 -Screenshots out/installer-screenshots - - - name: Setup logs - if: always() - run: | - $logs = Join-Path ([System.IO.Path]::GetTempPath()) 'Titano Setup' - if (-not (Test-Path -LiteralPath $logs)) { Write-Host "No setup log in '$logs'"; exit 0 } - Get-ChildItem -LiteralPath $logs -Filter *.log -File | Sort-Object Name | ForEach-Object { - Write-Host "::group::$($_.Name)" - Get-Content -LiteralPath $_.FullName - Write-Host '::endgroup::' - } - - postgres: - name: PostgreSQL ${{ matrix.pg }} integration - strategy: - fail-fast: false - matrix: - pg: ["16", "17"] - runs-on: ubuntu-latest - services: - postgres: - image: postgres:${{ matrix.pg }} - env: - POSTGRES_USER: titano - POSTGRES_PASSWORD: titano-ci - POSTGRES_DB: titano_test - ports: - - 5432:5432 - options: >- - --health-cmd "pg_isready -U titano -d titano_test" - --health-interval 5s --health-timeout 5s --health-retries 20 - env: - TITANO_TEST_PG: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano;Password=titano-ci;SslMode=disable - # Roles, pg_hba lines and TLS made by postgres-ci-setup.sh: with these set, the wire tests of MD5, cleartext, trust - # and TLS (BRIEF §6.3) run, and a server that refuses TLS fails them instead of skipping them. - TITANO_TEST_PG_MD5: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano_md5;Password=md5-ci;SslMode=disable - TITANO_TEST_PG_CLEARTEXT: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano_clear;Password=clear-ci;SslMode=disable - TITANO_TEST_PG_TRUST: Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano_trust;SslMode=disable - TITANO_TEST_PG_TLS: "1" - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 - with: - global-json-file: global.json - # The image starts with TLS off and SCRAM only. - - name: Configure PostgreSQL (MD5, cleartext, trust, TLS) - run: | - bash .github/scripts/postgres-ci-setup.sh "${{ job.services.postgres.id }}" titano titano_test "$RUNNER_TEMP/pg-tls" - echo "TITANO_TEST_PG_ROOT_CERT=$RUNNER_TEMP/pg-tls/server.crt" >> "$GITHUB_ENV" - - name: Test · Data (PostgreSQL) - run: dotnet run --project tests/Titano.Data.Tests -c Release -- --junit out/junit/data-pg${{ matrix.pg }}.xml - - name: Test · Server (PostgreSQL) - run: dotnet run --project tests/Titano.Server.Tests -c Release -- --junit out/junit/server-pg${{ matrix.pg }}.xml - - name: Upload test results - if: always() - continue-on-error: true - uses: actions/upload-artifact@v4 - with: - name: test-results-pg${{ matrix.pg }} - path: out/junit/ - if-no-files-found: ignore - retention-days: 7 - - docker: - name: Docker image - runs-on: ubuntu-latest - services: - postgres: - image: postgres:17 - env: - POSTGRES_USER: titano - POSTGRES_PASSWORD: titano-ci - POSTGRES_DB: titano - ports: - - 5432:5432 - options: >- - --health-cmd "pg_isready -U titano -d titano" - --health-interval 5s --health-timeout 5s --health-retries 20 - steps: - - uses: actions/checkout@v4 - - uses: docker/setup-buildx-action@v3 - - name: Build image - uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_RECORD_UPLOAD: "false" # no build-record artifact: nothing reads it - with: - context: . - file: deploy/docker/Dockerfile - platforms: linux/amd64 - load: true - push: false - tags: titano-server:ci - build-args: TITANO_VERSION=0.0.0-ci - cache-from: type=gha - cache-to: type=gha,mode=max - - name: Smoke test (/health) - run: | - mkdir -p "$RUNNER_TEMP/archive" "$RUNNER_TEMP/data" - docker run -d --name titano --network host \ - -e TITANO_DB_HOST=127.0.0.1 -e TITANO_DB_USER=titano -e TITANO_DB_PASSWORD=titano-ci -e TITANO_DB_NAME=titano \ - -e TITANO_ADMIN_USER=admin -e TITANO_ADMIN_PASSWORD=ci-password-1234 \ - -e PUID="$(id -u)" -e PGID="$(id -g)" \ - -v "$RUNNER_TEMP/archive:/archive" -v "$RUNNER_TEMP/data:/data" titano-server:ci - for i in $(seq 1 60); do - if curl -fsS http://127.0.0.1:8080/health; then echo; break; fi - sleep 2 - done - curl -fsS http://127.0.0.1:8080/api/v1/server/info - curl -fsSk https://127.0.0.1:8443/health - test "$(docker inspect --format '{{.State.Running}}' titano)" = "true" - - name: Container logs - if: always() - run: docker logs titano || true diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index a6c63f13..00000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Nightly image - -on: - schedule: - - cron: "17 2 * * *" - workflow_dispatch: - -permissions: - contents: read - packages: write - -jobs: - nightly: - if: github.ref == 'refs/heads/main' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Image name - id: image - run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/titano-server" >> "$GITHUB_OUTPUT" - - uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_RECORD_UPLOAD: "false" # no build-record artifact: nothing reads it - with: - context: . - file: deploy/docker/Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.image.outputs.name }}:nightly - build-args: TITANO_VERSION=0.0.0-nightly.${{ github.run_number }} - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml deleted file mode 100644 index e96b7592..00000000 --- a/.github/workflows/perf.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: Performance gates - -# BRIEF §1.1 and the Phase 2/3 gates on a synthetic 500,000-photo library (SQLite and PostgreSQL 17) and a -# 100,000-frame archive rebuild from sidecars. Too slow for every push: weekly and on demand. -on: - schedule: - - cron: "41 3 * * 1" - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: perf-${{ github.ref }} - cancel-in-progress: true - -env: - DOTNET_NOLOGO: "1" - DOTNET_CLI_TELEMETRY_OPTOUT: "1" - -jobs: - perf: - name: Library and rebuild gates - runs-on: ubuntu-latest - timeout-minutes: 90 - services: - postgres: - image: postgres:17 - env: - POSTGRES_USER: titano - POSTGRES_PASSWORD: titano-ci - POSTGRES_DB: titano_perf - ports: - - 5432:5432 - options: >- - --health-cmd "pg_isready -U titano -d titano_perf" - --health-interval 5s --health-timeout 5s --health-retries 20 - env: - TITANO_PERF: "1" - TITANO_TEST_PG: Host=127.0.0.1;Port=5432;Database=titano_perf;Username=titano;Password=titano-ci;SslMode=disable - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-dotnet@v4 - with: - global-json-file: global.json - - - name: Build - run: dotnet build tests/Titano.Data.Tests -c Release - - - name: Perf tests (SQLite, PostgreSQL 17) - run: | - set -o pipefail - dotnet run --project tests/Titano.Data.Tests -c Release --no-build -- --filter category:perf --verbose --junit out/junit/perf.xml | tee out-perf.log - - - name: Timings - if: always() - run: | - { - echo "## Performance gates" - echo '```' - if grep -q "perf:" out-perf.log 2>/dev/null; then - grep -h "perf:" out-perf.log | sed 's/^ *//' - else - echo "no timings recorded" - fi - echo '```' - } >> "$GITHUB_STEP_SUMMARY" - - - name: Upload results - if: always() - continue-on-error: true # the timings are also in the job summary - uses: actions/upload-artifact@v4 - with: - name: perf-results - path: | - out/junit/ - out-perf.log - if-no-files-found: ignore - retention-days: 30 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 1ca7f906..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,355 +0,0 @@ -name: Release - -# A tag vMAJOR.MINOR.PATCH[-PRERELEASE] builds, tests, signs (when certificates are configured) and publishes -# everything (BRIEF §19.3): installers, portable and server zips, SHA256SUMS, release notes, the multi-arch server -# image on GHCR, and the public releases repository content (BRIEF §19.4). -on: - push: - tags: ["v*"] - workflow_dispatch: - inputs: - tag: - description: "Existing tag to (re)publish, e.g. v0.2.0" - required: true - -permissions: - contents: write - packages: write - -concurrency: - group: release-${{ github.event.inputs.tag || github.ref_name }} - cancel-in-progress: false - -env: - DOTNET_NOLOGO: "1" - DOTNET_CLI_TELEMETRY_OPTOUT: "1" - TOOLS: src/Titano.Tools/bin/Release/net10.0/Titano.Tools.dll - # Public repository that receives releases (BRIEF §19.4). Override with the RELEASES_REPO repository variable. Every - # build embeds it as TitanoReleasesRepo, so the update check, licence and issue links read the repository published to. - RELEASES_REPO: ${{ vars.RELEASES_REPO || format('{0}/titano-releases', github.repository_owner) }} - -jobs: - version: - runs-on: ubuntu-latest - outputs: - tag: ${{ steps.v.outputs.tag }} - version: ${{ steps.v.outputs.version }} - prerelease: ${{ steps.v.outputs.prerelease }} - steps: - - id: v - env: - TAG: ${{ github.event.inputs.tag || github.ref_name }} - run: | - if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]]; then - echo "::error title=Release::Tag '$TAG' is not vMAJOR.MINOR.PATCH or vMAJOR.MINOR.PATCH-PRERELEASE" - exit 1 - fi - version="${TAG#v}" - { - echo "tag=$TAG" - echo "version=$version" - if [[ "$version" == *-* ]]; then echo "prerelease=true"; else echo "prerelease=false"; fi - } >> "$GITHUB_OUTPUT" - - windows: - needs: version - runs-on: windows-latest - defaults: - run: - shell: bash - env: - VERSION: ${{ needs.version.outputs.version }} - # Secrets cannot appear in step conditions: expose only whether signing is configured. - HAS_SIGNING: ${{ secrets.SIGN_PFX_BASE64 != '' }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.version.outputs.tag }} - fetch-depth: 0 - - uses: actions/setup-dotnet@v4 - with: - global-json-file: global.json - - - name: Build and test - run: | - dotnet build Titano.slnx -c Release -p:TitanoVersion="$VERSION" -p:TitanoReleasesRepo="$RELEASES_REPO" - for t in Core Data Server Tools Core.Windows App; do - dotnet run --project "tests/Titano.$t.Tests" -c Release --no-build -- --junit "out/junit/$t.xml" - done - - - name: Screenshots for the public README - continue-on-error: true - timeout-minutes: 10 - run: | - for exe in src/Titano.App/bin/Release/net10.0-windows/Titano.exe src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe; do - "$exe" --capture out/screenshots & - wait $! || echo "::warning title=Screenshots::$(basename "$exe") --capture exited with $?" - done - ls out/screenshots - - - name: Publish self-contained programs - run: | - common="-c Release -r win-x64 --self-contained -p:TitanoVersion=$VERSION -p:TitanoReleasesRepo=$RELEASES_REPO -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true -p:DebugType=none" - dotnet publish src/Titano.App/Titano.App.csproj $common -p:PublishReadyToRun=true -o out/publish/app - dotnet publish src/Titano.Uploader/Titano.Uploader.csproj $common -p:PublishReadyToRun=true -o out/publish/uploader - dotnet publish src/Titano.Server/Titano.Server.csproj $common -o out/publish/server - dotnet publish src/Titano.Setup/Titano.Setup.csproj $common -p:PublishReadyToRun=true -o out/publish/setup - - - name: Sign binaries - if: env.HAS_SIGNING == 'true' - env: - SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }} - SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }} - shell: pwsh - run: | - $pfx = Join-Path $env:RUNNER_TEMP "sign.pfx" - [IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX)) - try { - $signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1 - if (-not $signtool) { throw "signtool.exe not found in the Windows SDK" } - Get-ChildItem out/publish -Recurse -Include *.exe | ForEach-Object { - & $signtool.FullName sign /fd SHA256 /f $pfx /p $env:SIGN_PASSWORD /tr http://timestamp.digicert.com /td SHA256 $_.FullName - if ($LASTEXITCODE -ne 0) { throw "signtool failed for $($_.FullName)" } - } - } finally { - Remove-Item $pfx -ErrorAction SilentlyContinue - } - - - name: Package installers and archives - run: | - mkdir -p out/release - dotnet "$TOOLS" pack-installer --setup out/publish/setup/Titano.Setup.exe --product Titano \ - --component "Titano=out/publish/app" --component "Uploader=out/publish/uploader" --component "Server=out/publish/server" \ - --version "$VERSION" --out "out/release/Titano-Setup-$VERSION.exe" - dotnet "$TOOLS" pack-installer --setup out/publish/setup/Titano.Setup.exe --product "Titano Uploader" \ - --component "Uploader=out/publish/uploader" --version "$VERSION" --out "out/release/Titano-Uploader-Setup-$VERSION.exe" - (cd out/publish/server && 7z a -tzip "../../release/Titano-Server-win-x64-$VERSION.zip" . > /dev/null) - # The portable build keeps its data next to Titano.exe because of portable.txt (never inside the installer). - cp -R out/publish/app out/portable - printf 'Titano portable mode: settings, index and logs are kept in the data folder next to Titano.exe.\r\n' > out/portable/portable.txt - (cd out/portable && 7z a -tzip "../release/Titano-win-x64-portable-$VERSION.zip" . > /dev/null) - ls -l out/release - - - name: Sign installers - if: env.HAS_SIGNING == 'true' - env: - SIGN_PFX: ${{ secrets.SIGN_PFX_BASE64 }} - SIGN_PASSWORD: ${{ secrets.SIGN_PASSWORD }} - shell: pwsh - run: | - $pfx = Join-Path $env:RUNNER_TEMP "sign.pfx" - [IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGN_PFX)) - try { - $signtool = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\signtool.exe" | Sort-Object FullName -Descending | Select-Object -First 1 - Get-ChildItem out/release -Filter *.exe | ForEach-Object { - & $signtool.FullName sign /fd SHA256 /f $pfx /p $env:SIGN_PASSWORD /tr http://timestamp.digicert.com /td SHA256 $_.FullName - if ($LASTEXITCODE -ne 0) { throw "signtool failed for $($_.FullName)" } - } - } finally { - Remove-Item $pfx -ErrorAction SilentlyContinue - } - - - name: Unsigned build notice - if: env.HAS_SIGNING != 'true' - run: echo "::notice title=Signing::SIGN_PFX_BASE64 is not set; the installers are unsigned." - - - name: Release notes - env: - TAG: ${{ needs.version.outputs.tag }} - run: | - # A stable release lists everything since the previous stable one, not only what followed its last pre-release. - if [[ "$TAG" == *-* ]]; then - previous="$(git describe --tags --abbrev=0 "$TAG^" 2>/dev/null || true)" - else - previous="$(git describe --tags --abbrev=0 --exclude '*-*' "$TAG^" 2>/dev/null || true)" - fi - range="${previous:+$previous..}$TAG" - git log --no-merges --format='%h%x09%s' "$range" | dotnet "$TOOLS" changelog --title "Titano $VERSION" --out out/release-notes.md - cat out/release-notes.md - - - uses: actions/upload-artifact@v4 - with: - name: release-windows - if-no-files-found: error - retention-days: 3 # hand-off to the publish job; the GitHub release keeps the files - path: | - out/release/ - out/release-notes.md - out/screenshots/ - - # Pushes only the version tag, and only after the Windows job's tests passed; publish moves :latest once the GitHub - # release exists and the tag is the newest stable one. - docker: - needs: [version, windows] - runs-on: ubuntu-latest - outputs: - image: ${{ steps.image.outputs.name }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.version.outputs.tag }} - - uses: docker/setup-qemu-action@v3 - - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Image name - id: image - run: echo "name=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/titano-server" >> "$GITHUB_OUTPUT" - - uses: docker/build-push-action@v6 - env: - DOCKER_BUILD_RECORD_UPLOAD: "false" # no build-record artifact: nothing reads it - with: - context: . - file: deploy/docker/Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - build-args: TITANO_VERSION=${{ needs.version.outputs.version }} - tags: ${{ steps.image.outputs.name }}:${{ needs.version.outputs.version }} - cache-from: type=gha - cache-to: type=gha,mode=max - - publish: - needs: [version, windows, docker] - runs-on: ubuntu-latest - env: - TAG: ${{ needs.version.outputs.tag }} - VERSION: ${{ needs.version.outputs.version }} - PRERELEASE: ${{ needs.version.outputs.prerelease }} - IMAGE: ${{ needs.docker.outputs.image }} - HAS_RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN != '' }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.version.outputs.tag }} - - uses: actions/setup-dotnet@v4 - with: - global-json-file: global.json - - uses: actions/download-artifact@v4 - with: - name: release-windows - path: out - - - name: Checksums - working-directory: out/release - run: | - rm -f SHA256SUMS - sha256sum -- * > "$RUNNER_TEMP/SHA256SUMS" - mv "$RUNNER_TEMP/SHA256SUMS" SHA256SUMS - cat SHA256SUMS - - - name: Release target - id: target - env: - GH_TOKEN: ${{ env.HAS_RELEASES_TOKEN == 'true' && secrets.RELEASES_TOKEN || secrets.GITHUB_TOKEN }} - run: | - if [ "$HAS_RELEASES_TOKEN" = "true" ]; then - repo="$RELEASES_REPO" - else - repo="$GITHUB_REPOSITORY" - echo "::notice title=Release::RELEASES_TOKEN is not set: publishing to $GITHUB_REPOSITORY instead of $RELEASES_REPO (clients only see releases of $RELEASES_REPO)." - fi - # The public content (README, EULA, i18n/, SHA256SUMS), the GitHub "Latest" marker and the image's :latest tag - # follow the newest stable release, so re-publishing an older tag or publishing a pre-release never rolls them - # back; until a stable release exists, every tag updates the public content. - latest="$(gh release view --repo "$repo" --json tagName --jq .tagName 2>/dev/null || true)" - newest=true - if [ -n "$latest" ] && [ "$latest" != "$TAG" ]; then - if [ "$PRERELEASE" = "true" ] || [ "$(printf '%s\n%s\n' "${latest#v}" "$VERSION" | sort -V | tail -n 1)" != "$VERSION" ]; then - newest=false - fi - fi - echo "Latest release of $repo: ${latest:-none}; $TAG is the newest: $newest" - if [ "$newest" = "false" ]; then - echo "::notice title=Release::$TAG is older than $latest or a pre-release: the public repository content and :latest are left as they are." - fi - { - echo "repo=$repo" - echo "newest=$newest" - } >> "$GITHUB_OUTPUT" - - - name: Validate the public issue forms - run: ruby .github/scripts/check-yaml.rb deploy/releases-repo/.github/ISSUE_TEMPLATE/*.yml - - - name: GitHub release - env: - GH_TOKEN: ${{ env.HAS_RELEASES_TOKEN == 'true' && secrets.RELEASES_TOKEN || secrets.GITHUB_TOKEN }} - TARGET: ${{ steps.target.outputs.repo }} - NEWEST: ${{ steps.target.outputs.newest }} - run: | - # An older stable tag published again must not become "Latest" (the update check reads releases/latest). - latest=() - if [ "$PRERELEASE" = "false" ] && [ "$NEWEST" = "false" ]; then latest=(--latest=false); fi - if gh release view "$TAG" --repo "$TARGET" > /dev/null 2>&1; then - gh release upload "$TAG" out/release/* --repo "$TARGET" --clobber - gh release edit "$TAG" --repo "$TARGET" --title "Titano $VERSION" --notes-file out/release-notes.md --prerelease="$PRERELEASE" "${latest[@]}" - else - gh release create "$TAG" out/release/* --repo "$TARGET" --title "Titano $VERSION" --notes-file out/release-notes.md --prerelease="$PRERELEASE" "${latest[@]}" - fi - - - uses: docker/setup-buildx-action@v3 - if: env.PRERELEASE == 'false' && steps.target.outputs.newest == 'true' - - uses: docker/login-action@v3 - if: env.PRERELEASE == 'false' && steps.target.outputs.newest == 'true' - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Move the image's latest tag - if: env.PRERELEASE == 'false' && steps.target.outputs.newest == 'true' - # Compose and Unraid users follow :latest; it moves only once the release exists, never back to an older server. - run: docker buildx imagetools create --tag "$IMAGE:latest" "$IMAGE:$VERSION" - - - name: Update the public releases repository - if: env.HAS_RELEASES_TOKEN == 'true' && steps.target.outputs.newest == 'true' - env: - GH_TOKEN: ${{ secrets.RELEASES_TOKEN }} - run: | - branch="$(gh api "repos/$RELEASES_REPO" --jq .default_branch)" - git clone --depth 1 "https://x-access-token:${GH_TOKEN}@github.com/${RELEASES_REPO}.git" public - git -C public checkout -B "$branch" - cp -R deploy/releases-repo/. public/ - mkdir -p public/unraid public/docker public/screenshots - cp deploy/unraid/titano.xml public/unraid/titano.xml - cp deploy/docker/docker-compose.yml deploy/docker/.env.example public/docker/ - dotnet run --project src/Titano.Tools -c Release -- make-icon --out "$RUNNER_TEMP/icons" - cp "$RUNNER_TEMP/icons/titano-server-256.png" public/unraid/titano-server.png - rm -rf public/i18n - cp -R i18n public/i18n - cp out/release/SHA256SUMS public/SHA256SUMS - for shot in library jobs settings-rendering server uploader-queue; do - if [ -f "out/screenshots/$shot-dark.png" ]; then cp "out/screenshots/$shot-dark.png" public/screenshots/; fi - done - # Links in the published files follow the configured repository and the image the docker job pushed. - find public -path public/.git -prune -o -type f \( -name '*.md' -o -name '*.yml' -o -name '*.xml' \) -print0 | - xargs -0 -r sed -i -e "s#alby96/titano-releases/main/#${RELEASES_REPO}/${branch}/#g" -e "s#alby96/titano-releases#${RELEASES_REPO}#g" \ - -e "s#ghcr.io/alby96/titano-server#${IMAGE}#g" - cd public - git config user.name "titano-release" - git config user.email "titano-release@users.noreply.github.com" - git add -A - if git diff --cached --quiet; then - echo "Public repository already up to date." - else - git commit -q -m "chore: update for $TAG" - git push origin "HEAD:$branch" - fi - - - name: Summary - env: - TARGET: ${{ steps.target.outputs.repo }} - NEWEST: ${{ steps.target.outputs.newest }} - run: | - { - echo "## Titano $VERSION" - echo "- Release: https://github.com/$TARGET/releases/tag/$TAG" - echo "- Image: \`$IMAGE:$VERSION\`$([ "$PRERELEASE" = "false" ] && [ "$NEWEST" = "true" ] && echo " and \`:latest\`")" - echo "- GHCR packages are private when first pushed and GitHub has no API to change that: once, open the" - echo " package settings of \`titano-server\` and set its visibility to **Public** (BRIEF §19.4)." - echo - echo '```' - cat out/release/SHA256SUMS - echo '```' - } >> "$GITHUB_STEP_SUMMARY" diff --git a/.gitignore b/.gitignore index 62b03a69..74177708 100644 --- a/.gitignore +++ b/.gitignore @@ -428,7 +428,7 @@ FodyWeavers.xsd *.msm *.msp -# Titano +# Chronos tests/fixtures/external/ /out/ /publish/ diff --git a/.vscode/launch.json b/.vscode/launch.json index 57fcc9b5..85572196 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,15 +1,15 @@ { // Windows programs under the C# extension's debugger. Each launch configuration builds in Debug first (tasks.json), // then starts the program's .exe, never "dotnet .dll": the programs read Environment.ProcessPath (the Run - // keys and tray icons of Titano and the Uploader, Setup's payload and the stub of its capture's sample installer). + // keys and tray icons of Chronos and the Uploader, Setup's payload and the stub of its capture's sample installer). "version": "0.2.0", "configurations": [ { - "name": "Titano", + "name": "Chronos", "type": "coreclr", "request": "launch", - "preLaunchTask": "build: Titano", - "program": "${workspaceFolder}/src/Titano.App/bin/Debug/net10.0-windows/Titano.exe", + "preLaunchTask": "build: Chronos", + "program": "${workspaceFolder}/src/Chronos.App/bin/Debug/net10.0-windows/Chronos.exe", "cwd": "${workspaceFolder}", "console": "internalConsole", "presentation": { @@ -18,11 +18,11 @@ } }, { - "name": "Titano Uploader", + "name": "Chronos Uploader", "type": "coreclr", "request": "launch", - "preLaunchTask": "build: Titano Uploader", - "program": "${workspaceFolder}/src/Titano.Uploader/bin/Debug/net10.0-windows/Titano.Uploader.exe", + "preLaunchTask": "build: Chronos Uploader", + "program": "${workspaceFolder}/src/Chronos.Uploader/bin/Debug/net10.0-windows/Chronos.Uploader.exe", "cwd": "${workspaceFolder}", "console": "internalConsole", "presentation": { @@ -32,17 +32,17 @@ }, { // SQLite, as on any Windows server, with the data and the archive in out/debug/server instead of - // %ProgramData%\Titano Server and C:\TitanoArchive. The first administrator's temporary password is in + // %ProgramData%\Chronos Server and C:\ChronosArchive. The first administrator's temporary password is in // out/debug/server/data/initial-admin-password.txt. - "name": "Titano Server", + "name": "Chronos Server", "type": "coreclr", "request": "launch", - "preLaunchTask": "build: Titano Server", - "program": "${workspaceFolder}/src/Titano.Server/bin/Debug/net10.0/Titano.Server.exe", + "preLaunchTask": "build: Chronos Server", + "program": "${workspaceFolder}/src/Chronos.Server/bin/Debug/net10.0/Chronos.Server.exe", "cwd": "${workspaceFolder}", "env": { - "TITANO_DATA_PATH": "${workspaceFolder}\\out\\debug\\server\\data", - "TITANO_ARCHIVE_PATH": "${workspaceFolder}\\out\\debug\\server\\archive" + "CHRONOS_DATA_PATH": "${workspaceFolder}\\out\\debug\\server\\data", + "CHRONOS_ARCHIVE_PATH": "${workspaceFolder}\\out\\debug\\server\\archive" }, "console": "internalConsole", "serverReadyAction": { @@ -59,11 +59,11 @@ }, { // Every screen with sample data in a throw-away data folder, as the CI screenshots step runs it. - "name": "Titano (screenshots)", + "name": "Chronos (screenshots)", "type": "coreclr", "request": "launch", - "preLaunchTask": "build: Titano", - "program": "${workspaceFolder}/src/Titano.App/bin/Debug/net10.0-windows/Titano.exe", + "preLaunchTask": "build: Chronos", + "program": "${workspaceFolder}/src/Chronos.App/bin/Debug/net10.0-windows/Chronos.exe", "args": ["--capture", "${workspaceFolder}\\out\\screenshots"], "cwd": "${workspaceFolder}", "console": "internalConsole", @@ -73,11 +73,11 @@ } }, { - "name": "Titano Uploader (screenshots)", + "name": "Chronos Uploader (screenshots)", "type": "coreclr", "request": "launch", - "preLaunchTask": "build: Titano Uploader", - "program": "${workspaceFolder}/src/Titano.Uploader/bin/Debug/net10.0-windows/Titano.Uploader.exe", + "preLaunchTask": "build: Chronos Uploader", + "program": "${workspaceFolder}/src/Chronos.Uploader/bin/Debug/net10.0-windows/Chronos.Uploader.exe", "args": ["--capture", "${workspaceFolder}\\out\\screenshots"], "cwd": "${workspaceFolder}", "console": "internalConsole", @@ -88,11 +88,11 @@ }, { // Setup has no payload outside a packed installer: the capture builds a sample one and installs nothing. - "name": "Titano Setup (screenshots)", + "name": "Chronos Setup (screenshots)", "type": "coreclr", "request": "launch", - "preLaunchTask": "build: Titano Setup", - "program": "${workspaceFolder}/src/Titano.Setup/bin/Debug/net10.0-windows/Titano.Setup.exe", + "preLaunchTask": "build: Chronos Setup", + "program": "${workspaceFolder}/src/Chronos.Setup/bin/Debug/net10.0-windows/Chronos.Setup.exe", "args": ["--capture", "${workspaceFolder}\\out\\screenshots"], "cwd": "${workspaceFolder}", "console": "internalConsole", @@ -102,11 +102,11 @@ } }, { - "name": "Titano.Tools", + "name": "Chronos.Tools", "type": "coreclr", "request": "launch", - "preLaunchTask": "build: Titano.Tools", - "program": "${workspaceFolder}/src/Titano.Tools/bin/Debug/net10.0/Titano.Tools.exe", + "preLaunchTask": "build: Chronos.Tools", + "program": "${workspaceFolder}/src/Chronos.Tools/bin/Debug/net10.0/Chronos.Tools.exe", "args": "${input:toolsArguments}", "cwd": "${workspaceFolder}", "console": "internalConsole", @@ -144,7 +144,7 @@ { "id": "toolsArguments", "type": "promptString", - "description": "Titano.Tools command and options (--help lists them; changelog needs --in here)", + "description": "Chronos.Tools command and options (--help lists them; changelog needs --in here)", "default": "i18n check" }, { @@ -153,28 +153,28 @@ "description": "Test program", "options": [ { - "label": "Titano.Core.Tests", - "value": "Titano.Core.Tests/bin/Debug/net10.0/Titano.Core.Tests.exe" + "label": "Chronos.Core.Tests", + "value": "Chronos.Core.Tests/bin/Debug/net10.0/Chronos.Core.Tests.exe" }, { - "label": "Titano.Core.Windows.Tests", - "value": "Titano.Core.Windows.Tests/bin/Debug/net10.0-windows/Titano.Core.Windows.Tests.exe" + "label": "Chronos.Core.Windows.Tests", + "value": "Chronos.Core.Windows.Tests/bin/Debug/net10.0-windows/Chronos.Core.Windows.Tests.exe" }, { - "label": "Titano.Data.Tests", - "value": "Titano.Data.Tests/bin/Debug/net10.0/Titano.Data.Tests.exe" + "label": "Chronos.Data.Tests", + "value": "Chronos.Data.Tests/bin/Debug/net10.0/Chronos.Data.Tests.exe" }, { - "label": "Titano.Server.Tests", - "value": "Titano.Server.Tests/bin/Debug/net10.0/Titano.Server.Tests.exe" + "label": "Chronos.Server.Tests", + "value": "Chronos.Server.Tests/bin/Debug/net10.0/Chronos.Server.Tests.exe" }, { - "label": "Titano.App.Tests", - "value": "Titano.App.Tests/bin/Debug/net10.0-windows/Titano.App.Tests.exe" + "label": "Chronos.App.Tests", + "value": "Chronos.App.Tests/bin/Debug/net10.0-windows/Chronos.App.Tests.exe" }, { - "label": "Titano.Tools.Tests", - "value": "Titano.Tools.Tests/bin/Debug/net10.0/Titano.Tools.Tests.exe" + "label": "Chronos.Tools.Tests", + "value": "Chronos.Tools.Tests/bin/Debug/net10.0/Chronos.Tools.Tests.exe" } ] }, diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 54d69e5b..b6e51484 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -9,12 +9,12 @@ "tasks": [ { "label": "build", - "detail": "Titano.slnx, Debug", + "detail": "Chronos.slnx, Debug", "type": "process", "command": "dotnet", "args": [ "build", - "${workspaceFolder}/Titano.slnx", + "${workspaceFolder}/Chronos.slnx", "-c", "Debug", "-tl:off", @@ -30,13 +30,13 @@ "problemMatcher": "$msCompile" }, { - "label": "build: Titano", - "detail": "src/Titano.App, Debug", + "label": "build: Chronos", + "detail": "src/Chronos.App, Debug", "type": "process", "command": "dotnet", "args": [ "build", - "${workspaceFolder}/src/Titano.App/Titano.App.csproj", + "${workspaceFolder}/src/Chronos.App/Chronos.App.csproj", "-c", "Debug", "-tl:off", @@ -49,13 +49,13 @@ "problemMatcher": "$msCompile" }, { - "label": "build: Titano Uploader", - "detail": "src/Titano.Uploader, Debug", + "label": "build: Chronos Uploader", + "detail": "src/Chronos.Uploader, Debug", "type": "process", "command": "dotnet", "args": [ "build", - "${workspaceFolder}/src/Titano.Uploader/Titano.Uploader.csproj", + "${workspaceFolder}/src/Chronos.Uploader/Chronos.Uploader.csproj", "-c", "Debug", "-tl:off", @@ -68,13 +68,13 @@ "problemMatcher": "$msCompile" }, { - "label": "build: Titano Server", - "detail": "src/Titano.Server, Debug", + "label": "build: Chronos Server", + "detail": "src/Chronos.Server, Debug", "type": "process", "command": "dotnet", "args": [ "build", - "${workspaceFolder}/src/Titano.Server/Titano.Server.csproj", + "${workspaceFolder}/src/Chronos.Server/Chronos.Server.csproj", "-c", "Debug", "-tl:off", @@ -87,13 +87,13 @@ "problemMatcher": "$msCompile" }, { - "label": "build: Titano Setup", - "detail": "src/Titano.Setup, Debug", + "label": "build: Chronos Setup", + "detail": "src/Chronos.Setup, Debug", "type": "process", "command": "dotnet", "args": [ "build", - "${workspaceFolder}/src/Titano.Setup/Titano.Setup.csproj", + "${workspaceFolder}/src/Chronos.Setup/Chronos.Setup.csproj", "-c", "Debug", "-tl:off", @@ -106,13 +106,13 @@ "problemMatcher": "$msCompile" }, { - "label": "build: Titano.Tools", - "detail": "src/Titano.Tools, Debug", + "label": "build: Chronos.Tools", + "detail": "src/Chronos.Tools, Debug", "type": "process", "command": "dotnet", "args": [ "build", - "${workspaceFolder}/src/Titano.Tools/Titano.Tools.csproj", + "${workspaceFolder}/src/Chronos.Tools/Chronos.Tools.csproj", "-c", "Debug", "-tl:off", diff --git a/CLAUDE.md b/CLAUDE.md index 908e146a..409a1adf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,19 +1,19 @@ -# Titano — working rules +# Chronos — working rules Read docs/BRIEF.md when in doubt; it wins over these notes. - Zero . Anything not in the .NET BCL / Microsoft shared frameworks / OS APIs is written here. - No external processes at runtime (no ffmpeg, exiftool, powershell). Only OS dialogs listed in BRIEF §8.6. -- Titano.Core / Data / Protocol / Server target net10.0 and build on Linux; Windows-only code lives in *.Windows or the desktop apps. +- Chronos.Core / Data / Protocol / Server target net10.0 and build on Linux; Windows-only code lives in *.Windows or the desktop apps. - English identifiers, comments, commits (Conventional Commits). Prototype in docs/reference is Italian: port algorithms, not language. - Every UI string is a resource (en source, it translation). Labels ≤ 3 words; explanations only in tooltips; every actionable control has a tooltip; no helper paragraphs. - Destructive operations: dry-run plan first, hash verification, explicit user action. - When the brief is silent: choose the simplest safe option, log it in docs/DECISIONS.md, continue. Ask only at phase gates or before irreversible choices. -- Definition of Done per phase: green on windows-latest + ubuntu-latest, tests green, no new warnings, DECISIONS + CHANGELOG updated, i18n check green, phase report with "how to try it". -- Build: dotnet build -c Release; tests: dotnet run --project tests/ -- --junit out.xml; tools: dotnet run --project src/Titano.Tools -- . +- Definition of Done per phase: CI green on Gitea Actions (the Linux jobs; the windows job once a Windows runner is registered, until then the Windows-only tests run on a Windows PC), tests green, no new warnings, DECISIONS + CHANGELOG updated, i18n check green, phase report with "how to try it". +- Build: dotnet build -c Release; tests: dotnet run --project tests/ -- --junit out.xml; tools: dotnet run --project src/Chronos.Tools -- . - Current phase and next steps: see docs/STATUS.md (update at every gate). ## Repository specifics - Visual target: docs/ui/DESIGN.md (tokens, controls) and docs/ui/mockups/*.html. Looks: mockup wins; behaviour: brief wins. - Code conventions and module ownership: docs/ARCHITECTURE.md. - Localization: keys `Area.Group.Name` in i18n/en/.resx, Italian in i18n/it/.it.resx. C# `Loc.L("Key")`, XAML `{l:Loc Key}`. -- Checks run in CI: `Titano.Tools package-guard`, `i18n check`, `xaml-lint`. -- Linux builds the Windows projects for compile checking (EnableWindowsTargeting); Windows-only tests carry [WindowsOnly]. +- Checks run in CI (.gitea/workflows): `Chronos.Tools package-guard`, `i18n check`, `xaml-lint`, `pe-check`. +- Linux builds the Windows projects (EnableWindowsTargeting): CI compiles them and the release cross-compiles the Windows programs; Windows-only tests carry [WindowsOnly]. diff --git a/Chronos.slnx b/Chronos.slnx new file mode 100644 index 00000000..58d06039 --- /dev/null +++ b/Chronos.slnx @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Directory.Build.props b/Directory.Build.props index c08b3f1e..7fc1f73a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,15 +1,15 @@ $(MSBuildThisFileDirectory) - 0.1.0 - $(TitanoVersion) - $([System.Text.RegularExpressions.Regex]::Match($(TitanoVersion), '^\d+\.\d+\.\d+').Value).0 + 0.1.0 + $(ChronosVersion) + $([System.Text.RegularExpressions.Regex]::Match($(ChronosVersion), '^\d+\.\d+\.\d+').Value).0 $(AssemblyVersion) - $(TitanoVersion) + $(ChronosVersion) false - Titano - Titano - © Titano + Chronos + Chronos + © Chronos en latest @@ -42,19 +42,20 @@ - - alby96/titano-releases + + https://gitea.encke-hake.ts.net/BalboSoft/Chronos - + - - false + + false - + diff --git a/Directory.Build.targets b/Directory.Build.targets index 6e2913f9..1733bb0b 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -2,43 +2,43 @@ + Code="CHRONOS001" + Text="PackageReference is forbidden in Chronos (found: @(PackageReference)). Implement it in-house." /> - - + + i18n\%(Filename)%(Extension) - + - $(RepoRoot)artifacts/icons/ + $(RepoRoot)artifacts/icons/ - - $(TitanoIconDir)$(TitanoIconVariant).ico + + $(ChronosIconDir)$(ChronosIconVariant).ico - - + - - - - + - + diff --git a/deploy/releases-repo/EULA.md b/EULA.md similarity index 90% rename from deploy/releases-repo/EULA.md rename to EULA.md index 9d22ddc6..20ea7866 100644 --- a/deploy/releases-repo/EULA.md +++ b/EULA.md @@ -1,16 +1,16 @@ -# Titano — End User Licence Agreement +# Chronos — End User Licence Agreement > **DRAFT — not yet reviewed by a lawyer.** This text is a working draft prepared for the owner's legal review. It -> is published so that the terms intended for Titano are visible, but it may change before the first stable +> is published so that the terms intended for Chronos are visible, but it may change before the first stable > release. Where this draft is unclear or unenforceable, the mandatory law of your country applies. -Version 0.1 (draft) · Applies to Titano, Titano Uploader and Titano Server ("the Software"), including their +Version 0.1 (draft) · Applies to Chronos, Chronos Uploader and Chronos Server ("the Software"), including their installers, Docker images and updates. ## 1. Who the parties are This agreement is between you (the person or organisation installing or using the Software) and the owner of the -Titano project ("the Licensor"). By installing, copying or using the Software you accept these terms. If you do not +Chronos project ("the Licensor"). By installing, copying or using the Software you accept these terms. If you do not accept them, do not install or use the Software. ## 2. Licence granted @@ -43,9 +43,9 @@ NAS app catalogue) is allowed as long as they are offered free of charge and thi The Software runs on your own computers and servers. It does not send your photos, videos, archive or account data to the Licensor. The desktop programs contact the Internet only to: -- check the public releases repository for a newer version and download it when you ask (Settings › Updates; can be - turned off); -- reach the Titano Server you configure; +- check the repository that publishes Chronos releases for a newer version and download it when you ask (Settings › + Updates; can be turned off); +- reach the Chronos Server you configure; - open links you click (in your browser). Optional anonymous usage counts, if enabled by you in Settings, contain no personal data, file names or content. diff --git a/README.md b/README.md index b8876126..cbb64b83 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ -# Titano (development repository) +# Chronos (development repository) -Time-lapse ecosystem: **Titano** (Windows desktop client), **Titano Server** (Linux/Docker and Windows) and -**Titano Uploader** (Windows), sharing one C#/.NET 10 engine with zero third-party packages. This repository is -private; users get releases, the Docker image and the Unraid template from the public releases repository. +Time-lapse ecosystem: **Chronos** (Windows desktop client), **Chronos Server** (Linux/Docker and Windows) and +**Chronos Uploader** (Windows), sharing one C#/.NET 10 engine with zero third-party packages. This repository is +`BalboSoft/Chronos` on the owner's Gitea (); users get the releases, +the server image and the Unraid template from it too (see [Visibility](#visibility)). +- User guide (install, update, Docker, Unraid, verifying downloads): [`deploy/releases-repo/README.md`](deploy/releases-repo/README.md) - Specification: [`docs/BRIEF.md`](docs/BRIEF.md) · working rules: [`CLAUDE.md`](CLAUDE.md) - Architecture and conventions: [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) · decisions: [`docs/DECISIONS.md`](docs/DECISIONS.md) · status: [`docs/STATUS.md`](docs/STATUS.md) · changes: @@ -16,46 +18,49 @@ Requirements: the .NET SDK pinned in `global.json`. Windows builds and runs ever (the Windows projects for compile checking) and runs Core, Data, Protocol, Server and Tools. ```sh -dotnet build Titano.slnx -c Release +dotnet build Chronos.slnx -c Release # Tests (one program per area; --filter text|category:name, --junit file, --verbose) -dotnet run --project tests/Titano.Core.Tests -c Release -- --junit out/core.xml -dotnet run --project tests/Titano.Data.Tests -c Release -dotnet run --project tests/Titano.Server.Tests -c Release -dotnet run --project tests/Titano.Tools.Tests -c Release -dotnet run --project tests/Titano.Core.Windows.Tests -c Release # Windows -dotnet run --project tests/Titano.App.Tests -c Release # Windows +dotnet run --project tests/Chronos.Core.Tests -c Release -- --junit out/core.xml +dotnet run --project tests/Chronos.Data.Tests -c Release +dotnet run --project tests/Chronos.Server.Tests -c Release +dotnet run --project tests/Chronos.Tools.Tests -c Release +dotnet run --project tests/Chronos.Core.Windows.Tests -c Release # Windows +dotnet run --project tests/Chronos.App.Tests -c Release # Windows -# PostgreSQL integration tests (16 or 17); the MD5, cleartext, trust and TLS tests also read TITANO_TEST_PG_MD5, -# _CLEARTEXT, _TRUST, _TLS=1 and _ROOT_CERT (.github/scripts/postgres-ci-setup.sh prepares a server for them) -TITANO_TEST_PG="Host=127.0.0.1;Port=5432;Database=titano_test;Username=titano;Password=…;SslMode=disable" \ - dotnet run --project tests/Titano.Data.Tests -c Release +# PostgreSQL integration tests (16 or 17); the MD5, cleartext, trust and TLS tests also read CHRONOS_TEST_PG_MD5, +# _CLEARTEXT, _TRUST, _TLS=1 and _ROOT_CERT. postgres-ci prepares a throw-away server for them through SQL as a +# superuser (it rewrites pg_hba.conf and turns TLS on): roles and passwords as in .gitea/workflows/ci.yml, the +# certificate for _ROOT_CERT in out/pg-tls/server.crt +export CHRONOS_TEST_PG="Host=127.0.0.1;Port=5432;Database=chronos_test;Username=chronos;Password=…;SslMode=disable" +dotnet run --project src/Chronos.Tools -- postgres-ci --connection "$CHRONOS_TEST_PG" --host localhost --certificates out/pg-tls +dotnet run --project tests/Chronos.Data.Tests -c Release # Performance gates (500,000-photo library, 100,000-frame rebuild; minutes) -TITANO_PERF=1 dotnet run --project tests/Titano.Data.Tests -c Release -- --filter category:perf --verbose +CHRONOS_PERF=1 dotnet run --project tests/Chronos.Data.Tests -c Release -- --filter category:perf --verbose # Checks run by CI -dotnet run --project src/Titano.Tools -- package-guard -dotnet run --project src/Titano.Tools -- i18n check -dotnet run --project src/Titano.Tools -- xaml-lint -dotnet format whitespace Titano.slnx --verify-no-changes -dotnet run --project src/Titano.Tools -- screenshots diff out/screenshots # Windows, after --capture (tests/visual/baselines/README.md) +dotnet run --project src/Chronos.Tools -- package-guard +dotnet run --project src/Chronos.Tools -- i18n check +dotnet run --project src/Chronos.Tools -- xaml-lint +dotnet format whitespace Chronos.slnx --verify-no-changes +dotnet run --project src/Chronos.Tools -- screenshots diff out/screenshots # Windows, after --capture (tests/visual/baselines/README.md) # CC0 RAW samples for the decoder tests (tests/fixtures/manifest.json explains how to fill in URLs) -dotnet run --project src/Titano.Tools -- fixtures +dotnet run --project src/Chronos.Tools -- fixtures ``` Run: ```sh -dotnet run --project src/Titano.Server # admin panel https://localhost:8443/admin -src/Titano.App/bin/Release/net10.0-windows/Titano.exe [--capture ] -src/Titano.Uploader/bin/Release/net10.0-windows/Titano.Uploader.exe +dotnet run --project src/Chronos.Server # admin panel https://localhost:8443/admin +src/Chronos.App/bin/Release/net10.0-windows/Chronos.exe [--capture ] +src/Chronos.Uploader/bin/Release/net10.0-windows/Chronos.Uploader.exe docker compose -f deploy/docker/docker-compose.yml up -d ``` -The server reads `/data/server.json` (`TITANO_DATA_PATH`) and `TITANO_*` environment variables; -`Titano.Server --help` lists them. On Linux it needs PostgreSQL; on Windows it defaults to SQLite. +The server reads `/data/server.json` (`CHRONOS_DATA_PATH`) and `CHRONOS_*` environment variables; +`Chronos.Server --help` lists them. On Linux it needs PostgreSQL; on Windows it defaults to SQLite. ### Debug in VS Code (Windows) @@ -64,90 +69,166 @@ Open the repository folder with the C# extension (`.vscode/extensions.json` reco | Configuration | Starts | |---|---| -| Titano, Titano Uploader | The desktop programs, with their usual data folder (`%LOCALAPPDATA%\Titano`) | -| Titano Server | The server on SQLite, ports 8080 and 8443, data and archive in `out/debug/server`; then opens the admin panel | -| … (screenshots) | `--capture out/screenshots` of Titano, the Uploader or Setup | -| Titano.Tools | The command line it asks for (`i18n check` by default) | +| Chronos, Chronos Uploader | The desktop programs, with their usual data folder (`%LOCALAPPDATA%\Chronos`) | +| Chronos Server | The server on SQLite, ports 8080 and 8443, data and archive in `out/debug/server`; then opens the admin panel | +| … (screenshots) | `--capture out/screenshots` of Chronos, the Uploader or Setup | +| Chronos.Tools | The command line it asks for (`i18n check` by default) | | Tests | The test program and runner options it asks for (`--filter`, `--parallel 1`, …), after building the solution | | Attach to process | Nothing: attaches to a running process picked from a list | - Sessions run side by side: start the next one with the green *Start* button in *Run and Debug* once the previous build has finished (F5 starts a session only when none runs). *Tests* rebuilds the programs too, so stop their sessions first when the code has changed. -- Quit an installed Titano or Uploader first: a second copy hands over to it and ends. Debugging the Uploader points +- Quit an installed Chronos or Uploader first: a second copy hands over to it and ends. Debugging the Uploader points an existing *Start with Windows* entry at the Debug build. Closing the Uploader's window keeps it in the tray (the default): end its session with *Stop*. -- Stop the Docker stack or an installed Titano Server before *Titano Server*, which needs the same ports. The browser +- Stop the Docker stack or an installed Chronos Server before *Chronos Server*, which needs the same ports. The browser warns about the server's self-signed certificate; sign in as `admin` with the temporary password in `out/debug/server/data/initial-admin-password.txt`. -- Titano, the Uploader and Setup log to files (`%LOCALAPPDATA%\Titano\logs`, `%TEMP%\Titano Setup`); the server logs - to the Debug Console. Windows Firewall asks about Titano, the Uploader and the server at their first start. +- Chronos, the Uploader and Setup log to files (`%LOCALAPPDATA%\Chronos\logs`, `%TEMP%\Chronos Setup`); the server logs + to the Debug Console. Windows Firewall asks about Chronos, the Uploader and the server at their first start. - VS Code passes the drive letter in lower case: the first build after one made with an upper-case drive letter (another terminal, Visual Studio) restores and recompiles everything. ## CI +The workflows in `.gitea/workflows` run on Gitea Actions: one act_runner in Docker mode (label `ubuntu-latest`) on the +Linux server that also hosts Gitea, one job at a time. The .NET jobs run in the `mcr.microsoft.com/dotnet/sdk:10.0` +container and check out with plain git (the image has no Node.js, so no JavaScript actions such as +`actions/checkout`); the jobs that build images use the runner's own image and the host's Docker daemon. Nothing is +uploaded as an artifact or cached, and builds use 4 cores (`BUILD_CPUS`) so the host keeps memory for Gitea. Gitea +shows no job summary and no annotations: `::warning`/`::error` lines appear in the log only. + | Workflow | When | What | |---|---|---| -| `.github/workflows/ci.yml` | push to `main`, pull requests | Windows + Linux build (warnings are errors), all tests, package guard, i18n check, XAML lint, format check, YAML check of workflows and public issue forms, CC0 fixtures (a warning per missing sample), screenshots (`--capture`, also pushed to the `ci-screenshots` branch for same-repository PRs) and their pixel diff against `tests/visual/baselines`, Windows program artifacts, installer test (install, run, upgrade in place, uninstall), PostgreSQL 16/17 integration (SCRAM, MD5, cleartext, trust, TLS), Docker image smoke test | -| `.github/workflows/docker.yml` | nightly | `ghcr.io//titano-server:nightly` (multi-arch) | -| `.github/workflows/perf.yml` | weekly, manual | Performance gates on SQLite and PostgreSQL 17; timings in the job summary | -| `.github/workflows/release.yml` | tag `v*`, manual re-publish | The release (below) | +| `.gitea/workflows/ci.yml` | push to `main`, pull requests, manual | Job *build*: build (warnings are errors), package guard, i18n check, XAML lint, format check, CC0 fixtures (a warning per missing sample), Core, Data (SQLite), Server and Tools tests, the Windows programs (App, Uploader, Setup) cross-compiled for win-x64, `pack-installer` and `Chronos.Tools pe-check`. *postgres*: PostgreSQL 16/17 service containers (host `postgres`, prepared by `Chronos.Tools postgres-ci`) for the integration tests (SCRAM, MD5, cleartext, trust, TLS). *docker*: the image built with the host's daemon and its `/health` smoke test with PostgreSQL 17 on a network of the run. *yaml*: workflows, issue forms in `.gitea/ISSUE_TEMPLATE` and the compose file (`ruby:3.3-alpine`, sources from Gitea's archive API). *windows*, only with `WINDOWS_RUNNER`: Core.Windows and App tests, screenshots (`--capture`) and their pixel diff against `tests/visual/baselines`, installer test (install, run, upgrade in place, uninstall) | +| `.gitea/workflows/docker.yml` | daily at 02:17 (`main` only), manual | `gitea.encke-hake.ts.net/balbosoft/chronos-server:nightly` (linux/amd64; needs `REGISTRY_TOKEN`) | +| `.gitea/workflows/perf.yml` | weekly, manual | Performance gates on SQLite and PostgreSQL 17 (service container); timings printed at the end of the log | +| `.gitea/workflows/release.yml` | tag `v*`, manual re-publish | The release (below) | + +### Windows-only tests without a Windows runner + +Until `WINDOWS_RUNNER` names a Windows runner, CI skips the *windows* job: run its steps on a Windows PC before a +merge, from the repository root in PowerShell 7. + +```powershell +dotnet build Chronos.slnx -c Release +dotnet run --project tests/Chronos.Core.Windows.Tests -c Release --no-build +dotnet run --project tests/Chronos.App.Tests -c Release --no-build + +# Screenshots and their diff (tests/visual/baselines/README.md) +foreach ($exe in 'src/Chronos.App/bin/Release/net10.0-windows/Chronos.exe', + 'src/Chronos.Uploader/bin/Release/net10.0-windows/Chronos.Uploader.exe', + 'src/Chronos.Setup/bin/Release/net10.0-windows/Chronos.Setup.exe') { + Start-Process -Wait $exe -ArgumentList '--capture', 'out/screenshots' +} +dotnet run --project src/Chronos.Tools -- screenshots diff out/screenshots --out out/screenshot-diff +``` + +The installer test is the last step of the *windows* job (*Install, run, upgrade and remove* in +`.gitea/workflows/ci.yml`): set `$env:RUNNER_TEMP` to an empty scratch folder and run that step's script. It installs, +upgrades and removes Chronos and the Uploader for the current user, so use a PC (or virtual machine) without an +installed copy of either. ## Release process -1. Make sure `main` is green and `docs/CHANGELOG.md` / `docs/STATUS.md` are up to date. +1. Make sure `main` is green, the Windows-only tests passed (on the Windows runner or a Windows PC) and + `docs/CHANGELOG.md` / `docs/STATUS.md` are up to date. 2. Tag and push: `git tag v0.2.0 && git push origin v0.2.0` (pre-releases: `v0.2.0-rc.1`; they are published as - GitHub pre-releases, get no `:latest` image and are ignored by the in-app update check). -3. `release.yml` then: - - validates the tag, builds with `TitanoVersion` from the tag and runs every test on Windows; - - publishes self-contained single-file programs, signs them when signing secrets exist, packs - `Titano-Setup-.exe` and `Titano-Uploader-Setup-.exe` (`Titano.Tools pack-installer`), signs the setups, - zips `Titano-Server-win-x64-.zip` and `Titano-win-x64-portable-.zip`; - - writes release notes from the Conventional Commits since the previous tag (`Titano.Tools changelog`); a stable + Gitea pre-releases, get no `:latest` image and are ignored by the in-app update check). +3. `release.yml` then, in its job *Build, test and publish* (SDK container): + - validates the tag, builds with `ChronosVersion` from the tag and `ChronosReleasesUrl` (the repository the release + goes to), runs the package guard, the i18n check and the Core, Data, Server and Tools tests; + - cross-compiles the self-contained single-file win-x64 programs (Chronos, Uploader and Setup with ReadyToRun; + Server), checks them with `Chronos.Tools pe-check` (GUI subsystem, icon, version, PerMonitorV2 manifest), signs + them with osslsigncode when the signing secrets exist, packs `Chronos-Setup-.exe` (components Chronos, + Uploader, Server) and `Chronos-Uploader-Setup-.exe` (`Chronos.Tools pack-installer`), signs the setups, zips + `Chronos-Server-win-x64-.zip` and `Chronos-win-x64-portable-.zip` (with `portable.txt`); + - writes release notes from the Conventional Commits since the previous tag (`Chronos.Tools changelog`); a stable tag starts from the previous stable tag, so its notes include what its release candidates brought; - - once the Windows tests passed, builds and pushes `ghcr.io//titano-server:` for amd64 and arm64; - - computes `SHA256SUMS`, checks the public issue forms, creates (or updates) the GitHub release in the public - repository, then moves the image's `:latest` tag and updates the public repository content (README, EULA, - `i18n/`, `SHA256SUMS`). `:latest`, *Latest* and the content follow the newest stable release: a pre-release, or - an older tag published again, only gets its release and its `:` image. Until the first stable release exists, - every tag updates the content. -4. To publish an existing tag again (for example after adding a secret), run *Release* manually with the tag. + - computes `SHA256SUMS` and publishes the Gitea release with `Chronos.Tools gitea-release`: a draft first, every + file uploaded and checked at its size, then published (as a pre-release for a tag with a `-`); + - only with a separate releases repository (`RELEASES_REPO`), and only when the tag is the newest stable release: + copies into it `deploy/releases-repo/README.md`, `EULA.md`, `SECURITY.md`, `.gitea/ISSUE_TEMPLATE`, the Unraid + template and its icon (as `unraid/`), the compose file and `.env.example` (as `docker/`), `i18n/` and + `SHA256SUMS`, rewriting links to that repository and its image. +4. Its job *Server image* (the runner's own image with the docker CLI and the host's daemon) then builds the image for + linux/amd64 only (arm64 would need QEMU on the host) and pushes + `gitea.encke-hake.ts.net/balbosoft/chronos-server:`, plus `:latest` when the tag is the highest stable version among + the published releases (not Gitea's `releases/latest`, which is the most recently created one): a pre-release, or an + older tag published again, only gets its release and its `:` image. Without `REGISTRY_TOKEN` this job fails with instructions while the release is already published: add + the secret and re-run the job. +5. To publish an existing tag again (for example after adding a secret), run *Release* manually (Actions › Release › + *Run workflow*) with the tag. ### Secrets and variables +Repository *Settings › Actions › Secrets* and *Variables*. With the defaults only the images need a secret. + | Name | Kind | Purpose | |---|---|---| -| `RELEASES_TOKEN` | secret | Fine-grained PAT with *Contents: read and write* on the public releases repository. Without it the release is created in this (private) repository, which clients cannot see. | -| `RELEASES_REPO` | variable (optional) | `owner/name` of the public repository; default `/titano-releases`. `release.yml` passes it to every build as the `TitanoReleasesRepo` MSBuild property, so the update check, licence and issue links of the binaries read the repository the release goes to (local builds default to `alby96/titano-releases`). | +| `REGISTRY_TOKEN` | secret | Access token (scope *package: read and write*) of a user who can write the owner's packages; `release.yml` and `docker.yml` push the server image with it. The workflow's own token (user `gitea-actions`) is refused by the organisation's registry. | +| `REGISTRY_USER` | variable (optional) | The user `REGISTRY_TOKEN` belongs to; default: the user who started the run (for a release, who pushed the tag). | +| `REGISTRY` | variable (optional) | Registry host; default: the host of `PUBLIC_URL`. | +| `PUBLIC_URL` | variable (optional) | Where people and programs reach Gitea; default `https://gitea.encke-hake.ts.net`. The runner itself uses the server address Gitea gives it. | +| `RELEASES_REPO` | variable (optional) | `owner/name` of another repository on the same Gitea that receives the releases; default: this repository. Give it a first commit (a README): Gitea refuses releases in an empty repository. Without `RELEASES_TOKEN` the release goes to this repository, with a warning. `release.yml` passes `/` to every build as the `ChronosReleasesUrl` MSBuild property, so the update check, licence and issue links of the binaries read the repository the release goes to (local builds default to `https://gitea.encke-hake.ts.net/BalboSoft/Chronos`). | +| `RELEASES_TOKEN` | secret (only with `RELEASES_REPO`) | Access token with write access to that repository (scope *repository: read and write*): it creates the release there and pushes the copied content. | +| `WINDOWS_RUNNER` | variable (optional) | Label of a Windows act_runner in host mode; when set, CI runs its *windows* job there. | | `SIGN_PFX_BASE64` | secret (optional) | Base64 of the Authenticode code-signing certificate (`.pfx`). Without it builds are unsigned. | | `SIGN_PASSWORD` | secret (optional) | Password of that `.pfx`. | -`GITHUB_TOKEN` pushes the image to GHCR and moves its `:latest` tag; no other secret is used. +Everything else uses the workflow's own token: the checkouts, the source archive of the YAML check and the release in +this repository. -### Bootstrapping the public releases repository +### Visibility -1. Create a **public** repository named `titano-releases` under the same owner (or set `RELEASES_REPO`), with a - README so it has a default branch. Enable *Issues* and *Private vulnerability reporting* (Settings › Security). -2. Create the fine-grained PAT (repository access: only that repository; permissions: Contents read/write) and store - it as the `RELEASES_TOKEN` secret of this repository. -3. Push a pre-release tag (`v0.1.0-rc.1`). The release job copies `deploy/releases-repo/` (README, EULA draft, - SECURITY policy, issue forms), the Unraid template and its icon, the compose file and `.env.example`, the dark - screenshots, `i18n/` and the latest `SHA256SUMS` into the public repository after creating the release with the - installers, rewriting links to its name and default branch. -4. After the first image push, open the `titano-server` package on GHCR › *Package settings* and set its - visibility to **Public** (GitHub offers no API for this; the release summary reminds you). -5. Have the EULA draft (`deploy/releases-repo/EULA.md`) reviewed before the first stable release. -6. In Unraid, add `https://github.com//titano-releases` under Docker › Template repositories to validate the - template. +Today the `BalboSoft` organisation is not visible to anonymous visitors, so the update check, release downloads, the +raw compose and Unraid files and image pulls work only for people signed in to the Gitea +(`docker login gitea.encke-hake.ts.net` before pulling). They work for everyone once the owner makes the organisation +(and its packages) public, or publishes to a public `RELEASES_REPO`. Gitea has no private vulnerability reporting: +security problems go privately to the maintainers (`SECURITY.md`), never into a public issue. + +### First release (once) + +1. Create `REGISTRY_TOKEN`: in the user *Settings › Applications* of a user who can write the `BalboSoft` packages, + generate an access token with scope *package: read and write*. Store it as the repository secret `REGISTRY_TOKEN` + and that user's name as the variable `REGISTRY_USER` (without it a run signs in as whoever triggered it). +2. Optional: make the `BalboSoft` organisation (and its packages) public, so other people get update notices, + downloads and the image without an account. +3. Optional: register an act_runner in host mode on a Windows PC that has the .NET SDK of `global.json`, Git for + Windows and PowerShell 7 (`act_runner register --no-interactive --instance https://gitea.encke-hake.ts.net + --token --labels windows:host`, then `act_runner daemon`), and set the + repository variable `WINDOWS_RUNNER` to its label (`windows`). +4. Optional: a separate releases repository. Create it on the same Gitea with a README (so it has a default branch) + and issues enabled, set `RELEASES_REPO` to its `owner/name` and store an access token with write access to it as + `RELEASES_TOKEN`. +5. Optional: the signing secrets `SIGN_PFX_BASE64` and `SIGN_PASSWORD`. +6. Once `main` holds the change, push the first pre-release tag: `git tag v0.1.0-rc.1 && git push origin v0.1.0-rc.1`. + Follow it under *Actions › Release*; the files appear under *Releases* and the image under the organisation's + *Packages*. +7. Have the EULA draft (`EULA.md`) reviewed before the first stable release. + +### Server image, Compose and Unraid + +- Image: `gitea.encke-hake.ts.net/balbosoft/chronos-server`, tags `:latest` (newest stable release), `:` and + `:nightly` (`main`, not for production); linux/amd64 only. +- Compose: `deploy/docker/docker-compose.yml` and `.env.example`, downloaded from + `https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/docker/docker-compose.yml` and + `…/deploy/docker/.env.example`. +- Unraid: `deploy/unraid/chronos.xml` (repository `…/chronos-server:latest`, project and support links to this + repository, template and icon from `…/raw/branch/main/`). `release.yml` rewrites these addresses by their exact + prefixes when it copies the files to a separate releases repository: keep them verbatim. To try the template, save + it on the Unraid server as a user template (`/boot/config/plugins/dockerMan/templates-user/my-chronos-server.xml`) + and pick *chronos-server* in Docker › *Add container* › *Template*. ## Repository layout ``` -src/ Titano.Core, Core.Windows, Data, Protocol, Server, Ui, App, Uploader, Setup, Tools -tests/ Titano.Testing and one test program per area; fixtures/ (manifest of CC0 samples) +src/ Chronos.Core, Core.Windows, Data, Protocol, Server, Ui, App, Uploader, Setup, Tools +tests/ Chronos.Testing and one test program per area; fixtures/ (manifest of CC0 samples) i18n/ /.resx string catalogs, GLOSSARY.md -deploy/ docker/ (Dockerfile, compose), unraid/ (template), releases-repo/ (public repository content) +deploy/ docker/ (Dockerfile, compose), unraid/ (template), releases-repo/ (README of a separate releases repository) +.gitea/ workflows/ (CI, release, nightly image, perf), scripts/ (YAML check, installer test), ISSUE_TEMPLATE/ branding/ SVG masters of the icons docs/ BRIEF, ARCHITECTURE, DECISIONS, STATUS, CHANGELOG, ui/ ``` diff --git a/deploy/releases-repo/SECURITY.md b/SECURITY.md similarity index 82% rename from deploy/releases-repo/SECURITY.md rename to SECURITY.md index 3bff6a19..5288d741 100644 --- a/deploy/releases-repo/SECURITY.md +++ b/SECURITY.md @@ -14,9 +14,10 @@ version; the in-app update check (Settings › Updates) and `docker compose pull Please **do not open a public issue** for a security problem. -Use GitHub's private vulnerability reporting: *Security* tab of this repository › *Report a vulnerability*. Include: +Gitea has no private vulnerability reporting: report the problem privately to the maintainers, through the contact on +the repository owner's Gitea profile or by e-mail to them. Include: -- the affected program (Titano, Uploader, Server) and version (About, or `/api/v1/server/info` for the server); +- the affected program (Chronos, Uploader, Server) and version (About, or `/api/v1/server/info` for the server); - how to reproduce the problem, and what an attacker gains; - whether the server runs behind a reverse proxy and which TLS mode it uses (`auto`, `pem`, `proxy`). @@ -36,7 +37,7 @@ Out of scope: problems that need an attacker who already controls the user's Win denial of service through unrealistic load; self-signed certificate warnings (the client pins the fingerprint you confirm at first connection); findings from automated scanners without a demonstrated impact. -## How Titano protects you +## How Chronos protects you - Releases list the SHA-256 of every file in `SHA256SUMS`; the in-app update download refuses a file whose hash does not match. Builds are Authenticode-signed when a signing certificate is configured. @@ -44,5 +45,5 @@ confirm at first connection); findings from automated scanners without a demonst sign-in is rate limited and accounts lock after repeated failures. - Desktop clients pin the server certificate fingerprint on first use, never send a saved token to a server whose certificate changed, and keep tokens encrypted with Windows DPAPI. -- No program runs external tools or scripts; the only programs Titano starts are your browser (for links) and +- No program runs external tools or scripts; the only programs Chronos starts are your browser (for links) and Explorer (to show a folder). diff --git a/Titano.slnx b/Titano.slnx deleted file mode 100644 index eee03c3e..00000000 --- a/Titano.slnx +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branding/titano-mono.svg b/branding/chronos-mono.svg similarity index 100% rename from branding/titano-mono.svg rename to branding/chronos-mono.svg diff --git a/branding/titano-server.svg b/branding/chronos-server.svg similarity index 100% rename from branding/titano-server.svg rename to branding/chronos-server.svg diff --git a/branding/titano-uploader.svg b/branding/chronos-uploader.svg similarity index 100% rename from branding/titano-uploader.svg rename to branding/chronos-uploader.svg diff --git a/branding/titano.svg b/branding/chronos.svg similarity index 100% rename from branding/titano.svg rename to branding/chronos.svg diff --git a/branding/ui-icons/icons.py b/branding/ui-icons/icons.py index 2ecc1973..424b6c72 100644 --- a/branding/ui-icons/icons.py +++ b/branding/ui-icons/icons.py @@ -1,6 +1,6 @@ -"""Titano UI icon set (DESIGN.md §5): 16-px grid, 1.5-px strokes, round caps/joins. +"""Chronos UI icon set (DESIGN.md §5): 16-px grid, 1.5-px strokes, round caps/joins. Each icon = stroke path data + optional fill path data. Generates the WPF resource dictionary -src/Titano.Ui/Icons/Icons.xaml and a preview sheet (icons.svg). Run: python3 branding/ui-icons/icons.py""" +src/Chronos.Ui/Icons/Icons.xaml and a preview sheet (icons.svg). Run: python3 branding/ui-icons/icons.py""" import math, os def rr(x, y, w, h, r): @@ -127,11 +127,11 @@ I["Cross"] = ("M4.5 4.5 L11.5 11.5 M11.5 4.5 L4.5 11.5", None) # Everything else (clocks, media controls, the ▶ rendered status, symmetric shapes) never mirrors. DIRECTIONAL = {"Back", "Forward", "ChevronLeft", "ChevronRight", "ExternalLink", "Jobs", "Logs", "ViewList"} -out = os.path.join(os.path.dirname(__file__), "..", "..", "src", "Titano.Ui", "Icons", "Icons.xaml") +out = os.path.join(os.path.dirname(__file__), "..", "..", "src", "Chronos.Ui", "Icons", "Icons.xaml") with open(out, "w") as f: f.write('\n') + f.write(' xmlns:ui="clr-namespace:Chronos.Ui.Controls">\n') f.write(' \n') for name, (stroke, fill) in sorted(I.items()): attrs = '' diff --git a/deploy/docker/.env.example b/deploy/docker/.env.example index 34666df7..9ef6444e 100644 --- a/deploy/docker/.env.example +++ b/deploy/docker/.env.example @@ -1,9 +1,9 @@ -TITANO_ADMIN_PASSWORD=change-me-at-first-login -TITANO_DB_PASSWORD=choose-a-long-random-password +CHRONOS_ADMIN_PASSWORD=change-me-at-first-login +CHRONOS_DB_PASSWORD=choose-a-long-random-password # Folder of your archive, owned by PUID:PGID (an empty or root-owned folder is given to them at the first start) -TITANO_ARCHIVE=/mnt/user/Timelapse -TITANO_DATA=./data -TITANO_PGDATA=./pgdata +CHRONOS_ARCHIVE=/mnt/user/Timelapse +CHRONOS_DATA=./data +CHRONOS_PGDATA=./pgdata PUID=1000 PGID=1000 TZ=Europe/Rome diff --git a/deploy/docker/Dockerfile b/deploy/docker/Dockerfile index 62efaee5..274e3e73 100644 --- a/deploy/docker/Dockerfile +++ b/deploy/docker/Dockerfile @@ -1,33 +1,33 @@ -# Titano Server — multi-stage, multi-arch (linux/amd64, linux/arm64). BRIEF §14.9. +# Chronos Server — multi-stage, multi-arch (linux/amd64, linux/arm64). BRIEF §14.9. FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build ARG TARGETARCH -ARG TITANO_VERSION=0.0.0-dev +ARG CHRONOS_VERSION=0.0.0-dev WORKDIR /src -COPY global.json Directory.Build.props Directory.Build.targets Titano.slnx ./ +COPY global.json Directory.Build.props Directory.Build.targets Chronos.slnx ./ COPY i18n/ i18n/ -COPY src/Titano.Core/ src/Titano.Core/ -COPY src/Titano.Data/ src/Titano.Data/ -COPY src/Titano.Protocol/ src/Titano.Protocol/ -COPY src/Titano.Server/ src/Titano.Server/ -RUN dotnet publish src/Titano.Server/Titano.Server.csproj \ +COPY src/Chronos.Core/ src/Chronos.Core/ +COPY src/Chronos.Data/ src/Chronos.Data/ +COPY src/Chronos.Protocol/ src/Chronos.Protocol/ +COPY src/Chronos.Server/ src/Chronos.Server/ +RUN dotnet publish src/Chronos.Server/Chronos.Server.csproj \ -c Release -a "$TARGETARCH" --no-self-contained \ - -p:TitanoVersion="$TITANO_VERSION" -o /out \ + -p:ChronosVersion="$CHRONOS_VERSION" -o /out \ && rm -f /out/*.pdb FROM mcr.microsoft.com/dotnet/aspnet:10.0 -ARG TITANO_VERSION=0.0.0-dev -LABEL org.opencontainers.image.title="Titano Server" \ +ARG CHRONOS_VERSION=0.0.0-dev +LABEL org.opencontainers.image.title="Chronos Server" \ org.opencontainers.image.description="Time-lapse archive, uploads, jobs and rendering server" \ - org.opencontainers.image.version="$TITANO_VERSION" \ - org.opencontainers.image.licenses="LicenseRef-Titano-EULA" + org.opencontainers.image.version="$CHRONOS_VERSION" \ + org.opencontainers.image.licenses="LicenseRef-Chronos-EULA" # ASPNETCORE_HTTP_PORTS is emptied: the server binds its own ports, and the base image's 8080 only made Kestrel warn # "Overriding address(es)" at every start. -ENV TITANO_ARCHIVE_PATH=/archive \ - TITANO_DATA_PATH=/data \ - TITANO_HTTP_PORT=8080 \ - TITANO_HTTPS_PORT=8443 \ - TITANO_DB=postgres \ +ENV CHRONOS_ARCHIVE_PATH=/archive \ + CHRONOS_DATA_PATH=/data \ + CHRONOS_HTTP_PORT=8080 \ + CHRONOS_HTTPS_PORT=8443 \ + CHRONOS_DB=postgres \ PUID=1000 \ PGID=1000 \ ASPNETCORE_HTTP_PORTS= \ @@ -36,10 +36,10 @@ ENV TITANO_ARCHIVE_PATH=/archive \ DOTNET_NOLOGO=1 WORKDIR /app COPY --from=build /out/ ./ -COPY deploy/docker/entrypoint.sh /usr/local/bin/titano-entrypoint -RUN chmod 0755 /usr/local/bin/titano-entrypoint && mkdir -p /archive /data +COPY deploy/docker/entrypoint.sh /usr/local/bin/chronos-entrypoint +RUN chmod 0755 /usr/local/bin/chronos-entrypoint && mkdir -p /archive /data VOLUME ["/archive", "/data"] EXPOSE 8080 8443 HEALTHCHECK --interval=30s --timeout=8s --start-period=40s --retries=3 \ - CMD ["dotnet", "/app/Titano.Server.dll", "--healthcheck"] -ENTRYPOINT ["/usr/local/bin/titano-entrypoint"] + CMD ["dotnet", "/app/Chronos.Server.dll", "--healthcheck"] +ENTRYPOINT ["/usr/local/bin/chronos-entrypoint"] diff --git a/deploy/docker/docker-compose.yml b/deploy/docker/docker-compose.yml index 563cdcac..0f7fe1af 100644 --- a/deploy/docker/docker-compose.yml +++ b/deploy/docker/docker-compose.yml @@ -1,66 +1,67 @@ -# Titano Server with PostgreSQL 17. Start: docker compose up -d Admin panel: http://:8080/admin -name: titano +# Chronos Server with PostgreSQL 17. Start: docker compose up -d Admin panel: http://:8080/admin +name: chronos services: - titano: - image: ghcr.io/alby96/titano-server:latest + chronos: + # While the organisation on Gitea is private, sign in before pulling: docker login gitea.encke-hake.ts.net + image: gitea.encke-hake.ts.net/balbosoft/chronos-server:latest restart: unless-stopped depends_on: postgres: condition: service_healthy - # Publishing a port as another host port ("18443:8443")? Set TITANO_PUBLIC_HTTPS_PORT (and _HTTP_PORT) below to the + # Publishing a port as another host port ("18443:8443")? Set CHRONOS_PUBLIC_HTTPS_PORT (and _HTTP_PORT) below to the # host port. LAN discovery reaches clients only with "network_mode: host"; on this bridge network clients add the # server by its address. With host networking drop "ports", give the postgres service - # ports: ["127.0.0.1:5432:5432"] and set TITANO_DB_HOST to 127.0.0.1: the name "postgres" no longer resolves there. + # ports: ["127.0.0.1:5432:5432"] and set CHRONOS_DB_HOST to 127.0.0.1: the name "postgres" no longer resolves there. ports: - "8080:8080" - "8443:8443" environment: - TITANO_ADMIN_USER: admin - TITANO_ADMIN_PASSWORD: ${TITANO_ADMIN_PASSWORD:?set TITANO_ADMIN_PASSWORD in .env} - # postgres (with the TITANO_DB_* values below) or a full connection string: Host=…;Database=…;Username=…;Password=… - TITANO_DB: postgres - TITANO_DB_HOST: postgres - TITANO_DB_NAME: titano - TITANO_DB_USER: titano - TITANO_DB_PASSWORD: ${TITANO_DB_PASSWORD:?set TITANO_DB_PASSWORD in .env} - # auto (self-signed), pem or proxy. Behind a proxy, set TITANO_TRUSTED_PROXIES to the proxy's own address (only + CHRONOS_ADMIN_USER: admin + CHRONOS_ADMIN_PASSWORD: ${CHRONOS_ADMIN_PASSWORD:?set CHRONOS_ADMIN_PASSWORD in .env} + # postgres (with the CHRONOS_DB_* values below) or a full connection string: Host=…;Database=…;Username=…;Password=… + CHRONOS_DB: postgres + CHRONOS_DB_HOST: postgres + CHRONOS_DB_NAME: chronos + CHRONOS_DB_USER: chronos + CHRONOS_DB_PASSWORD: ${CHRONOS_DB_PASSWORD:?set CHRONOS_DB_PASSWORD in .env} + # auto (self-signed), pem or proxy. Behind a proxy, set CHRONOS_TRUSTED_PROXIES to the proxy's own address (only # loopback is trusted otherwise). Give a proxy container a fixed one (ipv4_address, on a network with an ipam - # subnet that this service joins too) and let it reach Titano on that network, not through a published port. + # subnet that this service joins too) and let it reach Chronos on that network, not through a published port. # Never list a subnet or the network's gateway (.1): Docker relays connections to the published ports (IPv6 # clients, the host) from the gateway, and each of them could then choose its client address. For a proxy on the - # host itself, run this service with network_mode: host; the proxy then reaches Titano over loopback. - TITANO_TLS_MODE: auto - # TITANO_TRUSTED_PROXIES: "172.30.0.10" - # TITANO_PUBLIC_HTTPS_PORT: "8443" - TITANO_SERVER_NAME: Titano Server + # host itself, run this service with network_mode: host; the proxy then reaches Chronos over loopback. + CHRONOS_TLS_MODE: auto + # CHRONOS_TRUSTED_PROXIES: "172.30.0.10" + # CHRONOS_PUBLIC_HTTPS_PORT: "8443" + CHRONOS_SERVER_NAME: Chronos Server # Jobs run one at a time. Photos the running job processes at once (default: half the cores), and the priority queue # (a higher job pauses the running one, which resumes afterwards). Set here, they can no longer be changed in the # admin panel's Settings. - # TITANO_PARALLELISM: "4" - # TITANO_PRIORITY_QUEUE: "true" + # CHRONOS_PARALLELISM: "4" + # CHRONOS_PRIORITY_QUEUE: "true" # Trace, Debug, Information, Warning or Error - TITANO_LOG_LEVEL: Information + CHRONOS_LOG_LEVEL: Information PUID: ${PUID:-1000} PGID: ${PGID:-1000} TZ: ${TZ:-UTC} volumes: # The archive folder should belong to PUID:PGID; an empty or root-owned one is given to them at start (the folder # only, never its contents). - - ${TITANO_ARCHIVE:-./archive}:/archive - - ${TITANO_DATA:-./data}:/data + - ${CHRONOS_ARCHIVE:-./archive}:/archive + - ${CHRONOS_DATA:-./data}:/data postgres: image: postgres:17 restart: unless-stopped environment: - POSTGRES_DB: titano - POSTGRES_USER: titano - POSTGRES_PASSWORD: ${TITANO_DB_PASSWORD:?set TITANO_DB_PASSWORD in .env} + POSTGRES_DB: chronos + POSTGRES_USER: chronos + POSTGRES_PASSWORD: ${CHRONOS_DB_PASSWORD:?set CHRONOS_DB_PASSWORD in .env} volumes: - - ${TITANO_PGDATA:-./pgdata}:/var/lib/postgresql/data + - ${CHRONOS_PGDATA:-./pgdata}:/var/lib/postgresql/data healthcheck: - test: ["CMD-SHELL", "pg_isready -U titano -d titano"] + test: ["CMD-SHELL", "pg_isready -U chronos -d chronos"] interval: 10s timeout: 5s retries: 10 diff --git a/deploy/docker/entrypoint.sh b/deploy/docker/entrypoint.sh index 3a542c5b..0aea7c34 100755 --- a/deploy/docker/entrypoint.sh +++ b/deploy/docker/entrypoint.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Runs Titano Server as PUID:PGID (Unraid/NAS convention). The data folder is owned by that user. The archive is left +# Runs Chronos Server as PUID:PGID (Unraid/NAS convention). The data folder is owned by that user. The archive is left # as mounted (it may hold terabytes) and only checked for write access; only when that user cannot write it and the # folder is empty or owned by root (Docker creates a missing bind source or a fresh volume that way) is the folder # itself, never its contents, given to PUID:PGID. @@ -7,13 +7,13 @@ set -eu PUID="${PUID:-1000}" PGID="${PGID:-1000}" -DATA="${TITANO_DATA_PATH:-/data}" -ARCHIVE="${TITANO_ARCHIVE_PATH:-/archive}" +DATA="${CHRONOS_DATA_PATH:-/data}" +ARCHIVE="${CHRONOS_ARCHIVE_PATH:-/archive}" umask 002 # Help and the health probe touch neither folder. case "${1:-}" in - --help | -h | -\? | /\? | --healthcheck) exec dotnet /app/Titano.Server.dll "$@" ;; + --help | -h | -\? | /\? | --healthcheck) exec dotnet /app/Chronos.Server.dll "$@" ;; esac as_user() { @@ -27,7 +27,7 @@ if [ "$(id -u)" = "0" ]; then if [ -z "$(ls -A "$ARCHIVE")" ] || [ "$(stat -c %u "$ARCHIVE")" = "0" ]; then owner="$(stat -c %u:%g "$ARCHIVE")" if chown "$PUID:$PGID" "$ARCHIVE" 2>/dev/null; then - echo "titano: $ARCHIVE belonged to $owner; it now belongs to $PUID:$PGID (the folder only, not its contents)" + echo "chronos: $ARCHIVE belonged to $owner; it now belongs to $PUID:$PGID (the folder only, not its contents)" fi fi if ! as_user test -w "$ARCHIVE"; then @@ -35,15 +35,15 @@ if [ "$(id -u)" = "0" ]; then exit 1 fi fi - # The server writes into the archive's .titano folders at once (staging, trash, locks); one left to root by an + # The server writes into the archive's .chronos folders at once (staging, trash, locks); one left to root by an # earlier run as root, or copied in by root, would stop it in a restart loop. Reported, never chowned. - for dir in "$ARCHIVE/.titano" "$ARCHIVE/.titano"/*/; do + for dir in "$ARCHIVE/.chronos" "$ARCHIVE/.chronos"/*/; do if [ -d "$dir" ] && ! as_user test -w "$dir"; then - echo "error: ${dir%/} is not writable by $PUID:$PGID; give that user write access to it on the host (for example chown -R $PUID:$PGID /.titano)" >&2 + echo "error: ${dir%/} is not writable by $PUID:$PGID; give that user write access to it on the host (for example chown -R $PUID:$PGID /.chronos)" >&2 exit 1 fi done - exec setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- dotnet /app/Titano.Server.dll "$@" + exec setpriv --reuid="$PUID" --regid="$PGID" --clear-groups -- dotnet /app/Chronos.Server.dll "$@" fi -exec dotnet /app/Titano.Server.dll "$@" +exec dotnet /app/Chronos.Server.dll "$@" diff --git a/deploy/releases-repo/README.md b/deploy/releases-repo/README.md index b132fe83..80db0eb1 100644 --- a/deploy/releases-repo/README.md +++ b/deploy/releases-repo/README.md @@ -1,6 +1,6 @@ -# Titano +# Chronos -Titano turns folders of photos (RAW, JPEG, HEIC…) into finished time-lapse videos and keeps a lifetime archive of +Chronos turns folders of photos (RAW, JPEG, HEIC…) into finished time-lapse videos and keeps a lifetime archive of your shoots organised, verified and searchable — on one PC or on a shared server. This repository publishes the installers, the Docker image instructions, the Unraid template and the translations @@ -12,9 +12,9 @@ for community review. Development happens elsewhere; please use the issues here | Program | Runs on | What it does | |---|---|---| -| **Titano** | Windows 10 21H2+ / 11, x64 | Desktop client: card import with hash verification, archive, analysis advisor, sequence editor, rendering with GPU encoders (H.264, HEVC, AV1) | -| **Titano Uploader** | Windows 10 21H2+ / 11, x64 | Small tray program that uploads photos, folders, cards and watch folders to a Titano Server | -| **Titano Server** | Docker (linux/amd64, linux/arm64), Unraid, Windows | Shared archive, users, resumable uploads, sync, background jobs, render delegation to GPU-equipped PCs, web admin panel | +| **Chronos** | Windows 10 21H2+ / 11, x64 | Desktop client: card import with hash verification, archive, analysis advisor, sequence editor, rendering with GPU encoders (H.264, HEVC, AV1) | +| **Chronos Uploader** | Windows 10 21H2+ / 11, x64 | Small tray program that uploads photos, folders, cards and watch folders to a Chronos Server | +| **Chronos Server** | Docker (linux/amd64), Unraid, Windows | Shared archive, users, resumable uploads, sync, background jobs, render delegation to GPU-equipped PCs, web admin panel | | | | |---|---| @@ -25,44 +25,44 @@ for community review. Development happens elsewhere; please use the issues here - **Desktop programs:** Windows 10 version 21H2 or later, or Windows 11, 64-bit (x64). 8 GB of memory or more is recommended for 4K renders. No other runtime is needed: the programs are self-contained. -- **Camera RAW files:** Titano develops DNG, CR2, NEF, ARW, PEF and RAF on its own. With Microsoft's free +- **Camera RAW files:** Chronos develops DNG, CR2, NEF, ARW, PEF and RAF on its own. With Microsoft's free *Raw Image Extension* installed, Windows' decoder is used first and covers the other formats (CR3, ORF, RW2…); without it they render from the full-size preview embedded by the camera. HEIC needs Microsoft's *HEIF Image Extensions* and *HEVC Video Extensions*. - **Hardware encoding:** any GPU whose driver provides Media Foundation encoders (NVIDIA, AMD, Intel). Without one, - Titano encodes H.264 in software and its own formats (AVI, GIF, APNG, image sequences). + Chronos encodes H.264 in software and its own formats (AVI, GIF, APNG, image sequences). - **Server:** Docker 20.10+ (or Unraid 6.12+) and PostgreSQL 16 or 17; or Windows 10/11/Server 2019+ x64. ## Install, upgrade, uninstall (Windows) -1. Download `Titano-Setup-.exe` (Titano, Uploader and, optionally, Server) or - `Titano-Uploader-Setup-.exe` from the [latest release](../../releases/latest). +1. Download `Chronos-Setup-.exe` (Chronos, Uploader and, optionally, Server) or + `Chronos-Uploader-Setup-.exe` from the [latest release](https://gitea.encke-hake.ts.net/BalboSoft/Chronos/releases/latest). 2. Check the download (optional, recommended): in PowerShell run - `Get-FileHash .\Titano-Setup-.exe -Algorithm SHA256` and compare the value with the line for that file + `Get-FileHash .\Chronos-Setup-.exe -Algorithm SHA256` and compare the value with the line for that file in `SHA256SUMS` of the same release. -3. Run the setup. It installs for the current user into `%LOCALAPPDATA%\Programs\Titano` without administrator +3. Run the setup. It installs for the current user into `%LOCALAPPDATA%\Programs\Chronos` without administrator rights; choose *All users* to install into `Program Files` (Windows asks for permission). The *Server* component runs as a Windows service, so choosing it installs for all users, in a folder inside `Program Files`. -- **Upgrade:** Titano checks this repository at start (you can turn this off in Settings › Updates) and shows a notice +- **Upgrade:** Chronos checks this repository at start (you can turn this off in Settings › Updates) and shows a notice when a new version exists. *Download* fetches the setup, verifies it against `SHA256SUMS` and shows it in Explorer; run it to upgrade in place. Your archive, settings and index are kept. -- **Uninstall:** Windows Settings › Apps › Installed apps › Titano › Uninstall. Your photos and archive are never - touched; the program data in `%LOCALAPPDATA%\Titano` is removed only if you tick the option to do so, and only the - part no other installed Titano program still uses. A Titano Server service of that folder is stopped and removed. -- **Silent install** (IT deployment): `Titano-Setup-.exe /S [/DIR="D:\Apps\Titano"] [/ALLUSERS] - [/COMPONENTS=Titano,Uploader,Server] [/NODESKTOP] [/NOSTARTMENU] [/LANG=it]`. Silent uninstall: - `"%LOCALAPPDATA%\Programs\Titano\Uninstall Titano.exe" /uninstall /S`. -- **Portable:** `Titano-win-x64-portable-.zip` keeps its data in a `data` folder next to `Titano.exe` +- **Uninstall:** Windows Settings › Apps › Installed apps › Chronos › Uninstall. Your photos and archive are never + touched; the program data in `%LOCALAPPDATA%\Chronos` is removed only if you tick the option to do so, and only the + part no other installed Chronos program still uses. A Chronos Server service of that folder is stopped and removed. +- **Silent install** (IT deployment): `Chronos-Setup-.exe /S [/DIR="D:\Apps\Chronos"] [/ALLUSERS] + [/COMPONENTS=Chronos,Uploader,Server] [/NODESKTOP] [/NOSTARTMENU] [/LANG=it]`. Silent uninstall: + `"%LOCALAPPDATA%\Programs\Chronos\Uninstall Chronos.exe" /uninstall /S`. +- **Portable:** `Chronos-win-x64-portable-.zip` keeps its data in a `data` folder next to `Chronos.exe` (because of the `portable.txt` file). Do not unpack it into a OneDrive or Dropbox folder. -## Titano Server with Docker Compose +## Chronos Server with Docker Compose ```sh -mkdir titano && cd titano -curl -LO https://raw.githubusercontent.com/alby96/titano-releases/main/docker/docker-compose.yml -curl -L -o .env https://raw.githubusercontent.com/alby96/titano-releases/main/docker/.env.example -# edit .env: TITANO_ADMIN_PASSWORD, TITANO_DB_PASSWORD, TITANO_ARCHIVE (folder of your archive), PUID/PGID, TZ +mkdir chronos && cd chronos +curl -LO https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/docker/docker-compose.yml +curl -L -o .env https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/docker/.env.example +# edit .env: CHRONOS_ADMIN_PASSWORD, CHRONOS_DB_PASSWORD, CHRONOS_ARCHIVE (folder of your archive), PUID/PGID, TZ docker compose up -d ``` @@ -70,70 +70,74 @@ Create the archive folder owned by `PUID:PGID` first (for example `mkdir -p :8080/admin`, sign in as `admin` with the password from `.env` and choose a new one. Titano +Open `http://:8080/admin`, sign in as `admin` with the password from `.env` and choose a new one. Chronos clients connect to `https://:8443`; the first connection shows the server's certificate fingerprint, which the admin panel shows under Settings so you can compare them. -- Image: `ghcr.io/alby96/titano-server:latest` (also `:`; `:nightly` follows development and is not for - production use). Multi-arch: `linux/amd64` and `linux/arm64`. -- Volumes: `/archive` (originals, sidecars, proxies, renders — the archive stays readable without Titano) and `/data` +- Image: `gitea.encke-hake.ts.net/balbosoft/chronos-server:latest` (also `:`; `:nightly` follows development + and is not for production use; pre-releases have no `:latest`). Architecture: `linux/amd64`. If the registry asks you + to sign in, run `docker login gitea.encke-hake.ts.net` with your Gitea account first. +- Volumes: `/archive` (originals, sidecars, proxies, renders — the archive stays readable without Chronos) and `/data` (settings, TLS certificate, uploads in progress, logs). - Upgrade: `docker compose pull && docker compose up -d`. Jobs in progress resume from their last checkpoint. -- All settings: environment variables `TITANO_*` (see `docker-compose.yml`) or `/data/server.json`. Run - `docker run --rm ghcr.io/alby96/titano-server:latest --help` for the list. +- All settings: environment variables `CHRONOS_*` (see `docker-compose.yml`) or `/data/server.json`. Run + `docker run --rm gitea.encke-hake.ts.net/balbosoft/chronos-server:latest --help` for the list. - Other host ports: when you publish the container's ports as other host ports (`18443:8443`), set - `TITANO_PUBLIC_HTTPS_PORT` (and `TITANO_PUBLIC_HTTP_PORT`) to the host ports, so the admin panel's redirect to HTTPS + `CHRONOS_PUBLIC_HTTPS_PORT` (and `CHRONOS_PUBLIC_HTTP_PORT`) to the host ports, so the admin panel's redirect to HTTPS and LAN discovery name the ports clients can reach. -- LAN discovery (`TITANO_DISCOVERY`, on by default) needs host networking (`network_mode: host` in compose, Network +- LAN discovery (`CHRONOS_DISCOVERY`, on by default) needs host networking (`network_mode: host` in compose, Network type *Host* on Unraid): on a bridge network its broadcasts never leave the container's network. Without it, add the - server in Titano by its address. With `network_mode: host` the name `postgres` no longer resolves: remove the - `ports` of the `titano` service, publish PostgreSQL on loopback (`ports: ["127.0.0.1:5432:5432"]` under `postgres`) - and set `TITANO_DB_HOST: 127.0.0.1`. -- Behind a reverse proxy (`TITANO_TLS_MODE=proxy`), only the proxies listed in `TITANO_TRUSTED_PROXIES` may set + server in Chronos by its address. With `network_mode: host` the name `postgres` no longer resolves: remove the + `ports` of the `chronos` service, publish PostgreSQL on loopback (`ports: ["127.0.0.1:5432:5432"]` under `postgres`) + and set `CHRONOS_DB_HOST: 127.0.0.1`. +- Behind a reverse proxy (`CHRONOS_TLS_MODE=proxy`), only the proxies listed in `CHRONOS_TRUSTED_PROXIES` may set `X-Forwarded-*` headers. By default that is loopback only: other machines on your network reach the HTTP port directly, so they must not choose the address the sign-in limit and the audit log see. List your proxy's own - address. Give a proxy container a fixed IP on a user-defined Docker network it shares with Titano (`ipv4_address` in - compose, *Fixed IP address* on Unraid), for example `172.30.0.10`, and let it reach Titano on that network rather + address. Give a proxy container a fixed IP on a user-defined Docker network it shares with Chronos (`ipv4_address` in + compose, *Fixed IP address* on Unraid), for example `172.30.0.10`, and let it reach Chronos on that network rather than through a published port. Never list a subnet, the network's gateway (`.1`) or Docker's default bridge (`172.17.0.0/16`): Docker relays connections to published ports from the gateway (IPv6 clients, the host itself), and on the default bridge every other container would count as your proxy too. For a proxy running on the Docker - host itself, run Titano with `network_mode: host`: the proxy then reaches it over loopback. The admin panel shows + host itself, run Chronos with `network_mode: host`: the proxy then reaches it over loopback. The admin panel shows *Not via proxy* when a page did not come through a trusted proxy over HTTPS. -## Titano Server on Unraid +## Chronos Server on Unraid -1. Install the official **postgresql17** template from Community Applications. Create a database `titano` owned by a - role `titano` (for example with `docker exec -it postgresql17 psql -U postgres -c "CREATE ROLE titano LOGIN - PASSWORD '…'" -c "CREATE DATABASE titano OWNER titano"`). -2. In Docker › *Template repositories* add `https://github.com/alby96/titano-releases` and save. -3. Docker › *Add container* › Template `titano-server`. Set the admin password, the database host, password and the +1. Install the official **postgresql17** template from Community Applications. Create a database `chronos` owned by a + role `chronos` (for example with `docker exec -it postgresql17 psql -U postgres -c "CREATE ROLE chronos LOGIN + PASSWORD '…'" -c "CREATE DATABASE chronos OWNER chronos"`). +2. Save the template [`unraid/chronos.xml`](unraid/chronos.xml) on the Unraid server as + `/boot/config/plugins/dockerMan/templates-user/my-chronos-server.xml` (for example with + `wget -O /boot/config/plugins/dockerMan/templates-user/my-chronos-server.xml `, the address in the + template's ``). Unraid's *Template repositories* read GitHub and GitLab addresses, not Gitea's. +3. Docker › *Add container* › Template `chronos-server`. Set the admin password, the database host, password and the archive share (default `/mnt/user/Timelapse`). The database host is the Unraid server's IP address (the PostgreSQL template publishes port 5432): container names resolve only when both containers are on the same custom Docker network, not on the default *bridge*. If you change the HTTPS port, enter the same port in *Public HTTPS port*. 4. Open the WebUI (`http://[IP]:8080/admin`). -The template file is [`unraid/titano.xml`](unraid/titano.xml). +The template file is [`unraid/chronos.xml`](unraid/chronos.xml). -## Titano Server on Windows +## Chronos Server on Windows -Choose the *Server* component in the setup, or unpack `Titano-Server-win-x64-.zip`. It uses SQLite in -`C:\ProgramData\Titano Server` by default, or PostgreSQL with `TITANO_DB=postgres` and the `TITANO_DB_*` variables. -The data folder is readable only by the server's account, SYSTEM and Administrators; without `TITANO_ADMIN_PASSWORD` +Choose the *Server* component in the setup, or unpack `Chronos-Server-win-x64-.zip`. It uses SQLite in +`C:\ProgramData\Chronos Server` by default, or PostgreSQL with `CHRONOS_DB=postgres` and the `CHRONOS_DB_*` variables. +The data folder is readable only by the server's account, SYSTEM and Administrators; without `CHRONOS_ADMIN_PASSWORD` the first start writes a temporary admin password to `initial-admin-password.txt` there (open it from an administrator prompt). Everything in it must belong to those accounts and nothing in it may be a link: otherwise the server does not start and names the file to check (in the console, or for the service in Event Viewer › Windows Logs › -Application, source `TitanoServer`). A new archive folder (default `C:\TitanoArchive`) can be changed only by those +Application, source `ChronosServer`). A new archive folder (default `C:\ChronosArchive`) can be changed only by those accounts and read by other users; when other users can change an existing archive, the log says so. -Run `Titano.Server.exe` in a console, or install it as a Windows service from an administrator prompt with -`Titano.Server.exe --install-service` (remove it with `--uninstall-service`). The service runs as LocalSystem, so it +Run `Chronos.Server.exe` in a console, or install it as a Windows service from an administrator prompt with +`Chronos.Server.exe --install-service` (remove it with `--uninstall-service`). The service runs as LocalSystem, so it registers only from a copy inside `Program Files` that only administrators can change: install for *All users*, or unpack the zip into a folder under `Program Files`. A console run that was not elevated creates the data folder as the account that ran it, and the service then refuses the folder and names that account (`… belongs to PC\name …`). Either delete the folder (with SQLite this also deletes the server's database and its accounts), or give the folder and everything in it to Administrators and take that account's access to it away, from a Command Prompt run as -administrator: `takeown /F "C:\ProgramData\Titano Server" /A /R`, then -`icacls "C:\ProgramData\Titano Server" /remove:g "PC\name" /T`, with the account the refusal names in place of +administrator: `takeown /F "C:\ProgramData\Chronos Server" /A /R`, then +`icacls "C:\ProgramData\Chronos Server" /remove:g "PC\name" /T`, with the account the refusal names in place of `PC\name` (`dir /q C:\ProgramData` also shows it, as the folder's owner, until `takeown` runs). When you ran the console yourself and the prompt runs as you, that account is `"%USERDOMAIN%\%USERNAME%"`. Then start the service. No other account gains access at any step, and afterwards only SYSTEM and Administrators have it, to the TLS key and @@ -142,14 +146,14 @@ inherit those of `C:\ProgramData`, which let every user read it. ## Translations -Titano is written in English and Italian; every other language is machine-translated and marked as such in +Chronos is written in English and Italian; every other language is machine-translated and marked as such in About. The source strings are in [`i18n/`](i18n): `en/.resx` is the source, `/..resx` the translation. To suggest a correction, open a **Translation review** issue with the key, the current text and your proposal — or the in-app *Suggest a fix* link in About, which leads here. ## Verifying downloads -Every release carries `SHA256SUMS`. On Linux or macOS: `sha256sum -c SHA256SUMS --ignore-missing`. Titano's +Every release carries `SHA256SUMS`. On Linux or macOS: `sha256sum -c SHA256SUMS --ignore-missing`. Chronos's in-app update download performs the same check before showing the setup or portable zip. Signed builds carry an Authenticode signature; unsigned builds may show a SmartScreen prompt. @@ -162,4 +166,4 @@ signature; unsigned builds may show a SmartScreen prompt. ## Licence -Titano is proprietary software distributed free of charge under the [End User Licence Agreement](EULA.md). +Chronos is proprietary software distributed free of charge under the [End User Licence Agreement](EULA.md). diff --git a/deploy/unraid/chronos.xml b/deploy/unraid/chronos.xml new file mode 100644 index 00000000..38424327 --- /dev/null +++ b/deploy/unraid/chronos.xml @@ -0,0 +1,46 @@ + + + chronos-server + gitea.encke-hake.ts.net/balbosoft/chronos-server:latest + https://gitea.encke-hake.ts.net/BalboSoft/Chronos + bridge + + sh + false + https://gitea.encke-hake.ts.net/BalboSoft/Chronos/issues + https://gitea.encke-hake.ts.net/BalboSoft/Chronos + Chronos Server keeps a shared, verified archive of time-lapse photo sequences and renders them. Pair it with the official PostgreSQL 17 container. + MediaServer:Photos Tools: + http://[IP]:[PORT:8080]/admin + https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/unraid/chronos.xml + https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/branding/chronos-server.svg + --restart unless-stopped + + + + + + A PostgreSQL 16 or 17 container (official "postgres" template) with a database and user for Chronos. + 8080 + 8443 + + /mnt/user/Timelapse + /mnt/user/appdata/chronos + admin + + + 5432 + chronos + chronos + + prefer + auto + + Chronos Server + + + Information + 99 + 100 + Europe/Rome + diff --git a/deploy/unraid/titano.xml b/deploy/unraid/titano.xml deleted file mode 100644 index b78768a4..00000000 --- a/deploy/unraid/titano.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - titano-server - ghcr.io/alby96/titano-server:latest - https://github.com/alby96/titano-releases - bridge - - sh - false - https://github.com/alby96/titano-releases/issues - https://github.com/alby96/titano-releases - Titano Server keeps a shared, verified archive of time-lapse photo sequences and renders them. Pair it with the official PostgreSQL 17 container. - MediaServer:Photos Tools: - http://[IP]:[PORT:8080]/admin - https://raw.githubusercontent.com/alby96/titano-releases/main/unraid/titano.xml - https://raw.githubusercontent.com/alby96/titano-releases/main/unraid/titano-server.png - --restart unless-stopped - - - - - - A PostgreSQL 16 or 17 container (official "postgres" template) with a database and user for Titano. - 8080 - 8443 - - /mnt/user/Timelapse - /mnt/user/appdata/titano - admin - - - 5432 - titano - titano - - prefer - auto - - Titano Server - - - Information - 99 - 100 - Europe/Rome - diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 1320c325..372f712d 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -1,4 +1,4 @@ -# Titano — Architecture and code conventions +# Chronos — Architecture and code conventions Companion to `docs/BRIEF.md` (scope, behaviour) and `docs/ui/DESIGN.md` (looks). This file says *where code goes*, *how data moves* and *how it is written*. Decisions behind the shapes described here are in `docs/DECISIONS.md`. @@ -7,25 +7,25 @@ Companion to `docs/BRIEF.md` (scope, behaviour) and `docs/ui/DESIGN.md` (looks). | Project | TFM | Purpose | |---|---|---| -| `src/Titano.Core` | net10.0 | Engine shared by every program: metadata, codecs, imaging, analysis, advisor, motion, render, video containers and managed encoders, archive format, naming, import planning, packaging, localization runtime, diagnostics, brand mark | -| `src/Titano.Core.Windows` | net10.0-windows | WIC decoders and codec inventory, Media Foundation encoders, DXGI adapters, removable devices, DPAPI, shell launcher, window chrome, power (P/Invoke/COM only) | -| `src/Titano.Data` | net10.0 | `IDatabase`, SQLite binding, PostgreSQL wire client, migrations, repositories, the job engine, the archive engine (`Archiving`), the analysis/render engine (`Processing`) and the client sync engine (`Sync`) | -| `src/Titano.Protocol` | net10.0 | API v1 DTOs, source-generated JSON context, typed `TitanoClient` with certificate pinning and bandwidth limiting | -| `src/Titano.Server` | net10.0 (Web SDK) | ASP.NET Core minimal API, auth, uploads, sync, jobs, render nodes, events, embedded admin panel, Windows service host | -| `src/Titano.Ui` | net10.0-windows (WPF) | Theme (DESIGN tokens), icons, standard and custom controls, visuals (charts, filmstrip, preview, curve editor, virtualizing grid), `Loc` markup extension, MVVM helpers, notification-area icon | -| `src/Titano.App` | WPF exe `Titano.exe` | Desktop client | -| `src/Titano.Uploader` | WPF exe | Uploader (tray, watch folders, resumable queue) | -| `src/Titano.Setup` | WPF exe | In-house installer/uninstaller (TPK1 payload) | -| `src/Titano.Tools` | net10.0 exe | CLI: `make-icon`, `i18n` (check, export, missing, import), `xaml-lint`, `package-guard`, `changelog`, `pack-installer`, `selftest`, `diagnose`, `fixtures`, `screenshots` (diff, accept) | -| `tests/Titano.Testing` | net10.0 | In-house test framework (`[Test]`, `[Theory]`+`[Case]`, `[Category]`, `[RequiresEnvironment]`, `[WindowsOnly]`, `[Serial]`, `Assert`, `TestContext`, JUnit) | -| `tests/Titano.*.Tests` | exe | One test program per area; `dotnet run --project tests/X -- --junit out.xml` | +| `src/Chronos.Core` | net10.0 | Engine shared by every program: metadata, codecs, imaging, analysis, advisor, motion, render, video containers and managed encoders, archive format, naming, import planning, packaging, localization runtime, diagnostics, brand mark | +| `src/Chronos.Core.Windows` | net10.0-windows | WIC decoders and codec inventory, Media Foundation encoders, DXGI adapters, removable devices, DPAPI, shell launcher, window chrome, power (P/Invoke/COM only) | +| `src/Chronos.Data` | net10.0 | `IDatabase`, SQLite binding, PostgreSQL wire client, migrations, repositories, the job engine, the archive engine (`Archiving`), the analysis/render engine (`Processing`) and the client sync engine (`Sync`) | +| `src/Chronos.Protocol` | net10.0 | API v1 DTOs, source-generated JSON context, typed `ChronosClient` with certificate pinning and bandwidth limiting | +| `src/Chronos.Server` | net10.0 (Web SDK) | ASP.NET Core minimal API, auth, uploads, sync, jobs, render nodes, events, embedded admin panel, Windows service host | +| `src/Chronos.Ui` | net10.0-windows (WPF) | Theme (DESIGN tokens), icons, standard and custom controls, visuals (charts, filmstrip, preview, curve editor, virtualizing grid), `Loc` markup extension, MVVM helpers, notification-area icon | +| `src/Chronos.App` | WPF exe `Chronos.exe` | Desktop client | +| `src/Chronos.Uploader` | WPF exe | Uploader (tray, watch folders, resumable queue) | +| `src/Chronos.Setup` | WPF exe | In-house installer/uninstaller (TPK1 payload) | +| `src/Chronos.Tools` | net10.0 exe | CLI: `make-icon`, `i18n` (check, export, missing, import), `xaml-lint`, `package-guard`, `changelog`, `pack-installer`, `selftest`, `diagnose`, `fixtures`, `screenshots` (diff, accept), `zip`, `gitea-release`, `postgres-ci`, `pe-check` | +| `tests/Chronos.Testing` | net10.0 | In-house test framework (`[Test]`, `[Theory]`+`[Case]`, `[Category]`, `[RequiresEnvironment]`, `[WindowsOnly]`, `[Serial]`, `Assert`, `TestContext`, JUnit) | +| `tests/Chronos.*.Tests` | exe | One test program per area; `dotnet run --project tests/X -- --junit out.xml` | Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `Server`; `Ui` ← `App`, `Uploader`, `Setup`. `Core`, `Data`, `Protocol` and `Server` never reference Windows-only code (Linux CI builds and tests them). ## 2. Module map -### 2.1 Titano.Core namespaces +### 2.1 Chronos.Core namespaces | Folder / namespace | Content | |---|---| @@ -35,8 +35,8 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S | `Analysis` (+ `Deep`) | Luminance statistics, deflicker, regions, holy grail, white balance, colour temperature, light analysis, streaming deep analysis with checkpoints | | `Advice` | `Advisor`: recommendations with localisable reasons, apply/optimise, sequence presets | | `Motion` | FFT, phase correlation, pyramids, optical flow, motion blur, stabiliser, virtual camera, interpolation, stacking | -| `Math` (namespace `Titano.Core.Mathematics`) | Splines, LOWESS, statistics, solar position, 3×3 colour matrices | -| `Project` | `ProjectSettings` (Auto/manual values), export presets, `ProjectBundle` (the `.titano` project file: sequence reference and settings) | +| `Math` (namespace `Chronos.Core.Mathematics`) | Splines, LOWESS, statistics, solar position, 3×3 colour matrices | +| `Project` | `ProjectSettings` (Auto/manual values), export presets, `ProjectBundle` (the `.chronos` project file: sequence reference and settings) | | `Render` | Render plan (timing modes), preparation pass, geometry, `RenderPipeline`, self-test suite | | `Export` | Preset resolution, encoder selection with fallbacks, output naming | | `Video` (+ `Mp4`, `Avi`, `Bitstream`, `Yuv`, `Managed`) | `IVideoEncoderProvider`, MP4 muxer and inspector, AVI-MJPEG, NV12/P010, managed encoders (MJPEG-AVI, GIF, APNG, image sequences) | @@ -48,39 +48,39 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S | `Diagnostics` | `Log`, file sink, synthetic sequences, `SecretScrubber`, `DiagnosticsArchive` (scrubbed diagnostics zip) | | `Localization`, `IO`, `Hashing`, `Branding` | `Loc`/plural rules, `AtomicFile`, `StartupCommand` (sign-in entries of the programs, moved or removed by setup), CRC-32/SHA helpers, brand mark geometry | -### 2.2 Titano.Data +### 2.2 Chronos.Data | Folder | Content | |---|---| | `Sqlite`, `Postgres` | SQLite P/Invoke binding (winsqlite3 / libsqlite3), in-house PostgreSQL wire protocol v3 client with pool and LISTEN | | `Migrations/{sqlite,postgres}/NNNN_name.sql` | Embedded, applied in one transaction at open (`MigrationRunner`) | -| `Repositories` | `TitanoDatabase` facade: archives, sequences, frames, tags, renders, jobs, cards, users, tokens, uploads, render nodes, settings, audit; `DatabaseBackups` (daily `VACUUM INTO` copies of an SQLite index kept ×3, restore staged for the next start and carried out before the index opens, so it also recovers one that no longer opens) | +| `Repositories` | `ChronosDatabase` facade: archives, sequences, frames, tags, renders, jobs, cards, users, tokens, uploads, render nodes, settings, audit; `DatabaseBackups` (daily `VACUUM INTO` copies of an SQLite index kept ×3, restore staged for the next start and carried out before the index opens, so it also recovers one that no longer opens) | | `Jobs` | `JobEngine` (one job at a time; reviews the priority queue and makes a lower running job yield, requeued with its checkpoint), `JobPriorityQueue` (a level per job kind, the claim order, settings round trip), `IJobHandler`, `IJobHandlerProvider`, `JobContext` (progress, checkpoints, follow-up jobs that never interrupt their parent), `JobThroughput`/`JobEta` (rate and bounded time left) | | `Archiving` | `ArchiveService` (create/adopt/open, archive settings written to `archive.json` then the index), `ArchiveIndexer` (scan, rebuild), `ArchiveIngest` (uploads and imports), `ImportService`, `ArchiveVerifier`, `ArchiveImages` (thumbnail and proxy passes, several photos at once through `OrderedWork`, which hands results back in frame order), `FrameTiers` (decode tier, `PreviewOnly`/`Undecodable` flags and preview size of frames, written to sidecar and index by the light analysis, deep analysis, renders and image passes), `GprCompanions` (the JPEG of each GoPro GPR, found in the index when an import kept it in another sequence), `ArchiveMaintenance`, `MassRenamer`, `SequenceTrash` (delete into the archive's hidden trash with a dry run, restore; the folder moves back when the index step fails), job handlers | -| `Processing` | `ProcessingService`, `SequenceAnalyser`, `DeepReports` (a saved deep report while it still describes the frames), `SequenceRender`, `ProjectStore`, `ProjectBundles` (a `.titano` file for a sequence, and the sequence a file names), `RenderNodeClient`, job handlers | -| `Sync` | `SyncService` (sync table of one server: compare, link by content, settle conflicts, enqueue transfers), `SyncRules` (status, settings merge and differences, no I/O), `SyncPositions` (the settings' frame positions translated by photo to the frames of the copy they go to), `SyncLinkStore` (`sync_links`, `sync_state`), `SyncTransfers` and `SyncJobHandler` (resumable, hash-verified uploads and downloads as jobs; downloads commit through the archive ingest), `SyncAgent` (background comparison, server events, backoff, offline proxies), `ProxyCache` and `RemoteSequence` (server sequences opened with proxies), `ISyncRemote` (the server calls; `TitanoSyncRemote` over `TitanoClient`) | +| `Processing` | `ProcessingService`, `SequenceAnalyser`, `DeepReports` (a saved deep report while it still describes the frames), `SequenceRender`, `ProjectStore`, `ProjectBundles` (a `.chronos` file for a sequence, and the sequence a file names), `RenderNodeClient`, job handlers | +| `Sync` | `SyncService` (sync table of one server: compare, link by content, settle conflicts, enqueue transfers), `SyncRules` (status, settings merge and differences, no I/O), `SyncPositions` (the settings' frame positions translated by photo to the frames of the copy they go to), `SyncLinkStore` (`sync_links`, `sync_state`), `SyncTransfers` and `SyncJobHandler` (resumable, hash-verified uploads and downloads as jobs; downloads commit through the archive ingest), `SyncAgent` (background comparison, server events, backoff, offline proxies), `ProxyCache` and `RemoteSequence` (server sequences opened with proxies), `ISyncRemote` (the server calls; `ChronosSyncRemote` over `ChronosClient`) | -### 2.3 Titano.App areas +### 2.3 Chronos.App areas | Folder | Content | |---|---| | `Shell` | `MainWindow` (rail and its shortcuts, taskbar progress), `ShellViewModel` (rail, sections, first run), `OsNotifications` (toasts as Windows notifications while the window is minimised or in the background), dialogs, `ErrorText` (the sentence of an error toast), `ScreenCapture` (`--capture` scenes), `SectionTemplates.xaml` (view model → view) | | `Sections` | One `XxxView.xaml` + `XxxViewModel` per screen: Welcome, Library, Sequence (the Edit section: the editor, and `SequencePickerView` choosing the sequence in place), Import, Archive, Jobs, Server, Settings, About | | `Library` | Filter, facets, pager, timeline, saved views, quick and mass actions, remote cards and thumbnails, thumbnail cache, list export | -| `Editor` | `EditorSession` (project, undo/redo, saving, merges), `ISequenceSource` (`LocalSequenceSource`, `RemoteSequenceSource`), the steps of the Edit path (`EditPath`: their order, each step's state, the step of each finding, the memory of the step shown; tabs Analysis, Frames, Exposure, Motion, Camera, Time, Stack, Export), `PreviewRenderer`, `ExportPlanner`, `ExportSync`, `SavedCopies`, `SequenceJobs`, `ProjectFiles` (save and open `.titano` project files) | +| `Editor` | `EditorSession` (project, undo/redo, saving, merges), `ISequenceSource` (`LocalSequenceSource`, `RemoteSequenceSource`), the steps of the Edit path (`EditPath`: their order, each step's state, the step of each finding, the memory of the step shown; tabs Analysis, Frames, Exposure, Motion, Camera, Time, Stack, Export), `PreviewRenderer`, `ExportPlanner`, `ExportSync`, `SavedCopies`, `SequenceJobs`, `ProjectFiles` (save and open `.chronos` project files) | | `Import` | `CardPool` (inserted cards, remembered cards, folders), camera profiles, plans and choices, destinations (archive, folder, server through `ServerImportSink`), card actions (verified delete, format, eject) | | `Archive` | `CurrentArchive`, `ArchiveTree`, figures for the charts, maintenance reports, mass rename and move, delete and trash dialogs (`SequenceDeletion`, `DeletePlans`), `ArchiveFailures` | | `Server` | `ServerSession`, `ConnectFlow` (trust on first use), `SyncHost` (sync engine, agent, metered hold, editor connections, Export Sync), sync table, `RemoteSequenceApi` | | `Jobs`, `Settings`, `About` | Job list and buffering, `JobNotices` (which job endings raise a toast; `JobEndings` lets a batch speak once); settings rows, encoder and format inventories, `ProcessingTuning` (Settings › Rendering and Analysis applied to each job: parallelism, memory budget, quality), `InterfacePriority`, language catalog, naming preview; update check and download | -| `Infrastructure` | `AppServices` (composition root), `AppSettings`, `AppEnvironment` (installed or portable), `AppClock` (today's date, frozen by `--capture`), `StartWithWindows` (this copy's sign-in entry), `UiLanguage`, `LiveRegion`, `RenderNodeHost`, `DiagnosticsBundle`, `ShellActions` (BRIEF §8.6), `SingleInstance` (one Titano per data folder; a later launch hands its file over a named pipe, or waits for a closing one to exit and starts in its place), device monitor | +| `Infrastructure` | `AppServices` (composition root), `AppSettings`, `AppEnvironment` (installed or portable), `AppClock` (today's date, frozen by `--capture`), `StartWithWindows` (this copy's sign-in entry), `UiLanguage`, `LiveRegion`, `RenderNodeHost`, `DiagnosticsBundle`, `ShellActions` (BRIEF §8.6), `SingleInstance` (one Chronos per data folder; a later launch hands its file over a named pipe, or waits for a closing one to exit and starts in its place), device monitor | | `DesignTime` | `SampleData`: the archive, jobs and server the screenshots and smoke tests run on, dated from the fixed `SampleData.Now` | -### 2.4 Titano.Ui and Titano.Server +### 2.4 Chronos.Ui and Chronos.Server | Folder | Content | |---|---| | `Ui/Themes`, `Ui/Theming` | DESIGN tokens (light, dark), typography, control styles, `ThemeManager` | -| `Ui/Controls` | `TitanoWindow` (chrome, language direction), `NavRail`, `JobBar`, `ToastHost`, `Field` (placeholder, icon, error), `Chip`, `AutoSlider`, `StatusGlyph`, `EmptyState`, `Icon`, `Bidi` (right-to-left rules), `Motion` (animations off for screenshots) | +| `Ui/Controls` | `ChronosWindow` (chrome, language direction), `NavRail`, `JobBar`, `ToastHost`, `Field` (placeholder, icon, error), `Chip`, `AutoSlider`, `StatusGlyph`, `EmptyState`, `Icon`, `Bidi` (right-to-left rules), `Motion` (animations off for screenshots) | | `Ui/Interop` | DWM calls of the window chrome; `TrayIcon` (`Shell_NotifyIconW`: the Uploader's tray, the client's Windows notifications) | | `Ui/Visuals` | `DrawingElement` (hover readout, item keyboard and activation) and its charts (`BarChart`, `SeriesChart`, `StackedBar`, `HeatmapStrip`, `TimelineBands`), `Filmstrip`, `PreviewViewport`, `CurveEditor`, `SequenceCard`, `VirtualizingWrapPanel`, `SegmentedControl`, `SplitButton` | | `Server/Api`, `Server/Events` | Endpoint groups (`XxxEndpoints.Map`), API errors, the WebSocket `EventHub` | @@ -92,14 +92,14 @@ Dependencies point one way: `Core` ← `Core.Windows`, `Data`, `Protocol` ← `S | Host | Composition root | What it runs | |---|---|---| -| Titano (desktop) | `App/Infrastructure/AppServices` | SQLite index in `%LOCALAPPDATA%\Titano` (or `.\data` when portable, unless the copy is in a OneDrive folder); `ArchiveService` with WIC first, then managed decoders; `ProcessingService` with Media Foundation, then managed encoders; one `JobEngine` with the handlers of both; thumbnails; `ServerSession`; `SyncHost` while signed in (sync engine and agent, upload and download handlers, metered hold, editors of server sequences); the render node while opted in and signed in; update check and download (`About/UpdateCheck`, `About/UpdateDownload`, `About/UpdateFlow`: the setup, or the portable zip for a portable copy, verified against `SHA256SUMS`, resumable, cancellable, failing after 60 s without data); diagnostics bundle; daily index backups and the restore staged in Settings › Advanced (`DatabaseBackups`) | -| Titano Server | `Server/Hosting/ServerHost.Build` | Options from `server.json` + `TITANO_*`; PostgreSQL (or SQLite on Windows); `ArchiveModule` then `ProcessingModule` register job handler providers; `JobEngineHost` (renders only managed formats and MP4 jobs no render node can take, BRIEF §14.7); `RenderNodeService`/`RenderNodeMonitor`; `UploadService`; `EventHub` (WebSocket); embedded admin panel; LAN discovery beacon; Windows service host; daily backups of an SQLite index (`DatabaseBackupService`) | -| Titano Uploader | `Uploader/App.xaml.cs` | `TitanoClient`, persisted queue, watch folders; no database | -| Titano Setup | `Setup/Program` | TPK1 payload extraction, registry, shortcuts, file types named in setup's language, silent mode, uninstaller; only what starts a program its log or payload lists is changed: Windows services of those programs stopped once the programs have closed, started again (also after a failure) or deleted through the Service Control Manager (an elevated `/SERVICES … /NAMES` step when needed), sign-in entries of those programs moved to the program an upgrade renamed or removed, shared shortcuts handed to the product that keeps the program; the Server only for all users inside Program Files; "Remove my data" limited to the programs no other installed product uses | +| Chronos (desktop) | `App/Infrastructure/AppServices` | SQLite index in `%LOCALAPPDATA%\Chronos` (or `.\data` when portable, unless the copy is in a OneDrive folder); `ArchiveService` with WIC first, then managed decoders; `ProcessingService` with Media Foundation, then managed encoders; one `JobEngine` with the handlers of both; thumbnails; `ServerSession`; `SyncHost` while signed in (sync engine and agent, upload and download handlers, metered hold, editors of server sequences); the render node while opted in and signed in; update check and download (`About/UpdateCheck`, `About/UpdateDownload`, `About/UpdateFlow`: the setup, or the portable zip for a portable copy, verified against `SHA256SUMS`, resumable, cancellable, failing after 60 s without data); diagnostics bundle; daily index backups and the restore staged in Settings › Advanced (`DatabaseBackups`) | +| Chronos Server | `Server/Hosting/ServerHost.Build` | Options from `server.json` + `CHRONOS_*`; PostgreSQL (or SQLite on Windows); `ArchiveModule` then `ProcessingModule` register job handler providers; `JobEngineHost` (renders only managed formats and MP4 jobs no render node can take, BRIEF §14.7); `RenderNodeService`/`RenderNodeMonitor`; `UploadService`; `EventHub` (WebSocket); embedded admin panel; LAN discovery beacon; Windows service host; daily backups of an SQLite index (`DatabaseBackupService`) | +| Chronos Uploader | `Uploader/App.xaml.cs` | `ChronosClient`, persisted queue, watch folders; no database | +| Chronos Setup | `Setup/Program` | TPK1 payload extraction, registry, shortcuts, file types named in setup's language, silent mode, uninstaller; only what starts a program its log or payload lists is changed: Windows services of those programs stopped once the programs have closed, started again (also after a failure) or deleted through the Service Control Manager (an elevated `/SERVICES … /NAMES` step when needed), sign-in entries of those programs moved to the program an upgrade renamed or removed, shared shortcuts handed to the product that keeps the program; the Server only for all users inside Program Files; "Remove my data" limited to the programs no other installed product uses | ### 2.6 Job kinds and their handlers -| `JobKind` | Handler (Titano.Data) | Desktop | Server | +| `JobKind` | Handler (Chronos.Data) | Desktop | Server | |---|---|---|---| | `Scan`, `Rebuild` | `Archiving/Jobs/ScanJobHandler` (via `ArchiveService.CreateJobHandlers`) | yes | yes | | `Verify` | `Archiving/Jobs/VerifyJobHandler` | yes | yes | @@ -155,14 +155,14 @@ run as server jobs whose progress comes from the events. | An image format or decoder | `IImageDecoderProvider` (managed in `Core/Imaging/Decoders` or `Codecs`, WIC in `Core.Windows`: a RAW only through the Raw Image Extension, checked per file); chained by `DecoderFactory` | | A video encoder | `IVideoEncoderProvider` (`Core/Video/Managed`, `Core.Windows/MediaFoundation`); list it in the host's `ProcessingOptions.Encoders` | | A background operation | a `JobKind`, an `IJobHandler` (in `Data/Archiving/Jobs` or `Data/Processing/Jobs`) returned by the service's `CreateJobHandlers`; the job engine, Jobs screen, admin and API pick it up | -| A server feature | a static `XxxEndpoints.Map(api)` in `Server/Api` with `.Requires(Permissions…)`, called from `ServerHost.ConfigurePipeline`; DTOs in `Titano.Protocol` with the JSON context | +| A server feature | a static `XxxEndpoints.Map(api)` in `Server/Api` with `.Requires(Permissions…)`, called from `ServerHost.ConfigurePipeline`; DTOs in `Chronos.Protocol` with the JSON context | | A server storage backend | `IArchiveIngest`, `IFrameAssetLocator` through the `ServerHost.Build` registration callback | | A schema change | `Data/Migrations/{sqlite,postgres}/NNNN_topic.sql` (never edit an applied one) | | An advisor rule | `Core/Advice` with a localised reason key in `Advisor` | | A UI string | `i18n/en/.resx` + `i18n/it/.it.resx` (other languages via `i18n missing`/`import`) | | An admin page | ES module in `Server/Admin/web/pages`, strings in the `Admin` area | | A CLI command | `ICommand` in `Tools/Commands`, listed in `Tools/Program.cs` | -| A desktop screen | `Sections/XxxView.xaml` + `XxxViewModel`, its `DataTemplate` in `Shell/SectionTemplates.xaml`, the property and rail entry in `ShellViewModel`, a scene in `Shell/ScreenCapture` with sample data, a smoke test in `Titano.App.Tests/Windows` | +| A desktop screen | `Sections/XxxView.xaml` + `XxxViewModel`, its `DataTemplate` in `Shell/SectionTemplates.xaml`, the property and rail entry in `ShellViewModel`, a scene in `Shell/ScreenCapture` with sample data, a smoke test in `Chronos.App.Tests/Windows` | ## 5. Conventions @@ -170,7 +170,7 @@ run as server jobs whose progress comes from the events. except narrowly around interop with a reason. - No third-party packages, ever. If the BCL lacks it (CRC-32, Adler, JPEG, PNG decode…), write it. - Never name a namespace `Archive` (it would shadow the entity): the archive code lives in `Archiving`. Inside - Titano.Core never write an unqualified `Math.`: use `System.Math` or `double.Max`. + Chronos.Core never write an unqualified `Math.`: use `System.Math` or `double.Max`. - Parsers never throw on malformed input: they return partial results plus warnings. Every offset is bounds-checked against the stream length; recursion and loops are capped. - Never load a whole RAW to read metadata: windowed reads through `Stream` + `Seek`. @@ -180,7 +180,7 @@ run as server jobs whose progress comes from the events. - Every long operation takes a `CancellationToken` and reports progress through `IProgress` or the `JobContext`. - Libraries use `ConfigureAwait(false)`. No `async void` except WPF event handlers. Heavy work and I/O never run on the UI thread. -- Logging through `Titano.Core.Diagnostics.Log` in Core and Data; `ILogger` on the server. Anything that leaves the +- Logging through `Chronos.Core.Diagnostics.Log` in Core and Data; `ILogger` on the server. Anything that leaves the machine (diagnostics bundles) passes through `SecretScrubber`. - Public types and non-obvious members get a one-line `///` summary. Comments explain *why*, not *what*. - Disk writes that must survive crashes use `AtomicFile` (temp → fsync → rename); originals are never modified. @@ -195,7 +195,7 @@ run as server jobs whose progress comes from the events. - Every string comes from the catalog (`Loc.L`, `{l:Loc}`); labels ≤ 3 words, explanations only in tooltips. Every actionable control has a tooltip, and an icon-only one a two-word accessible name: the screen smoke tests check both on every screen. -- Windows derive from `TitanoWindow`, which takes the UI language's direction at creation and on every switch; +- Windows derive from `ChronosWindow`, which takes the UI language's direction at creation and on every switch; screens never set `FlowDirection` for the language. Photos, charts, numbers, paths and templates are left-to-right islands on the smallest element holding them; directional icons mirror by themselves (`IconData.IsDirectional`, overridden per subtree with `Bidi.IsDirectional`); left-to-right fragments inside a right-to-left sentence go @@ -222,33 +222,36 @@ run as server jobs whose progress comes from the events. ## 6. Tests -- Framework: `Titano.Testing`. Test classes are `public sealed`; constructor may take `TestContext` (temp - directories, cancellation, log). `[WindowsOnly]` for OS-specific tests, `[RequiresEnvironment("TITANO_TEST_PG")]` +- Framework: `Chronos.Testing`. Test classes are `public sealed`; constructor may take `TestContext` (temp + directories, cancellation, log). `[WindowsOnly]` for OS-specific tests, `[RequiresEnvironment("CHRONOS_TEST_PG")]` for PostgreSQL integration tests. - Classes run in parallel. A test that changes or observes process-wide state (the UI language, unobserved task exceptions, the managed heap) belongs in a `[Serial]` class; the App and Core test programs fail a test outside one that switches the language away from English, after switching it back (`TestContext.Current`). -- Put tests under `tests/Titano..Tests//Tests.cs`, mirroring the source folder. -- `Titano.App.Tests` targets net10.0-windows and runs on Windows CI only: keep logic in plain classes. +- Put tests under `tests/Chronos..Tests//Tests.cs`, mirroring the source folder. +- `Chronos.App.Tests` targets net10.0-windows and runs on Windows only (the CI job `windows` when a Windows runner is + registered, otherwise on a Windows PC): keep logic in plain classes. - Fixtures are synthetic and generated in code wherever possible; tiny binary fixtures may go in `tests/fixtures/` - (< 50 KB each). CC0 RAW samples are fetched by `Titano.Tools fixtures` into `tests/fixtures/external/` (not - committed); tests depending on them skip when absent and CI shows a warning per missing sample. + (< 50 KB each). CC0 RAW samples are fetched by `Chronos.Tools fixtures` into `tests/fixtures/external/` (not + committed); tests depending on them skip when absent and the CI log shows a warning per missing sample. - Fuzz tests: truncate and corrupt valid inputs at many offsets; assert no exception escapes. -- Performance gates (`tests/Titano.Data.Tests/Perf`, `[Category("perf")]`, run only with `TITANO_PERF=1`): the +- Performance gates (`tests/Chronos.Data.Tests/Perf`, `[Category("perf")]`, run only with `CHRONOS_PERF=1`): the 500,000-photo library (Library open < 1 s on a new connection pool, filters < 200 ms; the OS cache is warm from building it) and the 100,000-frame rebuild from sidecars (400 sequences of 250 real photos, every column compared, - < 120 s), each on SQLite and PostgreSQL. `.github/workflows/perf.yml` runs them weekly against PostgreSQL 17. -- `Titano.Tools.Tests` covers the tools whose output CI relies on (fixtures annotations and exit codes, the screenshot - diff) and the test runner's outcomes. -- Visual regression: CI compares the `--capture` screenshots with `tests/visual/baselines` (`Titano.Tools screenshots - diff`; its README says how baselines are added). Once any baseline is committed, a screen without one fails too; - before that the step warns that it compared nothing. The capture draws the same pixels on any day: the sample's - clock is fixed, formats are English and nothing animates. -- Media Foundation output plays back (`Titano.Core.Windows.Tests`): MediaPlayer opens it where Windows Media Player + < 120 s), each on SQLite and PostgreSQL. `.gitea/workflows/perf.yml` runs them weekly against PostgreSQL 17. +- `Chronos.Tools.Tests` covers the tools whose output CI relies on (fixtures warning lines and exit codes, the + screenshot diff, the PostgreSQL preparation, `pe-check`, `zip`, the Gitea release upload) and the test runner's + outcomes. +- Visual regression: the CI job `windows` (or a run on a Windows PC) compares the `--capture` screenshots with + `tests/visual/baselines` (`Chronos.Tools screenshots diff`; its README says how baselines are added). Once any + baseline is committed, a screen without one fails too; before that the step warns that it compared nothing. The + capture draws the same pixels on any day: the sample's clock is fixed, formats are English and nothing animates. +- Media Foundation output plays back (`Chronos.Core.Windows.Tests`): MediaPlayer opens it where Windows Media Player is installed (skipped, with the reason, where it is not) and a source reader decodes its first frame everywhere. -- PostgreSQL: CI prepares the service containers with `.github/scripts/postgres-ci-setup.sh` (MD5, cleartext and - trust roles, TLS), so every authentication method and TLS mode of BRIEF §6.3 runs; `TITANO_TEST_PG_TLS=1` makes a - server without TLS fail the TLS tests. +- PostgreSQL: CI prepares the service containers with `Chronos.Tools postgres-ci` (MD5, cleartext and trust roles, + TLS; all through SQL as the superuser, because Gitea Actions gives no id of the service container to exec into), + so every authentication method and TLS mode of BRIEF §6.3 runs; `CHRONOS_TEST_PG_TLS=1` makes a server without TLS + fail the TLS tests. ## 7. Localization @@ -266,17 +269,24 @@ run as server jobs whose progress comes from the events. ## 8. Build, checks and CI ``` -dotnet build Titano.slnx -c Release -dotnet run --project tests/Titano.Core.Tests -c Release -- --junit out/core.xml -dotnet run --project src/Titano.Tools -- package-guard -dotnet run --project src/Titano.Tools -- i18n check -dotnet run --project src/Titano.Tools -- xaml-lint -dotnet format whitespace Titano.slnx --verify-no-changes +dotnet build Chronos.slnx -c Release +dotnet run --project tests/Chronos.Core.Tests -c Release -- --junit out/core.xml +dotnet run --project src/Chronos.Tools -- package-guard +dotnet run --project src/Chronos.Tools -- i18n check +dotnet run --project src/Chronos.Tools -- xaml-lint +dotnet format whitespace Chronos.slnx --verify-no-changes ``` | Workflow | Trigger | Does | |---|---|---| -| `ci.yml` | push to `main`, pull requests | Windows + Linux build and tests, guards, i18n, XAML lint, format, fixtures (warnings when missing), screenshots and their pixel diff, installer test (install, run, upgrade, uninstall), PostgreSQL 16/17 (every authentication method, TLS), Docker smoke test | -| `release.yml` | tag `v*` (or manual re-publish) | Tests, self-contained publish, optional signing, installers, portable and server zips, SHA256SUMS, release notes, multi-arch GHCR image, public releases repository update and GitHub release | -| `docker.yml` | nightly | `ghcr.io//titano-server:nightly` | -| `perf.yml` | weekly, manual | Performance gates (SQLite, PostgreSQL 17) with timings in the job summary | +| `ci.yml` | push to `main`, pull requests, manual | Linux build and tests, guards, i18n, XAML lint, format, fixtures (warnings when missing), the Windows programs cross-compiled for win-x64, packed and checked (`pe-check`), PostgreSQL 16/17 (every authentication method, TLS), Docker smoke test, YAML check of the workflows, issue forms and compose file; with a Windows runner (`WINDOWS_RUNNER`): Windows tests, screenshots and their pixel diff, installer test (install, run, upgrade, uninstall) | +| `release.yml` | tag `v*` (or manual re-publish) | Tests, self-contained win-x64 publish cross-compiled on Linux, `pe-check`, optional signing (osslsigncode), installers, portable and server zips, SHA256SUMS, release notes, Gitea release (`gitea-release`), then the linux/amd64 image in the Gitea container registry (`:latest` only for the newest stable release); a separate releases repository is updated only when `RELEASES_REPO` names one | +| `docker.yml` | nightly, manual | `gitea.encke-hake.ts.net/balbosoft/chronos-server:nightly` from `main` | +| `perf.yml` | weekly, manual | Performance gates (SQLite, PostgreSQL 17) with timings at the end of the log | + +The workflows live in `.gitea/workflows` (scripts in `.gitea/scripts`) and run on Gitea Actions: an act_runner in +Docker mode on the Linux server that hosts Gitea (label `ubuntu-latest`, one job at a time). The .NET jobs run in the +`mcr.microsoft.com/dotnet/sdk:10.0` container and check out with plain `git` (the image has no Node.js, so no +JavaScript actions); no artifacts or caches are used, and builds use `BUILD_CPUS` cores. Gitea shows no job summary and +no annotations: `::warning`/`::error` lines appear in the log only. Pushing images needs the repository secret +`REGISTRY_TOKEN` (the workflow's own token is refused by the organisation's registry). diff --git a/docs/BRIEF.md b/docs/BRIEF.md index c3fd45b7..a49f0ca3 100644 --- a/docs/BRIEF.md +++ b/docs/BRIEF.md @@ -1,12 +1,12 @@ -# Titano — Build Brief for Claude Code +# Chronos — Build Brief for Claude Code > This document is the complete specification and standing instruction set for building the -> Titano time-lapse ecosystem from scratch. It is written to be read by Claude Code at the +> Chronos time-lapse ecosystem from scratch. It is written to be read by Claude Code at the > start of every session (via `CLAUDE.md`, see Appendix A) and to be the single source of > truth for scope, architecture, constraints and delivery order. > -> Working name: **Titano**. Three shipped programs — **Titano** (Windows desktop client), -> **Titano Server** (Linux/Docker and Windows), **Titano Uploader** (Windows) — sharing one +> Working name: **Chronos**. Three shipped programs — **Chronos** (Windows desktop client), +> **Chronos Server** (Linux/Docker and Windows), **Chronos Uploader** (Windows) — sharing one > engine. Target audience: photographers, astro/landscape shooters, construction and > weather-cam operators, hobbyists worldwide. @@ -17,7 +17,7 @@ ### 0.1 Kickoff message Paste this as the first message in Claude Code, from an empty repository that contains only -this file at `docs/BRIEF.md` and the prototype dump at `docs/reference/titano-prototype.md`: +this file at `docs/BRIEF.md` and the prototype dump at `docs/reference/chronos-prototype.md`: ``` Read docs/BRIEF.md completely before doing anything. It is the full specification for this @@ -37,14 +37,14 @@ irreversible; otherwise decide, record it in docs/DECISIONS.md, and continue. `Microsoft.AspNetCore.App`, `Microsoft.WindowsDesktop.App`, the Windows SDK targeting pack), or an operating-system API reached by P/Invoke or COM interop, is implemented in-house. CI fails the build if a `PackageReference` appears (§19.2). The prototype in - `docs/reference/titano-prototype.md` proves this is workable: it decodes images with WIC, + `docs/reference/chronos-prototype.md` proves this is workable: it decodes images with WIC, encodes video with Media Foundation, parses EXIF/TIFF/XMP with its own parsers, and writes its own MP4 container. 2. **No external processes.** No FFmpeg, no ExifTool, no ImageMagick, no PowerShell scripts at runtime. The only OS executables/dialogs the product may invoke are listed in §8.6 (format-volume dialog, shell "open with", browser launch for links). -3. **Cross-platform core, Windows-only presentation.** `Titano.Core`, `Titano.Data`, - `Titano.Protocol` and `Titano.Server` target `net10.0` and must build and pass tests on +3. **Cross-platform core, Windows-only presentation.** `Chronos.Core`, `Chronos.Data`, + `Chronos.Protocol` and `Chronos.Server` target `net10.0` and must build and pass tests on Linux. Windows-only code lives in `*.Windows` projects or the desktop apps. 4. **English everywhere in the codebase**: identifiers, comments, commit messages, docs. The prototype is written in Italian; port the algorithms, not the language. @@ -62,14 +62,15 @@ irreversible; otherwise decide, record it in docs/DECISIONS.md, and continue. 8. **User data is sacred.** Never delete, move or format anything without (a) a verified hash match of every copied file and (b) an explicit user action. Every destructive operation is dry-run-able and shows its plan first. -9. **Definition of Done for every phase:** builds green on `windows-latest` and - `ubuntu-latest`; all tests green; no new warnings; `docs/DECISIONS.md` and - `docs/CHANGELOG.md` updated; a short "how to try it" note in the phase report; - localization completeness check passes for `en` and `it`. +9. **Definition of Done for every phase:** CI green on Gitea Actions (§19.1: the Linux + jobs; the `windows` job once a Windows runner is registered, until then the Windows-only + tests run on a Windows PC; amended 2026-10-23, R3); all tests green; no new warnings; + `docs/DECISIONS.md` and `docs/CHANGELOG.md` updated; a short "how to try it" note in the + phase report; localization completeness check passes for `en` and `it`. 10. **Commit style:** Conventional Commits (`feat(core): …`, `fix(server): …`), small commits, one concern each. Never commit generated binaries, fixtures downloaded by scripts, or secrets. -11. **Reference prototype:** `docs/reference/titano-prototype.md` is a Repomix dump of the +11. **Reference prototype:** `docs/reference/chronos-prototype.md` is a Repomix dump of the previous single-program prototype (C#/.NET 10, WinForms, zero packages). Its engine (metadata parsing, deflicker, holy-grail transitions, optical flow, motion blur, stabilization, virtual camera, time remap, stacking, Media Foundation encoding, MP4 @@ -81,7 +82,7 @@ irreversible; otherwise decide, record it in docs/DECISIONS.md, and continue. ## 1. Product vision -Titano turns folders of photos (RAW, JPEG, HEIC…) into finished time-lapse videos and keeps +Chronos turns folders of photos (RAW, JPEG, HEIC…) into finished time-lapse videos and keeps a lifetime archive of shoots organised, verified and searchable — on one PC or on a shared server. @@ -94,7 +95,7 @@ server. Foundation) to purpose-built presets, from 720p previews to 8K 10-bit archives. - **Archive** hundreds of thousands of photos across years and cameras, on local or network drives, with an index that can always be rebuilt from the files themselves. -- **Share** through Titano Server: central archive, users with logins, uploads from the +- **Share** through Chronos Server: central archive, users with logins, uploads from the tiny Uploader, sync of projects, server-side jobs, render delegation to GPU-equipped clients, and a web admin panel — deployable as a Docker container (Unraid template included) or on Windows. @@ -169,9 +170,9 @@ through the in-house wire-protocol client (§6.3). Microsoft "Raw Image Extension" gives full decode of everything else. - **Video encoding** on Linux has no OS encoder API; the server produces pure-managed outputs (MJPEG-AVI, image sequences, GIF, APNG) itself and delegates MP4/H.264/HEVC/AV1 - jobs to **render nodes** — Titano clients that volunteer their GPU (§14.7). An in-house + jobs to **render nodes** — Chronos clients that volunteer their GPU (§14.7). An in-house intra-only H.264 encoder is a P2 universal fallback (§11.6). -- **Testing** uses an in-house runner (`Titano.Testing`, §20.1), not xUnit/NUnit. +- **Testing** uses an in-house runner (`Chronos.Testing`, §20.1), not xUnit/NUnit. - **HEIC/HEIF** cannot be decoded in-house (HEVC intra decoder is out of scope): Windows clients decode via WIC (HEIF + HEVC extensions); the server stores originals and relies on proxies produced by a Windows client or render node. @@ -181,36 +182,36 @@ through the in-house wire-protocol client (§6.3). ## 3. Repository layout ``` -titano/ (private GitHub repo) +chronos/ (Gitea repository BalboSoft/Chronos; amended 2026-10-23, R2) ├── CLAUDE.md operating rules (Appendix A) ├── Directory.Build.props version, LangVersion, nullable, warnings-as-errors, analyzers ├── Directory.Build.targets zero-package guard, resource generation hooks -├── Titano.slnx +├── Chronos.slnx ├── global.json pins .NET 10 SDK ├── src/ -│ ├── Titano.Core/ net10.0 — engine: Metadata, Imaging, Codecs, Analysis, Motion, Video (container/muxers), Archive model, Naming, Localization runtime -│ ├── Titano.Core.Windows/ net10.0-windows — WIC decoder, Media Foundation encoder, DXGI, device APIs, winsqlite3 binding -│ ├── Titano.Data/ net10.0 — IDatabase abstraction, SQL dialects, migrations, repositories, Postgres wire client (Titano.Data.Postgres), SQLite driver surface (implemented by Core.Windows binding) -│ ├── Titano.Protocol/ net10.0 — API DTOs, JSON contexts (source-generated), chunked upload protocol, sync manifests, WebSocket event schema, version negotiation -│ ├── Titano.Server/ net10.0 — ASP.NET Core minimal API, auth, job engine, storage service, admin web UI (embedded static files), Docker entrypoint -│ ├── Titano.App/ net10.0-windows — WPF desktop client -│ ├── Titano.Uploader/ net10.0-windows — WPF uploader (tray-capable) -│ ├── Titano.Setup/ net10.0-windows — in-house installer/uninstaller (self-extracting, Add/Remove Programs, shortcuts, file associations) -│ └── Titano.Tools/ net10.0 — CLI: selftest, diagnose, make-icon, i18n export/check, fixtures fetch, changelog +│ ├── Chronos.Core/ net10.0 — engine: Metadata, Imaging, Codecs, Analysis, Motion, Video (container/muxers), Archive model, Naming, Localization runtime +│ ├── Chronos.Core.Windows/ net10.0-windows — WIC decoder, Media Foundation encoder, DXGI, device APIs, winsqlite3 binding +│ ├── Chronos.Data/ net10.0 — IDatabase abstraction, SQL dialects, migrations, repositories, Postgres wire client (Chronos.Data.Postgres), SQLite driver surface (implemented by Core.Windows binding) +│ ├── Chronos.Protocol/ net10.0 — API DTOs, JSON contexts (source-generated), chunked upload protocol, sync manifests, WebSocket event schema, version negotiation +│ ├── Chronos.Server/ net10.0 — ASP.NET Core minimal API, auth, job engine, storage service, admin web UI (embedded static files), Docker entrypoint +│ ├── Chronos.App/ net10.0-windows — WPF desktop client +│ ├── Chronos.Uploader/ net10.0-windows — WPF uploader (tray-capable) +│ ├── Chronos.Setup/ net10.0-windows — in-house installer/uninstaller (self-extracting, Add/Remove Programs, shortcuts, file associations) +│ └── Chronos.Tools/ net10.0 — CLI: selftest, diagnose, make-icon, i18n export/check, fixtures fetch, changelog ├── tests/ -│ ├── Titano.Testing/ in-house test framework + runner (attributes, asserts, fixtures, JUnit XML) -│ ├── Titano.Core.Tests/ -│ ├── Titano.Data.Tests/ includes PostgreSQL integration tests (skipped without TITANO_TEST_PG) -│ ├── Titano.Server.Tests/ in-process Kestrel on a random port -│ ├── Titano.App.Tests/ view-model tests + XAML lint (tooltip/resource rules) + screenshot smoke (`--capture`) -│ └── fixtures/ tiny checked-in samples; larger CC0 RAW samples fetched by `Titano.Tools fixtures` +│ ├── Chronos.Testing/ in-house test framework + runner (attributes, asserts, fixtures, JUnit XML) +│ ├── Chronos.Core.Tests/ +│ ├── Chronos.Data.Tests/ includes PostgreSQL integration tests (skipped without CHRONOS_TEST_PG) +│ ├── Chronos.Server.Tests/ in-process Kestrel on a random port +│ ├── Chronos.App.Tests/ view-model tests + XAML lint (tooltip/resource rules) + screenshot smoke (`--capture`) +│ └── fixtures/ tiny checked-in samples; larger CC0 RAW samples fetched by `Chronos.Tools fixtures` ├── branding/ icon sources (SVG), generated ICO/PNG sets ├── i18n/ .resx sources (en) + translations, glossary, machine-translation notes ├── deploy/ │ ├── docker/Dockerfile, docker-compose.yml, entrypoint -│ └── unraid/titano.xml -├── .github/workflows/ ci.yml, release.yml, docker.yml -└── docs/ BRIEF.md (this), DECISIONS.md, CHANGELOG.md, ARCHITECTURE.md (generated per phase), reference/titano-prototype.md +│ └── unraid/chronos.xml +├── .gitea/workflows/ ci.yml, release.yml, docker.yml, perf.yml (amended 2026-10-23, R2) +└── docs/ BRIEF.md (this), DECISIONS.md, CHANGELOG.md, ARCHITECTURE.md (generated per phase), reference/chronos-prototype.md ``` Project references: `App` → `Core`, `Core.Windows`, `Data`, `Protocol`. `Server` → `Core`, @@ -225,7 +226,7 @@ Project references: `App` → `Core`, `Core.Windows`, `Data`, `Protocol`. `Serve ``` ┌────────────────────────────────────────────────────────────────┐ - │ Titano (WPF client) │ + │ Chronos (WPF client) │ │ Library · Edit · Import · Archive manager · Jobs │ │ Local mode: SQLite + local/network archive │ │ Server mode: REST/WS client, proxies cache, render node │ @@ -233,7 +234,7 @@ Project references: `App` → `Core`, `Core.Windows`, `Data`, `Protocol`. `Serve │ HTTPS REST + WebSocket │ Memory cards (USB/SD) ▼ ▼ ┌───────────────────────────────────┐ ┌──────────────────────────┐ -│ Titano Server │ │ Titano Uploader (WPF) │ +│ Chronos Server │ │ Chronos Uploader (WPF) │ │ Kestrel · API v1 · Auth · Jobs │◄───────────│ queue · watch folders │ │ Storage service · Admin web panel │ HTTPS │ resumable chunk upload │ │ Pure-managed encoders │ └──────────────────────────┘ @@ -246,7 +247,7 @@ Project references: `App` → `Core`, `Core.Windows`, `Data`, `Protocol`. `Serve ### 4.2 Shared engine -`Titano.Core` is the same assembly on client and server: metadata parsing, image codecs, +`Chronos.Core` is the same assembly on client and server: metadata parsing, image codecs, analysis advisor, render pipeline, container writers. Only the *decoder/encoder providers* differ per platform, behind two interfaces: @@ -329,7 +330,7 @@ Paging everywhere (keyset pagination on `(first_capture, id)`). ## 6. Data layer -### 6.1 `Titano.Data` abstraction +### 6.1 `Chronos.Data` abstraction ```csharp public interface IDatabase : IAsyncDisposable { @@ -345,30 +346,30 @@ public interface IDbSession : IAsyncDisposable { ``` Hand-written SQL in repositories (`SequenceRepository`, `FrameRepository`, …); no ORM. -Migrations: numbered `.sql` files per dialect in `Titano.Data/Migrations/{sqlite,postgres}/`, +Migrations: numbered `.sql` files per dialect in `Chronos.Data/Migrations/{sqlite,postgres}/`, applied at startup inside a transaction, recorded in `schema_migrations`. Dialect differences (types, `RETURNING`, upserts) are confined to SQL files and a small `SqlDialect` helper. ### 6.2 SQLite (client, and Windows standalone server) -- Binding: `Titano.Core.Windows/Sqlite/WinSqlite3.cs` P/Invoke to `winsqlite3.dll` +- Binding: `Chronos.Core.Windows/Sqlite/WinSqlite3.cs` P/Invoke to `winsqlite3.dll` (`sqlite3_open_v2`, `prepare_v2`, `step`, `reset`, `finalize`, `bind_*`, `column_*`, `exec`, `errmsg`, `last_insert_rowid`, `changes`, `busy_timeout`, `libversion`, `extended_result_codes`). UTF-8 marshalling by hand. Check `sqlite3_libversion() ≥ 3.31` at startup; probe `PRAGMA compile_options` and never depend on FTS/JSON extensions. - Pragmas: `journal_mode=WAL`, `synchronous=NORMAL`, `foreign_keys=ON`, `temp_store=MEMORY`, `cache_size=-65536`, `mmap_size=268435456`. -- Location: `%LOCALAPPDATA%\Titano\titano.db` (never Documents/OneDrive-synced folders — +- Location: `%LOCALAPPDATA%\Chronos\chronos.db` (never Documents/OneDrive-synced folders — SQLite in a synced folder corrupts). Portable mode: `portable.txt` next to the exe puts everything under `.\data\`. - Backups: `VACUUM INTO` nightly copy kept ×3; restore from Settings › Advanced. -### 6.3 PostgreSQL client (`Titano.Data.Postgres`) — in-house wire protocol v3 +### 6.3 PostgreSQL client (`Chronos.Data.Postgres`) — in-house wire protocol v3 - TCP + optional TLS via `SslStream` after `SSLRequest`; `sslmode` = disable | prefer | require | verify-full. -- Startup (`user`, `database`, `application_name=titano-server`, `client_encoding=UTF8`, +- Startup (`user`, `database`, `application_name=chronos-server`, `client_encoding=UTF8`, `TimeZone=UTC`); authentication: SCRAM-SHA-256 (`Rfc2898DeriveBytes.Pbkdf2`, HMAC-SHA256, channel binding not required), MD5, cleartext, trust. - Simple query, extended query (Parse/Bind/Describe/Execute/Sync) with parameters in text @@ -389,7 +390,7 @@ The archive is the source of truth; the database is an index that can be rebuilt ``` / -├── .titano/ +├── .chronos/ │ ├── archive.json { id, name, schemaVersion, created, layoutTemplates, proxyPolicy } │ ├── index-snapshot.bin optional accelerator for rebuild (all sidecars concatenated + hash); ignored if stale │ └── locks/ lease files for concurrent writers (server + client on same share) @@ -398,7 +399,7 @@ The archive is the source of truth; the database is an index that can be rebuilt │ ├── originals/ IMG_0001.CR2 … names = expanded FileTemplate │ ├── proxies/ 0001.jpg … (JPEG, long edge per policy; optional, regenerable) │ ├── exports/ 2026-09-28 Harbour sunset - 4K HEVC.mp4 … -│ └── .titano/ +│ └── .chronos/ │ ├── sequence.json sidecar manifest (below) │ ├── analysis.json full deep-analysis report │ ├── project.json render settings (the "project") @@ -480,7 +481,7 @@ dims, delta), `WhiteLevel`, `AsShotNeutral`/`AsShotWhiteXY`, `ColorMatrix1/2` + `WarpRectilinear`, `FixVignetteRadial`; unknown opcodes ignored with a warning), `BaselineExposure`. Output: linear Rec.709/sRGB primaries float planes. -### 8.3 Managed codecs (all in `Titano.Core/Codecs`, pure C#, SIMD where it pays) +### 8.3 Managed codecs (all in `Chronos.Core/Codecs`, pure C#, SIMD where it pays) - `JpegDecoder` (baseline, progressive, restart intervals, 4:4:4/4:2:2/4:2:0/4:1:1/gray, 12-bit optional, ICC ignored), `JpegEncoder` (baseline, quality 1–100, subsampling @@ -519,7 +520,7 @@ size and budget, never by sequence length; the self-tests assert this. --- -## 9. Metadata model and parsers (`Titano.Core/Metadata`) +## 9. Metadata model and parsers (`Chronos.Core/Metadata`) Port and extend the prototype's binary parsers: container detection by signature; JPEG segment scan (APP1 Exif, APP1 XMP + extended XMP, APP2 MPF); TIFF/IFD walker with on-demand @@ -666,7 +667,7 @@ player smoke test on Windows CI. --- -## 12. Titano desktop client — UI specification +## 12. Chronos desktop client — UI specification ### 12.1 Shell @@ -813,7 +814,7 @@ player smoke test on Windows CI. ### 12.5 Archive manager ``` -│ [Archive: D:\TitanoArchive ▾] [Scan] [Rebuild index] [Verify] [Duplicates] [Orphans] [Adopt folder…] [Maintenance ▾] │ +│ [Archive: D:\ChronosArchive ▾] [Scan] [Rebuild index] [Verify] [Duplicates] [Orphans] [Adopt folder…] [Maintenance ▾] │ ├──────────────────────────────────────────────────────────────────────────────────────────────────────┤ │ 618,204 photos · 412 sequences · 9.4 TB · 14 cameras · 2019–2026 │ │ ▆▇█▅▂▁▃▆ photos per month (heatmap) ██████░░ storage by year ▉▉▉▍ by camera ▉▉▎ by format │ @@ -896,12 +897,12 @@ Version, build, licence/EULA link, third-party notice (none), diagnostics bundle --- -## 14. Titano Server +## 14. Chronos Server ### 14.1 Stack ASP.NET Core minimal API on Kestrel (`Microsoft.AspNetCore.App` shared framework, no -packages), `System.Text.Json` source-generated contexts from `Titano.Protocol`, WebSockets +packages), `System.Text.Json` source-generated contexts from `Chronos.Protocol`, WebSockets for events, in-house structured file logging (`Microsoft.Extensions.Logging` abstractions are part of the shared framework; the file provider is in-house), in-house rate limiting for login and uploads, health endpoint, graceful shutdown (jobs checkpoint). @@ -922,7 +923,7 @@ login and uploads, health endpoint, graceful shutdown (jobs checkpoint). - Limits: max upload size, chunk size (default 8 MiB), per-user quota, request timeouts, login rate limit (5/min/IP), audit log. -### 14.3 API v1 (JSON; errors as `{ code, message, details }`; `X-Titano-Api: 1`) +### 14.3 API v1 (JSON; errors as `{ code, message, details }`; `X-Chronos-Api: 1`) ``` POST /api/v1/auth/login {username,password,clientName} → {token,user,mustChangePassword} @@ -990,7 +991,7 @@ job's own follow-ups never interrupt it. (Amended 2026-10-16, R2.) ### 14.7 Render nodes -A Titano client with "Offer this PC as render node" registers its encoder capabilities +A Chronos client with "Offer this PC as render node" registers its encoder capabilities and polls/claims render jobs matching them, downloads what it needs (proxies or originals per job settings), renders with its GPU, uploads the result as a render of the sequence. Node state shown in admin › Jobs; the server falls back to managed formats when no node is @@ -1000,7 +1001,7 @@ available and says so in the job log. ``` ┌─────────────┬────────────────────────────────────────────────────────────────────────────┐ -│ Titano │ Dashboard │ +│ Chronos │ Dashboard │ │ ● Dashboard │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ Users │ │ 9.4 TB │ │ 412 seq │ │ 3 jobs │ │ 2 nodes │ │ │ Archive │ │ of 16 TB │ │ 618k pho │ │ running │ │ online │ │ @@ -1023,25 +1024,25 @@ links' tooltips then naming their page; on narrow screens it stays the top bar ( ### 14.9 Configuration and Docker Environment variables (also readable from `/data/server.json`): -`TITANO_ADMIN_USER`, `TITANO_ADMIN_PASSWORD` (used only when no admin exists; forced change -at first login), `TITANO_ARCHIVE_PATH=/archive`, `TITANO_DATA_PATH=/data`, -`TITANO_DB=postgres|sqlite` (Linux: postgres only), `TITANO_DB_HOST`, `TITANO_DB_PORT=5432`, -`TITANO_DB_NAME`, `TITANO_DB_USER`, `TITANO_DB_PASSWORD`, `TITANO_DB_SSLMODE=prefer`, -`TITANO_HTTP_PORT=8080`, `TITANO_HTTPS_PORT=8443`, `TITANO_TLS_MODE=auto|pem|proxy`, -`TITANO_TLS_CERT`, `TITANO_TLS_KEY`, `TITANO_SERVER_NAME`, `TITANO_LANG=en`, -`TITANO_PARALLELISM` (photos the running job processes at once; `TITANO_WORKERS`, its former -name, still sets it), `TITANO_PRIORITY_QUEUE=false`, `TITANO_DISCOVERY=true` (LAN UDP beacon), +`CHRONOS_ADMIN_USER`, `CHRONOS_ADMIN_PASSWORD` (used only when no admin exists; forced change +at first login), `CHRONOS_ARCHIVE_PATH=/archive`, `CHRONOS_DATA_PATH=/data`, +`CHRONOS_DB=postgres|sqlite` (Linux: postgres only), `CHRONOS_DB_HOST`, `CHRONOS_DB_PORT=5432`, +`CHRONOS_DB_NAME`, `CHRONOS_DB_USER`, `CHRONOS_DB_PASSWORD`, `CHRONOS_DB_SSLMODE=prefer`, +`CHRONOS_HTTP_PORT=8080`, `CHRONOS_HTTPS_PORT=8443`, `CHRONOS_TLS_MODE=auto|pem|proxy`, +`CHRONOS_TLS_CERT`, `CHRONOS_TLS_KEY`, `CHRONOS_SERVER_NAME`, `CHRONOS_LANG=en`, +`CHRONOS_PARALLELISM` (photos the running job processes at once; `CHRONOS_WORKERS`, its former +name, still sets it), `CHRONOS_PRIORITY_QUEUE=false`, `CHRONOS_DISCOVERY=true` (LAN UDP beacon), `PUID`, `PGID`, `TZ`. (Amended 2026-10-16, R2.) Dockerfile: multi-stage on `mcr.microsoft.com/dotnet/sdk:10.0` → `aspnet:10.0`, non-root user via `PUID/PGID` entrypoint, volumes `/archive` and `/data`, `HEALTHCHECK` on `/health`, `linux/amd64` + `linux/arm64`. `docker-compose.yml` with a PostgreSQL 17 service. -Windows: `Titano.Server.exe` runs as console or Windows Service (`sc create`), SQLite or +Windows: `Chronos.Server.exe` runs as console or Windows Service (`sc create`), SQLite or PostgreSQL. --- -## 15. Titano Uploader +## 15. Chronos Uploader Single small window (tray-capable), zero analysis: connect + sign in (token saved with DPAPI), drop zone (files/folders/cards), queue with per-file state, pause/resume, bandwidth @@ -1053,7 +1054,7 @@ new files after they stop growing), run at startup, minimise to tray, per-sessio for HEIC/RAW so the server can render without a node. ``` -│ Titano Uploader ☁ https://nas.local:8443 · alberto · ● Connected [⚙] │ +│ Chronos Uploader ☁ https://nas.local:8443 · alberto · ● Connected [⚙] │ │ ┌────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Drop photos, folders or a card here │ │ │ └────────────────────────────────────────────────────────────────────────────────┘ │ @@ -1072,19 +1073,20 @@ for HEIC/RAW so the server can render without a node. `Import`, `Archive`, `Server`, `Settings`, `Tooltips`, `Errors`, `Advisor`, `Admin`). Keys are stable identifiers (`Library.Filter.Year`), never English sentences. - Runtime: `ResourceManager` + a `Loc` XAML markup extension and `L("key", args)` helper in - `Titano.Core/Localization`; culture switch at runtime without restart (rebinding via a + `Chronos.Core/Localization`; culture switch at runtime without restart (rebinding via a `LocalizationChanged` event); web admin receives `/api/v1/i18n/{culture}` generated from - the same resx by `Titano.Tools i18n export`. + the same resx by `Chronos.Tools i18n export`. - Plurals: an in-house minimal CLDR plural-rule table for the shipped languages (`one/few/many/other`), keys with suffixes (`Photos.Count.one`, `.other`). - Dates/numbers/units via `CultureInfo`; file sizes localised; RTL via `FlowDirection` for `ar`, `he`, `fa`, `ur` (mirrored rail and icons where directional). - Languages (Phase 8, all machine-translated by Claude Code with a glossary, marked as such - in About and open to community review via the public releases repo): `en` (source), `it`, + in About and open to community review via the releases repository): `en` (source), `it`, `de`, `fr`, `es`, `pt-BR`, `pt-PT`, `nl`, `pl`, `cs`, `sk`, `hu`, `ro`, `sv`, `da`, `nb`, `fi`, `ru`, `uk`, `tr`, `el`, `bg`, `hr`, `sl`, `lt`, `lv`, `et`, `ja`, `zh-Hans`, `zh-Hant`, `ko`, `ar`, `he`, `hi`, `id`, `ms`, `vi`, `th`. Add more if effort allows. -- `Titano.Tools i18n check` fails CI when a key is missing in `en` or `it`, when a + (Amended 2026-10-23, R2.) +- `Chronos.Tools i18n check` fails CI when a key is missing in `en` or `it`, when a placeholder count differs between languages, or when a string exceeds the layout budget (tooltips ≤ 200 chars, labels ≤ 30 chars unless flagged). - UI is written to survive +40 % text expansion (German, Finnish): no fixed-width labels. @@ -1098,7 +1100,7 @@ for HEIC/RAW so the server can render without a node. reading as camera aperture, clock and sun path at once; single accent colour on a rounded square (dark) tile; no text. Works at 16 px (segments merge into a ring; the disc remains). -- Generated programmatically (`Titano.Tools make-icon`): in-house PNG encoder + ICO +- Generated programmatically (`Chronos.Tools make-icon`): in-house PNG encoder + ICO container (16/20/24/32/48/64/128/256), SVG source kept in `branding/`; variants: Server (mark + three horizontal bars badge), Uploader (mark + up-arrow badge). Also favicon for the admin panel and a 1024 px PNG for listings. Prototype `IconGenerator` shows @@ -1113,82 +1115,161 @@ for HEIC/RAW so the server can render without a node. - Builds: `dotnet publish -c Release -r win-x64 --self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true` for App, Uploader, Setup; server as framework-dependent Docker image and a self-contained Windows zip/installer. (No trimming: WPF does not - support it.) -- `Titano.Setup` (in-house, WPF, ~one screen): choose components (Titano, Uploader, - Server for Windows), folder, shortcuts, file associations (`.titano` project bundles), - installs to `%LOCALAPPDATA%\Programs\Titano` per user (no admin) or `Program Files` + support it.) The Windows programs are cross-compiled on the Linux runner + (`EnableWindowsTargeting`), and `Chronos.Tools pe-check` stops a release whose executables + lost the GUI subsystem, the icon, the version information or the PerMonitorV2 manifest + (amended 2026-10-23, R3). +- `Chronos.Setup` (in-house, WPF, ~one screen): choose components (Chronos, Uploader, + Server for Windows), folder, shortcuts, file associations (`.chronos` project bundles), + installs to `%LOCALAPPDATA%\Programs\Chronos` per user (no admin) or `Program Files` (elevated), registers Add/Remove Programs entry with uninstaller, silent mode (`/S /DIR=`), upgrade in place, keeps user data. Payload appended to the setup exe as a compressed archive (in-house format on `DeflateStream`) with a manifest and per-file hashes. If the human later permits a build-time tool, Inno Setup/MSIX are acceptable alternatives; default is in-house. -- Code signing hook in the release workflow (`signtool` from the Windows SDK) using - secrets when present; unsigned builds are still produced. -- Updates: on start (opt-out) the client calls the GitHub Releases API of the **public - releases repository** (§19.4) and shows a one-line notice with "Download" (P1: download - installer, verify SHA-256 from `SHA256SUMS`, run it). -- Distribution: installers and `SHA256SUMS` on the public releases repo; Docker images on - GHCR (public package); Unraid template in the public repo. +- Code signing hook in the release workflow (Authenticode with `osslsigncode`, the Linux + counterpart of `signtool`; amended 2026-10-23, R3) using secrets when present; unsigned + builds are still produced. +- Updates: on start (opt-out) the client calls the Gitea releases API of the **releases + repository** (§19.4), `/api/v1/repos///releases?draft=false&pre-release=false`, + takes the highest version (a pre-release build is offered the final release of its own + version; a 404, a repository the client cannot see, is a failed check, not "up to date"), + and shows a one-line notice with "Download" (P1: download + installer, verify SHA-256 from `SHA256SUMS`, run it). The repository is the build + property `ChronosReleasesUrl` (default `https://gitea.encke-hake.ts.net/BalboSoft/Chronos`), + which also gives the licence link (`/src/branch/main/EULA.md`), the issues + link (`/issues`) and the Add/Remove Programs `URLInfoAbout`. (Amended + 2026-10-23, R2.) +- Distribution: installers, zips and `SHA256SUMS` on the Gitea release of the releases + repository; Docker images in the Gitea container registry + (`gitea.encke-hake.ts.net/balbosoft/chronos-server`); Unraid template in the repository + (§19.6); who can reach them today: §19.4. (Amended 2026-10-23, R2.) --- ## 19. CI/CD, Docker, Unraid -### 19.1 `ci.yml` (push, PR) +### 19.1 `ci.yml` (push to `main`, pull requests, manual; amended 2026-10-23, R3) -Matrix `windows-latest` / `ubuntu-latest`: `dotnet --info`, restore (no packages → fast), -build with warnings as errors, run `Titano.Testing` for all test projects (JUnit XML -uploaded and annotated), `dotnet format --verify-no-changes`, `Titano.Tools i18n check`, -XAML lint (App.Tests), zero-package guard, Docker build (no push) on ubuntu; PostgreSQL 16 -and 17 service containers for `Titano.Data.Tests`; CC0 RAW fixtures fetched by -`Titano.Tools fixtures` and cached (`actions/cache`). +Gitea Actions in `.gitea/workflows`. The runner is act_runner in Docker mode on the Linux +server that also hosts Gitea, label `ubuntu-latest`, one job at a time. The .NET jobs run +in the container `mcr.microsoft.com/dotnet/sdk:10.0` and check out with plain `git` (the +image has no Node.js, so no JavaScript actions such as `actions/checkout`); no artifacts +and no caches are used; builds use 4 cores (`BUILD_CPUS`). Gitea shows no job summary and +no annotations: `::warning`/`::error` lines appear in the log only. Jobs: + +- `build`: `dotnet --info`, build with warnings as errors, zero-package guard, + `Chronos.Tools i18n check`, XAML lint, format check, CC0 RAW fixtures fetched by + `Chronos.Tools fixtures` (a missing sample is a warning in the log and its tests skip), + `Chronos.Testing` for the Core, Data (SQLite), Server and Tools tests (JUnit XML), and the + Windows programs (App, Uploader, Setup) cross-compiled for win-x64, packed with + `pack-installer` and checked with `Chronos.Tools pe-check`. +- `postgres`: PostgreSQL 16 and 17 service containers (host name `postgres`) for + `Chronos.Data.Tests` and `Chronos.Server.Tests`; `Chronos.Tools postgres-ci` prepares the + MD5, cleartext and trust roles and TLS through SQL only, because Gitea gives no id of the + service container. +- `docker`: builds the image with the host's daemon (no push) and smoke-tests `/health` + with PostgreSQL 17 on a network of the run. +- `yaml`: in `ruby:3.3-alpine`, with the sources from the Gitea archive API; checks the + workflows, the `.gitea/ISSUE_TEMPLATE` forms and the compose file. +- `windows` (optional): runs only when the repository variable `WINDOWS_RUNNER` names the + label of a Windows act_runner in host mode with the .NET SDK, Git for Windows (in + `C:/Program Files/Git`, whose bash the job names by path) and PowerShell 7: the Core.Windows and App tests, the `--capture` screenshots and their diff, + and the installer test. Without a Windows runner the Windows-only tests are run locally on + a Windows PC. + +`perf.yml` runs the performance gates weekly on SQLite and on PostgreSQL 17 in a service +container; the timings are printed at the end of the log. ### 19.2 Zero-package guard `Directory.Build.targets` target `AssertNoPackageReferences` fails the build if any `PackageReference` exists; CI also greps `**/*.csproj` and `**/*.props` and checks that -`obj/project.assets.json` lists no packages. Only `actions/*` and `docker/*` GitHub -Actions are used in workflows. +`obj/project.assets.json` lists no packages. The workflows use only shell (`run`) steps: no +third-party actions at all (amended 2026-10-23, R3). -### 19.3 `release.yml` (tag `v*`) +### 19.3 `release.yml` (tag `v*`, or manual re-publish of an existing tag; amended 2026-10-23, R3) -Version from the tag → `Directory.Build.props`; publish self-contained binaries; build -`Titano-Setup-.exe`, `Titano-Uploader-Setup-.exe`, `Titano-Server-win-x64-.zip`; -sign if secrets present; generate `SHA256SUMS` and the changelog (`Titano.Tools changelog` -from Conventional Commits); build and push multi-arch Docker image to -`ghcr.io//titano-server:` and `:latest`; create the GitHub Release **in the -public releases repository** with `gh release create` (the `gh` CLI is preinstalled on -runners) using a fine-grained PAT stored as `RELEASES_TOKEN`; copy `deploy/unraid/ -titano.xml` and EULA there. +Job `release`, in the SDK container: the version from the tag +(`vMAJOR.MINOR.PATCH[-PRERELEASE]`) passed as `-p:ChronosVersion`, with +`-p:ChronosReleasesUrl` (the releases repository's address, §18); build and the Linux +tests; self-contained single-file win-x64 publish of App and Uploader (ReadyToRun), Server +and Setup (ReadyToRun), cross-compiled on Linux; `Chronos.Tools pe-check` (GUI subsystem, +icon, version information, PerMonitorV2 manifest); Authenticode signing with +`osslsigncode` when the secrets `SIGN_PFX_BASE64` and `SIGN_PASSWORD` exist; the +installers `Chronos-Setup-.exe` (components Chronos, Uploader, Server) and +`Chronos-Uploader-Setup-.exe`, `Chronos-Server-win-x64-.zip` and +`Chronos-win-x64-portable-.zip` (with `portable.txt`); release notes +(`Chronos.Tools changelog` from Conventional Commits) and `SHA256SUMS`; the Gitea release +made by `Chronos.Tools gitea-release` (a draft first, every file uploaded and its size +verified, then published). Then job `image`, in the runner's default image with the docker +CLI and the host's daemon: it builds `linux/amd64` only (arm64 would need QEMU on the host) +and pushes `gitea.encke-hake.ts.net/balbosoft/chronos-server:`, plus `:latest` only +for the newest stable release. Pushing needs the repository secret `REGISTRY_TOKEN`, an +access token of a user who can write the owner's packages (scope "package: read and +write"): the workflow's own token (user `gitea-actions`) is refused by the organisation's +registry. Pre-releases (tags with a `-`) get no `:latest`, and the in-app update check +ignores them. -### 19.4 Public releases repository +Variables, all optional: `PUBLIC_URL` (default `https://gitea.encke-hake.ts.net`), +`RELEASES_REPO` (§19.4), `REGISTRY` (default the host of `PUBLIC_URL`), `REGISTRY_USER` +(default the user who pushed the tag), `WINDOWS_RUNNER` (§19.1). Secrets: +`REGISTRY_TOKEN` (needed for images), `RELEASES_TOKEN` (only with `RELEASES_REPO`), +`SIGN_PFX_BASE64` + `SIGN_PASSWORD` (optional signing). -Because release assets of a private repository are not publicly downloadable, a second, -public repository (`titano-releases`) holds only: README (what it is, screenshots, -requirements), EULA/LICENSE, release assets, `SHA256SUMS`, Unraid template, `i18n/` -translations for community review, and issues. The private repo publishes into it; nothing -is developed there. The GHCR package is set to public visibility. +### 19.4 Releases repository (amended 2026-10-23, R2) + +By default releases are published in `BalboSoft/Chronos` itself: on the owner's own Gitea +the owner decides who sees the organisation, its releases and its packages, and one +repository needs no second token and no copy step. A separate public repository stays +optional, for when the sources must stay hidden while the releases are public: with the +repository variable `RELEASES_REPO` (owner/name of another repository on the same Gitea) +and the secret `RELEASES_TOKEN`, the release goes there, and for the newest stable release +`release.yml` copies into it `deploy/releases-repo/README.md` (what it is, screenshots, +requirements), `EULA.md`, `SECURITY.md`, `.gitea/ISSUE_TEMPLATE`, +`deploy/unraid/chronos.xml` and `branding/chronos-server.svg` (as `unraid/`), the compose +file and `.env.example` (as `docker/`), `i18n/` translations for community review and +`SHA256SUMS`, rewriting the links to that repository and its image; nothing is developed +there. `EULA.md` and `SECURITY.md` live at the repository root, the issue forms in +`.gitea/ISSUE_TEMPLATE` (Gitea issue-form YAML: name, about, title, labels, body). + +Today the `BalboSoft` organisation is not visible to anonymous visitors, so the update +check, release downloads and image pulls work for other people only once the owner makes +the organisation (and its packages) public, or publishes to a public `RELEASES_REPO` (the +image stays in the organisation's registry either way); while it is private, +`docker login gitea.encke-hake.ts.net` is needed before pulling. Gitea has no private +vulnerability reporting: security problems are reported privately to the maintainers (the +contact on the owner's Gitea profile, or an e-mail to them), never in a public issue. ### 19.5 `docker.yml` -Nightly build of `main` to `ghcr.io//titano-server:nightly`; `deploy/docker/ -docker-compose.yml` for users (server + PostgreSQL + volumes). +Nightly build of `main` (02:17 daily) to +`gitea.encke-hake.ts.net/balbosoft/chronos-server:nightly` in the Gitea container registry, +with the host's daemon and the `REGISTRY_TOKEN` secret as in §19.3 (amended 2026-10-23, R3); +`deploy/docker/docker-compose.yml` for users (server + PostgreSQL + volumes), downloaded +from `https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/docker/docker-compose.yml` +together with `.../deploy/docker/.env.example`. -### 19.6 Unraid template (`deploy/unraid/titano.xml`) +### 19.6 Unraid template (`deploy/unraid/chronos.xml`) -Community Applications XML: repository `ghcr.io//titano-server:latest`, WebUI -`http://[IP]:[PORT:8080]/admin`, ports 8080/8443, paths `/archive` → `/mnt/user/Timelapse`, -`/data` → `/mnt/user/appdata/titano`, variables from §14.9 (admin user/password, DB -host/port/name/user/password, TLS mode, PUID/PGID, TZ), icon URL from the public repo, -support/project links, description ≤ 2 sentences. Document (in the public README) how to -add the template repository URL in Unraid and to pair with the official PostgreSQL -template. +Community Applications XML: repository `gitea.encke-hake.ts.net/balbosoft/chronos-server:latest`, +WebUI `http://[IP]:[PORT:8080]/admin`, ports 8080/8443, paths `/archive` → +`/mnt/user/Timelapse`, `/data` → `/mnt/user/appdata/chronos`, variables from §14.9 (admin +user/password, DB host/port/name/user/password, TLS mode, PUID/PGID, TZ), description ≤ 2 +sentences. Registry and Project `https://gitea.encke-hake.ts.net/BalboSoft/Chronos`, +Support `https://gitea.encke-hake.ts.net/BalboSoft/Chronos/issues`, TemplateURL +`https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/deploy/unraid/chronos.xml`, +Icon `https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/branding/chronos-server.svg`; +`release.yml` rewrites these exact prefixes for a separate releases repository (§19.4), so +they stay verbatim. (Amended 2026-10-23, R2.) Document (in the README) how to install the +template as a user template (Unraid's template repositories read GitHub and GitLab +addresses, not Gitea's) and to pair it with the official PostgreSQL template. --- ## 20. Testing and quality -### 20.1 `Titano.Testing` (in-house) +### 20.1 `Chronos.Testing` (in-house) Attributes `[Test]`, `[Theory]` + `[Case(...)]`, `[Skip(reason)]`, `[Timeout(ms)]`, `[Category]`; assertions with expressive messages (`Assert.Equal`, `Approximately`, @@ -1211,16 +1292,16 @@ out.xml --filter core`. in-house MP4 inspector + `MediaPlayer` playback check; `--capture` screenshots of every screen for visual regression (pixel-diff tolerance) and for the phase report. - Fixtures: tiny synthetic files checked in; CC0 RAW samples (one per major format, from a - public CC0 sample set) fetched by `Titano.Tools fixtures` into `tests/fixtures/external` - (git-ignored, CI-cached). + public CC0 sample set) fetched by `Chronos.Tools fixtures` into `tests/fixtures/external` + (git-ignored; CI fetches them on every run, without a cache; amended 2026-10-23, R3). ### 20.3 Static rules Warnings as errors; nullable enabled; `dotnet format`; XAML lint: every `Button`, `ToggleButton`, `Slider`, `ComboBox`, `CheckBox`, `MenuItem` has a `ToolTip`; no literal `Content="…"`/`Text="…"` outside resources; no `PackageReference`; no Windows APIs in -`Titano.Core`/`Titano.Data`/`Titano.Protocol`/`Titano.Server` (checked by building them on -Linux); public API of `Titano.Protocol` versioned. +`Chronos.Core`/`Chronos.Data`/`Chronos.Protocol`/`Chronos.Server` (checked by building them on +Linux); public API of `Chronos.Protocol` versioned. ### 20.4 Quality gates carried over from the prototype (regression thresholds) @@ -1238,20 +1319,22 @@ unobserved exceptions, spill file removed. - In-house ad delivery, no SDK, no tracking by default: the client fetches a signed campaign manifest (JSON: id, image URL, link, weight, languages, countries, start/end, - minimum version) from `https://.github.io/titano-releases/ads/manifest.json` - (or a URL set by the human), caches creatives, renders them natively in one slot — the - Export section while a render runs (prototype rationale: the only moment an ad takes - nothing from anyone) — and optionally a small footer slot in Library. Clicks open the - browser. Manifest signature: ECDSA P-256 with an embedded public key. + minimum version) from `ads/manifest.json`, a raw file of the releases repository on Gitea + (by default `https://gitea.encke-hake.ts.net/BalboSoft/Chronos/raw/branch/main/ads/manifest.json`), + or from a URL set by the human (amended 2026-10-23, R2), caches creatives, renders them + natively in one slot — the Export section while a render runs (prototype rationale: the + only moment an ad takes nothing from anyone) — and optionally a small footer slot in + Library. Clicks open the browser. Manifest signature: ECDSA P-256 with an embedded public + key. - Consent: first-run one-line choice for anonymous impression counting (off by default); when on, a daily aggregated ping (version, language, country from OS locale, counts) — no identifiers. Privacy policy link in About and EULA. -- Ad-free: "Titano Pro" licence key (ECDSA-signed, offline validation, tied to a display +- Ad-free: "Chronos Pro" licence key (ECDSA-signed, offline validation, tied to a display name and edition, no phone-home) entered in Settings › Licence; a server licence makes all its connected clients ad-free (team scenario). Fallback content when the manifest is empty: internal tips about the program. - Everything above is a toggle in Settings for the human's own builds; the feature ships - disabled by default until the human flips a build property `TitanoAdsEnabled=true`. + disabled by default until the human flips a build property `ChronosAdsEnabled=true`. --- @@ -1262,7 +1345,7 @@ split into sub-phases; order inside a phase is Claude Code's choice. ### Phase 0 — Bootstrap (repo, rules, shells) Solution, `Directory.Build.*`, `global.json`, `CLAUDE.md`, `DECISIONS.md`, `CHANGELOG.md`; -`Titano.Testing`; zero-package guard; `ci.yml`; i18n infrastructure with `en` + `it`; +`Chronos.Testing`; zero-package guard; `ci.yml`; i18n infrastructure with `en` + `it`; WPF shell (rail, theme, job bar, status strip, settings skeleton, tooltip lint); server skeleton (Kestrel, `/health`, `/server/info`, login page, admin shell); Dockerfile builds; branding mark + ICO generator. @@ -1272,7 +1355,7 @@ branding mark + ICO generator. Parsers (§9), managed codecs (§8.3), WIC provider, decode tiers, thumbnails/proxies, `ImageBuffer`/`FrameWindow` port, fixtures tool, fuzz tests, DNG full pipeline. *Gate:* every fixture decodes at the expected tier on Windows and Linux; PSNR/round-trip -tests green; `Titano.Tools diagnose ` reports per-file tier and metadata. +tests green; `Chronos.Tools diagnose ` reports per-file tier and metadata. ### Phase 2 — Data layer and archive SQLite binding, PostgreSQL wire client, migrations, repositories, archive layout, sidecars, @@ -1311,8 +1394,9 @@ client server mode, Uploader app, LAN discovery. via server; crash-restart resumes jobs; audit log complete. ### Phase 8 — Worldwide release readiness -All languages (§16), RTL pass, installer, `release.yml`, public releases repo bootstrap -(README, EULA draft, template), Unraid template, update check, diagnostics bundle, +All languages (§16), RTL pass, installer, `release.yml`, releases repository content +(README, EULA draft, template; a separate public repository optional since 2026-10-23, R2), +Unraid template, update check, diagnostics bundle, accessibility pass, performance pass, docs. *Gate:* tagged pre-release published end-to-end from CI; install/uninstall/upgrade tested; Unraid template validated. @@ -1324,8 +1408,8 @@ Unraid template validated. ## 23. Assumptions and open decisions (for the human; do not block on these) -1. Product name **Titano** kept from the prototype — rename before Phase 0 if desired - (repo-wide rename later is costly). +1. Product name **Chronos**, given by the owner on 2026-10-23 in place of the name kept + from the prototype (amended 2026-10-23, R1); settled. 2. Linux server MP4 output relies on render nodes (and P2 intra-only encoder). If an FFmpeg subprocess were ever allowed as an *optional, opt-in* backend, it would be a single `IVideoEncoderProvider`; not planned unless the human approves. @@ -1351,28 +1435,31 @@ questions asked and the answers; DECISIONS rows give the reasons. | Date | Request | Sections | What changed | |---|---|---|---| | 2026-10-16 | Owner review 1, R4 | §8.1, §8.2 | DNG decodes through the managed decoder (WIC only through the Raw Image Extension, never DNG); a GoPro DNG is GPR only when VC-5; analyses and previews take an adequate embedded preview by choice, renders decode natively. | -| 2026-10-16 | Owner review 1, R2 | §12.8, §14.6, §14.8, §14.9 | Jobs run one at a time; the parallelism is photos the running job processes at once; an optional priority queue by job kind pauses lower jobs and resumes them by itself; `TITANO_PARALLELISM` (former `TITANO_WORKERS`) and `TITANO_PRIORITY_QUEUE`. | +| 2026-10-16 | Owner review 1, R2 | §12.8, §14.6, §14.8, §14.9 | Jobs run one at a time; the parallelism is photos the running job processes at once; an optional priority queue by job kind pauses lower jobs and resumes them by itself; `CHRONOS_PARALLELISM` (former `CHRONOS_WORKERS`) and `CHRONOS_PRIORITY_QUEUE`. | | 2026-10-16 | Owner review 1, R1 | §12.1, §14.8 | The rail is 200 px and collapses to 48 px of icons with ≡ or Ctrl+B, their tooltips naming the sections, saved at once; the admin panel's sidebar is 256 px and collapses the same way, kept in the browser. | | 2026-10-16 | Owner review 1, R7 | §4.1, §10.2, §12.1, §12.3 | The Sequence section is now Edit: one sequence at a time, chosen in a picker inside the section (Change sequence, Ctrl+O); the editor's tabs are the steps of a guided, freely navigable path that starts with a new Analysis step, each step showing where it stands, with Previous and Next. | +| 2026-10-23 | Chronos on Gitea, R1 | whole brief, §23 | The product and its programs are named Chronos (Chronos, Chronos Server, Chronos Uploader) everywhere: projects and namespaces, files, settings, `CHRONOS_*` variables, `%LOCALAPPDATA%\Chronos`, `.chronos` project bundles and folders, the image `chronos-server`; the product name is no longer an open decision. | +| 2026-10-23 | Chronos on Gitea, R2 | §3, §16, §18, §19.4, §19.6, §21, §22 | The repository is `BalboSoft/Chronos` on the self-hosted Gitea (`https://gitea.encke-hake.ts.net`): the update check reads the Gitea releases API of `ChronosReleasesUrl`; licence, issue and support links, the Unraid template and the ads manifest point to that repository; images go to the Gitea container registry; releases are published in the repository itself, a separate public releases repository is optional (`RELEASES_REPO`); `EULA.md` and `SECURITY.md` at the root, issue forms in `.gitea/ISSUE_TEMPLATE`. | +| 2026-10-23 | Chronos on Gitea, R3 | §0.2, §18, §19.1, §19.2, §19.3, §19.5, §20.2, Appendix A | Gitea Actions on a Linux act_runner in Docker mode: CI jobs build, postgres, docker and yaml, plus a windows job once a Windows runner is registered; shell steps only, no artifacts, caches, job summaries or annotations; the release cross-compiles the Windows programs on Linux, checks them with `pe-check`, signs them with `osslsigncode` when secrets exist, publishes them with `gitea-release` and pushes a `linux/amd64` image with `REGISTRY_TOKEN`; Definition of Done is green on Gitea Actions, the Windows-only tests on a Windows runner or a Windows PC. | ## Appendix A — `CLAUDE.md` content (create verbatim in Phase 0, keep updated) ```markdown -# Titano — working rules +# Chronos — working rules Read docs/BRIEF.md when in doubt; it wins over these notes. - Zero . Anything not in the .NET BCL / Microsoft shared frameworks / OS APIs is written here. - No external processes at runtime (no ffmpeg, exiftool, powershell). Only OS dialogs listed in BRIEF §8.6. -- Titano.Core / Data / Protocol / Server target net10.0 and build on Linux; Windows-only code lives in *.Windows or the desktop apps. +- Chronos.Core / Data / Protocol / Server target net10.0 and build on Linux; Windows-only code lives in *.Windows or the desktop apps. - English identifiers, comments, commits (Conventional Commits). Prototype in docs/reference is Italian: port algorithms, not language. - Every UI string is a resource (en source, it translation). Labels ≤ 3 words; explanations only in tooltips; every actionable control has a tooltip; no helper paragraphs. - Destructive operations: dry-run plan first, hash verification, explicit user action. - When the brief is silent: choose the simplest safe option, log it in docs/DECISIONS.md, continue. Ask only at phase gates or before irreversible choices. -- Definition of Done per phase: green on windows-latest + ubuntu-latest, tests green, no new warnings, DECISIONS + CHANGELOG updated, i18n check green, phase report with "how to try it". -- Build: dotnet build -c Release; tests: dotnet run --project tests/ -- --junit out.xml; tools: dotnet run --project src/Titano.Tools -- . +- Definition of Done per phase: CI green on Gitea Actions (the Linux jobs; the windows job once a Windows runner is registered, until then the Windows-only tests run on a Windows PC), tests green, no new warnings, DECISIONS + CHANGELOG updated, i18n check green, phase report with "how to try it". +- Build: dotnet build -c Release; tests: dotnet run --project tests/ -- --junit out.xml; tools: dotnet run --project src/Chronos.Tools -- . - Current phase and next steps: see docs/STATUS.md (update at every gate). ``` -## Appendix B — Prototype module map (grep targets in `docs/reference/titano-prototype.md`) +## Appendix B — Prototype module map (grep targets in `docs/reference/chronos-prototype.md`) | Prototype (Italian) | New home | Notes | |---|---|---| @@ -1386,7 +1473,7 @@ Read docs/BRIEF.md when in doubt; it wins over these notes. | `Pipeline/MediaImporter, PathTemplate` | `Core/Import`, `Core/Naming` | tokens translated to English | | `Video/MediaFoundationInterop, VideoEncoderSession, Nv12Converter, CodecLimits` | `Core.Windows/MediaFoundation` | add P010, AV1, capability enumeration | | `Video/Mp4Muxer, BoxWriter, AnnexBParser, ExportPresets, ExportSettings` | `Core/Video`, `Core/Export` | add `av1C`, new presets | -| `Diagnostics/SelfTest, SyntheticSequence, SequenceDiagnostics, Mp4Inspector, Mp4Playback, AdvancedModuleTests, ExifWriter, IconGenerator, CrashGuard` | `tests/*`, `Titano.Tools`, `Core/Diagnostics` | 63 checks → tests | +| `Diagnostics/SelfTest, SyntheticSequence, SequenceDiagnostics, Mp4Inspector, Mp4Playback, AdvancedModuleTests, ExifWriter, IconGenerator, CrashGuard` | `tests/*`, `Chronos.Tools`, `Core/Diagnostics` | 63 checks → tests | | `UI/*` (WinForms) | not ported | reuse only the interaction ideas (rail, preview tools, Auto indicator, presets) | | `UI/SponsorPanel` | Phase 9 only | | diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 95af09ba..a3b7ec87 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,25 +1,29 @@ # Changelog All notable changes. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow SemVer; -commits follow Conventional Commits (release notes are generated from them by `Titano.Tools changelog`). +commits follow Conventional Commits (release notes are generated from them by `Chronos.Tools changelog`). ## [Unreleased] +## [0.1.0-rc.1] — 2026-10-23 + +First pre-release, built and published by Gitea Actions. + ### Added #### Foundation - Solution and build rules: warnings as errors, nullable, .NET 10 SDK pin, zero-package guard (build target and - `Titano.Tools package-guard`). -- `Titano.Testing`: in-house test framework and runner (theories, categories, timeouts, environment and Windows - gates, serial classes, parallel runs, JUnit XML, GitHub annotations). + `Chronos.Tools package-guard`). +- `Chronos.Testing`: in-house test framework and runner (theories, categories, timeouts, environment and Windows + gates, serial classes, parallel runs, JUnit XML, workflow annotations). - Localization runtime (`Loc`, CLDR plural rules with few/many forms, runtime culture switch, RTL), `en` + `it` catalogs, machine translations with per-language glossaries, `i18n check/export/missing/import`. - Brand mark geometry, SDF rasteriser, PNG encoder, ICO writer and `make-icon` (icons generated at build time). -- VS Code debug configurations for the Windows programs (`.vscode/launch.json`, `tasks.json`): Titano, the Uploader, - the server on SQLite with its data in `out/debug/server`, the screenshot captures, `Titano.Tools` and the test +- VS Code debug configurations for the Windows programs (`.vscode/launch.json`, `tasks.json`): Chronos, the Uploader, + the server on SQLite with its data in `out/debug/server`, the screenshot captures, `Chronos.Tools` and the test programs, each built in Debug first. -#### Engine (Titano.Core) +#### Engine (Chronos.Core) - Metadata: signature sniffing, TIFF/Exif/GPS/XMP/MakerNotes, JPEG segments, ISO-BMFF (HEIF, CR3), RAF, PNG, WebP and RIFF parsers with fuzz-tested partial results; `MetadataBuilder` fallback chains; `ExifWriter`. - Codecs: JPEG (baseline, progressive, lossless; libjpeg-exact integer IDCT), PNG, TIFF, linear DNG writer, GIF and @@ -32,7 +36,7 @@ commits follow Conventional Commits (release notes are generated from them by `T - Motion: FFT and phase correlation, pyramidal Lucas–Kanade flow, motion blur, nine-patch stabiliser, virtual camera, frame interpolation, stacking and star trails. - Render and export: render plan (constant, adaptive, interpolated, remapped timing), preparation pass, geometry, - pipeline, self-test suite (`Titano.Tools selftest`); preset resolution, encoder selection with hardware preference + pipeline, self-test suite (`Chronos.Tools selftest`); preset resolution, encoder selection with hardware preference and fallbacks, output naming. - Video: streaming MP4 muxer (H.264/HEVC/AV1) with inspector, AVI-MJPEG with OpenDML indexes, NV12/P010 conversion, level tables, managed encoder provider (MJPEG-AVI, image sequences, GIF, APNG). @@ -41,25 +45,25 @@ commits follow Conventional Commits (release notes are generated from them by `T - Diagnostics: `SecretScrubber` and `DiagnosticsArchive` for diagnostics bundles that never carry passwords, tokens, keys or photos. -#### Data (Titano.Data) +#### Data (Chronos.Data) - SQLite binding (winsqlite3 / libsqlite3) and in-house PostgreSQL wire protocol v3 client (pool, prepared statements, COPY, LISTEN, cancellation). -- Migrations, repositories and the `TitanoDatabase` facade; one persistent job engine with checkpoints, +- Migrations, repositories and the `ChronosDatabase` facade; one persistent job engine with checkpoints, pause/resume, priorities and crash recovery for client and server. - Archive engine: create/adopt/open, incremental and full scans, rebuild from sidecars, ingest of uploads and card imports, verify, thumbnails and proxies, maintenance, mass rename, job handlers. - Analysis and render engine: light/deep analysis and render job handlers, render node client. #### Programs -- Titano desktop: shell with rail, job bar and toasts; Welcome, Library (virtualised grid and list, filters, sort, +- Chronos desktop: shell with rail, job bar and toasts; Welcome, Library (virtualised grid and list, filters, sort, hover scrubbing), Jobs, Server (trust-on-first-use sign-in, DPAPI token), Settings (general, archive, rendering with encoder inventory and self-test, storage, server, updates, advanced) and About; `--capture` screenshots. -- Update check against the public releases repository and **Download**: the setup (the portable zip for a portable - copy) is fetched into `%TEMP%\Titano\updates`, verified against the release's `SHA256SUMS` and shown in Explorer; +- Update check against the releases repository on Gitea and **Download**: the setup (the portable zip for a portable + copy) is fetched into `%TEMP%\Chronos\updates`, verified against the release's `SHA256SUMS` and shown in Explorer; an interrupted download resumes, *Cancel* stops it, and a transfer that stalls for 60 s fails. - Diagnostics bundle (Settings › Advanced, About): environment, codec and encoder inventory, scrubbed settings, recent failed jobs and logs. -- Titano Server: configuration from `server.json` and `TITANO_*`, TLS (auto, PEM, proxy), API v1 (auth, users, +- Chronos Server: configuration from `server.json` and `CHRONOS_*`, TLS (auto, PEM, proxy), API v1 (auth, users, sequences, frames, uploads, sync, jobs, render nodes, events over WebSocket, archive), admin panel (dashboard, users, archive, jobs, settings, logs, about), audit log, LAN discovery, Windows service. - Server diagnostics: `GET /api/v1/server/diagnostics` (ManageArchive, audited) and a *Diagnostics* button in admin › @@ -68,9 +72,9 @@ commits follow Conventional Commits (release notes are generated from them by `T several actions, password change, typed confirmations, right-to-left layout; an administrator cannot reset their own password from Users (409). `DELETE /api/v1/sequences/{id}` moves the sequence to the archive's trash and answers 409 or 503 with a reason when it cannot. -- Titano Uploader: tray program with resumable persisted queue, session grouping, watch folders, bandwidth limit, +- Chronos Uploader: tray program with resumable persisted queue, session grouping, watch folders, bandwidth limit, verified-only source deletion. -- Titano Setup: one-screen installer, per-user or all-users, components, shortcuts, file types, upgrade in place, +- Chronos Setup: one-screen installer, per-user or all-users, components, shortcuts, file types, upgrade in place, silent mode, uninstaller that keeps user data unless asked. #### Desktop workflows @@ -95,7 +99,7 @@ commits follow Conventional Commits (release notes are generated from them by `T #### Localization and accessibility - 38 cultures: `en`, `it` and 36 machine translations with per-language glossaries and an independent review. -- Right-to-left: windows mirror from startup and on every language switch (`TitanoWindow`), directional icons +- Right-to-left: windows mirror from startup and on every language switch (`ChronosWindow`), directional icons mirror with them, photos, charts, numbers, paths and templates stay left-to-right islands, category charts lay out from the reading side. - Accessibility: automation peers for sliders, filmstrip, curve editor, preview, charts, split buttons and the job @@ -104,15 +108,20 @@ commits follow Conventional Commits (release notes are generated from them by `T icon-only toggles. #### Distribution and CI -- Docker image (multi-arch, PUID/PGID, health check), compose file with PostgreSQL 17, Unraid template. -- CI: Windows + Linux build and tests, PostgreSQL 16/17, Docker smoke test, screenshots branch, i18n, XAML lint, - format and package guards. -- Release workflow: tests, self-contained publish, optional Authenticode signing, installers, portable and server - zips, `SHA256SUMS`, release notes from Conventional Commits, multi-arch GHCR image, and the public releases - repository (README, EULA draft, SECURITY policy, issue forms, Unraid template, compose file, screenshots, `i18n/`). +- Docker image (PUID/PGID, health check), compose file with PostgreSQL 17, Unraid template. +- CI on Gitea Actions (`.gitea/workflows/ci.yml`): Linux build and tests, the Windows programs cross-compiled and + checked (`pe-check`), PostgreSQL 16/17, Docker smoke test, i18n, XAML lint, format, package and YAML guards; the + Windows tests, screenshots and installer test on a Windows runner once `WINDOWS_RUNNER` is set. +- Release workflow: tests, self-contained publish cross-compiled on Linux, optional Authenticode signing + (osslsigncode), installers, portable and server zips, `SHA256SUMS`, release notes from Conventional Commits, the + Gitea release (`Chronos.Tools gitea-release`), the server image in the Gitea container registry, and optionally a + separate releases repository (README, EULA draft, SECURITY policy, issue forms, Unraid template, compose file, + `i18n/`). +- `Chronos.Tools` commands for the Linux runner: `zip`, `gitea-release`, `postgres-ci` (the wire tests' roles and TLS + through SQL) and `pe-check`. - Performance gates (`perf.yml`, weekly): 500,000-photo library and 100,000-frame rebuild from sidecars (every column compared), each on SQLite and PostgreSQL 17. -- `Titano.Tools.Tests`: the fixtures command's warning annotations and exit codes. +- `Chronos.Tools.Tests`: the fixtures command's warning annotations and exit codes. #### Verification against the brief (2026-10-12) - Settings › Import, Analysis and Formats pages (defaults of new cards, deep-analysis width, thresholds and auto-run, @@ -124,11 +133,11 @@ commits follow Conventional Commits (release notes are generated from them by `T - An archive's templates, proxy size and thumbnail size live in its archive.json. Settings › Archive and PUT /api/v1/archive/settings rewrite it atomically under a lease, and new desktop archives start from Settings › Archive. -- CI: pixel diff of the `--capture` screenshots against `tests/visual/baselines` (`Titano.Tools screenshots diff` and +- CI: pixel diff of the `--capture` screenshots against `tests/visual/baselines` (`Chronos.Tools screenshots diff` and `accept`; 8/255 per channel, at most 0.05 % of a screen; a screen without a baseline fails once any is committed); captures are reproducible (fixed sample clock, English formats, no animation). -- CI: installer test on a clean `windows-latest` runner (silent install, run, upgrade in place, Uploader-only install, - uninstall, exit codes). +- CI: installer test (silent install, run, upgrade in place, Uploader-only install, uninstall, exit codes), now the + last step of the `windows` job on a Windows runner. - CI: the PostgreSQL 16/17 jobs run the MD5, cleartext, trust and TLS (require, verify-full) tests; a server without TLS fails them. - Windows tests: Media Foundation output opened by MediaPlayer (H.264, and HEVC Main10 where hardware allows) and its @@ -158,9 +167,9 @@ commits follow Conventional Commits (release notes are generated from them by `T the Panasonic time-lapse hint. Sequences shot by the camera's own intervalometer get adaptive timing across their pauses. - The SQLite compile options appear in the log and in the diagnostics bundle. -- `.titano` project files. *Save project file* on the Export tab writes the sequence's reference and settings. Opening - one (a double-click, or `Titano.exe `) opens the sequence with those settings as one undoable step, with - one-sentence toasts when the file cannot be read or its sequence is not in the library. One Titano runs per data +- `.chronos` project files. *Save project file* on the Export tab writes the sequence's reference and settings. Opening + one (a double-click, or `Chronos.exe `) opens the sequence with those settings as one undoable step, with + one-sentence toasts when the file cannot be read or its sequence is not in the library. One Chronos runs per data folder, and a later launch hands its file to the running one or, while that one is closing, waits for it and starts with the file. - Server: `PATCH /api/v1/sequences/{id}` takes `expectedFramesVersion` and answers 409 `frames_conflict` when the @@ -168,20 +177,26 @@ commits follow Conventional Commits (release notes are generated from them by `T returns frames, frames version and settings of one frames version. ### Changed +- Chronos on Gitea (2026-10-23, `docs/requests/2026-10-23-chronos-gitea.md`): the product is renamed from Titano to + Chronos everywhere (programs, namespaces, `CHRONOS_*` variables, `%LOCALAPPDATA%\Chronos`, `.chronos` files, the + image `chronos-server`, every translation with its grammar); the repository, update check, licence, issue and + support links, container registry and workflows move from GitHub to the self-hosted Gitea + (`https://gitea.encke-hake.ts.net/BalboSoft/Chronos`); releases are published in that repository, with `EULA.md` + and `SECURITY.md` at its root and the issue forms in `.gitea/ISSUE_TEMPLATE`. - Owner review 1 (2026-10-16, R2, `docs/requests/2026-10-15-owner-review-1.md`): - jobs run one at a time, on the desktop and on the server. Settings › Rendering › Parallelism (server: - `TITANO_PARALLELISM`, admin panel › Settings › Jobs) is now how many photos the running job processes at once: + `CHRONOS_PARALLELISM`, admin panel › Settings › Jobs) is now how many photos the running job processes at once: thumbnail and proxy passes draw that many photos together, decode tiers are probed that many at a time, the deep analysis measures that many frames and a render decodes that many ahead (fewer wherever large originals are developed whole, within the memory budget); the server's renders get a frame window sized to the host (a quarter of the memory available) instead of 1 GiB; the running job has the whole memory budget; - a new job waits its turn, and pausing the running job lets the next one start. An optional priority queue - (Settings › Rendering, admin panel › Settings › Jobs, `TITANO_PRIORITY_QUEUE`) gives each job kind a level; by + (Settings › Rendering, admin panel › Settings › Jobs, `CHRONOS_PRIORITY_QUEUE`) gives each job kind a level; by default renders, imports and downloads are high and verifies and proxies low. A queued job of a higher level pauses the running one without asking, and that one resumes by itself afterwards from its checkpoint; - the Jobs screen shows "8 photos at once", and a Priority queue chip while the queue is on; the admin dashboard shows the parallelism; - - `Titano.Tools i18n prune` removes from the translations the keys English no longer has. + - `Chronos.Tools i18n prune` removes from the translations the keys English no longer has. - Owner review 1 (2026-10-16, R1): the rail is 200 px wide, so section names fit in every language, and collapses to icons with ≡ or Ctrl+B; collapsed, an icon's tooltip names its section. The choice is saved at once and survives Settings › *Reset all…* and *Import…*. The admin panel's sidebar is 256 px and collapses to icons the same way (≡ or @@ -206,8 +221,8 @@ commits follow Conventional Commits (release notes are generated from them by `T its analysis waits or runs, else on Frames, whose list is now the frame warnings. ### Deprecated -- `TITANO_WORKERS` and the `Workers` key of `server.json` set the parallelism (photos the running job processes at - once, 1 to 64); the server logs a warning at start when the variable is set. Use `TITANO_PARALLELISM`. +- `CHRONOS_WORKERS` and the `Workers` key of `server.json` set the parallelism (photos the running job processes at + once, 1 to 64); the server logs a warning at start when the variable is set. Use `CHRONOS_PARALLELISM`. ### Fixed - Owner review 1 (2026-10-16, `docs/requests/2026-10-15-owner-review-1.md`): @@ -234,7 +249,7 @@ commits follow Conventional Commits (release notes are generated from them by `T - taking a sequence's lease could fail with "Access to the path is denied" when the previous holder had just released it while another process was reading it (Windows keeps the file pending deletion meanwhile): the lease is now taken once the reader lets go (found while testing phase 2). -- Opening the repository in VS Code with C# Dev Kit before the first build listed MSB3073 for Titano, the Uploader +- Opening the repository in VS Code with C# Dev Kit before the first build listed MSB3073 for Chronos, the Uploader and Setup: design-time builds no longer generate the program icons, and log WPF's MC1000 about projects not built yet as a message. - Server: downloading the current log while it was being written aborted the response (Content-Length mismatch); it @@ -280,14 +295,14 @@ commits follow Conventional Commits (release notes are generated from them by `T - Server (Windows): `--install-service` registered a LocalSystem service from any folder. It now refuses outside a Program Files folder that only administrators can change. - Server: in TLS mode proxy, any client could set `X-Forwarded-For` to escape the sign-in rate limit and forge its - audit address. Now only the proxies in `TITANO_TRUSTED_PROXIES` (default: loopback) may. The admin panel shows *Not + audit address. Now only the proxies in `CHRONOS_TRUSTED_PROXIES` (default: loopback) may. The admin panel shows *Not via proxy*, and a refused sign-in names the setting. - Docker: a fresh, root-owned archive folder made the container crash-loop. An empty or root-owned archive root is now - given to PUID:PGID. Any other archive, or `.titano` folder, that this user cannot write stops the container with a - one-line error. `TITANO_DATA_PATH` is honoured, and Kestrel no longer warns about overridden addresses at every + given to PUID:PGID. Any other archive, or `.chronos` folder, that this user cannot write stops the container with a + one-line error. `CHRONOS_DATA_PATH` is honoured, and Kestrel no longer warns about overridden addresses at every start. -- Docker and Unraid: remapped host ports broke the admin panel's HTTPS redirect; `TITANO_PUBLIC_HTTPS_PORT` and - `TITANO_PUBLIC_HTTP_PORT` fix it, and the LAN beacon uses them too. The Unraid template's default database host +- Docker and Unraid: remapped host ports broke the admin panel's HTTPS redirect; `CHRONOS_PUBLIC_HTTPS_PORT` and + `CHRONOS_PUBLIC_HTTP_PORT` fix it, and the LAN beacon uses them too. The Unraid template's default database host could not resolve on the bridge network. `--help` now lists every variable, the TZ description is accurate, and the README explains host networking for LAN discovery (with PostgreSQL on loopback). - Tests: four tests switched the UI language outside a serial class and could break English assertions running beside @@ -313,11 +328,11 @@ commits follow Conventional Commits (release notes are generated from them by `T the editor's player and runners before the index and the engine close. Cancelling or closing the sign-in dialog no longer leaves a half-signed-in session or crashes on a late answer. - The usage counts consent, which promised a daily count that nothing sends, is offered only in builds with - `TitanoAdsEnabled=true` (BRIEF §21). + `ChronosAdsEnabled=true` (BRIEF §21). - Error toasts say why an action failed in the app's language instead of showing .NET or OS text: a job posted to the server from the Library (including a server whose certificate changed since sign-in, which used to fail silently), the card check and delete after an import, and a failed editor save. The editor's own reasons (frames changed on the - server, settings changed elsewhere at the same time, sequence gone, project unreadable or from a newer Titano, + server, settings changed elsewhere at the same time, sequence gone, project unreadable or from a newer Chronos, account without edit rights) are no longer reported as 'The server does not answer'. - Texts that count now agree with the number: advisor findings and reasons, the rendering cores and the upload-all tooltip have singular and plural forms ('1 frame is black'), a single exposure change has its own finding, and @@ -361,17 +376,17 @@ commits follow Conventional Commits (release notes are generated from them by `T - A failure while probing the SQLite compile options can no longer stop the index from opening. - The PostgreSQL server writes decode tiers in batches instead of one statement per frame. The 0003 migration headers name the right mirror file. -- Upgrading or uninstalling while the Titano Server service ran failed, and uninstalling left the LocalSystem service +- Upgrading or uninstalling while the Chronos Server service ran failed, and uninstalling left the LocalSystem service registered. Services of the installed programs are now stopped once the programs have closed, started again after the upgrade (or when it fails) and deleted on uninstall. Only services, sign-in entries and shortcuts that start a program setup installed are changed, so installing into a shared folder never touches other programs'. - The Server component installs only for all users in a folder inside Program Files, where standard users cannot replace the program its service starts. - Uninstalling left the Uploader's and the client's sign-in entries behind. 'Remove my data' deleted the whole data - folder, also another installed Titano product's index or upload queue, and now removes only the data of programs no + folder, also another installed Chronos product's index or upload queue, and now removes only the data of programs no other installed product uses. Uninstalling one product deleted the other's Uploader shortcuts; they now move to the copy that stays. -- The `.titano` file type name is written in setup's language. +- The `.chronos` file type name is written in setup's language. - Titled notes with no listed changes now say 'Maintenance release.'. - Server: HEIF frames whose proxies had arrived stayed preview-only, capped at the size of their Exif thumbnail (often 160 × 120); the advisor then chose the 720p preview preset and the Library showed the preview-only chip. A frame @@ -432,7 +447,7 @@ commits follow Conventional Commits (release notes are generated from them by `T and the admin panel kept the old values until a restart, and saving the admin panel's archive form wrote the old templates back. The index now follows the file whenever Settings › Archive opens and at every rescan, on the desktop and on the server, and the admin form reads the file when it opens. A poll no longer puts back values an - administrator had just saved, and an archive.json written by a newer Titano is no longer registered. + administrator had just saved, and an archive.json written by a newer Chronos is no longer registered. - Settings › Archive saved 320 as this PC's thumbnail size whenever the open archive was offline. With an empty archive folder it edited the first archive of the index. It silently dropped an edit made while a newly chosen archive was still opening, and an edit made just before a second folder change went to the archive of the later @@ -440,7 +455,7 @@ commits follow Conventional Commits (release notes are generated from them by `T - Start with Windows (client and Uploader) stayed ticked after Task Manager disabled the entry, and ticking it again could not turn the entry back on. The Uploader now also reads it again when its settings open. - A portable copy unpacked in a OneDrive folder, including a Desktop or Documents folder backed up by OneDrive, kept - its SQLite index there. It now keeps its data in %LOCALAPPDATA%\Titano, says so at start and names the data it kept + its SQLite index there. It now keeps its data in %LOCALAPPDATA%\Chronos, says so at start and names the data it kept beside it before, which it leaves untouched. A per-user data folder that OneDrive synchronises is now reported with a warning. - Import: a photo that could not be copied, a card file the plan could not read, and every photo a stopped import @@ -459,9 +474,9 @@ commits follow Conventional Commits (release notes are generated from them by `T notification or its row, shows all of them selected in the Library instead of opening only the first in the editor. A job over a whole archive opens the Library without freezing it. - Server (Windows): a service that refused its data folder or `server.json` stopped with error 1064 and gave no reason - anywhere. Start and stop failures now go to the Application event log (source `TitanoServer`) with the entry to + anywhere. Start and stop failures now go to the Application event log (source `ChronosServer`) with the entry to check. The README gives the full steps to fix a data folder created by a console run. -- Docker and Unraid: the `TITANO_TRUSTED_PROXIES` guidance suggested trusting a whole Docker network (Unraid: +- Docker and Unraid: the `CHRONOS_TRUSTED_PROXIES` guidance suggested trusting a whole Docker network (Unraid: `172.17.0.0/16`), whose gateway carries relayed IPv6 and host connections. It now names the proxy container's own fixed address and warns against subnets, the gateway and the default bridge. - Setup: an upgrade that renamed the client or the Uploader deleted its sign-in entry, which silently turned *Start @@ -523,7 +538,7 @@ commits follow Conventional Commits (release notes are generated from them by `T - Import: a failed archive import showed the job's raw system or database text as its line. It now shows the archive's own sentence or 'The import stopped before the end.', with the text in the tooltip. - Portable copy: a SharePoint or Teams library synced with OneDrive's Sync button was not recognised as synchronised, - so a portable copy unpacked there kept its index inside it. Its data now goes to %LOCALAPPDATA%\Titano. + so a portable copy unpacked there kept its index inside it. Its data now goes to %LOCALAPPDATA%\Chronos. - Docs: the Windows README's recovery of a data folder created by an unelevated console run keeps the folder private. It no longer resets the permissions, which let every user read the TLS key and the temporary admin password, and it removes the account the service names, also when a standard user ran the console. @@ -531,14 +546,14 @@ commits follow Conventional Commits (release notes are generated from them by `T import, a scan) recorded its advice, warnings and analysed status for the old frames. Its Auto frame rate and warning count overwrote a newer light analysis, and the new photos were never analysed. It now records nothing in that case, unless a light analysis is already queued to replace what it records. It says so in the job log and - queues a light analysis of the photos as they are. When another Titano sharing the archive changed the photos and - this PC has not indexed them yet, the analysis no longer writes its old results over that Titano's in the shared + queues a light analysis of the photos as they are. When another Chronos sharing the archive changed the photos and + this PC has not indexed them yet, the analysis no longer writes its old results over that Chronos's in the shared project and sidecar. The next scan indexes the photos. - Sync: with Keep proxies offline, a proxy download made while the server was still drawing newly uploaded photos cached thumbnails or nothing for them, and marked the cache up to date. The editor then kept those thumbnails or blank frames until the frames changed again. The cache now stays stale until every photo, missing or damaged ones aside, has its proxy. It is downloaded again once the server's sequence changes. -- Sync: a title, tags, rating or notes taken from the server could hide photos that another Titano sharing this PC's +- Sync: a title, tags, rating or notes taken from the server could hide photos that another Chronos sharing this PC's archive had just added to the sequence. Scans then skipped the folder until it changed again. The next scan now indexes them. - Server (PostgreSQL): an analysis, image pass or render could record decode tiers or light statistics while a scan or @@ -569,7 +584,7 @@ commits follow Conventional Commits (release notes are generated from them by `T report endpoint then answered 404, and the next light analysis dropped the deep status. The report is now saved under the sequence's lock, and never over a more current one. A pass that leaves the saved report in place records that report's summary and warnings, not its own. -- Scans of an archive shared by two Titano indexes (a desktop and its server): one index could write a sidecar at the +- Scans of an archive shared by two Chronos indexes (a desktop and its server): one index could write a sidecar at the frames version the other held for other frames. The other index then took the frames as unchanged. When the versions match, a scan now also compares the frames themselves and writes changed ones one version past its row. - Orphans fix and scans: a photo that could not be read yet (held open by another program, no read permission, a diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 4a5cc5db..254f5b46 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -4,24 +4,24 @@ One line per decision: date · decision · alternative · reason. | Date | Decision | Alternative | Reason | |---|---|---|---| -| 2026-10-02 | The prototype dump `docs/reference/titano-prototype.md` was not supplied; algorithms are implemented from the brief's descriptions and the cited literature, with the §20.4 thresholds as acceptance tests. | Wait for the dump | Not available in the repository or uploads; the brief fully specifies behaviour and gates. | -| 2026-10-02 | Custom WPF theme dictionaries (`Titano.Ui/Themes`) implementing DESIGN.md tokens instead of `Application.ThemeMode` Fluent. | Fluent theme + overrides | DESIGN.md fixes exact colours/sizes; Fluent is still flagged experimental (WPF0001) and would need restyling of most controls anyway (§2.1 permits in-house dictionaries). | -| 2026-10-02 | Added shared WPF library `src/Titano.Ui` (theme, icons, controls, `Loc` markup extension) used by App, Uploader and Setup. | Duplicate resources per app | One visual system for three programs. | -| 2026-10-02 | Added `tests/Titano.Core.Windows.Tests` for WIC / Media Foundation / DXGI tests. | Put them in App.Tests | Keeps engine interop tests independent of the WPF app. | +| 2026-10-02 | The prototype dump `docs/reference/chronos-prototype.md` was not supplied; algorithms are implemented from the brief's descriptions and the cited literature, with the §20.4 thresholds as acceptance tests. | Wait for the dump | Not available in the repository or uploads; the brief fully specifies behaviour and gates. | +| 2026-10-02 | Custom WPF theme dictionaries (`Chronos.Ui/Themes`) implementing DESIGN.md tokens instead of `Application.ThemeMode` Fluent. | Fluent theme + overrides | DESIGN.md fixes exact colours/sizes; Fluent is still flagged experimental (WPF0001) and would need restyling of most controls anyway (§2.1 permits in-house dictionaries). | +| 2026-10-02 | Added shared WPF library `src/Chronos.Ui` (theme, icons, controls, `Loc` markup extension) used by App, Uploader and Setup. | Duplicate resources per app | One visual system for three programs. | +| 2026-10-02 | Added `tests/Chronos.Core.Windows.Tests` for WIC / Media Foundation / DXGI tests. | Put them in App.Tests | Keeps engine interop tests independent of the WPF app. | | 2026-10-02 | Localization areas extended with `Common`, `Jobs`, `Uploader`, `Setup`. | Fold into `Shell` | Smaller, owned files; same key scheme. | -| 2026-10-02 | Resources live in `i18n//[.].resx`, embedded into `Titano.Core` (satellite assemblies), base name `Titano.Core.i18n.`. Keys marked `invariant` need no translation. | Raw XML loader | Uses `ResourceManager` as the brief requires; satellites bundle into single-file publishes. | -| 2026-10-02 | Program icons (ICO) are generated at build time into `artifacts/icons` by `Titano.Tools make-icon`, invoked from `Directory.Build.targets`. | Commit generated ICO files | Brief forbids committing generated binaries and raster sources. | -| 2026-10-02 | In-house CRC-32 (`Titano.Core.Hashing.Crc32`). | System.IO.Hashing | That assembly is a NuGet package, not part of the shared framework. | +| 2026-10-02 | Resources live in `i18n//[.].resx`, embedded into `Chronos.Core` (satellite assemblies), base name `Chronos.Core.i18n.`. Keys marked `invariant` need no translation. | Raw XML loader | Uses `ResourceManager` as the brief requires; satellites bundle into single-file publishes. | +| 2026-10-02 | Program icons (ICO) are generated at build time into `artifacts/icons` by `Chronos.Tools make-icon`, invoked from `Directory.Build.targets`. | Commit generated ICO files | Brief forbids committing generated binaries and raster sources. | +| 2026-10-02 | In-house CRC-32 (`Chronos.Core.Hashing.Crc32`). | System.IO.Hashing | That assembly is a NuGet package, not part of the shared framework. | | 2026-10-02 | Windows projects target `net10.0-windows` (platform version 7.0) without a Windows SDK projection TFM; Windows 10 APIs are reached by P/Invoke/COM. | `net10.0-windows10.0.19041.0` | Avoids the CsWinRT projection; toasts use the in-window toast host plus tray balloon. | | 2026-10-02 | Test projects use an explicit `TestMain` entry point. | Top-level statements | Avoids the `Program` type clash with the server's top-level program. | -| 2026-10-02 | SQLite P/Invoke binding lives in `Titano.Data` with a library resolver (winsqlite3 on Windows, system libsqlite3 elsewhere for tests/dev); the Linux server still refuses SQLite at configuration time. | Binding in Core.Windows only | Lets repository tests run on Linux CI against both dialects. | +| 2026-10-02 | SQLite P/Invoke binding lives in `Chronos.Data` with a library resolver (winsqlite3 on Windows, system libsqlite3 elsewhere for tests/dev); the Linux server still refuses SQLite at configuration time. | Binding in Core.Windows only | Lets repository tests run on Linux CI against both dialects. | | 2026-10-02 | Client preferences needed before the database opens (language, theme, window placement) are stored in `settings.json` next to the database. | Settings table only | Language and theme must apply before the first window appears. | | 2026-10-02 | Server Windows-service hosting will use an in-house advapi32 P/Invoke host. | Microsoft.Extensions.Hosting.WindowsServices | That assembly is a NuGet package, not part of the shared framework. | | 2026-10-02 | Admin panel files are embedded resources served by an in-house middleware with ETags and SPA fallback. | ManifestEmbeddedFileProvider | Its manifest generator ships in a NuGet package. | -| 2026-10-02 | Container health check runs `Titano.Server --healthcheck` (in-process HTTP probe). | curl/wget in the image | Keeps the runtime image free of extra tools. | +| 2026-10-02 | Container health check runs `Chronos.Server --healthcheck` (in-process HTTP probe). | curl/wget in the image | Keeps the runtime image free of extra tools. | | 2026-10-02 | Container drops privileges with `setpriv` to PUID:PGID; `/data` is chowned, `/archive` only checked for write access. | Recursive chown of the archive | The archive may hold terabytes on NAS shares. | -| 2026-10-02 | Release workflow publishes to `RELEASES_REPO` (default `/titano-releases`) when the `RELEASES_TOKEN` secret exists, otherwise to this repository. | Fail without the token | First releases work before the public repository is set up. | -| 2026-10-02 | Release notes are generated by `Titano.Tools changelog` from `git log` piped on stdin. | Tool spawning git | Keeps the tool free of external process calls. | +| 2026-10-02 | Release workflow publishes to `RELEASES_REPO` (default `/chronos-releases`) when the `RELEASES_TOKEN` secret exists, otherwise to this repository. | Fail without the token | First releases work before the public repository is set up. | +| 2026-10-02 | Release notes are generated by `Chronos.Tools changelog` from `git log` piped on stdin. | Tool spawning git | Keeps the tool free of external process calls. | | 2026-10-02 | CI `dotnet format` gate checks whitespace formatting. | Full style/analyzer verification | Analyzer rules already fail the build (warnings as errors); style preferences stay suggestions. | | 2026-10-02 | Test runner exits 0 for a project with no tests and 2 when a filter matches nothing. | Always 2 | Empty projects during bootstrap are not failures; mistyped filters are. | | 2026-10-02 | COM via `[ComImport]` + explicit `ReleaseComObject`; flat APIs via `LibraryImport`. | `[GeneratedComInterface]` | Deterministic release keeps files unlocked; the apps are not trimmed. | @@ -30,7 +30,7 @@ One line per decision: date · decision · alternative · reason. | 2026-10-02 | Volume watcher uses a hidden top-level tool window plus 3 s polling. | Message-only window | Message-only windows do not receive broadcast WM_DEVICECHANGE. | | 2026-10-02 | Camera RAW is "native" via WIC only when the Raw Image Extension package is installed. | Decoder CLSID alone | The in-box RAW codec shares the CLSID but only reads embedded previews. | | 2026-10-02 | HEVC/AV1 decoder presence is detected with `MFTEnumEx`. | Store package names | Also covers OEM and hardware decoders. | -| 2026-10-02 | Math code lives in `src/Titano.Core/Math` with namespace `Titano.Core.Mathematics`. | `Titano.Core.Math` | That namespace would shadow `System.Math` in every `Titano.Core.*` file. | +| 2026-10-02 | Math code lives in `src/Chronos.Core/Math` with namespace `Chronos.Core.Mathematics`. | `Chronos.Core.Math` | That namespace would shadow `System.Math` in every `Chronos.Core.*` file. | | 2026-10-02 | CCT = McCamy refined to the nearest Planckian point (Krystek, CIE 1960 uv), valid for \|Duv\| ≤ 0.02. | Plain McCamy | McCamy alone misses the 100 K gate above ~9000 K. | | 2026-10-02 | Deflicker keeps (1 − strength)·ρ·S of a frame's deviation (ρ own Tukey weight, S window surviving fraction). | Blend by S only | S alone barely isolates outliers. | | 2026-10-02 | LOWESS uses the k nearest valid samples with bandwidth = farthest distance + one spacing. | Fixed half-width | Constant sample count at sequence edges. | @@ -61,7 +61,7 @@ One line per decision: date · decision · alternative · reason. | 2026-10-02 | Resampler keeps negative/overshoot values in linear light. | Clamp to 0–1 | Ringing stays within each kernel's exact bound; clamping happens at encode. | | 2026-10-02 | Codec fixtures (each < 12 KB) are generated by `tests/fixtures/codecs/make-fixtures.sh` with libjpeg-turbo/libtiff dev tools and committed. | Fetch at test time | Reference outputs must be stable; the tools are not build or runtime dependencies. | | 2026-10-02 | Installer payload "TPK1": deduplicated, deflate-ratio-bounded entries after the setup stub; footer aligned to 8 bytes and found before an Authenticode table so signing works before and after packing. | Spec fields only | Every offset is bounds-checked; signtool can append without breaking the payload. | -| 2026-10-02 | Setup runs `asInvoker` and relaunches itself elevated (`runas`) only for all-users installs; the unelevated parent starts Titano afterwards. | requireAdministrator | Titano never runs elevated. | +| 2026-10-02 | Setup runs `asInvoker` and relaunches itself elevated (`runas`) only for all-users installs; the unelevated parent starts Chronos afterwards. | requireAdministrator | Chronos never runs elevated. | | 2026-10-02 | Uninstaller self-removal via a %TEMP% copy started with `/CLEANUP`; running programs are only asked to close (never killed; silent mode exits 5). | MoveFileEx alone / kill | Per-user installs have no admin rights; user data safety. | | 2026-10-02 | Setup has its own `Program.Main` (silent and cleanup modes run without WPF) and is published with single-file compression (70 MB stub). | App.xaml-generated Main | Reliable exit codes; smaller installers. | | 2026-10-02 | SQLite: one in-process async write lock with `BEGIN IMMEDIATE`, shared-cache in-memory mode for tests, fixed-width ISO-8601 UTC text with microseconds and lower-case UUID text. | busy_timeout alone / epochs | Writers queue instead of failing; text order equals time order on both dialects. | @@ -69,7 +69,7 @@ One line per decision: date · decision · alternative · reason. | 2026-10-02 | Migrations: all pending ones in one transaction under `pg_advisory_xact_lock`. | One transaction per migration | Atomic and safe when several servers start together. | | 2026-10-02 | Case-insensitive search/sort via lower-cased `search_text`/`title_key` columns (and `COLLATE "C"` on PG). | ILIKE / NOCASE | Identical results on both dialects. | | 2026-10-02 | Job claim: `UPDATE … WHERE id = (SELECT … FOR UPDATE SKIP LOCKED) RETURNING` on PG; immediate transaction on SQLite. | Advisory locks | Exclusive under concurrency, as specified. | -| 2026-10-02 | One `JobEngine` in Titano.Data runs every long operation for both the client and the server: handlers per `JobKind`, progress persisted at most every 5 s, a failed persist (job no longer running) stops the handler, a shutdown leaves jobs running so the next start requeues them from their checkpoint. | Per-feature background loops | One queue, one cancel/pause/resume path and one crash-recovery rule everywhere. | +| 2026-10-02 | One `JobEngine` in Chronos.Data runs every long operation for both the client and the server: handlers per `JobKind`, progress persisted at most every 5 s, a failed persist (job no longer running) stops the handler, a shutdown leaves jobs running so the next start requeues them from their checkpoint. | Per-feature background loops | One queue, one cancel/pause/resume path and one crash-recovery rule everywhere. | | 2026-10-02 | Job throughput is a moving average over windows of at least 2 s. | Average since start | ETA follows speed changes (cache warm-up, network) without jitter. | | 2026-10-02 | Visual controls (card grid, filmstrip, charts, preview, curve editor) keep their layout and math in WPF-free classes; colours are theme brush keys re-resolved on theme switch; filmstrip, preview and time-axis charts never mirror in RTL (category charts lay out from the reading side since 2026-10-06, inside an element that stays left to right). | Math inside controls / brush properties | Testable on Linux; view models hold no brushes; time axes and images must not flip. | | 2026-10-02 | `VirtualizingWrapPanel` does its own keyboard navigation and recycling; the focused container is kept alive. | ListBox navigation | Direct targets, wrapping across rows; focus survives scrolling. | @@ -87,7 +87,7 @@ One line per decision: date · decision · alternative · reason. | 2026-10-02 | Shake and motion thresholds are judged in output pixels (stabilise above 0.3 px RMS). | Source pixels | That is what the viewer sees. | | 2026-10-02 | Automatic output stops at 4K UHD; no automatic stacking advice. | 8K / temporal-median denoise | 8K stays a manual choice; a median erases moving stars and stillness cannot be verified reliably. | | 2026-10-02 | Apply records a missing-data reason only where no advice exists; Optimise returns modules to Auto and only adds to the user's hero, exclusions, offset or output cap; a preset's own choices are stored as manual values, content-derived values stay Auto. | Overwrite | Manual values stay in force; re-analysis does not undo a chosen preset. | -| 2026-10-02 | Advisor namespace is `Titano.Core.Advice` (class `Advisor`). | `Titano.Core.Advisor` | A class named like its namespace needed an alias in every `Titano.Core.*` caller. | +| 2026-10-02 | Advisor namespace is `Chronos.Core.Advice` (class `Advisor`). | `Chronos.Core.Advisor` | A class named like its namespace needed an alias in every `Chronos.Core.*` caller. | | 2026-10-02 | CI also force-pushes each same-repository PR run's screenshots as one commit to the `ci-screenshots` branch (separate job, only it has `contents: write`). | Artifact only | Artifacts need an authenticated download; a branch can be fetched with plain git for visual review. The branch never merges and holds a single commit. | | 2026-10-02 | Export fps is the encoded grid; `Timing.FrameRate` is the playback rate (source frames per video second, default = export fps). Durations are quantised to output periods on rounded 90 kHz boundaries; whole frames are sampled at the period centre. | One fps / free durations | Presets keep their meaning, Interpolated can synthesise slow motion, AVI and image sequences stay exact. | | 2026-10-02 | Adaptive timing is proportional up to 3× the median interval; longer gaps show for 3 + log2(r/3) frames (max 5); pauses ≥ 20× median and ≥ 120 s become a 0.2 s cut. Interpolated fills gaps of up to 3 missing/excluded frames. | Fixed clamps | Bursts stay faithful and long gaps cannot stall the video. | @@ -112,15 +112,15 @@ One line per decision: date · decision · alternative · reason. | 2026-10-02 | Desktop: the archive engine uses WIC first, then managed decoders; the last archive is reopened at start (relinking a moved one, finishing interrupted renames) and incrementally rescanned every 10 minutes; Welcome and Library create/adopt through the archive engine and queue a full scan; failures become a toast. | File-system watchers / no periodic scan | BRIEF §7: polling by mtime/size plus manual rescan. | | 2026-10-02 | Desktop thumbnails: widths rounded up to 64 px, LRU of 2000 items, at most cores/2 (2–6) decodes, "no image" cached but failures not, a decode is cancelled when its card scrolls away; job list updates batched to ~10 Hz keeping the latest per job. | Fixed size per card / update per event | Fewer decodes, bounded memory, a free UI thread during fast renders. | | 2026-10-02 | Server sign-in in the client: an unknown certificate fingerprint is confirmed before any password is sent, a changed certificate never receives the saved token, the token is stored only DPAPI-encrypted. | Trust on login | BRIEF §14.2. | -| 2026-10-02 | The client update check reads the latest non-draft, non-prerelease GitHub release of `TitanoReleasesRepo` and only opens its page; Clear cache deletes only folders carrying a `.titano-cache` marker, after confirmation; `--capture` runs on a temporary data folder with fake server, encoders and update check. | Download updates / clear any folder / real data | No external processes; never delete user data; CI never touches user data. | -| 2026-10-02 | The server registers the archive engine in `ArchiveModule` (ingest, asset locator, job handlers through `IJobHandlerProvider`) and opens its archive through `ArchiveService.AdoptAsync`; `ServerHost.Build` keeps the registration callback so tests can substitute fakes, and still refuses to start without ingest and locator. | Hard-wired registrations / DB row only | Tests stay isolated; the archive always has `.titano/archive.json`, so scans and ingest work from the first start. | +| 2026-10-02 | The client update check reads the latest non-draft, non-prerelease GitHub release of `ChronosReleasesRepo` and only opens its page; Clear cache deletes only folders carrying a `.chronos-cache` marker, after confirmation; `--capture` runs on a temporary data folder with fake server, encoders and update check. | Download updates / clear any folder / real data | No external processes; never delete user data; CI never touches user data. | +| 2026-10-02 | The server registers the archive engine in `ArchiveModule` (ingest, asset locator, job handlers through `IJobHandlerProvider`) and opens its archive through `ArchiveService.AdoptAsync`; `ServerHost.Build` keeps the registration callback so tests can substitute fakes, and still refuses to start without ingest and locator. | Hard-wired registrations / DB row only | Tests stay isolated; the archive always has `.chronos/archive.json`, so scans and ingest work from the first start. | | 2026-10-02 | Admin cookies are `Secure`: cookie sign-in over plain HTTP only from loopback, `/admin` over HTTP from other hosts redirects to HTTPS; CSRF token derived from the session token's hash, cookie WebSocket upgrades must be same-origin. | Drop `Secure` / random double-submit cookie | BRIEF §14.2; a planted cookie pair cannot forge the token. | | 2026-10-02 | Sign-in rate limit and lockout live in memory and apply to unknown names too; the generated first admin password goes to an owner-only file deleted once an admin sets a password; minimum password length 10; admin-created users must change their password; resets give a temporary password. | DB columns / log the password / email links | No user enumeration; secrets never logged; no mail infrastructure. | -| 2026-10-02 | API errors are localised through `Accept-Language` (fallback `TITANO_LANG`); ETags on sequences, manifests and originals (SHA-256) with `If-Match` doubling as the expected settings version. | English only / version in body only | Every user-visible string is a resource; standard HTTP caching and concurrency. | -| 2026-10-02 | Deleting a sequence moves its folder to `/.titano/trash/` (with dry run); upload completion is synchronous and idempotent, survives client disconnect, and a failed ingest returns the upload to receiving (503). | Erase files / async commit job | User data rule 8 and undo; clients need the frame id at once and retries stay safe. | +| 2026-10-02 | API errors are localised through `Accept-Language` (fallback `CHRONOS_LANG`); ETags on sequences, manifests and originals (SHA-256) with `If-Match` doubling as the expected settings version. | English only / version in body only | Every user-visible string is a resource; standard HTTP caching and concurrency. | +| 2026-10-02 | Deleting a sequence moves its folder to `/.chronos/trash/` (with dry run); upload completion is synchronous and idempotent, survives client disconnect, and a failed ingest returns the upload to receiving (503). | Erase files / async commit job | User data rule 8 and undo; clients need the frame id at once and retries stay safe. | | 2026-10-02 | Quota = used + pending uploads + new size, checked at start and at commit (render outputs not counted); the duplicate short-circuit matches a hash anywhere, preferring the target sequence; at most 8 concurrent chunk uploads per user (429), bodies capped at 1 MiB except chunks. | Committed bytes only / per-sequence only / request-rate limiter | Parallel uploads cannot slip past the quota; the brief's wording; simplest effective limit. | | 2026-10-02 | Render jobs never run on the server engine: render nodes claim them by codec and resolution, report failures, and a job fails after losing its node 5 times. | Managed rendering on the server | No server render handler yet. | -| 2026-10-02 | Server settings page writes only edited keys to `server.json`; environment-fixed settings are locked; restart-only keys are flagged. Windows service: LocalSystem, automatic start, name `TitanoServer`. Admin panel: strict CSP (SVG charts, no inline styles); light and dark themes (2026-10-06, toggle in the header). | Rewrite the whole file / theme toggle | Secrets never written; DESIGN.md wins over the mockup toggle. | +| 2026-10-02 | Server settings page writes only edited keys to `server.json`; environment-fixed settings are locked; restart-only keys are flagged. Windows service: LocalSystem, automatic start, name `ChronosServer`. Admin panel: strict CSP (SVG charts, no inline styles); light and dark themes (2026-10-06, toggle in the header). | Rewrite the whole file / theme toggle | Secrets never written; DESIGN.md wins over the mockup toggle. | | 2026-10-02 | Migrations are numbered without gaps (0001 initial, 0002 archive index, 0003 server uploads). | Keep 0005 | Parallel workstreams picked numbers to avoid collisions; renumbered at merge. | | 2026-10-02 | `xaml-lint` checks keyed value resources against the property type (GridLength for column/row sizes, Thickness, CornerRadius, Double). | Rely on Windows smoke tests | A Double used as a column width compiles and only fails when the template loads on Windows; the lint now fails on Linux too. | | 2026-10-02 | Languages with more plural forms add `key.few` / `key.many` beside the English `key.one` / `key.other`; `i18n check` accepts them, compares their placeholders with English `other` and lets any plural form omit the count. | One English-shaped key set for every language | "Rendered once" style forms cannot cover Russian 21 or Arabic 3–10 otherwise. | @@ -133,16 +133,16 @@ One line per decision: date · decision · alternative · reason. | 2026-10-03 | `POST /jobs` splits a batch into one job per preset; a render node fails a batch job instead of rendering only the main preset; a node registering again requeues jobs its previous run abandoned. Proxies have no hash: fetched whole on retry; originals are resumed and SHA-256 verified. | Nodes render batches | One output per job keeps progress, retries and uploads simple. | | 2026-10-03 | A render on the server ignores the client's export folder and always writes to the sequence's `exports/`. | Honour the folder | The server never writes outside its archive. | | 2026-10-03 | Sync state lives in a client-side `sync_links` table (one row per server sequence, linked to its local copy); server-only sequences appear on the Server screen and, since 2026-10-06, in the Library as remote cards. | Columns on `sequences` | One local copy per server; server-only rows need a home. The server-connected Library mode stays with the Library. | -| 2026-10-03 | Uploads create the server sequence by sending the first original under the session key `titano-sync:`; every original is re-hashed before sending and a mismatch fails the job. | `POST /sequences` | The server cannot store uploads into an empty sequence created that way; originals are sacred. | -| 2026-10-03 | Sync conflicts: any field changed differently on both sides is a conflict settled against the versions shown (Keep mine / Take server confirm the differing settings; Save both takes the server's and keeps this PC's settings as `.titano/project.this-pc-