Skip to content

Commit

Permalink
Mailhog currently broken
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzymore committed Mar 24, 2022
1 parent 6993c86 commit 8f9ddef
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 28 deletions.
16 changes: 4 additions & 12 deletions cli/Valet/Mailhog.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function install()
public function ensureInstalled()
{
if (!$this->isAvailable()) {
$this->cli->run('ln -s '.VALET_BIN_PATH.'/mailhog /opt/valet-linux/mailhog');
$this->cli->run('ln -s ' . VALET_BIN_PATH . '/mailhog /opt/valet-linux/mailhog');
}
}

Expand All @@ -57,22 +57,14 @@ public function createService()
info('Installing Mailhog service...');

$servicePath = '/etc/init.d/mailhog';
$serviceFile = VALET_ROOT_PATH.'/cli/stubs/init/mailhog.sh';
$hasSystemd = $this->sm->_hasSystemd();

if ($hasSystemd) {
$servicePath = '/etc/systemd/system/mailhog.service';
$serviceFile = VALET_ROOT_PATH.'/cli/stubs/init/mailhog';
}
$serviceFile = VALET_ROOT_PATH . '/cli/stubs/init/mailhog.sh';

$this->files->put(
$servicePath,
$this->files->get($serviceFile)
);

if (!$hasSystemd) {
$this->cli->run("chmod +x $servicePath");
}
$this->cli->run("chmod +x $servicePath");

$this->sm->enable('mailhog');

Expand All @@ -85,7 +77,7 @@ public function updateDomain()
{
$domain = \Configuration::read()['domain'];

\Site::secure("mailhog.{$domain}", __DIR__.'/../stubs/mailhog.conf');
\Site::secure("mailhog.{$domain}", __DIR__ . '/../stubs/mailhog.conf');
}

public function isAvailable()
Expand Down
2 changes: 1 addition & 1 deletion cli/Valet/ServiceManagers/LinuxService.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function _hasSystemd()
{
try {
$this->cli->run(
'which systemctl',
'systemctl',
function ($exitCode, $output) {
throw new DomainException('Systemd not available');
}
Expand Down
30 changes: 15 additions & 15 deletions cli/valet.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
PhpFpm::install();
Nginx::restart();
Valet::symlinkToUsersBin();
Mailhog::install();
// Mailhog::install();
ValetRedis::install();
Mysql::install();

Expand Down Expand Up @@ -77,7 +77,7 @@

Configuration::updateKey('domain', $domain);
Site::resecureForNewDomain($oldDomain, $domain);
Mailhog::updateDomain();
// Mailhog::updateDomain();
PhpFpm::restart();
Nginx::restart();

Expand Down Expand Up @@ -304,7 +304,7 @@
if (empty($services)) {
PhpFpm::restart();
Nginx::restart();
Mailhog::restart();
// Mailhog::restart();
Mysql::restart();
ValetRedis::restart();
info('Valet services have been started.');
Expand All @@ -321,9 +321,9 @@
PhpFpm::restart();
break;

case 'mailhog':
Mailhog::restart();
break;
// case 'mailhog':
// Mailhog::restart();
// break;

case 'mysql':
Mysql::restart();
Expand All @@ -345,7 +345,7 @@
if (empty($services)) {
PhpFpm::restart();
Nginx::restart();
Mailhog::restart();
// Mailhog::restart();
Mysql::restart();
ValetRedis::restart();
info('Valet services have been restarted.');
Expand All @@ -363,9 +363,9 @@
PhpFpm::restart();
break;

case 'mailhog':
Mailhog::restart();
break;
// case 'mailhog':
// Mailhog::restart();
// break;

case 'mysql':
Mysql::restart();
Expand Down Expand Up @@ -400,7 +400,7 @@
if (empty($services)) {
PhpFpm::stop();
Nginx::stop();
Mailhog::stop();
// Mailhog::stop();
Mysql::stop();
ValetRedis::stop();
// Elasticsearch::stop();
Expand All @@ -421,9 +421,9 @@
PhpFpm::stop();
break;

case 'mailhog':
Mailhog::stop();
break;
// case 'mailhog':
// Mailhog::stop();
// break;

case 'mysql':
Mysql::stop();
Expand Down Expand Up @@ -457,7 +457,7 @@
$app->command('uninstall', function () {
Nginx::uninstall();
PhpFpm::uninstall();
Mailhog::uninstall();
// Mailhog::uninstall();
Configuration::uninstall();
Valet::uninstall();

Expand Down

0 comments on commit 8f9ddef

Please sign in to comment.