Server
aditd opens the control port, the HTTP endpoint, the HTTPS endpoint, and the panel. The agent connects to this process.
Run it
aditd --token bir-belirtec
Flags
| Flag | Environment | Default | Meaning |
|---|---|---|---|
--control | ADIT_CONTROL | 127.0.0.1:7000 | Address the agents connect to |
--control-tls | ADIT_CONTROL_TLS | off | Wraps the control connection in TLS. The agent writes tls://address:port. Token |
--http | ADIT_HTTP | 127.0.0.1:8080 | Public HTTP endpoint |
--https | ADIT_HTTPS | 127.0.0.1:8443 | Off if off |
--ui | ADIT_UI | 127.0.0.1:4590 | Panel and site |
--ui-tls | ADIT_UI_TLS | off | Serves the panel over https://. Turn it on if the panel is open outside the machine |
--no-loopback-admin | ADIT_NO_LOOPBACK_ADMIN | off | A panel request from this machine asks for the token too. Turn it on behind a reverse proxy on the same machine |
--no-signup | ADIT_NO_SIGNUP | off | Disables public self-registration at POST /api/join; existing members and the operator can still sign in |
--ui-password / --ui-password-file | ADIT_UI_PASSWORD / ADIT_UI_PASSWORD_FILE | empty | Separate panel login password (distinct from the agent --token) |
--trusted-proxy | ADIT_TRUSTED_PROXY | empty | Address or CIDR of the reverse proxies in front of you (comma-separated). X-Forwarded-For is read only from these; limits and allow lists apply to the real visitor. Token |
--workdir | empty | Working directory; relative paths are resolved against it. In a service the log is written here too. Windows service | |
--domain | ADIT_DOMAIN | 127.0.0.1.sslip.io | Domain name of the tunnels |
--token | ADIT_TOKEN | required | If it is empty, the server does not start |
--token-file | ADIT_TOKEN_FILE | empty | Reads the token from this file; it does not appear on the command line or in the environment. Not given together with --token |
--previous-token | ADIT_PREVIOUS_TOKEN | empty | The previous one if you changed the token. Names saved with the old one move to the new one. Not accepted for agent login. Token |
--data | ADIT_DATA | adit-data.json | Reserved names. The inspector record (adit-inspect.db) and the generated certificate are written to this file's directory |
--inspect-memory | ADIT_INSPECT_MEMORY | off | Does not write the inspector record to disk; it is deleted on restart. Inspector |
--mask-field | ADIT_MASK_FIELDS | empty | Extra field and header names whose value is always hidden in the inspector (comma-separated). The name matches exactly; case and - _ . do not matter. Inspector |
--mask-path | ADIT_MASK_PATHS | empty | Regular expression that finds the part of the path to hide; group 1, or the whole match if there is no group, becomes ***. Repeatable; in the environment, one expression per line. Inspector |
--downloads | ADIT_DOWNLOADS | dist | Packages to download |
--tls-cert | ADIT_TLS_CERT | empty | Certificate PEM |
--tls-key | ADIT_TLS_KEY | empty | Private key PEM |
--acme-email | ADIT_ACME_EMAIL | empty | Let's Encrypt account. If empty, ACME is off |
--acme-cache | ADIT_ACME_CACHE | empty | Certificate cache |
--acme-staging | off | Let's Encrypt staging directory | |
--tcp-bind | 127.0.0.1 | Address TCP tunnels listen on | |
--tcp-min | 19000 | Start of the port range. 0 means an ephemeral port. In that case --tcp-max is not used. | |
--tcp-max | 19040 | End of the port range | |
--public-url | ADIT_PUBLIC_URL | empty | External base URL behind a reverse proxy (e.g. https://tunl.example.com) |
--public-control | ADIT_PUBLIC_CONTROL | empty | External control host:port advertised in /api/meta and panel commands |
--ssh | ADIT_SSH | empty | Clientless ssh -R gateway listen address (e.g. :2222; auto-generates adit-ssh-hostkey). SSH -R |
--oidc-issuer / --oidc-client-id / --oidc-client-secret | ADIT_OIDC_ISSUER / ADIT_OIDC_CLIENT_ID / ADIT_OIDC_CLIENT_SECRET | empty | Edge OAuth2/OIDC provider credentials for --oauth tunnels. Zero-trust |
--max-domains-per-member | ADIT_MAX_DOMAINS_PER_MEMBER | 5 | Maximum custom domains per member account |
--max-pool-size | ADIT_MAX_POOL_SIZE | 16 | Maximum concurrent replicas in one --pool endpoint |
--max-members | ADIT_MAX_MEMBERS | 4096 | Maximum self-registered member accounts via POST /api/join |
--alert-webhook / --alert-secret | ADIT_ALERT_WEBHOOK / ADIT_ALERT_SECRET | empty | Server-wide Slack/Discord/HTTPS alert webhook and optional HMAC-SHA256 signing secret |
--tor-socks | ADIT_TOR_SOCKS | 127.0.0.1:9050 | Tor SOCKS address for the onion gateway. off, 0, false, no, or kapali disables it. The server still starts if Tor is down. Onion gateway |
Docker
The image uses the Linux package produced first by scripts/dist.ps1. It takes the amd64 or arm64 package that matches the platform.
docker build -t aditd .
docker run -d --name aditd -e ADIT_TOKEN=bir-belirtec -v adit-data:/data -p 7000:7000 -p 8080:8080 -p 8443:8443 -p 4590:4590 aditd
- The process runs as the
tunluser (uid 10001), not as root. Reserved names, the certificate, and the inspector record are under/data. Without-v adit-data:/datathese files leave with the container. If you mount a folder, uid 10001 must be able to write there. - TCP and UDP tunnels listen on
0.0.0.0inside the container. To publish them, add-p 19000-19040:19000-19040 -p 19000-19040:19000-19040/udp. For clientlessssh -R, add-e ADIT_SSH=0.0.0.0:2222 -p 2222:2222. - For the download page, mount the package folder:
-v /opt/tunl/dist:/srv/dist:ro. If you do not mount it, the list looks empty. - The tunnel domain defaults to
127.0.0.1.sslip.io. For public use, pass-e ADIT_DOMAIN=tunnel.example.com. - The container probes itself with
/healthz.docker stopshuts the server down cleanly. - The image does not contain Tor. Set
ADIT_TOR_SOCKS=tor:9050and run a Tor sidecar.
If you pass the token as a Docker secret: -e ADIT_TOKEN_FILE=/run/secrets/adit_token. If you will use the control port in the container from other machines, add -e ADIT_CONTROL_TLS=1 and connect the agent with tls://. The fingerprint of the self-signed certificate is in the docker logs aditd output. If you are behind a reverse proxy, pass the proxy's address as something like -e ADIT_TRUSTED_PROXY=172.17.0.1; if you do not, the limits count every visitor as one person.
Windows service
aditd can run as a service on Windows; it starts with the machine, and if it crashes it is restarted after 5 seconds and again after 30 seconds (it stops on the third crash in one day). As administrator:
aditd service install --name aditd -- --control 127.0.0.1:7000 --token-file C:\tunl\token.txt --data C:\tunl\adit-data.json
aditd service start --name aditd
aditd service stop --name aditd
aditd service uninstall --name aditd
Everything after -- is aditd flags and is written onto the service command line; every user can read that line, so pass the token with --token-file and write full paths. The service starts in its working directory (default: the folder of aditd.exe); relative paths such as --data are resolved against that, not against the system directory Windows starts the service from. Output goes to aditd-service.log in that folder; each time the service starts, if the file has passed 5 MB it is split off as .1. A flag typo is caught during install. If the service drops right after it starts (for example because the port is busy), start says so.
Which account it runs as
The default is LocalSystem: a hole in the server then gives away the whole machine. To install with a narrower account, pass --account:
--account | Account |
|---|---|
system (default) | LocalSystem; privileged for everything |
virtual (recommended) | NT SERVICE\ plus the service name; private to the service, no password, no privilege anywhere |
localservice | NT AUTHORITY\LocalService |
networkservice | NT AUTHORITY\NetworkService |
mkdir C:\ProgramData\aditd
copy token.txt C:\ProgramData\aditd\token.txt
aditd service install --name aditd --account virtual -- --token-file C:\ProgramData\aditd\token.txt
aditd service start --name aditd
- The service folder is given with
--workdir; if that is empty,%ProgramData%\service-name. Install creates the folder and grants the account write permission there. The record file, the inspector record, the session file, and the log stay there. - Because the folder holds the token, reserved names, and the requests under the record, install also removes access for
Users,Authenticated Users, andEveryone; only the service account, administrators, and the system can reach the folder. You see that in theicaclsoutput. - A drive root, the Windows folder,
Program Files,ProgramData,Users, and the profile folder itself are not opened for the account; pick a subfolder inside. - The service account cannot read your user folder (
C:\Users\you). If the program or the token file sits there, install warns and the service does not start; move the program somewhere likeC:\Program Files\tunl.surf, and the token file somewhere like the service folder. service uninstallalso removes the virtual account's permission entry on the folder; the folder itself and the record, log, and data files inside it are not deleted.localserviceandnetworkserviceare shared with other services, so their entries are not touched. If an entry cannot be removed, the command says which identity remains on which folder;icaclscannot delete an entry for an account that has been deleted, so delete it from the folder's Security tab.
Prometheus metrics
The panel listener exposes Prometheus text format (0.0.4) at GET /metrics with active tunnel gauges, HTTP request status classes, HTTP/TCP/SNI byte counters, replay counts, and Tor gateway counts.
curl -H "Authorization: Bearer $ADIT_TOKEN" http://127.0.0.1:4590/metrics
Access is restricted to loopback admin, an operator session, or Authorization: Bearer matching the server token or UI password. Member accounts receive 403 so global server counters remain private.
If there is no package
If the download list is empty, scripts/dist.ps1 is what produces it. The script does not install a file whose SHA256 does not match the list.