This is a Flask app to run the SecLab Spotify Webpage
===================
- Python 3
- Pip3
- Librespot
To run the site, install virtualenv on your machine with
pip install virtualenv
create a new virtualenv in the root of the git repository and activate it with
virtualenv .
source bin/activate
install the required pip packages with
pip install -r requirements.txt
And finally, run the app with
python app.py
then go to localhost:3000
- Create a separate symlink for each file from etc/systemd/system/ into /etc/systemd/system/
sudo ln -s etc/systemd/system/librespot.service /etc/systemd/system/librespot.service
sudo ln -s etc/systemd/system/spotbot.service /etc/systemd/system/spotbot.service
sudo ln -s etc/systemd/system/spotbot_script.service /etc/systemd/system/spotbot_script.service
sudo ln -s etc/systemd/system/spotbot_script.timer /etc/systemd/system/spotbot_script.timer
- Edit the system service configuration files as needed to point to the correct directories and use the correct arguments to run script.sh.
- Start and enable the services on boot with
sudo systemctl start librespot.service
sudo systemctl enable librespot.service
sudo systemctl start spotbot.service
sudo systemctl enable spotbot.service
sudo systemctl start spotbot_script.service
sudo systemctl enable spotbot_script.service
sudo systemctl start spotbot_script.timer
- Create a symlink from etc/nginx/sites-available/spotbot into /etc/nginx/sites-available/spotbot
sudo ln -s etc/nginx/sites-available/spotbot /etc/nginx/sites-available/spotbot
- Create a symlink in sites-enabled to the site configuration file and reload nginx.
sudo ln -s /etc/nginx/sites-available/spotbot /etc/nginx/sites-enabled/spotbot
- Edit the nginx configuration file as needed to have uwsgi pointing to the correct directory.
- Add the following lines to your user crontab:
45 * * * * rm auth_token; authtoken
00 00 * * * rm librespot.log; touch librespot.log
- The site should now be live at your machine's IP address.