1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shaarli_ynh.git synced 2024-09-03 20:26:10 +02:00

Cleaning up the conf dir

This commit is contained in:
Romain Garbage 2017-02-26 18:10:37 +02:00
parent 1ac88879d7
commit c91c1b6fd9
5 changed files with 0 additions and 108 deletions

View file

@ -1,13 +0,0 @@
<?php
$GLOBALS['salt'] = 'YNH_SALT';
$GLOBALS['timezone'] = 'YNH_TIMEZONE';
date_default_timezone_set('YNH_TIMEZONE');
$GLOBALS['title'] = 'YNH_TITLE';
$GLOBALS['redirector'] = '';
$GLOBALS['disablesessionprotection'] = false;
$GLOBALS['disablejquery'] = false;
$GLOBALS['privateLinkByDefault'] = 'YNH_PRIVATE_LINK_BY_DEFAULT';
$GLOBALS['ynh_admin'] = 'YNH_ADMIN';
require(realpath(dirname(__FILE__)) . '/config_user.php');
?>

View file

@ -1,17 +0,0 @@
<?php
$GLOBALS['salt'] = 'YNH_SALT';
$GLOBALS['timezone'] = 'YNH_TIMEZONE';
date_default_timezone_set('YNH_TIMEZONE');
$GLOBALS['title'] = 'YNH_TITLE';
$GLOBALS['redirector'] = '';
$GLOBALS['disablesessionprotection'] = false;
$GLOBALS['disablejquery'] = false;
$GLOBALS['privateLinkByDefault'] = YNH_PRIVATE_LINK_BY_DEFAULT;
$GLOBALS['ynh_admin'] = 'YNH_ADMIN';
$userconfigfile = realpath(dirname(__FILE__)) . '/config_user.php';
if (is_file($userconfigfile))
{
require($userconfigfile);
}
?>

View file

@ -1,52 +0,0 @@
#!/usr/bin/php
<?php
require('/home/yunohost.app/shaarli/data/config.php');
$userlist=$argv;
array_shift($userlist);
foreach($userlist as $usercount => $userlogin)
{
$userlevel = '2';
if ($userlogin == $GLOBALS['ynh_admin'])
{
$userlevel = '4';
}
$currentLogin = array($userlogin);
$currentPassword = array($userlogin => '');
$currentLevel = array($userlogin => $userlevel);
$currentEmail = array($userlogin => '');
if (array_key_exists('login', $GLOBALS))
{
$GLOBALS['login'] = array_merge($GLOBALS['login'], $currentLogin);
$GLOBALS['password'] = array_merge($GLOBALS['password'], $currentPassword);
$GLOBALS['level'] = array_merge($GLOBALS['level'], $currentLevel);
$GLOBALS['email'] = array_merge($GLOBALS['email'], $currentEmail);
}
else
{
$GLOBALS['login'] = $currentLogin;
$GLOBALS['password'] = $currentPassword;
$GLOBALS['level'] = $currentLevel;
$GLOBALS['email'] = $currentEmail;
}
}
$userconf = '<?php' . PHP_EOL;
$userconf .= '$GLOBALS[\'login\'] = ' . var_export($GLOBALS['login'],true) . ';' . PHP_EOL;
$userconf .= '$GLOBALS[\'password\'] = ' . var_export($GLOBALS['password'],true) . ';' . PHP_EOL;
$userconf .= '$GLOBALS[\'level\'] = ' . var_export($GLOBALS['level'],true) . ';' . PHP_EOL;
$userconf .= '$GLOBALS[\'email\'] = ' . var_export($GLOBALS['email'],true) . ';' . PHP_EOL;
$userconf .= '?>';
$userconf_file = '/home/yunohost.app/shaarli/data/config_user.php';
if (!file_put_contents($userconf_file, $userconf) || strcmp(file_get_contents($userconf_file),$userconf)!=0)
{
fwrite(STDERR, "Error while writing " . $userconf_file);
exit(1);
}
?>

View file

@ -1,23 +0,0 @@
<?php
/*
* DATADIR is defined in index.php, and cannot be defined elsewhere
*
$GLOBALS['config']['DATADIR'] = '/home/yunohost.app/shaarli/data'; // Data subdirectory
*/
$GLOBALS['config']['CONFIG_FILE'] = $GLOBALS['config']['DATADIR'].'/config.php'; // Configuration file (user login/password)
$GLOBALS['config']['DATASTORE'] = $GLOBALS['config']['DATADIR'].'/datastore.php'; // Data storage file.
$GLOBALS['config']['LINKS_PER_PAGE'] = 20; // Default links per page.
$GLOBALS['config']['IPBANS_FILENAME'] = $GLOBALS['config']['DATADIR'].'/ipbans.php'; // File storage for failures and bans.
$GLOBALS['config']['BAN_AFTER'] = 4; // Ban IP after this many failures.
$GLOBALS['config']['BAN_DURATION'] = 1800; // Ban duration for IP address after login failures (in seconds) (1800 sec. = 30 minutes)
$GLOBALS['config']['OPEN_SHAARLI'] = false; // If true, anyone can add/edit/delete links without having to login
$GLOBALS['config']['HIDE_TIMESTAMPS'] = false; // If true, the moment when links were saved are not shown to users that are not logged in.
$GLOBALS['config']['HIDE_QRCODE'] = false; // If true, qrcodes are not shown.
$GLOBALS['config']['ENABLE_THUMBNAILS'] = true; // Enable thumbnails in links.
$GLOBALS['config']['CACHEDIR'] = '/home/yunohost.app/shaarli/cache'; // Cache directory for thumbnails for SLOW services (like flickr)
$GLOBALS['config']['PAGECACHE'] = '/home/yunohost.app/shaarli/pagecache'; // Page cache directory.
$GLOBALS['config']['ENABLE_LOCALCACHE'] = true; // Enable Shaarli to store thumbnail in a local cache. Disable to reduce webspace usage.
$GLOBALS['config']['PUBSUBHUB_URL'] = ''; // PubSubHubbub support. Put an empty string to disable, or put your hub url here to enable.
$GLOBALS['config']['UPDATECHECK_FILENAME'] = $GLOBALS['config']['DATADIR'].'/lastupdatecheck.txt'; // For updates check of Shaarli.
$GLOBALS['config']['UPDATECHECK_INTERVAL'] = 86400 ; // Updates check frequency for Shaarli. 86400 seconds=24 hours
$GLOBALS['config']['RTP_TMPDIR'] = '/home/yunohost.app/shaarli/tmp'; // Rain template tmp directory.

View file

@ -1,3 +0,0 @@
import sys, json
userlist=json.loads(sys.stdin.readlines()[0])["users"]
print "{0}".format("\n".join(i["username"] for i in userlist.values()))