jo
1f7c2fa0ab
chore(api): document version endpoint
2022-07-19 19:52:54 +02:00
jo
0e3ede5a1a
chore(api): route using urls
...
Allow to register function views in the same app instead of globaly.
2022-07-19 19:52:54 +02:00
jo
33e5e8ada3
chore(api): fix overbooked property type hint
2022-07-19 19:52:54 +02:00
jo
57046e2a9d
chore(api): rename schedule models fields
2022-07-18 00:04:54 +02:00
jo
8ceb1419a0
chore(api): rename show models fields
2022-07-18 00:04:54 +02:00
jo
4d037bb624
chore(api): rename smart_block models fields
2022-07-18 00:04:54 +02:00
jo
4bcc34212c
chore(api): rename webstream models fields
2022-07-18 00:04:54 +02:00
jo
1c48f11af2
chore(api): rename playlist models fields
2022-07-18 00:04:54 +02:00
jo
7c613d9176
test(api): ignore mypy missing imports
2022-07-18 00:04:54 +02:00
jo
81e1de4fbd
chore(api): disable fixme warnings
2022-07-18 00:04:54 +02:00
jo
80218f33eb
chore: rewrite extract-requirements to python
...
Using python ast to guess requirements in the setup.py file.
2022-07-17 21:25:37 +02:00
jo
a8cb62586e
feat: remove unused cc_country table
2022-07-12 11:33:22 +02:00
jo
de21e3175a
fix: use track_type_id in smartblock criteria
...
Missing migration step from db976881f0
Fixes #1957
2022-07-12 11:32:26 +02:00
jo
f39c079296
feat: set default locale to en_US
2022-07-08 13:11:32 +02:00
jo
3442376b08
chore: clean default data.sql
2022-07-08 13:11:32 +02:00
Jonas L
d323657047
fix: prevent data loose on track_types_id migration ( #1949 )
2022-07-07 23:35:27 +02:00
jo
db976881f0
fix: use constrained foreign key for files track_type
2022-07-07 21:07:41 +02:00
jo
c7c5bad46c
chore(api): widen dependencies ranges
...
- https://packages.debian.org/bullseye-backports/python3-django
- https://packages.debian.org/bullseye/python3-django-filters
- https://packages.debian.org/bullseye/python3-djangorestframework
- https://packages.debian.org/bullseye/python3-psycopg2
2022-07-07 12:37:33 +02:00
jo
6c82e37fac
chore(api): remove deprecated coreapi dependency
...
https://www.django-rest-framework.org/community/3.10-announcement/#openapi-schema-generation
2022-07-07 12:37:33 +02:00
jo
6d7510afee
chore(api): remove markdown package
2022-07-07 12:37:33 +02:00
jo
7c26020c80
feat(api): use uvicorn as asgi server with gunicorn
2022-07-07 10:51:07 +02:00
jo
1cb03c35d2
feat(api): listen on unix socket with gunicorn
2022-07-07 10:51:07 +02:00
jo
2f205544c2
feat: use dedicated 'libretime' user
...
BREAKING CHANGE: The default `www-data` user has been replaced by a dedicated `libretime` user to run the services. Be sure to change the ownership of the libretime files.
2022-07-07 10:51:07 +02:00
Jonas L
703a8e5856
chore: remove cloud storage remainings ( #1934 )
2022-07-04 22:09:14 +02:00
Jonas L
2ce1053bbc
chore(api): rename library model visibility field ( #1933 )
2022-07-01 19:13:31 +02:00
jo
07f6c0b0f2
test(api): ignore tests file coverage
2022-06-30 13:24:05 +02:00
jo
26a2c2dda0
chore: update python tests target
2022-06-30 13:24:05 +02:00
jo
f2e947f05f
chore(api): rename file model fields
...
- Removed checksum field
- Removed ftype field
- Removed silan_check field
2022-06-29 13:51:07 +02:00
jo
05ca410453
feat(api): rename track type to library
...
Related to #1922
- rename library model fields
2022-06-29 13:51:07 +02:00
jo
e5cb21c0e2
chore(api): add make schema-foreach-commit command
2022-06-29 13:51:07 +02:00
jo
d946497336
chore(api): update README
2022-06-29 06:04:31 +02:00
jo
0104799b59
ci(api): fail job on linting error
2022-06-29 06:04:31 +02:00
jo
ac66441278
test(api): disable too-many-arguments lint error
2022-06-29 06:04:31 +02:00
jo
7503618599
test(api): fix lint errors
2022-06-29 06:04:31 +02:00
jo
6cc20013ef
test(api): disable too-few-public-methods lint error
2022-06-29 06:04:31 +02:00
jo
0a1406bf48
chore(api): fix import-outside-toplevel lint error
2022-06-29 06:04:31 +02:00
jo
6ac52ead3e
test(api): allow f string format for logging
2022-06-29 06:04:31 +02:00
jo
70a31338f7
feat(api): create bulk_import command
...
- filter by allowed_extensions
2022-06-28 19:05:14 +02:00
jo
7e01591fae
style(api): reorder user models fields args
2022-06-27 19:02:12 +02:00
jo
a11cda0ae4
style(api): reorder preference model fields args
2022-06-27 19:02:12 +02:00
jo
654314cb1b
chore(api): rename country model fields
2022-06-27 19:02:12 +02:00
jo
e730959e9f
chore(api): rename editor role to host
2022-06-27 19:02:12 +02:00
jo
4009e7eeb6
chore(api): use fully qualified model names
2022-06-27 19:02:12 +02:00
jo
86b7a34263
chore(api): fix linting errors
2022-06-26 16:13:47 +02:00
Jonas L
04fbcc5f36
feat(api): rename podcasts models fields ( #1910 )
2022-06-22 16:42:09 +02:00
Jonas L
9c042c881a
feat: remove unused cc_perms table ( #1909 )
2022-06-22 16:32:39 +02:00
Jonas L
a7c45fb0e1
fix(api): cascade when dropping table ( #1908 )
...
This is supposed to work without it, but this is to be safe.
2022-06-22 16:08:05 +02:00
Jonas L
4837a1885d
feat: remove unused cc_sess table ( #1907 )
2022-06-22 15:15:31 +02:00
jo
ec8c18097d
chore(api): fix some linting errors
2022-06-22 13:37:17 +02:00
jo
1e83a91b5e
chore(api): use named argument for on_delete
2022-06-22 13:37:17 +02:00
jo
7ff59e272c
chore(api): disable some linting rule
2022-06-22 13:37:17 +02:00
Jonas L
cbfd9e51fd
fix(api): update model fields in set_icecast_passwords ( #1903 )
2022-06-22 08:35:26 +02:00
Jonas L
dc426f0aa5
feat(api): rename user model fields ( #1902 )
2022-06-21 23:43:03 +02:00
jo
28c4989d44
chore(api): update StreamSetting model
2022-06-21 16:53:25 +02:00
jo
6bae0e2846
chore(api): update Preference model
2022-06-21 16:53:25 +02:00
Jonas L
b9895d19e2
chore(api): move podcasts in dedicated app ( #1899 )
2022-06-21 14:40:21 +02:00
jo
b10696265f
ci: check and dispatch api schema changes
...
- check if api schema is outdated
- do not cancel in progress workflow
Since this workflow commit to an external repo, it might squash multiple changes into a single commit.
- dispatch each schema update to client repo
- cache pip dependencies
2022-06-18 12:13:11 +02:00
jo
08bcaf459c
chore(api): add openapi schema
2022-06-18 12:13:11 +02:00
jo
71cfab79ef
feat: rename default stream mount point to main
...
This will not change the default mount point if you are upgrading.
BREAKING: The default stream mount point changed from `airtime_128` to `main`. Be sure to updates your clients accordingly.
2022-06-18 12:08:29 +02:00
jo
7457a29e7f
chore(api): pin django related packages
2022-06-18 11:55:02 +02:00
jo
9babb0c4f0
chore(api): pin/downgrade django-filter to ~=21.1.0
2022-06-18 11:55:02 +02:00
jo
14b716d366
chore(api): pin/upgrade django to ~=3.2.13
2022-06-18 11:55:02 +02:00
jo
eef789e4d1
chore(api): rename deprecated filter_fields to filterset_fields
2022-06-18 11:55:02 +02:00
Jonas L
7f926ab6a5
fix(api): allow updating default_icecast_password ( #1872 )
...
Correctly implement the Preference.objects.update_or_create function.
2022-06-12 07:52:54 +02:00
Jonas L
9d0c098684
test(api): use pytest to run api tests ( #1645 )
2022-06-09 16:26:47 +02:00
jo
3bca92413f
fix: drop unused sequences
...
Drop old campcaster sequences that aren't used anymore.
2022-06-08 23:23:08 +02:00
jo
df5ac70769
fix(api): missing build-essential to build psycopg2
2022-06-08 23:23:08 +02:00
jo
28b9343c77
fix(legacy): remove not null contraint when using default
...
This fixes the inital schema creation to match as if the old migrations
were always run.
The third_party_track_references.file_id field should not have a not
null constraint while have a default value to 0.
2022-06-08 23:23:08 +02:00
jo
f7bb6e7592
feat: move storage path setting to configuration file
...
- change default storage path to /srv/libretime
- remove music dirs table
- use /tmp for testing storage
- storage dir should always have a trailing slash
2022-06-08 23:23:08 +02:00
jo
510e978952
feat: add systemd libretime.target
...
- add wanted by
- instantly start services in vagrant
2022-06-08 23:23:08 +02:00
jo
91f8a51a1e
feat(api): create set_icecast_passwords command
...
- allow to fetch icecast password from xml config
- set default stream password
2022-06-08 23:23:08 +02:00
jo
980f1acd0c
fix: correct cc_file.artwork column size
2022-06-08 23:23:08 +02:00
jo
6889e11a91
fix: don't add track types only on migration
2022-06-08 23:23:08 +02:00
jo
4be8bde14e
feat: drop cc_locale table
2022-06-08 23:23:08 +02:00
jo
0e4bc4cacd
feat: replace php migration with django migration
...
- keep latest legacy version in initial migration file
- move propel schema to api legacy app
- remove legacy upgrade tool
2022-06-08 23:23:08 +02:00
jo
ee98387264
feat(installer): rewrite install script
...
- remove unused root packages.ini
- write config to yaml file
- allow to set public_url during install
- force icecast start right after package install
- move config file in place at the end of installation
BREAKING CHANGE: The bash installer has been rewritten, the flags and
options changed, please run `./install --help` to get more details.
2022-06-08 23:23:08 +02:00
jo
aed6d2f294
feat: change config dir path to /etc/libretime
...
BREAKING: The configuration directory changed from `/etc/airtime` to
`/etc/libretime`. Please rename your configuration directory accordingly.
2022-06-08 23:23:08 +02:00
jo
604ff20239
feat: change config filename to config.yml
...
BREAKING: The configuration file name changed from `airtime.conf` to
`config.yml`. Please rename your configuration file accordingly.
2022-06-08 23:23:08 +02:00
jo
3d7083f602
chore(api): format schema using prettier
2022-04-26 08:10:39 +02:00
jo
751d430bcc
feat: replace exploded base_* with public_url
...
Fixes #1574
BREAKING CHANGE: The `general` section in the config schema has changed: the `general.base_*`, `general.protocol` and `general.force_ssl` configuration fields have been replaced with a single `general.public_url` field. Be sure to use a valid url with the new configuration field.
2022-04-25 16:45:01 +02:00
Jonas L
41df76eed0
feat(api): replace uwsgi with gunicorn ( #1785 )
...
Related to #1719
BREAKING: The uwsgi packages and configuration files (`/etc/airtime/libretime-api.ini`) should be removed from the system.
2022-04-25 16:09:19 +02:00
Jonas L
dc92661c49
chore(api): move uswgi config in api/install ( #1781 )
2022-04-21 07:14:35 +02:00
Jonas L
28fc8360a3
fix(api): prevent timing attacke on api key ( #1771 )
2022-04-17 18:55:18 +02:00
Jonas L
9d5de61241
chore(api): add mypy django stubs plugins ( #1726 )
2022-04-09 12:18:23 +02:00
Kyle Robbertze
beebe79edd
ci: generate schema and push to api-client repo ( #1740 )
...
* chore(api): add schema generation make target
* ci: generate schema and push to api-client repo
2022-04-08 15:38:58 +02:00
jo
0bbd46c33f
refactor(api): fix pylint errors
2022-04-04 15:20:22 +02:00
jo
bf8db3e6f0
chore(api): add pylint-django plugin
2022-04-04 15:20:22 +02:00
Jonas L
fce988aef1
feat(api): split api into multiple apps ( #1626 )
...
Fixes #1622
- split the api into 4 apps: core, history, schedule, storage
- exploded the settings into testing/prod
2022-04-04 14:38:50 +02:00
Jonas L
8c96c0a094
feat: remove unused python3-venv package ( #1728 )
2022-04-02 05:41:43 +02:00
Kyle Robbertze
cbcd0abcae
chore(api): add API metadata ( #1723 )
2022-04-01 15:17:40 +02:00
Jonas L
7e9c9a2792
chore: rename vagrant devices ( #1716 )
2022-03-29 14:25:34 +02:00
jo
e5d6216e1d
feat(api): include id in file/webstream serializers
2022-03-06 15:17:44 +02:00
Jonas L
f5bb31e971
fix(api): static_url settings is required in dev mode ( #1662 )
2022-03-04 15:50:05 +02:00
jo
2dcc654b70
feat(api): load config using shared helpers
...
- add django settings module documentation
- use default for previously required fields
BREAKING CHANGE: The API command line interface require the
configuration file to be present. The default configuration file path is
`/etc/airtime/airtime.conf`
2022-03-02 22:03:56 +02:00
jo
9af717ef7f
feat(api): remove admin app and static files
...
- remove django admin app,
- disable static files for production deployment,
- keep the rest framework browsable api in dev mode.
2022-03-02 22:03:56 +02:00
jo
4da8d8c06b
fix(api): model_bakery is a dev dependency
2022-03-02 22:03:56 +02:00
Jonas L
d55e58e416
chore: auto generate requirements.txt ( #1651 )
...
- force LC_ALL for the sort command
2022-02-28 20:02:01 +02:00
Jonas L
98cea4dcd2
feat(api): improve uwsgi systemd integration ( #1614 )
2022-02-19 09:03:25 +02:00
jo
924b7f8f46
test(api): add bandit linter check
2022-02-14 21:01:35 +02:00
Jonas L
3245216869
feat(legacy): add db config defaults and allow custom port ( #1559 )
...
* feat(legacy): allow custom port for database connection
- fix heredoc for php72
* update test config db section
* update sample config db section
* update api db config
* use defaults for database config section
* update documentation
* more documentation for migration
2022-02-04 16:03:01 +02:00
jo
32cb67806a
chore: add pyupgrade pre-commit hook
...
- add --py3-plus flag to pyupgrade hook
- add --py36-plus flag to pyupgrade hook
2022-01-27 10:37:48 +02:00
jo
9de82bb568
chore: make linters config consistent in pyproject.toml
...
- remove mypy config from makefile
2022-01-26 10:15:35 +02:00
jo
7988b7467b
test: allow to set python linters to fail per app
2022-01-26 10:15:35 +02:00
jo
0f8cb1a5ed
chore: set python build system in pyproject.toml
...
- fix local package install
- local packages requirement url format
2022-01-26 10:15:35 +02:00
jo
441028a1d2
chore: make setup.py file chdir consistent
2022-01-26 10:15:35 +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
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
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
Jonas L
4057c88cf0
feat: debian 11 support ( #1292 )
...
* Debian 11 Support
Run api ci test on bullseye as well
* Silan does not work for mp3 on bullseye
* Liquisoap does not fail with wma files on bullseye
2021-11-09 11:21:40 +02:00
Kyle Robbertze
7182390000
feat: add support for Ubuntu Focal 20.04 ( #1168 )
...
Co-authored-by: Valerio Bozzolan <gnu@linux.it>
2021-11-04 09:55:50 +02:00
Kyle Robbertze
6ca1ca2aec
feat: run API tests in CI ( #1421 )
...
* feat: run API tests in CI
* fix: remove incorrect test for guest user viewing themself
2021-10-18 14:17:34 +02:00
Jonas L
7384dd7a2f
feature: Use setuptools entrypoints ( #1409 )
...
* Use console_scripts entrypoint for libretimeapi
* Use console_scripts entrypoint for playout
2021-10-18 09:44:39 +02:00
Jonas L
30b3470a06
Better format enforcing ( #1391 )
...
* Add shared python format-check target
* Add .format-check to api lint target
* Format api code with makefile format target
* Add .format-check to tools lint target
* Add .format-check to analyzer lint target
* Format analyzer code with makefile format target
* Add .format-check to celery lint target
* Add .format-check to api_client lint target
* Format api_client code with makefile format target
* Add .format-check to playout lint target
* Run CI linting in parallel
* Disable isort in pre-commit
2021-10-17 16:24:37 +02:00
Kyle Robbertze
1274b2d849
Add openapi spec for API v2 ( #1388 )
2021-10-16 20:34:03 +02:00
jo
c4c89eae19
Fix paths after legacy rename
2021-10-11 13:43:39 +02:00
jo
7f7ce0acb2
Fix api2 permissions check
2021-10-08 06:04:43 +02:00
jo
6013434393
Install api with prod extra requires
2021-10-01 17:49:33 +02:00
Kyle Robbertze
77a07f4b83
make check sequence a tuple
2021-09-22 15:27:40 +02:00
Kyle Robbertze
8ca356303b
correctly filter schedule items based on is_valid
...
Fixes : #1360
2021-09-21 21:42:57 +02:00
Kyle Robbertze
6caa29e0c9
filter out invalid schedule items
2021-09-21 11:36:49 +02:00
jo
fc02f8cafb
Cleanup
2021-09-19 22:39:10 +02:00
jo
f84e40dc06
Small refactoring
2021-09-19 22:38:49 +02:00
jo
d8c5206e2e
Fix cueout for overlapping starts & ends schedule
2021-09-19 20:48:19 +02:00
jo
aad92c4ac1
Revert 77315885b9
...
And remove prod extra requires for api because ./setup.py install
don't handle extra requires.
2021-09-17 07:23:26 +02:00
jo
c2df85c751
Cleanup redondant/useless requirements
2021-09-13 14:44:32 +02:00
jo
d12e232a6f
Add format target in makefiles
2021-09-13 14:43:18 +02:00
jo
3a336375c2
Setup python_requires to >=3.6
...
Fix python_requires format
2021-09-10 15:14:48 +02:00
jo
3dbc1205d0
Start linting with mypy
2021-09-10 15:14:48 +02:00
jo
ceb40ee216
Use shared python makefile and start linting
...
Always update setuptools/wheel/pip
Never fail while linting
We use github annotations to impove the code incrementally.
2021-09-10 15:14:46 +02:00
jo
0d88d17f7c
Use setup extra_requires for dev/prod dependencies
...
Also add pylint by default.
2021-09-10 13:45:27 +02:00
jo
c9e35b1f62
Update setup tools project details
2021-09-02 15:45:37 +02:00
jo
fb3ee2d27a
Install venv instead of virtualenv
2021-08-31 16:07:29 +02:00
jo
01141606fd
libpq-dev is required for psycopg2 in production
...
This is a package for the API.
2021-08-31 16:07:29 +02:00
jo
18f9c81b74
Add dependencies manager
...
Used to generate list of packages dependencies
for different distributions, and should improve
dependencies management by having them in each project.
This tools should gather the reason why a dependency is present,
so one can remove it when unused.
Rename deps script to packages
Move installer/packages to scripts and write tests
Remove packages-list make target
2021-08-31 16:07:21 +02:00
Kyle Robbertze
4f765ebb2d
remove debug statement
2021-08-12 10:08:38 +02:00
Kyle Robbertze
7e1be7b028
Truncate schedule items that run over the time of the containing show
...
Fixes : #1272
2021-08-12 10:08:38 +02:00
jo
01fbd1e8b9
Add isort pre-commit hook
...
Sort import statement in python files
See https://github.com/PyCQA/isort
2021-06-05 00:39:35 +02:00
jo
b26de72704
Remove python encoding pragma
2021-06-05 00:39:23 +02:00
jo
ced4fea3e1
Fix libretime-api
2021-06-04 17:06:05 +02:00
jo
5e9f99ed7e
More spelling fix (dangerous)
2021-06-04 17:06:05 +02:00
jo
f2e840989a
Fix executable bit
2021-06-04 17:06:05 +02:00
jo
c27f020d73
Format code using black
2021-06-04 17:06:05 +02:00
jo
efe4fa027e
Format code using prettier
2021-06-04 17:04:53 +02:00
jo
ac17db97fc
Fix missing encoding pragma on python files
2021-06-04 17:04:53 +02:00
Kyle Robbertze
2df0189a90
add API v2
2021-05-14 13:04:46 +02:00
paul.baranowski
edd7351b76
Removed the API directory, all of it has been moved to application/controllers/ApiController.php
2010-12-15 14:25:42 -05:00
paul.baranowski
3613812012
Pypo fixes and improvements
...
General:
* Moved pypo author info into one file
* Added two database columns in schedule table: "schedule_group_played"
and "media_item_played".
API clients:
* Created get_liquidsoap_data() function which allows you
to give arbitrary data to liquidsoap.
* Added documentation
* Renamed functions to make it more obvious what is happening
pypo_cli:
* Got rid of more constants that were not needed
* Created function set_export_source() to reduce code repetition
* Separated the downloading of the schedule from tracking what has
been played. The tracking info is now kept in a separate file.
This fixes the major bug that the playlist keeps restarting for
the first minute of playback.
* converted more print statements to debug statements
pypoTester:
* Now uses samples from the audio_samples directory, and schedules two
audio clips back-to-back.
2010-11-29 18:34:22 -05:00
paul.baranowski
7ade83ae74
Fixes to the liquidsoap scheduler and the API.
...
Added a test() function to api_client.
Fixed bug with the config file.
Added line numbers to the logging.
2010-11-18 18:00:13 -05:00
paul.baranowski
8014f94c58
Fixed whitespace to standard coding conventions.
2010-11-18 14:39:03 -05:00
paul.baranowski
8a58df3093
Moved all file-related functions from BasicStor into StoredFile class.
...
Got rid of all the stuff related to GUNID hex-to-int conversion.
Commented out lots of functions that are either not in use or will
no longer work.
Pypo: made things more generic and pluggable, added documentation.
Added the PHP scripts to serve the right info back to pypo.
2010-11-12 17:07:01 -05:00
paul.baranowski
35dc3fd01f
CC-1713 - New storage directory structure
...
Changed the GUNID to a 32 hex string (MD5 value), there is no more
conversion between hex strings and bigints in the database anymore.
Added added the file extension to the file name.
Stored the complete path to the file in the database. This means that
linking doesnt need to create any files at all. (It used to create a
symlink to the file you were importing)
The structure and file naming should be fine - there are 4096 possibilities
for the first directory level, and even will a million files this is only
244 files per sub-directory. The GUID is fine for the file name
2010-11-11 16:50:30 -05:00