I’m trying to setup a Docker container, “ready to go”, bootstrapped out-of-the-box with users. Unfortunately, I can’t work out how to add users, given the current options…
Install screen - I’d like to setup the users programatically as part of an automatic deployment (so this won’t work)
Use the gitea shell command - I don’t have access to the container shell remotely (unless I setup an ssh server )
REST API - requires an existing user account to be specified, otherwise I get 403 Forbidden (chicken and egg problem, no users exist)
Questions:
Are there any other options?
Does Gitea have a default admin account?
Does the REST API accept a SECRET_KEY HTTP header as an authentication mechanism?
I could use OAuth…
I could “roll my own” Dockerfile to setup a default user account…
but I wanted to check there wasn’t a supported method out there already.
@daviian, re: “bootstrap” - I’m getting an error when I try to add a user, before gitea has been run for the first time.
./gitea admin create-user --name admin --password admin123 --email admin@mountain-pass.com.au --admin
...
CreateUser: no such table: user
So I assume what is happening, is the command is trying to insert a user record straight into the database table, but the database table hasn’t been setup yet…
Is there anyway I can setup the tables (before running gitea)?
e.g. perhaps using gitea-db.sql from the backup/restore process? (incidently, I tried to get hold of a copy of gitea-db.sql from my current system using ./gitea dump, but the file wasn’t created. . No samples available in the source code either.)
Unfortunately there is currently no way to setup the tables before actually running gitea.
However I like the idea to have a cli command that only performs the initial database steps including migrations.
Would you mind creating a feature request on github?