From 6085e88f5ee99e9c5c0144d22e657780e4487270 Mon Sep 17 00:00:00 2001 From: Evgenii Alekseev Date: Fri, 5 Jan 2024 12:34:55 +0200 Subject: [PATCH] chore: add index page recipe --- recipes/README.md | 1 + recipes/index/README.md | 6 +++++ recipes/index/compose.yml | 48 +++++++++++++++++++++++++++++++++++++++ recipes/index/nginx.conf | 9 ++++++++ recipes/index/service.ini | 6 +++++ 5 files changed, 70 insertions(+) create mode 100644 recipes/index/README.md create mode 100644 recipes/index/compose.yml create mode 100644 recipes/index/nginx.conf create mode 100644 recipes/index/service.ini diff --git a/recipes/README.md b/recipes/README.md index 9d357985..11ecd538 100644 --- a/recipes/README.md +++ b/recipes/README.md @@ -9,6 +9,7 @@ Collection of the examples of docker compose configuration files, which covers s * [Distributed](distributed): cluster of three nodes, one with web interface and two workers which are responsible for build process. * [Distributed manual](distributed-manual): same as [distributed](distributed), but two nodes and update process must be run on worker node manually. * [i686](i686): non-x86_64 architecture setup. +* [Index](index): repository with index page generator enabled. * [Multi repo](multirepo): run web service with two separated repositories. * [OAuth](oauth): web service with OAuth (GitHub provider) authentication enabled. * [Pull](pull): normal service, but in addition with pulling packages from another source (e.g. GitHub repository). diff --git a/recipes/index/README.md b/recipes/index/README.md new file mode 100644 index 00000000..7f101552 --- /dev/null +++ b/recipes/index/README.md @@ -0,0 +1,6 @@ +# Index + +1. Setup repository named `ahriman-demo` with architecture `x86_64`. +2. Generate index page. +3. Repository is available at `http://localhost:8080/repo`. +4. Index page is available at `http://localhost:8080/repo/ahriman-demo/x86_64/index.html` diff --git a/recipes/index/compose.yml b/recipes/index/compose.yml new file mode 100644 index 00000000..1a508105 --- /dev/null +++ b/recipes/index/compose.yml @@ -0,0 +1,48 @@ +services: + backend: + image: arcan1s/ahriman:edge + privileged: true + + environment: + AHRIMAN_DEBUG: yes + AHRIMAN_OUTPUT: console + AHRIMAN_REPOSITORY: ahriman-demo + + configs: + - source: service + target: /etc/ahriman.ini.d/99-settings.ini + + volumes: + - type: volume + source: repository + target: /var/lib/ahriman + volume: + nocopy: true + + command: repo-report + + 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 + +configs: + nginx: + file: nginx.conf + service: + file: service.ini + +volumes: + repository: diff --git a/recipes/index/nginx.conf b/recipes/index/nginx.conf new file mode 100644 index 00000000..03f07c39 --- /dev/null +++ b/recipes/index/nginx.conf @@ -0,0 +1,9 @@ +server { + listen 80; + + location /repo { + rewrite ^/repo/(.*) /$1 break; + autoindex on; + root /srv/ahriman/repository; + } +} diff --git a/recipes/index/service.ini b/recipes/index/service.ini new file mode 100644 index 00000000..8972e4c3 --- /dev/null +++ b/recipes/index/service.ini @@ -0,0 +1,6 @@ +[report] +target = html + +[html] +path = /var/lib/ahriman/ahriman/repository/ahriman-demo/x86_64/index.html +link_path = http://localhost:8080/repo/ahriman-demo/x86_64