Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade config file #108

Merged
merged 37 commits into from Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
844d317
fix
ericgaspar Jun 26, 2021
b321373
fix
ericgaspar Jun 26, 2021
35406e5
Update install
ericgaspar Jun 26, 2021
22c46aa
Fix
ericgaspar Sep 29, 2021
e6f952b
Fix
ericgaspar Nov 21, 2021
2636b12
Fix
ericgaspar Nov 21, 2021
6622c4a
FIx
ericgaspar Nov 21, 2021
dfa3e52
Update install
ericgaspar Nov 21, 2021
6f206e5
Fix
ericgaspar Nov 21, 2021
bc7b3a1
Update config.php
ericgaspar Nov 21, 2021
c3b3b89
Update config
ericgaspar Dec 21, 2021
d022f5e
Update nginx.conf
ericgaspar Dec 21, 2021
e5785c3
Update config.php
ericgaspar Dec 21, 2021
574f87f
Fix
ericgaspar Dec 21, 2021
fa342ca
Update app.src
ericgaspar Dec 21, 2021
a354da7
fix
ericgaspar Dec 21, 2021
459bc79
Update install
ericgaspar Dec 21, 2021
4e6345f
Fix
ericgaspar Dec 21, 2021
f350709
Update install
ericgaspar Dec 21, 2021
6704f7c
Update install
ericgaspar Dec 21, 2021
07082fd
Update install
ericgaspar Dec 21, 2021
043bf1c
Update install
ericgaspar Dec 21, 2021
e409a1a
Update install
ericgaspar Dec 21, 2021
3256aa3
Update config.php
ericgaspar Dec 21, 2021
2f7ca6f
Update install
ericgaspar Dec 21, 2021
1e9f710
Update config.php
ericgaspar Dec 21, 2021
eadf42f
Update config.php
ericgaspar Dec 21, 2021
8bc5aa9
Update config.php
ericgaspar Dec 21, 2021
5cef3f0
Update config.php
ericgaspar Dec 21, 2021
1b65596
Update config.php
ericgaspar Dec 21, 2021
7facfe4
Update config.php
ericgaspar Dec 21, 2021
b93a18b
Update manifest.json
ericgaspar Dec 21, 2021
24b32d0
Update manifest.json
ericgaspar Dec 24, 2021
bdbc37f
Update check_process
ericgaspar Dec 24, 2021
f176e24
Update upgrade
ericgaspar Dec 25, 2021
8776d26
Update upgrade
ericgaspar Dec 25, 2021
3a3113d
Update upgrade
ericgaspar Dec 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions check_process
Expand Up @@ -2,18 +2,24 @@
; Manifest
domain="domain.tld"
path="/path"
is_public=1
; Checks
pkg_linter=1
setup_sub_dir=1
setup_root=1
setup_nourl=0
setup_private=0
setup_public=0
setup_private=1
setup_public=1
upgrade=1
upgrade=1 from_commit=be16ff54ae531329590ef6576d6f928315ebe0cf
backup_restore=1
multi_instance=1
change_url=1
;;; Options
Email=
Notification=none
;;; Upgrade options
; commit=be16ff54ae531329590ef6576d6f928315ebe0cf
name=Create cron
manifest_arg=domain=DOMAIN&path=PATH&admin=USER&language=fr&is_public=1&password=pass&port=666&

5 changes: 2 additions & 3 deletions conf/app.src
@@ -1,7 +1,6 @@
SOURCE_URL=https://git.tt-rss.org/fox/tt-rss/archive/9d3c79498368fa99cfde684c759a1c40825aaaa9.tar.gz
SOURCE_SUM=cb5a39a61f6319734606f06fafbb0eb60aa488cdc911ec84ee6738da533124cb
SOURCE_URL=https://git.tt-rss.org/fox/tt-rss/archive/7aeaa1b039b269c75e543045dcf8c077b3aa258d.tar.gz
SOURCE_SUM=379d96fc026e76c6325908638e953a93ab4f6bb29da99ad7a0ea203fb88a6e6c
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
SOURCE_EXTRACT=true
129 changes: 28 additions & 101 deletions conf/config.php
@@ -1,47 +1,36 @@
<?php

