proxyauth quickstart: a guided setup that shows you the configuration it writes
Was this useful?
0 unique visitors
The two configuration files are the real interface to ProxyAuth, and
the documentation describes every field in them. But a first vhost, a
first account, and the login rule that opens a vhost to someone are the
three things almost everybody writes first — and the three places where
a small mistake (an empty allow-list, a missing tag_proxyauth, a
plaintext password) costs the most time.
proxyauth quickstart walks through exactly those three:
| Command | Writes to | Result |
|---|---|---|
proxyauth quickstart vhost | routes.yml | a new vhosts: entry with its routes |
proxyauth quickstart users | config.json or the database | a new account |
proxyauth quickstart vhost-access | routes.yml | the login rules of an existing vhost |
Like every other subcommand, they are run as plain proxyauth …
commands and edit the files under /etc/proxyauth/config/.
Three rules the wizard never breaks
1. Nothing is written before it has been shown. Every command ends
its questions by printing the exact block it would add, the file it
would go to, and a Write this? [y/N] prompt. The default is no:
pressing Enter, or answering n, leaves both files byte for byte
unchanged.
2. The block is printed again afterwards, with its file path, under “What was added, so you can write the next one yourself”. The wizard is a shortcut for learning the format, not a layer that hides it. After one or two runs, writing the next vhost by hand is usually faster.
3. routes.yml is edited as text, never re-serialized. Your
comments, ordering and formatting are kept. The new content is inserted
into the file, then the whole result is parsed with the same loader the
server uses — including the check for the old secure key. If it would
not load, nothing is written and you get the parser’s error.
And every write goes through a backup first:
/etc/proxyauth/config/routes.yml.bak-20260916-143012
A bad run is always one mv away from being undone.
How to answer
- Defaults are in brackets.
backend URL [http://127.0.0.1:8000]— press Enter to accept. Most runs can be completed on Enter alone. - Yes/no accepts
y,yes,n,no(ando,oui,non). The capital letter in[Y/n]is the default. - Menus are numbered; Enter picks
1. - Lists are comma separated:
staff, ops. An empty answer is an empty list — which is meaningful for several fields, as you will see. - Passwords are read with hidden input.
Colours are disabled automatically when the output is not a terminal, or
when NO_COLOR is set:
NO_COLOR=1 proxyauth quickstart vhost
quickstart vhost — a vhost and its routes
Six questions.
1 · Hostnames. One or several, comma separated. Several names share one certificate and one policy. The first one is the primary name, used for the default certificate paths.
2 · TLS.
| Choice | What it writes |
|---|---|
| Let’s Encrypt | vhost_cert at /etc/proxyauth/cert/<primary>/fullchain.pem and privkey.pem, plus certbot_renew: true |
| Own certificate | vhost_cert with the two paths you type (same defaults) |
| None | nothing — plain HTTP, local development only |
3 · Who talks to this vhost? This single answer decides cookies and CSRF:
| Choice | Writes |
|---|---|
| Browsers | session_cookie: true, tag_csrf_token: true, login_redirect_url set to the application path, logout_redirect_url: "/" |
| Scripts and APIs | session_cookie: false, tag_csrf_token: false |
4 · Who may sign in here? First a list of groups. If you leave it
empty, it asks for usernames instead. If both stay empty, you get a
warning: a vhost that names nobody accepts no login, and that default is
deliberate. You can fill it in later with quickstart vhost-access.
5 · The application behind it.
- backend URL — default
http://127.0.0.1:8000; - the path it is served at — default
/appfor browsers,/for APIs; - require a session to reach it — default yes (
required_login); - send the visitor’s real IP and Host — default yes
(
forward_proxy_headers).
6 · The login page (browsers only). Serve one from disk on /?
Default yes, from /var/www/login/ with login.html. The generated
route already carries tag_proxyauth: true, so {{ csrf_token }} is
filled in, and cache: false, so each visitor gets their own copy. For
an API, this step is skipped: clients post straight to /auth.
A complete run
Quickstart — a vhost and its routes
───────────────────────────────────
Every question has a default. Press Enter to accept it.
Nothing is written until you confirm at the end.
[1/6] Which hostname does this vhost answer to?
hostname(s) (comma separated): tool.example.com
[2/6] TLS
How is this vhost's certificate handled?
1) Let's Encrypt — ProxyAuth issues and renews it, nothing else to install
2) Own certificate — you provide the cert and key paths
3) None — plain HTTP — local development only
choice [1]:
[3/6] Who talks to this vhost?
choice [1]:
[4/6] Who may sign in here?
groups allowed to log in (comma separated): staff
[5/6] The application behind it
backend URL [http://127.0.0.1:8000]:
path it is served at [/app]:
Require a session to reach it? [Y/n]:
Send the visitor's real IP and Host to the backend? [Y/n]:
[6/6] The login page
Serve a login page from disk on /? [Y/n]:
directory [/var/www/login/]:
index file [login.html]:
The preview, which is exactly what gets written:
vhosts:
- vhost: ["tool.example.com"]
vhost_cert:
cert: "/etc/proxyauth/cert/tool.example.com/fullchain.pem"
key: "/etc/proxyauth/cert/tool.example.com/privkey.pem"
certbot_renew: true
allow_groups: ["staff"]
session_cookie: true
tag_csrf_token: true
login_redirect_url: "/app"
logout_redirect_url: "/"
routes:
# The login page is public by definition — nobody can sign in
# through a page that already requires being signed in.
- prefix: "/"
static: "/var/www/login/"
static_index: "login.html"
tag_proxyauth: true
cache: false
- prefix: "/app"
target: "http://127.0.0.1:8000"
required_login: true
forward_proxy_headers: true
Lists are written in flow style (["a", "b"]), which keeps generated
blocks compact and easy to tell apart from what you wrote by hand.
Where the entry lands
At the end of your existing vhosts: block. If that block is followed
by comments or blank lines that introduce the next section of the file,
the new entry goes above them, so a comment never ends up stranded
over the wrong thing. If the file has no vhosts: key yet, one is
created at the end.
After it
The wizard prints the next steps:
routes.yml is reloaded live — no restart needed for this change.
Issue the certificate: proxyauth certbot new tool.example.com
Then restart once, so the new vhost's certificate gets watched.
Check what it secures: proxyauth routes-audit
The restart matters only for Let’s Encrypt: certificate watchers are
created at startup, so a vhost added to a running server needs one
restart before its renewals are picked up live. If you left step 4
empty, it also reminds you to run quickstart vhost-access.
The page itself — /var/www/login/login.html — is yours to write. A
minimal one:
<form method="POST" action="/auth">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<input type="text" name="username" autocomplete="username">
<input type="password" name="password" autocomplete="current-password">
<button type="submit">Sign in</button>
</form>
quickstart users — an account
Five questions, six when a databases block exists.
1 · Where should this account live? Only asked when a database is
configured; the default is the database, shared by every instance.
Otherwise the account goes to config.json. A login is checked against
both either way.
2 · Username. Required.
3 · Password. First: is this a temporary password you are handing
over? — default yes. If so, the account gets
must_change_password: true, and its next login lands on the reset page
instead of receiving a session. Then the password, typed twice, hidden;
empty or mismatched entries are asked again.
4 · Groups and roles. Groups gate routes. Roles do too, and are also
forwarded to the backend as X-User-Roles.
5 · Email. Needed for proxyauth reset-password to have somewhere
to send the link. With several addresses, it asks which is primary
(default: the first); an answer that is not in the list stops the run.
The password is hashed with Argon2id before anything is written — it never reaches a file or a table in clear. The preview shows the hash shortened to 24 characters for readability; the destination holds it in full.
{
"username": "bob",
"password": "$argon2id$v=19$m=19456,…",
"groups": ["staff"],
"email": [
{ "address": "bob@example.com", "primary": true },
],
"must_change_password": true
}
Into the database
The write uses a live connection, never the local LMDB fallback cache: that cache serves reads during an outage, and a write landing there would vanish at the next sync while looking successful. If the database is unreachable, the run stops and nothing is written.
The schema is created if needed, then the account is inserted — or updated if it exists, including reviving an account that had been soft-deleted. Every instance picks it up on its next incremental scan, within seconds, without a restart.
The wizard then prints the equivalent command, so you can script it:
proxyauth db-add-user --username bob --groups staff \
--email bob@example.com --must-change-password
Into config.json
- An existing username is refused — edit it in the file, or pick another name.
- Only the fields you filled are written; no
"otpkey": nullnoise. - The file is backed up, then rewritten as pretty-printed JSON.
config.jsonis read once at startup: restart for the account to exist. The wizard says so.
quickstart vhost-access — who may sign in on a vhost
This edits the login gate of a vhost: allow_users,
allow_groups, allow_roles, exclude_users. It is not route-level
access control, which decides what a logged-in visitor may reach
afterwards.
Only hosts declared inside a vhosts: group can be edited. These
are vhost-level keys, and a flat route has no group to put them on. If
the file has no group at all, run quickstart vhost first.
1 · Which vhost? A menu of every host declared in your groups, sorted. Before asking anything else, the wizard shows what is in force right now, resolved the way the server resolves it:
Currently on tool.example.com
allow_users : —
allow_groups: staff
allow_roles : —
exclude_users: —
and warns if nothing is allowed — meaning no login succeeds on that vhost today.
2 · Who gets in? Groups, then roles, then usernames. The three combine as an OR: matching any one is enough. Leaving all three empty closes the vhost to every login; the wizard asks you to confirm that explicitly, with no as the default.
3 · Any exception? Usernames in exclude_users are refused even if
a rule above lets them in — even a direct username match.
allow_groups: ["staff"]
allow_roles: ["admin"]
exclude_users: ["contractor-temp"]
Replace, not merge
The four keys already on that entry are removed and replaced, not merged with your answers. That includes block-style lists written by hand:
allow_groups:
- old
- stale
Both the key and its - value lines are removed, so nothing orphaned is
left behind. The new keys are inserted just above the entry’s routes:,
keeping vhost settings together. Everything else on the entry —
session_cookie, certificates, routes, comments — is left alone.
Answering nothing everywhere therefore removes all four keys, which closes the vhost. That is why it asks twice.
Because routes.yml reloads live, the new rule is in force as soon as
the command finishes. Check it:
proxyauth routes-audit
proxyauth check-access --username alice
A first instance in five commands
proxyauth quickstart vhost # the vhost, its login page, the app
proxyauth quickstart users # an account with a temporary password
proxyauth certbot new tool.example.com
systemctl restart proxyauth # watch the new certificate
proxyauth check-access --username bob
Then read what was written:
less /etc/proxyauth/config/routes.yml
That file is the real interface. The wizard only saves you from getting the first entries wrong.
If something goes wrong
- “The generated routes.yml does not parse … nothing written.” Your existing file already has an issue, or the combination does not load. The file is untouched; fix it by hand and run again.
- “No
vhosts:entry in routes.yml declares …” The host exists only on a flat route. Move it into avhosts:group, or create one withquickstart vhost. - “Database is not reachable — nothing written.” Check the
databasesblock andconnect_timeout_secs; the cache is never used as a fallback for writes. - Undo a run:
mv /etc/proxyauth/config/routes.yml.bak-20260916-143012 \
/etc/proxyauth/config/routes.yml
Ask, show, confirm, back up, validate, write — and print the result again so you learn the format instead of depending on the wizard. Three commands for the three things that usually go wrong first.