Optimized Peertube OIDC draft

This commit is contained in:
2025-05-20 04:18:27 +02:00
parent 3c7825fd23
commit 2f1d6a5178
5 changed files with 34 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
- name: "Uninstall auth-openid-connect plugin for Peertube"
command: >
docker exec {{ container_name }} \
npm run plugin:uninstall -- --npm-name {{oidc_plugin}}
ignore_errors: true

View File

@@ -0,0 +1,16 @@
- name: "Install auth-openid-connect plugin for Peertube"
command: >
docker exec {{ container_name }} \
npm run plugin:install -- --npm-name {{oidc_plugin}}
- name: Update Peertube config for OpenID Connect
ansible.builtin.lineinfile:
path: /opt/peertube/config/production.yaml
regexp: '^{{ item.key }}:'
line: "{{ item.key }}: {{ item.value }}"
loop:
- { key: "oidc.client_id", value: "{{ oidc_client_id }}" }
- { key: "oidc.client_secret", value: "{{ oidc_client_secret }}" }
- { key: "oidc.discover_url", value: "{{ oidc_discover_url }}" }
- { key: "oidc.scope", value: "openid email profile" }
become: yes

View File

@@ -13,3 +13,11 @@
- name: "copy docker-compose.yml and env file"
include_tasks: copy-docker-compose-and-env.yml
- name: "Install and activate auth-openid-connect plugin if OIDC is enabled"
include_tasks: enable-oidc.yml
when: applications | is_feature_enabled('oidc',application_id)
- name: "Deinstall and disable auth-openid-connect plugin if OIDC is enabled"
include_tasks: disable-oidc.yml
when: applications | is_feature_enabled('oidc',application_id)