feat: create admin user
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
Some checks failed
Continuous Delivery / build_n_upload (push) Has been cancelled
This commit is contained in:
@@ -22,12 +22,6 @@ USER = forgejo
|
|||||||
|
|
||||||
[security]
|
[security]
|
||||||
INSTALL_LOCK = true
|
INSTALL_LOCK = true
|
||||||
SECRET_KEY = $SECRET_KEY
|
|
||||||
INTERNAL_TOKEN = $INTERNAL_TOKEN
|
|
||||||
|
|
||||||
[service]
|
[service]
|
||||||
DISABLE_REGISTRATION = true
|
DISABLE_REGISTRATION = true
|
||||||
|
|
||||||
[session]
|
|
||||||
PROVIDER = redis
|
|
||||||
PROVIDER_CONFIG = /run/valkey/valkey.sock
|
|
||||||
|
|||||||
@@ -34,6 +34,11 @@ if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | gre
|
|||||||
runuser --user=postgres -- createdb --owner=forgejo forgejo
|
runuser --user=postgres -- createdb --owner=forgejo forgejo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create admin user
|
||||||
|
if ! runuser --user forgejo -- forgejo --config %{_sysconfdir}/forgejo/conf/netoik_app.ini admin user list | grep $(make owner); then
|
||||||
|
runuser --user=forgejo -- forgejo --config %{_sysconfdir}/forgejo/conf/netoik_app.ini admin user create --username samuel --email "samuel.campos@netoik.io" --admin --random-password --random-password-length 30 --fullname "Samuel Campos"
|
||||||
|
fi
|
||||||
|
|
||||||
# Restart forgejo and nginx services
|
# Restart forgejo and nginx services
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
systemctl reenable forgejo.service
|
systemctl reenable forgejo.service
|
||||||
|
|||||||
Reference in New Issue
Block a user