No description
  • Python 55.4%
  • C++ 18.6%
  • JavaScript 8.7%
  • QML 5.8%
  • Java 5.7%
  • Other 5.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
mbulatov 578236afdc
Some checks failed
CI / tests (push) Successful in 2m3s
CI / clients (push) Failing after 56s
CI / docker (push) Successful in 49s
CI / compatibility (push) Successful in 1m24s
CI / release (push) Has been skipped
CI / deploy (push) Successful in 21s
Require Qt checksums before using direct dependency downloads
2026-11-27 12:08:36 +03:00
.forgejo Require Qt checksums before using direct dependency downloads 2026-11-27 12:08:36 +03:00
.vscode update 2026-10-19 20:50:51 +03:00
app-client Connect through the first ready VPN profile and add access rules 2026-11-27 11:48:33 +03:00
design Refine web and native visuals with shared typography and icon actions 2026-10-20 22:48:35 +03:00
docs Preserve fragmented game UDP on Linux and Android 2026-10-21 13:53:17 +03:00
scripts Add configurable offline GeoIP routing to native clients 2026-10-21 02:14:33 +03:00
src/webshare Connect through the first ready VPN profile and add access rules 2026-11-27 11:48:33 +03:00
tests Connect through the first ready VPN profile and add access rules 2026-11-27 11:48:33 +03:00
tools/ssh3-helper Add SSH3 reserve management with password authentication and safe SSH failover 2026-10-28 12:01:37 +03:00
.dockerignore Add connection quality, functional probes, safe updates and verified backups 2026-10-20 12:13:25 +03:00
.env.example next stage 2026-05-31 11:42:10 +03:00
.gitignore update 2026-10-19 20:50:51 +03:00
.gitmodules Expose scoped traffic charts and align panel styling 2026-10-19 23:54:26 +03:00
docker-compose.prod.yml next stage 2026-05-31 11:42:10 +03:00
docker-compose.yml next stage 2026-05-31 11:42:10 +03:00
Dockerfile Add SSH3 reserve management with password authentication and safe SSH failover 2026-10-28 12:01:37 +03:00
pyproject.toml Add managed device security, signed releases and staged operations 2026-10-20 13:33:10 +03:00
README.md Connect through the first ready VPN profile and add access rules 2026-11-27 11:48:33 +03:00

WebShare

Small dependency-free VPN/proxy access panel inspired by the older webvpn project.

The old project mixed a public UI, NextAuth, FastAPI, PostgreSQL, Redis, Celery, SSH deployment, traffic collection and protocol-specific logic in one large system. This implementation keeps the useful domain model, but makes the first version intentionally boring:

  • one Python process;
  • SQLite storage;
  • no Node, Redis, PostgreSQL or task queue required;
  • built-in static web UI;
  • explicit protocol adapters for client config generation;
  • optional SSH/Docker deployment and monitoring;
  • QR code rendering for client configs;
  • web backup export/import without operation logs;
  • deployable with plain Python or Docker.

It is meant as a clean base that can grow. Remote SSH deployment and live traffic collectors can be added behind the existing deployment/client boundaries without changing the HTTP surface.

Quick Start

cd /home/acnas/projects/my/webshare
python3 -m src.webshare

Open:

http://127.0.0.1:8080

Default local admin:

username: admin
password: admin123

Change the password after the first login.

Configuration

Environment variables:

Variable Default Description
WEBSHARE_BIND 127.0.0.1 HTTP bind address
WEBSHARE_PORT 8080 HTTP port
WEBSHARE_HOST_PORT 8081 Docker host port mapped to container 8080
WEBSHARE_DB ./data/webshare.sqlite3 SQLite database path
WEBSHARE_SECRET generated on start HMAC token secret
WEBSHARE_ADMIN_USERNAME admin Seed admin username
WEBSHARE_ADMIN_EMAIL admin@webshare.local Seed admin email
WEBSHARE_ADMIN_PASSWORD admin123 Seed admin password
WEBSHARE_TOKEN_TTL_SECONDS 86400 Session lifetime
WEBSHARE_MONITOR_INTERVAL_SECONDS 60 Automatic SSH/Docker server check interval; 0 disables it
WEBSHARE_MONITOR_INITIAL_DELAY_SECONDS 10 Delay before the first automatic check
WEBSHARE_APP_REPOSITORY_URL https://forgejo.acnas.net/app/webshare Forgejo repository used by the web panel Apps download links
WEBSHARE_APP_RELEASE_CHECK_TIMEOUT_SECONDS 4 Timeout for checking the latest Forgejo release
WEBSHARE_GEOIP_CITY_DB /app/data/geoip/GeoLite2-City.mmdb in Docker Optional free MMDB City database path for client location lookup
WEBSHARE_GEOIP_ASN_DB /app/data/geoip/GeoLite2-ASN.mmdb in Docker Optional free MMDB ASN database path for ASN/organization lookup
WEBSHARE_GEOIP_AUTO_DOWNLOAD true in Docker Download missing GeoIP databases on startup
WEBSHARE_GEOIP_CITY_URL https://cdn.jsdelivr.net/npm/geolite2-city/GeoLite2-City.mmdb.gz City database download URL
WEBSHARE_GEOIP_ASN_URL empty Optional ASN database download URL
WEBSHARE_GEOIP_DOWNLOAD_TIMEOUT_SECONDS 30 GeoIP download timeout

SSH3 reserve for server management

In Серверы → Настройки сервера → Доступ · SSH / SSH3, choose Автоматически: SSH → SSH3, Только SSH, or Только SSH3. Existing servers keep SSH until explicitly configured. SSH3 uses HTTP/3 over UDP; its port is independent of the TCP SSH port. An existing endpoint such as https://vpn.example.com:443/ssh3-term needs its hostname, UDP port and URL path. Choose inherited SSH credentials, a separate password, or a separate unencrypted private key. SSH3 also recognizes the user's ordinary ~/.ssh/authorized_keys. Use Проверить SSH / SSH3 to check both channels independently; the task result shows both outcomes and the server card shows the selected channel and check time.

Развернуть резерв SSH3 installs a separate webshare-ssh3.service with systemd autostart, on Linux amd64/arm64 with root or passwordless sudo. The panel ships server binaries built from upstream SSH3 v0.1.7 using current Go and libxcrypt so modern Linux password hashes, including yescrypt, work. The target does not need outbound access to GitHub. A new self-signed certificate is pinned through the already authenticated management channel. Public certificates use normal CA/hostname validation; explicit SHA256 certificate pinning is available for existing self-signed endpoints. Certificate changes require updating the pin through a trusted channel. No accept-any-certificate mode is offered.

Existing SSH3 services are not replaced. If one is already installed, enter its settings and select Auto or SSH3 instead. Automatic installation requires a free UDP port; an active UFW is updated, while an external firewall must allow that port. Installation failures clean up only the new WebShare-owned service.

Listener validation includes the SSH TCP port, enabled SSH3 UDP endpoints, VPN listeners and additional Reality/XHTTP publications. It runs when either side is created/edited and during backup import. Records pending deletion retain their ports. Queued SSH3 installation reserves its port too; a pinned SSH3 endpoint remains reserved when switching the preferred transport back to SSH. Management settings wait for an in-progress SSH3 installation, so its reservation cannot move while the installer still uses the old endpoint. TCP and UDP can share a port number, and an explicit SSH3 host override is checked against that endpoint rather than the local server. Known host aliases and duplicate records with different SSH ports cannot bypass these checks.

Existing conflicts appear on server cards with the owners and transport. The SSH3 form suggests a port available in the panel inventory; choosing it is an explicit action, and existing endpoints are never silently moved. A configured port is not proof that SSH3 is installed: use the independent channel check. Before replacing runtime files and immediately before Compose recreation, a read-only host preflight checks running Docker publications (including DNAT without docker-proxy) and other TCP/UDP sockets. The selected Compose project's own ports may be reused. SSH3 installation uses the same preflight before creating its service. An external process claiming a port after preflight can still race the installer; the operating system/Docker remains the final binding authority.

All management operations, including monitoring, configuration transfer and private canary tunnels, share the selected transport. Auto probes TCP SSH with a short harmless command and uses SSH3 only for network failures, never to bypass authentication or host-key failures. It rechecks TCP after 60 seconds. A failed or timed-out mutating command is never automatically replayed through the other transport: its outcome may be unknown. Check actual server state before retrying an operation. SSH3 passwords and keys are encrypted in managed settings, included in encrypted backups, and omitted from API responses, argv and logs.

Docker images include /usr/local/bin/webshare-ssh3 and both reserve server architectures. Source installations can set WEBSHARE_SSH3_HELPER and WEBSHARE_SSH3_SERVER_DIR to equivalent local builds. Client apps need no update for this server management feature.

For persistent sessions, set WEBSHARE_SECRET.

For built-in GeoIP location, Docker downloads a free City database automatically on startup when WEBSHARE_GEOIP_AUTO_DOWNLOAD=true and the file is missing. The default City source is the wp-statistics GeoLite2 package served through jsDelivr, so no paid account or license key is required. You can also provide any free MMDB-compatible City and ASN databases manually and place them at:

