From 83185154c807bbb92fda0af5cbbe0c65c9405656 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Wed, 19 Aug 2026 03:02:45 -0700 Subject: [PATCH] Keep first-run setup browser-first --- README.md | 10 +++++----- archivebox/templates/admin/login.html | 2 ++ archivebox/tests/test_server_security_browser.py | 4 ++++ docs/Docker.md | 2 +- docs/Install.md | 2 +- docs/Merging-Collections.md | 2 +- docs/Publishing-Your-Archive.md | 2 +- docs/Quickstart.md | 3 ++- docs/Setting-up-Authentication.md | 3 --- docs/codeblocks.toml | 2 +- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 283059cd..73fef246 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ docker compose pull
  • Start the server, which initializes a new collection automatically.
    docker compose up -d --wait
     
  • -
  • Open http://admin.archivebox.localhost:8000 and follow the setup wizard to create the first admin and configure web access. +
  • Open http://admin.archivebox.localhost:8000/admin/ to create the first admin. If BASE_URL is not configured yet, continue through the web setup wizard.
    
     # run CLI commands inside the server container started above
     docker compose exec archivebox archivebox add 'https://example.com'
    @@ -214,7 +214,7 @@ docker run --rm -v $PWD:/data -it archivebox/archivebox:dev init
     docker run --rm -v $PWD:/data -it archivebox/archivebox:dev install
     
  • -
  • Optional: Start the server then log in to the Admin UI at http://admin.archivebox.localhost:8000. +
  • Optional: Start the server, then open http://admin.archivebox.localhost:8000/admin/ to create the first admin. If BASE_URL is not configured yet, continue through the web setup wizard.
    docker run -v $PWD:/data -p 8000:8000 archivebox/archivebox:dev
     # completely optional, CLI can always be used without running a server
     # docker run -v $PWD:/data -it archivebox/archivebox:dev [subcommand] [--help]
    @@ -270,7 +270,7 @@ archivebox init     # initialize a new collection
     archivebox install  # install all the runtime dependencies (e.g. chrome, single-file, yt-dlp, etc.)
     
  • -
  • Optionally start the server, then open the Admin UI at http://admin.archivebox.localhost:8000 and follow the same setup wizard used by Docker installs. +
  • Optionally start the server, then open http://admin.archivebox.localhost:8000/admin/ to create the first admin. If BASE_URL is not configured yet, continue through the same web setup wizard used by Docker installs.
    archivebox server 0.0.0.0:8000
     # completely optional, CLI can always be used without running a server
     # archivebox [subcommand] [--help]
    @@ -306,7 +306,7 @@ archivebox add 'https://example.com'
     

  • -
  • Optionally start the server, then open the Admin UI at http://admin.archivebox.localhost:8000 and follow the same setup wizard used by Docker installs. +
  • Optionally start the server, then open http://admin.archivebox.localhost:8000/admin/ to create the first admin. If BASE_URL is not configured yet, continue through the same web setup wizard used by Docker installs.
    archivebox server 0.0.0.0:8000
     # completely optional, CLI can always be used without running a server
     # archivebox [subcommand] [--help]
    @@ -339,7 +339,7 @@ archivebox init
     archivebox install
     
  • -
  • Optionally start the server, then open the Admin UI at http://admin.archivebox.localhost:8000 and follow the same setup wizard used by Docker installs. +
  • Optionally start the server, then open http://admin.archivebox.localhost:8000/admin/ to create the first admin. If BASE_URL is not configured yet, continue through the same web setup wizard used by Docker installs.
    archivebox server 0.0.0.0:8000
     # completely optional, CLI can always be used without running a server
     # archivebox [subcommand] [--help]
    diff --git a/archivebox/templates/admin/login.html b/archivebox/templates/admin/login.html
    index 50b3dd51..4679396c 100644
    --- a/archivebox/templates/admin/login.html
    +++ b/archivebox/templates/admin/login.html
    @@ -97,6 +97,7 @@
     
     {% endif %}
     
    +{% if not first_admin_setup %}
     



    @@ -117,6 +118,7 @@ archivebox manage changepassword <username>

    +{% endif %} diff --git a/archivebox/tests/test_server_security_browser.py b/archivebox/tests/test_server_security_browser.py index 9c2766d9..87cea601 100644 --- a/archivebox/tests/test_server_security_browser.py +++ b/archivebox/tests/test_server_security_browser.py @@ -166,6 +166,10 @@ async function main() { await page.goto(config.loginUrl, {waitUntil: "networkidle2", timeout: 15000}); const firstAdminForm = await page.$("#first-admin-form"); if (!firstAdminForm) throw new Error("First admin setup form was not shown"); + const firstAdminText = await page.$eval("body", (element) => element.innerText); + if (firstAdminText.includes("archivebox manage createsuperuser")) { + throw new Error("First admin setup showed the alternate CLI account flow"); + } await page.type('input[name="username"]', config.username); await page.type('input[name="password1"]', config.password); await page.type('input[name="password2"]', config.password); diff --git a/docs/Docker.md b/docs/Docker.md index e712b571..6a080563 100644 --- a/docs/Docker.md +++ b/docs/Docker.md @@ -202,7 +202,7 @@ docker run --rm -it -v "$PWD:/data" archivebox/archivebox:dev init docker run -d --name archivebox -v "$PWD:/data" -p 8000:8000 archivebox/archivebox:dev ``` -Then open and follow the setup wizard. +Then open to create the first admin. If `BASE_URL` is not configured yet, continue through the web setup wizard. *(You can create a collection in any directory you want, `~/archivebox/data` is just used as an example here)* diff --git a/docs/Install.md b/docs/Install.md index 6f10e9cf..2c2e40d1 100644 --- a/docs/Install.md +++ b/docs/Install.md @@ -76,7 +76,7 @@ If you're on macOS or Ubuntu, there is an optional auto-setup script provided. curl -fsSL 'https://get.archivebox.io' | bash # shortcut to run https://raw.githubusercontent.com/ArchiveBox/ArchiveBox/dev/bin/setup.sh ``` -The script uses Docker Compose when available, otherwise plain Docker when it can pull the released image. If Docker is unavailable, it shows the native `uv` install plan and pauses so you can cancel before continuing. It initializes the collection, installs ArchiveBox's runtime dependencies, and starts the server. Open the printed Admin UI URL and follow the setup wizard to create the first admin and configure web access. +The script uses Docker Compose when available, otherwise plain Docker when it can pull the released image. If Docker is unavailable, it shows the native `uv` install plan and pauses so you can cancel before continuing. It initializes the collection, installs ArchiveBox's runtime dependencies, and starts the server. Open the printed Admin UI URL to create the first admin. If `BASE_URL` is not configured yet, continue through the web setup wizard. Run it as your normal user unless you want a system-owned deployment. When run as root, the script creates the `archivebox` service user and places the collection under that account's home directory; it prints the exact path and follow-up commands when finished. diff --git a/docs/Merging-Collections.md b/docs/Merging-Collections.md index e1abdf79..e1ead850 100644 --- a/docs/Merging-Collections.md +++ b/docs/Merging-Collections.md @@ -75,7 +75,7 @@ WHERE username = 'someUsernameHere'; #### Example: Adding a new user with a hashed password -*Note: this is just an example to demonstrate direct database usage. If you are trying to create a user on initial setup, use the [`ADMIN_USERNAME` & `ADMIN_PASSWORD`](https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration#admin_username--admin_password) configuration options.* +*Note: this is just an example to demonstrate direct database usage. For initial setup, open the Admin UI and create the first admin there.* 1. First, generate the hashed password in a Python shell using Django's `make_password` function. diff --git a/docs/Publishing-Your-Archive.md b/docs/Publishing-Your-Archive.md index 93662e86..a6fdb316 100644 --- a/docs/Publishing-Your-Archive.md +++ b/docs/Publishing-Your-Archive.md @@ -14,7 +14,7 @@ archivebox server 0.0.0.0:8000 Open in a browser to create the first admin and finish web setup. To create additional accounts from the CLI, use `archivebox manage createsuperuser`. This server is enabled out-of-the-box if you're using `docker-compose` to run ArchiveBox. -If hosting publicly, complete the first-run wizard before exposing ArchiveBox. It guides you through choosing a security mode and shows the settings to enter in Cloudflare, Nginx Proxy Manager, Caddy, Traefik, Tailscale, or your hosting platform's ingress UI. Configure HTTPS there, then open the canonical URL you chose in the wizard. +If `BASE_URL` is not configured yet, complete the first-run wizard before exposing ArchiveBox. It guides you through choosing a security mode and shows the settings to enter in Cloudflare, Nginx Proxy Manager, Caddy, Traefik, Tailscale, or your hosting platform's ingress UI. Configure HTTPS there, then open the canonical URL you chose in the wizard. Existing `BASE_URL` and security settings are trusted, so configured servers skip this wizard. After ingress is working, set the permissions depending on how public you want the archive to be: diff --git a/docs/Quickstart.md b/docs/Quickstart.md index 2ea67af6..93687f54 100644 --- a/docs/Quickstart.md +++ b/docs/Quickstart.md @@ -71,7 +71,8 @@ docker compose up -d # or without Docker: archivebox server -# Visit http://web.archivebox.localhost:8000 in a browser +# Visit http://admin.archivebox.localhost:8000/admin/ to create the first admin. +# If BASE_URL is not configured yet, continue through the web setup wizard. ``` --- diff --git a/docs/Setting-up-Authentication.md b/docs/Setting-up-Authentication.md index 36066b8b..a3d8fe6b 100644 --- a/docs/Setting-up-Authentication.md +++ b/docs/Setting-up-Authentication.md @@ -43,9 +43,6 @@ archivebox manage changepassword # equivalent: docker run -v $PWD:/data archivebox/archivebox:dev manage [...] ``` -> [!TIP] -> If using Docker, you can set [`ADMIN_USERNAME` & `ADMIN_PASSWORD`](https://github.com/ArchiveBox/ArchiveBox/wiki/Configuration#admin_username--admin_password) to auto-create an admin account on first run. - Existing users can be managed from the Admin UI here: [`/admin/auth/user/`](http://admin.archivebox.localhost:8000/admin/auth/user/), and you can change your password here: [`/admin/password_change/`](http://admin.archivebox.localhost:8000/admin/password_change/). diff --git a/docs/codeblocks.toml b/docs/codeblocks.toml index ba06f18a..55c48391 100644 --- a/docs/codeblocks.toml +++ b/docs/codeblocks.toml @@ -163,7 +163,7 @@ version = 2 # docs/Quickstart.md "d81b70ce03456db1-1" = "illustration" -"40cbdd365d234433-1" = "illustration" +"f3fd34dae6f6f6ab-1" = "illustration" "c84835e713d1c625-1" = "run" # docs/Scheduled-Archiving.md