// *******************************************
// *** Database configuration (important!) ***
// *******************************************

define('DB_TYPE', "mysql"); // or mysql
define('DB_HOST', "localhost");
define('DB_USER', "__DB_NAME__");
define('DB_NAME', "__DB_NAME__");
define('DB_PASS', "__DB_PWD__");
define('DB_PORT', '3306'); // usually 5432 for PostgreSQL, 3306 for MySQL
putenv('TTRSS_DB_TYPE=mysql'); // or mysql
putenv('TTRSS_DB_HOST=localhost');
putenv('TTRSS_DB_USER=__DB_NAME__');
putenv('TTRSS_DB_NAME=__DB_NAME__');
putenv('TTRSS_DB_PASS=__DB_PWD__');
putenv('TTRSS_DB_PORT=3306'); // usually 5432 for PostgreSQL, 3306 for MySQL

define('MYSQL_CHARSET', 'UTF8');
putenv('TTRSS_MYSQL_CHARSET=UTF8');
// Connection charset for MySQL. If you have a legacy database and/or experience
// garbage unicode characters with this option, try setting it to a blank string.

// ***********************************
// *** Basic settings (important!) ***
// ***********************************

define('SELF_URL_PATH', '__DOMAIN_PATH__');
putenv('TTRSS_SELF_URL_PATH=__DOMAIN_PATH__');
// Full URL of your tt-rss installation. This should be set to the
// location of tt-rss directory, e.g. http://example.org/tt-rss/
// You need to set this option correctly otherwise several features
// including PUSH, bookmarklets and browser integration will not work properly.

define('FEED_CRYPT_KEY', '');
// WARNING: mcrypt is deprecated in php 7.1. This directive exists for backwards
// compatibility with existing installs, new passwords are NOT going to be encrypted.
// Use update.php --decrypt-feeds to decrypt existing passwords in the database while
// mcrypt is still available.

// Key used for encryption of passwords for password-protected feeds
// in the database. A string of 24 random characters. If left blank, encryption
// is not used. Requires mcrypt functions.
// Warning: changing this key will make your stored feed passwords impossible
// to decrypt.

define('SINGLE_USER_MODE', false);
putenv('TTRSS_SINGLE_USER_MODE=true');
// Operate in single user mode, disables all functionality related to
// multiple users and authentication. Enabling this assumes you have
// your tt-rss directory protected by other means (e.g. http auth).

define('SIMPLE_UPDATE_MODE', false);
putenv('TTRSS_SIMPLE_UPDATE_MODE=false');
// Enables fallback update mode where tt-rss tries to update feeds in
// background while tt-rss is open in your browser.
// If you don't have a lot of feeds and don't want to or can't run
Expand All @@ -54,37 +43,39 @@
// *** Files and directories ***
// *****************************

define('PHP_EXECUTABLE', '/usr/bin/php');
putenv('TTRSS_PHP_EXECUTABLE=/usr/bin/php');
// Path to PHP *COMMAND LINE* executable, used for various command-line tt-rss
// programs and update daemon. Do not try to use CGI binary here, it won't work.
// If you see HTTP headers being displayed while running tt-rss scripts,
// then most probably you are using the CGI binary. If you are unsure what to
// put in here, ask your hosting provider.

define('LOCK_DIRECTORY', 'lock');
putenv('TTRSS_LOCK_DIRECTORY=lock');
// Directory for lockfiles, must be writable to the user you run
// daemon process or cronjobs under.

define('CACHE_DIR', 'cache');
putenv('TTRSS_CACHE_DIR=cache');
// Local cache directory for RSS feed content.

define('ICONS_DIR', "feed-icons");
define('ICONS_URL', "feed-icons");
putenv('TTRSS_ICONS_DIR=feed-icons');
putenv('TTRSS_ICONS_URL=feed-icons');
// 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.

