This project is no longer mainteined and updated. Please refer to the updated project by clicking on this link.
Erre2 è un webserver scritto in python che si pone come obiettivo quello di creare una piattaforma gradevole da usare per l'universitario medio sulla quale è possibile caricare e aggiornare riassunti, piuttosto che ritrovarseli sparpagliati nel gruppo universitario. Con Erre2, inoltre, è possibile ricevere notifiche mediante Telegram di aggiornamenti e nuovi arrivi sulla piattaforma, per essere sempre aggiornati e pronti agli esami.
Erre2 is a webserver written in python that aims to become a comfortable platform to be used by the average university student to gather summaries in a more methodic and organized way than scattered in a Whatsapp group. Erre2 also supports telegram integration: provide your university group chat-id, and Erre2 will tell everyone if a new summary gets uploaded or updated.
If you need a full website translation, please open an issue. I will be more than happy to provide one.
- Clone this repository using
git
:git clone [email protected]:Fermitech-Softworks/Erre2.git
-
Install dependencies using
poetry
:poetry install
-
Use
export
to set the required environment variables:export COOKIE_SECRET_KEY='qwerty' # A random string of characters # The token for the Telegram notifier bot, get one at https://t.me/BotFather export TELEGRAM_BOT_TOKEN='1234567890:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' # The Telegram chat id where the notifications should be sent, remember that the id of supergroups is prefixed by -100 export TARGET_CHAT_ID='-100XXXXXXXXXX' # The folder where files should be stored export UPLOAD_FOLDER='/opt/erre2' # The uri of the database to use export SQLALCHEMY_DATABASE_URI='postgresql://erre2@/erre2'
-
Run the
flask
development server:poetry run python -m erre2
Assuming you are using a Linux distribution which supports systemd and has apache2 installed.
-
Create a new
venv
:python -m venv venv
-
activate
the venv you just created:source venv/bin/activate
-
Install the package from
pip
:pip install erre2
-
Create the file
/etc/systemd/system/web-erre2.service
with the following contents:[Unit] Name=web-erre2 Description=Erre2 Gunicorn Server Wants=network-online.target After=network-online.target nss-lookup.target [Service] Type=exec User=erre2 Group=erre2 # Replace with the directory where you cloned the repository WorkingDirectory=/opt/erre2 # Replace with the directory where you cloned the repository ExecStart=/opt/erre2/venv/bin/gunicorn -b 127.0.0.1:30002 erre2.__main__:reverse_proxy_app [Install] WantedBy=multi-user.target
-
Create the file
/etc/systemd/system/web-erre2.service.d/override.conf
with the following contents:[Service] # A random string of characters Environment=COOKIE_SECRET_KEY=qwerty # The token for the Telegram notifier bot, get one at https://t.me/BotFather Environment=TELEGRAM_BOT_TOKEN=1234567890:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA # The Telegram chat id where the notifications should be sent, remember that the id of supergroups is prefixed by -100 Environment=TARGET_CHAT_ID=-100XXXXXXXXXX # The folder where files should be stored Environment=UPLOAD_FOLDER=/opt/erre2 # The uri of the database to use Environment=SQLALCHEMY_DATABASE_URI=postgresql://erre2@/erre2
-
Reload all
systemd
daemon files:systemctl daemon-reload
-
start
(and optionallyenable
to run at boot) theweb-erre2
systemd service:systemctl start web-erre2 systemctl enable web-erre2
-
Configure a reverse proxy (
apache2
,nginx
, ...) to proxy requests to and from127.0.0.1:30002
.