-
-
Notifications
You must be signed in to change notification settings - Fork 475
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
33 lines (24 loc) 路 1.28 KB
/
Copy pathdocker-entrypoint.sh
File metadata and controls
33 lines (24 loc) 路 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
set -e
# reset previously modified UrlHelper.php, in case ALLOW_PORTS is updated
git checkout -- /var/www/classes/UrlHelper.php
if [ "$ALLOW_PORTS" != "80,443" ]; then
# open ports in the env
ALLOW_PORTS="80, 443, $ALLOW_PORTS, ''"
sed -i -r "s/(80, 443).*?('')/$ALLOW_PORTS/" /var/www/classes/UrlHelper.php
# make custom ports be treated as standard ports (allows private IPs on these ports)
sed -i -r "s/\\\$is_standard_port = .*;/\\\$is_standard_port = in_array(\\\$port, [$ALLOW_PORTS]);/" /var/www/classes/UrlHelper.php
# modify BL to include ports
# no longer needed after Nov 7,2025 https://github.com/tt-rss/tt-rss/pull/122
# CODE="if (isset(\$parts['port'])) \$tmp .= ':' . \$parts['port']; \n"
# sed -i "/if (isset(\$parts\['path'\]))/i $CODE" /var/www/classes/UrlHelper.php
fi
if [ "$FEED_LOG_QUIET" != "true" ]; then
sed -i -r "s/--quiet/ /" /etc/s6/update-daemon/run
else
sed -i -r "s/\.php/.php --quiet/" /etc/s6/update-daemon/run
fi
if [ -n "$DB_USER_FILE" ]; then DB_USER="$(cat $DB_USER_FILE)"; fi
if [ -n "$DB_PASS_FILE" ]; then DB_PASS="$(cat $DB_PASS_FILE)"; fi
sh /wait-for.sh $DB_HOST:$DB_PORT -- php /initialize.php && s6-setuidgid nobody php /var/www/update.php --update-schema=force-yes && exec s6-svscan /etc/s6/
exec "$@"