1
0
mirror of https://git.cloudron.io/cloudron/freshrss-app synced 2025-09-16 02:09:11 +00:00

Compare commits

..

18 Commits

Author SHA1 Message Date
Dennis Schwerdel
9ebdd87f37 Version 0.4.1 2017-05-24 20:29:08 +02:00
Dennis Schwerdel
4b4560e178 Added --wait for reconfigure in test 2017-05-24 20:28:54 +02:00
dswd
45f13f695f Merge branch 'test_api_config' into 'master'
Add test for api configuration

See merge request !4
2017-05-24 18:25:13 +00:00
Girish Ramakrishnan
7691695423 Add test for api configuration
https://github.com/FreshRSS/FreshRSS/issues/443#issuecomment-36666133
2017-05-24 11:19:30 -07:00
dswd
083b4fd832 Merge branch 'master' into 'master'
Update description

See merge request !3
2017-05-24 18:13:35 +00:00
dswd
fe944c9238 Merge branch 'FixApacheConf' into 'master'
Add parameter to allow for encoded slashes

See merge request !2
2017-05-24 18:11:31 +00:00
Girish Ramakrishnan
e26b11a102 Update description 2017-05-12 10:40:17 -07:00
Richard
91367404fe Add parameter to allow for 2%F in URLs 2017-04-27 10:14:07 +00:00
Dennis Schwerdel
497199febd Updated to 1.6.3, removed custom patches 2017-03-12 10:45:14 +01:00
Dennis Schwerdel
a5022969c3 Bumped version, fixed db-prefix 2017-02-23 18:07:50 +01:00
Dennis Schwerdel
1175cc0d8f Removed update menu item 2017-02-23 15:54:34 +01:00
Dennis Schwerdel
a3014a0fdb Using cli scripts & allowing config changes 2017-02-23 15:25:53 +01:00
dswd
b48681e37c Merge branch 'master' into 'master'
Use scheduler addon to update feeds

Closes #6

See merge request !1
2017-02-23 13:02:42 +00:00
Girish Ramakrishnan
2750b4944d Use scheduler addon to update feeds
Fixes #6
2017-02-22 15:24:47 -08:00
Dennis Schwerdel
7ea8743446 v0.2.0 2017-02-18 14:27:46 +01:00
Dennis Schwerdel
fc6ca4c877 Made TTRSS-API extension work 2017-02-18 14:26:35 +01:00
Dennis Schwerdel
f5390c5d25 Changed cloudron cli url 2017-02-18 13:00:48 +01:00
Dennis Schwerdel
bbddef8d92 New base image, extensions 2017-02-18 11:51:44 +01:00
10 changed files with 105 additions and 67 deletions

View File

@@ -1,2 +1,20 @@
[0.1.0]
* Initial version
[0.2.0]
* Updated to base image 0.10.0
* Supporting extensions
[0.3.0]
* No longer overwriting all config changes
* Using cli scripts
* Using scheduler for periodic task
* Removed update menu item
[0.4.0]
* Updated to FreshRSS 1.6.3
* Removed most custom patches (FreshRSS includes those now)
[0.4.1]
* Add parameter to allow for encoded slashes (thanks @Richard)
* Updated description (thanks @Girish)

View File

@@ -5,12 +5,18 @@
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG",
"tagline": "RSS feed reader",
"version": "0.1.0",
"version": "0.4.1",
"healthCheckPath": "/",
"httpPort": 8000,
"addons": {
"localstorage": {},
"mysql": {}
"mysql": {},
"scheduler": {
"update_feeds": {
"schedule": "*/1 * * * *",
"command": "/usr/local/bin/gosu www-data:www-data php /app/code/app/actualize_script.php"
}
}
},
"manifestVersion": 1,
"website": "http://www.freshrss.org",

View File

@@ -1,4 +1,4 @@
This app packages FreshRSS 1.6.2.
This app packages FreshRSS 1.6.3.
FreshRSS is a self-hosted RSS feed aggregator such as Leed or Kriss Feed.

View File

