mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-04-25 09:06:02 +03:00
[GH-ISSUE #734] Feature Request: Add env var options ARCHIVEBOX_USERNAME and ARCHIVEBOX_PASSWORD to initialize admin user on first run without prompting #465
Labels
No labels
expected: maybe someday
expected: next release
expected: release after next
expected: unlikely unless contributed
good first ticket
help wanted
pull-request
scope: all users
scope: windows users
size: easy
size: hard
size: medium
size: medium
status: backlog
status: blocked
status: done
status: idea-phase
status: needs followup
status: wip
status: wontfix
touches: API/CLI/Spec
touches: configuration
touches: data/schema/architecture
touches: dependencies/packaging
touches: docs
touches: js
touches: views/replayers/html/css
why: correctness
why: functionality
why: performance
why: security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ArchiveBox#465
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @marco10x15 on GitHub (May 2, 2021).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/734
I have succesfully deploied via docker using portainer a container on my Synology NAS.
I can access the web gui but i haven't found in the documentation the Admin Password to be used to acces.
How can I find the password or what ENV variable I must set up?
Thank.
Marco.
@pirate commented on GitHub (May 3, 2021):
Right now you have to run
archivebox init --setuporarchivebox manage createsuperuserusing the CLI (it prompts you to choose the admin username and password during initial setup).I'll add some env vars to initialize the admin user without having to run that command ^ in the next version.
@mhfowler commented on GitHub (Aug 17, 2021):
I'm currently working on creating a yunohost package for archivebox, and this feature will also be needed for that.
Or some other way, which I can supply an initial admin and password for archivebox during setup (perhaps as CLI arguments?), without an interactive prompt with the user (since the app is installed via a GUI, without a user directly interacting with the terminal)
@mhfowler commented on GitHub (Aug 18, 2021):
for now I was able to achieve what I needed using expect, but having CLI args for archivebox would probably be cleaner. e.g.
@mhfowler commented on GitHub (Oct 20, 2021):
I've still been running into some bugs with this from users,
for example "install fails with password similar to username"
and "install fails if password contains $ signs"
I could make the expect script more complicated to handle these cases, but actually the best solution would still be if there was ARCHIVEBOX_USERNAME and ARCHIVEBOX_PASSWORD env vars, so I could not use expect at all
@pirate commented on GitHub (Oct 20, 2021):
Those are the default Django password validators kicking in (see settings.py) to try and keep people safe, I suppose we can disable them with another env var or specifically in the case that the pass is loaded via env vars.
@mhfowler commented on GitHub (Oct 21, 2021):
ah interesting. yes I'm having trouble imagining how to pass these validator warnings back to the user, given its non-interactive, so to disable these warnings in the case that a pass is loaded via env vars sounds like a good option to me if possible
@solarchemist commented on GitHub (Jan 19, 2022):
This would be good for Ansible also.
I tried using the expect plugin (which has worked for me before when no other options were available), and it actually worked, but only during the first run of the playbook:
For some reason beyond my understanding, subsequent runs of this task would just freeze indefinitely (this is not a request for support, just noting the weird behaviour and moving on).
Anyway, so that's another reason why it would be great to be able to set the admin user non-interactively. The expect command can be rather fragile at times.
@pirate commented on GitHub (Jan 22, 2022):
Note that you can also insert a USER row directly into the
index.sqlite3db as a temporary hack (instead of using expect). (see here for instructions: https://github.com/ArchiveBox/ArchiveBox/issues/928#issuecomment-1075758078 and https://github.com/ArchiveBox/ArchiveBox/wiki/Upgrading-or-Merging-Archives#modify-the-archivebox-sqlite3-db-directly)@solarchemist commented on GitHub (Jan 23, 2022):
Thanks for the suggestion! If I get the time, I'll look into doing that.
PS. I just pushed the Ansible role I used to install ArchiveBox to Codeberg. The role is quite tailored to my needs, but the more Ansible roles, the merrier, right? :-)
@pirate commented on GitHub (Mar 22, 2022):
For people here looking for a temporary solution, I posted instructions on how to insert a User row directly into the SQLite3 DB here: https://github.com/ArchiveBox/ArchiveBox/issues/928#issuecomment-1075758078 and here https://github.com/ArchiveBox/ArchiveBox/wiki/Upgrading-or-Merging-Archives#modify-the-archivebox-sqlite3-db-directly.
@Nezteb commented on GitHub (Mar 30, 2023):
Chiming in to say that I'd love this feature. The SQLite workaround is cool but I'd rather not mess with that in case the implementation eventually changes.
I'm deploying to https://fly.io/ and for most services I host there, I just need a single
Dockerfileand afly.tomlwithout ever needing to start a remote shell to run a startup/config command.@pirate commented on GitHub (Oct 18, 2023):
This is done and merged into
dev, thanks @benmuth!I'll update the docs to reflect the new feature. For anyone that wants to use this immediately you can run the
devbranch like so: https://github.com/ArchiveBox/ArchiveBox#install-and-run-a-specific-github-branch