From 387998365eddc95c602c7aa095b8b4c22a65c6f1 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 12:29:57 +0200 Subject: [PATCH 01/10] dependencies: bump pyyaml version to 6.0.1 (enables wheel building in a CPython3.11.2 virtualenv, https://github.com/yaml/pyyaml/issues/601) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 65bdec7..7fcf089 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,5 +17,5 @@ dateutils~=0.6 mutagen~=1.45 Pillow~=9.0 psutil~=5.9 -PyYAML==5.4 +PyYAML==6.0.1 watchdog~=2.1 -- 2.30.2 From 4d54af78be47112cd2377dc7cfb790f592cf2fd0 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 12:49:33 +0200 Subject: [PATCH 02/10] documentation: update settings file location --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7362de1..a07ca2a 100755 --- a/README.md +++ b/README.md @@ -62,8 +62,8 @@ pip install -r requirements.txt ``` ### Configuration -You must write a settings.py file in the `instance` directory (you can just -copy and paste `instance/sample_settings.py`. There still is configuration +You must write a settings.py file in the `instance/settings` directory (you can just +copy and paste `instance/settings/sample.py`. There still is configuration required in this file, check it in for more info. -- 2.30.2 From 1730a8f54b416ec698766d94f56e6e644cb28fe3 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 12:50:02 +0200 Subject: [PATCH 03/10] gitignore: ignore db.sqlite3 and instance/settings/settings.py --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index fd1ca31..e78eae4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ venv/ node_modules/ *.egg-info/ *.egg + +db.sqlite3 +instance/settings/settings.py -- 2.30.2 From d3b5b90d7a7cb723725344513d1f59bceec3cfb6 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 12:54:05 +0200 Subject: [PATCH 04/10] settings: prevent ModuleNotFoundError --- instance/settings/sample.py | 1 + 1 file changed, 1 insertion(+) diff --git a/instance/settings/sample.py b/instance/settings/sample.py index cb90a5b..deffe1e 100644 --- a/instance/settings/sample.py +++ b/instance/settings/sample.py @@ -10,6 +10,7 @@ For Django settings see: https://docs.djangoproject.com/en/3.1/topics/settings/ https://docs.djangoproject.com/en/3.1/ref/settings/ """ +from django.utils import timezone from zoneinfo import ZoneInfo from .prod import * -- 2.30.2 From d59f3402cd638f06d7c5fdaf307b039e54c91997 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 12:57:51 +0200 Subject: [PATCH 05/10] settings/dev: do not require memcached --- instance/settings/dev.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/instance/settings/dev.py b/instance/settings/dev.py index 44d1d29..8b2c276 100755 --- a/instance/settings/dev.py +++ b/instance/settings/dev.py @@ -40,3 +40,9 @@ LOGGING = { }, }, } + +CACHES = { + "default": { + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", + } +} -- 2.30.2 From 2553955eee4960564ec33cc6736bbaf8173e2140 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 13:31:11 +0200 Subject: [PATCH 06/10] settings/dev: provide a dummy SECRET_KEY --- instance/settings/dev.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instance/settings/dev.py b/instance/settings/dev.py index 8b2c276..da836bb 100755 --- a/instance/settings/dev.py +++ b/instance/settings/dev.py @@ -7,6 +7,8 @@ try: except ImportError: pass +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-+@*g!emsz-!6sr8a2z&sighsc8m+1(+oq+#+nne+-txd3^l59t' LOCALE_PATHS = ["aircox/locale", "aircox_streamer/locale"] -- 2.30.2 From d601ad21efdbb5baacdea6bf5b964fd19612f7e8 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 13:34:41 +0200 Subject: [PATCH 07/10] documentation: add a development setup section --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index a07ca2a..d24eb7e 100755 --- a/README.md +++ b/README.md @@ -15,6 +15,30 @@ This project is distributed under GPL version 3. More information in the LICENSE * **cms**: content management system. +## Development setup +Start installing a virtual environment : + +``` +virtualenv venv +source venv/bin/activate +pip install -r requirements.txt +pip install -r requirements_tests.txt +``` + +Then copy the default settings and initiate the database : + +``` +cp instance/settings/sample.py instance/settings/settings.py +DJANGO_SETTINGS_MODULE=instance.settings.dev ./manage.py migrate +``` + +Finally test and run the instance using development settings, and point your browser to http://localhost:8000 : + +``` +DJANGO_SETTINGS_MODULE=instance.settings.dev pytest +DJANGO_SETTINGS_MODULE=instance.settings.dev ./manage.py runserver +``` + ## Scripts Are included various configuration scripts that can be used to ease setup. They assume that the project is present in `/srv/apps/aircox`: -- 2.30.2 From cb6180bfa6f4c11be34accb27cd90af0d8012001 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 13:35:53 +0200 Subject: [PATCH 08/10] documentation: move the scripts subsection into installation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d24eb7e..5741cd0 100755 --- a/README.md +++ b/README.md @@ -39,7 +39,8 @@ DJANGO_SETTINGS_MODULE=instance.settings.dev pytest DJANGO_SETTINGS_MODULE=instance.settings.dev ./manage.py runserver ``` -## Scripts +## Installation +### Scripts Are included various configuration scripts that can be used to ease setup. They assume that the project is present in `/srv/apps/aircox`: @@ -51,7 +52,6 @@ The scripts are written with a combination of `cron`, `supervisord`, `nginx` and `gunicorn` in mind. -## Installation ### Dependencies For python dependencies take a peek at the `requirements.txt` file, plus dependencies specific to Django (e.g. for database: `mysqlclient` for MySql -- 2.30.2 From 04a6eba354c9c36e2d4f2c19e95fe1c8b9276be9 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 13:47:03 +0200 Subject: [PATCH 09/10] settings/dev: switch on debug mode (and get static files served) --- instance/settings/dev.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/instance/settings/dev.py b/instance/settings/dev.py index da836bb..06ce08c 100755 --- a/instance/settings/dev.py +++ b/instance/settings/dev.py @@ -7,6 +7,8 @@ try: except ImportError: pass +DEBUG = True + # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-+@*g!emsz-!6sr8a2z&sighsc8m+1(+oq+#+nne+-txd3^l59t' -- 2.30.2 From 2dd482ba642de4bade873eb14021a1ff1e80042e Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Thu, 28 Sep 2023 14:03:30 +0200 Subject: [PATCH 10/10] documenation: merge technicians content --- README.md | 14 ++++++++++++-- docs/technicians.md | 25 ------------------------- 2 files changed, 12 insertions(+), 27 deletions(-) delete mode 100755 docs/technicians.md diff --git a/README.md b/README.md index 5741cd0..8add534 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,9 @@ ![](/logo.png) -Platform to manage a radio, schedules, website, and so on. We use the power of great tools like Django or Liquidsoap. +A platform to manage radio schedules, website content, and more. It uses the power of great tools like Django or Liquidsoap. This project is distributed under GPL version 3. More information in the LICENSE file, except for some files whose license is indicated inside source code. - ## Features * **streams**: multiple random music streams when no program is played. We also can specify a time range and frequency for each; * **diffusions**: generate diffusions time slot for programs that have schedule informations. Check for conflicts and rerun. @@ -15,6 +14,11 @@ This project is distributed under GPL version 3. More information in the LICENSE * **cms**: content management system. +## Architecture and concepts +Aircox is divided in two main modules: +* `aircox`: basics of Aircox (programs, diffusions, sounds, etc. management); interface for managing a website with Aircox elements (playlists, timetable, players on the website); +* `aircox_streamer`: interact with application to generate audio stream (LiquidSoap); + ## Development setup Start installing a virtual environment : @@ -40,6 +44,12 @@ DJANGO_SETTINGS_MODULE=instance.settings.dev ./manage.py runserver ``` ## Installation +Running Aircox on production involves: +* Aircox modules and a running Django project; +* a supervisor for common tasks (sounds monitoring, stream control, etc.) -- `supervisord`; +* a wsgi and an HTTP server -- `gunicorn`, `nginx`; +* a database supported by Django (MySQL, SQLite, PostGresSQL); + ### Scripts Are included various configuration scripts that can be used to ease setup. They assume that the project is present in `/srv/apps/aircox`: diff --git a/docs/technicians.md b/docs/technicians.md deleted file mode 100755 index 6efab8b..0000000 --- a/docs/technicians.md +++ /dev/null @@ -1,25 +0,0 @@ - -# General information -Aircox is a set of Django applications that aims to provide a radio management solution, and is -written in Python 3.5. - -Running Aircox on production involves: -* Aircox modules and a running Django project; -* a supervisor for common tasks (sounds monitoring, stream control, etc.) -- `supervisord`; -* a wsgi and an HTTP server -- `gunicorn`, `nginx`; -* a database supported by Django (MySQL, SQLite, PostGresSQL); - -# Architecture and concepts -Aircox is divided in three main modules: -* `programs`: basics of Aircox (programs, diffusions, sounds, etc. management); -* `controllers`: interact with application to generate audio stream (LiquidSoap); -* `cms`: create a website with Aircox elements (playlists, timetable, players on the website); - - - - - -# Installation - - -# Configuration -- 2.30.2