Commit Graph

2630 Commits

Author SHA1 Message Date
rjhelms 2160daea00 Fix replaygain_analyzer in Python 3.5
'text' argument was added in Python 3.7 as an alias of 'universal_newlines'. Using 'universal_newlines' works on Python 3.5/3.6 and should be forward-compatible.
2020-11-19 14:52:52 -05:00
Zachary Klosko a5023d031a pin PyGObject versions to distro provided packages
this prevents pip trying to build the pypi package and failing.
Fixes: #1107
2020-11-18 17:49:51 +02:00
Kyle Robbertze 4c0146db74 pin celery version until we can fix compatibility with celery 5 2020-08-28 12:47:01 +02:00
Jakub Skory 7058def9a8
Renamed template conf for liquidsoap and playout 2020-06-27 14:36:08 +02:00
Robb 16bff4ff9e
Merge pull request #1047 from paddatrapper/listener-stats
Correctly encode icecast admin credentials for listener stats
2020-05-23 09:43:52 -04:00
Kyle Robbertze afd3d7842b Rewrite Travis script to be modular
Fixes: #1039
2020-05-20 11:06:56 +02:00
Zachary Klosko 6540a34a9b Adding back scripts in /docs 2020-05-19 10:16:31 -04:00
Kyle Robbertze cf414239e2 Correctly encode icecast admin credentials for listener stats
Fixes: #1045
2020-05-18 16:49:19 +02:00
Kyle Robbertze c44346fe94 Rename all systemd, sysvinit and upstart files to libretime
Fixes: #516
2020-05-15 15:32:13 +02:00
Kyle Robbertze 9112f205e2 fix decode error 2020-05-04 22:42:42 +02:00
Kyle Robbertze e0e4d4c87f Ensure all json loads calls use strings 2020-05-04 13:25:36 +02:00
Kyle Robbertze cf3b9782ac fix legacy version check 2020-04-29 19:06:52 +02:00
Kyle Robbertze 6640e5624c move legacy script to python3 2020-04-29 19:06:52 +02:00
Keoni Mahelona 30d6db1e5e Make sure command calls python3 2020-04-29 19:06:52 +02:00
Keoni Mahelona 91996c91bc Remove double encode which caused webstream playout to break 2020-04-29 19:06:52 +02:00
Kyle Robbertze ca0d01b693 Fix mutagen to compatible versions 2020-04-29 19:06:52 +02:00
Keoni Mahelona d48e792922 Checking type of command to only encode if string. 2020-04-29 19:06:52 +02:00
Keoni Mahelona 348f8573c7 Add traceback so we can debug. 2020-04-29 19:06:52 +02:00
Keoni Mahelona 9724298f40 Use `utf-8` encoding. 2020-04-29 19:06:52 +02:00
Keoni Mahelona 0a9781d138 Added traceback so we can find the bug 2020-04-29 19:06:52 +02:00
Keoni Mahelona 0289f84111 Ok hopefully this is it. python3 requries a bytestring https://docs.python.org/3.7/library/telnetlib.html 2020-04-29 19:06:52 +02:00
Keoni Mahelona dd46b4c984 Remove .encode(). Not needed in python3 2020-04-29 19:06:52 +02:00
Keoni Mahelona 42a5937288 Updated other old tn.write() functions 2020-04-29 19:06:52 +02:00
Keoni Mahelona 1ac3f691b4 Fixed #968. Needed to send a byte string to telnet not a normal string. 2020-04-29 19:06:52 +02:00
Keoni Mahelona a643883d06 Set pika version to ~1.1.0 to prevent api updates from breaking code.
Updated message_listener for new version.
2020-04-29 19:06:52 +02:00
Keoni Mahelona 4a45225369 Suggest using `universal_newlines` as the alias `text` only works for python 3.7 and above.
Default python3 for example is 3.6 in Ubuntu Bionic and therefore liquidsoap fails with parameter `text`.
2020-04-29 19:06:52 +02:00
Kyle Robbertze 6ebb1fd555 more pypo fixes 2020-04-29 19:06:52 +02:00
Kyle Robbertze 3a8b1e207f deprecate media_monitor completely 2020-04-29 19:06:52 +02:00
Kyle Robbertze 5923dee839 Fix running apps 2020-04-29 19:06:52 +02:00
Kyle Robbertze e8a0783139 Fix tests 2020-04-29 19:06:52 +02:00
Kyle Robbertze 82042e8c69 fix test failures 2020-04-29 19:06:52 +02:00
Kyle Robbertze ea54493c21 add chaudum fixes 2020-04-29 19:05:35 +02:00
Kyle Robbertze 8346e89e99 install successfully using py3 2020-04-29 19:05:35 +02:00
Kyle Robbertze 81ad2fc705 do not be backwards compatible 2020-04-29 19:05:35 +02:00
Kyle Robbertze 9298ea7e05 airtime_analyzer: depend on rgain3 for py3 2020-04-29 19:05:35 +02:00
Kyle Robbertze 632ba9acfe convert print statements to py3 2020-04-29 19:05:35 +02:00
Kyle Robbertze 7a090e1bab
Merge pull request #987 from jeromelebleu/fix-logrotate
Fix postrotate command of airtime-liquidsoap
2020-04-18 10:53:52 +02:00
Jérôme Lebleu 39469d3f88 Use stop instead of kick to disconnect the source 2020-04-01 19:01:06 +02:00
Jérôme Lebleu a8194e95ea Fix postrotate command of airtime-liquidsoap 2020-03-25 17:55:22 +01:00
Keoni Mahelona 8edada6f3d Added extra mime type for flac file 2020-03-18 17:19:57 +13:00
Keoni Mahelona f6f536c749 Set mutagen~=1.43.0 until LibreTime moves to python3 2020-02-19 04:01:11 +00:00
Robb Ebright 0931ba842a add legacy script for liquidsoap 1.1.1 compatibility 2019-12-30 22:07:48 -05:00
Kyle Robbertze a572f275fc Update stream URLs to use LibreTime 2019-11-06 14:08:13 +02:00
Roberto Soto bf7659dfa0 fix heartbeat spelling 2019-11-04 13:05:57 -08:00
Roberto Soto 8a0f474075 use AMQP heartbeat feature 2019-11-04 11:02:40 -08:00
Roberto Soto 5b3c0cb1c8 Revert "raising the exception might kill pypopush thread"
This reverts commit 2afe01b3ddc94194101a4a2149116e27e0e115e5.
2019-11-04 11:02:39 -08:00
Roberto Soto cdf9f6f98e PypoMessageHandlers using a kombu Consumer solves MVC/Liquidsoap synchronization issues:
The real error was PypoMessageHandler wasn't consuming messages from RabbitMQ, thus schedules were only updated on PypoFetch time out.
Proably queue is in a stale state  because it didn't recover from a broken connection.
The issue is a SimpleQueue was being used, which's 'python-like' *get*  method apparently doesn't handle recovery.
Consumers are the way to go instead.
2019-11-04 11:02:39 -08:00
Roberto Soto 03c3cb02d8 raising the exception might kill pypopush thread
this is apparently the reason why schedules don't get pushed after a silence
producing desynchronization between the mvc and liquidsoap and cannot catch up until pypofetch times out.
(ON AIR turns off and there's a mess until the schedule is fetched. sometimes it even continues playing the wrong tune)
((logging inside the while True loop produces no output, probably it is locked on the queue?))
2019-11-04 11:02:39 -08:00
Kyle Robbertze 07a9ef4ba3
Merge pull request #854 from radiorabe/chore/py3-cleanup-for-celery
Python3 cleanup in airtime-celery package
2019-08-18 22:02:59 +02:00
Lucas Bickel 8bdc63dffb 🐛 (pypo) CentOS 7/Python 2.7.5 fix 2019-08-18 18:04:06 +02:00
Lucas Bickel 9bea08dc03 ♻️ (celery) python3 compat fixes 2019-08-18 17:45:48 +02:00
Lucas Bickel a3d6ea77e6 🐛 (pypo) disable fs block size based cache check 2019-07-29 20:19:54 +02:00
frecuencialibre c26e15fd70
Merge pull request #659 from Robbt/podcast-metadata-override
added track title and artist override for podcasts
2019-01-21 14:09:39 -06:00
Lucas Bickel a526a59ef4 ♻️ cleanup aac code
Removes unsupported codecs from our liquidsoap code
2019-01-20 15:37:21 +01:00
Robbt 8427d0a92a changed artist track to podcast title 2019-01-13 00:29:49 -05:00
Robbt e773887736 merge in audiofile fix from master 2019-01-12 23:11:00 -05:00
Robbt 28d2b110c2 made basic sanity checks to only do back up mp3 mutagen import on files with mp3 extension 2018-12-27 18:38:17 -05:00
Robbt 26fad97915 modified the code to treat a file mutagen fails to load as a mp3 2018-12-27 17:50:33 -05:00
Robbt e2e8591b4d added track title override for podcasts 2018-12-23 14:54:47 -05:00
Robb f011a13ecb
Merge pull request #654 from radiorabe/chore/cleanup-and-2to3-pypo-main
Cleanup pypo/__main__.py
2018-12-23 11:46:38 -05:00
Robb 71d4da185a
Merge pull request #652 from radiorabe/chore/cleanup-analyzer-abc
Cleanup airtime_analyzer/analyzer.py
2018-12-23 11:42:15 -05:00
Lucas Bickel 36891c18c8 ♻️ (pypo) cleanup pypo/__main__.py
Clean up code and add python 3 support (with python 2 bc).
2018-12-23 12:06:26 +01:00
Lucas Bickel 201d3741d8 🔥 (analyzer) cleanup analyzer.py 2018-12-22 22:19:38 +01:00
Robbt 0b9c3396ea removed debug line that was causing failures for m4a 2018-12-19 16:27:31 -05:00
Robbt 9e78c110c5 made mutagen version 1.41 or above 2018-12-19 15:50:10 -05:00
Robbt 626e682aad changed celery podcast download to use mutagen for all supported files vs. mp3 only 2018-12-13 12:36:10 -05:00
Robbt a2573b52d2 fixed bad operator 2018-12-13 08:58:59 -05:00
Robbt f673d92edd modified bitrates to match new mutagen values 2018-12-13 08:53:52 -05:00
vagrant 2ee85f0546 made mp3 bitrate test a range vs. exact number because of variation in results from different mutagen versions 2018-12-04 00:35:24 +00:00
Robbt 6b0e6312af removed the version restriction on mutagen to take advantage of bug fixes 2018-11-28 07:47:54 -05:00
Robbt 8a6f992aa5 Increased podcast download timeout to 1800 seconds 2018-10-21 17:18:29 -04:00
Lucas Bickel f7ceeedb04 (Amazon S3) drop broken S3 support 2018-10-06 12:45:22 +02:00
Lucas Bickel da64166fa5 Fix call with deprecated arg 2018-07-06 12:12:39 +02:00
Robb 0b0cb77c29
Merge pull request #432 from radiorabe/fix/remove-dead-hack
Remove std_err_override
2018-05-24 14:10:12 -04:00
expert-geeks 539b03dd8c
Stop ShoutCAST rejecting title updates
When Libretime streams a webstream, the ID3 data is put into a single title field, leaving the artist field blank. When processing the ID3 data, Libretime concatenates the blank 'artist' field with the title, leaving '- title'. ShoutCAST rejects title updates that begin with punctuation for stylistic reasons (thanks guys) and so effectively ignores all ID3 data coming with the stream, falling back to the 'Station off-air' message. This PR uses the title field alone if the artist field is blank, but both when the artist data is available e.g. when streaming an MP3.
2018-03-04 15:04:31 +00:00
Lucas Bickel ff6f497fbb Remove std_err_override
This hasn't been used in many moons.
2018-02-03 12:45:34 +01:00
Kyle Robertze c16d7c2a1d remove media-monitor
airtime-media-monitor conflicts with airtime-analyzer, which is what
is now used to monitor the LibreTime application

https://github.com/LibreTime/libretime-debian-packaging/issues/2#issuecomment-359987457
2018-01-24 09:20:51 +02:00
Lucas Bickel bf5cfbcf56 gracefully handle missing config option 2017-10-15 14:45:22 +02:00
Lucas Bickel ace7e493f4 Fix port and protocol default values
Turns our bare ConfigObjects don't to default passing very automatically.
2017-10-15 13:46:40 +02:00
Lucas Bickel 4287ac1c70 Revert pypofile try block move
Config file getting is allowed to fail. I didn't realize that it
would not just use the default instead of excepting and getting
caught. Sorry for that.
2017-10-15 13:14:40 +02:00
Robb 38fe253438 Merge pull request #329 from radiorabe/fix/pypo-update-track-time
Pypo track updating fix
2017-10-14 10:18:11 -04:00
Lucas Bickel 6e35cfb44b Fix whitespace and move config getting into try 2017-10-08 16:15:08 +02:00
Lucas Bickel 1add49efdf Merge pull request #327 from Robbt/robbt-fix/podcast_download_decode_to_avoid_corruption
Fix podcast corruption by adding decode = true to the raw request object for the celery task
2017-10-08 14:50:17 +02:00
Robb Ebright 5150f3add5 Adding decode = true to the raw request object fixes issues with certain podcasts and corruption 2017-10-07 18:48:39 -04:00
Xabi Spacebiker 5160fc64d7 Update pypofile.py
Last update
2017-10-03 03:37:06 +02:00
Xabi Spacebiker 216294428a Update pypofile.py 2017-10-03 01:28:01 +02:00
Xabi Spacebiker cfb99fa926 Update pypofile.py
1st- Changes the file permissions of cache files from 444 to 644
2nd- Put the host variables into a single array, this way we can pass the full variable to the report_file_size_and_md5_to_airtime function.
2017-10-02 23:42:11 +02:00
Xabi Spacebiker 2104b53761 Update pypofile.py
Adding user write permission in cached file
2017-09-28 11:12:57 +02:00
Lucas Bickel 586314052f Better error message when parsing WAVE file 2017-09-20 19:13:15 +02:00
Robb bd845a016d Merge pull request #253 from radiorabe/feature/refactor-config-structure
Simplify configuration file structure
2017-08-05 20:47:28 -04:00
Robb Ebright 314654dfe4 Enable logging for analyzer and pypo 2017-08-05 17:56:23 -04:00
Lucas Bickel fa2018a2c5 Simplify configuration file structure
This removes most of the legacy upstream config madness by not using
weird config files spread all over the place.

This isn't the solution to other config reading fragility issues, but
it does move the whole config back to the central airtime.conf file.
2017-07-21 13:15:28 +02:00
Lucas Bickel 0a556adbfa Use proper protocol in URL if port is set to 443
This adds TLS support to pypo when downloading files from the REST
API. I previously fixed some similar issues in the api_client and
wasn't aware that pypo isn't using it for every URL..
2017-07-21 12:27:34 +02:00
Robb 6e2cb2b2a8 Merge pull request #241 from radiorabe/feature/update-install
Update installer with systemd detecting code
2017-07-10 23:28:23 -04:00
Robb 3b2a9451eb Merge pull request #169 from radiorabe/feature/use-official-magic
Use file-magic instead of python-magic
2017-04-28 19:56:38 -04:00
Bill Burton 320856516f Merge remote-tracking branch 'upstream/master' into install-auto-detect-distro-init 2017-04-28 11:38:12 -04:00
Bill Burton 3179651dec Installer auto-detects distro, portable system init
The theme of this commit is to make the install process more
resiliant to differences in distros by testing for specific
features or versions of executables rather than making as many
assumptions just on the distro and release.

* Distro and Release detection (install, Vagrantfile)
  - Added detection logic for distro and release based on
    /etc/os-release which is available on all potential supported
    distros. The --distribution and --release options can be used
    to override detection.
  - Added distro and release checks to ensure values specified are
    for a supported release.
  - Changed some distro checks to use booleans, e.g.
    if $is_centos_7; then ...
  - Added a simple check so if --distribution is specified, it will
    ensure it's at least sane, e.g. centos on debian or debian on
    centos will be caught.
  - In Vagrantfile, removed --distribution and --release options for
    all distro and release combinations.

* Portable Init System Detection and Management (install, centos.sh)
  - Added detection logic for init system type - systemd, Upstart or
    System V in the function systemInitDetect().
  - Added portable init system install in the function
    systemInitInstall() which depends on systemInitDetect(). After
    installing files, enables and starts service.
  - Added portable init system commands in the function
    systemInitCommand() for start, stop, reload, restart and status.
  - Python services don't support systemd but unconditionally install
    scripts for both Upstart and System V. Disabled by passing
    --no-init-script to setup.py for each service.
  - When upgrading, remove all old system init files in /etc/init,
    /etc/init.d, /etc/default and /etc/systemd/system.
  - In centos.sh, removed install of airtime systemd service files
    as it's now handled by install.
  - Created an Upstart .conf for airtime-celery
  - In systemd file for airtime-celery, changed absolute path to
    /usr/local/bin/celery and for centos, the install symlinks
    celery to /usr/local/bin.

* External Dependencies Install (install)
  - For external dependencies, only attempt to install for Debian-
    based distros with apt-get. For centos, a warning is displayed.
  - For systems with apt-get, detect version and if 1.1 or greater,
    use new force options, otherwise use --force-yes option.

* Configuring Apache (install)
  - For Apache, check for centos and use httpd for binary and
    service, otherwise use apache2ctl and apache2.
  - Detect Apache version 2 or better in a more reliable manner.
  - Detect Apache root folder and conf file name by running
    apache2ctl -V or httpd -V as appropriate.
  - Various checks for centos as it doesn't support the Debian
    Apache utilities a2ensite/a2dissite, a2enmod/a2dismod, etc.

* Installing Airtime Services (install)
  - Detect Python version. If less than 2.7.9, install OpenSSL
    support.
  - Prevent installing init files by passing --no-init-script to
    setup.py for each service.
  - Use systemInitInstall to install, enable and start each service
    after setup.py has run.
  - Removed filtering for WEB_USER for files in
    /etc/init/airtime*.template as that is handled in the
    systemInitInstall() function.

* Configuring PHP in Apache (install)
  - Detect PHP conf folder by checking a list of locations rather
    than making assumptions based on the distro and release.

* Configuring PostgreSQL (install)
  - Detects if the airtime user has already been created. If not,
    then creates the user.

* Installing Locales (install)
  - Minor changes to check for centos and prevent from running.
2017-04-28 11:00:50 -04:00
Lucas Bickel 65a4961aac Merge pull request #187 from Kirill-Kad/patch-1
Correction lines 399 and 400.  ls_script.liq
2017-04-25 13:09:58 +02:00
Lucas Bickel 122166216a Merge pull request #157 from Lapotor/Ubuntu-16.04-Update
Ubuntu 16.04 installer update
2017-04-20 15:21:56 +02:00
Lapotor 0766b91cde Added remind to reload systemctl for Xenail 2017-04-19 20:36:48 +02:00
Lucas Bickel 9ce611130c Use file-magic instead of python-magic
This gets the mime type using file-magic in a most minimal way. Since the python bindings have been available as a distro package for quite a while it is written in a way so it should also run on pre pypi installs of file-magic. This means not being able to use nice things like magic.detect_from_filename due to the fact that they where added rather recently (with recently being 2 years ago).

As the mime type is only used to check for wav files that mutagen can't handle it only reads the mime type and ignores the charset and other attributes that magic can find.

Due to the fact that file-magic is not properly unicode safe I'm checking the file based on it's first 2048 bytes as per <http://stackoverflow.com/questions/34836792/python-magic-cant-identify-unicode-filename#comment57418632_34838355>. This is not an issue since wav files need to start with a wav header by definition anyway.

I tested this sucessfully on both CentOS and Debian with files containing Unicode in their names.
2017-04-18 09:49:09 +02:00
Robb ebd7c1d2a3 Merge pull request #163 from radiorabe/feature/python-debug-flag-for-140
Problem: airtime-liquidsoap --debug only works for liquidsoap
2017-04-17 16:36:07 -04:00
Lucas Bickel 8253a070f4 Update name in ref_off_air_meta in Liquidsoap 2017-04-16 01:23:40 +02:00
Lucas Bickel 007ff5561c Pass debug flag to python logger as well 2017-04-15 23:27:04 +02:00
Lucas Bickel f1d6fdea39 Merge pull request #161 from Robbt/fix/celery-worker-crash
Fix/celery worker crash
2017-04-14 09:25:58 +02:00
Robb Ebright 2d7882872b use celery 3.0 and compatible kombo 2017-04-13 23:11:59 -04:00
Robb Ebright c7131e0936 set celery version 3 2017-04-13 21:58:49 -04:00
Robbt b12d132aab removed hardcoded include of pervasives.liq 2017-04-03 19:54:18 -04:00
Lucas Bickel acdc529139 Do not bundle liquidsoap library
I think the code was bundled into legacy upstream before it was
readily available in liquidsoap proper. These snippets are now
maintained at https://github.com/savonet/liquidsoap/tree/master/scripts.

On all distros I checked these scripts are installed to /usr/bin/liquidsoap
by the corresponding package. Liquidsoap loads them from there by
default.

By not bundling this we will be ready to profit from new features and
bugfixes in liquidsoap that is expected to land on opam soon. We'll
need to figure out how to get debian and others updated when that
happens.
2017-03-28 12:26:11 +02:00
Lucas Bickel b267036483 Fix recording through ecasound
This is part 2 of fixing ecasound recordings from line-in. Part 1 restored the User-Interface, part 2 takes care of getting to the point where ecasound gets started, records something and uploads it through rest when done. Part 3 will take care of making sure that the recorded file is mapped to the show and not just stored as a new track.

I refactored api_clients to not use urllib2 for posting multipart data since I was loosing my sanity over it and requests seems to have a modern approach to doing this compared to what api_clients was previously doing.
2017-03-24 15:15:37 +01:00
Lucas Bickel 5f04dbb8a8 Get base_recorder_file config from proper subsection in conf
It took me way too long to figure this one out it wasn't logging nicely. With this ecasound actually gets called again. It's still failing on my install but I'm not yet sure why exactly.
2017-03-23 13:18:52 +01:00
Hans-Joachim aa64b8eab8 get rid of SaaS definitions 2017-03-21 22:56:43 +01:00
Lucas Bickel d20965131c Fix TLS support
Clearly, I have no python skills hence this bug :(
2017-03-20 21:31:46 +01:00
Lucas Bickel 81d3c3e2b8 Merge pull request #84 from Robbt/fix/live-stream-source
[WIP] Making show and master source ports and mount points editable.
2017-03-20 02:06:58 +01:00
Lucas Bickel c6225f9db5 Reverse pypo changes
The TODO seems to have been wrong due to the fact that everything works as advertised w/0 the change.
2017-03-19 13:15:59 +01:00
Lucas Bickel 4527b63c7b General fixes for TLS
This was tested in airtime web and with integration of media-monitor and silan up and running. It might work for pypo but that needs testing.
2017-03-18 15:47:50 +01:00
Lucas Bickel ae4c9203e6 Refactor override preference
Properly defaults the preference to be true and always return a boolean value since that is what celery will be expecting.
2017-03-17 02:10:04 +01:00
Robb Ebright fefc53c000 basic podcast album override option in preferences 2017-03-16 16:48:31 -04:00
Robb Ebright 1b90dbd4ca working python liquidsoap reconfigure script, might need further refinement 2017-03-14 04:02:51 +00:00
Robb Ebright 67ffd2d34a Making show and master source ports and mount points editable. 2017-03-14 01:15:14 +00:00
Robb 479bdb1c80 Merge pull request #76 from radiorabe/feature/no-more-std_err_override-for-pypo
Problem: std_err_override is a hack for python < 2.7
2017-03-13 14:44:01 -04:00
Lucas Bickel dfe3f077fd Replace std_err_override with logging.captureWarnings(True) in pypo
The quite ugly hack with std_err_override seems to have been made for python < 2.7. Since all major distros
have al least python 2.7 installed we can stop using the std_err_override hack.

This removes it from pypo, media-monitor still uses the module and we can completely delete it when we have
remove media-monitor after having maybe backported the watched folders feature to analyzer.
2017-03-13 16:28:07 +01:00
Lucas Bickel 99a0ce37cc Fix fix_cue_in to work with liquidsoap 1.2
The previous syntax only worked with 1.1, this one should work on both.
2017-03-13 14:30:51 +01:00
Robb a583d8fa1e Merge pull request #64 from radiorabe/feature/debian-and-experimental-centos
Vagrant Debian support (and experimental CentOS)
2017-03-12 21:42:37 -04:00
Kirill Kadoshnikov 0775bc4f59 Correction lines 399 and 400. ls_script.liq
Lines 399 and 400. Changed the values of s3_name and s3_description places. 
(Because of this error, the Icecast confused the name and description of the flow)
_______________________
Строки 399 и 400. Поменял значения s3_name и s3_description местами. (Из-за этой ошибки Icecast путал название и описание потока)
_______________________
Sorry for my clumsy translation, I'm from Russia
2017-03-12 20:03:30 +04:00
Lucas Bickel ac5f608bd8 Refactor into def check_version
Make the code more readable :)
2017-03-12 14:18:06 +01:00
Lucas Bickel 80373ca7bc cue_cut workaround
This is the workaround for <https://github.com/savonet/liquidsoap/issues/390>.

I still need to do proper testing on it and maybe we should figure out the proper "formula" for getting to the 0.04 value.
2017-03-12 14:18:06 +01:00
Lucas Bickel c29285ae48 Vagrant Debian support (and experimental CentOS)
This changes the Vagrant setup to support multiple installations as multiple
boxes. In addition to Ubuntu Vagrant can now be used to install on Debian
as well as on CentOS.

I took the chance to clean up the .deb install a bit and backported analyzer
and celery to SysV proper so it runs there. Some of the distro specfics were
moved to the install script from the python setup scripts to acheive this.

For the CentOS support I added a rather involved OS prepare script. In the
long term this will be added to the preparing-the-server docs we already have.

I had to switch the default port to http-alt (8080). On CentOS 9080 is registered
for ocsp and getting it to work for apache without hacking SELinux is hard. I
think 8080 is the RFC way to go anyhow. If anyone want to override this it
should be rather easy using the --web-port arg and by hacking Vagrantfile.

The PyOpenSSL code has been refactored for all the distros that the Vagrantfile
now supports.

As far as my checks go, I tried this code with all the distros, uploaded a track
and downloaded a unicode and a ssl podcast and was able to listen to them
in each case.

In the experimental CentOS case, the UI is not up to spec since services
need to get scheduled through systemctl and the status overview (ie. on the /?config page)
do not work properly. They need to be as follows:

```
sudo systemctl start airtime-playout
sudo systemctl start airtime-liquidsoap
sudo systemctl start airtime_analyzer.service
sudo systemctl start airtime-celery.service
```
2017-03-12 13:42:22 +01:00
Lucas Bickel 0cb5e2665e Fix unicode issues in podcast downloader
The podcast downloader fails pretty badly when the podcast name contains non ascii chars. The main fail happens during logging; I have learnt way to much about pythons stupid unicode implementation.

This adds addtional debug logging and also outputs the real reason a download fails properly. The content of the tags should be written as UTF-8 or whater is input into it, this commit mainly touches (and fixes) logging.
2017-03-11 21:01:52 +01:00
Lucas Bickel 0e8d0868e8 Make pypo media downloader port aware
This is needed if the base port is not 80 like in the vagrant setup.
2017-03-10 19:10:15 +01:00
Robb d86e223c45 Merge pull request #28 from radiorabe/feature/robbt/podcast-naming
Podcast naming feature as per #26
2017-03-06 18:12:57 -05:00
Lucas Bickel 188c127057 Merge branch 'master' into feature/analyzer-on-travis
# Conflicts:
#	.travis.yml
2017-03-04 16:35:11 +01:00
Lucas Bickel 2e9fc432b1 Only override album it is empty 2017-03-04 13:38:37 +01:00
Robb Ebright 2cebb7dfa2 first part of the adding album tags to podcast downloads 2017-03-04 13:38:36 +01:00
Lucas Bickel 9b3d0c90da mostly run analyzer tests on travis
* [x] regonfigured the build matrix with more php jobs and a separate python job (we can add more python jobs later)
* [x] run tests on travis' trusty beta container (it's closer to what we need anyway)
* [x] install packages needed for analyzer tests in build env
* [x] added docs on how to run nosetests locally
* [x] don't run initctl in analyzer setup so setup can also be used on travis (and add it to the install script directly)
* [x] ignore replaygain checks on travis (it has proven quite impossible to get the needed python-gi module to work in the provided virtualenv)

