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 1 commit
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/start-rssbridge"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline. Also wouldn't it be better to rename this script to something like docker-entrypoint.sh, to indicate that it's related to Docker image?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, no problem

22 changes: 22 additions & 0 deletions start-rssbridge
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/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 f in `find /config/ -type f`; do
fname=${f##*/}
case $fname in
*Bridge.php) yes | cp $f /app/bridges/ ;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While bridges' names don't contain spaces, it's better to quote these anyway.

Copy link

@ikajdan ikajdan May 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, wouldn't it be better if these files were soft-linked?

Suggested change
*Bridge.php) yes | cp $f /app/bridges/ ;
*Bridge.php) ln -s "$f" /app/bridges/ ;

chown www-data:www-data /app/bridges/$fname;
printf "Custom Bridge %s added.\n" $fname;;
config.ini.php) yes | cp $f /app/ ;
chown www-data:www-data /app/$fname;
printf "Custom config.ini.php added.\n";;
whitelist.txt) yes | cp $f /app/ ;
chown www-data:www-data /app/$fname;
printf "Custom whitelist.txt added.\n";;
esac
done

# Start apache
apache2-foreground