A free, self-hostable news aggregator…
Cookie : sous-répertoire pour index (changements de répertoires !)
Alexandre Alapetite58300c36ad77
diff --git a/README.md b/README.mdindex 716859ccf..62d7e0c25 100644--- a/README.md+++ b/README.md@@ -31,7 +31,7 @@ Privilégiez pour cela des demandes sur GitHub# Installation1. Récupérez l’application FreshRSS via la commande git ou [en téléchargeant l’archive](https://github.com/marienfressinaud/FreshRSS/archive/master.zip)-2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./public/`)+2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./p/`)3. Le serveur Web doit avoir les droits d’écriture dans le répertoire `./data/`4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à me contacter.@@ -49,7 +49,7 @@ Il est recommandé de limiter l’accès à votre FreshRSS, soit :```# Conseils-* Pour une meilleure sécurité, faites en sorte que seul le répertoire `./public` soit accessible depuis le Web, par exemple en faisant pointer un sous-domaine sur le répertoire `./public`.+* Pour une meilleure sécurité, faites en sorte que seul le répertoire `./p/` soit accessible depuis le Web, par exemple en faisant pointer un sous-domaine sur le répertoire `./public`.* Les données personnelles se trouvent dans le répertoire `./data/` (déjà protégé par un .htaccess pour Apache - vérifiez que cela fonctionne -, à protéger vous-même dans le cas d’autres serveurs Web).* Le fichier `./constants.php` définit les chemins d’accès aux répertoires clés de l’application. Si vous les bougez, tout se passe ici.* En cas de problème, les logs peuvent être utile à lire, soit depuis l’interface de FreshRSS, soit manuellement depuis `./data/log/*.log`.diff --git a/constants.php b/constants.phpindex c22209efe..0c7adc57e 100644--- a/constants.php+++ b/constants.php@@ -3,12 +3,15 @@ define('FRESHRSS_VERSION', '0.7-beta3');define('FRESHRSS_WEBSITE', 'http://freshrss.org');// Constantes de chemins-define ('FRESHRSS_PATH', dirname(__FILE__));+define('FRESHRSS_PATH', dirname(__FILE__));-define ('PUBLIC_PATH', FRESHRSS_PATH . '/public');-define ('DATA_PATH', FRESHRSS_PATH . '/data');-define ('LIB_PATH', FRESHRSS_PATH . '/lib');-define ('APP_PATH', FRESHRSS_PATH . '/app');+ define('PUBLIC_PATH', FRESHRSS_PATH . '/p');+ define('INDEX_PATH', PUBLIC_PATH . '/i');+ define('PUBLIC_RELATIVE', '..');-define ('LOG_PATH', DATA_PATH . '/log');-define ('CACHE_PATH', DATA_PATH . '/cache');+ define('DATA_PATH', FRESHRSS_PATH . '/data');+ define('LOG_PATH', DATA_PATH . '/log');+ define('CACHE_PATH', DATA_PATH . '/cache');++ define('LIB_PATH', FRESHRSS_PATH . '/lib');+ define('APP_PATH', FRESHRSS_PATH . '/app');diff --git a/index.html b/index.htmlindex 937659d57..bbea573c7 100644--- a/index.html+++ b/index.html@@ -2,12 +2,11 @@<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB"><head><meta charset="UTF-8" />-<meta http-equiv="Refresh" content="0; url=public/" />+<meta http-equiv="Refresh" content="0; url=p/i/" /><title>Redirection</title>-<meta name="robots" content="noindex,follow" /></head><body>-<p><a href="./public/">FreshRSS</a></p>+<p><a href="p/i/">FreshRSS</a></p></body></html>diff --git a/index.php b/index.phpnew file mode 100644index 000000000..3fdae4285--- /dev/null+++ b/index.php@@ -0,0 +1,3 @@+<?php+header('Location: p/i/', true, 301);+include('index.html');diff --git a/lib/Minz/Session.php b/lib/Minz/Session.phpindex c2af920df..f527322f5 100644--- a/lib/Minz/Session.php+++ b/lib/Minz/Session.php@@ -18,6 +18,7 @@ class Minz_Session {public static function init ($name) {// démarre la sessionsession_name ($name);+ session_set_cookie_params (0, './', null, false, true);session_start ();if (isset ($_SESSION)) {diff --git a/lib/Minz/Url.php b/lib/Minz/Url.phpindex 30f7f6231..17f1ddece 100644--- a/lib/Minz/Url.php+++ b/lib/Minz/Url.php@@ -17,12 +17,16 @@ class Minz_Url {* @return l'url formatée*/public static function display ($url = array (), $encodage = 'html', $absolute = false) {- $url = self::checkUrl ($url);+ $isArray = is_array($url);++ if ($isArray) {+ $url = self::checkUrl ($url);+ }$url_string = '';if ($absolute) {- if (is_array ($url) && isset ($url['protocol'])) {+ if ($isArray && isset ($url['protocol'])) {$protocol = $url['protocol'];} elseif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {$protocol = 'https:';@@ -30,12 +34,11 @@ class Minz_Url {$protocol = 'http:';}$url_string = $protocol . '//' . Minz_Request::getDomainName () . Minz_Request::getBaseUrl ();- }- else {- $url_string = '.';+ } else {+ $url_string = $isArray ? '.' : PUBLIC_RELATIVE;}- if (is_array ($url)) {+ if ($isArray) {$router = new Minz_Router ();if (Minz_Configuration::useUrlRewriting ()) {diff --git a/public/.htaccess b/p/.htaccesssimilarity index 100%rename from public/.htaccessrename to p/.htaccessdiff --git a/public/f.php b/p/f.phpsimilarity index 100%rename from public/f.phprename to p/f.phpdiff --git a/public/favicon.ico b/p/favicon.icosimilarity index 100%rename from public/favicon.icorename to p/favicon.icodiff --git a/public/favicon.png b/p/favicon.pngsimilarity index 100%rename from public/favicon.pngrename to p/favicon.pngdiff --git a/public/index.php b/p/i/index.phpsimilarity index 98%rename from public/index.phprename to p/i/index.phpindex c8b15b3d9..6c25b2c54 100755--- a/public/index.php+++ b/p/i/index.php@@ -21,7 +21,7 @@if (file_exists ('install.php')) {require('install.php');} else {- require('../constants.php');+ require('../../constants.php');session_cache_limiter('');if (!file_exists(DATA_PATH . '/no-cache.txt')) {diff --git a/public/install.php b/p/i/install.phpsimilarity index 98%rename from public/install.phprename to p/i/install.phpindex ad5527765..fa37ae19a 100644--- a/public/install.php+++ b/p/i/install.php@@ -1,8 +1,9 @@<?php-require('../constants.php');+require('../../constants.php');include(LIB_PATH . '/lib_rss.php');session_name('FreshRSS');+session_set_cookie_params(0, './', null, false, true);session_start();if (isset ($_GET['step'])) {@@ -381,7 +382,7 @@ function updateDatabase($perform = false) {}function deleteInstall () {- $res = unlink (PUBLIC_PATH . '/install.php');+ $res = unlink (INDEX_PATH . '/install.php');if ($res) {header ('Location: index.php');}@@ -455,16 +456,6 @@ function delTree($dir) { //http://php.net/rmdir#110489return rmdir($dir);}-function removeOldFiles() {- $oldDirs = array('/app/configuration/', '/cache/', '/log/', '/public/data/', '/public/themes/printer/'); //v0.6-- $ok = true;- foreach ($oldDirs as $oldDir) {- $ok &= delTree(FRESHRSS_PATH . $oldDir);- }- return $ok;-}-/*** VÉRIFICATIONS ***/function checkStep () {$s0 = checkStep0 ();@@ -483,7 +474,7 @@ function checkStep () {$_SESSION['actualize_feeds'] = true;}function checkStep0 () {- moveOldFiles() && removeOldFiles();+ moveOldFiles();if (file_exists(DATA_PATH . '/config.php')) {$ini_array = include(DATA_PATH . '/config.php');@@ -934,7 +925,7 @@ function printStep5 () {function printStep6 () {?>- <p class="alert alert-error"><span class="alert-head"><?php echo _t ('oops'); ?></span> <?php echo _t ('install_not_deleted', PUBLIC_PATH . '/install.php'); ?></p>+ <p class="alert alert-error"><span class="alert-head"><?php echo _t ('oops'); ?></span> <?php echo _t ('install_not_deleted', INDEX_PATH . '/install.php'); ?></p><?php}diff --git a/p/index.html b/p/index.htmlnew file mode 100644index 000000000..af91b717e--- /dev/null+++ b/p/index.html@@ -0,0 +1,12 @@+<!DOCTYPE html>+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">+<head>+<meta charset="UTF-8" />+<meta http-equiv="Refresh" content="0; url=i/" />+<title>Redirection</title>+</head>++<body>+<p><a href="i/">FreshRSS</a></p>+</body>+</html>diff --git a/p/index.php b/p/index.phpnew file mode 100644index 000000000..e90662078--- /dev/null+++ b/p/index.php@@ -0,0 +1,3 @@+<?php+header('Location: i/', true, 301);+include('index.html');diff --git a/public/robots.txt b/p/robots.txtsimilarity index 100%rename from public/robots.txtrename to p/robots.txtdiff --git a/public/scripts/global_view.js b/p/scripts/global_view.jssimilarity index 100%rename from public/scripts/global_view.jsrename to p/scripts/global_view.jsdiff --git a/public/scripts/jquery-2.0.3.min.map b/p/scripts/jquery-2.0.3.min.mapsimilarity index 100%rename from public/scripts/jquery-2.0.3.min.maprename to p/scripts/jquery-2.0.3.min.mapdiff --git a/public/scripts/jquery.lazyload.min.js b/p/scripts/jquery.lazyload.min.jssimilarity index 100%rename from public/scripts/jquery.lazyload.min.jsrename to p/scripts/jquery.lazyload.min.jsdiff --git a/public/scripts/jquery.min.js b/p/scripts/jquery.min.jssimilarity index 100%rename from public/scripts/jquery.min.jsrename to p/scripts/jquery.min.jsdiff --git a/public/scripts/main.js b/p/scripts/main.jssimilarity index 100%rename from public/scripts/main.jsrename to p/scripts/main.jsdiff --git a/public/scripts/shortcut.js b/p/scripts/shortcut.jssimilarity index 100%rename from public/scripts/shortcut.jsrename to p/scripts/shortcut.jsdiff --git a/public/themes/default/freshrss.css b/p/themes/default/freshrss.csssimilarity index 100%rename from public/themes/default/freshrss.cssrename to p/themes/default/freshrss.cssdiff --git a/public/themes/default/global.css b/p/themes/default/global.csssimilarity index 100%rename from public/themes/default/global.cssrename to p/themes/default/global.cssdiff --git a/public/themes/default/loader.gif b/p/themes/default/loader.gifsimilarity index 100%rename from public/themes/default/loader.gifrename to p/themes/default/loader.gifdiff --git a/public/themes/default/metadata.json b/p/themes/default/metadata.jsonsimilarity index 100%rename from public/themes/default/metadata.jsonrename to p/themes/default/metadata.jsondiff --git a/public/themes/flat-design/freshrss.css b/p/themes/flat-design/freshrss.csssimilarity index 100%rename from public/themes/flat-design/freshrss.cssrename to p/themes/flat-design/freshrss.cssdiff --git a/public/themes/flat-design/global.css b/p/themes/flat-design/global.csssimilarity index 100%rename from public/themes/flat-design/global.cssrename to p/themes/flat-design/global.cssdiff --git a/public/themes/flat-design/icons/add.svg b/p/themes/flat-design/icons/add.svgsimilarity index 100%rename from public/themes/flat-design/icons/add.svgrename to p/themes/flat-design/icons/add.svgdiff --git a/public/themes/flat-design/icons/all.svg b/p/themes/flat-design/icons/all.svgsimilarity index 100%rename from public/themes/flat-design/icons/all.svgrename to p/themes/flat-design/icons/all.svgdiff --git a/public/themes/flat-design/icons/close.svg b/p/themes/flat-design/icons/close.svgsimilarity index 100%rename from public/themes/flat-design/icons/close.svgrename to p/themes/flat-design/icons/close.svgdiff --git a/public/themes/flat-design/icons/configure.svg b/p/themes/flat-design/icons/configure.svgsimilarity index 100%rename from public/themes/flat-design/icons/configure.svgrename to p/themes/flat-design/icons/configure.svgdiff --git a/public/themes/flat-design/icons/down.svg b/p/themes/flat-design/icons/down.svgsimilarity index 100%rename from public/themes/flat-design/icons/down.svgrename to p/themes/flat-design/icons/down.svgdiff --git a/public/themes/flat-design/icons/next.svg b/p/themes/flat-design/icons/next.svgsimilarity index 100%rename from public/themes/flat-design/icons/next.svgrename to p/themes/flat-design/icons/next.svgdiff --git a/public/themes/flat-design/icons/prev.svg b/p/themes/flat-design/icons/prev.svgsimilarity index 100%rename from public/themes/flat-design/icons/prev.svgrename to p/themes/flat-design/icons/prev.svgdiff --git a/public/themes/flat-design/icons/refresh.svg b/p/themes/flat-design/icons/refresh.svgsimilarity index 100%rename from public/themes/flat-design/icons/refresh.svgrename to p/themes/flat-design/icons/refresh.svgdiff --git a/public/themes/flat-design/icons/search.svg b/p/themes/flat-design/icons/search.svgsimilarity index 100%rename from public/themes/flat-design/icons/search.svgrename to p/themes/flat-design/icons/search.svgdiff --git a/public/themes/flat-design/icons/up.svg b/p/themes/flat-design/icons/up.svgsimilarity index 100%rename from public/themes/flat-design/icons/up.svgrename to p/themes/flat-design/icons/up.svgdiff --git a/public/themes/flat-design/loader.gif b/p/themes/flat-design/loader.gifsimilarity index 100%rename from public/themes/flat-design/loader.gifrename to p/themes/flat-design/loader.gifdiff --git a/public/themes/flat-design/metadata.json b/p/themes/flat-design/metadata.jsonsimilarity index 100%rename from public/themes/flat-design/metadata.jsonrename to p/themes/flat-design/metadata.jsondiff --git a/public/themes/fonts/openSans.woff b/p/themes/fonts/openSans.woffsimilarity index 100%rename from public/themes/fonts/openSans.woffrename to p/themes/fonts/openSans.woffdiff --git a/public/themes/icons/add.svg b/p/themes/icons/add.svgsimilarity index 100%rename from public/themes/icons/add.svgrename to p/themes/icons/add.svgdiff --git a/public/themes/icons/all.svg b/p/themes/icons/all.svgsimilarity index 100%rename from public/themes/icons/all.svgrename to p/themes/icons/all.svgdiff --git a/public/themes/icons/bookmark.svg b/p/themes/icons/bookmark.svgsimilarity index 100%rename from public/themes/icons/bookmark.svgrename to p/themes/icons/bookmark.svgdiff --git a/public/themes/icons/category-white.svg b/p/themes/icons/category-white.svgsimilarity index 100%rename from public/themes/icons/category-white.svgrename to p/themes/icons/category-white.svgdiff --git a/public/themes/icons/category.svg b/p/themes/icons/category.svgsimilarity index 100%rename from public/themes/icons/category.svgrename to p/themes/icons/category.svgdiff --git a/public/themes/icons/close.svg b/p/themes/icons/close.svgsimilarity index 100%rename from public/themes/icons/close.svgrename to p/themes/icons/close.svgdiff --git a/public/themes/icons/configure.svg b/p/themes/icons/configure.svgsimilarity index 100%rename from public/themes/icons/configure.svgrename to p/themes/icons/configure.svgdiff --git a/public/themes/icons/down.svg b/p/themes/icons/down.svgsimilarity index 100%rename from public/themes/icons/down.svgrename to p/themes/icons/down.svgdiff --git a/public/themes/icons/grey.gif b/p/themes/icons/grey.gifsimilarity index 100%rename from public/themes/icons/grey.gifrename to p/themes/icons/grey.gifdiff --git a/public/themes/icons/help.svg b/p/themes/icons/help.svgsimilarity index 100%rename from public/themes/icons/help.svgrename to p/themes/icons/help.svgdiff --git a/public/themes/icons/icon.svg b/p/themes/icons/icon.svgsimilarity index 100%rename from public/themes/icons/icon.svgrename to p/themes/icons/icon.svgdiff --git a/public/themes/icons/link.svg b/p/themes/icons/link.svgsimilarity index 100%rename from public/themes/icons/link.svgrename to p/themes/icons/link.svgdiff --git a/public/themes/icons/login.svg b/p/themes/icons/login.svgsimilarity index 100%rename from public/themes/icons/login.svgrename to p/themes/icons/login.svgdiff --git a/public/themes/icons/logout.svg b/p/themes/icons/logout.svgsimilarity index 100%rename from public/themes/icons/logout.svgrename to p/themes/icons/logout.svgdiff --git a/public/themes/icons/next.svg b/p/themes/icons/next.svgsimilarity index 100%rename from public/themes/icons/next.svgrename to p/themes/icons/next.svgdiff --git a/public/themes/icons/non-starred.svg b/p/themes/icons/non-starred.svgsimilarity index 100%rename from public/themes/icons/non-starred.svgrename to p/themes/icons/non-starred.svgdiff --git a/public/themes/icons/prev.svg b/p/themes/icons/prev.svgsimilarity index 100%rename from public/themes/icons/prev.svgrename to p/themes/icons/prev.svgdiff --git a/public/themes/icons/read.svg b/p/themes/icons/read.svgsimilarity index 100%rename from public/themes/icons/read.svgrename to p/themes/icons/read.svgdiff --git a/public/themes/icons/refresh.svg b/p/themes/icons/refresh.svgsimilarity index 100%rename from public/themes/icons/refresh.svgrename to p/themes/icons/refresh.svgdiff --git a/public/themes/icons/rss.svg b/p/themes/icons/rss.svgsimilarity index 100%rename from public/themes/icons/rss.svgrename to p/themes/icons/rss.svgdiff --git a/public/themes/icons/search.svg b/p/themes/icons/search.svgsimilarity index 100%rename from public/themes/icons/search.svgrename to p/themes/icons/search.svgdiff --git a/public/themes/icons/share.svg b/p/themes/icons/share.svgsimilarity index 100%rename from public/themes/icons/share.svgrename to p/themes/icons/share.svgdiff --git a/public/themes/icons/starred.svg b/p/themes/icons/starred.svgsimilarity index 100%rename from public/themes/icons/starred.svgrename to p/themes/icons/starred.svgdiff --git a/public/themes/icons/tag.svg b/p/themes/icons/tag.svgsimilarity index 100%rename from public/themes/icons/tag.svgrename to p/themes/icons/tag.svgdiff --git a/public/themes/icons/unread.svg b/p/themes/icons/unread.svgsimilarity index 100%rename from public/themes/icons/unread.svgrename to p/themes/icons/unread.svgdiff --git a/public/themes/icons/up.svg b/p/themes/icons/up.svgsimilarity index 100%rename from public/themes/icons/up.svgrename to p/themes/icons/up.svg