try to run auth on staging

Signed-off-by: MiniDigger <admin@minidigger.me>
This commit is contained in:
MiniDigger 2020-09-30 15:38:45 +02:00
parent 7bfdb0754a
commit bebee93c5c
6 changed files with 43 additions and 33 deletions

View File

@ -1 +1,3 @@
FROM postgres:12-alpine
COPY scripts /docker-entrypoint-initdb.d/

View File

@ -0,0 +1,22 @@
#!/bin/bash
set -e
set -u
function create_user_and_database() {
local database=$1
echo " Creating user and database '$database'"
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER $database WITH PASSWORD '$database';
CREATE DATABASE $database;
GRANT ALL PRIVILEGES ON DATABASE $database TO $database;
EOSQL
}
if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES"
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do
create_user_and_database $db
done
echo "Multiple databases created"
fi

View File

@ -1,15 +0,0 @@
version: '3.7'
services:
db:
build: ./db
environment:
POSTGRES_USER: hangar
POSTGRES_PASSWORD: 'hangar'
POSTGRES_DB: hangar
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
volumes:
db_data:

View File

@ -13,20 +13,21 @@ services:
stdin_open: true
labels:
- "traefik.enable=true"
- "traefik.http.services.hangarnew.loadbalancer.server.port=8080"
- "traefik.http.routers.hangarnew.rule=Host(`hangar-new.minidigger.me`)"
- "traefik.http.routers.hangarnew.entrypoints=web-secure"
- "traefik.http.routers.hangarnew.tls=true"
- "traefik.http.routers.hangarnew.tls.options=default"
- "traefik.http.routers.hangarnew.tls.certresolver=default"
- "traefik.http.routers.hangarnew.tls.domains[0].main=minidigger.me"
- "traefik.http.routers.hangarnew.tls.domains[0].sans=*.minidigger.me"
- "traefik.http.services.hangar.loadbalancer.server.port=8080"
- "traefik.http.routers.hangar.rule=Host(`hangar.minidigger.me`)"
- "traefik.http.routers.hangar.entrypoints=web-secure"
- "traefik.http.routers.hangar.tls=true"
- "traefik.http.routers.hangar.tls.options=default"
- "traefik.http.routers.hangar.tls.certresolver=default"
- "traefik.http.routers.hangar.tls.domains[0].main=minidigger.me"
- "traefik.http.routers.hangar.tls.domains[0].sans=*.minidigger.me"
networks:
- web
db:
image: registry.gitlab.com/minidigger/hangar2/db:latest
build: ./db
environment:
POSTGRES_MULTIPLE_DATABASES: hangar,hangarauth
POSTGRES_USER: hangar
POSTGRES_PASSWORD: 'hangar'
POSTGRES_DB: hangar
@ -44,7 +45,7 @@ services:
- "traefik.enable=true"
- "traefik.http.services.hangar-mail.loadbalancer.server.port=8025"
- "traefik.http.routers.hangar-mail.middlewares=basicauth@file"
- "traefik.http.routers.hangar-mail.rule=Host(`hangar-mail-new.minidigger.me`)"
- "traefik.http.routers.hangar-mail.rule=Host(`hangar-mail.minidigger.me`)"
- "traefik.http.routers.hangar-mail.entrypoints=web-secure"
- "traefik.http.routers.hangar-mail.tls=true"
- "traefik.http.routers.hangar-mail.tls.options=default"
@ -60,7 +61,7 @@ services:
labels:
- "traefik.enable=true"
- "traefik.http.services.hangar-auth.loadbalancer.server.port=8000"
- "traefik.http.routers.hangar-auth.rule=Host(`hangar-auth-new.minidigger.me`)"
- "traefik.http.routers.hangar-auth.rule=Host(`hangar-auth.minidigger.me`)"
- "traefik.http.routers.hangar-auth.entrypoints=web-secure"
- "traefik.http.routers.hangar-auth.tls=true"
- "traefik.http.routers.hangar-auth.tls.options=default"
@ -75,9 +76,9 @@ services:
EMAIL_TLS: "false"
EMAIL_HOST_USER: "dum"
EMAIL_HOST_PASSWORD: "dum"
DB_NAME: "spongeauth"
DB_USER: "spongeauth"
DB_PASSWORD: "spongeauth"
DB_NAME: "hangarauth"
DB_USER: "hangar"
DB_PASSWORD: "hangar"
DB_HOST: "hangar_db"
SSO_ENDPOINT_ore: "{ 'sync_sso_endpoint': ('http://hangar_app:9000/api/sync_sso'), 'sso_secret': 'changeme', 'api_key': 'changeme' }"
DEBUG: "false"

View File

@ -10,8 +10,8 @@ fake-user:
hangar:
debug: true
use-webpack: false
auth-url: "https://hangar-auth-new.minidigger.me"
base-url: "https://hangar-new.minidigger.me"
auth-url: "https://hangar-auth.minidigger.me"
base-url: "https://hangar.minidigger.me"
sso:
secret: "changeme"
@ -19,5 +19,5 @@ hangar:
security:
api:
url: "https://hangar-auth-new.minidigger.me"
avatar-url: "https://hangar-auth-new.minidigger.me/avatar/%s?size=120x120"
url: "https://hangar-auth.minidigger.me"
avatar-url: "https://hangar-auth.minidigger.me/avatar/%s?size=120x120"

View File

@ -64,7 +64,7 @@ general.linkout.title = External Link Warning
general.linkout.warning = You have clicked on an external link to "{0}". If you did not intend to visit this link, please go back. Otherwise, click continue.
general.restore = Restore deleted
general.harddelete = Hard delete
general.stagingWarning = This is a staging server for testing purposes. Data could be deleted at any time. Please use our production server at https://hangar.minidigger.me for uploading your plugins!
general.stagingWarning = This is a staging server for testing purposes. Data could be deleted at any time. Please use our production server at <TODO: prod url, lol> for uploading your plugins!
admin.health.title = Hangar Health Report
admin.health.discuss = Missing discussion topic