diff --git a/CHANGELOG b/CHANGELOG
index d50c3ff65..9a9abff4b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,109 @@
+Version 2021.03 (unreleased)
+
+Version 2021.01 (2021-01-04)
+ Friendica Core
+ Added HU translation
+ Updates to the translations: DE, IT, RU [translation teams]
+ Updates to the themes (duepuntozero, frio, vier) [annando, MrPetovan, tobiasd, vinzv]
+ General Code cleanup [annando, MrPetovan, nupplaphil]
+ Enhanced the handling of permission sets [annando]
+ Enhanced the usage of system resources when displaying photos and updating contacts [annando]
+ Enhanced the database structure [annando, Quix0r]
+ Enhanced the detection of PeerTube servers [annando]
+ Enhanced the photo cache [annando]
+ Enhanced the import of old postings which would otherwise not be imported due their age [annando]
+ Enhanced the delivery process of ActivityPub content [annando]
+ Enhanced the performance profiler [annando]
+ Enhanced the background worker [annando]
+ Enhanced the handling of blocked authors [MrPetovan]
+ Enhanced the user management in the admin panel [MrPetovan]
+ Enhanced the process of expiring postings [annando]
+ Enhanced the un/follow process of contacts [annando]
+ Enhanced the handling of HTTP requests [nupplaphil]
+ Enhanced filter possibilities of contacts [annando]
+ Enhanced language detection of postings [annando]
+ Enhanced the admin panel [MrPetovan, tobiasd]
+ Enhanced the contact suggestions [annando]
+ Enhanced the community page (filter, tags) [annando]
+ Enhanced the display of the reason why a posting is displayed in a stream [annando]
+ Enhanced the forum delivery of postings [redmatrix]
+ Enhanced PHP8 compatibility [annando]
+ Enhanced the worker_cooldown mechanism [annando]
+ Added new options to the remote_self feature [annando]
+ Added API endpoints for accounts and trends [annando]
+ Added API endpoints for re-sharing of postings [annando]
+ Added provider fields to the API [annando]
+ Added the possibility to map $_SERVER variables during installation [nupplaphil]
+ Added the possibility to filter account types on the network page [annando]
+ Added missing Mastodon API endpoints as "unsupported" [annando]
+ Added a watchdog mode to check if the daemon is running [annando]
+ Added number of group members to the contact widget [annando]
+ Added endless scrolling in several places [annando]
+ Added an option to stay local when clicking on a contact profile [annando]
+ Added support of ActivityPub relays [annando]
+ Model\User::getAuthenticationInfo is now available for addons [MrPetovan]
+ Contact details can only edited for mail and feed contacts [annando]
+ Fixed some problems during the export of user data [annando]
+ Fixed various problems with the notification system [MrPetovan]
+ Fixed a problem with emoticon alt-text interpretation [MrPetovan]
+ Fixed a problem that caused comments on Tweets being distributed via ActivityPub [annando]
+ Fixed a problem with the auto-completion when composing comments [MrPetovan]
+ Fixed an ACL problem while poking contacts [MrPetovan]
+ Fixed a problem with Mastodon emoticons [MrPetovan]
+ Fixed a parser problem that caused additional tags [annando]
+ Fixed escaping of several HTML snippets [MrPetovan]
+ Fixed a problem with fetching objects by URL [annando]
+
+ Friendica Addons
+ Updated to the translations IT, HU [translation teams]
+ advancedcontentfilter:
+ Added examples [hoergen]
+ blackout:
+ Improved the wording in the admin interface [urbalazs]
+ catavatar:
+ Improved the generation of avatars [annando]
+ ifttt:
+ Added support for delayed postings [annando]
+ mailstream:
+ Improved code structure [nupplaphil]
+ Fix case-sensitive check by [nupplaphil]
+ markdown:
+ Improved parsing [MrPetovan]
+ newmemberwidget:
+ Improved addon description [SpencerDub]
+ langfilter:
+ Changed the input to use a slider [MrPetovan]
+ ldapauth:
+ Reworked the authentication code [MrPetovan]
+ libravatar:
+ Fixed a problem with DNS requests [annando]
+ Improved the list of available avatars [annando]
+ phpmailer:
+ Fixed UTF8 encoding problems [MrPetovan]
+ rendertime:
+ Added more information about the "other" things that cost time [annando]
+ showmore:
+ Improved handling of the HTML structure of postings [MrPetovan]
+ showmore_dyn:
+ Improved user settings, language [MrPetovan]
+ twitter:
+ Improved logging [annando]
+ Improved the twitter_post_hook [MrPetovan]
+ Improved the posts send to twitter [annando]
+ Improved the remote_self functionality [annando]
+ Added support for delayed postings [annando]
+ Fixed a bug with direct re-shares [MrPetovan]
+
+ Closed Issues
+ 2803, 4230, 4486, 4494, 5616, 7393, 7697, 8485, 8533, 8605, 8689,
+ 8796, 8896, 8943, 8950, 9042, 9089, 9127, 9142, 9165, 9235, 9236,
+ 9238, 9249, 9264, 9268, 9276, 9281, 9291, 9296, 9305, 9306, 9315,
+ 9326, 9328, 9329, 9337, 9344, 9348, 9363, 9383, 9385, 9407, 9427,
+ 9430, 9432, 9457, 9461, 9464, 9465, 9480, 9486, 9496, 9508, 9518,
+ 9525, 9538, 9549, 9564, 9568, 9573, 9598, 9611, 9622, 9629, 9630,
+ 9633, 9636, 9639, 9641, 9642, 9662, 9672, 9673, 9678, 9682, 9692,
+ 9712
+
Version 2020.09-1 (2020-09-24)
Friendica Core:
Updates to the translations: RU [translation teams]
diff --git a/CREDITS.txt b/CREDITS.txt
index 07d6ecb2f..2f6897054 100644
--- a/CREDITS.txt
+++ b/CREDITS.txt
@@ -35,6 +35,7 @@ Athalbert
aweiher
axelt
balderino
+Balázs Úr
Beanow
beardyunixer
Beatriz Vital
@@ -133,6 +134,7 @@ julia.domagalska
Julio Cova
Karel
Karolina
+Kastal András
Keenan Pepper
Keith Fernie
Klaus Weidenbach
@@ -144,11 +146,11 @@ Leberwurscht
Leonard Lausen
Lionel Triay
loma-one
+loma1
Lorem Ipsum
Ludovic Grossard
Lynn Stephenson
maase2
-Magdalena Gazda
Mai Anh Nguyen
Manuel Pérez Monís
Marcin Klessa
@@ -157,7 +159,6 @@ Marcus Müller
Marie Olive
Mariusz Pisz
marmor
-Marquis_de_Carabas
Martin Schmitt
Mateusz Mikos
Mats Sjöberg
@@ -177,6 +178,7 @@ mpanhans
mytbk
nathilia-peirce
Nicola Spanti
+nobody
Olaf Conradi
Oliver
Olivier
@@ -225,7 +227,6 @@ Samuli Valavuo
Sandro Santilli
Sebastian Egbers
sella
-Sennewood
Seth
Silke Meyer
Simon L'nu
@@ -242,7 +243,6 @@ Sveinn í Felli
Sven Anders
Sylke Vicious
Sylvain Lagacé
-szymon.filip
Sérgio Lima
Taekus
Tazman DeVille
diff --git a/VERSION b/VERSION
index 04d17e893..50ccf18a2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2020.12-rc
+2021.03-dev
diff --git a/bin/daemon.php b/bin/daemon.php
index ec507305c..fcdd73566 100755
--- a/bin/daemon.php
+++ b/bin/daemon.php
@@ -223,6 +223,11 @@ while (true) {
$sleep = min(1000000, round(log10($arg) * 1000000, 0));
usleep($sleep);
+ $pid = pcntl_waitpid(-1, $status, WNOHANG);
+ if ($pid > 0) {
+ Logger::info('Children quit via pcntl_waitpid', ['pid' => $pid, 'status' => $status]);
+ }
+
$timeout = ($seconds >= $wait_interval);
} while (!$timeout && !Worker::IPCJobsExists());
diff --git a/boot.php b/boot.php
index 504f997d9..1c5b4c168 100644
--- a/boot.php
+++ b/boot.php
@@ -38,7 +38,7 @@ use Friendica\Util\DateTimeFormat;
define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Red Hot Poker');
-define('FRIENDICA_VERSION', '2020.12-rc');
+define('FRIENDICA_VERSION', '2021.03-dev');
define('DFRN_PROTOCOL_VERSION', '2.23');
define('NEW_UPDATE_ROUTINE_VERSION', 1170);
diff --git a/doc/img/editor_frio.png b/doc/img/editor_frio.png
index d37081b83..d969f261b 100644
Binary files a/doc/img/editor_frio.png and b/doc/img/editor_frio.png differ
diff --git a/doc/img/editor_vier.png b/doc/img/editor_vier.png
index 5278b0ff1..7ffac7fc7 100644
Binary files a/doc/img/editor_vier.png and b/doc/img/editor_vier.png differ
diff --git a/doc/img/vier_icons.png b/doc/img/vier_icons.png
index 4dc8ae03f..b880e9562 100644
Binary files a/doc/img/vier_icons.png and b/doc/img/vier_icons.png differ
diff --git a/images/article.gif b/images/article.gif
index 91aeef000..af9de9345 100644
Binary files a/images/article.gif and b/images/article.gif differ
diff --git a/images/b_drop.gif b/images/b_drop.gif
index b08c68b62..5834b5d29 100644
Binary files a/images/b_drop.gif and b/images/b_drop.gif differ
diff --git a/images/b_dropshow.gif b/images/b_dropshow.gif
index b08c68b62..5834b5d29 100644
Binary files a/images/b_dropshow.gif and b/images/b_dropshow.gif differ
diff --git a/images/beer_mug.gif b/images/beer_mug.gif
index 9a3e05192..10b53e47b 100644
Binary files a/images/beer_mug.gif and b/images/beer_mug.gif differ
diff --git a/images/camera-icon.gif b/images/camera-icon.gif
index a4adf9adf..2943aa095 100644
Binary files a/images/camera-icon.gif and b/images/camera-icon.gif differ
diff --git a/images/discourse.png b/images/discourse.png
index 6c9ce4667..c51e26d0c 100644
Binary files a/images/discourse.png and b/images/discourse.png differ
diff --git a/images/friendica-404_svg_flexy-o-hare.png b/images/friendica-404_svg_flexy-o-hare.png
index 36d6b5ca3..8ba689d53 100644
Binary files a/images/friendica-404_svg_flexy-o-hare.png and b/images/friendica-404_svg_flexy-o-hare.png differ
diff --git a/images/friendica-404_svg_hare-bottom-light-inside.png b/images/friendica-404_svg_hare-bottom-light-inside.png
index 6c9189e4e..f32e11340 100644
Binary files a/images/friendica-404_svg_hare-bottom-light-inside.png and b/images/friendica-404_svg_hare-bottom-light-inside.png differ
diff --git a/images/friendica.svg b/images/friendica.svg
index 2105ef317..45820959d 100644
--- a/images/friendica.svg
+++ b/images/friendica.svg
@@ -1,240 +1 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/images/globe.gif b/images/globe.gif
index 3f17c5d32..84722efa5 100644
Binary files a/images/globe.gif and b/images/globe.gif differ
diff --git a/images/humane-tech-badge.svg b/images/humane-tech-badge.svg
index 51a28d87d..699942271 100644
--- a/images/humane-tech-badge.svg
+++ b/images/humane-tech-badge.svg
@@ -1,57 +1 @@
-
-
+
\ No newline at end of file
diff --git a/images/larrw.gif b/images/larrw.gif
index 08902d772..6076876a6 100644
Binary files a/images/larrw.gif and b/images/larrw.gif differ
diff --git a/images/link-icon.gif b/images/link-icon.gif
index c012d716e..f238c63bf 100644
Binary files a/images/link-icon.gif and b/images/link-icon.gif differ
diff --git a/images/lock_icon.gif b/images/lock_icon.gif
index b6b1b7fed..44a7d0500 100644
Binary files a/images/lock_icon.gif and b/images/lock_icon.gif differ
diff --git a/images/pause.gif b/images/pause.gif
index dc57c4c98..7006e9856 100644
Binary files a/images/pause.gif and b/images/pause.gif differ
diff --git a/images/person-300.jpg b/images/person-300.jpg
index 817308211..41803623d 100644
Binary files a/images/person-300.jpg and b/images/person-300.jpg differ
diff --git a/images/play.gif b/images/play.gif
index 4010f056d..c5ae628b5 100644
Binary files a/images/play.gif and b/images/play.gif differ
diff --git a/images/rarrw.gif b/images/rarrw.gif
index 849238c2d..bf26b8a8b 100644
Binary files a/images/rarrw.gif and b/images/rarrw.gif differ
diff --git a/images/rotator.gif b/images/rotator.gif
index 3797ec3e4..6e8181ee9 100644
Binary files a/images/rotator.gif and b/images/rotator.gif differ
diff --git a/images/smiley-Oo.gif b/images/smiley-Oo.gif
index a15d97427..27d2690fc 100644
Binary files a/images/smiley-Oo.gif and b/images/smiley-Oo.gif differ
diff --git a/images/smiley-bangheaddesk.gif b/images/smiley-bangheaddesk.gif
index 91ccb8bb4..c28440296 100644
Binary files a/images/smiley-bangheaddesk.gif and b/images/smiley-bangheaddesk.gif differ
diff --git a/images/smiley-brokenheart.gif b/images/smiley-brokenheart.gif
index 971b57fd9..f511db3e4 100644
Binary files a/images/smiley-brokenheart.gif and b/images/smiley-brokenheart.gif differ
diff --git a/images/smiley-heart.gif b/images/smiley-heart.gif
index 6a11e7065..8891901cf 100644
Binary files a/images/smiley-heart.gif and b/images/smiley-heart.gif differ
diff --git a/images/smiley-shaka.gif b/images/smiley-shaka.gif
index 336fe3bcd..030aeccad 100644
Binary files a/images/smiley-shaka.gif and b/images/smiley-shaka.gif differ
diff --git a/images/spencil.gif b/images/spencil.gif
index 0a2551ac0..515e6b02d 100644
Binary files a/images/spencil.gif and b/images/spencil.gif differ
diff --git a/images/unlock_icon.gif b/images/unlock_icon.gif
index 254ac8bfd..9487b44e3 100644
Binary files a/images/unlock_icon.gif and b/images/unlock_icon.gif differ
diff --git a/images/youtube_icon.gif b/images/youtube_icon.gif
index 987b82bfd..11a0a982c 100644
Binary files a/images/youtube_icon.gif and b/images/youtube_icon.gif differ
diff --git a/spec/dfrn2_contact_confirmation.svg b/spec/dfrn2_contact_confirmation.svg
index fc5b33162..81268509d 100644
--- a/spec/dfrn2_contact_confirmation.svg
+++ b/spec/dfrn2_contact_confirmation.svg
@@ -1,162 +1 @@
-
-
-
+
\ No newline at end of file
diff --git a/spec/dfrn2_contact_request.svg b/spec/dfrn2_contact_request.svg
index d32718271..9b75acd5d 100644
--- a/spec/dfrn2_contact_request.svg
+++ b/spec/dfrn2_contact_request.svg
@@ -1,218 +1 @@
-
-
-
+
\ No newline at end of file
diff --git a/src/Core/Process.php b/src/Core/Process.php
index 919d37dea..447d312d4 100644
--- a/src/Core/Process.php
+++ b/src/Core/Process.php
@@ -77,6 +77,17 @@ class Process
$this->pid = $pid;
}
+ /**
+ * Set the process id
+ *
+ * @param integer $pid
+ * @return void
+ */
+ public function setPid(int $pid)
+ {
+ $this->pid = $pid;
+ }
+
/**
* Log active processes into the "process" table
*/
diff --git a/src/Core/Worker.php b/src/Core/Worker.php
index a0e444642..56c62451b 100644
--- a/src/Core/Worker.php
+++ b/src/Core/Worker.php
@@ -50,6 +50,7 @@ class Worker
private static $lock_duration = 0;
private static $last_update;
private static $state;
+ private static $daemon_mode = null;
/**
* Processes the tasks that are in the workerqueue table
@@ -96,6 +97,10 @@ class Worker
// We fetch the next queue entry that is about to be executed
while ($r = self::workerProcess()) {
+ if (self::IPCJobsExists(getmypid())) {
+ self::IPCDeleteJobState(getmypid());
+ }
+
// Don't refetch when a worker fetches tasks for multiple workers
$refetched = DI::config()->get('system', 'worker_multiple_fetch');
foreach ($r as $entry) {
@@ -146,13 +151,17 @@ class Worker
if (time() > ($starttime + (DI::config()->get('system', 'cron_interval') * 60))) {
Logger::info('Process lifetime reached, respawning.');
self::unclaimProcess();
- self::spawnWorker();
+ if (self::isDaemonMode()) {
+ self::IPCSetJobState(true);
+ } else {
+ self::spawnWorker();
+ }
return;
}
}
// Cleaning up. Possibly not needed, but it doesn't harm anything.
- if (DI::config()->get('system', 'worker_daemon_mode', false)) {
+ if (self::isDaemonMode()) {
self::IPCSetJobState(false);
}
Logger::info("Couldn't select a workerqueue entry, quitting process", ['pid' => getmypid()]);
@@ -190,7 +199,7 @@ class Worker
Logger::warning('Maximum processes reached, quitting.');
return false;
}
-
+
return true;
}
@@ -412,6 +421,12 @@ class Worker
{
$a = DI::app();
+ $cooldown = DI::config()->get("system", "worker_cooldown", 0);
+ if ($cooldown > 0) {
+ Logger::info('Pre execution cooldown.', ['priority' => $queue["priority"], 'id' => $queue["id"], 'cooldown' => $cooldown]);
+ sleep($cooldown);
+ }
+
Logger::enableWorker($funcname);
Logger::info("Process start.", ['priority' => $queue["priority"], 'id' => $queue["id"]]);
@@ -484,10 +499,8 @@ class Worker
DI::profiler()->saveLog(DI::logger(), "ID " . $queue["id"] . ": " . $funcname);
- $cooldown = DI::config()->get("system", "worker_cooldown", 0);
-
if ($cooldown > 0) {
- Logger::info('Cooldown.', ['priority' => $queue["priority"], 'id' => $queue["id"], 'cooldown' => $cooldown]);
+ Logger::info('Post execution cooldown.', ['priority' => $queue["priority"], 'id' => $queue["id"], 'cooldown' => $cooldown]);
sleep($cooldown);
}
}
@@ -771,7 +784,7 @@ class Worker
// Are there fewer workers running as possible? Then fork a new one.
if (!DI::config()->get("system", "worker_dont_fork", false) && ($queues > ($active + 1)) && self::entriesExists()) {
Logger::info("There are fewer workers as possible, fork a new worker.", ['active' => $active, 'queues' => $queues]);
- if (DI::config()->get('system', 'worker_daemon_mode', false)) {
+ if (self::isDaemonMode()) {
self::IPCSetJobState(true);
} else {
self::spawnWorker();
@@ -780,7 +793,7 @@ class Worker
}
// if there are too much worker, we don't spawn a new one.
- if (DI::config()->get('system', 'worker_daemon_mode', false) && ($active > $queues)) {
+ if (self::isDaemonMode() && ($active > $queues)) {
self::IPCSetJobState(false);
}
@@ -1100,6 +1113,11 @@ class Worker
*/
private static function forkProcess(bool $do_cron)
{
+ if (DI::process()->isMinMemoryReached()) {
+ Logger::warning('Memory limit reached - quitting');
+ return;
+ }
+
// Children inherit their parent's database connection.
// To avoid problems we disconnect and connect both parent and child
DBA::disconnect();
@@ -1111,22 +1129,40 @@ class Worker
} elseif ($pid) {
// The parent process continues here
DBA::connect();
- Logger::info('Spawned new worker', ['cron' => $do_cron, 'pid' => $pid]);
+
+ self::IPCSetJobState(true, $pid);
+ Logger::info('Spawned new worker', ['pid' => $pid]);
+
+ $cycles = 0;
+ while (self::IPCJobsExists($pid) && (++$cycles < 100)) {
+ usleep(10000);
+ }
+
+ Logger::info('Spawned worker is ready', ['pid' => $pid, 'wait_cycles' => $cycles]);
return;
}
-
- // We now are in the new worker
- DBA::connect();
- Logger::info('Worker spawned', ['cron' => $do_cron, 'pid' => getmypid()]);
- DI::process()->start();
+ // We now are in the new worker
+ $pid = getmypid();
+
+ DBA::connect();
+ /// @todo Reinitialize the logger to set a new process_id and uid
+ DI::process()->setPid($pid);
+
+ $cycles = 0;
+ while (!self::IPCJobsExists($pid) && (++$cycles < 100)) {
+ usleep(10000);
+ }
+
+ Logger::info('Worker spawned', ['pid' => $pid, 'wait_cycles' => $cycles]);
self::processQueue($do_cron);
self::unclaimProcess();
+ self::IPCSetJobState(false, $pid);
DI::process()->end();
- Logger::info('Worker ended', ['cron' => $do_cron, 'pid' => getmypid()]);
+ Logger::info('Worker ended', ['pid' => $pid]);
exit();
}
@@ -1139,18 +1175,14 @@ class Worker
*/
public static function spawnWorker($do_cron = false)
{
- // Worker and daemon are started from the command line.
- // This means that this is executed by a PHP interpreter without runtime limitations
- if (function_exists('pcntl_fork') && in_array(DI::mode()->getExecutor(), [Mode::DAEMON, Mode::WORKER])) {
+ if (self::isDaemonMode() && DI::config()->get('system', 'worker_fork')) {
self::forkProcess($do_cron);
} else {
$process = new Core\Process(DI::logger(), DI::mode(), DI::config(),
DI::modelProcess(), DI::app()->getBasePath(), getmypid());
$process->run('bin/worker.php', ['no_cron' => !$do_cron]);
}
-
- // after spawning we have to remove the flag.
- if (DI::config()->get('system', 'worker_daemon_mode', false)) {
+ if (self::isDaemonMode()) {
self::IPCSetJobState(false);
}
}
@@ -1242,7 +1274,7 @@ class Worker
}
// Set the IPC flag to ensure an immediate process execution via daemon
- if (DI::config()->get('system', 'worker_daemon_mode', false)) {
+ if (self::isDaemonMode()) {
self::IPCSetJobState(true);
}
@@ -1267,7 +1299,7 @@ class Worker
}
// Quit on daemon mode
- if (DI::config()->get('system', 'worker_daemon_mode', false)) {
+ if (self::isDaemonMode()) {
return $added;
}
@@ -1361,12 +1393,27 @@ class Worker
* Set the flag if some job is waiting
*
* @param boolean $jobs Is there a waiting job?
+ * @param int $key Key number
* @throws \Exception
*/
- public static function IPCSetJobState($jobs)
+ public static function IPCSetJobState(bool $jobs, int $key = 0)
{
$stamp = (float)microtime(true);
- DBA::update('worker-ipc', ['jobs' => $jobs], ['key' => 1], true);
+ DBA::replace('worker-ipc', ['jobs' => $jobs, 'key' => $key]);
+ self::$db_duration += (microtime(true) - $stamp);
+ self::$db_duration_write += (microtime(true) - $stamp);
+ }
+
+ /**
+ * Delete a key entry
+ *
+ * @param int $key Key number
+ * @throws \Exception
+ */
+ public static function IPCDeleteJobState(int $key)
+ {
+ $stamp = (float)microtime(true);
+ DBA::delete('worker-ipc', ['key' => $key]);
self::$db_duration += (microtime(true) - $stamp);
self::$db_duration_write += (microtime(true) - $stamp);
}
@@ -1374,13 +1421,14 @@ class Worker
/**
* Checks if some worker job waits to be executed
*
+ * @param int $key Key number
* @return bool
* @throws \Exception
*/
- public static function IPCJobsExists()
+ public static function IPCJobsExists(int $key = 0)
{
$stamp = (float)microtime(true);
- $row = DBA::selectFirst('worker-ipc', ['jobs'], ['key' => 1]);
+ $row = DBA::selectFirst('worker-ipc', ['jobs'], ['key' => $key]);
self::$db_duration += (microtime(true) - $stamp);
// When we don't have a row, no job is running
@@ -1391,6 +1439,51 @@ class Worker
return (bool)$row['jobs'];
}
+ /**
+ * Checks if the worker is running in the daemon mode.
+ *
+ * @return boolean
+ */
+ public static function isDaemonMode()
+ {
+ if (!is_null(self::$daemon_mode)) {
+ return self::$daemon_mode;
+ }
+
+ if (DI::mode()->getExecutor() == Mode::DAEMON) {
+ return true;
+ }
+
+ $daemon_mode = DI::config()->get('system', 'worker_daemon_mode', false, true);
+ if ($daemon_mode) {
+ return $daemon_mode;
+ }
+
+ if (!function_exists('pcntl_fork')) {
+ self::$daemon_mode = false;
+ return false;
+ }
+
+ $pidfile = DI::config()->get('system', 'pidfile');
+ if (empty($pidfile)) {
+ // No pid file, no daemon
+ self::$daemon_mode = false;
+ return false;
+ }
+
+ if (!is_readable($pidfile)) {
+ // No pid file. We assume that the daemon had been intentionally stopped.
+ self::$daemon_mode = false;
+ return false;
+ }
+
+ $pid = intval(file_get_contents($pidfile));
+ $running = posix_kill($pid, 0);
+
+ self::$daemon_mode = $running;
+ return $running;
+ }
+
/**
* Test if the daemon is running. If not, it will be started
*
diff --git a/src/Model/User.php b/src/Model/User.php
index 6960c5c2c..dbace74e5 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -1159,6 +1159,9 @@ class User
return false;
}
+ // Delete the avatar
+ Photo::delete(['uid' => $register['uid']]);
+
return DBA::delete('user', ['uid' => $register['uid']]) &&
Register::deleteByHash($register['hash']);
}
diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php
index 1901766d3..acb5132af 100644
--- a/src/Worker/Cron.php
+++ b/src/Worker/Cron.php
@@ -24,6 +24,7 @@ namespace Friendica\Worker;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Worker;
+use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Tag;
@@ -54,6 +55,10 @@ class Cron
copy($basepath . '/.htaccess-dist', $basepath . '/.htaccess');
}
+ if (DI::config()->get('system', 'delete_sleeping_processes')) {
+ self::deleteSleepingProcesses();
+ }
+
// Fork the cron jobs in separate parts to avoid problems when one of them is crashing
Hook::fork(PRIORITY_MEDIUM, 'cron');
@@ -137,4 +142,25 @@ class Cron
DI::config()->set('system', 'last_cron', time());
}
+
+ /**
+ * Kill sleeping database processes
+ *
+ * @return void
+ */
+ private static function deleteSleepingProcesses()
+ {
+ Logger::info('Looking for sleeping processes');
+
+ $processes = DBA::p("SHOW FULL PROCESSLIST");
+ while ($process = DBA::fetch($processes)) {
+ if (($process['Command'] != 'Sleep') || ($process['Time'] < 300) || ($process['db'] != DBA::databaseName())) {
+ continue;
+ }
+
+ DBA::e("KILL ?", $process['Id']);
+ Logger::notice('Killed sleeping process', ['id' => $process['Id']]);
+ }
+ DBA::close($processes);
+ }
}
diff --git a/static/defaults.config.php b/static/defaults.config.php
index c3102e388..e11e4c5c8 100644
--- a/static/defaults.config.php
+++ b/static/defaults.config.php
@@ -194,6 +194,10 @@ return [
// If it is not running and hadn't been terminated normally, it will be started automatically.
'daemon_watchdog' => false,
+ // delete_sleeping_processes (Boolean)
+ // Periodically delete waiting database processes.
+ 'delete_sleeping_processes' => false,
+
// diaspora_test (Boolean)
// For development only. Disables the message transfer.
'diaspora_test' => false,
@@ -534,6 +538,11 @@ return [
// Number of worker tasks that are fetched in a single query.
'worker_fetch_limit' => 1,
+ // worker_fork (Boolean)
+ // Experimental setting. Use pcntl_fork to spawn a new worker process.
+ // Does not work when "worker_multiple_fetch" is enabled (Needs more testing)
+ 'worker_fork' => false,
+
// worker_jpm (Boolean)
// If enabled, it prints out the jobs per minute.
'worker_jpm' => false,
@@ -551,6 +560,7 @@ return [
// worker_multiple_fetch (Boolean)
// When activated, the worker fetches jobs for multiple workers (not only for itself).
// This is an experimental setting without knowing the performance impact.
+ // Does not work when "worker_fork" is enabled (Needs more testing)
'worker_multiple_fetch' => false,
// worker_defer_limit (Integer)
diff --git a/view/theme/duepuntozero/login-bg.gif b/view/theme/duepuntozero/login-bg.gif
index cde836c89..be47484c5 100644
Binary files a/view/theme/duepuntozero/login-bg.gif and b/view/theme/duepuntozero/login-bg.gif differ
diff --git a/view/theme/frio/font/open_sans/fonts/Bold/OpenSans-Bold.svg b/view/theme/frio/font/open_sans/fonts/Bold/OpenSans-Bold.svg
index 81c8a275a..9aa908bbb 100755
--- a/view/theme/frio/font/open_sans/fonts/Bold/OpenSans-Bold.svg
+++ b/view/theme/frio/font/open_sans/fonts/Bold/OpenSans-Bold.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/BoldItalic/OpenSans-BoldItalic.svg b/view/theme/frio/font/open_sans/fonts/BoldItalic/OpenSans-BoldItalic.svg
index d06de541a..36fc373c5 100755
--- a/view/theme/frio/font/open_sans/fonts/BoldItalic/OpenSans-BoldItalic.svg
+++ b/view/theme/frio/font/open_sans/fonts/BoldItalic/OpenSans-BoldItalic.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/ExtraBold/OpenSans-ExtraBold.svg b/view/theme/frio/font/open_sans/fonts/ExtraBold/OpenSans-ExtraBold.svg
index aeb208de4..76ae14e60 100755
--- a/view/theme/frio/font/open_sans/fonts/ExtraBold/OpenSans-ExtraBold.svg
+++ b/view/theme/frio/font/open_sans/fonts/ExtraBold/OpenSans-ExtraBold.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.svg b/view/theme/frio/font/open_sans/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.svg
index 2152de9ec..9a64576ff 100755
--- a/view/theme/frio/font/open_sans/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.svg
+++ b/view/theme/frio/font/open_sans/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/Italic/OpenSans-Italic.svg b/view/theme/frio/font/open_sans/fonts/Italic/OpenSans-Italic.svg
index 7561e874c..47c769b8c 100755
--- a/view/theme/frio/font/open_sans/fonts/Italic/OpenSans-Italic.svg
+++ b/view/theme/frio/font/open_sans/fonts/Italic/OpenSans-Italic.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/Light/OpenSans-Light.svg b/view/theme/frio/font/open_sans/fonts/Light/OpenSans-Light.svg
index c3bd1594c..4d8470fe3 100755
--- a/view/theme/frio/font/open_sans/fonts/Light/OpenSans-Light.svg
+++ b/view/theme/frio/font/open_sans/fonts/Light/OpenSans-Light.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/LightItalic/OpenSans-LightItalic.svg b/view/theme/frio/font/open_sans/fonts/LightItalic/OpenSans-LightItalic.svg
index e5694a123..9a5a9547f 100755
--- a/view/theme/frio/font/open_sans/fonts/LightItalic/OpenSans-LightItalic.svg
+++ b/view/theme/frio/font/open_sans/fonts/LightItalic/OpenSans-LightItalic.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/Regular/OpenSans-Regular.svg b/view/theme/frio/font/open_sans/fonts/Regular/OpenSans-Regular.svg
index b34ed428a..a6d682228 100755
--- a/view/theme/frio/font/open_sans/fonts/Regular/OpenSans-Regular.svg
+++ b/view/theme/frio/font/open_sans/fonts/Regular/OpenSans-Regular.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/Semibold/OpenSans-Semibold.svg b/view/theme/frio/font/open_sans/fonts/Semibold/OpenSans-Semibold.svg
index 4949365fb..38e38b1eb 100755
--- a/view/theme/frio/font/open_sans/fonts/Semibold/OpenSans-Semibold.svg
+++ b/view/theme/frio/font/open_sans/fonts/Semibold/OpenSans-Semibold.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/font/open_sans/fonts/SemiboldItalic/OpenSans-SemiboldItalic.svg b/view/theme/frio/font/open_sans/fonts/SemiboldItalic/OpenSans-SemiboldItalic.svg
index df4513785..e178a0f4b 100755
--- a/view/theme/frio/font/open_sans/fonts/SemiboldItalic/OpenSans-SemiboldItalic.svg
+++ b/view/theme/frio/font/open_sans/fonts/SemiboldItalic/OpenSans-SemiboldItalic.svg
@@ -1,958 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/frameworks/bootstrap/fonts/glyphicons-halflings-regular.svg b/view/theme/frio/frameworks/bootstrap/fonts/glyphicons-halflings-regular.svg
index 94fb5490a..b17ff2663 100644
--- a/view/theme/frio/frameworks/bootstrap/fonts/glyphicons-halflings-regular.svg
+++ b/view/theme/frio/frameworks/bootstrap/fonts/glyphicons-halflings-regular.svg
@@ -1,288 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/frio/img/friendica-logo.svg b/view/theme/frio/img/friendica-logo.svg
index 42f7f1b09..d402a22d6 100644
--- a/view/theme/frio/img/friendica-logo.svg
+++ b/view/theme/frio/img/friendica-logo.svg
@@ -1,17 +1 @@
-
-
-
+
\ No newline at end of file
diff --git a/view/theme/frio/scheme/plusminus.jpg b/view/theme/frio/scheme/plusminus.jpg
index 7d333a2e1..a0e39e96e 100644
Binary files a/view/theme/frio/scheme/plusminus.jpg and b/view/theme/frio/scheme/plusminus.jpg differ
diff --git a/view/theme/smoothly/images/icons.svg b/view/theme/smoothly/images/icons.svg
index 91bb2ff38..befc4d9e1 100644
--- a/view/theme/smoothly/images/icons.svg
+++ b/view/theme/smoothly/images/icons.svg
@@ -1,1463 +1 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/view/theme/smoothly/images/larrow.gif b/view/theme/smoothly/images/larrow.gif
index 15bb1ea11..2fa8067ce 100644
Binary files a/view/theme/smoothly/images/larrow.gif and b/view/theme/smoothly/images/larrow.gif differ
diff --git a/view/theme/smoothly/images/login-bg.gif b/view/theme/smoothly/images/login-bg.gif
index cde836c89..be47484c5 100644
Binary files a/view/theme/smoothly/images/login-bg.gif and b/view/theme/smoothly/images/login-bg.gif differ
diff --git a/view/theme/smoothly/images/rarrow.gif b/view/theme/smoothly/images/rarrow.gif
index 3c38041f3..509024897 100644
Binary files a/view/theme/smoothly/images/rarrow.gif and b/view/theme/smoothly/images/rarrow.gif differ
diff --git a/view/theme/vier/font/fontawesome-webfont.svg b/view/theme/vier/font/fontawesome-webfont.svg
index d05688e9e..87bd1bc3e 100644
--- a/view/theme/vier/font/fontawesome-webfont.svg
+++ b/view/theme/vier/font/fontawesome-webfont.svg
@@ -1,655 +1 @@
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/view/theme/vier/icons.svg b/view/theme/vier/icons.svg
index 91bb2ff38..befc4d9e1 100644
--- a/view/theme/vier/icons.svg
+++ b/view/theme/vier/icons.svg
@@ -1,1463 +1 @@
-
-
-
-
+
\ No newline at end of file