Commit Graph

15542 Commits

Author SHA1 Message Date
Lucas Bickel e31d5077ac Fix rebasing typo 2017-07-21 13:28:08 +02: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 320b128ad8 Merge pull request #247 from radiorabe/fix/update-warning
Fix update warning
2017-07-18 22:21:33 -04:00
Robb 0c06496203 Merge pull request #248 from radiorabe/fix/no-dev-composer-install
Don't pull dev packages on install
2017-07-18 22:20:28 -04:00
Robb 0837c97263 Merge pull request #250 from radiorabe/fix/cors-response-on-non-stdandard-port
Fix non default local CORS URL case
2017-07-18 22:20:00 -04:00
Lucas Bickel 04e2402276 Fix non default local CORS URL case
I cleaned up the CORSHandler code a bit more and also rewrote the
helper to use the framework to access the request properly and
took care of also grabbing the request schema from the server.
2017-07-18 20:39:53 +02:00
Lucas Bickel f794a579d6 Don't pull dev packages on install
We don't need them for the end user runtime and this speeds up the
install quite a bit when installing from the full tarball.

Devs will need to run `composer install` to run unit tests locally
but that's about it.
2017-07-17 22:02:46 +02:00
Lucas Bickel 9c5b769cf0 Fix update warning
I fixed the manual installer to ensure that the VERSION file ends up
in the right directory on install.

I also took care of the pre-release parts of the naggingness. It shows
no updates as long there is no stable release for the current version.
As soon as one is available it uses the orange update icon to alert the
user that an update would be in order since a stable version has been
released.
2017-07-17 21:15:51 +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
Lucas Bickel 5013a76060 Don't start services on install
We need to wait until the setup routine is finished or else the
install will fail when starting celery.
2017-06-27 22:44:13 +02:00
Robb ee22098b7d Merge pull request #218 from radiorabe/feature/update-phpamqp
Bump phpamqp
2017-06-13 08:23:25 -04:00
Robb dea59558a2 Merge pull request #221 from radiorabe/feature/update-faq
Add silan info to faq
2017-06-08 12:09:18 -04:00
Robb 9af154410a Merge pull request #226 from radiorabe/fix/php-7-assert-in-runtime-path
Remove assert() from rest module bootstrap
2017-06-08 12:08:40 -04:00
Lucas Bickel d6a5cbd02e Remove assert() from rest module bootstrap
Problem: assert() is Language construct in php 7 and not a function anymore. It also seems to behave silghtly differently with regards to what kind of side effects assertions are allowed to have. This leads to all of the rest endpoints being broken in php 7 since the assertion silently fails and the routes never really get added to the front controllers router.

Solution: Don't wrap the addRouter call in assert(). The way assert was being uses was rather unusual for php code this age. It was also mostly checking zf1 rather than guarding against errors in LibreTime itself.

The php manual clearly states "As a rule of thumb your code should always be able to work correctly if assertion checking is not activated." giving even more reason to ot wrap critical paths in assertions.

There are some other instances of `assert()` being used in non test code, those don't seem to have any negative effects on php7.
2017-06-07 17:33:23 +02:00
Lucas Bickel 1834ddd1bb Add silan info to faq
"What's with cue-In/Out points and silan?" is a frequently asked question that currently has multiple possible fixes and a couple of open tasks (not only "Why is it broken?" but also "Where is the cue-point editor?").

I added current infos to the release notes and was thinking this should be pointed out in the FAQ until we have a stable solution ready.
2017-06-07 00:00:58 +02:00
Lucas Bickel 2d3a367681 Bump phpamqp
Small bump to get rid of the package is outdated message also contains some patches to the lib.
2017-06-05 10:42:54 +02:00
Robb 9d5d866db6 Merge pull request #217 from radiorabe/feature/only-update-time-scale-pref-on-change
Only update timescale pref in db on change
2017-06-04 08:10:02 -04:00
Robb 92377518c4 Merge pull request #216 from radiorabe/feature/hint-about-distro-version-in-contributing
Ask for distro version in CONTRIBUTING.md
2017-06-03 17:42:12 -04:00
Lucas Bickel b1f840ee0f Only update timescale pref in db on change
The /Schedule/set-time-scale/format/json was being hit every time a new calendar page was displayed. The isn't good for performance reasons and also makes race conditions like #210 much more likely.

