Skip to content
Snippets Groups Projects
Verified Commit 8c196d95 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Support installing custom pip packages and settings custom code in settings.py

parent 3becd0cb
No related branches found
No related tags found
No related merge requests found
Pipeline #7460 passed with stage
in 13 seconds
......@@ -141,6 +141,8 @@ Role Variables
| `funkwhale_systemd_after` | `redis.service postgresql.service` | Configuration used for Systemd `After=` directive. Modify it if you have a database or redis server on a separate host |
| `funkwhale_systemd_service_name` | `funkwhale` | Name of the generated Systemd service, e.g when calling `systemctl start <xxx>` |
| `funkwhale_username` | `funkwhale` | Username of the system user and owner of Funkwhale data, files and configuration |
| `funkwhale_custom_pip_packages` | `[]` | A list of additional python packages to download |
| `funkwhale_custom_settings` | `` | Some Python code to append to `api/config/settings/production.py`. Use funkwhale_custom_settings: |` for multiline code. |
Supported platforms
-------------------
......
......@@ -28,3 +28,5 @@ funkwhale_letsencrypt_enabled: true
funkwhale_letsencrypt_skip_cert: false
funkwhale_ssl_cert_path:
funkwhale_ssl_key_path:
funkwhale_custom_settings:
funkwhale_custom_pip_packages: []
......@@ -106,6 +106,17 @@
notify:
- reload funkwhale
- name: "Install custom python dependencies, if any"
when: funkwhale_custom_pip_packages is defined and (funkwhale_custom_pip_packages|length>0)
become: true
become_user: "{{ funkwhale_username }}"
pip:
name: "{{ funkwhale_custom_pip_packages }}"
virtualenv: "{{ funkwhale_install_path }}/virtualenv"
virtualenv_python: python3
notify:
- reload funkwhale
- name: "Install gunicorn/uvicorn"
become: true
become_user: "{{ funkwhale_username }}"
......@@ -118,6 +129,15 @@
notify:
- restart funkwhale
- name: Append custom settings to production.py, if any
become: true
become_user: "{{ funkwhale_username }}"
blockinfile:
path: "{{ funkwhale_install_path }}/api/config/settings/production.py"
insertafter: "EOF"
block: "{{ funkwhale_custom_settings }}"
- name: "Collect static files"
command: "{{ funkwhale_install_path }}/virtualenv/bin/python api/manage.py collectstatic --no-input"
become: true
......
---
- name: "Set frontend path"
when: funkwhale_frontend_managed
tags: [funkwhale, nginx]
set_fact:
funkwhale_frontend_path: "{{ funkwhale_install_path }}/front/dist"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment