update
This commit is contained in:
@@ -15,7 +15,6 @@ SSL_CERTIFICATE_DIR=./config/letsencrypt/live/broker.example.com
|
|||||||
SSL_CERTIFICATE_FILE=fullchain.pem
|
SSL_CERTIFICATE_FILE=fullchain.pem
|
||||||
SSL_CERTIFICATE_KEY_FILE=privkey.pem
|
SSL_CERTIFICATE_KEY_FILE=privkey.pem
|
||||||
|
|
||||||
TAPM_LISTEN_ADDR=:8080
|
|
||||||
TAPM_DATABASE_DSN=file:/data/tapm.db?_pragma=busy_timeout(5000)&_pragma=foreign_keys(1)&_pragma=journal_mode(WAL)
|
TAPM_DATABASE_DSN=file:/data/tapm.db?_pragma=busy_timeout(5000)&_pragma=foreign_keys(1)&_pragma=journal_mode(WAL)
|
||||||
TAPM_PUBLIC_URL=https://broker.example.com
|
TAPM_PUBLIC_URL=https://broker.example.com
|
||||||
TAPM_GITEA_URL=https://git.example.com
|
TAPM_GITEA_URL=https://git.example.com
|
||||||
|
|||||||
+6
-4
@@ -94,12 +94,14 @@ the repository or at an absolute host path.
|
|||||||
Create the initial Gitea administrator:
|
Create the initial Gitea administrator:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker compose exec gitea \
|
./manage.sh create-admin
|
||||||
gitea admin user create \
|
|
||||||
--admin --username taiadmin --email ADMIN-EMAIL \
|
|
||||||
--password 'TEMPORARY-RANDOM-PASSWORD' --must-change-password
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
No Gitea login is hard-coded or stored in `.env`. The command prompts for the
|
||||||
|
administrator username and email, generates a temporary password, and requires
|
||||||
|
it to be changed at first login. The initial web installer is intentionally
|
||||||
|
locked and public registration is disabled.
|
||||||
|
|
||||||
Sign in to Gitea at `https://GITEA_DOMAIN`, create the `TAI` organization, and
|
Sign in to Gitea at `https://GITEA_DOMAIN`, create the `TAI` organization, and
|
||||||
create:
|
create:
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,29 @@ start-direct)
|
|||||||
-f compose.direct.yaml \
|
-f compose.direct.yaml \
|
||||||
up -d --build
|
up -d --build
|
||||||
;;
|
;;
|
||||||
|
create-admin)
|
||||||
|
require_env
|
||||||
|
command -v openssl >/dev/null 2>&1 ||
|
||||||
|
fail "openssl is required to generate the temporary password"
|
||||||
|
printf 'Gitea administrator username [taiadmin]: '
|
||||||
|
read -r admin_username
|
||||||
|
admin_username="${admin_username:-taiadmin}"
|
||||||
|
printf 'Gitea administrator email: '
|
||||||
|
read -r admin_email
|
||||||
|
[[ -n "$admin_email" ]] || fail "an administrator email is required"
|
||||||
|
temporary_password="$(openssl rand -base64 24)"
|
||||||
|
docker compose exec -T gitea gitea admin user create \
|
||||||
|
--admin \
|
||||||
|
--username "$admin_username" \
|
||||||
|
--email "$admin_email" \
|
||||||
|
--password "$temporary_password" \
|
||||||
|
--must-change-password
|
||||||
|
printf '\nGitea administrator created.\n'
|
||||||
|
printf 'Username: %s\n' "$admin_username"
|
||||||
|
printf 'Temporary password: %s\n' "$temporary_password"
|
||||||
|
printf 'Sign in at https://%s/ and change the password immediately.\n' \
|
||||||
|
"$GITEA_DOMAIN"
|
||||||
|
;;
|
||||||
renew)
|
renew)
|
||||||
require_env
|
require_env
|
||||||
[[ "$SSL_MODE" == "letsencrypt" ]] ||
|
[[ "$SSL_MODE" == "letsencrypt" ]] ||
|
||||||
@@ -133,7 +156,7 @@ status)
|
|||||||
docker compose -f compose.yaml -f compose.tls.yaml ps
|
docker compose -f compose.yaml -f compose.tls.yaml ps
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf 'Usage: %s {prepare|bootstrap|start|start-direct|renew|backup|status}\n' "$0"
|
printf 'Usage: %s {prepare|bootstrap|start|start-direct|create-admin|renew|backup|status}\n' "$0"
|
||||||
exit 2
|
exit 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user