Compare commits

..

4 Commits

14 changed files with 47 additions and 42 deletions

3
Todo.md Normal file
View File

@ -0,0 +1,3 @@
# Todos
- Implement multi language
- Implement rbac administration interface

2
filter_plugins/TODO.md Normal file
View File

@ -0,0 +1,2 @@
# Todos
- Refactor all 4 functions to one

View File

@ -14,7 +14,7 @@ def get_oidc_enabled(applications, application_id):
def get_features_iframe(applications, application_id): def get_features_iframe(applications, application_id):
app = applications.get(application_id) app = applications.get(application_id)
enabled = app.features.iframe enabled = app.get('features', {}).get('iframe', False)
return bool(enabled) return bool(enabled)
def get_database_central_storage(applications, application_id): def get_database_central_storage(applications, application_id):

View File

@ -23,14 +23,19 @@
database_password is defined) database_password is defined)
- name: "seed database values in directory {{ backup_docker_to_local_folder }}" - name: "seed database values in directory {{ backup_docker_to_local_folder }}"
command: command: >
cmd: "python database_entry_seeder.py databases.csv {{database_instance}} {{database_name}} {{database_username}} {{database_password}}" python database_entry_seeder.py databases.csv
"{{ database_instance }}"
"{{ database_name }}"
"{{ database_username }}"
"{{ database_password }}"
args:
chdir: "{{ backup_docker_to_local_folder }}" chdir: "{{ backup_docker_to_local_folder }}"
when: > when:
database_instance is defined and - database_instance is defined
database_name is defined and - database_name is defined
database_username is defined and - database_username is defined
database_password is defined - database_password is defined
- name: Set file permissions for databases.csv to be readable, writable, and executable by root only - name: Set file permissions for databases.csv to be readable, writable, and executable by root only
ansible.builtin.file: ansible.builtin.file:

View File

@ -92,7 +92,7 @@
- name: docker compose up bigbluebutton - name: docker compose up bigbluebutton
command: command:
cmd: "docker-compose -p bigbluebutton up -d --force-recreate{% if mode_cleanup | bool %} --remove-orphans{% endif %}" cmd: "docker-compose -p bigbluebutton up -d --force-recreate --remove-orphans"
# Don't use the --build flag here. This leads to bugs # Don't use the --build flag here. This leads to bugs
chdir: "{{ docker_compose.directories.instance }}" chdir: "{{ docker_compose.directories.instance }}"
environment: environment:

View File

@ -3,9 +3,9 @@ bbb_repository_directory: "{{ docker_compose.directories.services }}"
docker_compose_file_origine: "{{ docker_compose.directories.services }}docker-compose.yml" docker_compose_file_origine: "{{ docker_compose.directories.services }}docker-compose.yml"
docker_compose_file_final: "{{ docker_compose.directories.instance }}docker-compose.yml" docker_compose_file_final: "{{ docker_compose.directories.instance }}docker-compose.yml"
database_instance: "bigbluebutton" database_instance: "bigbluebutton"
database_name: "greenlight-v3" database_name: "" # Database name is empty, because bb uses multiple databases
database_username: "postgres" database_username: "postgres"
database_password: "{{applications.bigbluebutton.postgresql_secret}}" database_password: "{{ applications.bigbluebutton.credentials.postgresql_secret }}"
domain: "{{ domains[application_id] }}" domain: "{{ domains[application_id] }}"
http_port: "{{ ports.localhost.http[application_id] }}" http_port: "{{ ports.localhost.http[application_id] }}"
bbb_env_file_link: "{{ docker_compose.directories.instance }}.env" bbb_env_file_link: "{{ docker_compose.directories.instance }}.env"

View File

@ -11,7 +11,7 @@
# default setup for docker compose files # default setup for docker compose files
- name: docker compose project setup - name: docker compose project setup
command: command:
cmd: "docker-compose -p {{application_id}} up -d --force-recreate{% if mode_cleanup | bool %} --remove-orphans{% endif %}" cmd: "docker-compose -p {{application_id}} up -d --force-recreate --remove-orphans"
chdir: "{{docker_compose.directories.instance}}" chdir: "{{docker_compose.directories.instance}}"
environment: environment:
COMPOSE_HTTP_TIMEOUT: 600 COMPOSE_HTTP_TIMEOUT: 600
@ -22,7 +22,7 @@
# for performance reasons it's not recommended to use this if there is no build tag specified # for performance reasons it's not recommended to use this if there is no build tag specified
- name: docker compose project build and setup - name: docker compose project build and setup
command: command:
cmd: "docker-compose -p {{application_id}} up -d --force-recreate --build{% if mode_cleanup | bool %} --remove-orphans{% endif %}" cmd: "docker-compose -p {{application_id}} up -d --force-recreate --build --remove-orphans"
chdir: "{{docker_compose.directories.instance}}" chdir: "{{docker_compose.directories.instance}}"
environment: environment:
COMPOSE_HTTP_TIMEOUT: 600 COMPOSE_HTTP_TIMEOUT: 600

View File

@ -109,7 +109,7 @@
- name: docker compose project setup - name: docker compose project setup
command: command:
cmd: "docker-compose -p {{application_id}} up -d{% if mode_cleanup | bool %} --remove-orphans{% endif %}" cmd: "docker-compose -p {{application_id}} up -d --remove-orphans"
chdir: "{{docker_compose.directories.instance}}" chdir: "{{docker_compose.directories.instance}}"
environment: environment:
COMPOSE_HTTP_TIMEOUT: 600 COMPOSE_HTTP_TIMEOUT: 600

