Skip to content

Commit 6cba66e

Browse files
nginx needs to serve downloads from the media directory.
1 parent dc2d97d commit 6cba66e

File tree

8 files changed

+11
-14
lines changed

8 files changed

+11
-14
lines changed

debian-live-config/config/hooks/normal/9999-wrolpi.hook.chroot

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ cd /opt/wrolpi/app
1818
npm --version
1919
node --version
2020
npm install
21-
npm run build
2221

2322
# Install Node console commands.
2423

docker/app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ USER node
1818
RUN npm install
1919

2020
# Run the production build
21-
CMD ["serve", "-s", "build"]
21+
CMD ["npm", "run", "start"]

etc/raspberrypios/wrolpi-app.service

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Wants=wrolpi-api.service
44
PartOf=wrolpi.target
55

66
[Service]
7-
ExecStart=/usr/local/bin/serve -s build -l 5000
7+
# Use development React app
8+
ExecStart=/usr/bin/npm run start
89
Group=wrolpi
910
User=wrolpi
1011
WorkingDirectory=/opt/wrolpi/app/

etc/raspberrypios/wrolpi.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ location /apple-touch-icon.png {
1414

1515
location / {
1616
# React APP
17-
proxy_pass http://0.0.0.0:5000;
17+
proxy_pass http://0.0.0.0:3000;
1818
rewrite $1 break;
1919
}
2020

2121
location /ws {
22-
proxy_pass http://0.0.0.0:5000;
22+
proxy_pass http://0.0.0.0:3000;
2323
proxy_http_version 1.1;
2424
proxy_set_header Upgrade $http_upgrade;
2525
proxy_set_header Connection $connection_upgrade;
@@ -69,5 +69,5 @@ location /download {
6969

7070
autoindex on;
7171
autoindex_exact_size off;
72-
alias /opt/media;
72+
alias /media/wrolpi;
7373
}

help.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ if [ -f /etc/systemd/system/wrolpi-app.service ]; then
173173
fi
174174
fi
175175

176-
if curl -s http://0.0.0.0:5000 | grep -i wrolpi >/dev/null; then
176+
if curl -s http://0.0.0.0:3000 | grep -i wrolpi >/dev/null; then
177177
echo "OK: WROLPi app responded with UI"
178178
else
179179
echo "FAILED: WROLPi app did not respond with UI"
180180
fi
181181

182-
if curl -s http://0.0.0.0:5000/epub/epub.html | grep -i epub.js >/dev/null; then
182+
if curl -s http://0.0.0.0:3000/epub/epub.html | grep -i epub.js >/dev/null; then
183183
echo "OK: WROLPi app responded with ebook interface"
184184
else
185185
echo "FAILED: WROLPi app did not respond with ebook interface"

pi-gen/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ rsync -a "${SCRIPT_DIR}"/stage2/* "${BUILD_DIR}/stage2/"
3333

3434
# We only need to build the Lite and Desktop images.
3535
rm "${BUILD_DIR}"/stage*/EXPORT*
36-
echo 'IMG_SUFFIX="-lite"' > "${BUILD_DIR}/stage2/EXPORT_IMAGE"
36+
#echo 'IMG_SUFFIX="-lite"' > "${BUILD_DIR}/stage2/EXPORT_IMAGE"
3737
echo 'IMG_SUFFIX="-desktop"' > "${BUILD_DIR}/stage5/EXPORT_IMAGE"
3838

3939
# Build the images.
@@ -45,7 +45,7 @@ grep "03-run-chroot.sh completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (
4545
grep "04-run-chroot.sh completed" "${SCRIPT_DIR}/build.log" >/dev/null 2>&1 || (echo "script 4 failed!" && exit 1)
4646

4747
# Move the built images out of the build directory.
48-
mv "${BUILD_DIR}"/deploy/*lite*xz "${SCRIPT_DIR}"/WROLPi-v"${VERSION}"-aarch64-lite.img.xz
48+
#mv "${BUILD_DIR}"/deploy/*lite*xz "${SCRIPT_DIR}"/WROLPi-v"${VERSION}"-aarch64-lite.img.xz
4949
mv "${BUILD_DIR}"/deploy/*desktop*xz "${SCRIPT_DIR}"/WROLPi-v"${VERSION}"-aarch64-desktop.img.xz
5050
chmod 644 "${SCRIPT_DIR}"/*xz
5151
chown -R 1000:1000 "${SCRIPT_DIR}"

pi-gen/stage2/04-wrolpi/03-run-chroot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ python3 -m venv /opt/wrolpi/venv
2929
/opt/wrolpi/venv/bin/pip3 install -r /opt/wrolpi/requirements.txt
3030

3131
# Install webapp.
32-
(cd /opt/wrolpi/app && npm install && npm run build)
32+
(cd /opt/wrolpi/app && npm install)
3333

3434
chown -R wrolpi:wrolpi /opt/wrolpi
3535

repair.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ git config --global --add safe.directory /opt/wrolpi
3838
git reset HEAD --hard
3939
chown -R wrolpi:wrolpi /opt/wrolpi
4040

41-
# Rebuild the app after reset.
42-
(cd app && npm run build)
43-
4441
# Copy configs to system.
4542
cp /opt/wrolpi/etc/raspberrypios/nginx.conf /etc/nginx/nginx.conf
4643
[ -f /etc/nginx/conf.d/default.conf ] && rm /etc/nginx/conf.d/default.conf

0 commit comments

Comments
 (0)