mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 14:51:43 +00:00
chore: add configuration recipes
This commit is contained in:
11
recipes/distributed/README.md
Normal file
11
recipes/distributed/README.md
Normal 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.
|
85
recipes/distributed/compose.yml
Normal file
85
recipes/distributed/compose.yml
Normal 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:
|
18
recipes/distributed/nginx.conf
Normal file
18
recipes/distributed/nginx.conf
Normal 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;
|
||||
}
|
||||
}
|
13
recipes/distributed/service.ini
Normal file
13
recipes/distributed/service.ini
Normal 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
|
22
recipes/distributed/worker.ini
Normal file
22
recipes/distributed/worker.ini
Normal 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]
|
Reference in New Issue
Block a user