add a login and encrypt the .env so people can't get in and still the api key
This commit is contained in:
+28
-13
@@ -19,17 +19,17 @@ services:
|
||||
image: gitops-watcher
|
||||
container_name: gitops-watcher
|
||||
restart: unless-stopped
|
||||
stop_grace_period: 5m # let a running deploy finish on `docker stop`
|
||||
stop_grace_period: 5m # let a running deploy finish on `docker stop`
|
||||
env_file: .env
|
||||
environment:
|
||||
<<: *paths
|
||||
# pull + rebuild this stack when its own branch gets a new commit
|
||||
# (only when the checkout is clean; see check_self() in app/watcher.py)
|
||||
SELF_UPDATE: "true"
|
||||
SELF_REMOTE: gitea # which remote of this checkout to follow (git remote -v)
|
||||
SELF_REMOTE: gitea # which remote of this checkout to follow (git remote -v)
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- .:/self:ro # this checkout, to compare its commit with the remote
|
||||
- .:/self:ro # this checkout, to compare its commit with the remote
|
||||
# a folder, not the single file: Docker would create a *directory* named
|
||||
# repos.yml if the file didn't exist yet
|
||||
- ./config:/config
|
||||
@@ -37,23 +37,38 @@ services:
|
||||
- /opt/gitops:/opt/gitops
|
||||
|
||||
gitops-web:
|
||||
image: gitops-watcher # same image, built by the service above
|
||||
image: gitops-watcher # same image, built by the service above
|
||||
container_name: gitops-web
|
||||
depends_on: [gitops-watcher]
|
||||
restart: unless-stopped
|
||||
command: ["gunicorn", "--workers", "1", "--threads", "4", "--bind", "0.0.0.0:5000",
|
||||
"--chdir", "/app/web", "app:app"]
|
||||
command:
|
||||
[
|
||||
"gunicorn",
|
||||
"--workers",
|
||||
"1",
|
||||
"--threads",
|
||||
"4",
|
||||
"--bind",
|
||||
"0.0.0.0:5000",
|
||||
"--chdir",
|
||||
"/app/web",
|
||||
"app:app",
|
||||
]
|
||||
ports:
|
||||
- "8088:5000" # LAN only until there's a login in front (e.g. an NPM access list)
|
||||
- "8088:5000" # LAN only until there's a login in front (e.g. an NPM access list)
|
||||
environment:
|
||||
<<: *paths
|
||||
TOKEN_ENVS: GITEA_TOKEN,GITHUB_TOKEN # names only, for the add-repo dropdown
|
||||
TOKEN_ENVS: GITEA_TOKEN,GITHUB_TOKEN # names only, for the add-repo dropdown
|
||||
SECRET_KEY: ${WEB_SECRET_KEY}
|
||||
WEBHOOK_SECRET: ${WEBHOOK_SECRET} # same value goes in the GitHub/Gitea webhook settings
|
||||
WEBHOOK_SECRET: ${WEBHOOK_SECRET} # same value goes in the GitHub/Gitea webhook settings
|
||||
ADMIN_USER: ${WEB_ADMIN_USER}
|
||||
ADMIN_PASSWORD_HASH: ${WEB_ADMIN_PASSWORD_HASH}
|
||||
ENV_ENCRYPTION_KEY: ${ENV_ENCRYPTION_KEY} # the watcher gets it through env_file
|
||||
COOKIE_SECURE: "0"
|
||||
volumes:
|
||||
# NO docker socket: the website can't run containers, only ask the watcher
|
||||
- ./config:/config:ro
|
||||
- ./data:/data:ro # reads state.json...
|
||||
- ./data/local:/data/local # ...but only writes local files
|
||||
- ./data/requests:/data/requests # ...and requests
|
||||
- /opt/gitops:/opt/gitops:ro # reads the clones to show repo files
|
||||
- ./data:/data:ro # reads state.json...
|
||||
- ./data/local:/data/local # ...but only writes local files
|
||||
- ./data/requests:/data/requests # ...and requests
|
||||
- /opt/gitops:/opt/gitops:ro # reads the clones to show repo files
|
||||
|
||||
Reference in New Issue
Block a user