Commit Graph

17437 Commits

Author SHA1 Message Date
jo b527c2704d feat(shared): add suffix to shared config models 2022-01-21 11:54:00 +02:00
Weblate (bot) 76069006b5
chore: Translations update from Hosted Weblate (#1529)
* chore: translated using weblate (Turkish)

Currently translated at 41.7% (400 of 959 strings)

Translation: LibreTime/Legacy
Translate-URL: https://hosted.weblate.org/projects/libretime/legacy/tr/

* chore: translated using weblate (Turkish)

Currently translated at 42.1% (404 of 959 strings)

Translation: LibreTime/Legacy
Translate-URL: https://hosted.weblate.org/projects/libretime/legacy/tr/

Co-authored-by: ToldYouThat <itoldyouthat@protonmail.com>
2022-01-21 11:17:46 +02:00
Jonas L 1561353b20
feat(shared): allow cli parametrized decorators (#1527) 2022-01-20 07:30:35 +02:00
dependabot[bot] 2de1ce6e0d
chore: bump php-amqplib/php-amqplib from 3.1.1 to 3.1.2 in /legacy (#1526)
Bumps [php-amqplib/php-amqplib](https://github.com/php-amqplib/php-amqplib) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/php-amqplib/php-amqplib/releases)
- [Changelog](https://github.com/php-amqplib/php-amqplib/blob/master/CHANGELOG.md)
- [Commits](https://github.com/php-amqplib/php-amqplib/compare/v3.1.1...v3.1.2)

---
updated-dependencies:
- dependency-name: php-amqplib/php-amqplib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-19 12:06:38 +02:00
jo 2cae31a97a refactor(analyzer): redefine *_analyzer into steps
- update imports and names
- define step as a protocol
- extract analyzer function from classes
2022-01-18 11:18:19 +02:00
jo f6a52c8324 refactor(analyzer): rename analyzer files 2022-01-18 11:18:19 +02:00
jo 2a8da1e931 test(shared): assert key is from file 2022-01-18 11:14:24 +02:00
jo b1ecf25d6f feat(shared): allow loading from ini config file 2022-01-18 11:14:24 +02:00
jo 65dff91d47 fix(shared): tmp_path fixture type mismatch 2022-01-18 11:14:24 +02:00
jo 100784cb78 fix(shared): prevent child override by empty dict 2022-01-18 11:14:24 +02:00
Jonas L f42d67d41d
fix(legacy): api migration config variable name (#1522) 2022-01-18 09:36:40 +02:00
Jonas L 5364911922
feat(playout): migrate notify cli to click (#1519)
Fixes #1502

- replace notify option parser with click
- refactor call from liquidsoap to playout-notify

BREAKING CHANGE: the libretime-layout-notify log file in '/var/log/airtime/pypo-liquidsoap/notify.log' was removed and merged into the existing '/var/log/libretime/liquidsoap.log' log file.
2022-01-17 11:51:32 +02:00
Jonas L fe0b2c4a7a
feat(analyzer): enhance analyzer cli and logging (#1507)
Some initial work on modernizing the analyzer app. This replace any custom logger or `logging` based logger with the logging tools from `libretime_shared.logging` and `loguru`.

- rename cli to main
- use pathlib in setup.py
- add api-client and shared package as dev deps
- rework main entrypoint cli to use click and shared helpers
- remove unused imports
- replace logging with logger
- rework analyzer app using shared abstract app
- move analyzer log path to systemd service
- change analyzer working dir

BREAKING CHANGE: The analyzer cli has been reworked and uses new flags / environnement variables for configuration.
`--debug` flag becomes `--log-level <level>`
`--rmq-config-file` flag becomes `--config <filepath>`
`--http-retry-queue-file` flag becomes `--retry-queue-filepath`.
`retry-queue-filepath` default value changed from `/tmp/airtime_analyzer_http_retries` to `retry_queue` in the working dir.
`LIBRETIME_CONF_DIR` environnement variable replaced by `LIBRETIME_CONFIG_FILEPATH`.

BREAKING CHANGE: When running analyzer as a systemd service, the working directory is now /var/lib/libretime/analyzer.
2022-01-17 10:26:30 +02:00
jo bf59f20ffd feat(api): allow to run without log file for dev
BREAKING CHANGE: moved production api log file
from '/var/log/airtime/api.log' to '/var/log/libretime/api.log'
2022-01-17 09:49:22 +02:00
jo 401808d7d1 fix(api): duplicate exception raising and close file 2022-01-17 09:49:22 +02:00
jo ad7686e8a7 feat(api): update env var settings loading
BREAKING CHANGE: environment variables names changed
'LIBRETIME_CONF_DIR' was removed
'LIBRETIME_CONF_FILE' was renamed to 'LIBRETIME_CONFIG_FILEPATH'
2022-01-17 09:49:22 +02:00
Jonas L 19faffea16
fix: make vagrant source.list update idempotent (#1520) 2022-01-17 09:33:09 +02:00
Kyle Robbertze 8b4260d74b fix(legacy): correct linting issues 2022-01-15 00:51:01 +01:00
jo dc93189962 fix(shared): require click >=8.0.3 2022-01-14 19:36:40 +02:00
jo b37f4f7509 fix(playout): optional log_file for liquidsoap 2022-01-14 19:36:40 +02:00
Jonas L 4443528cf8
ci: cancel duplicate test workflow (#1513) 2022-01-13 19:35:42 +02:00
Jonas L c2cd1c28b8
chore: rename master branch to main (#1508) 2022-01-13 16:03:31 +00:00
Jonas L 5c72f714a8
feat(playout): enhance playout logging (#1495)
Some initial work on modernizing the playout app. This replace any custom logger or
logging based logger with the logging tools from libretime_shared.logging and loguru.

Removed all the thread/function assigned logger (self.logger = ...), as this makes it
part of the logic (passing logger though function args) as it should not.

Of a dedicated logger is required for a specific task, it should use
the create_task_logger function.

- refactor: remove dead code
- refactor: remove py2 specific fix
- feat: remove unused test command
- feat: setup shared cli and logging tools
- feat: replace logging with loguru
- feat: setup shared cli and logging tools for notify
- fix: warn method deos not exist
- feat: make cli setup the entrypoint
- fix: install shared modules globally in production
  use extra_requires to load local packages in dev environement
- feat: configure log path in systemd service
- feat: default behavior is to log to console only
- feat: create log dir during install
- chore: add comment
- fix: don't create useless dir in install
- fix: move notify logs to /var/log/libretime dir
- fix: update setup_logger attrs
- style: linting
- fix: replace verbosity flag with log-level flag
- feat: use shared logging tool in liquidsoap
- fix: pass logger down to api client
- feat: allow custom log_filepath in liquidsoap config
- chore: add pylintrc to playout
- refactor: fix pylint errors
- feat: set liquidsoap log filepath in systemd service
- fix: missing setup entrypoint update

BREAKING CHANGE: for playout and liquidsoap the default log file path changed to None
and will only log to the console when developing / testing. Unless you are running the
app as a systemd service (production) the default logs filepaths changed:
from "/var/log/airtime/pypo/pypo.log" to "/var/log/libretime/playout.log" and
from "/var/log/airtime/pypo-liquidsoap/ls_script.log" to "/var/log/libretime/liquidsoap.log"

BREAKING CHANGE: for playout-notify the default log file path changed
from "/var/log/airtime/pypo/notify.log" to "/var/log/libretime/playout-notify.log"
2022-01-13 17:11:37 +02:00
Jonas L 56a3875e2d
chore: add auto-apt-proxy to vagrant prepare (#1511)
* chore: add auto-apt-proxy to vagrant prepare

* bypass apt SRV redirections for deb.debian.org
2022-01-13 09:59:51 +02:00
Jonas L 0d25a330cf
chore: rename common section to python (#1509)
this will make the section more explicite,
in addition, this allow to exclude python deps
on docker images for example.
2022-01-13 07:12:50 +02:00
Jonas L fd580d689f
fix(legacy): validate id param in show image controller (#1510) 2022-01-13 07:10:32 +02:00
Jonas L d986302de2
fix: change filepath options type to pathlib.Path (#1506) 2022-01-12 23:06:51 +02:00
dependabot[bot] db8dd87d61
chore: bump amannn/action-semantic-pull-request from 3.5.0 to 3.6.0 (#1500)
Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/master/CHANGELOG.md)
- [Commits](https://github.com/amannn/action-semantic-pull-request/compare/v3.5.0...v3.6.0)

---
updated-dependencies:
- dependency-name: amannn/action-semantic-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 11:13:06 +02:00
Jonas L 19986cf1b1
chore: exclude packages sections using tools/packages.py (#1499)
* feat: exclude packages sections using tools/packages.py

* chore: group apache deps packages in a section

This allow one to exlude the entire section and install nginx for example.
2022-01-10 08:23:37 +02:00
Jonas L 1b601e2ac1
chore: allow no port fowarding in vagrant (#1498) 2022-01-10 08:20:45 +02:00
Jonas L 40130303dd
feat: replace verbosity flag with log-level flag (#1496)
using a string flag is better when using environement variables.
2022-01-08 08:16:08 +02:00
jo ba4eeaaff2 fix(shared): fix tests 2022-01-07 16:50:58 +01:00
Jonas L 501e7844e3
feat(shared): let user provide the log level (#1493)
* feat(shared): let user provide the log level

Simplify the logger setup, as choice should be
left to the user to import or guess  the log level from verbosity.

* fix: linting
2022-01-07 17:35:58 +02:00
Jonas L 9bad45acb3
ci: add shared to allowed commit scopes (#1494) 2022-01-07 17:34:59 +02:00
Jonas L 48dea6e5d5
feat: enhance libretime shared (#1491)
* feat: allow custom delimiter in BaseConfig

* feat: add default config filepath constant
2022-01-06 16:25:43 +02:00
Jonas L 3a615cafa0
feat: create libretime_shared package (#1349)
* feat: create libretime_shared package

- We don't use pydantic.BaseSettings because of some
  incompatble loading behavior.

* fix: whitelist pydantic in pylintrc

* docs: update to new BaseConfig behavior

* docs: change confusing config filepath
2022-01-06 15:40:52 +02:00
dependabot[bot] ba8b51af76
chore: bump composer/semver from 3.2.6 to 3.2.7 in /legacy (#1485)
Bumps [composer/semver](https://github.com/composer/semver) from 3.2.6 to 3.2.7.
- [Release notes](https://github.com/composer/semver/releases)
- [Changelog](https://github.com/composer/semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/composer/semver/compare/3.2.6...3.2.7)

---
updated-dependencies:
- dependency-name: composer/semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-05 11:25:52 +02:00
Jonas L 5b1e61a13e
chore: enhance python.mk (#1474)
* chore: run pylint with multiple cpu

* chore: use .venv as dev venv dir
2022-01-04 13:09:19 +02:00
jo 4a7f2290f1 ci: pin action-semantic-pull-request version 2022-01-04 08:26:27 +01:00
jo aa4be97312 chore: move liquidsoap logrotate in install dir 2022-01-04 09:18:58 +02:00
jo b6795432b6 chore: fix linting in libretime_playout 2022-01-04 09:18:58 +02:00
jo ccb8a234b8 chore: fixes after libretime_worker rename 2022-01-04 09:18:58 +02:00
jo 39c6acdd8a chore: rename airtime-celery to libretime_worker 2022-01-04 09:18:58 +02:00
jo a3ad6cecc4 chore: fixes after libretime_playout rename 2022-01-04 09:18:58 +02:00
jo 318b36b6b2 chore: rename pypo dir to libretime_playout 2022-01-04 09:18:58 +02:00
jo 61a1abce0d chore: fixes after libretime_liquidsoap rename 2022-01-04 09:18:58 +02:00
jo 4be0210026 chore: rename liquidsoap dir to libretime_liquidsoap 2022-01-04 09:18:58 +02:00
jo c04287b7c4 chore: fixes after libretime_api_client rename 2022-01-04 09:18:58 +02:00
jo be09f74af6 chore: rename api_clients dir to libretime_api_client 2022-01-04 09:18:58 +02:00
jo e84137a8ee chore: fixes after libretime_api rename 2022-01-04 09:18:58 +02:00