Initial User Creation
mufaka opened this issue · comments
It took me a bit to sort this out because I couldn't find any documentation on it. Either I missed it or it's not there. Either way, here is how I got it working and this possibly should be added to the quick start documentation for the server.
Set an admin password for the server when running in Docker.
docker run \
-d \
--name tahskr-server \
-v "[YOUR DATA PATH]:/app/data" \
-p [YOUR PORT]:8080 \
-e "TAHSKR_ADMIN_PASSWORD=[YOUR ADMIN PASSWORD]" \
--restart=always \
dullage/tahskr-server:latest
- Replace [YOUR PORT] with the tcp port for tahskr-server to listen on
- Replace [YOUR DATA PATH] with a path on your filesystem where you want the data to be stored.
- Replace [YOUR ADMIN PASSWORD] with an admin password of your choice.
Create a user example with curl
curl -X POST http://[SERVER IP OR NAME]:[YOUR PORT]/user -H 'Content-Type: application/json' -H 'x-admin: [YOUR ADMIN PASSWORD]' -d '{ "username": "[YOUR USERNAME]", "password": "[YOUR PASSWORD]"}'
- Replace [YOUR PORT] with the tcp port the tahskr-server listens on
- Replace [SERVER IP OR NAME] with the server name or ip address of the tahskr-server
- Replace [YOUR ADMIN PASSWORD] with an admin password of your choice.
- Replace [YOUR USERNAME] with the username you want to create
- Replace [YOUR PASSWORD] with the password you want to create for the user
If all goes well you should see an output from the curl command similar to the following:
{"config":null,"created":"2023-09-17T22:34:57.068144","id":1,"username":"[YOUR USERNAME]"}
Thank you for this. The docs are a bit lacking on this front. I'll get them updated shortly.