@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support an SSH error log

Summary: Ref T13624. Depends on D21578. In "sshd" subprocess contexts, use "PhutilErrorLog" to direct errors to both stderr and, if configured, a logfile on disk.

Test Plan:
- Confiugured an error log.
- Forced `ssh-auth` to fatal.
- Saw errors on stderr and in log.

Maniphest Tasks: T13624

Differential Revision: https://secure.phabricator.com/D21579

+25 -1
+5
scripts/ssh/ssh-auth.php
··· 4 4 $root = dirname(dirname(dirname(__FILE__))); 5 5 require_once $root.'/scripts/init/init-script.php'; 6 6 7 + $error_log = id(new PhutilErrorLog()) 8 + ->setLogName(pht('SSH Error Log')) 9 + ->setLogPath(PhabricatorEnv::getEnvConfig('log.ssh-error.path')) 10 + ->activateLog(); 11 + 7 12 // TODO: For now, this is using "parseParital()", not "parse()". This allows 8 13 // the script to accept (and ignore) additional arguments. This preserves 9 14 // backward compatibility until installs have time to migrate to the new
+6 -1
scripts/ssh/ssh-exec.php
··· 4 4 $ssh_start_time = microtime(true); 5 5 6 6 $root = dirname(dirname(dirname(__FILE__))); 7 - require_once $root.'/scripts/__init_script__.php'; 7 + require_once $root.'/scripts/init/init-script.php'; 8 + 9 + $error_log = id(new PhutilErrorLog()) 10 + ->setLogName(pht('SSH Error Log')) 11 + ->setLogPath(PhabricatorEnv::getEnvConfig('log.ssh-error.path')) 12 + ->activateLog(); 8 13 9 14 $ssh_log = PhabricatorSSHLog::getLog(); 10 15
+14
src/applications/config/option/PhabricatorAccessLogConfigOptions.php
··· 116 116 ->setLocked(true) 117 117 ->setSummary(pht('SSH log format.')) 118 118 ->setDescription($ssh_desc), 119 + $this->newOption('log.ssh-error.path', 'string', null) 120 + ->setLocked(true) 121 + ->setSummary(pht('SSH error log location.')) 122 + ->setDescription( 123 + pht( 124 + 'To enable the Phabricator SSH error log, specify a path. Errors '. 125 + 'occurring in contexts where Phabricator is serving SSH requests '. 126 + 'will be written to this log.'. 127 + "\n\n". 128 + 'If not set, no log will be written.')) 129 + ->addExample(null, pht('Disable SSH error log.')) 130 + ->addExample( 131 + '/var/log/phabricator/ssh-error.log', 132 + pht('Write SSH error log here.')), 119 133 ); 120 134 } 121 135