Skip to content

Commit

Permalink
Merge pull request #291 from andreapollastri/3.x
Browse files Browse the repository at this point in the history
SSL & Site Edit Fix
  • Loading branch information
andreapollastri authored Dec 9, 2021
2 parents 54c1c77 + c2403fe commit a387adb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

(no unreleased versions)

## [3.1.1] - 2021-12-09
### Fixes
- Let's Encrypt Issue on Nginx Fix
- Domain Edit Issue Fix

## [3.1.0] - 2021-12-09
### Added
Expand Down
1 change: 1 addition & 0 deletions app/Jobs/EditSiteDomainSSH.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function handle()
$ssh->login('cipi', $this->site->server->password);
$ssh->setTimeout(360);
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo rpl -i -w "server_name '.$this->olddomain.'" "server_name '.$this->site->domain.'" /etc/nginx/sites-available/'.$this->site->username.'.conf');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo rpl -i -w "server_name '.$this->olddomain.'" "server_name '.$this->site->domain.'" /etc/nginx/sites-enabled/'.$this->site->username.'.conf');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo systemctl restart nginx.service');
$ssh->exec('exit');
}
Expand Down
5 changes: 5 additions & 0 deletions app/Jobs/SslSiteSSH.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public function handle()
$ssh = new SSH2($this->site->server->ip, 22);
$ssh->login('cipi', $this->site->server->password);
$ssh->setTimeout(360);

$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo fuser -k 80/tcp');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo fuser -k 443/tcp');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo systemctl restart nginx.service');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo ufw disable');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo certbot --nginx -d '.$this->site->domain.' --non-interactive --agree-tos --register-unsafely-without-email');
Expand All @@ -44,6 +47,8 @@ public function handle()
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo ufw --force enable');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo systemctl restart nginx.service');
foreach ($this->site->aliases as $alias) {
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo fuser -k 80/tcp');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo fuser -k 443/tcp');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo systemctl restart nginx.service');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo ufw disable');
$ssh->exec('echo '.$this->site->server->password.' | sudo -S sudo certbot --nginx -d '.$alias->domain.' --non-interactive --agree-tos --register-unsafely-without-email');
Expand Down

0 comments on commit a387adb

Please sign in to comment.