implement a forced directory update mode where we unconditionally create a directory sync packet. This is needed to ensure that monthly directory pings are propagated to other directory servers so they can each prove for themselves whether or not an account is alive or dead. We do not trust other directories to provide us information beyond "look at this entry and decide for yourself" as doing otherwise would invite rogue directory manipulations. As this scheduled update occurs on all channels across all servers, we should also pick up refresh messages from all existing channel clones and these should also propagate out to all directory servers using the same mechanism (though perhaps not at the same time).
This commit is contained in:
@@ -13,6 +13,10 @@ function directory_run($argv, $argc){
|
||||
if($argc < 2)
|
||||
return;
|
||||
|
||||
$force = false;
|
||||
if(($argc > 2) && ($argv[2] === 'force'))
|
||||
$force = true;
|
||||
|
||||
logger('directory update', LOGGER_DEBUG);
|
||||
|
||||
$dirmode = get_config('system','directory_mode');
|
||||
@@ -29,7 +33,8 @@ function directory_run($argv, $argc){
|
||||
|
||||
|
||||
if(($dirmode == DIRECTORY_MODE_PRIMARY) || ($dirmode == DIRECTORY_MODE_STANDALONE)) {
|
||||
syncdirs($argv[1]);
|
||||
|
||||
local_dir_update($argv[1],$force);
|
||||
|
||||
q("update channel set channel_dirdate = '%s' where channel_id = %d limit 1",
|
||||
dbesc(datetime_convert()),
|
||||
@@ -53,7 +58,7 @@ function directory_run($argv, $argc){
|
||||
|
||||
// ensure the upstream directory is updated
|
||||
|
||||
$packet = zot_build_packet($channel,'refresh');
|
||||
$packet = zot_build_packet($channel,(($force) ? 'force_refresh' : 'refresh'));
|
||||
$z = zot_zot($url,$packet);
|
||||
|
||||
// re-queue if unsuccessful
|
||||
|
||||
Reference in New Issue
Block a user