Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Config] Add custom config location #2097

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& sed -ri -e 's/(MinProtocol\s*=\s*)TLSv1\.2/\1None/' /etc/ssl/openssl.cnf \
&& sed -ri -e 's/(CipherString\s*=\s*DEFAULT)@SECLEVEL=2/\1/' /etc/ssl/openssl.cnf

COPY --chown=www-data:www-data ./ /app/
COPY --chown=www-data:www-data ./ /app/

CMD ["/app/docker-entrypoint.sh"]
27 changes: 27 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

# Find custom files in the /config folder and copy them to the respective folders in /app.
# Look for bridges that end in 'Bridge.php' and for the whitelist and config.ini files. Everything else is ignored
# This will overwrite previous configs and bridges. It also uses the default paths of the configs and bridges, so if there is no file that matches, rss-bridge works like default.

for file in `find /config/ -type f`; do
file_name="$(basename "$file")" # Strip leading path
if [[ $file_name= *" "* ]]; then
printf 'Custom Bridge %s has a space in the name and will be skipped.\n' "$file_name"
break
fi
case "$file_name" in
*Bridge.php) yes | cp "$file" /app/bridges/ ;
chown www-data:www-data "/app/bridges/$file_name";
printf "Custom Bridge %s added.\n" $file_name;;
config.ini.php) yes | cp "$file" /app/ ;
chown www-data:www-data "/app/$file_name";
printf "Custom config.ini.php added.\n";;
whitelist.txt) yes | cp "$file" /app/ ;
chown www-data:www-data "/app/$file_name";
printf "Custom whitelist.txt added.\n";;
esac
done

# Start apache
apache2-foreground