@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.

Automatically create the Aphlict log directory

Summary: Fixes T6944. Attempt to automatically create the log directory for the Aphlict server. If the directory can't be created, throw a helpful exception.

Test Plan:
# Set `notification.log` to `/var/log/aphlict/aphlict.log`.
# Ran `./bin/aphlict debug` and saw an exception (because the user doesn't have permissions to create the `/var/log/aphlict` directory).
# Ran `sudo chmod 777 /var/log`.
# Ran `./bin/aphlict debug` and saw the `/var/log/aphlict` directory created.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Maniphest Tasks: T6944

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

+17 -1
+17 -1
src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
··· 34 34 return PhabricatorEnv::getEnvConfig('notification.pidfile'); 35 35 } 36 36 37 + final public function getLogPath() { 38 + $path = PhabricatorEnv::getEnvConfig('notification.log'); 39 + 40 + try { 41 + $dir = dirname($path); 42 + Filesystem::createDirectory($dir, 0755, true); 43 + } catch (FilesystemException $ex) { 44 + throw new Exception( 45 + pht( 46 + "Failed to create '%s'. You should manually create this directory.", 47 + $dir)); 48 + } 49 + 50 + return $path; 51 + } 52 + 37 53 final public function getPID() { 38 54 $pid = null; 39 55 if (Filesystem::pathExists($this->getPIDPath())) { ··· 128 144 $client_uri = PhabricatorEnv::getEnvConfig('notification.client-uri'); 129 145 $client_uri = new PhutilURI($client_uri); 130 146 131 - $log = PhabricatorEnv::getEnvConfig('notification.log'); 147 + $log = $this->getLogPath(); 132 148 133 149 $server_argv = array(); 134 150 $server_argv[] = '--client-port='.coalesce(