Initial immport

This commit is contained in:
Daniel Berteaud 2012-04-24 10:25:01 +02:00
commit a7dc6d0251
28 changed files with 533 additions and 0 deletions

23
createlinks Normal file
View File

@ -0,0 +1,23 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
# Templates to expand
templates2events("/etc/e-smith/sql/init/tt-rss", qw(bootstrap-console-save webapps-update));
templates2events("/usr/share/tt-rss/config.php", qw(bootstrap-console-save webapps-update));
templates2events("/etc/cron.d/tt-rss", qw(bootstrap-console-save webapps-update));
# tt-rss daemon
safe_symlink("restart", "root/etc/e-smith/events/webapps-update/services2adjust/tt-rss");
safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/tt-rss');
safe_symlink("/var/service/tt-rss" , 'root/service/tt-rss');
safe_touch("root/var/service/tt-rss/down");
service_link_enhanced("tt-rss", "S98", "7");
service_link_enhanced("tt-rss", "K10", "6");
service_link_enhanced("tt-rss", "K10", "0");
# PHP header and footer
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/usr/share/tt-rss/config.php/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/usr/share/tt-rss/config.php/template-end");

View File

@ -0,0 +1 @@
http

View File

@ -0,0 +1 @@
rssdb

View File

@ -0,0 +1 @@
rssuser

View File

@ -0,0 +1 @@
enabled

View File

@ -0,0 +1 @@
private

View File

@ -0,0 +1 @@
enabled

View File

@ -0,0 +1 @@
service

View File

@ -0,0 +1,12 @@
{
my $rec = $DB->get('tt-rss') || $DB->new_record('tt-rss', { type => 'webapp' });
my $pw = $rec->prop('DbPassword');
if (not $pw){
$pw = `/usr/bin/openssl rand -base64 60 | tr -c -d '[:graph:]'`;
chomp($pw);
$rec->set_prop('DbPassword', $pw);
}
}

View File

@ -0,0 +1,3 @@
UID="root"
GID="root"
PERMS=0755

View File

@ -0,0 +1,3 @@
UID="root"
GID="apache"
PERMS=0640

View File

@ -0,0 +1 @@
# Cron job disabled, SME Server uses the daemon to update the feeds

View File

@ -0,0 +1,48 @@
{
my $db = ${'tt-rss'}{'DbName'} || 'rssdb';
my $user = ${'tt-rss'}{'DbUser'} || 'rssuser';
my $pass = ${'tt-rss'}{'DbPassword'} || 'secret';
my $schema = `rpm -ql tt-rss | grep ttrss_schema_mysql.sql`;
$OUT .= <<"END";
#! /bin/sh
if [ \! -d /var/lib/mysql/$db ]; then
/usr/bin/mysqladmin create $db
/usr/bin/mysql $db < $schema
fi
/usr/bin/mysql <<EOF
USE mysql;
REPLACE INTO user (
host,
user,
password)
VALUES (
'localhost',
'$user',
PASSWORD ('$pass'));
REPLACE INTO db (
host,
db,
user,
select_priv, insert_priv, update_priv, delete_priv,
create_priv, alter_priv, index_priv, drop_priv, create_tmp_table_priv,
grant_priv, lock_tables_priv, references_priv)
VALUES (
'localhost',
'$db',
'$user',
'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y',
'N', 'Y', 'Y');
FLUSH PRIVILEGES;
EOF
END
}

View File

@ -0,0 +1,36 @@
{
if ((${'tt-rss'}{'status'} || 'enabled') eq 'enabled'){
my $alias = ((${'tt-rss'}{'AliasOnPrimary'} || 'enabled') eq 'enabled' ) ? 'Alias /tt-rss /usr/share/tt-rss':'';
my $allow = ((${'tt-rss'}{'access'} || 'private') eq 'public') ? 'all':"$localAccess $externalSSLAccess";
my $auth = ((${'tt-rss'}{'Authentication'} || 'http') eq 'http') ? "AuthName \"Tiny Tiny RSS\"\n" .
" AuthType Basic\n" .
" AuthExternal pwauth\n" .
" Require valid-user\n" : '';
$OUT .=<<"HERE";
$alias
<Directory /usr/share/tt-rss>
AddType application/x-httpd-php .php
php_admin_value open_basedir /usr/share/tt-rss:/var/lock/tt-rss:/var/cache/tt-rss:/tmp
php_admin_value memory_limit 80M
php_admin_flag allow_url_fopen on
SSLRequireSSL on
Order deny,allow
Deny from all
Allow from $allow
$auth
</Directory>
<Directory /usr/share/tt-rss/schema>
deny from all
</Directory>
HERE
}
else{
$OUT .= " # TT-RSS is disabled\n";
}
}

