Compare commits

..

24 Commits

Author SHA1 Message Date
b43560720e README: add Radarr 2021-06-21 13:47:31 +02:00
5e5cb703a6 authelia: radarr=two_factor 2021-06-21 13:09:40 +02:00
9c50a6dcaf radarr: add related vars 2021-06-21 13:09:25 +02:00
2269007083 radarr: add nginx conf 2021-06-21 13:09:11 +02:00
6ebb25af72 radarr: add role 2021-06-21 13:08:59 +02:00
b8364d8163 README: sort alphabetically 2021-06-21 12:02:32 +02:00
7a0a240ad8 readme: add portainer 2021-06-21 12:02:00 +02:00
2a8b5464e6 jellyfin, nginx, openldap: do not restart 2021-06-21 11:55:06 +02:00
e43907992a openldap: remove cruft 2021-06-21 11:55:05 +02:00
6638b4d357 openldap: move above portainer 2021-06-21 11:55:04 +02:00
bdb6b109af docker: add convenience packages 2021-06-21 11:55:03 +02:00
17a5d0550d authelia: secure portainer, keycloak, allow local 2021-06-21 11:55:02 +02:00
45f14658e4 portainer: allow access to ldap 2021-06-21 11:55:01 +02:00
a13a7adf67 nginx: make sure https redirect works 2021-06-21 11:55:00 +02:00
069314f9d6 minor: fix space 2021-06-21 11:54:59 +02:00
c418b61ede Improve networks
Create a single external network called "external".
Create container-specific networks.
Only a few containers need access to these.
So far: openldap, postgres.
2021-06-21 11:54:58 +02:00
f5824a5ffe portainer: copy nginx conf 2021-06-21 11:54:57 +02:00
1ad9787b17 portainer: add nginx-internal network 2021-06-21 11:54:56 +02:00
2593c84400 Set portainer to one_factor 2021-06-21 11:54:55 +02:00
6b70fa2587 portainer: add nginx conf 2021-06-21 11:54:54 +02:00
6702afc8f7 portainer: add main task 2021-06-21 11:54:53 +02:00
7a17b16980 portainer: add role to playbook 2021-06-21 11:54:52 +02:00
a464d287b7 Fix error introduced in 9cf68c4fda 2021-06-21 09:53:25 +02:00
1df2e68180 nginx: log subrequests 2021-06-21 06:14:19 +00:00
10 changed files with 73 additions and 18 deletions

View File

@ -12,12 +12,14 @@ homelab.
=== Containers
* NGINX
* Jellyfin
* OpenLDAP
* PostgreSQL
* Keycloak
* Authelia
* Jellyfin
* Keycloak
* NGINX
* OpenLDAP
* Portainer
* PostgreSQL
* Radarr
=== Testing
To run locally, specify the inventory file with `-i hosts`.

View File

@ -13,4 +13,9 @@ pgid: "1000"
tz: "Europe/Prague"
media:
tv: "{{ data_folder }}/media/tv"
movies: "{{ data_folder }}/media/movies"
movies: "{{ data_folder }}/media/movies"
downloads:
nzb: "{{ data_folder }}/downloads/nzb"
torrent: "{{ data_folder }}/downloads/torrent"
torrent_blackhole: "{{ data_folder }}/downloads/blackhole"
music: "{{ data_folder }}/downloads/music"

View File

@ -3,12 +3,13 @@
roles:
- docker
- nginx
- openldap
- portainer
- jellyfin
- openldap
- postgres
- authelia
- keycloak
- radarr
vars_files:
- vault/certs/{{ base_domain }}.yml
- vault/passwords.yml

View File

@ -39,6 +39,8 @@ access_control:
policy: one_factor
- domain: keycloak.{{ base_domain }}
policy: one_factor
- domain: radarr.{{ base_domain }}
policy: two_factor
session:
name: authelia_session
secret: somerandomsecret

View File

@ -29,7 +29,6 @@
devices:
- /dev/dri:/dev/dri
state: started
restart: yes
- name: copy jellyfin nginx config
template:
src: jellyfin.conf.j2

View File

@ -52,5 +52,4 @@
env:
NGINX_HOST: "{{ base_domain }}"
NGINX_PORT: '80'
state: started
restart: yes
state: started

View File

@ -29,5 +29,4 @@
LDAP_DOMAIN: "kucharczyk.xyz"
LDAP_ADMIN_PASSWORD: "{{ vault_openldap_admin_password }}"
LDAP_REMOVE_CONFIG_AFTER_SETUP: "false"
state: started
restart: yes
state: started

View File

@ -1,6 +0,0 @@
dn: dc=kucharczyk,dc=xyz
objectclass: top
objectclass: dcObject
objectclass: organization
dc: kucharczyk
o: Homelab

View File

@ -0,0 +1,34 @@
- name: ensure directories exist
file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- "{{ data_folder }}/radarr"
- "{{ media.tv }}"
- "{{ media.movies }}"
- "{{ downloads.nzb }}"
- name: run container
docker_container:
name: "{{ role_name }}"
image: "linuxserver/radarr"
networks:
- name: external
env:
"TZ": "{{ tz }}"
"PUID": "{{ puid }}"
"PGID": "{{ pgid }}"
"UMASK": "022"
volumes:
- "{{ data_folder }}/radarr:/config"
- "{{ downloads.nzb }}:/downloads"
- "{{ media.movies }}:/movies"
ports:
- "7878:7878"
state: started
- name: copy nginx conf
template:
src: "{{ role_name }}.conf.j2"
dest: "{{ data_folder }}/nginx/conf.d/{{ role_name }}.{{ base_domain }}.conf"
mode: "755"
notify: reload nginx

View File

@ -0,0 +1,20 @@
server {
server_name {{ role_name }}.{{ base_domain }};
listen 80;
return 301 https://$server_name$request_uri;
}
server {
server_name {{ role_name }}.{{ base_domain }};
listen 443 ssl http2;
include /etc/nginx/snippets/authelia-endpoint.conf;
location / {
include /etc/nginx/snippets/proxy.conf;
include /etc/nginx/snippets/authelia-auth.conf;
set $upstream http://{{ role_name }}:7878;
proxy_pass $upstream;
}
}