sync: mirror deployed github repo (chains + sanitized bridge), keep GitLab CI

Make this monorepo's tracked tree identical to the deployed github repo
(github.com/pezkuwichain/pezkuwi-DKS): all RC/AH/People runtimes and framework
carry the mainnet fixes (incl. U128CurrencyToVote everywhere, so the staking
election stall cannot recur), and tools/usdt-bridge matches the current,
public-safe custody tooling (real config/deploy units gitignored, secret-file
locations and server IPs stripped, sanitized *.example templates committed).

Only exception to the mirror: GitLab-native CI is preserved (.gitlab-ci.yml and
.gitlab/), to be rebuilt to match the github CI pipeline in a follow-up.
This commit is contained in:
Satoshi Qazi Muhammed committed 2026-07-24 11:42:50 -07:00
1 parent 82543bdfab
commit d285d59108
736 files changed
+15082 -16359

No files matched your search

@@ -1,53 +0,0 @@
[Unit]
Description=PezbridgeBot - USDT bridge automation-key allowance renewal notifier (holds no key)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=pezbridgebot
Group=pezbridgebot
WorkingDirectory=/opt/pezbridgebot/data
ExecStart=/opt/pezbridgebot/bin/pezbridge-bot
Environment=PEZBRIDGE_CONFIG=/opt/pezbridgebot/bin/pezbridge_bot_config.json
Environment=RUST_LOG=info
EnvironmentFile=/etc/pezbridgebot/telegram_token.env
Restart=on-failure
RestartSec=10
# --- Hardening ---
# Deployed 2026-07-13 on NEW-10 (89.116.25.180), simplified 2026-07-14: this process used to
# also hold Noter's (Validator_04's) mnemonic via LoadCredential so it could automate 1-of-3
# required signatures. That stopped being worth the risk once pwap-web shipped a real signing
# UI (any of the 5 signers can now approve directly with their own wallet extension at
# /multisig/pending) - the bot-held key only ever saved "2 humans click instead of 3", not
# enough to justify a private key living on a server. Noter's mnemonic was removed from this
# host entirely; this unit now only reads chain state and sends Telegram messages - it has no
# LoadCredential, no signing capability, and nothing worth exfiltrating. The hardening below is
# kept anyway as good baseline practice, not because there's a key to protect anymore.
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes
RestrictSUIDSGID=yes
RemoveIPC=yes
LockPersonality=yes
RestrictRealtime=yes
RestrictNamespaces=yes
MemoryDenyWriteExecute=yes
SystemCallFilter=@system-service
SystemCallArchitectures=native
CapabilityBoundingSet=
AmbientCapabilities=
ReadWritePaths=/opt/pezbridgebot/data
UMask=0077
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,49 @@
# PezbridgeBot — example systemd unit.
# Read-only allowance-renewal notifier: reads chain state and sends Telegram alerts when the
# automation-key allowance needs a 3-of-5-signed renewal. Holds NO signing key and cannot submit
# anything. Copy to /etc/systemd/system/, fill in <PLACEHOLDERS>, provide the Telegram token
# ONLY via the EnvironmentFile below (never in the repo).
[Unit]
Description=PezbridgeBot - allowance renewal notifier (holds no key)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=<service-user>
Group=<service-group>
WorkingDirectory=<WORKDIR>
ExecStart=<BIN_DIR>/pezbridge-bot
Environment=PEZBRIDGE_CONFIG=<CONFIG_PATH>/pezbridge_bot_config.json
Environment=RUST_LOG=info
EnvironmentFile=<SECRETS_DIR>/telegram_token.env
Restart=on-failure
RestartSec=10
# Hardening (recommended baseline)
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes
RestrictSUIDSGID=yes
RemoveIPC=yes
LockPersonality=yes
RestrictRealtime=yes
RestrictNamespaces=yes
MemoryDenyWriteExecute=yes
SystemCallFilter=@system-service
SystemCallArchitectures=native
CapabilityBoundingSet=
AmbientCapabilities=
ReadWritePaths=<WORKDIR>
UMask=0077
[Install]
WantedBy=multi-user.target
@@ -1,60 +0,0 @@
[Unit]
Description=usdt-bridge listen-all - USDT/wUSDT listener; auto-pays sub-cap swaps via the bounded automation-key allowance, everything else queues for 3-of-5
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=usdtbridge
Group=usdtbridge
WorkingDirectory=/opt/usdtbridge/data
ExecStart=/opt/usdtbridge/bin/usdt-bridge --config /opt/usdtbridge/bin/bridge_config.json listen-all
Environment=RUST_LOG=info
EnvironmentFile=/etc/pezbridgebot/telegram_token.env
EnvironmentFile=-/etc/usdtbridge/automation_key.env
Restart=on-failure
RestartSec=10
# --- Hardening ---
# Deployed 2026-07-14 on NEW-10 (89.116.25.180), same UTIL bucket as pezbridge-bot (no
# consensus/fund-critical services here - see dks-ci-runners/vps2-dev-decommission-status
# memory for the placement convention). UPDATED 2026-07-14: this process now also loads the
# automation key's mnemonic (from a separate, tighter-scoped EnvironmentFile than the Telegram
# token) and can sign+submit Assets.transfer_approved on both chains - but ONLY within the
# multisig's pre-approved delegated allowance, capped per-tx (max_single_tx) and per rolling 24h
# window (auto_pay_daily_cap) with a circuit breaker on burst consumption. It can never mint,
# burn, set_team, or transfer_ownership - those stay exclusively multisig (3-of-5), same as
# before. Worst case of this key being compromised is bounded by whatever allowance + daily cap
# remain at the time, not unbounded custody - a materially different (and much smaller) risk
# tier than the legacy single-key bot this whole migration replaced. Hardening kept as-is; the
# automation_key.env file itself is root:usdtbridge 0640, separate from the Telegram token file
# so a Telegram-token leak alone can never expose the signing key. The leading "-" on that
# EnvironmentFile line is required (not decorative): the file does not exist until an operator
# deliberately provisions it, and the unit must still start cleanly without it, matching the
# code's own AUTOMATION_KEY_MNEMONIC-unset fallback (100% manual, auto-pay simply inactive).
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes
RestrictSUIDSGID=yes
RemoveIPC=yes
LockPersonality=yes
RestrictRealtime=yes
RestrictNamespaces=yes
MemoryDenyWriteExecute=yes
SystemCallFilter=@system-service
SystemCallArchitectures=native
CapabilityBoundingSet=
AmbientCapabilities=
ReadWritePaths=/opt/usdtbridge/data
UMask=0077
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,50 @@
# usdt-bridge listener — example systemd unit.
# Detects USDT/wUSDT deposit/withdrawal events; auto-pays only sub-cap swaps via a bounded,
# multisig-delegated automation-key allowance, and queues everything else for 3-of-5 approval.
# It can never mint/burn/set_team/transfer_ownership — those stay exclusively with the multisig.
# Copy to /etc/systemd/system/, fill in <PLACEHOLDERS>, and provide secrets ONLY via the
# EnvironmentFile(s) below (never in the repo): BRIDGE_SEED_MNEMONIC / AUTOMATION_KEY_MNEMONIC.
[Unit]
Description=usdt-bridge listener
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=<service-user>
Group=<service-group>
WorkingDirectory=<WORKDIR>
ExecStart=<BIN_DIR>/usdt-bridge --config <CONFIG_PATH>/bridge_config.json listen-all
Environment=RUST_LOG=info
EnvironmentFile=<SECRETS_DIR>/telegram_token.env
EnvironmentFile=-<SECRETS_DIR>/automation_key.env
Restart=on-failure
RestartSec=10
# Hardening (recommended baseline)
NoNewPrivileges=yes
ProtectSystem=strict
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes
RestrictSUIDSGID=yes
RemoveIPC=yes
LockPersonality=yes
RestrictRealtime=yes
RestrictNamespaces=yes
MemoryDenyWriteExecute=yes
SystemCallFilter=@system-service
SystemCallArchitectures=native
CapabilityBoundingSet=
AmbientCapabilities=
ReadWritePaths=<WORKDIR>
UMask=0077
[Install]
WantedBy=multi-user.target