Remove automatic software update from the user interface

- This process is not considered safe
- This feature might leads to potential security flaws
- Miniflux focus on minimalism
This commit is contained in:
Frederic Guillot 2016-12-26 10:16:04 -05:00
parent 82df35a59b
commit c8234cc3c3
29 changed files with 3 additions and 340 deletions

View File

@ -6,6 +6,7 @@ Version 1.2.0 (unreleased)
* New config parameter to disable web access for the cronjob * New config parameter to disable web access for the cronjob
* Debug mode parameter is moved to the config file * Debug mode parameter is moved to the config file
* The console web page have been removed * The console web page have been removed
* Remove automatic software update from the user interface
* New API methods (not backward compatible) * New API methods (not backward compatible)
* Fever API tokens are longer than before * Fever API tokens are longer than before
* Add support for Wallabag service * Add support for Wallabag service

View File

@ -28,8 +28,7 @@ Features
- Keeps history of read items - Keeps history of read items
- Import/Export of OPML feeds - Import/Export of OPML feeds
- Themes - Themes
- Auto-update from the user interface - Multiple users
- Multiple databases (each user has his own database)
- Image proxy to avoid mixed content warnings with HTTPS - Image proxy to avoid mixed content warnings with HTTPS
Requirements Requirements

View File

@ -26,11 +26,6 @@ defined('PROXY_PORT') or define('PROXY_PORT', 3128);
defined('PROXY_USERNAME') or define('PROXY_USERNAME', ''); defined('PROXY_USERNAME') or define('PROXY_USERNAME', '');
defined('PROXY_PASSWORD') or define('PROXY_PASSWORD', ''); defined('PROXY_PASSWORD') or define('PROXY_PASSWORD', '');
defined('ENABLE_AUTO_UPDATE') or define('ENABLE_AUTO_UPDATE', true);
defined('AUTO_UPDATE_DOWNLOAD_DIRECTORY') or define('AUTO_UPDATE_DOWNLOAD_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'download');
defined('AUTO_UPDATE_ARCHIVE_DIRECTORY') or define('AUTO_UPDATE_ARCHIVE_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'archive');
defined('AUTO_UPDATE_BACKUP_DIRECTORY') or define('AUTO_UPDATE_BACKUP_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'backup');
defined('SUBSCRIPTION_CONCURRENT_REQUESTS') or define('SUBSCRIPTION_CONCURRENT_REQUESTS', 5); defined('SUBSCRIPTION_CONCURRENT_REQUESTS') or define('SUBSCRIPTION_CONCURRENT_REQUESTS', 5);
defined('RULES_DIRECTORY') or define('RULES_DIRECTORY', ROOT_DIRECTORY.DIRECTORY_SEPARATOR.'rules'); defined('RULES_DIRECTORY') or define('RULES_DIRECTORY', ROOT_DIRECTORY.DIRECTORY_SEPARATOR.'rules');

View File

@ -11,27 +11,6 @@ use Miniflux\Template;
use Miniflux\Helper; use Miniflux\Helper;
use Miniflux\Model; use Miniflux\Model;
// Confirmation box before auto-update
Router\get_action('confirm-auto-update', function () {
Response\html(Template\layout('confirm_auto_update', array(
'menu' => 'config',
'title' => t('Confirmation')
)));
});
// Auto-update
Router\get_action('auto-update', function () {
if (ENABLE_AUTO_UPDATE) {
if (Model\AutoUpdate\execute(Helper\config('auto_update_url'))) {
SessionStorage::getInstance()->setFlashMessage(t('Miniflux is updated!'));
} else {
SessionStorage::getInstance()->setFlashErrorMessage(t('Unable to update Miniflux, check the console for errors.'));
}
}
Response\redirect('?action=config');
});
// Re-generate tokens // Re-generate tokens
Router\get_action('generate-tokens', function () { Router\get_action('generate-tokens', function () {
$user_id = SessionStorage::getInstance()->getUserId(); $user_id = SessionStorage::getInstance()->getUserId();

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => 'قبل %d شهر', '%d month ago' => 'قبل %d شهر',
'Timezone' => ':المنطقة الزمنية', 'Timezone' => ':المنطقة الزمنية',
'Update all subscriptions' => 'تحديث كل الإشتراكات', 'Update all subscriptions' => 'تحديث كل الإشتراكات',
'Auto-Update URL' => ':تحديث تلقائي للميني فلكس من الرابط',
'Update Miniflux' => 'تحديث برنامج Miniflux',
'Miniflux is updated!' => 'بنجاح! Miniflux تمت عملية تحديث برنامج',
'Don\'t forget to backup your database' => 'لاتنسى إنشاء نسخة إحتياطية من قاعدة البيانات', 'Don\'t forget to backup your database' => 'لاتنسى إنشاء نسخة إحتياطية من قاعدة البيانات',
'The name must have only alpha-numeric characters' => 'يجب إدخال أحرف أو أرقام فقط', 'The name must have only alpha-numeric characters' => 'يجب إدخال أحرف أو أرقام فقط',
'New database' => 'إنشاء قاعدة بيانات جديده', 'New database' => 'إنشاء قاعدة بيانات جديده',
@ -197,7 +194,6 @@ return array(
'help' => 'مساعدة', 'help' => 'مساعدة',
'api' => 'api', 'api' => 'api',
'about' => 'حول البرنامج', 'about' => 'حول البرنامج',
'This action will update Miniflux with the last development version, are you sure?' => 'سيتم إستبدال هذه النسخة من برنامج ميني فلكس بأحدث نسخه ... هل أنت متأكد من انك تريد ذلك؟ ?',
'database' => 'قاعدة البيانات', 'database' => 'قاعدة البيانات',
'Miniflux API' => 'Miniflux API', 'Miniflux API' => 'Miniflux API',
'menu' => 'قائمة', 'menu' => 'قائمة',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => array('před měsícem', 'před %d měsíci', 'před %d měsíci'), '%d month ago' => array('před měsícem', 'před %d měsíci', 'před %d měsíci'),
'Timezone' => 'Časová zóna', 'Timezone' => 'Časová zóna',
'Update all subscriptions' => 'Aktualizovat všechny odběry', 'Update all subscriptions' => 'Aktualizovat všechny odběry',
'Auto-Update URL' => 'URL automatické aktualizace',
'Update Miniflux' => 'Aktualizovat Miniflux',
'Miniflux is updated!' => 'Miniflux je aktualizovaný!',
'Don\'t forget to backup your database' => 'Nezapomeňte zálohovat vaši databázi', 'Don\'t forget to backup your database' => 'Nezapomeňte zálohovat vaši databázi',
'The name must have only alpha-numeric characters' => 'Jméno smí obsahovat pouze písmena a číslice', 'The name must have only alpha-numeric characters' => 'Jméno smí obsahovat pouze písmena a číslice',
'New database' => 'Nová databáze', 'New database' => 'Nová databáze',
@ -197,7 +194,6 @@ return array(
'help' => 'nápověda', 'help' => 'nápověda',
'api' => 'api', 'api' => 'api',
'about' => 'o', 'about' => 'o',
'This action will update Miniflux with the last development version, are you sure?' => 'Tato akce aktualizuje Miniflux na poslední vývojovou verzi. Jste si jistí?',
'database' => 'databáze', 'database' => 'databáze',
'Miniflux API' => 'Miniflux API', 'Miniflux API' => 'Miniflux API',
'menu' => 'nabídka', 'menu' => 'nabídka',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => array('Vor %d Monat', 'Vor %d Monaten'), '%d month ago' => array('Vor %d Monat', 'Vor %d Monaten'),
'Timezone' => 'Zeitzone', 'Timezone' => 'Zeitzone',
'Update all subscriptions' => 'Alle Abonnements aktualisieren', 'Update all subscriptions' => 'Alle Abonnements aktualisieren',
'Auto-Update URL' => 'Auto-Update URL',
'Update Miniflux' => 'Miniflux aktualisieren',
'Miniflux is updated!' => 'Miniflux wurde erfolgreich aktualisiert!',
'Don\'t forget to backup your database' => 'Vergiss nicht, die Datenbank zu sichern', 'Don\'t forget to backup your database' => 'Vergiss nicht, die Datenbank zu sichern',
'The name must have only alpha-numeric characters' => 'Der Name darf nur alphanumerische Zeichen enthalten', 'The name must have only alpha-numeric characters' => 'Der Name darf nur alphanumerische Zeichen enthalten',
'New database' => 'Neue Datenbank', 'New database' => 'Neue Datenbank',
@ -197,7 +194,6 @@ return array(
'help' => 'Hilfe', 'help' => 'Hilfe',
'api' => 'api', 'api' => 'api',
'about' => 'über', 'about' => 'über',
'This action will update Miniflux with the last development version, are you sure?' => 'Miniflux wird auf die aktuelle Entwicklungsversion aktualisiert. Bist du sicher?',
'database' => 'Datenbank', 'database' => 'Datenbank',
'Miniflux API' => 'Miniflux API', 'Miniflux API' => 'Miniflux API',
'menu' => 'Menü', 'menu' => 'Menü',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => array('hace %d mes', 'hace %d meses'), '%d month ago' => array('hace %d mes', 'hace %d meses'),
'Timezone' => 'Zona horaria', 'Timezone' => 'Zona horaria',
'Update all subscriptions' => 'Actualizar todas las subscripciones', 'Update all subscriptions' => 'Actualizar todas las subscripciones',
'Auto-Update URL' => 'Actualizar automáticamente la URL',
'Update Miniflux' => 'Actualizar Miniflux',
'Miniflux is updated!' => 'Miniflux esta actualizado',
'Don\'t forget to backup your database' => 'No olvides de hacer una copia de seguridad de la base de datos', 'Don\'t forget to backup your database' => 'No olvides de hacer una copia de seguridad de la base de datos',
'The name must have only alpha-numeric characters' => 'El nombre sólo puede contener caractéres alfanuméricos', 'The name must have only alpha-numeric characters' => 'El nombre sólo puede contener caractéres alfanuméricos',
'New database' => 'Nueva base de datos', 'New database' => 'Nueva base de datos',
@ -197,7 +194,6 @@ return array(
'help' => 'ayuda', 'help' => 'ayuda',
'api' => 'api', 'api' => 'api',
'about' => 'acerca de', 'about' => 'acerca de',
'This action will update Miniflux with the last development version, are you sure?' => 'Esta acción actualizará Miniflux a la última versión de desarrollo, ¿está seguro?',
'database' => 'base de datos', 'database' => 'base de datos',
'Miniflux API' => 'API Miniflux', 'Miniflux API' => 'API Miniflux',
'menu' => 'menú', 'menu' => 'menú',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => 'Il y a %d mois', '%d month ago' => 'Il y a %d mois',
'Timezone' => 'Fuseau horaire', 'Timezone' => 'Fuseau horaire',
'Update all subscriptions' => 'Mettre à jour tous les abonnements', 'Update all subscriptions' => 'Mettre à jour tous les abonnements',
'Auto-Update URL' => 'URL de mise à jour automatique',
'Update Miniflux' => 'Mettre à jour Miniflux',
'Miniflux is updated!' => 'Miniflux a été mis à jour avec succès !',
'Don\'t forget to backup your database' => 'N\'oubliez pas de sauvegarder votre base de données', 'Don\'t forget to backup your database' => 'N\'oubliez pas de sauvegarder votre base de données',
'The name must have only alpha-numeric characters' => 'Le nom doit avoir seulement des caractères alphanumériques', 'The name must have only alpha-numeric characters' => 'Le nom doit avoir seulement des caractères alphanumériques',
'New database' => 'Nouvelle base de données', 'New database' => 'Nouvelle base de données',
@ -197,7 +194,6 @@ return array(
'help' => 'aide', 'help' => 'aide',
'api' => 'api', 'api' => 'api',
'about' => 'a propos', 'about' => 'a propos',
'This action will update Miniflux with the last development version, are you sure?' => 'Cette action va mettre à jour Miniflux avec la dernière version en cours de développement, êtes-vous certain ?',
'database' => 'base de données', 'database' => 'base de données',
'Miniflux API' => 'Miniflux API', 'Miniflux API' => 'Miniflux API',
'menu' => 'menu', 'menu' => 'menu',

View File

@ -154,9 +154,6 @@ return array(
// '%d month ago' => '', // '%d month ago' => '',
// 'Timezone' => '', // 'Timezone' => '',
// 'Update all subscriptions' => '', // 'Update all subscriptions' => '',
// 'Auto-Update URL' => '',
// 'Update Miniflux' => '',
// 'Miniflux is updated!' => '',
// 'Don\'t forget to backup your database' => '', // 'Don\'t forget to backup your database' => '',
// 'The name must have only alpha-numeric characters' => '', // 'The name must have only alpha-numeric characters' => '',
// 'New database' => '', // 'New database' => '',
@ -197,7 +194,6 @@ return array(
// 'help' => '', // 'help' => '',
// 'api' => '', // 'api' => '',
// 'about' => '', // 'about' => '',
// 'This action will update Miniflux with the last development version, are you sure?' => '',
// 'database' => '', // 'database' => '',
// 'Miniflux API' => '', // 'Miniflux API' => '',
// 'menu' => '', // 'menu' => '',

View File

@ -156,9 +156,6 @@ return array(
'%d month ago' => '%dヶ月前', '%d month ago' => '%dヶ月前',
'Timezone' => 'タイムゾーン', 'Timezone' => 'タイムゾーン',
'Update all subscriptions' => 'すべての購読を更新', 'Update all subscriptions' => 'すべての購読を更新',
'Auto-Update URL' => '自動更新のURL',
'Update Miniflux' => 'Minifluxを更新',
'Miniflux is updated!' => 'Minifluxは更新されました',
'Don\'t forget to backup your database' => 'データベースのバックアップを忘れないで下さい', 'Don\'t forget to backup your database' => 'データベースのバックアップを忘れないで下さい',
'The name must have only alpha-numeric characters' => '名前には英数字のみを使用することが出来ます', 'The name must have only alpha-numeric characters' => '名前には英数字のみを使用することが出来ます',
'New database' => '新しいデータベース', 'New database' => '新しいデータベース',
@ -199,7 +196,6 @@ return array(
'help' => 'ヘルプ', 'help' => 'ヘルプ',
'api' => 'API', 'api' => 'API',
'about' => 'Minifluxについて', 'about' => 'Minifluxについて',
'This action will update Miniflux with the last development version, are you sure?' => '最新の開発バージョンでMinifluxを更新します。よろしいですか',
'database' => 'データベース', 'database' => 'データベース',
'Miniflux API' => 'Miniflux API', 'Miniflux API' => 'Miniflux API',
'menu' => 'メニュー', 'menu' => 'メニュー',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => array('%d mês atrás', '%d meses atrás'), '%d month ago' => array('%d mês atrás', '%d meses atrás'),
'Timezone' => 'Fuso horário', 'Timezone' => 'Fuso horário',
'Update all subscriptions' => 'Atualizar todas as assinaturas', 'Update all subscriptions' => 'Atualizar todas as assinaturas',
'Auto-Update URL' => 'URL de atualização automática',
'Update Miniflux' => 'Atualizar Miniflux',
'Miniflux is updated!' => 'Miniflux foi atualizado!',
'Don\'t forget to backup your database' => 'Não esqueça de fazer backup de seu banco de dados', 'Don\'t forget to backup your database' => 'Não esqueça de fazer backup de seu banco de dados',
'The name must have only alpha-numeric characters' => 'O nome deve conter apenas caracteres alfa-numéricos', 'The name must have only alpha-numeric characters' => 'O nome deve conter apenas caracteres alfa-numéricos',
'New database' => 'Novo banco de dados', 'New database' => 'Novo banco de dados',
@ -197,7 +194,6 @@ return array(
'help' => 'ajuda', 'help' => 'ajuda',
'api' => 'api', 'api' => 'api',
'about' => 'sobre', 'about' => 'sobre',
'This action will update Miniflux with the last development version, are you sure?' => 'Esta ação irá atualizar o Miniflux com a última versão de desenvolvimento, você tem certeza?',
'database' => 'banco de dados', 'database' => 'banco de dados',
'Miniflux API' => 'API do Miniflux', 'Miniflux API' => 'API do Miniflux',
'menu' => 'menu', 'menu' => 'menu',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => array('%d месяц назад', '%d месяца назад', '%d месяцев назад'), '%d month ago' => array('%d месяц назад', '%d месяца назад', '%d месяцев назад'),
'Timezone' => 'Временная зона', 'Timezone' => 'Временная зона',
'Update all subscriptions' => 'Обновить все подписки', 'Update all subscriptions' => 'Обновить все подписки',
'Auto-Update URL' => 'URL автоматического обновления',
'Update Miniflux' => 'Обновить Miniflux',
'Miniflux is updated!' => 'Miniflux обновлен!',
'Don\'t forget to backup your database' => 'Не забудьте предварительно сделать резервную копию базы данных', 'Don\'t forget to backup your database' => 'Не забудьте предварительно сделать резервную копию базы данных',
'The name must have only alpha-numeric characters' => 'Название должно состоять только из алфавитно-цифровых символов', 'The name must have only alpha-numeric characters' => 'Название должно состоять только из алфавитно-цифровых символов',
'New database' => 'Новая база данных', 'New database' => 'Новая база данных',
@ -197,7 +194,6 @@ return array(
'help' => 'помощь', 'help' => 'помощь',
'api' => 'api', 'api' => 'api',
'about' => 'о программе', 'about' => 'о программе',
'This action will update Miniflux with the last development version, are you sure?' => 'Это действие обновит Miniflux до последней разрабатываемой версии, вы уверены?',
'database' => 'база данных', 'database' => 'база данных',
'Miniflux API' => 'Miniflux API', 'Miniflux API' => 'Miniflux API',
'menu' => 'меню', 'menu' => 'меню',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => array('Пре %d месец', 'Пре %d месеца', 'Пре %d месеци'), '%d month ago' => array('Пре %d месец', 'Пре %d месеца', 'Пре %d месеци'),
'Timezone' => 'Временска зона', 'Timezone' => 'Временска зона',
'Update all subscriptions' => 'Ажурирај све претплате', 'Update all subscriptions' => 'Ажурирај све претплате',
'Auto-Update URL' => 'УРЛ за аутоматско ажурирање',
'Update Miniflux' => 'Ажурирај Минифлукс',
'Miniflux is updated!' => 'Минифлукс је успешно ажуриран !',
'Don\'t forget to backup your database' => 'Не заборавите да бекапујете базу података', 'Don\'t forget to backup your database' => 'Не заборавите да бекапујете базу података',
'The name must have only alpha-numeric characters' => 'Име може садржати само бројеве или слова', 'The name must have only alpha-numeric characters' => 'Име може садржати само бројеве или слова',
'New database' => 'Нова база података', 'New database' => 'Нова база података',
@ -197,7 +194,6 @@ return array(
'help' => 'помоћ', 'help' => 'помоћ',
'api' => 'апи', 'api' => 'апи',
'about' => 'о програму', 'about' => 'о програму',
'This action will update Miniflux with the last development version, are you sure?' => 'Ова акција ће ажурирати Минифлукс на најновију развојну верију, да ли сте сигурни?',
'database' => 'база података', 'database' => 'база података',
'Miniflux API' => 'АПИ Минифлукса', 'Miniflux API' => 'АПИ Минифлукса',
'menu' => 'мени', 'menu' => 'мени',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => array('Pre %d mesec', 'Pre %d meseca', 'Pre %d meseci'), '%d month ago' => array('Pre %d mesec', 'Pre %d meseca', 'Pre %d meseci'),
'Timezone' => 'Vremenska zona', 'Timezone' => 'Vremenska zona',
'Update all subscriptions' => 'Ažuriraj sve pretplate', 'Update all subscriptions' => 'Ažuriraj sve pretplate',
'Auto-Update URL' => 'URL za automatsko ažuriranje',
'Update Miniflux' => 'Ažuriraj Miniflux',
'Miniflux is updated!' => 'Miniflux je uspešno ažuriran !',
'Don\'t forget to backup your database' => 'Ne zaboravite da bekapujete bazu podataka', 'Don\'t forget to backup your database' => 'Ne zaboravite da bekapujete bazu podataka',
'The name must have only alpha-numeric characters' => 'Ime može sadržati samo brojeve ili slova', 'The name must have only alpha-numeric characters' => 'Ime može sadržati samo brojeve ili slova',
'New database' => 'Nova baza podataka', 'New database' => 'Nova baza podataka',
@ -197,7 +194,6 @@ return array(
'help' => 'pomoć', 'help' => 'pomoć',
'api' => 'api', 'api' => 'api',
'about' => 'o programu', 'about' => 'o programu',
'This action will update Miniflux with the last development version, are you sure?' => 'Ova akcija će ažurirati Miniflux na najnoviju razvojnu veriju, da li ste sigurni?',
'database' => 'baza podataka', 'database' => 'baza podataka',
'Miniflux API' => 'API Minifluxa', 'Miniflux API' => 'API Minifluxa',
'menu' => 'meni', 'menu' => 'meni',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => '%d ay önce', '%d month ago' => '%d ay önce',
'Timezone' => 'Zaman dilimi', 'Timezone' => 'Zaman dilimi',
'Update all subscriptions' => 'Tüm abonelikleri güncelle', 'Update all subscriptions' => 'Tüm abonelikleri güncelle',
'Auto-Update URL' => 'Otomatik güncelleme bağlantısı',
'Update Miniflux' => 'Miniflux\'ı Güncelle',
'Miniflux is updated!' => 'Miniflux güncellendi!',
'Don\'t forget to backup your database' => 'Veritabanınızı yedeklemeyi unutmayın', 'Don\'t forget to backup your database' => 'Veritabanınızı yedeklemeyi unutmayın',
'The name must have only alpha-numeric characters' => 'İsim yalnızca alfanümerik karakterler içermeli', 'The name must have only alpha-numeric characters' => 'İsim yalnızca alfanümerik karakterler içermeli',
'New database' => 'Yeni veritabanı', 'New database' => 'Yeni veritabanı',
@ -197,7 +194,6 @@ return array(
'help' => 'yardım', 'help' => 'yardım',
'api' => 'api', 'api' => 'api',
'about' => 'hakkında', 'about' => 'hakkında',
'This action will update Miniflux with the last development version, are you sure?' => 'Bu işlem Miniflux\'u en son yayınlanan geliştirme sürümüne güncelleyecektir, emin misiniz?',
'database' => 'veritabanı', 'database' => 'veritabanı',
'Miniflux API' => 'Miniflux API', 'Miniflux API' => 'Miniflux API',
'menu' => 'menü', 'menu' => 'menü',

View File

@ -154,9 +154,6 @@ return array(
'%d month ago' => '%d月前', '%d month ago' => '%d月前',
'Timezone' => '时区', 'Timezone' => '时区',
'Update all subscriptions' => '更新所有的订阅', 'Update all subscriptions' => '更新所有的订阅',
'Auto-Update URL' => '自动更新URL',
'Update Miniflux' => '更新Miniflux',
'Miniflux is updated!' => 'Miniflux已被更新',
'Don\'t forget to backup your database' => '不要忘记备份你的数据库', 'Don\'t forget to backup your database' => '不要忘记备份你的数据库',
'The name must have only alpha-numeric characters' => '名字只能包含字母和数字', 'The name must have only alpha-numeric characters' => '名字只能包含字母和数字',
'New database' => '新数据库', 'New database' => '新数据库',
@ -197,7 +194,6 @@ return array(
'help' => '帮助', 'help' => '帮助',
'api' => '接口', 'api' => '接口',
'about' => '关于', 'about' => '关于',
'This action will update Miniflux with the last development version, are you sure?' => '这个操作将更新Miniflux到最新的开发版你确认吗',
'database' => '数据库', 'database' => '数据库',
'Miniflux API' => 'Miniflux API', 'Miniflux API' => 'Miniflux API',
'menu' => '菜单', 'menu' => '菜单',

View File

@ -1,221 +0,0 @@
<?php
namespace Miniflux\Model\AutoUpdate;
use ZipArchive;
use DirectoryIterator;
use RecursiveIteratorIterator;
use RecursiveDirectoryIterator;
use Miniflux\Model\Config;
// Get all files of a given directory
function get_files_list($directory)
{
$exclude_list = array(
'.git',
'data',
'scripts',
'config.php',
'rules',
);
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory), RecursiveIteratorIterator::SELF_FIRST);
$files = array();
while ($it->valid()) {
if ($it->isFile() && ! is_excluded_path($it->getSubPathname(), $exclude_list)) {
$files[] = $it->getSubPathname();
}
$it->next();
}
return $files;
}
// Check if the given path is excluded
function is_excluded_path($path, array $exclude_list)
{
foreach ($exclude_list as $excluded_path) {
if (strpos($path, $excluded_path) === 0) {
return true;
}
}
return false;
}
// Synchronize 2 directories (copy/remove files)
function synchronize($source_directory, $destination_directory)
{
$src_files = get_files_list($source_directory);
$dst_files = get_files_list($destination_directory);
// Remove files
$remove_files = array_diff($dst_files, $src_files);
foreach ($remove_files as $file) {
if ($file !== '.htaccess') {
$destination_file = $destination_directory.DIRECTORY_SEPARATOR.$file;
if (! @unlink($destination_file)) {
return false;
}
}
}
// Overwrite all files
foreach ($src_files as $file) {
$directory = $destination_directory.DIRECTORY_SEPARATOR.dirname($file);
if (! is_dir($directory)) {
if (! @mkdir($directory, 0755, true)) {
return false;
}
}
$source_file = $source_directory.DIRECTORY_SEPARATOR.$file;
$destination_file = $destination_directory.DIRECTORY_SEPARATOR.$file;
if (! @copy($source_file, $destination_file)) {
return false;
}
}
return true;
}
// Download and unzip the archive
function uncompress_archive($url, $download_directory = AUTO_UPDATE_DOWNLOAD_DIRECTORY, $archive_directory = AUTO_UPDATE_ARCHIVE_DIRECTORY)
{
$archive_file = $download_directory.DIRECTORY_SEPARATOR.'update.zip';
if (($data = @file_get_contents($url)) === false) {
return false;
}
if (@file_put_contents($archive_file, $data) === false) {
return false;
}
$zip = new ZipArchive;
if (! $zip->open($archive_file)) {
return false;
}
$zip->extractTo($archive_directory);
$zip->close();
return true;
}
// Remove all files for a given directory
function cleanup_directory($directory)
{
$dir = new DirectoryIterator($directory);
foreach ($dir as $fileinfo) {
if (! $fileinfo->isDot()) {
$filename = $fileinfo->getRealPath();
if ($fileinfo->isFile()) {
@unlink($filename);
} else {
cleanup_directory($filename);
@rmdir($filename);
}
}
}
}
// Cleanup all temporary directories
function cleanup_directories()
{
cleanup_directory(AUTO_UPDATE_DOWNLOAD_DIRECTORY);
cleanup_directory(AUTO_UPDATE_ARCHIVE_DIRECTORY);
cleanup_directory(AUTO_UPDATE_BACKUP_DIRECTORY);
}
// Find the archive directory name
function find_archive_root($base_directory = AUTO_UPDATE_ARCHIVE_DIRECTORY)
{
$directory = '';
$dir = new DirectoryIterator($base_directory);
foreach ($dir as $fileinfo) {
if (! $fileinfo->isDot() && $fileinfo->isDir()) {
$directory = $fileinfo->getFilename();
break;
}
}
if (empty($directory)) {
return false;
}
return $base_directory.DIRECTORY_SEPARATOR.$directory;
}
// Check if everything is setup correctly
function check_setup()
{
if (! class_exists('ZipArchive')) {
die('To use this feature, your PHP installation must be able to uncompress zip files!');
}
if (AUTO_UPDATE_DOWNLOAD_DIRECTORY === '') {
die('The constant AUTO_UPDATE_DOWNLOAD_DIRECTORY is not set!');
}
if (AUTO_UPDATE_ARCHIVE_DIRECTORY === '') {
die('The constant AUTO_UPDATE_ARCHIVE_DIRECTORY is not set!');
}
if (AUTO_UPDATE_DOWNLOAD_DIRECTORY === '') {
die('The constant AUTO_UPDATE_DOWNLOAD_DIRECTORY is not set!');
}
if (! is_dir(AUTO_UPDATE_DOWNLOAD_DIRECTORY)) {
@mkdir(AUTO_UPDATE_DOWNLOAD_DIRECTORY, 0755);
}
if (! is_dir(AUTO_UPDATE_ARCHIVE_DIRECTORY)) {
@mkdir(AUTO_UPDATE_ARCHIVE_DIRECTORY, 0755);
}
if (! is_dir(AUTO_UPDATE_BACKUP_DIRECTORY)) {
@mkdir(AUTO_UPDATE_BACKUP_DIRECTORY, 0755);
}
if (! is_writable(AUTO_UPDATE_DOWNLOAD_DIRECTORY)) {
die('Update directories must be writable by your web server user!');
}
if (! is_writable(__DIR__)) {
die('Source files must be writable by your web server user!');
}
}
// Update the source code
function execute($url)
{
check_setup();
cleanup_directories();
if (uncompress_archive($url)) {
$update_directory = find_archive_root();
if ($update_directory) {
// Backup first
if (synchronize(ROOT_DIRECTORY, AUTO_UPDATE_BACKUP_DIRECTORY)) {
// Update
if (synchronize($update_directory, ROOT_DIRECTORY)) {
cleanup_directories();
return true;
} else {
// If update failed, rollback
synchronize(AUTO_UPDATE_BACKUP_DIRECTORY, ROOT_DIRECTORY);
}
}
}
}
return false;
}

View File

@ -29,11 +29,6 @@
<?php echo Miniflux\Helper\form_label(t('Theme'), 'theme') ?> <?php echo Miniflux\Helper\form_label(t('Theme'), 'theme') ?>
<?php echo Miniflux\Helper\form_select('theme', $theme_options, $values, $errors) ?><br/> <?php echo Miniflux\Helper\form_select('theme', $theme_options, $values, $errors) ?><br/>
<?php if (ENABLE_AUTO_UPDATE): ?>
<?php echo Miniflux\Helper\form_label(t('Auto-Update URL'), 'auto_update_url') ?>
<?php echo Miniflux\Helper\form_text('auto_update_url', $values, $errors) ?><br/>
<?php endif ?>
<?php echo Miniflux\Helper\form_checkbox('image_proxy', t('Enable image proxy'), 1, isset($values['image_proxy']) && $values['image_proxy'] == 1) ?> <?php echo Miniflux\Helper\form_checkbox('image_proxy', t('Enable image proxy'), 1, isset($values['image_proxy']) && $values['image_proxy'] == 1) ?>
<div class="form-help"><?php echo t('Avoid mixed content warnings with HTTPS') ?></div> <div class="form-help"><?php echo t('Avoid mixed content warnings with HTTPS') ?></div>
</div> </div>
@ -81,8 +76,5 @@
<section class="panel panel-danger"> <section class="panel panel-danger">
<ul> <ul>
<li><a href="?action=generate-tokens&amp;csrf=<?php echo $values['csrf'] ?>"><?php echo t('Generate new tokens') ?></a> (<?php echo t('Miniflux API') ?>, <?php echo t('Fever API') ?>, <?php echo t('Bookmarklet') ?>, <?php echo t('Bookmark RSS Feed') ?>)</li> <li><a href="?action=generate-tokens&amp;csrf=<?php echo $values['csrf'] ?>"><?php echo t('Generate new tokens') ?></a> (<?php echo t('Miniflux API') ?>, <?php echo t('Fever API') ?>, <?php echo t('Bookmarklet') ?>, <?php echo t('Bookmark RSS Feed') ?>)</li>
<?php if (ENABLE_AUTO_UPDATE): ?>
<li><a href="?action=confirm-auto-update"><?php echo t('Update Miniflux') ?></a> (<?php echo t('Don\'t forget to backup your database') ?>)</li>
<?php endif ?>
</ul> </ul>
</section> </section>

View File

@ -1,10 +0,0 @@
<div class="page-header">
<h2><?php echo t('Confirmation') ?></h2>
</div>
<p class="alert alert-info"><?php echo t('This action will update Miniflux with the last development version, are you sure?') ?></p>
<div class="form-actions">
<a href="?action=auto-update" class="btn btn-red"><?php echo t('Update Miniflux') ?></a>
<?php echo t('or') ?> <a href="?action=config"><?php echo t('cancel') ?></a>
</div>

View File

@ -53,7 +53,6 @@
"app/models/item_feed.php", "app/models/item_feed.php",
"app/models/item_group.php", "app/models/item_group.php",
"app/models/bookmark.php", "app/models/bookmark.php",
"app/models/auto_update.php",
"app/models/remember_me.php", "app/models/remember_me.php",
"app/models/group.php", "app/models/group.php",
"app/models/favicon.php", "app/models/favicon.php",

View File

@ -42,9 +42,6 @@ define('PROXY_USERNAME', '');
// PROXY_PASSWORD => default is empty // PROXY_PASSWORD => default is empty
define('PROXY_PASSWORD', ''); define('PROXY_PASSWORD', '');
// ENABLE_AUTO_UPDATE => default is true (enable Miniflux update from the user interface)
define('ENABLE_AUTO_UPDATE', true);
// SUBSCRIPTION_CONCURRENT_REQUESTS => number of concurrent feeds to refresh at once // SUBSCRIPTION_CONCURRENT_REQUESTS => number of concurrent feeds to refresh at once
// Reduce this number on systems with limited processing power // Reduce this number on systems with limited processing power
define('SUBSCRIPTION_CONCURRENT_REQUESTS', 5); define('SUBSCRIPTION_CONCURRENT_REQUESTS', 5);

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View File

@ -56,9 +56,6 @@ define('PROXY_USERNAME', '');
// PROXY_PASSWORD => default is empty // PROXY_PASSWORD => default is empty
define('PROXY_PASSWORD', ''); define('PROXY_PASSWORD', '');
// ENABLE_AUTO_UPDATE => default is true (enable Miniflux update from the user interface)
define('ENABLE_AUTO_UPDATE', true);
// SUBSCRIPTION_CONCURRENT_REQUESTS => number of concurrent feeds to refresh at once // SUBSCRIPTION_CONCURRENT_REQUESTS => number of concurrent feeds to refresh at once
// Reduce this number on systems with limited processing power // Reduce this number on systems with limited processing power
define('SUBSCRIPTION_CONCURRENT_REQUESTS', 5); define('SUBSCRIPTION_CONCURRENT_REQUESTS', 5);

View File

@ -81,6 +81,7 @@ function copy_settings(PDO $db, $user_id, array $settings)
'feed_token', 'feed_token',
'fever_token', 'fever_token',
'debug_mode', 'debug_mode',
'auto_update_url',
); );
$rq = $db->prepare('INSERT INTO user_settings ("user_id", "key", "value") VALUES (?, ?, ?)'); $rq = $db->prepare('INSERT INTO user_settings ("user_id", "key", "value") VALUES (?, ?, ?)');

View File

@ -34,7 +34,6 @@ return array(
'c0f7d31e45ab3b885f3f3567be6b8cda' => $baseDir . '/app/models/item_feed.php', 'c0f7d31e45ab3b885f3f3567be6b8cda' => $baseDir . '/app/models/item_feed.php',
'c9e2906d32a129f63c98d210037c227b' => $baseDir . '/app/models/item_group.php', 'c9e2906d32a129f63c98d210037c227b' => $baseDir . '/app/models/item_group.php',
'546998ee103e300ad614144f30a1de8e' => $baseDir . '/app/models/bookmark.php', '546998ee103e300ad614144f30a1de8e' => $baseDir . '/app/models/bookmark.php',
'd06207bd4580f7e9250cf39d0d648fc5' => $baseDir . '/app/models/auto_update.php',
'ee585b658e324609d721bc6f959e85c8' => $baseDir . '/app/models/remember_me.php', 'ee585b658e324609d721bc6f959e85c8' => $baseDir . '/app/models/remember_me.php',
'fc49fda782025f9f73852265b1fa7760' => $baseDir . '/app/models/group.php', 'fc49fda782025f9f73852265b1fa7760' => $baseDir . '/app/models/group.php',
'785cebb801997d40232b8337459f1606' => $baseDir . '/app/models/favicon.php', '785cebb801997d40232b8337459f1606' => $baseDir . '/app/models/favicon.php',

View File

@ -35,7 +35,6 @@ class ComposerStaticInitfd7e8d436e1dc450edc3153ac8bc31b4
'c0f7d31e45ab3b885f3f3567be6b8cda' => __DIR__ . '/../..' . '/app/models/item_feed.php', 'c0f7d31e45ab3b885f3f3567be6b8cda' => __DIR__ . '/../..' . '/app/models/item_feed.php',
'c9e2906d32a129f63c98d210037c227b' => __DIR__ . '/../..' . '/app/models/item_group.php', 'c9e2906d32a129f63c98d210037c227b' => __DIR__ . '/../..' . '/app/models/item_group.php',
'546998ee103e300ad614144f30a1de8e' => __DIR__ . '/../..' . '/app/models/bookmark.php', '546998ee103e300ad614144f30a1de8e' => __DIR__ . '/../..' . '/app/models/bookmark.php',
'd06207bd4580f7e9250cf39d0d648fc5' => __DIR__ . '/../..' . '/app/models/auto_update.php',
'ee585b658e324609d721bc6f959e85c8' => __DIR__ . '/../..' . '/app/models/remember_me.php', 'ee585b658e324609d721bc6f959e85c8' => __DIR__ . '/../..' . '/app/models/remember_me.php',
'fc49fda782025f9f73852265b1fa7760' => __DIR__ . '/../..' . '/app/models/group.php', 'fc49fda782025f9f73852265b1fa7760' => __DIR__ . '/../..' . '/app/models/group.php',
'785cebb801997d40232b8337459f1606' => __DIR__ . '/../..' . '/app/models/favicon.php', '785cebb801997d40232b8337459f1606' => __DIR__ . '/../..' . '/app/models/favicon.php',