/rtrss

RSS feeds for popular torrent tracker

Primary LanguagePythonApache License 2.0Apache-2.0

Configuration

Application settings:

RTRSS_SECRET_KEY - secret key used by Flask to sign cookies. Set this to some random, hard to guess string. RTRSS_FILESTORAGE_URL - URL for torrent file storage. Supported schemes are gs:// and file://.

  • file:// is used to store torrent files in local directory.
  • gs:// scheme is used to store files in Google Cloud Storage: gs://<Storage bucket id>/[prefix]. Prefix is optional. On Openshift default value is file://{$OPENSHIFT_DATA_DIR}/torrents, in local development environment it defaults to file://<Project dir>/data/torrents RTRSS_GCS_PRIVATEKEY_URL - If you use Google Cloud Storage to store torrent files, this must be set to location of private key file in JSON format.

Settings are stored in environment variables, default value is used if variable not set.

Deployment

Development environment

Prerequisites:

Step-by-step guide:

  1. git clone https://github.com/notapresent/rtrss.git
  2. cd rtrss
  3. vagrant up
  4. vagrant ssh
  5. ... TODO

Production deployment on Openshift

Prerequisites:

  • Openshift account. You can create one here.
  • OpenShift Client Tools (installation instructions). Don't forget to run rhc setup before first use.
  • Google developer console project. Create one here.
  • Service account, associated with the project from previous step. Here you can find instructions how to create one.
  • Private key in JSON format. Find your service account in Credentials section, then click [Generate new JSON key]. You need to store this file somewhere, so it can be downloaded via public URL, services like Dropbox will do.
  • Google Cloud Storage bucket. By default, each new project gets default bucket, named <Project id>.appspot.com

Step-by-step guide:

  1. Choose a name: export APP_NAME='<Your app name here>'
  2. Create openshift application: rhc create-app "$APP_NAME" python-2.7 postgresql-9.2 --from-code=https://github.com/notapresent/rtrss.git
  3. cd $APP_NAME
  4. Set up configuration values: rhc set-env RTRSS_SECRET_KEY='<Secret key>' RTRSS_FILESTORAGE_URL='<Storage URL>'
  5. ssh into newly created application: rhc ssh. Following commands are executed on server
  6. Activate virtualenv environment: source "$OPENSHIFT_HOMEDIR/python/virtenv/bin/activate"
  7. Initialize database: rtrssmgr db init'
  8. Add user accounts
  9. Import categories from tracker: rtrssmgr worker sync_categories