mirror of
https://git.cloudron.io/cloudron/freshrss-app
synced 2025-09-16 02:09:11 +00:00
Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9ebdd87f37 | ||
|
4b4560e178 | ||
|
45f13f695f | ||
|
7691695423 | ||
|
083b4fd832 | ||
|
fe944c9238 | ||
|
e26b11a102 | ||
|
91367404fe | ||
|
497199febd | ||
|
a5022969c3 | ||
|
1175cc0d8f | ||
|
a3014a0fdb | ||
|
b48681e37c | ||
|
2750b4944d | ||
|
7ea8743446 | ||
|
fc6ca4c877 | ||
|
f5390c5d25 | ||
|
bbddef8d92 |
18
CHANGELOG
18
CHANGELOG
@@ -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)
|
||||
|
@@ -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",
|
||||
|
@@ -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.
|
||||
|
||||
|
15
Dockerfile
15
Dockerfile
@@ -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" ]
|
||||
|
@@ -6,7 +6,7 @@ This repository contains the Cloudron app package source for [FreshRSS](http://w
|
||||
|
||||
[](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
|
||||
|
@@ -1,5 +1,6 @@
|
||||
<VirtualHost *:8000>
|
||||
DocumentRoot /app/code
|
||||
AllowEncodedSlashes On
|
||||
|
||||
ErrorLog /dev/stderr
|
||||
CustomLog /dev/stdout combined
|
||||
|
21
change-ttrss-file-path.patch
Normal file
21
change-ttrss-file-path.patch
Normal 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';
|
14
setup_db.php
14
setup_db.php
@@ -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();
|
||||
|
68
start.sh
68
start.sh
@@ -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
|
||||
|
19
test/test.js
19
test/test.js
@@ -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 () {
|
||||
|
Reference in New Issue
Block a user