data/geoip/GeoLite2-City.mmdb
data/geoip/GeoLite2-ASN.mmdb

The Docker compose files already map these to /app/data/geoip/.... Restart or rebuild the web panel after changing the files so the GeoIP reader cache is refreshed. ASN/organization lookup requires GeoLite2-ASN.mmdb or a custom WEBSHARE_GEOIP_ASN_URL; the default auto-download source only provides City data.

API Shape

All API routes live under /api.

  • POST /api/auth/login
  • GET /api/apps
  • GET /api/me
  • GET|PATCH /api/profile
  • GET|POST /api/users
  • GET|PATCH|DELETE /api/users/{id}
  • GET|POST /api/servers
  • GET|POST /api/servers/{id}/deployments
  • GET|POST /api/clients
  • GET /api/clients/{id}/config
  • GET /api/mobile/deployments
  • GET|POST /api/mobile/clients
  • GET /api/mobile/clients/{id}/sing-box
  • GET /api/mobile/network-status
  • GET|PUT /api/clients/{id}/limit
  • POST /api/clients/{id}/traffic
  • GET /api/reports/summary
  • GET /api/reports/traffic
  • GET /api/reports/near-limit
  • GET /api/settings/oidc
  • PUT /api/settings/oidc
  • GET /api/settings/smtp
  • PUT /api/settings/smtp
  • POST /api/settings/smtp/test
  • GET /api/auth/oidc/config
  • POST /api/auth/oidc/start
  • GET /api/auth/oidc/callback
  • GET /api/export
  • POST /api/import

Tests

python3 -m unittest discover -s tests

No third-party packages are required.

Optional Linux interoperability checks use a built webshare-core, Docker, OpenSSL, the pinned Xray/Hysteria images, and nginx:alpine. They transfer 1 MiB through REALITY Vision, all three XHTTP modes and Hysteria2 with no obfuscation, Salamander and Gecko, including a legacy XHTTP OPTIONS profile behind an Nginx method rewrite. The HTTP target and REALITY TLS target both run on loopback:

WEBSHARE_CORE_BINARY=/path/to/webshare-core python3 -m unittest tests.test_runtime_compatibility

Add tests.test_resilience.LiveUserTests to that command to verify live Xray user addition while an existing TCP session stays open, per-user counters, and canary cleanup after both successful and failed candidate checks. All test services use loopback. Native controller and UI checks are described in app-client/README.md.

Docker

docker compose up --build

Open the Docker deployment at:

http://127.0.0.1:8081

For production deployments use the image-based compose file:

docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d

By default it pulls:

forgejo.acnas.net/app/webshare:main

Override it with WEBSHARE_IMAGE in .env when you want to pin a specific tag or SHA image.

App Clients

app-client/ is the shared Qt 6.11.1 + QML client. The same QML interface is used for Android, Linux, and Windows, while platform behavior lives behind the C++ controller.

All app clients consume the same optimized sing-box VPN profile shape: IPv4-only TUN, MTU 1200, automatic routes, DoH DNS and full UDP routing without a blanket UDP/443 block. Android, Linux and Windows use the mixed stack to reassemble fragmented game UDP while keeping native TCP handling. Cached profiles migrate to this stack before connecting.

The app checks /api/mobile/network-status through webshare.acnas.net to show the public IP, route status, API latency and location data before and after VPN connection. Country, city, ASN and organization are read from reverse-proxy or CDN headers such as CF-IPCountry, X-Country-Code, X-City, X-ASN and X-Organization. If those headers are not configured, WebShare falls back to free MMDB files from WEBSHARE_GEOIP_CITY_DB and WEBSHARE_GEOIP_ASN_DB; if the files are missing, the app still shows the observed public IP and marks location as unknown.

Current implementation status:

  • Linux: Qt/QML desktop app with tray, single-instance behavior, WebShare login, embedded OIDC, profile creation, MTProto Telegram links, update discovery, and bundled webshare-core controlled through the installed polkit helper;
  • Windows: Qt/QML app packaged as a Qt Installer Framework setup executable with bundled webshare-core.exe;
  • Android: the same Qt/QML UI and API flow with the native VpnService/libbox tunnel bridge built from the same submodule branch.
./app-client/build-in-docker.sh all
./app-client/build-in-docker.sh linux
./app-client/build-in-docker.sh linux-installer
./app-client/build-in-docker.sh windows
./app-client/build-in-docker.sh android

Artifacts are exported to:

app-client/dist/webshare-linux-x64.run
app-client/dist/webshare-windows-x64-setup.exe
app-client/dist/webshare-android-universal.apk

webshare-linux-x64.run is the Qt Installer Framework offline installer for Linux. It installs the system menu shortcut, root-owned webshare-core, and a polkit/systemd-managed VPN helper so active local users can connect/disconnect without repeated password prompts.

webshare-windows-x64-setup.exe is the Qt Installer Framework offline installer for Windows.

The Android APK is signed by the Docker build. Add these Forgejo secrets for a release signature, or omit them to get an installable debug-signed APK:

ANDROID_KEYSTORE_BASE64
ANDROID_KEYSTORE_PASSWORD
ANDROID_KEY_ALIAS
ANDROID_KEY_PASSWORD

The default Android artifact is a universal APK for arm64-v8a, armeabi-v7a, x86_64, and x86. Override QT_ANDROID_ABIS in CI if a smaller APK is needed.

The app client always uses https://webshare.acnas.net as its WebShare API endpoint. There is no server field in the app UI and older saved overrides are ignored.

The Account screen can check the latest Forgejo release through /api/apps and open the matching package download.

The client uses a simple screen model:

  • VPN: current connection, connect/disconnect, and available VPN profiles;
  • Telegram: MTProto and experimental WEB proxy profiles, with open/copy actions;
  • Account: logout, update checks, routing settings and diagnostics.

The three main tabs stay visible on phones and desktops. Add a profile from VPN or Telegram; after creation the app returns to the relevant tab. Connection IP, latency and traffic details are collapsed until requested. The web panel uses searchable connection cards, a separate Telegram section, and a grouped administration menu. Profile creation opens in a dialog; protocol and runtime options remain available under additional settings.

OIDC login supports the standard authorization-code flow through a local callback listener and an embedded Qt WebView.

Runtime requirements:

  • webshare-core is bundled with the release archive;
  • WEBSHARE_CORE=/path/to/webshare-core can override the bundled helper;
  • the Linux installer adds a root-owned webshare-core and limited webshare-vpn-helper under /usr/libexec/webshare, plus a polkit rule that allows active local desktop users to manage WebShare VPN without repeated password prompts;
  • Linux installed builds use systemd-run/polkit and do not call sudo, do not call pkexec, do not use setcap, and do not store sudo passwords;
  • Linux needs systemd, polkit, and /dev/net/tun.

Android, Linux and Windows build the core from the same Git submodule: app-client/third_party/sing-box, based on the published Leadaxe/sing-box-lx tag v1.14.3-lx.21. The packaging fork is published at https://forgejo.acnas.net/libs/sing-box.git on branch webshare. Its Android and Apple client submodules are published in the same repository on branches vendor/android and vendor/apple; all three are pinned by exact Git commits so recursive CI checkouts can retrieve the local packaging changes. WebShare-specific desktop and Android traffic bridges live in app-client/core/ and are applied to the container source by app-client/scripts/prepare-core.sh.

git submodule sync --recursive app-client/third_party/sing-box
git submodule update --init --recursive app-client/third_party/sing-box
./app-client/build-in-docker.sh all

The core build uses golang:1.26.8-bookworm by default. The pinned core requires Go 1.25.5 or newer. Desktop and Android builds report 1.14.3-lx.21-webshare.1; the version is recorded in app-client/core/VERSION.

CI checks out submodules recursively, including the four pinned WireGuard, sing-tun, gVisor and uTLS forks. To update the helper, select a published sing-box-lx tag, verify the overlay and client API, then update the submodule pointer and app-client/core/VERSION together.

Desktop builds use the release tag list from the cloned repository and append the sing-box-lx client features with_xhttp, with_awg, and with_lx_command. Override SING_BOX_BUILD_TAGS only when replacing the whole tag list is intentional. By default the desktop build skips with_naive_outbound; Windows also skips tfogo_checklinkname0 to keep cross-compilation stable. Android's libbox builder enables the same downstream features directly for both AAR variants.

Linux installer:

chmod +x app-client/dist/webshare-linux-x64.run
./app-client/dist/webshare-linux-x64.run

The installer performs one elevated system-integration step and creates the desktop/app-menu launcher.

Keep polkit installed and running. Installed builds should not ask for the administrator password on every connect/disconnect after the installer has completed its elevated system-integration step.

If /dev/net/tun is missing, enable the TUN module on the host with sudo modprobe tun.

CI and local Docker builds can use a proxy for Qt, Android SDK, Gradle, pip, apt and curl downloads:

WEBSHARE_BUILD_PROXY='http://user:password@proxy.example.net:6669' ./app-client/build-in-docker.sh all