View File

@ -0,0 +1,14 @@
{
my $sslport = $modSSL{'TCPPort'} || '443';
my $status = ${'tt-rss'}{'status'} || 'enabled';
my $alias = ${'tt-rss'}{'AliasOnPrimary'} || 'enabled';
if (($port ne $sslport) && ($status eq 'enabled') && ($alias eq 'enabled')){
## Redirect Web Address to Secure Address
$OUT .= " RewriteEngine on\n";
$OUT .= " RewriteRule ^/tt-rss(/.*|\$) https://%{HTTP_HOST}/tt-rss\$1 \[L,R\]\n";
}
}

View File

@ -0,0 +1,22 @@
{
my $db = ${'tt-rss'}{'DbName'} || 'rssdb';
my $user = ${'tt-rss'}{'DbUser'} || 'rssuser';
my $pass = ${'tt-rss'}{'DbPassword'} || 'secret';
my $port = $mysqld{'TCPPort'} || '3306';
$OUT .=<<"HERE";
define('DB_TYPE', "mysql"); // or mysql
define('DB_HOST', "localhost");
define('DB_PORT', "$port");
define('DB_USER', "$user");
define('DB_NAME', "$db");
define('DB_PASS', "$pass");
HERE
}
define('MYSQL_CHARSET', 'UTF8');
// Connection charset for MySQL.

View File

@ -0,0 +1,47 @@
define('SELF_URL_PATH', '');
// Full URL of your tt-rss installation. This should be set to the
// location of tt-rss directory, e.g. http://yourserver/tt-rss/
// You need to set this option correctly otherwise several features
// including PUSH, bookmarklets and browser integration will not work properly.
define('MAGPIE_FETCH_TIME_OUT', 60);
// Magpie's default timeout is 5 seconds. Some RSS feeds,
// such as from large Trac installs, can take significantly
// longer than 5 seconds to generate. To prevent failed
// updates, increase this.
define('CACHE_DIR', '/var/cache/tt-rss/');
// Local cache directory for RSS feed content.
define('MAGPIE_CACHE_DIR', '/var/cache/tt-rss/magpie');
// Local cache directory for RSS feeds
define('MAGPIE_CACHE_AGE', 60*30);
// How long to store cached RSS objects? In seconds.
// Defaults to 30 minutes
define('ICONS_DIR', "rssicons");
define('ICONS_URL', "rssicons");
// Local and URL path to the directory, where feed favicons are stored.
// Unless you really know what you're doing, please keep those relative
// to tt-rss main directory.
define('TMP_DIRECTORY', '/tmp');
// Directory for temporary files
define('SIMPLEPIE_CACHE_DIR', '/var/cache/tt-rss/simplepie');
// Cache directory for RSS feeds when using SimplePie
define('SIMPLEPIE_CACHE_IMAGES', true);
// Allow caching feed images when using SimplePie, to bypass hotlink
// prevention and such at expense of local disk space and bandwidth.
// Note that you (or your users) also have to enable image caching
// in feed editor.
define('PHP_EXECUTABLE', '/usr/bin/php');
// Path to PHP executable
define('LOCK_DIRECTORY', '/var/lock/tt-rss');
// Directory for lockfiles, must be writable to the user you run
// daemon process or cronjobs under

View File

@ -0,0 +1,51 @@
{
my $auth = ${'tt-rss'}{'Authentication'} || 'http';
my $remote = ($auth eq 'internal') ? 'false':'true';
my $multi = ((${'tt-rss'}{'MultiUser'} || 'enabled') eq 'enabled') ? 'false':'true';
$OUT .=<<"HERE";
define('SINGLE_USER_MODE',$multi);
// Operate in single user mode, disables all functionality related to
// multiple users.
define('ALLOW_REMOTE_USER_AUTH',$remote);
// Set to 'true' if you trust your web server's REMOTE_USER
// environment variable to validate that the user is logged in. This
// option can be used to integrate tt-rss with Apache's external
// authentication modules.
HERE
}
define('AUTO_CREATE_USER',true);
// If users are authenticated by your web server, set this to true if
// You want new users to be automaticaly created in tt-rss database
// on first login
define('AUTO_LOGIN',true);
// Set this to true if you use ALLOW_REMOTE_USER_AUTH and you want
// to skip the login form. If set to true, users won't be able to select
// profile
define('DATABASE_BACKED_SESSIONS', false);
// Store session information in a database, recommended for multiuser
// configurations. Doesn't seem to work for everyone, so enable with caution.
// tt-rss uses default PHP session storing mechanism if disabled.
define('SESSION_CHECK_ADDRESS', 1);
// Check client IP address when validating session:
// 0 - disable checking
// 1 - check first 3 octets of an address (recommended)
// 2 - check first 2 octets of an address
// 3 - check entire address
define('SESSION_COOKIE_LIFETIME', 0);
// Default lifetime of a session (e.g. login) cookie. In seconds,
// 0 means cookie will be deleted when browser closes.
define('SESSION_EXPIRE_TIME', 86400);
// Hard expiration limit for sessions. Should be
// greater or equal to SESSION_COOKIE_LIFETIME

