tested local services

This commit is contained in:
Kyattsukuro 2026-10-19 23:54:14 +02:00
parent f656f415bd
commit c614f576c5
6 changed files with 46 additions and 21 deletions

View File

@ -3,7 +3,7 @@ path: /srv/{{ role_name }}
localservices_override: {} localservices_override: {}
localservices_defaults: localservices_defaults:
networkmount: networkmount:
path: "" dest_path: ""
host: "" host: ""
host_path: "" host_path: ""
args: "" args: ""

View File

@ -1,9 +0,0 @@
- name: restart container
community.docker.docker_compose_v2:
project_src: "{{ path }}"
project_name: "{{ role_name }}"
recreate: "always"
services: ["localservices"]
state: "restarted"
when: not _localservices_already_restarted

View File

@ -16,5 +16,5 @@ galaxy_info:
# NOTE: A tag is limited to a single word comprised of alphanumeric characters. # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role. # Maximum 20 tags per role.
dependencies: #dependencies:
- role: traefik # - role: traefik

View File

@ -5,7 +5,7 @@
- name: ensure that path exists - name: ensure that path exists
file: file:
path: "{{ path }}/config/localservices" path: "{{ path }}/config/wg_confs"
state: directory state: directory
- import_role: - import_role:
@ -15,10 +15,21 @@
host: "{{ localservices.networkmount.host }}" host: "{{ localservices.networkmount.host }}"
host_path: "{{ localservices.networkmount.host_path }}" host_path: "{{ localservices.networkmount.host_path }}"
args: "{{ localservices.networkmount.args }}" args: "{{ localservices.networkmount.args }}"
type: "{{ localservices.networkmount.type }}" dest_path: "{{ localservices.networkmount.dest_path }}"
dest_path: "{{ localservices.localservices.path }}"
when: localservices.networkmount.host | length > 1 when: localservices.networkmount.host | length > 1
- name: write wg0.conf
copy:
content: "{{ localservices.wg_client.wg_conf }}"
dest: "{{ path }}/config/wg0.conf"
- name: template i2psnark.conf
template:
src: "i2psnark.conf.j2"
dest: "{{ path }}/config/i2psnark.config"
when: localservices.i2psnark.url | length > 0
- name: template docker compose - name: template docker compose
template: template:
src: "compose.yml.j2" src: "compose.yml.j2"

View File

@ -1,5 +1,6 @@
services: services:
{% if localservices.wg_client.enabled %} {% if localservices.wg_client.enabled %}
wireguard: wireguard:
image: linuxserver/wireguard image: linuxserver/wireguard
cap_add: cap_add:
@ -13,12 +14,13 @@ services:
sysctls: sysctls:
- net.ipv4.conf.all.src_valid_mark=1 - net.ipv4.conf.all.src_valid_mark=1
volumes: volumes:
- ./config/wg0_conf:/config/wg0.conf - ./config/wg0.conf:/config/wg_confs/wg0.conf
networks: networks:
- proxy - proxy
labels: labels:
traefik.enable: true traefik.enable: true
{% if localservices.aniworld.url | length > 0 %} {% if localservices.aniworld.url | length > 0 %}
traefik.http.routers.aniworld.service: aniworld traefik.http.routers.aniworld.service: aniworld
traefik.http.routers.aniworld.rule: Host(`{{ localservices.aniworld.url }}`) traefik.http.routers.aniworld.rule: Host(`{{ localservices.aniworld.url }}`)
traefik.http.routers.aniworld.tls: "true" traefik.http.routers.aniworld.tls: "true"
@ -29,24 +31,26 @@ services:
{% endif %} {% endif %}
{% if localservices.aniworld.url | length > 0 %} {% if localservices.aniworld.url | length > 0 %}
aniworld: aniworld:
image: ghcr.io/phoenixthrush/aniworld-downloader:latest image: ghcr.io/phoenixthrush/aniworld-downloader:latest
user: "0:0" user: "0:0"
network_mode: "service:wireguard" network_mode: "service:wireguard"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- {{ localservices.aniworld.url }}:/app/Downloads - {{ localservices.aniworld.data_path }}:/app/Downloads
- ./confg/.aniworld:/home/aniworld/.aniworld - ./config/aniworld:/home/aniworld/.aniworld
{% endif %} {% endif %}
{% if localservices.bittorrent.url | length > 0 %} {% if localservices.bittorrent.url | length > 0 %}
bittorrent: bittorrent:
image: linuxserver/qbittorrent:latest image: linuxserver/qbittorrent:latest
networks: networks:
- proxy - proxy
volumes: volumes:
- ./config/qbittorrent:/config - ./config/qbittorrent:/config
- {{ localservices.aniworld.url }}:/downloads - {{ localservices.bittorrent.data_path }}:/downloads
ports: ports:
- 6881:6881 - 6881:6881
- 6881:6881/udp - 6881:6881/udp
@ -68,13 +72,15 @@ services:
traefik.http.routers.qb.middlewares: local-only@file, traefik-auth@file, qb-headers traefik.http.routers.qb.middlewares: local-only@file, traefik-auth@file, qb-headers
traefik.http.services.qb.loadbalancer.passhostheader: "false" traefik.http.services.qb.loadbalancer.passhostheader: "false"
{% endif %}
{% if localservices.i2psnark.url | length > 0 %} {% if localservices.i2psnark.url | length > 0 %}
i2psnark: i2psnark:
image: ypopovych/i2psnark:latest image: ypopovych/i2psnark:latest
volumes: volumes:
- ./config/i2psnark:/snark/config - ./config/i2psnark.config:/snark/config/i2psnark.config
- {{ localservices.aniworld.url }}:/snark/downloads - {{ localservices.i2psnark.data_path }}:/snark/downloads
networks: networks:
- proxy - proxy
environment: environment:
@ -98,6 +104,7 @@ services:
traefik.http.middlewares.i2psnark-headers.headers.customRequestHeaders.Host: {{ localservices.i2psnark.url }} traefik.http.middlewares.i2psnark-headers.headers.customRequestHeaders.Host: {{ localservices.i2psnark.url }}
traefik.http.middlewares.i2psnark-headers.headers.customRequestHeaders.X-Forwarded-Proto: https traefik.http.middlewares.i2psnark-headers.headers.customRequestHeaders.X-Forwarded-Proto: https
traefik.http.routers.i2psnark.middlewares: local-only@file, traefik-auth@file, i2psnark-redirect, i2psnark-headers traefik.http.routers.i2psnark.middlewares: local-only@file, traefik-auth@file, i2psnark-redirect, i2psnark-headers
{% endif %}
networks: networks:
proxy: proxy:

View File

@ -0,0 +1,16 @@
# NOTE: This I2P config file must use UTF-8 encoding
# Last saved: May 19, 2026 7:13 PM
i2psnark.autoStart=true
i2psnark.collapsePanels=true
i2psnark.comments=true
i2psnark.commentsName=
i2psnark.dir=/snark/downloads
i2psnark.i2cpHost={{ localservices.i2psnark.i2pc_host }}
i2psnark.i2cpOptions=inbound.length=3 outbound.length=3 inbound.quantity=3 outbound.quantity=3
i2psnark.i2cpPort=7654
i2psnark.pageSize=50
i2psnark.ratings=true
i2psnark.refreshSeconds=15
i2psnark.startupDelay=3
i2psnark.theme=ubergine
i2psnark.uploaders.total=20