With this change the preference is only updated on the server when the GUI state changes because the user clicked on one of the "Day", "Week", or "Month" buttons.

This does not fix the locking issue completely, but it should help because the cc_prefs time-scale row in the database will get locked much less often. After applying this I wasn't able to reproduce #210 any more on an install with an extensive schedule.
2017-06-03 23:05:18 +02:00
Lucas Bickel 1f59d44afd Ask for distro version in CONTRIBUTING.md 2017-06-02 18:11:02 +02:00
Robb e7d1359117 Merge pull request #201 from radiorabe/feature/release-script-round-2
Fix release script call
2017-05-25 11:37:55 -04:00
Robb c1f38e536f Merge pull request #206 from radiorabe/fix/delete-first-admin-user
Problem: Deleting the initial admin won't work since it doesn't re-assign files
2017-05-25 11:25:12 -04:00
Robb 7044862fb8 Merge pull request #202 from radiorabe/fix/crlf-in-docs
[WIP] Run dos2unix on all markdown files in docs/
2017-05-24 08:20:43 -04:00
Lucas Bickel 2ea19f20fe Re-assign files to first non deleted admin user 2017-05-22 00:20:02 +02:00
Lucas Bickel 3233ccd151 Remove dead code in user model 2017-05-22 00:10:38 +02:00
Lucas Bickel f3e8e8cb00 Run dos2unix on all markdown files in docs/ 2017-05-16 13:39:17 +02:00
Lucas Bickel 4dc45a935f Fix release script call
The script was logging "Script failed with status 127". It seems that this is due to release.sh not being executable and not being referenced with a path starting with ./.
2017-05-16 12:44:01 +02:00
Lucas Bickel 43eb777177 Clean up file creation and remove std_err_override
* Re-order folder creation to make a bit more sense (the log file creation step was unreachable because python scripts always created the checked dir early)
* create dirs from pypo data_files in installer so pypo can run out of the box on a new install
* Fix path to logrotate script (logrotation needs testing though)
* Remove std_err_override module from install. Code-wise only airtime-media-monitor is still based on it and that is slated for removal together with std_err_override.
2017-05-01 19:04:40 +02:00
Robb 2b30a14744 Merge pull request #168 from radiorabe/feature/use-global-angular-install-and-not-cdn
Use the minimized angular from public dir instead of cdn
2017-04-28 19:58:20 -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
Robb 481b8b2ebc Merge pull request #188 from radiorabe/feature/update-docs
Refactor upgrading docs
2017-04-28 15:44:26 -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 a48bdb8461 Add info on system restart/reboot 2017-04-25 20:32:38 +02:00
Lucas Bickel 0f831c6e0b Update faq entry 2017-04-25 20:14:03 +02:00
Lucas Bickel b2f8a57332 Refactor upgrade docs
* [x] explain semver since this upgrade cases are when this applies
* [x] links to different parts of manual
* [x] move backup section to the top
* [x] add "real" git pull example
* [x] rename install script to plain ./install
* [x] remove very old monit upgrade help
2017-04-25 20:09:14 +02: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 711238af18 Merge pull request #171 from bburton/vagrant-debian-bento-box
Switch Vagrantfile to use bento boxes for Debian #170
2017-04-20 15:22:26 +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 74d58b7555 Removed upstart-sysv comment 2017-04-19 20:45:17 +02:00
Bill Burton 450a92384f Switch Vagrantfile to use bento boxes for Debian #170 2017-04-19 14:42:12 -04:00
Lapotor 0766b91cde Added remind to reload systemctl for Xenail 2017-04-19 20:36:48 +02:00
Lapotor 28fb7fca72 Changed on Xenial Upstart to Systemd 2017-04-19 20:35:47 +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
Lucas Bickel f9a19d9e27 Uses the minimized angular from public dir instead of cdn
This uses the available minimized version of angular instead of using the non minimized version from the google cdn.
2017-04-18 08:43:44 +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
Robb b536769a5d Merge pull request #164 from radiorabe/feature/project-rename-in-defaultdata
Problem: legacy upstream name is still in defaultdata
2017-04-17 14:58:21 -04:00
Robb 0089aa203b Merge pull request #165 from radiorabe/feature/update-vagrant-docs
Update vagrant docs for new ubuntu boxes
2017-04-17 14:57:36 -04:00
Lucas Bickel e34d87a1da Update vagrant docs for new ubuntu boxes 2017-04-16 01:33:41 +02:00