View File

@ -0,0 +1,34 @@
define('ENABLE_UPDATE_DAEMON', true);
// This enables different mechanism for user-triggered updates designed
// for update daemon running in background on the server.
// This option suggests FEEDS_FRAME_REFRESH set to a small value
// (like 60 seconds, depending on number of users and server/bandwidth load).
define('DAEMON_SLEEP_INTERVAL', 60);
// Interval between update daemon update runs
define('DAEMON_UPDATE_LOGIN_LIMIT', 0);
// Stop updating feeds of user who haven't logged in specified
// amount of days. 0 disables.
define('DEFAULT_UPDATE_METHOD', 0);
// Which feed parsing library to use as default:
// 0 - Magpie
// 1 - SimplePie
define('DAEMON_FEED_LIMIT', 60);
// Limits the amount of feeds daemon (or a cronjob) updates on one run
define('FORCE_ARTICLE_PURGE', 0);
// When this option is not 0, users ability to control feed purging
// intervals is disabled and all articles (which are not starred)
// older than this amount of days are purged.
define('COUNTERS_MAX_AGE', 365);
// Hard limit for unread counters calculation. Try tweaking this
// parameter to speed up tt-rss when having a huge number of articles
// in the database (better yet, enable purging!)

View File

@ -0,0 +1,29 @@
define('DIGEST_ENABLE', true);
// Global option to enable daily digests. Also toggles the ability of users
// to forward articles by email.
define('DIGEST_EMAIL_LIMIT', 10);
// The maximum amount of emails sent in one digest batch
define('DAEMON_SENDS_DIGESTS', true);
// If update daemon and update_feeds should send digests
// Disable if you prefer querying special URL (see wiki)
define('DIGEST_FROM_NAME', 'Tiny Tiny RSS');
define('DIGEST_FROM_ADDRESS', 'noreply@{$DomainName}');
// Name, address and subject for sending outgoing mail. This applies
// to password reset notifications, digest emails and any other mail.
define('DIGEST_SUBJECT', '[tt-rss] New headlines for last 24 hours');
// Subject line for email digests
define('DIGEST_SMTP_HOST', 'localhost');
// SMTP Host to send outgoing mail. Blank - use system MTA.
define('DIGEST_SMTP_LOGIN', '');
define('DIGEST_SMTP_PASSWORD', '');
// These two options enable SMTP authentication when sending
// outgoing mail. Require DIGEST_SMTP_HOST.

View File

@ -0,0 +1,14 @@
define('ENABLE_REGISTRATION', false);
// Allow users to register themselves. Please be vary that allowing
// random people to access your tt-rss installation is a security risk
// and potentially might lead to data loss or server exploit. Disabled
// by default.
define('REG_NOTIFY_ADDRESS', 'admin@{$DomainName}');
// Email address to send new user notifications to.
define('REG_MAX_USERS', 0);
// Maximum amount of users which will be allowed to register on this
// system. 0 - no limit.

View File

@ -0,0 +1,8 @@
define('SPHINX_ENABLED', false);
// Enable fulltext search using Sphinx (http://www.sphinxsearch.com)
// Please see http://tt-rss.org/wiki/SphinxSearch for more information.
define('SPHINX_INDEX', 'ttrss');
// Index name in Sphinx configuration

View File

@ -0,0 +1,9 @@
define('ENABLE_TWEET_BUTTON', false);
// Enable 'tweet this' button for articles
define('CONSUMER_KEY', '');
define('CONSUMER_SECRET', '');
// Your OAuth instance authentication information for Twitter, visit
// http://twitter.com/oauth_clients to register your instance.

