diff --git a/docker-compose.yml b/docker-compose.yml index 2109efd..02fdf84 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,6 +37,10 @@ services: build: context: ./rss-bridge/ container_name: feedati_rss_bridge + volumes: + - ./rss-bridge:/app/public/ + - ./docker/rssbridge-config.php:/app/public/config.ini.php:ro + - ./docker/rssbridge-whitelist.txt:/app/public/whitelist.txt:ro ports: - 8001:80 environment: @@ -53,5 +57,9 @@ services: - tt-rss - rss-bridge + syslog: + image: jumanjiman/rsyslog:latest + container_name: feedati_syslog + volumes: postgres_data: diff --git a/docker/Dockerfile-tt-rss b/docker/Dockerfile-tt-rss index f0e5d76..dc36570 100644 --- a/docker/Dockerfile-tt-rss +++ b/docker/Dockerfile-tt-rss @@ -12,16 +12,22 @@ RUN mkdir -p /app/public/tt-rss/ /var/cache/tt-rss/images \ # can't get ttys unless you run the container in privileged mode sed -i '/tty/d' /etc/inittab &&\ # can't set hostname since docker sets it - sed -i 's/hostname $opts/# hostname $opts/g' /etc/init.d/hostname &&\ + sed -i '/hostname $opts/d' /etc/init.d/hostname &&\ # can't mount tmpfs since not privileged - sed -i 's/mount -t tmpfs/# mount -t tmpfs/g' /lib/rc/sh/init.sh &&\ + sed -i '/mount -t tmpfs/d' /lib/rc/sh/init.sh &&\ # can't do cgroups -sed -i 's/cgroup_add_service$/# cgroup_add_service /g' /lib/rc/sh/openrc-run.sh + sed -i '/cgroup_add_service$/d' /lib/rc/sh/openrc-run.sh &&\ + sed -i '/^ntpd/d' /bootstrap/start.sh &&\ + echo -e 'log_errors = On\nerror_log = syslog' >> /etc/php7/php.ini &&\ + sed -i -r 's@ErrorLog .*@ErrorLog "| logger -n syslog -T -P 514 -t apacheErr"@i' /etc/apache2/httpd.conf &&\ + echo 'TransferLog "| logger -n syslog -T -P 514 -t apacheLog"' >> /etc/apache2/httpd.conf +RUN apk --no-cache add util-linux COPY tt-rss/* /app/public/tt-rss/ COPY docker/ttrss-openrc-apache /etc/init.d/apache COPY docker/ttrss-openrc-ttrssupdate /etc/init.d/ttrssupdate -RUN rc-update add apache && rc-update add ttrssupdate +COPY docker/ttrss-openrc-ntpd /etc/init.d/ntpd +RUN rc-update add ntpd && rc-update add apache && rc-update add ttrssupdate ENTRYPOINT [] diff --git a/docker/rssbridge-config.php b/docker/rssbridge-config.php new file mode 100644 index 0000000..5909ad8 --- /dev/null +++ b/docker/rssbridge-config.php @@ -0,0 +1,44 @@ +; DO NOT REMOVE THIS LINE + +; This file contains the default settings for RSS-Bridge. Do not change this +; file, it will be replaced on the next update of RSS-Bridge! You can specify +; your own configuration in 'config.ini.php' (copy this file). + +[cache] + +; Allow users to specify custom timeout for specific requests. +; true = enabled +; false = disabled (default) +custom_timeout = false + +[proxy] + +; Sets the proxy url (i.e. "tcp://192.168.0.0:32") +; "" = Proxy disabled (default) +url = "" + +; Sets the proxy name that is shown on the bridge instead of the proxy url. +; "" = Show proxy url +name = "Hidden proxy name" + +; Allow users to disable proxy usage for specific requests. +; true = enabled +; false = disabled (default) +by_bridge = false + +[authentication] + +; Enables authentication for all requests to this RSS-Bridge instance. +; +; Warning: You'll have to upgrade existing feeds after enabling this option! +; +; true = enabled +; false = disabled (default) +enable = false + +; The username for authentication. Insert this name when prompted for login. +username = "" + +; The password for authentication. Insert this password when prompted for login. +; Use a strong password to prevent others from guessing your login! +password = "" diff --git a/docker/rssbridge-whitelist.txt b/docker/rssbridge-whitelist.txt new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/docker/rssbridge-whitelist.txt @@ -0,0 +1 @@ +* diff --git a/docker/ttrss-openrc-apache b/docker/ttrss-openrc-apache index 581db74..49cf5f8 100755 --- a/docker/ttrss-openrc-apache +++ b/docker/ttrss-openrc-apache @@ -1,5 +1,10 @@ #!/sbin/runscript +depend() { + need ntpd +} + + start() { ebegin "Starting Apache (with wrapper)" start-stop-daemon --background --start --exec /bootstrap/start.sh \ @@ -16,3 +21,4 @@ stop() { --pidfile /var/run/apache2/httpd.pid eend $? } +# vim: set ft=sh bkc=yes: diff --git a/docker/ttrss-openrc-ntpd b/docker/ttrss-openrc-ntpd new file mode 100755 index 0000000..8fe8641 --- /dev/null +++ b/docker/ttrss-openrc-ntpd @@ -0,0 +1,12 @@ +#!/sbin/openrc-run + +name="ntpd" +description="update clock" +command="/usr/sbin/ntpd" +command_user="root" +pidfile="/run/$name.pid" +command_args="-s -p $pidfile" +start_stop_daemon_args="" + + +# vim: set ft=sh bkc=yes: diff --git a/docker/ttrss-openrc-ttrssupdate b/docker/ttrss-openrc-ttrssupdate index f4db867..7d3fd1d 100755 --- a/docker/ttrss-openrc-ttrssupdate +++ b/docker/ttrss-openrc-ttrssupdate @@ -6,15 +6,22 @@ command="/usr/bin/php7" command_args="/app/public/tt-rss/update.php --daemon" command_user="apache" pidfile="/run/$name.pid" +command_background=true start_stop_daemon_args="" +depend() { + need ntpd +} + start_pre() { for _ in $(seq 1 60); do - if env PGPASSWORD=password-dev psql -h db -U ttrss -w ttrss; then + if env PGPASSWORD=password-dev psql -h db -U ttrss -w ttrss -c "" -q; then return 0 fi - einfo "Waiting... ( $? )" + einfo "Waiting..." sleep 1 done + einfo "Timeout! postgresql wasn't ready in 60 seconds; aborting ${name} start ($description)" return 1 } +# vim: set ft=sh bkc=yes: diff --git a/dodo.py b/dodo.py index f26d7fd..5496146 100644 --- a/dodo.py +++ b/dodo.py @@ -16,7 +16,9 @@ def task_build(): 'uptodate': [up2date_anyimages], 'file_dep': ['docker-compose.yml', 'docker/Dockerfile-tt-rss', 'docker/ttrss-openrc-apache', - 'docker/ttrss-openrc-ttrssupdate'], + 'docker/ttrss-openrc-ttrssupdate', + 'rss-bridge/Dockerfile' + ], 'actions': [COMPOSE + ' build'], 'clean': [run_task_func(task__build_rm), run_task_func(task__build_rmi)],