v2.0.0 — AnyReality default + rebrand
[2.0.0] — 2026-07-19
Project renamed to
anyreality-resi-stack(formerlyreality-resi-stack). GitHub automatically redirects old repository URLs, so existingcurl | bashinstall commands keep working. Runtime filesystem paths (/etc,/var/lib,/usr/local/lib,/var/backups), systemd unit names, the backup script/archives, and the environment variable (nowANYREALITY_RESI_STACK_REF, with the legacyREALITY_RESI_STACK_REFstill honored) are all renamed to theanyreality-resi-stackprefix. Upgrading a v1.x host runs a migration phase (phase_migrate_legacy_paths) that moves the oldreality-resi-stackdirectories to the new prefix and retires the old backup unit, so existing secrets, usage state, backups, and therefore already-imported clients are preserved.Breaking — default protocol changed. Fresh installs now default to AnyReality (AnyTLS + Reality) instead of VLESS + Reality + xtls-rprx-vision. Existing servers keep their current protocol until the installer is re-run. AnyReality is sing-box-only; if you rely on Clash/mihomo clients, install (or re-run) with
--protocol vless-visionto stay on the legacy protocol. Because AnyReality authenticates with a password rather than a UUID/flow and the default subscription file changed fromprofile.yamltoprofile.json, clients must be re-imported after switching protocols.
Changed
- AnyTLS + REALITY (AnyReality) is now the default protocol. New installs deploy a sing-box
anytlsinbound fronted by Reality, authenticated with a per-server password (ANYTLS_PASSWORDinsecrets.env). AnyTLS's custom padding hardens against TLS-in-TLS fingerprinting while Reality keeps the certless server camouflage. Still no domain or TLS certificate required. - The default subscription profile is now a full sing-box client config served as
profile.json(mixed inbound on127.0.0.1:2080, AnyReality outbound, domain-based routing in dual-node mode); the legacy Clashprofile.yamlis served only under--protocol vless-vision. - Runtime layout renamed to the
anyreality-resi-stackprefix:/etc/anyreality-resi-stack,/var/lib/anyreality-resi-stack,/usr/local/lib/anyreality-resi-stack,/var/backups/anyreality-resi-stack,/opt/anyreality-resi-stack, thebackup-anyreality-resi-stack.shscript andanyreality-resi-stack-*.tar.gzarchives, and theanyreality-resi-stack-backupsystemd units. A newphase_migrate_legacy_pathsinstaller phase migrates existingreality-resi-stackhosts in place;uninstall.shalso cleans up either prefix.
Added
--protocol anytls-reality(default) /--protocol vless-vision(legacy) selects the inbound protocol. VLESS + Reality + xtls-rprx-vision remains fully supported for Clash/mihomo users, which cannot parse AnyReality.- AnyReality templates:
templates/singbox/11_anytls-reality_inbounds.json.tmpl(server inbound),templates/singbox-client/anytls-outbound.json.tmpl, and full sing-box client configstemplates/singbox-client/client-single.json.tmpl/client-dual.json.tmpl(dual-node smart routing via sing-boxrouterules). - Installers predating AnyReality mint and append an
ANYTLS_PASSWORDto an existingsecrets.envon re-run, so switching to--protocol anytls-realityworks without regenerating the UUID or Reality keypair. Re-running with a different protocol drops the stale inbound and profile file to avoid port collisions or format mismatches.
Fixed
- Leaf subscription accounting now samples interface counters while holding the state lock, preventing concurrent requests/background polling from applying stale samples out of order.
- Aggregator usage cache writes now use per-thread temporary files plus atomic replace, avoiding
.tmpcollisions during concurrent refreshes. - Backup archives now exclude hidden runtime
.tmpstate/cache files and placemanifest.txtat the archive root. - Leaf subscription accounting now keeps usage fresher by sampling in the background every
USAGE_POLL_INTERVAL_SECONDSseconds instead of only updating when a client pulls the subscription URL. - Leaf subscription accounting now supports provider billing reset days via
BILLING_CYCLE_DAY, so plans that reset on the 11th do not roll over on the 1st by mistake. - Leaf subscription accounting now counts bytes already present in the current boot on first state creation by default (
COUNT_CURRENT_BOOT_ON_INIT=true), while still supporting baseline-only mode andUSAGE_OFFSET_BYTEScalibration. - Leaf accounting now carries usage forward across reboots or NIC counter rollovers by adding the new boot's current counter instead of silently dropping it.
- Aggregator subscription accounting now refreshes the leaf status cache in the background via
REMOTE_POLL_INTERVAL_SECONDS, keeping usage cards warm even before the next client request. - Re-running the installer with an existing
secrets.envre-exports the reused UUID, Reality keys, subscription token, and short ID before rendering templates. --with-subscriptionand--with-aggregatorare now mutually exclusive, and aggregator installs fail early unless the residential-node template variables are provided.
Added
ANYREALITY_RESI_STACK_REFlets remote-piped installs fetch a specific branch or tag while defaulting tomain.- Standard-library
unittestcoverage for leaf accounting and aggregator cache fallback, wired intomake testand GitHub Actions. make mdchecknow falls back tonpx --yes markdown-link-checkwhen the binary is not installed globally, retries transient link-checker failures once, and GitHub Actions runs the same Markdown link gate.
Security
- Aggregator leaf-status polling now caps each remote status response with
MAX_REMOTE_STATUS_BYTES(default 64 KiB) before parsing JSON. - Subscription systemd units now use basic sandboxing (
NoNewPrivileges,PrivateTmp,ProtectHome,ProtectSystem=strict) and only keep/var/lib/anyreality-resi-stackwritable. - Config backups now exclude runtime usage/cache state, set backup directory permissions to
700, and write archives as600.