I tried a lot of solutions to get the replaygain checks to run. I needed to decide that this has gone far enough, maybe someone who is more of a pythonista than me can take a crack at it and get it solved. Even without running those tests on CI/CD there are still plenty others.

This PR only has parts of what are needed for getting python tests running on travis as per #15. I only took a quick shot at anything not analyzer and figured I would not be able to "fix" them without digging a bit deeper (ie. also getting rid of std_err_override).
2017-03-03 20:38:27 +01:00
Lucas Bickel e28ad471f9 Rewrite config from /etc/airtime-saas to plain /etc/airtime
This is the results of sed -i -e 's|/etc/airtime-saas/|/etc/airtime/|' `grep -irl 'airtime-saas' airtime_mvc/ python_apps/` :P

It might need more testing, the airtime-saas part never really made sense, zf1 has environments for that, ie you would create a saas env based on production for instance.

I beleive legacy upstream was using this to share configuration between customers (ie. analyser runs only once and writes to a shared S3 bucket). I assume they mount the airtime-saas folder onto individual customers instances with a global config. Like I said, I don't feel that this makes sense since all it does is make hacking at the configs in airtime-saas a bit easier. A serious SaaS operation should be using something like puppet or ansible to achieve this.
2017-03-03 15:57:41 +01:00
Albert Santoni a26f1a70e3 Respawn liquidsoap and pypo indefinitely if they fail to launch. Throttled it though. 2015-12-04 15:56:06 -05:00
Albert Santoni 91e1252b86 SAAS-1239: Listener stats with Shoutcast not working 2015-12-04 15:05:17 -05:00
Albert Santoni 2eea558dfd SAAS-1267: AAC streams stuck at 64 kbps, even at higher bitrates 2015-12-04 10:51:07 -05:00
Albert Santoni 965a78c54a Merge branch 'saas-dev' into saas-dev-publishing
Conflicts:
	airtime_mvc/application/controllers/ApiController.php