If the proxy value is copied from a WebShare profile and includes a name after #, the build script strips that fragment before passing it to HTTP clients.

Linux and Windows installers use WebShare's internal Qt Installer Framework build by default:

https://forgejo.acnas.net/app/qtif/releases/tag/v6.11.1-ifw4.11.0-2

The Docker build downloads the platform QtIF tools archive, verifies it with SHA256SUMS.txt, and then creates the offline installers. Override QTIFW_RELEASE_TAG, QTIFW_DOWNLOAD_BASE_URL, QTIFW_LINUX_TOOLS_URL or QTIFW_WINDOWS_TOOLS_URL in CI if a newer QtIF release should be used.

Forgejo CI And Releases

The repository includes .forgejo/workflows/ci.yml for Forgejo Actions:

  • pushes and pull requests run Python compilation and unit tests;
  • pushes to main build and push Docker image tags main and sha-<commit>;
  • Git tags matching v* also publish a Docker image with the same tag;
  • pushes to main can deploy the web panel over SSH with Docker Compose;
  • the Linux, Windows, and Android Qt/QML client packages are built in Docker from the Linux Forgejo runner;
  • the Linux and Windows user-facing installers are generated with Qt Installer Framework;
  • release assets are published only for Git tags matching v*.

Docker images are pushed to the Forgejo container registry using the repository path:

forgejo.acnas.net/app/webshare

For repository app/webshare, the pushed tags look like:

forgejo.acnas.net/app/webshare:main
forgejo.acnas.net/app/webshare:sha-abcdef123456
forgejo.acnas.net/app/webshare:v0.1.0

Forgejo Actions provides a temporary FORGEJO_TOKEN / GITHUB_TOKEN for the workflow, but many Forgejo versions/configurations do not allow that automatic token to push to the container registry. If docker push fails with 401 Unauthorized on /v2/.../blobs/uploads/, create a personal access token and add these Forgejo repository secrets:

REGISTRY_USER
REGISTRY_TOKEN
DEPLOY_HOST
DEPLOY_PORT
DEPLOY_USER
DEPLOY_SSH_KEY
DEPLOY_SSH_PASSWORD
DEPLOY_PATH
WEBSHARE_BUILD_PROXY
QT_MIRROR
ANDROID_KEYSTORE_BASE64
ANDROID_KEYSTORE_PASSWORD
ANDROID_KEY_ALIAS
ANDROID_KEY_PASSWORD

REGISTRY_USER is the Forgejo username that owns the token, for example your user or a dedicated deploy bot. REGISTRY_TOKEN is a Forgejo access token from:

User menu -> Settings -> Applications -> Access Tokens

Create a token that can write container/package artifacts for this repository. If your Forgejo token UI has scopes, grant package/container read and write permissions.

For SSH deploy, prefer DEPLOY_SSH_KEY. It must be a private key that can SSH to the production host. If you cannot use a key yet, set DEPLOY_SSH_PASSWORD instead; the workflow will use password auth through sshpass. DEPLOY_PORT is optional and defaults to 22. The remote user must be able to run docker and docker compose.

Prepare the production host once:

sudo mkdir -p /opt/webshare-panel
sudo chown "$USER:$USER" /opt/webshare-panel
cd /opt/webshare-panel
cp /path/to/.env.example .env

Edit /opt/webshare-panel/.env and set at least:

WEBSHARE_SECRET=long-random-secret
WEBSHARE_ADMIN_USERNAME=admin
WEBSHARE_ADMIN_EMAIL=admin@example.com
WEBSHARE_ADMIN_PASSWORD=strong-password
WEBSHARE_HOST_PORT=8081

Then set DEPLOY_PATH=/opt/webshare-panel in Forgejo secrets. On each push to main, CI builds the image, pushes it to Forgejo, copies docker-compose.prod.yml to DEPLOY_PATH, runs:

docker compose -f docker-compose.prod.yml pull webshare
docker compose -f docker-compose.prod.yml up -d --remove-orphans webshare

and checks /api/health from inside the container.

The client CI job uses the same Dockerized build as local development: app-client/build-in-docker.sh. The Forgejo runner must expose a Docker daemon to job containers. With a Docker-in-Docker runner, set the runner config to pass DOCKER_HOST into jobs and point container.docker_host at the DIND daemon.

To publish a release, push a tag:

git tag v0.1.0
git push origin v0.1.0

The tagged workflow creates or updates the Forgejo release and uploads:

webshare-linux-x64.run
webshare-windows-x64-setup.exe
webshare-android-universal.apk

The web panel Apps view reads the latest release from Forgejo and links to the available assets.

Backup And Restore

Admins can use the Backup view to schedule encrypted backups, create a verified copy immediately, download previous copies and restore them through the browser. The default schedule is daily at 03:00 Europe/Moscow with 14 retained versions. Both the time zone and retention (1–90 copies) are configurable in the panel.

Copies use authenticated Fernet encryption over compressed JSON. A copy is only published and counted towards retention after decrypting it, importing it into an isolated temporary SQLite database and checking integrity, foreign keys and record counts. A failed check preserves earlier copies. Failed or interrupted scheduled attempts retry after an hour.

By default files are stored in data/backups/ and the separate recovery key is data/backup-recovery.key; override these with WEBSHARE_BACKUP_DIR and WEBSHARE_BACKUP_KEY_FILE. Files and keys have owner-only permissions. Download the key once and keep an external copy separately from the encrypted backups. Use Settings → Копии на другом сервере to enable verified off-host delivery to S3 or SFTP. The destination and credentials are configured in the panel. To resume scheduled backups after a lost key file, restore the saved key to WEBSHARE_BACKUP_KEY_FILE; an existing backup set never silently receives a replacement key.

Encrypted browser restores require the downloaded recovery-key file. Plain JSON export/import remains available under the manual-transfer disclosure.

The backup includes:

  • users and password hashes;
  • OIDC provider settings and linked external identities;
  • SMTP settings, including stored SMTP passwords;
  • servers, SSH settings, SSH passwords, and stored SSH private keys;
  • deployments, generated configs, clients, traffic limits, and traffic records;
  • per-device credentials, accounting cursors and retained engine release metadata;
  • panel-managed offsite/notification/release settings and admin MFA policy.

Backup format 4 adds managed settings, with signing and integration secrets encrypted by the separate recovery key even inside plain JSON exports. Moving these settings to another installation requires that source key; browser restore rewraps the secrets with the destination key. Formats 1, 2 and 3 remain importable. Retained Docker images themselves stay on the VPN host and are not in the backup.

The backup does not include operation logs, server check history, quality events, collector/probe status, app sessions, rollout plans, qualification reports, the local backup schedule, or audit logs. Treat plain JSON exports as secrets because they contain credentials.

When importing with Replace current configuration, the current users are replaced by the backup users. After restore, sign in with an admin account from the restored backup.

By default, restore also queues a VPN sync for every restored deployment whose server has Auto deploy and sync clients enabled and SSH key or password credentials configured. That sync regenerates the runtime configs from the restored users/clients and runs remote Docker Compose with forced recreate, so the VPN containers receive the restored user list automatically. Deployments on servers without SSH credentials, or with auto-sync disabled, are skipped and can be applied later with Deploy.

Managed operations

Devices and sessions

The app's normal VPN flow is server → protocol → connect. On first use the panel creates a personal key for the persistent installation UUID and waits for the managed server to apply it. Retries and reconnects reuse the key; opening the catalog creates nothing. Automatic mode can prepare additional protocols as reserves and connects as soon as one usable profile is ready. New credentials require a server with automatic sync and management access configured. Cached, previously applied profiles can still start while the panel is offline.

Admins can create local access groups under Пользователи and assign users and groups under Доступ пользователей when creating or editing a server or protocol. Choose everyone, selected accounts only, or everyone except the selected accounts. For protocol access, both the server rule and the protocol rule must permit the account. Rules apply to an admin's own VPN connections too. Existing servers and protocols have unrestricted access until an admin adds a rule.

Changing access hides denied endpoints and stops issuing their profiles immediately. Applying affected protocols removes denied keys from the remote runtime. The panel queues application when automatic sync is enabled and reports which protocols need manual application otherwise. The underlying profile and usage history remain available for regranting and reporting. Convert legacy shared MTProto links to personal links before restricting that proxy. Access rules and group membership are included in backups.

The web panel separates Подключение (server/protocol catalog and handoff to WebShare) from Устройства (keys grouped by device, traffic and access). Revoking one device disables all its protocol keys and prevents provisioning new keys for that device ID; it preserves history and other devices' access. The UI shows pending revocation until the runtime configuration is applied. Admins keep the detailed Подключения пользователей view. Manual profile creation/export for external clients remains in collapsed advanced sections; each external profile receives its own device ID.

Upgrading migrates SQLite's old uniqueness constraint without changing keys, links or traffic history. Existing profiles are marked legacy and remain visible on all of that user's installations. To separate a previously shared profile, connect from each updated WebShare app and retire the shared one once both devices are connected. Legacy/imported profiles remain in the app's Дополнительные подключения; server protocols do not need recreating.