@@ -1,4 +1,4 @@
FROM cloudron/base:0.9.0
FROM cloudron/base:0.10.0
MAINTAINER Rainloop Developers <support@cloudron.io>
EXPOSE 8000
@@ -7,7 +7,8 @@ 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
ENV VERSION 1.6.3
ENV EXTENSIONS_VERSION eac4b749775c3e1b584c1a6b4a4487e4a4b8b159
RUN mkdir -p /app/code
WORKDIR /app/code
@@ -19,6 +20,15 @@ RUN mkdir -p /app/data \
&& mv data data-orig \
&& ln -s /app/data data
ADD change-ttrss-file-path.patch /app/code/change-ttrss-file-path.patch
RUN wget https://github.com/FreshRSS/Extensions/archive/${EXTENSIONS_VERSION}.tar.gz -O - \
| tar -xz --strip-components=1 -C /app/code/extensions \
&& patch -p0 -d /app/code < /app/code/change-ttrss-file-path.patch \
&& mv /app/code/extensions /app/code/extensions-orig \
&& ln -s /app/data/extensions /app/code/extensions \
&& ln -s /app/data/extensions/ttrss.php /app/code/p/api/ttrss.php
ADD apache2.conf /etc/apache2/sites-available/freshrss.conf
RUN rm /etc/apache2/sites-enabled/* \
@@ -33,6 +43,5 @@ RUN rm -rf /var/lib/php \
&& ln -s /run/php /var/lib/php
ADD start.sh /app/code/start.sh
ADD setup_db.php /app/code/setup_db.php
CMD [ "/app/code/start.sh" ]

View File

@@ -6,7 +6,7 @@ This repository contains the Cloudron app package source for [FreshRSS](http://w
[![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)
or using the [Cloudron command line tooling](https://git.cloudron.io/cloudron/cloudron-cli/)
```
cloudron install --appstore-id org.freshrss.cloudronapp
@@ -14,7 +14,7 @@ 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).
The app package can be built using the [Cloudron command line tooling](https://git.cloudron.io/cloudron/cloudron-cli/).
```
cd freshrss-app

View File

@@ -1,5 +1,6 @@
<VirtualHost *:8000>
DocumentRoot /app/code
AllowEncodedSlashes On
ErrorLog /dev/stderr
CustomLog /dev/stdout combined

View File

@@ -0,0 +1,21 @@
diff -ru extensions-orig/xExtension-TTRSS_API/extension.php extensions/xExtension-TTRSS_API/extension.php
--- extensions-orig/xExtension-TTRSS_API/extension.php 2016-12-15 10:24:17.000000000 +0000
+++ extensions/xExtension-TTRSS_API/extension.php 2017-02-18 13:06:59.640761922 +0000
@@ -9,7 +9,7 @@
public function install() {
$filename = 'ttrss.php';
$file_source = join_path($this->getPath(), $filename);
- $path_destination = join_path(PUBLIC_PATH, 'api');
+ $path_destination = '/app/data/extensions';
$file_destination = join_path($path_destination, $filename);
if (!is_writable($path_destination)) {
@@ -35,7 +35,7 @@
public function uninstall() {
$filename = 'ttrss.php';
- $file_destination = join_path(PUBLIC_PATH, 'api', $filename);
+ $file_destination = join_path('/app/data/extensions', $filename);
if (file_exists($file_destination) && !unlink($file_destination)) {
return 'API file cannot be removed';

View File

@@ -1,14 +0,0 @@
<?PHP
include_once('/app/code/app/SQL/install.sql.mysql.php');
$c = new PDO("mysql:dbname=".getenv('MYSQL_DATABASE').";host=".getenv('MYSQL_HOST').";port=".getenv('MYSQL_PORT'), getenv('MYSQL_USERNAME'), getenv('MYSQL_PASSWORD'));
$sql = sprintf(SQL_CREATE_TABLES, 'admin_', 'Uncategorized');
$stm = $c->prepare($sql);
$stm->execute();
$sql = sprintf(SQL_INSERT_FEEDS, 'admin_');
$stm = $c->prepare($sql);
$stm->execute();

View File

@@ -7,57 +7,37 @@ mkdir -p /run/php/sessions
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 <<EOF
<?php
return array (
'language' => '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
php cli/do-install.php \
--environment production --default_user admin \
--db-type mysql --db-host "${MYSQL_HOST}:${MYSQL_PORT}" \
--db-user "${MYSQL_USERNAME}" --db-password "${MYSQL_PASSWORD}" \
--db-base "${MYSQL_DATABASE}" --db-prefix "" \
--disable_update
php cli/create-user.php --user admin --password password --language en
php cli/actualize-user.php --user admin
touch /app/data/.installed
echo "Done."
fi
echo "Creating config file"
SALT=$(cat /app/data/.salt)
cat > /app/data/config.php <<EOF
<?php
return array (
'salt' => '${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
mkdir -p /app/data/extensions
for f in $(ls /app/code/extensions-orig); do
if ! [ -e "/app/data/extensions/$f" ]; then
ln -s "/app/code/extensions-orig/$f" "/app/data/extensions/$f"
fi
done
echo "Updating config file"
php cli/reconfigure.php --default_user admin --base_url "https://${APP_DOMAIN}/p" \
--db-type mysql --db-host "${MYSQL_HOST}:${MYSQL_PORT}" \
--db-user "${MYSQL_USERNAME}" --db-password "${MYSQL_PASSWORD}" \
--db-base "${MYSQL_DATABASE}" --db-prefix "" \
--disable_update
echo "Setting permissions"
chown -R www-data.www-data /run/php /app/data
echo "Trying to update feeds every 60 secs"
while true; do
sleep 60
sudo -u www-data php /app/code/app/actualize_script.php >/dev/stdout 2>/dev/stderr
done &
echo "Starting apache"
APACHE_CONFDIR="" source /etc/apache2/envvars

View File

@@ -118,6 +118,19 @@ describe('Application life cycle test', function () {
});
}
function enableApi(callback) {
browser.get('https://' + app.fqdn + '/p/i/?c=auth').then(function () {
return browser.findElement(by.id('api_enabled')).click();
}).then(function () {
return browser.findElement(by.xpath('//form[@action=".?c=auth"]')).submit();
}).then(callback);
}
function checkApiConfiguration(callback) {
browser.get('https://' + app.fqdn + '/p/api/greader.php/check%2Fcompatibility').then(function () {
exists(by.xpath('//pre[text()="PASS"]'), callback);
});
}
xit('build app', function () {
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
@@ -138,6 +151,8 @@ describe('Application life cycle test', function () {
it('can login', login);
it('can subscribe', addSubscription);
it('can add users', addUser);
it('can enable API', enableApi);
it('can check configuration', checkApiConfiguration);
it('can logout', logout);
it('backup app', function () {
@@ -149,17 +164,19 @@ describe('Application life cycle test', function () {
});
it('can login', login);
it('can check configuration', checkApiConfiguration);
it('can logout', logout);
it('move to different location', function () {
browser.manage().deleteAllCookies();
execSync('cloudron configure --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
execSync('cloudron configure --wait --location ' + LOCATION + '2', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
var inspect = JSON.parse(execSync('cloudron inspect'));
app = inspect.apps.filter(function (a) { return a.location === LOCATION + '2'; })[0];
expect(app).to.be.an('object');
});
it('can login', login);
it('can check configuration', checkApiConfiguration);
it('can logout', logout);
it('uninstall app', function () {