View File

@ -0,0 +1,18 @@
define('ENABLE_GZIP_OUTPUT', true);
// Selectively gzip output to improve wire performance. This requires
// PHP Zlib extension on the server.
define('ENABLE_TRANSLATIONS', true);
// Enable support for interface translations
define('FEEDBACK_URL', '');
// Displays an URL for users to provide feedback or comments regarding
// this instance of tt-rss. Can lead to a forum, contact email, etc.
define('USE_CURL', false);
// Use CURL to fetch remote data instead of PHP built-in fopen()
define('CHECK_FOR_NEW_VERSION', false);
// Check for new versions of tt-rss automatically.

View File

@ -0,0 +1,6 @@
define('CONFIG_VERSION', 23);
// Expected config version. Please update this option in config.php
// if necessary (after migrating all new options from this file).
// vim:ft=php

View File

@ -0,0 +1,25 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 2010-2011 Firewall-Services
# daniel@firewall-services.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#----------------------------------------------------------------------
exec \
/usr/local/bin/setuidgid smelog \
/usr/local/bin/multilog t s5000000 \
/var/log/tt-rss

View File

@ -0,0 +1,33 @@
#!/bin/sh
#----------------------------------------------------------------------
# copyright (C) 2010-2011 Firewall-Services
# daniel@firewall-services.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Technical support for this program is available from Mitel Networks
# Please visit our web site www.mitel.com/sme/ for details.
#----------------------------------------------------------------------
exec 2>&1
cd /usr/share/tt-rss
exec \
/usr/local/bin/setuidgid www \
/usr/bin/php ./update.php -daemon

90
smeserver-tt-rss.spec Normal file
View File

@ -0,0 +1,90 @@
# Authority: vip-ire
# Name: Daniel Berteaud
%define name smeserver-tt-rss
%define version 0.1.0
%define release 1
Summary: sme server integration of tt-rss
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: GNU GPL version 2
URL: http://www.zabbix.com/
Group: SMEserver/addon
Source: %{name}-%{version}.tar.gz
BuildArchitectures: noarch
BuildRequires: e-smith-devtools
BuildRoot: /var/tmp/%{name}-%{version}
Requires: e-smith-release
Requires: tt-rss >= 1.5.1
Requires: smeserver-webapps-common
AutoReqProv: no
%description
smserver integration of openupload.
OpenUpload is an open source application to share files over
the internet (like MegaUpload or RapidShare for example)
%changelog
* Tue Apr 24 2012 Daniel Berteaud <daniel@firewall-services.com> 0.1.0-1.sme
- Migrate to GIT
* Fri Nov 25 2011 Daniel Berteaud <daniel@firewall-services.com> 0.1-8.sme
- Define SELF_URL_PATH in config
- Update config version to 23 (1.5.7)
* Mon Jul 25 2011 Daniel Berteaud <daniel@firewall-services.com> 0.1-7.sme
- Configure cache dir (prevent log noise)
* Tue Jun 07 2011 Daniel B. <daniel@firewall-services.com> 0.1-6.sme
- MySQL schema files are not doc files anymore
* Tue May 17 2011 Daniel B. <daniel@firewall-services.com> 0.1-5
- Deny access to the /schema directory
* Wed Jan 26 2011 Daniel B. <daniel@firewall-services.com> 0.1-4
- Add DB_PORT param in config file
* Wed Jan 26 2011 Daniel B. <daniel@firewall-services.com> 0.1-3
- Support tt-rss 1.5.1
* Mon Jan 03 2011 Daniel B. <daniel@firewall-services.com> 0.1-2
- disable cron job, as feeds are updated via the daemon
* Mon Jan 03 2011 Daniel B. <daniel@firewall-services.com> 0.1-1
- initial release
%prep
%setup
%build
perl ./createlinks
%{__mkdir_p} root/var/log/tt-rss
%install
rm -rf $RPM_BUILD_ROOT
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT)
rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--file /var/service/tt-rss/run 'attr(0755,root,root)' \
--file /var/service/tt-rss/log/run 'attr(0755,root,root)' \
--dir /var/log/tt-rss 'attr(0770,root,smelog)' \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%clean
rm -rf $RPM_BUILD_ROOT
%postun
#uninstall
if [ $1 = 0 ] ; then
/sbin/e-smith/db configuration setprop tt-rss status disabled
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
/usr/bin/sv h /service/httpd-e-smith
fi
true