Account → Входы в аккаунт lists current sessions and can revoke one or all. Password, active-status or role changes revoke that user's sessions. Tokens issued before this upgrade require signing in again; an existing VPN credential is revoked separately through its connection. Sessions are bounded to 50 per account and their tokens are never stored in the database.

For admin MFA, configure Keycloak's authentication flow and ACR/AMR mapping, sign in with a verified second factor, then enable Settings → Второй фактор администратора. The panel requests the configured ACR and accepts proof only from the verified ID token. Userinfo cannot supply MFA proof. Enabling the policy closes admin password/non-MFA sessions and blocks subsequent admin password login. Keep the recovery key and a working MFA admin account available.

Offsite copies and notifications

Settings → Копии на другом сервере supports S3 (bucket, HTTPS endpoint, prefix, region and access keys) and SFTP (host, port, user, absolute directory, pinned SHA256 SSH host-key fingerprint, password or private key). Empty secret inputs preserve saved values. The storage directory/bucket must already exist. The check button tests connectivity without uploading data; each scheduled or manual copy subsequently tests write access by uploading encrypted ciphertext, reading it back and comparing SHA256. Only then are older managed backup files pruned, according to retention. Unrelated objects are preserved. SFTP uploads use a temporary file with mode 0600 before rename. A failed remote delivery keeps the valid local copy and has its own visible status. The recovery key is never uploaded with a backup.

Settings → Уведомления supports existing SMTP settings and a Telegram bot plus explicit chat IDs. Protocol failures, unstable reconnects, local/offsite backup failures, rollback failures and rollout stops have a persistent delayed state. Transient events shorter than the delay are suppressed; repeated failures are grouped and rate limited, and stable recovery generates a single notification. A failed provider retries without repeating a group already delivered through the other provider. Enabling channels sends real notifications only when due; there is no automatic test message.

Scheduled server updates

Управление → Обновления серверов creates a plan with selected protocols, target image tags, start time, group size, observation period and maintenance window. Pending configuration must be applied and functional probes enabled first. The first batch is one host with all selected protocols on it. Safe updates perform their existing precheck/postcheck and immediate rollback on failure; functional probes continue throughout observation. At least two successful observations and the full observation period are required before the next batch. A failed probe or configuration drift stops the remaining rollout. A later observation failure does not itself revert an already accepted engine update.

Cancellation finishes an in-flight safe operation and prevents subsequent ones. An expired window pauses the plan. If the panel restarts during application, the plan pauses for inspection instead of blindly repeating the operation; scheduled plans and observation can continue after restart. Create a new plan for remaining deployments after resolving a pause or failure.

App signing and release trust

Settings → Подпись и выпуск приложений accepts an existing Android keystore, alias, passwords and the installed signing certificate's SHA256. It generates an Ed25519 manifest key once and retains it encrypted with other managed secrets. Android signing-key replacement is never automatic. The panel reports whether fields are supplied; CI validates the keystore and actual APK certificate before publishing. A wrong certificate aborts the release.

Use “Подключить Forgejo CI” to issue a scoped, one-time-visible builder token. Set two Forgejo secrets once: WEBSHARE_RELEASE_CONFIG_URL to the panel's HTTPS /api/releases/build-config endpoint, and WEBSHARE_RELEASE_CONFIG_TOKEN to that token. The destination and signing material themselves remain panel settings. The token normally allows reading build materials only, expires after a year and is revoked when replaced. Keep this endpoint behind HTTPS. CI reads a private 0600 environment file, passes Android secrets through BuildKit secret mounts and removes temporary keystores within the signing step.

If the existing Android key is held only in Forgejo secrets, deploy the updated main first and choose Перенести существующую подпись из Forgejo CI in the panel's signing settings. This creates the manifest key if needed and issues a builder token with explicit permission for one Android import. Add the two WEBSHARE_RELEASE_CONFIG_* secrets above and keep ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD, ANDROID_KEY_ALIAS and ANDROID_KEY_PASSWORD unchanged. The next trusted build reads the existing keystore inside CI, derives its certificate fingerprint with keytool, and sends the signing settings directly to the panel over HTTPS. No secret needs to be viewed, downloaded, pasted into chat, or attached as a build artifact. The grant is consumed when the import succeeds, cannot replace a saved Android key or the manifest key, and checks any certificate fingerprint already set in the panel. Ordinary builder tokens cannot initialize Android signing. Identical retries are safe; changing the key still requires an administrator in the panel. Do not rerun an old tag expecting updated workflow code: create a new tag from the updated main with the same version as app-client/VERSION.

Pull-request builds do not receive signing credentials. Public build metadata also binds the manifest key and Android certificate across build/publish stages; a signing-setting change between stages requires rebuilding the release.

Tagged releases fail closed without this configuration. Three installers and webshare-update.json are published together. The signed manifest binds version, platform, size, SHA256 and expiry. Apps pin the public Ed25519 key at build time; Android/libbox and desktop/bundled core verify signature, complete file hash, platform, expiry and strictly newer numeric version before installer launch. The verifier cannot be substituted through PATH. Initial trust-key installation uses a manually installed build made by the configured pipeline; older builds without a pinned key cannot safely bootstrap automatic update trust.

Android versionCode derives from numeric major.minor.patch[.revision] as major*1000000 + minor*10000 + patch*100 + revision; components after major must be below 100. Release tags must progress numerically. Nonrelease local builds can use the retained local debug keystore, but are not production signed releases. A release must use the same certificate as users' currently installed APKs.

OIDC Login

Admins can enable OIDC in Settings -> OIDC. The implementation uses the authorization-code flow with PKCE and verifies RSA-signed id_token values against the provider JWKS. Keycloak works with the standard realm issuer URL:

https://keycloak.example.com/realms/main

Configure the Keycloak client with this redirect URI, shown in the web panel:

https://your-webshare-host/api/auth/oidc/callback

Useful defaults:

  • scopes: openid email profile;
  • username claim: preferred_username;
  • email claim: email;
  • role claim path for Keycloak realm roles: realm_access.roles;
  • admin roles: admin,webshare-admin.

If Allow new OIDC users is enabled, first login creates a local WebShare user and links it to the OIDC issuer + sub. If the email already exists locally, WebShare links that existing account instead. Client secrets are stored in the local SQLite database, so keep data/webshare.sqlite3 private.

SMTP Settings

Admins can configure SMTP in Settings -> SMTP from the web panel.

Supported options:

  • host, port, and security mode: STARTTLS, SSL/TLS, or None;
  • optional username and password;
  • sender email and display name;
  • timeout for SMTP operations;
  • test recipient for sending a test email.

Passwords are stored in the local SQLite database and are included in backups. Use Save and test to verify the current settings without leaving the panel.

When SMTP is enabled, WebShare sends automatic emails for:

  • newly created user accounts;
  • password changes;
  • server/Docker checks that move from healthy to unstable or error;
  • recovery emails when a previously unhealthy server becomes online again.

Server check notifications are transition-based to avoid repeating the same alert on every automatic check.

User Profile

Every signed-in user has a Profile view. Users can change their email, display name, and password. Changing the password requires the current password. Admins can still manage roles and account status from Users.

Remote Deployment

Servers can be managed automatically over SSH.

When adding a server in the UI, fill:

  • Host: SSH host or IP address;
  • Public host: domain/IP that clients will connect to;
  • SSH user and SSH port;
  • Deploy path: remote directory for generated runtime files, default /opt/webshare;
  • SSH private key: private key with Docker access on the remote host;
  • SSH password: optional password auth when a key is not provided;
  • Install Docker if missing: checks Docker Engine and Docker Compose v2 over SSH and installs them when missing;
  • Auto deploy and sync clients: when enabled, deployments and client changes are applied automatically.

The remote host must have:

  • SSH access for the configured user;
  • root or passwordless sudo access when WebShare needs to install Docker;
  • permission for the SSH user to run Docker. WebShare adds the user to the docker group during provisioning when possible.

Key authentication is preferred. Password authentication uses sshpass and is supported by the Docker image. If you run WebShare directly on the host, install sshpass and openssh-client there too. The password is stored in the local SQLite database, so keep data/webshare.sqlite3 private.

Client config QR codes use the system qrencode utility. The Docker image includes it. If you run WebShare directly on the host, install qrencode to see QR codes in the config modal.

What Happens On Deploy

For each protocol deployment WebShare generates a small runtime bundle and uploads it to:

/opt/webshare/<deployment-id>/

VLESS XHTTP uses the same flat path on its Origin server. A chained XHTTP deployment references an existing VLESS Reality deployment; it does not create another runtime directory on the Reality server. That deployment keeps its own /opt/webshare/<reality-deployment-id>/ directory and container.

Then it runs:

docker compose pull
docker compose up -d --remove-orphans --force-recreate

Adding, deleting, or changing clients rebuilds the runtime config and syncs the deployment again when auto_sync is enabled. Xray Reality and XHTTP add new users through the loopback management API when only the user list has grown. Existing connections and the container stay running. Deleting, disabling or changing a credential uses a full apply so established sessions with revoked credentials are closed. Other runtime/config changes also use a full apply.

