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

Compare commits

..

6 Commits

Author SHA1 Message Date
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
5 changed files with 37 additions and 63 deletions

View File

@@ -4,3 +4,13 @@
[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)

View File

@@ -5,12 +5,18 @@
"description": "file://DESCRIPTION.md",
"changelog": "file://CHANGELOG",
"tagline": "RSS feed reader",
"version": "0.2.0",
"version": "0.4.0",
"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

@@ -7,7 +7,7 @@ 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
@@ -24,7 +24,7 @@ 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 -p1 -d /app/code/extensions < /app/code/change-ttrss-file-path.patch \
&& 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
@@ -43,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

@@ -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,20 +7,14 @@ 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
@@ -32,39 +26,18 @@ for f in $(ls /app/code/extensions-orig); do
fi
done
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
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