commit 0b95d20d1e85fd7e62bf9d8d19554c0e458b119a Author: Dennis Schwerdel Date: Fri Feb 17 09:45:48 2017 +0100 Initial commit diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5ce517b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +.git +.gitignore +.dockerignore +node_modules +screenshots +test + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..562d512 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test/node_modules/ diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..0b6ac06 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,2 @@ +[0.1.0] +* Initial version diff --git a/CloudronManifest.json b/CloudronManifest.json new file mode 100644 index 0000000..2588b5e --- /dev/null +++ b/CloudronManifest.json @@ -0,0 +1,25 @@ +{ + "id": "org.freshrss.cloudronapp", + "title": "FreshRSS", + "author": "FreshRSS Developers", + "description": "file://DESCRIPTION.md", + "changelog": "file://CHANGELOG", + "tagline": "RSS reader", + "version": "0.1.0", + "healthCheckPath": "/", + "httpPort": 8000, + "addons": { + "localstorage": {}, + "mysql": {} + }, + "manifestVersion": 1, + "website": "http://www.freshrss.org", + "contactEmail": "support@cloudron.io", + "icon": "logo.png", + "tags": [ + "rss" + ], + "mediaLinks": [ + ], + "postInstallMessage": "file://POSTINSTALL.md" +} diff --git a/DESCRIPTION.md b/DESCRIPTION.md new file mode 100644 index 0000000..14d397b --- /dev/null +++ b/DESCRIPTION.md @@ -0,0 +1,21 @@ +This app packages FreshRSS 1.6.2. + +FreshRSS is a self-hosted RSS feed aggregator such as Leed or Kriss Feed. + +It is at the same time lightweight, easy to work with, powerful and customizable. + +It is a multi-user application with an anonymous reading mode. It supports PubSubHubbub for instant notifications from compatible Web sites. There is an API for (mobile) clients, and a Command-Line Interface. Finally, it supports extensions for further tuning. + +### Extensions +FreshRSS supports further customizations by adding extensions on top of its core functionality. +See the [repository dedicated to those extensions](https://github.com/FreshRSS/Extensions). + + +### Compatible clients +Any client supporting a Google Reader-like API. Selection: + +* Android + * [News+](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus) with [News+ Google Reader extension](https://play.google.com/store/apps/details?id=com.noinnion.android.newsplus.extension.google_reader) (Closed source) + * [EasyRSS](https://github.com/Alkarex/EasyRSS) (Open source, F-Droid) +* Linux + * [FeedReader 2.0+](https://jangernert.github.io/FeedReader/) (Open source) diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0d16371 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM cloudron/base:0.9.0 +MAINTAINER Rainloop Developers + +EXPOSE 8000 + +RUN apt-get update \ + && apt-get -y install php php-curl php-gmp php-intl php-mbstring php-xml php-zip \ + libapache2-mod-php mysql-client php-mysql + +ENV VERSION 1.6.2 + +RUN mkdir -p /app/code +WORKDIR /app/code + +RUN wget "https://github.com/FreshRSS/FreshRSS/archive/${VERSION}.tar.gz" -O - \ + | tar -xz --strip-components=1 + +RUN mkdir -p /app/data \ + && mv data data-orig \ + && ln -s /app/data data + +ADD apache2.conf /etc/apache2/sites-available/freshrss.conf + +RUN rm /etc/apache2/sites-enabled/* \ + && sed -e 's,^ErrorLog.*,ErrorLog "/dev/stderr",' -i /etc/apache2/apache2.conf \ + && sed -e "s,MaxSpareServers[^:].*,MaxSpareServers 5," -i /etc/apache2/mods-available/mpm_prefork.conf \ + && a2disconf other-vhosts-access-log \ + && echo "Listen 8000" > /etc/apache2/ports.conf \ + && a2enmod headers expires \ + && a2ensite freshrss + +ADD start.sh /app/code/start.sh +ADD setup_db.php /app/code/setup_db.php + +CMD [ "/app/code/start.sh" ] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..1a9d816 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License (MIT) +Copyright (c) 2016 Cloudron UG + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/POSTINSTALL.md b/POSTINSTALL.md new file mode 100644 index 0000000..cac98ce --- /dev/null +++ b/POSTINSTALL.md @@ -0,0 +1,10 @@ +This application does not integrate with Cloudron authentication. + +There is a preconfigured administrator account with the following credentials: + +* Username: `admin` +* Password: `password` + +(Please change that password on first login) + +You can create more accounts withing the app when logged in as administrator. diff --git a/README.md b/README.md new file mode 100644 index 0000000..bb1fb1e --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# FreshRSS Cloudron App + +This repository contains the Cloudron app package source for [FreshRSS](http://www.freshrss.org/). + +## Installation + +[![Install](https://cloudron.io/img/button.svg)](https://cloudron.io/button.html?app=org.freshrss.cloudronapp) + +or using the [Cloudron command line tooling](https://cloudron.io/references/cli.html) + +``` +cloudron install --appstore-id org.freshrss.cloudronapp +``` + +## Building + +The app package can be built using the [Cloudron command line tooling](https://cloudron.io/references/cli.html). + +``` +cd freshrss-app + +cloudron build +cloudron install +``` + +## Testing + +The e2e tests are located in the `test/` folder and require [nodejs](http://nodejs.org/). They are creating a fresh build, install the app on your Cloudron, perform tests, backup, restore and test if the repos are still ok. The tests expect port 29418 to be available. + +``` +cd freshrss-app/test + +npm install +USERNAME= PASSWORD= mocha --bail test.js +``` + diff --git a/apache2.conf b/apache2.conf new file mode 100644 index 0000000..4f16d68 --- /dev/null +++ b/apache2.conf @@ -0,0 +1,17 @@ + + DocumentRoot /app/code + + ErrorLog /dev/stderr + CustomLog /dev/stdout combined + + + Options +FollowSymLinks + AllowOverride All + Require all granted + + + php_value memory_limit 64m + + + + diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..e44b406 Binary files /dev/null and b/logo.png differ diff --git a/screenshots/1.png b/screenshots/1.png new file mode 100644 index 0000000..2bcd6e6 Binary files /dev/null and b/screenshots/1.png differ diff --git a/setup_db.php b/setup_db.php new file mode 100644 index 0000000..2171520 --- /dev/null +++ b/setup_db.php @@ -0,0 +1,14 @@ +prepare($sql); +$stm->execute(); + +$sql = sprintf(SQL_INSERT_FEEDS, 'admin_'); +$stm = $c->prepare($sql); +$stm->execute(); + diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..e3cbb1c --- /dev/null +++ b/start.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +set -eu + +if ! [ -f /app/data/.installed ]; then + echo "Fresh installation, setting up..." + rsync -a /app/code/data-orig/ /app/data/ + dd if=/dev/urandom bs=1 count=1024 2>/dev/null | sha1sum | awk '{ print $1 }' > /app/data/.salt + mkdir -p /app/data/users/admin + cat > /app/data/users/admin/config.php < 'en', + 'passwordHash' => '\$2a\$09\$lO5xTAsfRCG1rSssJgHtTeiweXj2VwGN/JfuexIMpsQWzKoFVoklm', + 'apiPasswordHash' => '', +); +?> +EOF + touch /app/data/users/admin/log.txt + rm /app/data/do-install.txt + php /app/code/setup_db.php + touch /app/data/.installed + echo "Done." +fi + +echo "Creating config file" +SALT=$(cat /app/data/.salt) +cat > /app/data/config.php < '${SALT}', + 'base_url' => 'https://${APP_DOMAIN}/p', + 'title' => 'FreshRSS', + 'default_user' => 'admin', + 'auth_type' => 'form', + 'db' => + array ( + 'type' => 'mysql', + 'host' => '${MYSQL_HOST}', + 'user' => '${MYSQL_USERNAME}', + 'password' => '${MYSQL_PASSWORD}', + 'base' => '${MYSQL_DATABASE}', + 'prefix' => '', + 'pdo_options' => + array ( + ), + ), + 'pubsubhubbub_enabled' => true, +); +EOF + +chown -R www-data.www-data /app/data + +echo "Trying to update feeds every 60 secs" +while true; do + sleep 60 + curl 'http://localhost:8000/p/i/?c=feed&a=actualize' >/dev/stdout 2>/dev/stderr +done & + +echo "Starting apache" +APACHE_CONFDIR="" source /etc/apache2/envvars +rm -f "${APACHE_PID_FILE}" +exec /usr/sbin/apache2 -DFOREGROUND