Files
apxtri/documents/11-CHANGELOG_INIT.md
T
2026-08-13 14:57:03 +00:00

5.1 KiB
Executable File

Changelog - init.sh

Version 1.1.0 - 2026-04-12

New Architecture Restructuring

Major update to the directory structure and webapp discovery system.

Directory Structure Changes

  1. New Path Convention

    • Code: /opt/apxtowns/{TOWN}.{NATION}/apxtri/
    • Data: /var/lib/apxtowns/{TOWN}.{NATION}/{tribe}/
    • Example: /opt/apxtowns/dev.test/apxtri/ + /var/lib/apxtowns/dev.test/dev/
  2. Per-Tribe Data Namespaces

    • Each tribe now has its own objects/ and wwws/ directories
    • Webapps stored in tribe namespace, not in apxtri core
  3. Web Application Discovery

    • Webapps auto-discovered from {tribe}/wwws/ directories
    • Routes: path-based /{app}/* or custom DNS in appconf.json
    • Caddy auto-generates routes from discovered webapps

New Features

  1. Auto-Generated API Documentation

    • apidoc auto-generated on server startup
    • Output to webapp runtime directory
    • Skip if already generated (dev mode)
  2. Auto-Update via Git

    • setup/update.sh scans all package.json files
    • Compares local vs remote versions
    • Pulls updates from repository.url
  3. Per-Tribe Backup Configuration

    • backupObjects[] in tribe.json specifies what to backup
    • setup/backup.sh reads from tribe config
    • Daily backup at 1:00 AM

Removed Features

  1. WCO (Web Component Objects)

    • Removed from codebase
    • models/Wwws.js simplified
    • routes/wwws.js updated (WCO routes removed)
  2. Old Path References

    • Removed farm-test directory structure
    • Removed apxtri/objects/ and apxtri/wwws/
    • All data now per-tribe

Migration Notes

For existing installations:

  1. Backup all data
  2. Run setup/init.sh --clean
  3. Reinstall with new path structure
  4. Restore data to appropriate tribe namespaces

Version 1.0.0 - 2024-10-29

Initial unified installation script

Features

  1. Unified dev/prod installation

    • Both modes use systemd for process management
    • Auto-detection based on NATION="test" (dev) vs other (prod)
  2. Automatic crontab configuration

    • Update: Daily at 03:00 AM, compares versions, auto-updates
    • Backup: Daily at 01:00 AM, rolling 7-day backup
  3. Intelligent domain management

    • Dev: Auto-generates admin.apxtri.{TOWN}.test
    • Prod: Required domain with DNS verification
  4. Auto port detection

    • Finds first free port starting from 3000
    • Avoids conflicts on multiple installations
  5. Dual log output

    • All logs to journalctl AND files
    • Dev: /var/lib/apxtowns/data/apxtri/logs/dev.log
    • Prod: /var/lib/apxtowns/data/apxtri/logs/prod.log
  6. Systemd service management

    sudo systemctl start apxtri@town.nation      # Start service
    sudo systemctl stop apxtri@town.nation       # Stop service
    sudo systemctl restart apxtri@town.nation    # Restart
    sudo systemctl status apxtri@town.nation     # Check status
    journalctl -f -u apxtri@town.nation          # Follow logs
    

Version 1.2.0 - 2026-05-14

HTTP-Only Installation (Major Change)

Installation now only configures HTTP on port 80. TLS/HTTPS is deferred to the web interface.

Removed Features

  1. Caddy TLS automation removed from init.sh and Caddy.js

    • No more port 443 in Caddy config
    • No more Let's Encrypt ACME certificate provisioning on startup
    • No more TLS automation block in generated Caddy config
  2. SSL/HTTPS deferred to web UI

    • HTTPS activation will be handled via a Node.js endpoint in a future release
    • The web interface will trigger certificate provisioning when the user is ready

New Flags

  1. --domain <domain>

    • Sets the public domain name for the town
    • Used for routing in Caddy config and display in the startup message
    • In dev mode, auto-generated as admin.{TOWN}.{NATION}
    • In prod mode, must be provided manually
  2. --trusted-proxy-ips <ip>

    • Configures PROXY protocol v2 support for reverse proxy setups
    • Accepts comma-separated IPs (e.g., 192.168.1.3,10.31.251.1)
    • IPs are converted to CIDR format (/32) for Caddy 2.11+ listener_wrappers[].allow

Bug Fixes

  1. apidoc template rendering — Fixed conf.json → appconf.json filename in Mustache rendering block (lines 345-355). The condition was checking for the old filename, so {{NODEPATH}} was never replaced.

  2. Startup message URL — Fixed from https:// to http:// and corrected the fallback domain format.

  3. Data skeleton copy — Added missing copy of setup/skeletons/newtribe/data/ to tribe data directory during installation.

Caddy.js Changes

  • Listen is now always [":80"] (removed MODE-dependent port selection)
  • TLS automation block removed entirely
  • listener_wrappers with proxy_protocol kept for PROXY protocol support
  • PROXY protocol format updated to Caddy 2.11+ (allow with CIDR in listener_wrappers)

Usage

# Installation interactive
./init.sh

# Installation automatisée
./init.sh --town farm --nation test

# Réinstallation propre
./init.sh --clean

Support

Discord: https://discord.gg/89Ucsnej Repository: https://gitea.ndda.fr/apxtri/apxtri