Wiki > Medusa
Installation
pip
-
Install pip for python3 (if you haven't already)
curl -s https://bootstrap.pypa.io/get-pip.py | python3 - --user
-
Add it to your PATH (if you haven't already)
echo "PATH=\$HOME/.local/bin:\$PATH" >> ~/.bashrc && source ~/.bashrc
Medusa
-
Download Medusa.
git clone git://github.com/pymedusa/Medusa.git
-
Install python module dependencies
pip3 install --user -U -r Medusa/requirements.txt
-
Start Medusa in daemon mode to create the initial configuration files.
python3 ~/Medusa/start.py -d
-
Kill the Medusa process.
pkill -f start.py
-
Edit the configuration file to set a port and download location. Port 21940 has been automatically generated for you, but you may use another 5 digit port between 10000 and 65535.
nano ~/Medusa/config.ini
Change the line that reads
root_dirs = ""
toroot_dirs = "0|/home/user/files"
.
Change the "web_port" option to 21940 or your chosen port. Set a username and password for the web interface by editingweb_username = "user"
andweb_password = "your password here"
-
Change Your Bash Timezone. If you haven't set your Bash Timezone, your logs and television schedule will be incorrect.
-
Start Medusa
python3 ~/Medusa/start.py -d --nolaunch
Automatically Restart
Below are steps to take to have your Medusa instance automatically restart if it crashes, or if the server is rebooted.
-
Make a file to be used for the script.
touch ~/medusa_restart.cron
-
Edit the file and enter the text below.
nano -w ~/medusa_restart.cron
#!/bin/bash if pgrep -fx "/usr/lib/python-exec/python3.8/python3 /home/user/Medusa/start.py -d --nolaunch" > /dev/null then echo "Medusa is running." else echo "Medusa is not running, starting Medusa" python3 ~/Medusa/start.py -d --nolaunch fi exit
-
Save the file with
Ctrl+x
,y
andEnter
to accept overwriting. -
Make the script executable.
chmod +x ~/medusa_restart.cron
-
Open your crontab.
EDITOR=nano crontab -e
-
Enter the following text at the end of the file.
@reboot /home/user/medusa_restart.cron >/dev/null 2>&1 */5 * * * * /home/user/medusa_restart.cron >/dev/null 2>&1
-
Save the crontab with
Ctrl+x
,y
andEnter
to accept overwriting.
Usage
- Open your browser and navigate to
http://server.whatbox.ca:21940
to access the Medusa web interface.