From d255a0839cffa398263bba06ef6a2792732d24c0 Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 17 Jan 2022 09:35:17 -0700 Subject: [PATCH 1/4] Installing python packages globally because it will make it easier to troubleshoot and start the services. --- 50x.html | 15 +++++++++++++-- install.sh | 4 +--- systemd/wrolpi-api.service | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/50x.html b/50x.html index 7b057994..2d1cf8de 100644 --- a/50x.html +++ b/50x.html @@ -1,4 +1,4 @@ - +

Error!

@@ -8,9 +8,20 @@

sudo systemctl status wrolpi-app

sudo systemctl status wrolpi-api

-

If either of those services are not running, start it:

+
+

If either of those services are not running, start all WROLPi services:

+

sudo systemctl start wrolpi.target

+ +
+

Or, start them individually:

sudo systemctl start wrolpi-app

sudo systemctl start wrolpi-api

+ +
+ +

Can't start the services?

+

You can view the media directory by clicking here

+ diff --git a/install.sh b/install.sh index e0056a48..b7e0e020 100755 --- a/install.sh +++ b/install.sh @@ -64,8 +64,6 @@ pip3 --version || ( curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && python3 /tmp/get-pip.py ) -python3 -m venv /opt/wrolpi/venv -. /opt/wrolpi/venv/bin/activate # Install python requirements files pip3 install -r /opt/wrolpi/requirements.txt @@ -85,7 +83,7 @@ sudo -u postgres psql -c '\l' | grep wrolpi || ( sudo -u postgres createdb -O wrolpi wrolpi ) # Initialize the WROLPi database. -(cd /opt/wrolpi && /opt/wrolpi/venv/bin/python3 /opt/wrolpi/main.py db upgrade) +(cd /opt/wrolpi && /usr/bin/python3 /opt/wrolpi/main.py db upgrade) # Install the WROLPi nginx config over the default nginx config. cp /opt/wrolpi/nginx.conf /etc/nginx/nginx.conf diff --git a/systemd/wrolpi-api.service b/systemd/wrolpi-api.service index b309db0b..212b76ec 100644 --- a/systemd/wrolpi-api.service +++ b/systemd/wrolpi-api.service @@ -5,7 +5,7 @@ PartOf=wrolpi.target [Service] Environment=PYTHONUNBUFFERED=1 -ExecStart=/opt/wrolpi/venv/bin/python /opt/wrolpi/main.py api +ExecStart=/usr/bin/python3 /opt/wrolpi/main.py api Group=wrolpi User=wrolpi WorkingDirectory=/opt/wrolpi/ From 58bfde9c9cd9718fa78d1f123e390b201450ee1e Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 17 Jan 2022 10:46:14 -0700 Subject: [PATCH 2/4] Installing raspberry pi version of pyyaml. --- config/example.yaml | 1 + requirements.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/config/example.yaml b/config/example.yaml index 2434370f..6047f7d5 100644 --- a/config/example.yaml +++ b/config/example.yaml @@ -22,5 +22,6 @@ channels: name: WROLPi # the pretty name for the channel url: https://www.youtube.com/channel/UC4t8bw1besFTyjW7ZBCOIrw/videos directory: videos/wrolpi # relative to `media_directory` + download_frequency: 604800 timezone: America/Boise diff --git a/requirements.txt b/requirements.txt index 8afc5846..1d38472c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ psycopg2-binary==2.9.3 pytest-asyncio==0.17.0 pytest==6.2.5 pytz==2021.3 -PyYAML==6.0 +PyYAML==5.3.1 requests==2.27.1 Sanic-Cors==1.0.1 sanic-openapi==0.6.2 From b62dec0d4221724daac15ce9d286c78d6f5e14bc Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 17 Jan 2022 11:17:31 -0700 Subject: [PATCH 3/4] Creating user home directory when creating wrolpi user. --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b7e0e020..18a652c5 100755 --- a/install.sh +++ b/install.sh @@ -91,7 +91,7 @@ cp /opt/wrolpi/50x.html /var/www/50x.html /usr/sbin/nginx -s reload # Create the WROLPi user -grep wrolpi /etc/passwd || useradd -d /home/wrolpi wrolpi -s "$(command -v bash)" +grep wrolpi /etc/passwd || useradd -md /home/wrolpi wrolpi -s "$(command -v bash)" chown -R wrolpi:wrolpi /opt/wrolpi # Create the media directory. This should be mounted by the maintainer. From 531f75351c09191be6ac83a7b73d64ae1d1d0cb8 Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 17 Jan 2022 12:43:04 -0700 Subject: [PATCH 4/4] Adding information about hotspot to install output. --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 18a652c5..c057c7bb 100755 --- a/install.sh +++ b/install.sh @@ -127,8 +127,13 @@ WROLPi has successfully been installed! Mount your external hard drive to /media/wrolpi if you have one. Start the WROLPi services using: - # sudo systemctl start wrolpi.target then navigate to: http://${ip} + +Or, join to the Wifi hotspot: +SSID: WROLPi +Password: wrolpi hotspot + +When on the hotspot, WROLPi is accessible at http://192.168.0.1 "