Existing Xray deployments need one Deploy after upgrading the panel to enable the management API and per-user traffic counters. The API listens only on container loopback and is accessed through SSH and docker exec; port 10085 is not published. Subsequent server monitoring collects cumulative counters into the existing user/client traffic charts and limits. Cursor updates are atomic, deduplicated and handle container restarts. Docker totals remain separate from the per-user counters; internal XHTTP chain credentials are not charged to users.

Use Version on a deployment to read the currently running Docker container and image information from the remote host. WebShare stores the latest image tag, image id, container status, and timestamps on the deployment.

Use Проверить обновление for every supported protocol to choose an engine version. The running image is retained before testing. Xray uses the previous Xray client for its private compatibility test; Hysteria, SOCKS5 and HTTP use the packaged WebShare core. MTProto and Telegram WEB perform nonce-checked Telegram req_pq_multi transactions, without a Telegram account. Temporary containers only publish loopback ports and are reached through an SSH tunnel. Working services change after the candidate passes. Runtime health and a real connection are checked again after applying; failure triggers automatic rollback. Candidate containers, networks, volumes and private staging files are cleaned on success and failure.

Откатить ядро restores a retained image while keeping the current users, keys, limits and routing policy. Revoked users are never restored. Non-Xray manual rollbacks also validate the retained binaries against the current configuration before changing the live service. A rollback whose connection cannot be verified is reported as an error, rather than claiming the connection works.

Apply pending configuration changes before testing an update. The generic edit form cannot change a deployed engine version or forge managed release markers. For non-Xray runtimes, tested primary and helper image IDs are retained under private local tags and applied without pull/build. Rejected floating-tag updates freeze subsequent normal applies to the retained image. Do not prune these image IDs on the VPN host while they are needed for rollback. Backups contain release metadata, not Docker image layers; a fresh host needs its images rebuilt and validated. No protocol or connection recreation is required.

Every deployment has a Runtime Docker image tag field in Basic settings (or image_tag in Config JSON). WebShare fixes the repository for each protocol and accepts a Docker tag such as 26.10.17, 2, or latest; arbitrary image repositories cannot be supplied. A validated image_digest is managed by the rollback workflow. The defaults are Xray 26.10.17, Hysteria v2.13.0, 3proxy latest, and MTG 2. Xray 26.10.17 is marked prerelease upstream; use an older pinned tag when that release channel is unsuitable. Existing deployment snapshots without image_tag are backfilled with that protocol default during the database migration; the remote container changes only on its next Deploy, Update, or automatic sync. For Hysteria2 this setting controls the Hysteria runtime image only; the short-lived OpenSSL certificate helper remains managed internally by WebShare.

For VLESS Reality and XHTTP, the default 26.10.17 tag resolves to the official multi-architecture image pinned by digest. Hysteria v2.13.0 is also pinned by digest. WebShare also retains the audited digest for known older Xray tags, so an explicitly selected version does not lose its pin after a future panel upgrade. Unknown concrete tags resolve to the protocol's fixed repository and remain publisher-mutable. latest is deliberately floating: every Deploy, Update, or automatic client sync runs docker compose pull, so it can download and restart a different image without a panel upgrade. Prefer a concrete version unless that behavior is intentional. A chained XHTTP deployment and its selected Reality deployment keep independent image tags.

For a coordinated upgrade, distribute the rebuilt apps first, update the panel, then test the new Xray runtime tags with Проверить обновление on the deployments you want to upgrade. Use the same checked update action for the other runtimes. Existing explicit image pins are retained. Enable Gecko/XMUX options after clients have the updated core. Xray 26.10 also blocks private destinations by default in direct/freedom egress; review deployments that intentionally access private networks before selecting that version.

A chained XHTTP deployment adds its private service credential to the selected, already existing VLESS Reality deployment; it does not create a second protocol runtime there.

If WebShare restarts during Deploy or Update, the interrupted operation is marked with a warning and its deployment is queued again. A chained deployment ensures its service credential is active on the referenced Reality deployment before applying the Origin configuration that uses it.

Deleting a client removes it from the local database and, when the deployment's server has auto-sync and SSH credentials, queues a sync so the remote VPN config is regenerated without that user. Deleting a deployment or server first marks its records as deleting and queues remote cleanup. WebShare runs Docker Compose down with orphan and volume cleanup in the deployment directory and removes the remote deployment folder. Deleting a chained XHTTP deployment also removes only its internal service credential from the referenced Reality deployment and reapplies that existing runtime; it never deletes the Reality deployment or its ordinary Connections. If all known Reality containers are stopped, WebShare can revoke only the chain UUID from the saved configurations without starting or recreating the upstream runtime. It verifies container states before and after the change and preserves unrelated pending settings. This allows cleanup to finish even when Docker networking prevents Reality from starting. Running, paused, restarting or unverified containers still require normal runtime revocation. Only after cleanup succeeds are the local records deleted. Failed or interrupted cleanup keeps the metadata and is retried after restart or by pressing Delete again. The server host, SSH target, and deploy path are frozen while cleanup is pending so a retry cannot silently clean the wrong machine; restore reachability at that same target before retrying. The SSH credentials button remains available while a server is deleting, so a wrong key or password can be repaired before choosing SSH cleanup again in the deletion dialog.

If access to a server is permanently lost, the deletion dialog also offers Only from the panel (no access). This removes the selected server or protocol and its associated client profiles immediately, without SSH, including records already waiting for cleanup. Remote containers, files and access credentials are not cleaned up by this mode; any remaining runtime must be removed manually. It does not wait for an ongoing SSH cleanup; a previously started cleanup may still finish independently. For API clients, send {"local_only": true} in the JSON body of DELETE /api/servers/{id} or DELETE /api/deployments/{id}. This option is administrator-only, recorded in the audit log, and does not bypass the XHTTP dependency protection described below. The default DELETE behavior still requires successful remote cleanup.

A VLESS Reality deployment referenced by an XHTTP chain, or the server that owns it, cannot be deleted until the dependent chain is deleted. This prevents a working Origin from being left with a missing upstream.

Runtime Files

Supported runtime generation:

Protocol Runtime behavior
amneziawg Builds checksum-pinned AmneziaWG 3.1 in an isolated userspace container; issues per-device keys/addresses and collects peer traffic and handshake counters; supports AWG 2.0 compatibility settings
socks5 Runs 3proxy/3proxy:latest and generates 3proxy.cfg with all active users
http_proxy Runs 3proxy/3proxy:latest and generates 3proxy.cfg with all active users
hysteria2 Generates hysteria.yaml with user/password auth, optional Salamander/Gecko obfuscation and a self-signed cert volume
mtproto Runs nineseconds/mtg:2 with an mtg-v2 compatible fake-TLS secret
mtproto_web Builds the pinned official Telegram WEB relay and MTProxy backend; publishes a loopback HTTP origin for an external HTTPS reverse proxy
xray_vless_reality Generates xray.json; auto-generates a Reality keypair on first remote deploy when keys are omitted; explicitly controls the minimum accepted client version
xray_vless_xhttp_tls Deploys an XHTTP Origin as a direct final node or routes it through an existing VLESS Reality deployment; regenerates its per-user VLESS inbound on every client sync

Hysteria2 Basic settings include obfs_type (none, salamander, or experimental gecko) and obfs_password. Enabling obfuscation with an empty password generates and saves a shared secret once. Gecko defaults to packet sizes 512–1200 bytes; its minimum and maximum can be configured. Server YAML, share links and app profiles use the same obfuscation secret. Editing a deployment refreshes existing links while preserving each user's authentication password. Existing deployments keep obfuscation disabled until explicitly configured.

For xray_vless_reality, WebShare tries to generate a matching private_key / public_key pair on the remote host by running Xray in Docker during deploy. You can also provide both keys manually in Config JSON.

Example:

{
  "server_name": "www.cloudflare.com",
  "public_key": "REALITY_PUBLIC_KEY",
  "private_key": "REALITY_PRIVATE_KEY",
  "short_id": "abcd1234",
  "min_client_ver": "1.0.0",
  "image_tag": "26.10.17"
}

min_client_ver defaults to 1.0.0 so Xray does not silently reject existing Reality clients. Raise this value in the deployment only after all clients have been upgraded. After upgrading WebShare, press Deploy once on an existing Reality deployment to write this setting into its remote xray.json.

VLESS XHTTP deployment

New XHTTP deployments default to POST. Existing custom methods, including OPTIONS, are preserved. Xray treats bare OPTIONS as CORS preflight without reading its payload; an OPTIONS profile therefore requires the existing Origin proxy's OPTIONS -> POST rewrite shown below. Check that the CDN permits the upload method selected for your deployment before changing it. Optional xmux fields control connection reuse, request limits, connection lifetime and HTTP/2 keepalive; the panel maps them to both sing-box configs and Xray share-link extras. Unset XMUX options retain the core's defaults.

