chore: add configuration recipes

This commit is contained in:
2023-12-18 16:38:29 +02:00
parent 93793b6424
commit 28589cb122
50 changed files with 1214 additions and 42 deletions

View File

@ -0,0 +1,11 @@
# Distributed
1. Create user `demo` with password from `AHRIMAN_PASSWORD` environment variable.
2. Setup repository named `ahriman-demo` with architecture `x86_64`.
3. Start web server at port `8080`.
4. Start two workers.
5. All updates triggered by the web server will be passed to workers.
6. All updates from worker instances are uploaded to the web service.
7. Repository is available at `http://localhost:8080/repo`.
Note, in this configuration, workers are spawned in replicated mode, thus the backend accesses them in round-robin-like manner.

View File

@ -0,0 +1,85 @@
services:
backend:
image: arcan1s/ahriman:edge
privileged: true
environment:
AHRIMAN_DEBUG: yes
AHRIMAN_OUTPUT: console
AHRIMAN_PASSWORD: ${AHRIMAN_PASSWORD}
AHRIMAN_PORT: 8080
AHRIMAN_PRESETUP_COMMAND: (cat /run/secrets/password; echo; cat /run/secrets/password) | sudo -u ahriman ahriman user-add demo -R full
AHRIMAN_REPOSITORY: ahriman-demo
AHRIMAN_UNIX_SOCKET: /var/lib/ahriman/ahriman/ahriman.sock
configs:
- source: service
target: /etc/ahriman.ini.d/99-settings.ini
secrets:
- password
volumes:
- type: volume
source: repository
target: /var/lib/ahriman
volume:
nocopy: true
command: web
frontend:
image: nginx
ports:
- 8080:80
configs:
- source: nginx
target: /etc/nginx/conf.d/default.conf
volumes:
- type: volume
source: repository
target: /srv
read_only: true
volume:
nocopy: true
worker:
image: arcan1s/ahriman:edge
privileged: true
deploy:
mode: replicated
replicas: 2
environment:
AHRIMAN_DEBUG: yes
AHRIMAN_OUTPUT: console
AHRIMAN_PASSWORD: ${AHRIMAN_PASSWORD}
AHRIMAN_PORT: 8080
AHRIMAN_PRESETUP_COMMAND: (cat /run/secrets/password; echo; cat /run/secrets/password) | sudo -u ahriman ahriman user-add demo -R full
AHRIMAN_REPOSITORY: ahriman-demo
AHRIMAN_REPOSITORY_SERVER: http://frontend/repo/$$repo/$$arch
configs:
- source: worker
target: /etc/ahriman.ini.d/99-settings.ini
secrets:
- password
command: web
configs:
nginx:
file: nginx.conf
service:
file: service.ini
worker:
file: worker.ini
secrets:
password:
environment: AHRIMAN_PASSWORD
volumes:
repository:

View File

@ -0,0 +1,18 @@
server {
listen 80;
location /repo {
rewrite ^/repo/(.*) /$1 break;
autoindex on;
root /srv/ahriman/repository;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarder-Proto $scheme;
proxy_pass http://backend:8080;
}
}

View File

@ -0,0 +1,13 @@
[auth]
target = mapping
[build]
workers = http://worker:8080 http://worker:8080
[status]
username = demo
password = $AHRIMAN_PASSWORD
[web]
enable_archive_upload = yes
wait_timeout = 0

View File

@ -0,0 +1,22 @@
[auth]
target = mapping
[build]
triggers = ahriman.core.upload.UploadTrigger ahriman.core.report.ReportTrigger
[status]
address = http://backend:8080
username = demo
password = $AHRIMAN_PASSWORD
[report]
target = remote-call
[remote-call]
manual = yes
wait_timeout = 0
[upload]
target = remote-service
[remote-service]