2015-11-18 12:38:18 -05:00
Duncan Sommerville 071de55329 Add some additional error handling and prevent disabled buttons from being triggered 2015-11-11 19:26:51 -05:00
Albert Santoni bb05fa996a SAAS-1132: Improve safety of XML parsing for listener stats 2015-11-09 19:32:56 -05:00
Albert Santoni c85944785b Comments 2015-10-30 18:09:56 -04:00
Albert Santoni b49bb2e262 Loosen up Mutagen vs. Silan cue out length threshold a bit 2015-10-30 17:54:24 -04:00
Albert Santoni 7be548f30e Fixed the airtime_analyzer unit tests 2015-10-30 17:15:33 -04:00
Albert Santoni fc51e63214 Fix typo in airtime_analyzer setup.py 2015-10-30 17:13:12 -04:00
Albert Santoni 76f202106b Defensive coding against Silan bugs and bump to Mutagen 1.31 2015-10-30 17:12:13 -04:00
Duncan Sommerville 4f281a30ed Add SoundCloud update and download tasks to Celery backend; requires airtime-celery reinstall 2015-10-30 16:10:16 -04:00
Duncan Sommerville e3feb17f0c * Change the Celery timeout to 15 minutes (from 10) to better accommodate automatic ingest
* Fix various small bugs in auto ingestion and tab implementation
* Update TaskManager run conditions to piggyback on API calls - guarantees a certain frequency of requests and greatly reduces chances of lock contention
2015-10-29 17:53:45 -04:00
Duncan Sommerville 0b1df6baf3 * SAAS-1084 - initial work on publishing API backend
* More work on automatic ingest
* Add automatic_ingest_timestamp column to ImportedPodcast
2015-10-20 19:03:34 -04:00