Commit Graph

50 Commits

Author SHA1 Message Date
Alexandre Alapetite
0319cc9d23 Minz allow parallel sessions (#3096)
* Minz allow parallel sessions

#fix https://github.com/FreshRSS/FreshRSS/issues/3093

* Array optimisation

* Array optimisation missing

* Reduce direct access to $_SESSION except in install process

* Fix session start headers warning

* Use cookie only the first time the session is started:
`PHP Warning:  session_start(): Cannot start session when headers
already sent in /var/www/FreshRSS/lib/Minz/Session.php on line 39`

* New concept of volatile session for API calls

Optimisation: do not use cookies or local storage at all for API calls
without a Web session
Fix warning:

```
PHP Warning:  session_destroy(): Trying to destroy uninitialized session
in Unknown on line 0
```

* Only call Minz_Session::init once in our index

It was called twice (once indirectly via FreshRSS->init())

* Whitespace

* Mutex for notifications

Implement mutex for notifications
https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499509809

* Typo

* Install script is not ready for using Minz_Session
2020-10-06 23:19:45 +02:00
Marien Fressinaud
8619cf6fa6 Add a migration system (#2760)
* Add a Minz_Migrator class

Until now, we updated the database structure somewhere in the code but
it wasn't always consistent and somehow complicated to find. Also, this
code was always checked for nothing.

The Migrator aims to improve and ease the creation of migrations. It
should improve the way we apply the updates, making the update server
almost useless.

References:

- example of migration (before Migrator): cc0db9af4f (diff-11a53443fa81512b128c66b065df0679R10)
- update server: https://github.com/FreshRSS/update.freshrss.org
- PR moving the code of the update server to the core: https://github.com/FreshRSS/FreshRSS/pull/1760

* Automatically apply migrations

For now, administrators are used to have nothing to do during an update
else than getting the new code. I suggest to keep this behaviour and
automatically apply migrations if we detect new ones.

Another solution would be to create a CLI command and ask admins to call
it after getting the new code. It could hide migrations errors to end
users, but admin can forget to apply migrations since there are not used
to it.

* Add documentation for Minz Migrator

* Execute migrations even if next ones are applied

* Change mechanism to prevent multiple update at once

* Use mkdir to create the lock and to test it exists

Reference: https://stackoverflow.com/a/731634

* Append .lock to applied_migrations_path

There are no needs to define another file to serve as a lock.

* Change migrations naming convention

* Apply suggestions from code review

Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr>

* Perform a low-cost migration versions comparaison

* Clarify version numbers concerning the migration system

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-07-08 12:11:55 +02:00
Alexandre Alapetite
acc50df0ef Fix logging environment constants (#2745)
* Fix logging environment constants

* COPY_LOG_TO_SYSLOG was only working when Syslog was used
* FRESHRSS_ENV was not properly used to set logging level

* Simplify code

Always call `openlog()` even when it is not used

* Always specify syslog properties

https://github.com/FreshRSS/FreshRSS/pull/2745#discussion_r362207445

* $username is also needed further down

* No new line in syslog
2020-01-03 18:50:33 +01:00
Alexandre Alapetite
802c264574 Copy syslog to STDERR (#2208)
* Use openlog before syslog
In order to have a copy on stderr when syslog is not available.

* Take advantage of syslog for actualization
Pipe cron job STDERR and syslog to Docker log
Cf. 00bd467655
2019-01-06 00:46:48 +01:00
Alexandre Alapetite
a6623b7b2f Apache performance (#2202)
* Apache performance
API: Use SetEnvIf if available and fallback to RewriteRule
Docker: Disable unused modules.
Docker: Hard-include .htaccess to avoid having to scan for changes in
that file.
Docker: Disable security check of symlinks, which we do not use ayway.

* Apache readme

* Docker/Apache tuning
Run cron job with correct www-data user instead of root
Remove PHP GMP module uneeded for 64-bit Docker image
Add option to mount custom .htaccess for HTTP authentication
Re-add Apache module for HTTP authentication
Move Alpine-specific instructions to Docker file (instead of Apache
conf) to make it easier to have other base images than Alpine
2019-01-02 21:36:33 +01:00
Alexandre Alapetite
f6dda14d1f Message when PHP is not installed (#2035)
* Message when PHP is not installed

* or configured correctly
2018-09-29 23:20:33 +02:00
Frans de Jonge
469d601bcb [doc] Editing for better style (#1736)
* Also removed references to Persona authentication.
* Changed code comment about Persona because it's for HTTP auth
  in general. See 3d876091e1
  and https://github.com/FreshRSS/FreshRSS/issues/358#issuecomment-31931484
2017-12-22 12:02:06 +01:00
Alexandre Alapetite
52d0988655 Use __DIR__ for relative include and require
For uniformity, and to avoid having PHP searching in include_path.
http://php.net/manual/function.include.php
https://github.com/FreshRSS/FreshRSS/pull/1715
https://github.com/FreshRSS/FreshRSS/pull/1711#issuecomment-350581350
2017-12-11 21:11:34 +01:00
Marien Fressinaud
51a71ec4b9 New configuration system (not working yet)
- Use only Minz_Configuration
- register() method to load a new configuration file
- get() to get a configuration
- new exceptions related to configuration
- fix a list configuration calls to have FRSS working

Current problems to resolve:

- How to handle configuration param verifications (i.e. check auth_type
  is a value from none, http_auth, persona or form)
- We must use $conf = Minz_Configuration::get('system'); $general_conf = $conf->general;
  to access global system configuration which is quite annoying. How to change that?

See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-05 16:54:16 +01:00
Marien Fressinaud
c391ca62f1 Remove all old references to LOG_PATH
See https://github.com/FreshRSS/FreshRSS/issues/729
2014-12-28 18:05:02 +01:00
Marien Fressinaud
d8f4681382 Replace Minz_Log::record by corresponding methods
Please not use Minz_Log::record anymore!

See https://github.com/marienfressinaud/FreshRSS/issues/655
2014-10-05 19:35:29 +02:00
Alexandre Alapetite
3674a7a764 gitignore /p/i/.htaccess
This can be the place of a user's .htaccess, for instance for HTTP
password control.
2014-08-11 21:26:57 +02:00
Alexandre Alapetite
8a5050289e New install logic
Now the install.php is kept in ./app/ and the trigger is
./data/do-install.php
There is no need anymore to have write access in ./p/i/
2014-07-03 21:20:11 +02:00
Marien Fressinaud
8c132b2acd Fix theme paths for install.php 2014-06-13 18:14:44 +02:00
Nicolas ELIE
6aadb7e59a Username regexp is too strict
Username can contains more characters that the regexp allows. For example, on a raspberry pi, the default user for web server is 'www-data'.
2014-05-09 09:53:46 +02:00
Alexandre Alapetite
c8aa451c76 Minz: remove url_rewriting
As suggested
https://github.com/marienfressinaud/FreshRSS/issues/163#issuecomment-38478669

At the same time, removes a bunch of (almost) dead code such as
Minz_Router (the few remaining lines being moved to Minz_FrontController
to avoid a class)

Contributes to https://github.com/marienfressinaud/FreshRSS/issues/303
2014-03-24 20:55:18 +01:00
Alexandre Alapetite
fd829d7567 Constant to enable PHP compression
https://github.com/marienfressinaud/FreshRSS/issues/303#issuecomment-38477994
2014-03-24 19:16:09 +01:00
Alexandre Alapetite
b07f9157b1 New unsafe autologin mode
https://github.com/marienfressinaud/FreshRSS/issues/440
2014-03-02 13:35:09 +01:00
Alexandre Alapetite
db120b4ed4 Test si crypt() fonctionne pour PHP 5.3.3
https://github.com/marienfressinaud/FreshRSS/issues/432
2014-02-23 12:16:23 +01:00
Alexandre Alapetite
f2a8a516aa Requiert PHP 5.3.4 pour l'authentification par formulaire
https://github.com/marienfressinaud/FreshRSS/issues/432
En attendant de voir si on peut trouver une meilleure solution, si
nécessaire, ou une meilleure documentation
2014-02-23 11:52:37 +01:00
Marien Fressinaud
ccc8c415f3 Style install.php: add alert-warn class to update message 2014-02-15 14:46:13 +01:00
Alexandre Alapetite
0cabd1f50d Mutex par flux pour les actualisations
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/351
Nouvelle constante TMP_PATH comme répertoire pour stocker des fichiers
temporaires (si possible en mémoire et non sur disque, tel tmpfs pour
/tmp sur certaines distributions Linux)
Requiert PHP 5.2.1+ (contre 5.2.0 auparavant) pour le
`sys_get_temp_dir()`
2014-02-11 21:48:10 +01:00
Alexandre Alapetite
18403d9720 SQL : Supprime c.color
Implémente décision
https://github.com/marienfressinaud/FreshRSS/issues/295
Install.php pourrait peut-être être mis à jour pour supprimer
automatiquement la colonne, mais ce n'est pas fait dans ce patch.
2014-02-11 15:30:52 +01:00
Alexandre Alapetite
311ea6f52f Meilleure mise à jour avec les favicons
Implémente
https://github.com/marienfressinaud/FreshRSS/issues/327#issuecomment-33329115
2014-01-26 22:32:30 +01:00
Alexandre Alapetite
3fd1e051a7 Compatibilité PHP 5.4-
https://github.com/marienfressinaud/FreshRSS/issues/327#issuecomment-33328377
2014-01-26 21:09:47 +01:00
Marien Fressinaud
9de7165919 Infos mise à jour plus verbeux et déplacés
Un message explicite indique la fin de la mise à jour. Le message a été
déplacé au-dessus de la zone des boutons.
Voir #377
2014-01-25 12:47:39 +01:00
Alexandre Alapetite
4985e457eb N'affiche <option></option> que lorsque nécessaire
Corrige https://github.com/marienfressinaud/FreshRSS/issues/372
2014-01-23 18:03:44 +01:00
Alexandre Alapetite
5f0594c630 Désactive l'identification par formulaire en dessous de PHP 5.3
PHP 5.3 est sorti en juin 2009.
https://github.com/ircmaxell/password_compat
Pour plus de tranquillité (compatibilité et sécurité), il faudrait même
désactiver en dessous de PHP 5.3.7 (août 2011)
2014-01-18 21:26:33 +01:00
Alexandre Alapetite
fb908d4557 Corrige rafraîchissement automatique après mise-à-jour avec Persona ou formulaire
Corrige
https://github.com/marienfressinaud/FreshRSS/issues/327#issuecomment-31958851
2014-01-18 00:34:46 +01:00
Alexandre Alapetite
781d8a717f Choix du type de connexion dans l'installeur
+ diverses corrections dans l'installeur
Adresse une partie de
https://github.com/marienfressinaud/FreshRSS/issues/355
2014-01-18 00:17:03 +01:00
Alexandre Alapetite
3d9d054f43 Mise à jour des noms des thèmes dans install
Corrige
https://github.com/marienfressinaud/FreshRSS/issues/327#issuecomment-32630046
(Pas encore testé)
2014-01-17 22:12:26 +01:00
Alexandre Alapetite
73682777a3 Install.php Mise à jour nom du thème "Origine"
https://github.com/marienfressinaud/FreshRSS/issues/120
2014-01-13 23:38:02 +01:00
Alexandre Alapetite
3d876091e1 Nouveau rafraîchissement automatique du nombre d'articles non lus + session Persona
Devrait aussi résoudre
https://github.com/marienfressinaud/FreshRSS/issues/358
À tester
2014-01-09 23:17:35 +01:00
Alexandre Alapetite
70c6ba903d Meilleure mise-à-jour avec Persona depuis v0.6 vers v0.7
https://github.com/marienfressinaud/FreshRSS/issues/347
* Conserve l'information sur l'utilisation de Persona lors d'une mise à
jour depuis v0.6 vers v0.7.
* Idem pour la lecture anonyme
* Les droits sur le répertoire persona sont testés
* Les tokens ne sont pas migrés ni testés pour l'instant
https://github.com/marienfressinaud/FreshRSS/issues/327
2014-01-05 21:55:15 +01:00
Alexandre Alapetite
eb8c4d21af install.php : stripslashes pour migration depuis v0.6
https://github.com/marienfressinaud/FreshRSS/issues/299
2014-01-05 20:42:19 +01:00
Alexandre Alapetite
79d88a2d5b Corrige problème cookie avec IE en utilisant un chemin absolu
Corrige https://github.com/marienfressinaud/FreshRSS/issues/345
@marienfressinaud Il faudrait peut-être le ré-écrire un peu mieux en
utilisant base_url de la configuration de FreshRSS, mais je n'ai pas
trop suivi comment était généré et utilisée cette variable. Qu'en dis-tu
?
2014-01-05 01:14:01 +01:00
Alexandre Alapetite
bad052f590 Messages d'erreur dans install 2014-01-04 15:53:06 +01:00
Alexandre Alapetite
e38b3a9c1b Petits changements install 2014-01-04 14:34:01 +01:00
Alexandre Alapetite
a08201c414 SQL : Insère la catégorie par défaut dès la création des tables 2014-01-01 15:08:15 +01:00
Alexandre Alapetite
5c9a32329a Multi-utilisateur fonctionnel avec Mozilla Persona
Il faut ré-enregistrer l'adresse courriel une fois dans l'interface de
FreshRSS pour créer le fichier nécessaire.
+ Comparaison sans tenir compte de la casse pour les noms d'utilisateur.
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
ll faudra tester la sécurité
2013-12-31 14:52:01 +01:00
Alexandre Alapetite
1ac09e7fe4 Multi-utilisateur fonctionnel en HTTP Auth
+ Possibilité d'ajout / suppression d'utilisateur (seulement par
l'administrateur)
+ Divers changements pour le mode multi-utilisateur
https://github.com/marienfressinaud/FreshRSS/issues/126
+ Minz : Renomme "sel_application" en "salt'
2013-12-31 02:59:07 +01:00
Alexandre Alapetite
84be5ff618 Champs utilisateurs plus stricts + SQL réutilisable
Utilisation de input pattern (HTML5).
Évite l'écriture de fichiers tableaux à la main (préfère var_export qui
s'occupe aussi des caractères spéciaux).
Séparation des requêtes SQL réutilisables.
2013-12-30 21:29:51 +01:00
Alexandre Alapetite
bd5d7a7bcb Cache HTTP compatible multi-utilisateur
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126
2013-12-30 15:00:41 +01:00
Alexandre Alapetite
3cc073f2d1 Log compatible multi-utilisateur
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126.
Il faudra restaurer la gestion du cache HTTP pour les logs
2013-12-30 12:39:21 +01:00
Alexandre Alapetite
92efd68a3a Début de mode multi-utilisateur avec http_auth
+ Légère optimisation de Minz_View.
+ Encore plus de tests de bibliothèques dans install.php
Contribue à https://github.com/marienfressinaud/FreshRSS/issues/126 et
https://github.com/marienfressinaud/FreshRSS/issues/303
2013-12-30 01:03:32 +01:00
Alexandre Alapetite
45b2decce0 HTTP Auth user
https://github.com/marienfressinaud/FreshRSS/issues/126
2013-12-28 01:24:54 +01:00
Alexandre Alapetite
badc60910a Petites corrections et sortie 0.7-beta3 2013-12-27 15:16:53 +01:00
Alexandre Alapetite
ab3cc9be56 Install.php petites corrections
Évite des problèmes de droits lorsque config.php et *_user.php existent
déjà
Adresse des styles mise à jour
2013-12-27 13:02:16 +01:00
Alexandre Alapetite
f8b8dc7a23 Mise à jour possible depuis v0.7-beta[1-2] + correction message
+ Correction message lorsqu'on clique sur "enregistrer" un flux où rien
n'a changé et qui disait qu'une erreur était survenue alors que
simplement rien n'avait changé
2013-12-27 12:30:57 +01:00
Alexandre Alapetite
58300c36ad Cookie : sous-répertoire pour index (changements de répertoires !)
Implémente https://github.com/marienfressinaud/FreshRSS/issues/333
/public/ est renommé /p/
/public/index.php est déplacé dans /p/i/index.php
Le cookie de session est limité à /p/i/
2013-12-26 01:56:58 +01:00