Experimental radio CMS based on Flask (Python) micro-framework for Radio Rhino (Strasbourg).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
/\/ \-/ ❭❬ fb5bd91713 merge requirements.txt 11 months ago
app updated README.md, change config default files 11 months ago
doc Little model refactoring + lorem & nuke commands 1 year ago
liquidsoap Liquidsoap webhook integration (in progress) 1 year ago
migrations Correcting pages id for about and contribute 1 year ago
rhino_ynh Correcting __init__ of Events. 1 year ago
.gitignore updated .gitignore to avoid updating config.py 11 months ago
README.html fixed README.md, added TABLES.rst for table description, and structure.dot for a graphviz representation of tables 1 year ago
README.md updated README.md, change config default files 11 months ago
TABLES.pdf fixed README.md, added TABLES.rst for table description, and structure.dot for a graphviz representation of tables 1 year ago
TABLES.rst fixed README.md, added TABLES.rst for table description, and structure.dot for a graphviz representation of tables 1 year ago
config.py updated README.md, change config default files 11 months ago
gunicorn.py removed modifications from gunicorn.py 11 months ago
manage.py updated README.md, change config default files 11 months ago
requirements.txt changed version of forgeryPy for forgerPy3 1 year ago
run_dev_server.sh updated README.md, change config default files 11 months ago
structure.dot fixed README.md, added TABLES.rst for table description, and structure.dot for a graphviz representation of tables 1 year ago
structure.png fixed README.md, added TABLES.rst for table description, and structure.dot for a graphviz representation of tables 1 year ago
wsgi.py Lot of shit to fix to get it working in prod 1 year ago

README.md

Rhino Radio CMS

Experimental webradio CMS based on Flask micro-framework designed for Radio Rhino with YunoHost (not absolutely required but necessary to protect admin).

Install

# On Debian-based distros
sudo apt-get install python3 python3-pip python3-virtualenv virtualenv

###
# If you want to create a virtual environment (i.e. for development purpose)

mkdir ~/.pyvenv
virtualenv -p python3 ~/.pyvenv/rhinoradiocms

source ~/.pyvenv/rhinoradiocms/bin/activate

#
###

###
# If you want to use a local postgresql server

# PostgreSQL and GIS (geographic db)
sudo apt-get install python3-dev postgresql-9.6 postgresql-server-dev-9.6 postgis

# Start PostgreSQL
systemctl start postgresql

sudo su postgres
psql
>>> CREATE DATABASE rhino;
>>> \c rhino;
>>> CREATE EXTENSION postgis;
>>> CREATE USER "rhino" WITH PASSWORD "mypassword";
>>> GRANT ALL ON DATABASE rhino TO "rhino";
>>> \q

#
###

###
# If you want to compile Sass CSS on your machine
sudo apt-get install ruby ruby-dev

gem install --user-install sass
# or
sudo gem install sass

#
###


# WARNING installing with pip will require administrator rights if not installing in a virtual environment, or install with --user
pip install -r requirements.txt

# if needed :
#createlang plpgsql gis

Init the base

# If you modified the password "mypassword", change the  
# url of the variable SQLALCHEMY_DATABASE_URI in the following format
# postgresql://user:password@hostname/rhino

# (Re-)initialize database
python3 manage.py nuke

# Feed database with random placeholder values
python3 manage.py lorem

Develop

Run dev server

python3 manage.py runserver

Access the main page

http://127.0.0.1:5000/site

List the routes

python3 manage.py routes

Admin

Admin interface on : http://domain.tld/admin

Deployment with Gunicorn

Install Gunicorn

pip3 install Gunicorn

More to come.

Uncomment ‘#scheme=“https”’ in views.py

Add environment variables to /lib/systemd/system :

  • AIRTIME_API_KEY
  • STREAM_URL
  • SECRET_KEY
  • FLASK_CONFIG=‘production’

If your podcast files are on a distant machine : set an autofs + sshfs on app/static/podcasts :

sshfs user@distant-ip:/podcasts/dir/

Prod upgrade

git pull
git merge origin master
sass app/static/scss/style.scss:app/static/css/style.css --style compressed
service rhinosite restart

Doc

Eeeeeeeh… Soon™.

Install Sphinx

pip3 install Sphinx