xray_vless_xhttp_tls is one logical panel deployment with two routing modes: Direct final node and Route through existing VLESS Reality. WebShare uploads a pinned Xray 26.10.17 runtime to the Origin, publishes its XHTTP inbound on 127.0.0.1:8003 by default, and puts every active WebShare Connection into the generated xray.json with a separate UUID. Chain mode selects a concrete, already deployed VLESS Reality entry as its upstream. It reuses that deployment instead of creating another protocol, container, domain, certificate, or Xray inbound. Chain mode may publish a second host port (by default 8443) to the existing Reality container's unchanged listener.

Creating, disabling, or deleting a connection, disabling/deleting its user, or reaching a hard traffic limit queues a deployment sync when server auto_sync is enabled. Wait for that operation to finish before testing a new profile or assuming a UUID has been revoked. If automatic sync is unavailable, the panel explicitly asks you to press Deploy manually.

The existing HTTP edge remains outside this Docker deployment: configure Yandex Cloud CDN, its DNS/certificate, and Nginx once, then point the Nginx XHTTP location at 127.0.0.1:8003. Do not expose Origin port 8003 through the router. If Nginx runs in a separate container that cannot reach host loopback, use a deliberate Docker network or change bind_address; do not open 8003 to the Internet without a firewall.

Keep the Origin's existing OPTIONS -> POST method map and disable both proxy response buffering and request buffering for the XHTTP location. Its path must match the deployment path (here /api-test).

Keep the three CDN names separate:

  • client_server: address dialed by the client, normally the provider topology hostname rather than the custom domain;
  • server_name: TLS SNI/certificate name accepted by that CDN address;
  • http_host: HTTP Host that selects your CDN resource, for example cdn.acnas.net.

The deployment port is the Origin listener (8003); client_port remains 443. No deployment-wide user UUID is accepted: WebShare generates one UUID per connection.

Direct/final-node Origin example:

{
  "bind_address": "127.0.0.1",
  "client_server": "053a1e6a20302eed.topology.gslb.yccdn.ru",
  "client_port": 443,
  "server_name": "yccdn-mar-16.yccdn.cloud.yandex.net",
  "alpn": ["h2"],
  "fp": "chrome",
  "http_host": "cdn.acnas.net",
  "path": "/api-test",
  "mode": "packet-up",
  "headers": {
    "Content-Type": "application/octet-stream"
  },
  "sc_max_each_post_bytes": "1000000-1000000",
  "sc_min_posts_interval_ms": "30-30",
  "uplink_http_method": "OPTIONS",
  "x_padding_obfs_mode": true,
  "x_padding_placement": "queryInHeader",
  "x_padding_key": "dc",
  "x_padding_header": "X-Cache",
  "x_padding_method": "tokenish",
  "egress": {
    "type": "direct"
  }
}

This produces:

Client -> Yandex CDN -> Nginx -> managed Xray Origin -> Internet

Direct deployment order in the panel:

  1. Add the Origin under Servers, including SSH credentials, and leave auto_sync enabled.
  2. Ensure host port 8003 is free before the first deployment. The generated Origin binds it only on 127.0.0.1, for access from Nginx on the same host.
  3. Add VLESS XHTTP TLS, keep deployment port 8003, enter the three CDN names above, and choose Direct final node.
  4. Wait for the automatic operation or press Deploy; verify the deployment is Running/Active and the webshare-xray-xhttp container is running.
  5. In an updated WebShare app select the server and VLESS XHTTP TLS, then connect. It creates/reuses that device's UUID and waits for deployment sync. For an external client use the web panel's collapsed manual profile/export action and wait for sync before importing.

Run Direct and chained entries simultaneously

The Direct and chained entries can reuse the same Yandex CDN resource, topology address, TLS SNI, custom HTTP Host, source, and certificate. They need different loopback listener ports and XHTTP paths so Nginx can route each request to the correct Origin container:

WebShare field Direct entry Chained entry
Deployment port 8003 8004
Origin bind address 127.0.0.1 127.0.0.1
Client server / CDN address 053a1e6a20302eed.topology.gslb.yccdn.ru 053a1e6a20302eed.topology.gslb.yccdn.ru
Client port 443 443
TLS server name (SNI) yccdn-mar-16.yccdn.cloud.yandex.net yccdn-mar-16.yccdn.cloud.yandex.net
HTTP Host cdn.acnas.net cdn.acnas.net
XHTTP path /api-test /api-chain
Final destination Direct final node Route through existing VLESS Reality
Existing VLESS Reality deployment — select the running proxy.acnas.net / VLESS Reality / :6666 deployment
Inner Reality published port — 8443
Inner Reality fingerprint — hellochrome_120

These are two independent entries that remain active together. Do not edit the Direct deployment and turn it into a chain: submit the deployment form a second time. They share the physical Origin and Nginx 443/tcp, but have different deployment IDs, loopback listeners, XHTTP paths, and user Connections.

  1. Add origin.acnas.net under Servers with working SSH credentials and Docker. This one server owns both Origin containers.
  2. Keep the existing Yandex resource for cdn.acnas.net. Its HTTPS source, SNI, and source Host remain origin.acnas.net. Disable CDN caching and allow the methods used by the working XHTTP entry, including OPTIONS.
  3. On a different server, keep an existing VLESS Reality deployment Active and verified. It must be managed by WebShare over SSH and use direct egress so WebShare can add a private service credential without creating a visible Connection.
  4. Keep ports 8003 and 8004 closed to the Internet. Only Nginx connects to these loopback listeners.

The existing map belongs once in Nginx's http context. Put both locations inside the existing HTTPS server block for origin.acnas.net:

map $request_method $xhttp_proxy_method {
    default  $request_method;
    OPTIONS  POST;
}

# Inside: server { listen 443 ssl; server_name origin.acnas.net; ... }
location ^~ /api-test {
    proxy_pass http://127.0.0.1:8003;
    proxy_method $xhttp_proxy_method;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_pass_request_headers on;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_cache off;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
}

location ^~ /api-chain {
    proxy_pass http://127.0.0.1:8004;
    proxy_method $xhttp_proxy_method;
    proxy_http_version 1.1;
    proxy_set_header Connection "";
    proxy_pass_request_headers on;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_request_buffering off;
    proxy_cache off;
    proxy_read_timeout 3600s;
    proxy_send_timeout 3600s;
}

