FIBRE Portal ================ FIBRE portal repository. https://fibre.org.br Dependencies =============== ### Redis ``` docker run --name fibre-redis -d -p 6379:6379 redis ``` Postgresql Python3 Python3 pip Django 1.10.2 Django recaptcha psycopg2 Installation guide ================ ## Python environment [Virtual Environments](http://docs.python-guide.org/en/latest/dev/virtualenvs/) Install virtualenv via pip: ``` $ pip install virtualenv ``` Active venv: ``` $ cd fibre-terminal $ virtualenv venv $ source venv/bin/activate ``` Install dependencies ``` pip install -r requirements.txt ``` ## Project Migrate: ``` python manage.py migrate ``` Run server: ``` python manage.py runserver 8000 ``` - Install OS dependencies ``` sudo apt-get update sudo apt-get install -y python3 python3-pip python3-venv python3-openssl python-psycopg2 libxml2-dev libxslt1-dev python3-lxml postgresql postgresql-server-dev-9.4 libffi-dev libxmlsec1-dev git vim ``` - Clone the Portal repo: ``` git config --global http.sslverify false git clone https://git.rnp.br/fibre/portal-interface.git ``` - Create virtual environment ``` pyvenv venv python3 -m venv venv ``` - Activate virtual environment ``` source venv/bin/activate ``` - Install python dependencies ``` pip3 install Django==1.10.2 pip3 install django-recaptcha2 pip install django-bootstrap3 pip3 install psycopg2 pip3 install sqlalchemy pip3 install cryptography pip3 install httplib2 pip3 install xmlsec pip3 install networkx pip3 install psycopg2-binary pip3 install urllib3 aptitude -V install python3-urllib3/jessie-backports ``` - Run server ``` screen -S portal-interface python3 manage.py runserver 8080 ``` - Install nginx for localhost proxy ``` apt-get install nginx sudo ln -s nginx/portal.conf /etc/nginx/sites-enabled/ sudo rm /etc/nginx/sites-enabled/default ``` - Database configuration ``` sudo -u postgres psql template1 -c "CREATE USER portaladmin WITH PASSWORD 'portal' CREATEDB;" sudo -u postgres psql -c "CREATE DATABASE portaldb;" sudo -u postgres psql portaldb -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO portaladmin;" python3 manage.py migrate ```