//putenv('TTRSS_SIMPLE_UPDATE_MODE=true');

// **********************
// *** Authentication ***
// **********************

// Please see PLUGINS below to configure various authentication modules.

define('AUTH_AUTO_CREATE', true);
putenv('TTRSS_AUTH_AUTO_CREATE=true');
// Allow authentication modules to auto-create users in tt-rss internal
// database when authenticated successfully.

define('AUTH_AUTO_LOGIN', true);
putenv('TTRSS_AUTH_AUTO_LOGIN=true');
// Automatically login user on remote or other kind of externally supplied
// authentication, otherwise redirect to login form as normal.
// If set to true, users won't be able to set application language
Expand All @@ -94,29 +85,25 @@
// *** Feed settings ***
// *********************

define('FORCE_ARTICLE_PURGE', 0);
putenv('TTRSS_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.

// *** PubSubHubbub settings ***

define('PUBSUBHUBBUB_HUB', '');
// URL to a PubSubHubbub-compatible hub server. If defined, "Published
// articles" generated feed would automatically become PUSH-enabled.

define('PUBSUBHUBBUB_ENABLED', false);
putenv('TTRSS_PUBSUBHUBBUB_ENABLED=false');
// Enable client PubSubHubbub support in tt-rss. When disabled, tt-rss
// won't try to subscribe to PUSH feed updates.

// ****************************
// *** Sphinx search plugin ***
// ****************************

define('SPHINX_SERVER', 'localhost:9312');
putenv('TTRSS_SPHINX_SERVER=localhost:9312');
// Hostname:port combination for the Sphinx server.

define('SPHINX_INDEX', 'ttrss, delta');
putenv('TTRSS_SPHINX_INDEX=ttrss, delta');
// Index name in Sphinx configuration. You can specify multiple indexes
// as a comma-separated string.
// Example configuration files are available on tt-rss wiki.
Expand All @@ -125,83 +112,23 @@
// *** Self-registrations by users ***
// ***********************************

define('ENABLE_REGISTRATION', false);
putenv('TTRSS_ENABLE_REGISTRATION=false');
// Allow users to register themselves. Please be aware 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', 'user@your.domain.dom');
putenv('TTRSS_REG_NOTIFY_ADDRESS=user@your.domain.dom');
// Email address to send new user notifications to.

define('REG_MAX_USERS', 10);
putenv('TTRSS_REG_MAX_USERS=10');
// Maximum amount of users which will be allowed to register on this
// system. 0 - no limit.

// **********************************
// *** Cookies and login sessions ***
// **********************************

define('SESSION_COOKIE_LIFETIME', 86400);
putenv('TTRSS_SESSION_COOKIE_LIFETIME='.(86400*30));
// Default lifetime of a session (e.g. login) cookie. In seconds,
// 0 means cookie will be deleted when browser closes.

// *********************************
// *** Email and digest settings ***
// *********************************

define('SMTP_FROM_NAME', 'Tiny Tiny RSS');
define('SMTP_FROM_ADDRESS', 'noreply@your.domain.dom');
// 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('SMTP_SERVER', '');
// Hostname:port combination to send outgoing mail (i.e. localhost:25).
// Blank - use system MTA.

define('SMTP_LOGIN', '');
define('SMTP_PASSWORD', '');
// These two options enable SMTP authentication when sending
// outgoing mail. Only used with SMTP_SERVER.

define('SMTP_SECURE', '');
// Used to select a secure SMTP connection. Allowed values: ssl, tls,
// or empty.

// ***************************************
// *** Other settings (less important) ***
// ***************************************

define('CHECK_FOR_UPDATES', true);
// Check for updates automatically if running Git version

define('ENABLE_GZIP_OUTPUT', false);
// Selectively gzip output to improve wire performance. This requires
// PHP Zlib extension on the server.
// Enabling this can break tt-rss in several httpd/php configurations,
// if you experience weird errors and tt-rss failing to start, blank pages
// after login, or content encoding errors, disable it.

define('PLUGINS', 'auth_remote, auth_internal, note');
// Comma-separated list of plugins to load automatically for all users.
// System plugins have to be specified here. Please enable at least one
// authentication plugin here (auth_*).
// Users may enable other user plugins from Preferences/Plugins but may not
// disable plugins specified in this list.
// Disabling auth_internal in this list would automatically disable
// reset password link on the login form.

define('LOG_DESTINATION', 'sql');
// Log destination to use. Possible values: sql (uses internal logging
// you can read in Preferences -> System), syslog - logs to system log.
// Setting this to blank uses PHP logging (usually to http server
// error.log).

define('CONFIG_VERSION', 26);
// Expected config version. Please update this option in config.php
// if necessary (after migrating all new options from this file).

// vim:ft=php
1 change: 1 addition & 0 deletions conf/cron
@@ -0,0 +1 @@
*/30 * * * * /usr/bin/php__PHPVERSION__ __FINALPATH__/update.php --feeds --quiet
5 changes: 0 additions & 5 deletions conf/nginx.conf
Expand Up @@ -4,11 +4,6 @@ location __PATH__/ {
# Path to source
alias __FINALPATH__/ ;

# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}

index index.php;

# Common parameter to increase upload size limit in conjunction with dedicated php-fpm file
Expand Down
32 changes: 18 additions & 14 deletions manifest.json
Expand Up @@ -3,18 +3,18 @@
"id": "ttrss",
"packaging_format": 1,
"description": {
"en": "News feed (RSS/Atom) reader and aggregator.",
"fr": "Lecteur de flux d’actualité utilisant les protocoles RSS et Atom."
"en": "News feed (RSS/Atom) reader and aggregator",
"fr": "Lecteur de flux d’actualité utilisant les protocoles RSS et Atom"
},
"version": "20200916~ynh5",
"version": "20211221~ynh1",
"url": "http://tt-rss.org",
"license": "GPL-3.0-only",
"maintainer": {
"name": "",
"email": ""
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [
Expand All @@ -24,16 +24,20 @@
],
"arguments": {
"install" : [
{
"name": "domain",
"type": "domain",
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"example": "/ttrss",
"default": "/ttrss"
{
"name": "domain",
"type": "domain"
},
{
"name": "path",
"type": "path",
"example": "/ttrss",
"default": "/ttrss"
},
{
"name": "is_public",
"type": "boolean",
"default": true
}
]
}
Expand Down
38 changes: 1 addition & 37 deletions scripts/_common.sh
Expand Up @@ -6,46 +6,10 @@

YNH_PHP_VERSION="7.3"

extra_php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-opcache \
pkg_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-opcache \
php${YNH_PHP_VERSION}-fileinfo php${YNH_PHP_VERSION}-intl php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xml"

#=================================================
# EXPERIMENTAL HELPERS
#=================================================

# Check available space before creating a temp directory.
#
# usage: ynh_smart_mktemp --min_size="Min size"
#
# | arg: -s, --min_size= - Minimal size needed for the temporary directory, in Mb
ynh_smart_mktemp () {
# Declare an array to define the options of this helper.
declare -Ar args_array=( [s]=min_size= )
local min_size
# Manage arguments with getopts
ynh_handle_getopts_args "$@"

min_size="${min_size:-300}"
# Transform the minimum size from megabytes to kilobytes
min_size=$(( $min_size * 1024 ))

# Check if there's enough free space in a directory
is_there_enough_space () {
local free_space=$(df --output=avail "$1" | sed 1d)
test $free_space -ge $min_size
}

if is_there_enough_space /tmp; then
local tmpdir=/tmp
elif is_there_enough_space /var; then
local tmpdir=/var
elif is_there_enough_space /; then
local tmpdir=/
elif is_there_enough_space /home; then
local tmpdir=/home
else
ynh_die "Insufficient free space to continue..."
fi

echo "$(mktemp --directory --tmpdir="$tmpdir")"
}