Create the deployments from the Origin server card in this order:

  1. Submit VLESS XHTTP TLS with port 8003, the Direct column from the table, and Direct final node. Wait until it is Active.
  2. Use the empty form on the same Origin card again. Submit VLESS XHTTP TLS with port 8004, the Chained column, and Route through existing VLESS Reality. Select the existing proxy.acnas.net / VLESS Reality / :6666 deployment. Do not edit the Direct row.
  3. Wait for the chain deployment to become Active. WebShare adds a private, stable service UUID to the selected Reality inbound and applies that deployment before starting the second Origin container. Its Compose runtime publishes 8443:<existing-Reality-container-port>; the existing public port and all old direct Reality profiles remain unchanged. Allow the Origin to reach this TCP port (preferably restrict it to the Origin's IP).
  4. Under Connections, create one connection for the Direct deployment and a second connection for the chained deployment. The same user may own both; each receives its own UUID/profile.
  5. Confirm that the Origin card contains two independent Active rows: Direct and Origin → proxy.acnas.net / VLESS Reality :6666. Deploying or deleting one XHTTP entry does not replace the other.

The three existing runtimes keep independent paths:

# Origin server
/opt/webshare/<direct-deployment-id>/
/opt/webshare/<chain-deployment-id>/

# NL server; this path already belongs to the selected Reality deployment
/opt/webshare/<reality-deployment-id>/

The chain deployment ID is never installed on the NL server. WebShare updates the selected Reality deployment's existing xray.json and container, preserving its normal user Connections alongside the private service credential.

The persisted relationship contains the selected deployment ID plus two non-secret controls for the private hop:

{
  "egress": {
    "type": "reality_deployment",
    "deployment_id": "VLESS-REALITY-DEPLOYMENT-UUID",
    "dial_port": 8443,
    "fingerprint": "hellochrome_120"
  }
}

The address, SNI, Reality public key, and Short ID are derived from the referenced deployment whenever WebShare builds the Origin runtime. Do not copy those values into the chain configuration. dial_port is a host-side publish/dial port: the Reality container still listens on its original deployment port. The inner fingerprint is independent of both the XHTTP client-facing fp and the direct Reality deployment's fp. hellochrome_120 is the default for new panel forms; firefox may be selected for an explicit A/B test without changing either outer profile.

Old stored chains without dial_port continue to dial the Reality deployment's main port and do not add a Docker port mapping. An explicitly stored inner fingerprint is preserved; when it is absent, materialization uses the stable hellochrome_120 inner-hop default. The service UUID remains owned by WebShare and is not duplicated in config_json or exposed as an end-user Connection. The internal chain credential intentionally has no flow; ordinary Reality user credentials keep the deployment's configured flow (normally xtls-rprx-vision).

One Deploy action validates the dependency, applies and verifies the selected Reality deployment with the service UUID, and only then applies the Origin. If the upstream apply fails, WebShare does not switch the Origin to a credential that is not active.

The chain is:

Client -> Yandex CDN -> Nginx -> XHTTP Origin -> existing VLESS Reality -> Internet

Split traffic between Origin and the Reality exit

A chained XHTTP deployment can apply one server-side routing policy to all of its Connections. In the Basic editor, use:

  • Default traffic route: where unmatched traffic exits;
  • Exception domains: one Xray domain matcher per line;
  • Exception IP / CIDR / GeoIP entries: one address or matcher per line.

Exceptions always use the route opposite to the selected default. For example, to send Russian services from the Origin while everything else continues to the Reality exit, select Reality chain. Enter these domain exceptions:

domain:gosuslugi.ru
domain:nalog.gov.ru

Then enter this GeoIP exception:

geoip:ru

The persisted non-secret policy has this shape:

{
  "egress": {
    "type": "reality_deployment",
    "deployment_id": "VLESS-REALITY-DEPLOYMENT-UUID",
    "routing": {
      "default": "chain",
      "domains": ["domain:gosuslugi.ru", "domain:nalog.gov.ru"],
      "ips": ["geoip:ru"]
    }
  }
}

chain exits from the selected Reality server; direct exits from the Origin. An existing chain with no saved policy keeps sending all traffic through Reality; adding its first exception automatically makes Reality the default route. Domain exceptions automatically enable route-only HTTP/TLS/QUIC sniffing. IP exceptions use Origin-side DNS resolution when the client supplied a domain. Traffic whose domain cannot be observed, including some ECH traffic, falls back to an IP exception or the default route. Avoid geoip:private unless Connections must intentionally reach private networks visible from the Origin. Policy edits do not change client URIs or the Reality service UUID, but existing sessions must reconnect before all new rules take effect.

Several chains may reuse one Reality deployment; each receives a different service UUID and may share the same dedicated published port. A dedicated host port cannot be claimed by another deployment or by a chain targeting a different Reality container on the same server; the panel rejects such conflicts before writing runtime files. Deleting one chain removes only its UUID and Origin runtime, then reapplies Reality while preserving the credentials of its ordinary users and other chains. Recreating that shared Reality container can briefly reconnect their active sessions. A referenced Reality deployment and its server cannot be deleted until all chains that use it are deleted. If Reality or its server becomes unavailable, dependent XHTTP chains are excluded from connection choices until the dependency is healthy again.

As soon as the first Deploy attempt begins, the route topology is intentionally fixed. Direct versus chained mode and the selected Reality deployment can only be changed by deleting and recreating the XHTTP deployment. Ordinary CDN/XHTTP settings and user Connections remain editable.

The deployment's Origin/listener port is also frozen after its first Deploy attempt. Delete and recreate the deployment to move that listener to another port; this keeps the old live port reserved until its runtime is cleaned.

XHTTP range values stay JSON strings. Do not add xtls-rprx-vision or Reality to the client XHTTP profile. The Origin uses a separate service credential for the internal Reality hop, without Vision flow. For an HTTP CDN Origin use explicit packet-up.

For mtproto, WebShare generates Telegram Fake-TLS secrets automatically. You can override the fake-TLS domain with:

{
  "fronting_domain": "telegram.org"
}

Older MTProto deployments that still have a legacy 32-hex secret are repaired on the next Deploy; WebShare regenerates the secret and refreshes the client links before starting the remote container.

New MTProto deployments use personal links on the same listener: each connection has a separate secret, can be revoked individually, and has its own traffic graph. Existing MTG deployments keep their shared links until an admin selects More → Enable personal links. This one-time migration preserves the protocol, port, connection IDs, owners, names, limits and traffic history, but replaces all shared links. Users must add the new proxy link to Telegram. The panel then queues deployment; if deployment fails, retry Deploy with the already-generated links. Repeating migration does not rotate personal secrets. The API is POST /api/deployments/{id}/personal-links with {"replace_shared_links": true} (administrator only).

Stable Xray account identifiers

Connection names are display labels and may be reused by different users. Reality and XHTTP generate Xray's internal email as client-<credential UUID>; it does not depend on the name, its punctuation, length or Unicode characters. Renaming a connection therefore cannot collide with another account or change its credentials. Internal XHTTP-to-Reality accounts retain their separate xhttp-chain-<deployment UUID> namespace.

After updating an existing panel, run Deploy on existing Reality and XHTTP deployments to regenerate their runtime files and remove any old duplicate emails. Users can keep their current connection links. This code update does not restart remote VPN containers by itself.

Experimental Telegram WEB proxy

This is Telegram's new WebView/HTTPS carrier, distinct from the existing FakeTLS MTProto deployment. The official implementation is still a proof of concept: server and platform status, wire contract. A WEB-capable Telegram client is required. Do not assume that current store builds on all platforms support it; the public t.me/webproxy frontend is also not registered in the upstream documentation. WebShare therefore issues the direct tg://webproxy link and offers copying it as well as opening Telegram.

Create a Telegram WEB (experimental) deployment on an x86_64 server:

{
  "public_hostname": "proxy.example.com",
  "backend_public_ip": "203.0.113.10",
  "base_path": "",
  "carrier_mode": "https"
}

Use your real domain and the server's actual outbound public IPv4. The latter is required for MTProxy's AES middle-end handshake behind Docker/NAT; an incorrect address can leave apparently established connections stalled. If omitted, the runtime uses the server's numeric host; set it explicitly when that is an SSH hostname, a private address, or differs from the outbound IP.

The default origin listener is 127.0.0.1:8088. Telegram always connects to HTTPS 443 with a publicly trusted certificate. WebShare does not obtain this certificate or modify the host's existing reverse proxy. Configure DNS, TLS and an HTTPS virtual host before distributing profiles. Example Nginx configuration (the map belongs in the http context):

map $http_upgrade $webproxy_connection {
    default upgrade;
    '' close;
}
server {
    listen 443 ssl;
    server_name proxy.example.com;
    ssl_certificate /etc/letsencrypt/live/proxy.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/proxy.example.com/privkey.pem;
    access_log off;
    location / {
        proxy_pass http://127.0.0.1:8088;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $webproxy_connection;
        proxy_buffering off;
        proxy_read_timeout 75s;
    }
}

Do not log request URIs, headers or bodies on this virtual host: bridge queries and carrier headers contain capabilities. Preserve the relay's response headers, Host and paths. With a root deployment, route the whole hostname through the relay, including the ordinary cover website. The generated webproxy-site/ contains a minimal cover page that operators can replace with their own site.

For an existing website use a base_path, for example private/bridge, without leading/trailing slashes, and route only /private/bridge/ to the same origin, without stripping that prefix. Follow the official base path deployment guide. Links encode host/path in server and prepend the 0x70 marker to the secret before base64url encoding, as required by Telegram's newer clients.

Deploy builds official relay commit c8adb8b7c6b7fc46c12ae3acb68be9070c26a8e8 and MTProxy commit f36d8af769ffaeac36978d38c2c0f6d1104c2137, with source archive SHA-256 verification. No third-party relay implementation is substituted. First deploy needs access to the Go/Debian registries and GitHub. The Compose build runs before start; allow up to 15 minutes for this operation.

Only the HTTP origin is published on the host. Relay admin ports and MTProxy listeners share a private container network namespace and are not published. Traffic accounting reads only the gateway counters, so the shared network is not charged again for each relay/backend container. The signing key persists in webproxy_state; profiles and backend scripts are uploaded with mode 0600. Every user connection has its own secret. Deletion, disabled users and hard-limit revocations remove that secret on managed sync; servers with auto-sync disabled still require a manual Deploy. Backend processes are grouped in batches of 16 secrets to match official MTProxy's limit.

carrier_mode supports https, https-lanes, websocket and websocket-lanes. Start with HTTPS; WebSocket modes also require reverse-proxy Upgrade forwarding. Runtime health checks reach the relay's private /readyz. Official Telegram secret/routing files are downloaded on backend startup; run Deploy periodically or restart the backend containers to refresh them. WEB profiles are listed only under Telegram and are never exported as sing-box VPNs.

Monitoring

The Check button on a server runs remote Docker inspection:

docker ps -a
docker stats --no-stream

WebShare stores the latest check result on the server record and keeps historical server_checks. Monitoring covers Docker/container status, restart count, healthcheck status, exit code, CPU, memory, and container network I/O. Per-client traffic is collected from private protocol counters for VLESS, Hysteria2, SOCKS5, HTTP proxy, Telegram WEB and personal-link MTProto.

Container network I/O is also saved as deployment traffic. The first successful check stores a baseline from Docker counters; the next checks save RX/TX deltas, so the dashboard traffic and Reports graphs move automatically while VPN containers are passing traffic.

The web panel shows the server traffic graph directly on Home and in the top-level Traffic section, with separate incoming/outgoing lines and periods of 24 hours, 7 days or 30 days. Users → Traffic selects one user's graph; Connections → Traffic statistics selects a single connection. Administrators can select any user, while regular users can only read their own usage.

Individual graphs use the traffic records associated with each connection (including records submitted with POST /api/clients/{id}/traffic). They do not divide shared Docker counters between users. Existing deployments need one Deploy to install the collectors. No protocol or connection recreation is needed. Historical traffic before enabling counters cannot be recovered. Without individual records, the panel shows No individual records. Hysteria2 uses its authenticated private Stats API; 3proxy uses exact per-login binary counters, persisted in the deployment’s traffic/ directory (do not delete this directory while retaining accounting history). 3proxy flushes its file each minute; active transfers update counters every 64 KiB. Telegram WEB builds the pinned official relay with per-profile counters and build-time tests. MTProto uses Telemt 3.5.14, with its metrics on the private Docker network and control API disabled. Counter cursors and traffic/quota changes are committed atomically, so repeated samples and panel restarts do not double-count usage. The API is GET /api/reports/traffic?source=clients, with optional hours, user_id and client_id filters. Regular-user requests are always restricted to the authenticated user's connections; Docker reports remain administrator-only.

The traffic page also shows each collector's last successful observation and whether it is active, stale, unreachable, waiting for Apply, or waiting for the MTProto personal-link migration. Empty usage graphs therefore have a concrete collection status next to them.

Independent functional checks run every five minutes by default (WEBSHARE_PROBE_INTERVAL_SECONDS, 0 disables scheduling). These check the actual protocol path instead of container status alone. HTTP-based protocols use two fixed HTTPS destinations; Telegram protocols verify an unauthenticated Telegram response nonce. Each deployment receives a reserved service credential on its next Deploy. It is absent from user/client records, billing and quotas. Older applied snapshots show Needs Apply until the credential is installed. Configure probe_enabled: false to disable scheduling for one deployment; re-enable it before checked updates. Probe results are in the traffic page's Контрольные проверки протоколов disclosure.

Updated native apps submit connection-quality events for their own connections. The Качество подключений report shows successful probes, mean successful HTTPS latency, unexpected disconnects, reconnects and completed connection duration, with user/connection/period filters. Reports retain 30 days of bounded telemetry. Only the coarse network type is submitted; local network fingerprints stay on the device. API routes are POST /api/mobile/clients/{id}/quality and GET /api/reports/quality. Client reports are diagnostic observations, not an additional billing source.

Server activity is considered online when the SSH command succeeds and Docker responds successfully. If SSH fails, Docker is unavailable, or the user cannot run Docker, the check is saved as error and the command output is kept in the check payload for debugging.

Deployment Deploy and Version also inspect the resulting Compose containers. If Docker Compose exits successfully but the VPN container immediately exits, restarts, reports unhealthy, or recent logs contain known fatal markers, the deployment is marked error and the Operations details show the container state, exit code, restart count, health status, and recent logs.

Successful one-shot helper containers, such as Hysteria certgen finishing with Exited (0), are treated as healthy. Server-wide checks also ignore stopped containers from old WebShare Compose projects that are no longer present as active deployments in the local database.

WebShare also runs automatic checks in the background. By default it checks every 60 seconds all active servers that have SSH key or password credentials. Set WEBSHARE_MONITOR_INTERVAL_SECONDS=0 to disable automatic monitoring.

The Overview, Servers, Operations, and Reports views refresh themselves while open, so the latest server status appears without pressing refresh.

Operation Logs

Deploy, update, version, and server check actions run as background operations. The Operations view shows:

  • operation type and target;
  • running / success / error status;
  • current message;
  • command log and final JSON result.

The view refreshes automatically every few seconds while it is open. Routine actions no longer force-switch you to Operations; they show a short operation id in the notice area, and you can open the full details when needed.

CI build selection and caches

Forgejo CI classifies changed paths before packaging. Panel-only changes skip native installers; native UI-only changes skip panel deployment. Changes to the shared core, submodules or workflow rebuild both. Tags, manual runs and unknown base commits build everything. New branch runs cancel obsolete runs for the same ref; tag runs are preserved. Python downloads and native compiler work use caches; cache availability does not determine correctness. The panel image includes Linux amd64/arm64 functional-probe engines, so its checkout includes submodules.

Readiness, login protection and recovery exercises

The admin Готовность системы screen reads the running panel's build commit and UTC build date, the requested/applied protocol images, the images last seen by Docker inspection, and app/core versions reported by active app sessions. Unknown versions and checks that have never run remain explicit. Сравнить с Forgejo CI compares the deployed commit with main and its CI run; a successful CI run alone is not evidence that the panel has deployed. CI stamps the image; manual builds should pass --build-arg WEBSHARE_COMMIT=<full-commit>.

Настройки → Защита от перебора паролей controls persistent account/IP budgets and capped progressive delays. Unknown users take a dummy password verification, failed attempts are audited without plaintext usernames, and a successful login resets that account's budget. Accounts are never permanently locked. Forwarded addresses are ignored unless the immediate peer belongs to an explicitly configured trusted proxy CIDR; keep these limited to your actual reverse proxies. The signing/session secret must remain stable across restarts.

Настройки → Полная проверка восстановления schedules an exercise every 1–90 days or starts it manually. It uses the latest local encrypted copy and its separate recovery key. An ephemeral worker rewraps encrypted integration settings, imports and checks the database, generates restored profiles, starts an isolated panel, logs in with a synthetic user, and verifies a 256 KiB transfer through a synthetic loopback Hysteria2 tunnel. It never starts restored server jobs or executes restored endpoints. Network/DNS and subprocess guards restrict worker activity to these local fixtures; this is process-level isolation, not an OS/container security boundary. The worker has a 120-second deadline, kills its VPN children, and removes its private temporary files. Failed exercises are reported separately from ordinary backup verification. Scheduling starts disabled until configured in the panel.

Replacing one device's credentials

In WebShare apps use Аккаунт → Заменить ключ этого устройства while connected. The server first applies overlapping credentials. The app tests the candidate with two independent tunnel health checks and saves it in protected storage; the panel also checks the candidate protocol before retiring the old key. An ambiguous confirmation reply preserves the verified candidate cache. A failed candidate test restores the previous profile and leaves both keys available.

The web connection menu also has Заменить ключ устройства: prepare a link, import and test it on the device, then explicitly confirm retirement. Telegram proxies use this manual flow; ordinary MTProto must already use personal Telemt links. Unconfirmed keys stay available until confirmed or cancelled. Failed server application can be retried from that dialog. There is no mass rotation. The connection ID, device ownership, traffic history and quota remain intact; each key has its own counter cursor and stable runtime UUID, including Telegram. Applying a runtime can restart a container; this does not promise uninterrupted existing TCP sessions or recreate the panel's protocol record.

Large encrypted backups and streaming restore

Scheduled/manual copies now use the binary WEBSHARE-BACKUP-2 format. A consistent SQLite read transaction exports supported records as compressed, ordered AES-GCM chunks with a per-copy derived key and authenticated end marker. Large traffic tables are parsed and validated in a private temporary SQLite file during restore; no SQL/schema supplied by a backup is executed. The existing import validation, managed-secret rewrapping, runtime guards and SSH-key recovery remain in use. Copies are published only after an isolated restore and count/integrity checks. The separate recovery key is unchanged; legacy encrypted JSON copies remain readable.

The panel uploads new copies in 1 MiB chunks tied to the admin session, checks order/completion and performs verification/restoration as an operation. Abandoned uploads expire after an hour. Downloads use a 90-second, single-use POST ticket and the browser's download manager, without buffering the complete file in JS or placing a credential in the URL. S3 uses multipart upload for large copies and still reads the object back to verify its SHA256. Streaming input is bounded to 128 GiB and individual records to 4 MiB; the old limits remain only for legacy JSON. Allow enough local temporary space for decompression and verification. The backup screen shows database size, free space and a conservative working-space estimate; daily measurements provide a growth forecast after at least two samples.

Release center and publication recovery

Admins can open Приложения → Выпуск приложений → Обновить состояние CI to inspect build/test/protocol/publication stages, recent failures and installer presence. Reading a public repository works without a token. Configure a Forgejo token with permission to dispatch Actions in the collapsed access settings to request publication recovery. This token is encrypted separately from the scoped WebShare builder token and is never returned to the browser.

publish-existing.yml accepts an existing tag and original API run ID. The panel only offers recovery for qualified tag builds whose installer artifact remains available. The workflow independently verifies the original tag, commit and all four prerequisite jobs, extracts only the three expected installers and trust record, then checks signing-key consistency and signs/publishes the manifest. It neither creates/moves a tag nor rebuilds installers. Missing/expired artifacts require a new build. Dispatch status means queued, not published.

TV sign-in from a phone

Choose Войти с телефона in the app. Open the displayed QR/link on your phone, sign in to the existing panel (password or Keycloak), compare the TV code and explicitly approve the displayed device. The TV alone holds an independent 256-bit polling secret and receives a separate session after approval. Codes expire after ten minutes; approval and consumption are single-use. Revoking the approving browser session invalidates an unconsumed approval. MFA policy and active-account checks apply when the TV receives its session. Pairing needs no new Keycloak grant/client configuration and transmits no IdP token to the TV.