mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 18:34:18 +00:00
All configuration via .env file. (This replaces the nopaque.env file)
This commit is contained in:
parent
f32c6e9faa
commit
59003593b6
68
.env.tpl
68
.env.tpl
@ -1,6 +1,62 @@
|
|||||||
# docker GID (getent group docker | cut -d: -f3)
|
### Build ###
|
||||||
docker_gid=
|
# Bash: getent group docker | cut -d: -f3
|
||||||
# GID (id -g)
|
DOCKER_GID=
|
||||||
gid=
|
# Bash: id -g
|
||||||
# UID (id -u)
|
GID=
|
||||||
uid=
|
# Bash: id -u
|
||||||
|
UID=
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Runtime ###
|
||||||
|
# Fill out these variables to use the Docker HTTP socket. When doing this, you
|
||||||
|
# can remove the Docker UNIX socket mount from the docker-compose file.
|
||||||
|
# Example: /home/nopaqued/.docker
|
||||||
|
# DOCKER_CERT_PATH=
|
||||||
|
# Example: host.docker.internal
|
||||||
|
# DOCKER_HOST=
|
||||||
|
# Choose one: False, True
|
||||||
|
# DOCKER_TLS_VERIFY=
|
||||||
|
|
||||||
|
# Choose one: development, production, testing
|
||||||
|
FLASK_CONFIG=
|
||||||
|
# Bash: python -c "import uuid; print(uuid.uuid4().hex)"
|
||||||
|
SECRET_KEY=
|
||||||
|
|
||||||
|
# Example: -
|
||||||
|
GITLAB_USERNAME=
|
||||||
|
# Example: -
|
||||||
|
GITLAB_PASSWORD=
|
||||||
|
|
||||||
|
# Example: smtp.example.com
|
||||||
|
MAIL_SERVER=
|
||||||
|
# Example: 587
|
||||||
|
MAIL_PORT=
|
||||||
|
# Choose one: False, True
|
||||||
|
MAIL_USE_TLS=
|
||||||
|
# Example: nopaque@example.com
|
||||||
|
MAIL_USERNAME=
|
||||||
|
# Example: -
|
||||||
|
MAIL_PASSWORD=
|
||||||
|
|
||||||
|
# Example: nopaque@example.com
|
||||||
|
NOPAQUE_ADMIN=
|
||||||
|
# Example: nopaque@example.com
|
||||||
|
NOPAQUE_CONTACT=
|
||||||
|
# Example: nopaque.localhost
|
||||||
|
NOPAQUE_DOMAIN=
|
||||||
|
# Choose one: CRITICAL, ERROR, WARNING, INFO, DEBUG
|
||||||
|
NOPAQUE_LOG_LEVEL=
|
||||||
|
# Example: nopaque Admin <nopaque@example.com>
|
||||||
|
NOPAQUE_MAIL_SENDER=
|
||||||
|
# Choose one: http, https
|
||||||
|
NOPAQUE_PROTOCOL=
|
||||||
|
# Example: /mnt/nopaque
|
||||||
|
NOPAQUE_STORAGE=
|
||||||
|
|
||||||
|
# Example: nopaque
|
||||||
|
POSTGRES_DB_NAME=
|
||||||
|
# Example: -
|
||||||
|
POSTGRES_USER=
|
||||||
|
# Example: -
|
||||||
|
POSTGRES_PASSWORD=
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
docker-compose.override.yml
|
||||||
nopaque.log
|
nopaque.log
|
||||||
nopaqued.log
|
nopaqued.log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
@ -4,9 +4,9 @@ FROM python:3.6-slim-stretch
|
|||||||
LABEL maintainer="inf_sfb1288@lists.uni-bielefeld.de"
|
LABEL maintainer="inf_sfb1288@lists.uni-bielefeld.de"
|
||||||
|
|
||||||
|
|
||||||
ARG docker_gid=999
|
ARG DOCKER_GID
|
||||||
ARG gid=1000
|
ARG GID
|
||||||
ARG uid=1000
|
ARG UID
|
||||||
ENV LANG=C.UTF-8
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
|
|
||||||
@ -18,9 +18,9 @@ RUN apt-get update \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
RUN groupadd --gid ${docker_gid} --system docker \
|
RUN groupadd --gid ${DOCKER_GID} --system docker \
|
||||||
&& groupadd --gid ${gid} --system nopaqued \
|
&& groupadd --gid ${GID} --system nopaqued \
|
||||||
&& useradd --create-home --gid ${gid} --groups ${docker_gid} --no-log-init --system --uid ${uid} nopaqued
|
&& useradd --create-home --gid ${GID} --groups ${DOCKER_GID} --no-log-init --system --uid ${UID} nopaqued
|
||||||
USER nopaqued
|
USER nopaqued
|
||||||
WORKDIR /home/nopaqued
|
WORKDIR /home/nopaqued
|
||||||
|
|
||||||
|
@ -340,10 +340,10 @@ def create_mail_notifications(notification_service):
|
|||||||
data.job.user.email)
|
data.job.user.email)
|
||||||
subject_template = '[nopaque] Status update for your Job/Corpora: {title}!'
|
subject_template = '[nopaque] Status update for your Job/Corpora: {title}!'
|
||||||
subject_template_values_dict = {'title': data.job.title}
|
subject_template_values_dict = {'title': data.job.title}
|
||||||
|
protocol = os.environ.get('NOPAQUE_PROTOCOL')
|
||||||
domain = os.environ.get('NOPAQUE_DOMAIN')
|
domain = os.environ.get('NOPAQUE_DOMAIN')
|
||||||
url = '{domain}/{jobs}/{id}'.format(domain=domain,
|
url = '{protocol}://{domain}/{jobs}/{id}'.format(
|
||||||
jobs='jobs',
|
protocol=protocol, domain=domain, jobs='jobs', id=data.job.id)
|
||||||
id=data.job.id)
|
|
||||||
body_template_values_dict = {'username': data.job.user.username,
|
body_template_values_dict = {'username': data.job.user.username,
|
||||||
'id': data.job.id,
|
'id': data.job.id,
|
||||||
'title': data.job.title,
|
'title': data.job.title,
|
||||||
|
@ -47,10 +47,10 @@ def __create_mail_notifications(notification_service):
|
|||||||
data.job.user.email)
|
data.job.user.email)
|
||||||
subject_template = '[nopaque] Status update for your Job/Corpora: {title}!'
|
subject_template = '[nopaque] Status update for your Job/Corpora: {title}!'
|
||||||
subject_template_values_dict = {'title': data.job.title}
|
subject_template_values_dict = {'title': data.job.title}
|
||||||
|
protocol = os.environ.get('NOPAQUE_PROTOCOL')
|
||||||
domain = os.environ.get('NOPAQUE_DOMAIN')
|
domain = os.environ.get('NOPAQUE_DOMAIN')
|
||||||
url = '{domain}/{jobs}/{id}'.format(domain=domain,
|
url = '{protocol}://{domain}/{jobs}/{id}'.format(
|
||||||
jobs='jobs',
|
protocol=protocol, domain=domain, jobs='jobs', id=data.job.id)
|
||||||
id=data.job.id)
|
|
||||||
body_template_values_dict = {'username': data.job.user.username,
|
body_template_values_dict = {'username': data.job.user.username,
|
||||||
'id': data.job.id,
|
'id': data.job.id,
|
||||||
'title': data.job.title,
|
'title': data.job.title,
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
version: '3.5'
|
version: '3.5'
|
||||||
|
|
||||||
networks:
|
|
||||||
reverse-proxy:
|
|
||||||
external:
|
|
||||||
name: reverse-proxy
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
redis-trash1:
|
redis-trash1:
|
||||||
|
|
||||||
@ -12,72 +7,35 @@ services:
|
|||||||
web:
|
web:
|
||||||
build:
|
build:
|
||||||
args:
|
args:
|
||||||
gid: ${gid}
|
GID: ${GID}
|
||||||
uid: ${uid}
|
UID: ${UID}
|
||||||
context: ./web
|
context: ./web
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
- redis
|
- redis
|
||||||
env_file: nopaque.env
|
env_file: .env
|
||||||
image: nopaque/web
|
image: nopaque/web
|
||||||
labels:
|
|
||||||
- "traefik.docker.network=reverse-proxy"
|
|
||||||
- "traefik.enable=true"
|
|
||||||
### <http> ###
|
|
||||||
- "traefik.http.middlewares.nopaque-header.headers.customrequestheaders.X-Forwarded-Proto=http"
|
|
||||||
- "traefik.http.routers.nopaque.entrypoints=web"
|
|
||||||
- "traefik.http.routers.nopaque.middlewares=nopaque-header, redirect-to-https@file"
|
|
||||||
- "traefik.http.routers.nopaque.rule=Host(`nopaque.localhost`)"
|
|
||||||
### </http> ###
|
|
||||||
### <https> ###
|
|
||||||
- "traefik.http.middlewares.nopaque-secure-header.headers.customrequestheaders.X-Forwarded-Proto=https"
|
|
||||||
- "traefik.http.routers.nopaque-secure.entrypoints=web-secure"
|
|
||||||
- "traefik.http.routers.nopaque-secure.middlewares=hsts-header@file, nopaque-secure-header"
|
|
||||||
- "traefik.http.routers.nopaque-secure.rule=Host(`nopaque.localhost`)"
|
|
||||||
- "traefik.http.routers.nopaque-secure.tls.options=intermediate@file"
|
|
||||||
### </https> ###
|
|
||||||
### <basicauth help="https://docs.traefik.io/middlewares/basicauth/"> ###
|
|
||||||
# - "traefik.http.middlewares.nopaque-basicauth.basicauth.users=name:hashed-password"
|
|
||||||
# - "traefik.http.routers.nopaque.middlewares=nopaque-basicauth, nopaque-header, redirect-to-https@file"
|
|
||||||
# - "traefik.http.routers.nopaque-secure.middlewares=nopaque-basicauth, hsts-header@file, nopaquesecure-header"
|
|
||||||
### </basicauth> ###
|
|
||||||
networks:
|
|
||||||
- default
|
|
||||||
- reverse-proxy
|
|
||||||
volumes:
|
volumes:
|
||||||
- "/mnt/dind-swarm/nopaque:/mnt/dind-swarm/nopaque"
|
|
||||||
- "./logs:/home/nopaque/logs"
|
- "./logs:/home/nopaque/logs"
|
||||||
- "./web/app:/home/nopaque/app"
|
- "${NOPAQUE_STORAGE}:${NOPAQUE_STORAGE}"
|
||||||
- "./web/migrations:/home/nopaque/migrations"
|
|
||||||
- "./web/tests:/home/nopaque/tests"
|
|
||||||
- "./web/config.py:/home/nopaque/config.py"
|
|
||||||
- "./web/docker-entrypoint.sh:/home/nopaque/docker-entrypoint.sh"
|
|
||||||
- "./web/nopaque.py:/home/nopaque/nopaque.py"
|
|
||||||
- "./web/requirements.txt:/home/nopaque/requirements.txt"
|
|
||||||
daemon:
|
daemon:
|
||||||
build:
|
build:
|
||||||
args:
|
args:
|
||||||
docker_gid: ${docker_gid}
|
DOCKER_GID: ${DOCKER_GID}
|
||||||
gid: ${gid}
|
GID: ${GID}
|
||||||
uid: ${uid}
|
UID: ${UID}
|
||||||
context: ./daemon
|
context: ./daemon
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
- web
|
- web
|
||||||
env_file: nopaque.env
|
env_file: .env
|
||||||
image: nopaque/daemon
|
image: nopaque/daemon
|
||||||
volumes:
|
volumes:
|
||||||
- "/mnt/dind-swarm/nopaque:/mnt/dind-swarm/nopaque"
|
|
||||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||||
- "./logs:/home/nopaqued/logs"
|
- "./logs:/home/nopaqued/logs"
|
||||||
- "./daemon/logger:/home/nopaqued/logger"
|
- "${NOPAQUE_STORAGE}:${NOPAQUE_STORAGE}"
|
||||||
- "./daemon/notify:/home/nopaqued/notify"
|
|
||||||
- "./daemon/tasks:/home/nopaqued/tasks"
|
|
||||||
- "./daemon/docker-entrypoint.sh:/home/nopaqued/docker-entrypoint.sh"
|
|
||||||
- "./daemon/nopaqued.py:/home/nopaqued/nopaqued.py"
|
|
||||||
- "./daemon/requirements.txt:/home/nopaqued/requirements.txt"
|
|
||||||
db:
|
db:
|
||||||
env_file: nopaque.env
|
env_file: .env
|
||||||
image: postgres:11
|
image: postgres:11
|
||||||
volumes:
|
volumes:
|
||||||
- "/srv/nopaque/db:/var/lib/postgresql/data"
|
- "/srv/nopaque/db:/var/lib/postgresql/data"
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
### Docker ###
|
|
||||||
# Fill out these variables to use the Docker HTTP socket. When doing this, you
|
|
||||||
# can remove the Docker UNIX socket mount from the docker-compose file.
|
|
||||||
# DOCKER_CERT_PATH=
|
|
||||||
# DOCKER_HOST=
|
|
||||||
# DOCKER_TLS_VERIFY=
|
|
||||||
|
|
||||||
### Flask ###
|
|
||||||
FLASK_CONFIG=
|
|
||||||
SECRET_KEY=
|
|
||||||
|
|
||||||
### GitLab Registry ###
|
|
||||||
GITLAB_USERNAME=
|
|
||||||
GITLAB_PASSWORD=
|
|
||||||
|
|
||||||
### Flask-Mail ###
|
|
||||||
MAIL_SERVER=
|
|
||||||
MAIL_PORT=
|
|
||||||
MAIL_USE_TLS=
|
|
||||||
MAIL_USERNAME=
|
|
||||||
MAIL_PASSWORD=
|
|
||||||
|
|
||||||
### nopaque ###
|
|
||||||
NOPAQUE_ADMIN=
|
|
||||||
NOPAQUE_CONTACT=
|
|
||||||
NOPAQUE_DOMAIN=
|
|
||||||
NOPAQUE_LOG_LEVEL=
|
|
||||||
NOPAQUE_MAIL_SENDER=
|
|
||||||
NOPAQUE_STORAGE=
|
|
||||||
NOPAQUE_EXECUTE_NOTIFICATIONS=
|
|
||||||
|
|
||||||
### PostgreSQL ###
|
|
||||||
POSTGRES_DB_NAME=
|
|
||||||
POSTGRES_USER=
|
|
||||||
POSTGRES_PASSWORD=
|
|
@ -4,8 +4,8 @@ FROM python:3.6-slim-stretch
|
|||||||
LABEL maintainer="inf_sfb1288@lists.uni-bielefeld.de"
|
LABEL maintainer="inf_sfb1288@lists.uni-bielefeld.de"
|
||||||
|
|
||||||
|
|
||||||
ARG uid=1000
|
ARG UID
|
||||||
ARG gid=1000
|
ARG GID
|
||||||
ENV FLASK_APP=nopaque.py
|
ENV FLASK_APP=nopaque.py
|
||||||
ENV LANG=C.UTF-8
|
ENV LANG=C.UTF-8
|
||||||
|
|
||||||
@ -21,8 +21,8 @@ RUN apt-get update \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
RUN groupadd --gid "${gid}" --system nopaque \
|
RUN groupadd --gid ${GID} --system nopaque \
|
||||||
&& useradd --create-home --gid "${gid}" --no-log-init --system --uid "${uid}" nopaque
|
&& useradd --create-home --gid ${GID} --no-log-init --system --uid ${UID} nopaque
|
||||||
USER nopaque
|
USER nopaque
|
||||||
WORKDIR /home/nopaque
|
WORKDIR /home/nopaque
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user