From 968819a855ab27ea28684d0e54cde8155745607a Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Sat, 21 Feb 2015 15:48:03 +0100 Subject: [PATCH 1/3] Set SELF_URL_PATH on runtime --- Dockerfile | 4 +++- README.md | 9 +++++++++ configure-db.php | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 49fed7a..4ef2819 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,12 +17,14 @@ RUN rm /etc/nginx/sites-enabled/default RUN git clone https://github.com/gothfox/Tiny-Tiny-RSS.git /var/www WORKDIR /var/www RUN cp config.php-dist config.php -RUN sed -i -e "/'SELF_URL_PATH'/s/ '.*'/ 'http:\/\/localhost\/'/" config.php RUN chown www-data:www-data -R /var/www # expose only nginx HTTP port EXPOSE 80 +# complete path to ttrss +ENV SELF_URL_PATH http://localhost + # expose default database credentials via ENV in order to ease overwriting ENV DB_NAME ttrss ENV DB_USER ttrss diff --git a/README.md b/README.md index afbde3a..ead7efa 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,15 @@ following additional arguments: -e DB_ENV_PASS=docker ``` +### SELF_URL_PATH + +The `SELF_URL_PATH` config value can be set on runtime. This will enable PUSH +and make the browser integration work. Default value: `http://localhost`. + +``` +-e SELF_URL_PATH=https://example.org/ttrss +``` + ### Testing ttrss in foreground For testing purposes it's recommended to initially start this container in foreground. diff --git a/configure-db.php b/configure-db.php index 6025e30..8f9b1e3 100644 --- a/configure-db.php +++ b/configure-db.php @@ -5,6 +5,9 @@ $confpath = '/var/www/config.php'; $config = array(); +// path to ttrss +$config['SELF_URL_PATH'] = env('SELF_URL_PATH', 'http://localhost'); + if (getenv('DB_TYPE') !== false) { $config['DB_TYPE'] = getenv('DB_TYPE'); } elseif (getenv('DB_PORT_5432_TCP_ADDR') !== false) { From 42309345a3dbe41077395c4fe7886fdec38cc0c2 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Fri, 24 Apr 2015 13:08:58 +0200 Subject: [PATCH 2/3] Remove trailing whitespace --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ead7efa..11d671d 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ If you've already followed the [quickstart](#quickstart) guide and everything wo This container requires a PostgreSQL or MySQL database instance. Following docker's best practices, this container does not contain its own database, -but instead expects you to supply a running instance. +but instead expects you to supply a running instance. While slightly more complicated at first, this gives your more freedom as to which database instance and configuration you're relying on. Also, this makes this container quite disposable, as it doesn't store any sensitive From 08dae5e81f3cf7c15ce478b53c99293ec0a25ad1 Mon Sep 17 00:00:00 2001 From: Philipp Schmitt Date: Fri, 24 Apr 2015 13:25:42 +0200 Subject: [PATCH 3/3] Update SELF_URL_PATH documentation to better reflect the menaning of the variable (#15) --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11d671d..a884f7c 100644 --- a/README.md +++ b/README.md @@ -154,8 +154,11 @@ following additional arguments: ### SELF_URL_PATH -The `SELF_URL_PATH` config value can be set on runtime. This will enable PUSH -and make the browser integration work. Default value: `http://localhost`. +The `SELF_URL_PATH` config value should be set to the URL where this TinyTinyRSS +will be accessible at. Setting it correctly will enable PUSH support and make +the browser integration work. Default value: `http://localhost`. + +For more information check out the [official documentation](https://github.com/gothfox/Tiny-Tiny-RSS/blob/master/config.php-dist#L22). ``` -e SELF_URL_PATH=https://example.org/ttrss