Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Latest commit

 

History

History
151 lines (100 loc) · 4.29 KB

HOWTO.md

File metadata and controls

151 lines (100 loc) · 4.29 KB

How to

Monitor logs

Run tail -F data/application.log in a terminal window (when in the application directory). Replace application.log with application.warnings.log to see only warnings and errors.

Application complains about Permission denied

Try running the following:

sudo chown -R podprod data src/static/images

Replace podprod with whatever user is used to run the application.

Please note that the application should not be the owner of any other directory or file than those mentioned above, in order to minimize consequences of a security breach.

Change name of show

Simply change the name in DigAS. You should monitor the logs for warnings and errors.

Add support for an alternate version of feeds

This is how the Spotify feed is set up.

  1. Add pipeline name to ALLOWED_PIPELINES in src/views/web_feed.py.
  2. Add pipeline to the set given to validate_pipelines in the functions create_show_pipelines and create_episode_pipelines found in src/feed_utils/init_pipelines.py.
  3. Add configuration for this pipeline in settings.default.yaml, with an explanatory comment.
  4. Test out the application. You should be able to access this pipeline through /<pipeline-name>/<show-name>.

Upgrade/deploy a new version

You might want to have a staging server which is identical to the production server, and first try to upgrade the staging server before upgrading the production server.

  1. Change directory so you're in the folder which contains the folder where this application is installed.

  2. Make a copy of the podkast.radiorevolt.no folder:

    cp -p -R podkast.radiorevolt.no upgrade-podkast.radiorevolt.no

    You might have to run this with sudo.

  3. Change into the new directory:

    cd upgrade-podcast-feed-gen
  4. Remove the virtualenv.

    rm -R venv
  5. Set up the virtualenv and install the required packages, following the instructions in README.md.

  6. Download the newest changes:

    1. If you want to use newest master:

      git pull
    2. If you want to use a specific release:

      git fetch --all
      git checkout <release-name>
  7. Go through the changelog and/or release notes, and make the required changes to the configuration files (remember, the local non-template files aren't changed). You may also need to install or upgrade existing dependencies.

  8. Make yourself the owner of the data directory, so you can run the tests (note: no tests exist, this is outdated. Instead, run python src/app.py --bind 0.0.0.0:9000 or something to test out the application.):

    sudo chown -R YOUR_USERNAME:YOUR_USERNAME data
  9. Check that everything works:

    . venv/bin/activate
    py.test generator webserver
  10. Change back so the podcastfeedgen user you created during installation owns the data directory:

    sudo chown -R SERVER_USER:SERVER_USER data
  11. Now, we're ready to make our changes live. First, deactivate the virtualenv before removing it:

    deactivate
    rm -R venv
  12. Step out of the temporary directory.

    cd ..
  13. While performing the following steps, the website may become unavailable and produce errors!

    First, check if there are any specific instructions about this upgrade, like installing a new dependency or upgrading one of the existing dependencies. Follow those instructions.

  14. Copy the new files:

    cp -p -u -R upgrade-podcast-feed-gen/. podcast-feed-gen

    You might need to run this with sudo.

  15. Make the server reload, so the changes are applied:

    touch podcast-feed-gen/server.wsgi

(There's a chance you may have to restart the podcast-feed-gen service/upstart thing instead, I don't know for sure. In that case: sudo service podcast_feed_gen restart or sudo systemctl podcast_feed_gen restart.)

  1. Access the website and confirm that nothing is broken.

  2. Now, the website should be back to normal.

  3. Remove the copy we created.

    rm -R upgrade-podcast-feed-gen

    You might need to run this with sudo.

  4. Alter and improve this guide if something was poorly explained, you encountered a problem or something similar.