Commit Graph

17575 Commits

Author SHA1 Message Date
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
jo 6de242db65 chore: rename libretimeapi dir to libretime_api 2022-01-04 09:18:58 +02:00
jo 02efadc3d0 chore: fixes after libretime_analyzer rename 2022-01-04 09:18:58 +02:00
jo 62476de478 chore: rename airtime_analyzer dir to libretime_analyzer 2022-01-04 09:18:58 +02:00
Jonas L bd43688757
ci: add semantic pull request linting (#1472)
* ci: add semantic pull request linting

* ci: add missing link to conventional commits
2022-01-04 09:15:08 +02:00
Jonas L 0b994c4e20
ci: add closed references notificier workflow (#1467)
This workflow will check for issue links in the code
that has been closed upstream and can be dealt with.
2022-01-04 08:51:03 +02:00
Weblate (bot) 415e22a306
chore: Translated using Weblate (Hungarian) (#1464)
Currently translated at 85.4% (819 of 959 strings)

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

Co-authored-by: f3rr31 <5920873@disroot.org>
2022-01-03 09:38:32 +02:00
Jonas L e5ac78414e
chore(ci): let dependapot catch up with commit syle (#1468) 2022-01-03 08:02:06 +02:00
dependabot[bot] 7de75936c2 chore: bump simplepie/simplepie from 1.5.7 to 1.5.8 in /legacy
Bumps [simplepie/simplepie](https://github.com/simplepie/simplepie) from 1.5.7 to 1.5.8.
- [Release notes](https://github.com/simplepie/simplepie/releases)
- [Changelog](https://github.com/simplepie/simplepie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/simplepie/simplepie/compare/1.5.7...1.5.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-24 13:46:51 +01:00
dependabot[bot] 78523fd2eb
chore: bump simplepie/simplepie from 1.5.6 to 1.5.7 in /legacy (#1458)
Bumps [simplepie/simplepie](https://github.com/simplepie/simplepie) from 1.5.6 to 1.5.7.
- [Release notes](https://github.com/simplepie/simplepie/releases)
- [Changelog](https://github.com/simplepie/simplepie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/simplepie/simplepie/compare/1.5.6...1.5.7)

---
updated-dependencies:
- dependency-name: simplepie/simplepie
  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>
2021-12-20 11:35:19 +02:00
Weblate (bot) a86f303064
chore: translated using Weblate (Turkish) (#1456)
Currently translated at 41.1% (395 of 959 strings)

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

Co-authored-by: Oğuz Ersen <oguzersen@protonmail.com>
2021-12-13 11:35:10 +02:00
dependabot[bot] 9f0ed9edae
chore: bump php-amqplib/php-amqplib from 3.0.0 to 3.1.1 in /legacy (#1457)
Bumps [php-amqplib/php-amqplib](https://github.com/php-amqplib/php-amqplib) from 3.0.0 to 3.1.1.
- [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.0.0...v3.1.1)

---
updated-dependencies:
- dependency-name: php-amqplib/php-amqplib
  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>
2021-12-13 11:30:04 +02:00
Kyle Robbertze 17daeebd25 fix: assume api client is installed
Until pip out-of-tree dependencies work with our setup and we can update
to newer versions of our dependencies, assume api client is installed
without explicitly adding it as a dependency. The install script
installs api_client anyway

Fixes: #1435
2021-12-03 00:59:40 +01:00