mirror of
https://github.com/Dokploy/website.git
synced 2026-06-15 20:25:25 +02:00
feat: enhance Dokploy installation script to generate and store auth secret
Added functionality to the install script to generate a secure auth secret for Better Auth and store it as a Docker Secret. Updated the service creation command to include the new auth secret, ensuring improved security for Dokploy installations.
This commit is contained in:
@@ -232,11 +232,17 @@ install_dokploy() {
|
|||||||
|
|
||||||
# Generate secure random password for Postgres
|
# Generate secure random password for Postgres
|
||||||
POSTGRES_PASSWORD=$(generate_random_password)
|
POSTGRES_PASSWORD=$(generate_random_password)
|
||||||
|
|
||||||
# Store password as Docker Secret (encrypted and secure)
|
# Store password as Docker Secret (encrypted and secure)
|
||||||
echo "$POSTGRES_PASSWORD" | docker secret create dokploy_postgres_password - 2>/dev/null || true
|
echo "$POSTGRES_PASSWORD" | docker secret create dokploy_postgres_password - 2>/dev/null || true
|
||||||
|
|
||||||
echo "Generated secure database credentials (stored in Docker Secrets)"
|
# Generate secure auth secret for Better Auth
|
||||||
|
AUTH_SECRET=$(openssl rand -hex 32)
|
||||||
|
|
||||||
|
# Store auth secret as Docker Secret (encrypted and secure)
|
||||||
|
echo "$AUTH_SECRET" | docker secret create dokploy_auth_secret - 2>/dev/null || true
|
||||||
|
|
||||||
|
echo "Generated secure database credentials and auth secret (stored in Docker Secrets)"
|
||||||
|
|
||||||
docker service create \
|
docker service create \
|
||||||
--name dokploy-postgres \
|
--name dokploy-postgres \
|
||||||
@@ -277,6 +283,7 @@ install_dokploy() {
|
|||||||
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
|
--mount type=bind,source=/etc/dokploy,target=/etc/dokploy \
|
||||||
--mount type=volume,source=dokploy,target=/root/.docker \
|
--mount type=volume,source=dokploy,target=/root/.docker \
|
||||||
--secret source=dokploy_postgres_password,target=/run/secrets/postgres_password \
|
--secret source=dokploy_postgres_password,target=/run/secrets/postgres_password \
|
||||||
|
--secret source=dokploy_auth_secret,target=/run/secrets/dokploy_auth_secret \
|
||||||
--publish published=3000,target=3000,mode=host \
|
--publish published=3000,target=3000,mode=host \
|
||||||
--update-parallelism 1 \
|
--update-parallelism 1 \
|
||||||
--update-order stop-first \
|
--update-order stop-first \
|
||||||
@@ -285,6 +292,7 @@ install_dokploy() {
|
|||||||
$release_tag_env \
|
$release_tag_env \
|
||||||
-e ADVERTISE_ADDR=$advertise_addr \
|
-e ADVERTISE_ADDR=$advertise_addr \
|
||||||
-e POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password \
|
-e POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password \
|
||||||
|
-e BETTER_AUTH_SECRET_FILE=/run/secrets/dokploy_auth_secret \
|
||||||
$DOCKER_IMAGE
|
$DOCKER_IMAGE
|
||||||
|
|
||||||
sleep 4
|
sleep 4
|
||||||
|
|||||||
Reference in New Issue
Block a user