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 isfile://{$OPENSHIFT_DATA_DIR}/torrents
, in local development environment it defaults tofile://<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.
git clone https://github.com/notapresent/rtrss.git
cd rtrss
vagrant up
vagrant ssh
- ... TODO
Production deployment on Openshift
- 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
- Choose a name:
export APP_NAME='<Your app name here>'
- Create openshift application:
rhc create-app "$APP_NAME" python-2.7 postgresql-9.2 --from-code=https://github.com/notapresent/rtrss.git
cd $APP_NAME
- Set up configuration values:
rhc set-env RTRSS_SECRET_KEY='<Secret key>' RTRSS_FILESTORAGE_URL='<Storage URL>'
- ssh into newly created application:
rhc ssh
. Following commands are executed on server - Activate virtualenv environment:
source "$OPENSHIFT_HOMEDIR/python/virtenv/bin/activate"
- Initialize database:
rtrssmgr db init'
- Add user accounts
- Import categories from tracker: rtrssmgr worker sync_categories