View File

@ -3,9 +3,6 @@ x-op-app: &app
logging: logging:
driver: journald driver: journald
image: {{custom_openproject_image}} image: {{custom_openproject_image}}
volumes:
- "data:/var/openproject/assets"
- "{{dummy_volume}}:/var/openproject/pgdata" # This mount is unnecessary and just done to prevent anonymous volumes
build: build:
context: {{openproject_plugins_service}} context: {{openproject_plugins_service}}
dockerfile: Dockerfile dockerfile: Dockerfile
@ -46,25 +43,15 @@ services:
condition: service_started condition: service_started
seeder: seeder:
condition: service_started condition: service_started
labels:
- autoheal=true
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health_checks/default"] test: ["CMD", "curl", "-f", "http://localhost:8080/health_checks/default"]
interval: 10s interval: 10s
timeout: 3s timeout: 3s
retries: 3 retries: 3
start_period: 30s start_period: 30s
autoheal:
image: willfarrell/autoheal:1.2.0
container_name: openproject-autoheal
{% include 'roles/docker-compose/templates/services/base.yml.j2' %}
volumes: volumes:
- "/var/run/docker.sock:/var/run/docker.sock" - "data:/var/openproject/assets"
environment: - "{{dummy_volume}}:/var/openproject/pgdata" # This mount is unnecessary and just done to prevent anonymous volumes
AUTOHEAL_CONTAINER_LABEL: autoheal
AUTOHEAL_START_PERIOD: 600
AUTOHEAL_INTERVAL: 30
worker: worker:
<<: *app <<: *app
@ -77,6 +64,10 @@ services:
condition: service_started condition: service_started
seeder: seeder:
condition: service_started condition: service_started
volumes:
- "data:/var/openproject/assets"
- "{{dummy_volume}}:/var/openproject/pgdata" # This mount is unnecessary and just done to prevent anonymous volumes
cron: cron:
<<: *app <<: *app
@ -89,6 +80,9 @@ services:
condition: service_started condition: service_started
seeder: seeder:
condition: service_started condition: service_started
volumes:
- "data:/var/openproject/assets"
- "{{dummy_volume}}:/var/openproject/pgdata" # This mount is unnecessary and just done to prevent anonymous volumes
seeder: seeder:
<<: *app <<: *app
@ -100,6 +94,9 @@ services:
driver: journald driver: journald
restart: on-failure restart: on-failure
{% include 'templates/docker/container/networks.yml.j2' %} {% include 'templates/docker/container/networks.yml.j2' %}
volumes:
- "data:/var/openproject/assets"
- "{{dummy_volume}}:/var/openproject/pgdata" # This mount is unnecessary and just done to prevent anonymous volumes
{% include 'templates/docker/compose/networks.yml.j2' %} {% include 'templates/docker/compose/networks.yml.j2' %}

View File

@ -1,2 +1,2 @@
configuration_destination: "{{nginx.directories.http.servers}}{{domain}}.conf" configuration_destination: "{{nginx.directories.http.servers}}{{domain}}.conf"
final_oauth2_enabled: "{{applications[application_id].get('oauth2_proxy', {}).get('enabled', False)}}" final_oauth2_enabled: "{{applications[application_id].get('features', {}).get('oauth2', False)}}"

View File

@ -6,15 +6,9 @@
cmd: "pkgmgr update pkgmgr" cmd: "pkgmgr update pkgmgr"
when: run_once_pkgmgr_update is not defined when: run_once_pkgmgr_update is not defined
- name: clone {{ package_name }}
command:
cmd: "pkgmgr clone {{ package_name }} --clone-mode https"
notify: "{{ package_notify | default(omit) }}"
ignore_errors: true
- name: update {{ package_name }} - name: update {{ package_name }}
command: command:
cmd: "pkgmgr update {{ package_name }} --dependencies" cmd: "pkgmgr update {{ package_name }} --dependencies --clone-mode https"
notify: "{{ package_notify | default(omit) }}" notify: "{{ package_notify | default(omit) }}"
- name: mark pkgmgr update as done - name: mark pkgmgr update as done

3
tasks/TODO.md Normal file
View File

@ -0,0 +1,3 @@
# todo
- Move update-repository-with-files.yml to own role
- Move copy-docker-compose-and-env.yml to own role

View File

@ -1,10 +1,11 @@
# It isn't best practice to use this task # It isn't best practice to use this task
# Better load the repositories into /opt/docker/[servicename]/services, build them there and then use a docker-compose file for customizing # Better load the repositories into /opt/docker/[servicename]/services, build them there and then use a docker-compose file for customizing
# @todo Refactor\Remove # @todo Refactor\Remove
# @deprecated
- name: "Merge detached_files with applications.oauth2_proxy.configuration_file" - name: "Merge detached_files with applications.oauth2_proxy.configuration_file"
ansible.builtin.set_fact: ansible.builtin.set_fact:
merged_detached_files: "{{ detached_files + [applications.oauth2_proxy.configuration_file] }}" merged_detached_files: "{{ detached_files + [applications.oauth2_proxy.configuration_file] }}"
when: applications[application_id].get('oauth2_proxy', {}).get('enabled', False) | bool when: applications[application_id].get('features', {}).get('oauth2', False) | bool
- name: "backup detached files" - name: "backup detached files"
command: > command: >