Compare commits

..

6 Commits

Author SHA1 Message Date
Lukáš Kucharczyk f1b3417202
docker: add convenience packages 2021-06-21 11:32:43 +02:00
Lukáš Kucharczyk 57c7b06f03
authelia: secure portainer, keycloak, allow local 2021-06-21 11:32:24 +02:00
Lukáš Kucharczyk 11c96fe48d
portainer: allow access to ldap 2021-06-21 11:28:52 +02:00
Lukáš Kucharczyk 8175a62c0b
nginx: make sure https redirect works 2021-06-21 11:28:36 +02:00
Lukáš Kucharczyk 53570a1f08
minor: fix space 2021-06-21 11:11:27 +02:00
Lukáš Kucharczyk a0b1b75a73
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 10:38:18 +02:00
12 changed files with 41 additions and 21 deletions

View File

@ -17,8 +17,8 @@
ports:
- "9091:9091"
networks:
- name: bridge
- name: nginx-internal
- name: external
- name: openldap
volumes:
- "{{ data_folder }}/authelia:/config"
- name: copy nginx endpoint conf

View File

@ -1,7 +1,7 @@
server {
listen 80;
server_name auth.{{ base_domain }};
return 301 https://$host$request_uri;
listen 80;
return 301 https://$server_name$request_uri;
}
server {

View File

@ -26,11 +26,19 @@ authentication_backend:
password: {{ vault_openldap_admin_password }}
access_control:
default_policy: deny
networks:
- name: local
networks:
- 192.168.0.0/24
rules:
- domain: "*.{{ base_domain }}"
networks:
- local
policy: bypass
- domain: portainer.{{ base_domain }}
policy: one_factor
- domain: keycloak.{{ base_domain }}
policy: one_factor
session:
name: authelia_session
secret: somerandomsecret

View File

@ -3,6 +3,9 @@
name:
- docker
- python-pip
- neovim
- fish
- curlie
state: present
update_cache: true
- name: start
@ -12,8 +15,9 @@
- name: add user to group
user:
name: lukas
groups: docker
groups: docker,wheel
append: true
shell: /usr/bin/fish
- name: install python docker
pip:
name:

View File

@ -12,7 +12,7 @@
name: 'jellyfin'
image: linuxserver/jellyfin
networks:
- name: nginx-internal
- name: external
volumes:
- "{{ data_folder }}/jellyfin:/config"
- "{{ media.tv }}:/data/tv"

View File

@ -1,6 +1,7 @@
server {
server_name "jellyfin.{{ base_domain }}";
listen 80;
return 301 https://$host$request_uri;
return 301 https://$server_name$request_uri;
}
server {

View File

@ -5,8 +5,9 @@
ports:
- "8080:8080"
networks:
- name: external
- name: postgres
- name: nginx-internal
- name: openldap
env:
"KEYCLOAK_USER": "{{ vault_keycloak_user }}"
"KEYCLOAK_PASSWORD": "{{ vault_keycloak_password }}"
@ -20,6 +21,6 @@
- name: copy nginx conf
template:
src: "keycloak.conf.j2"
dest: "{{ data_folder }}/nginx/conf.d/{{ role_name}}.{{ base_domain }}.conf"
dest: "{{ data_folder }}/nginx/conf.d/{{ role_name }}.{{ base_domain }}.conf"
mode: "755"
notify: reload nginx

View File

@ -1,6 +1,7 @@
server {
server_name "keycloak.{{ base_domain }}";
listen 80;
return 301 https://$host$request_uri;
return 301 https://$server_name$request_uri;
}
server {

View File

@ -14,11 +14,11 @@
- name: generate self-signed certs
import_tasks: self-signed.yml
when: self_signed
- name: create nginx bridge network
- name: create external bridge network
docker_network:
name: nginx-internal
name: external
attachable: true
internal: true
internal: false
state: present
- name: copy nginx.conf
template:
@ -37,8 +37,7 @@
name: 'nginx'
image: nginx
networks:
- name: bridge
- name: nginx-internal
- name: external
volumes:
- "{{ data_folder }}/nginx/conf.d:/etc/nginx/conf.d"
- "{{ data_folder }}/nginx/nginx.conf:/etc/nginx/nginx.conf"

View File

@ -6,13 +6,19 @@
loop:
- "{{ data_folder }}/openldap"
- "{{ data_folder }}/openldap/data"
- name: create network
docker_network:
name: openldap
attachable: true
internal: true
state: present
- name: run container
docker_container:
name: "openldap"
image: osixia/openldap
hostname: openldap
networks:
- name: nginx-internal
- name: openldap
ports:
- "389:389"
- "636:636"

View File

@ -3,8 +3,8 @@
name: 'portainer'
image: portainer/portainer-ce
networks:
- name: nginx-internal
- name: bridge
- name: external
- name: openldap
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
ports:

View File

@ -1,7 +1,7 @@
server {
listen 80;
server_name portainer.{{ base_domain }};
return 301 https://$host$request_uri;
listen 80;
return 301 https://$server_name$request_uri;
}
server {