This commit is contained in:
Bozhidar Slaveykov 2024-04-04 12:41:16 +03:00
parent 2526f9ce81
commit b844aeb845
4 changed files with 37 additions and 5 deletions

View file

@ -22,6 +22,15 @@ pm.max_children = 4
pm.max_requests = 1000
pm.process_idle_timeout = 10s;
#env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
#env[PHYRE] = $PHYRE
env[LANG] = en_US.UTF-8
php_flag[display_errors] = off
php_admin_flag[log_errors] = on
php_admin_flag[session.cookie_httponly] = on

View file

@ -21,8 +21,11 @@ email="admin@phyrepanel.com"
# Create the new phyreweb user
/usr/sbin/useradd "phyreweb" -c "$email" --no-create-home
sudo usermod -aG sudo phyreweb
sudo usermod -aG sudo www-data
# Add the phyreweb user to the www-data group
sudo usermod -a -G www-data phyreweb
# Add the root user to the www-data group
sudo usermod -a -G www-data root
# do not allow login into phyreweb user

View file

@ -2,8 +2,10 @@
namespace Modules\Microweber\Filament\Clusters\Microweber\Resources\InstallationResource\Pages;
use App\Models\Website;
use Filament\Actions;
use Filament\Resources\Pages\ListRecords;
use MicroweberPackages\SharedServerScripts\MicroweberInstallationsScanner;
use Modules\Microweber\Filament\Clusters\Microweber\Resources\InstallationResource;
class ListInstallations extends ListRecords
@ -14,6 +16,25 @@ class ListInstallations extends ListRecords
{
return [
Actions\CreateAction::make(),
Actions\Action::make('Scan for installations')->action('scanForInstallations')
];
}
public function scanForInstallations()
{
$findWebsites = Website::all();
foreach ($findWebsites as $website) {
dd(file_put_contents('test.txt', 'test'));
dd(file_put_contents($website->domain_public. '/test.txt', 'test'));
$scan = new MicroweberInstallationsScanner();
$scan->setPath($website->domain_public);
$installations = $scan->scanRecusrive();
}
}
}

View file

@ -65,8 +65,7 @@ class ApacheWebsiteCreate
'domainRoot' => $domainRoot,
'homeRoot' => '/home/' . $this->user,
'user' => $this->user,
'group' => $this->user,
// 'group' => 'www-data',
'group' => 'www-data',
'enableRuid2' => true,
];
$apache2Sample = view('actions.samples.ubuntu.apache2-conf', $settings)->render();
@ -100,7 +99,7 @@ class ApacheWebsiteCreate
ShellApi::exec('chmod -R 755 ' . $allDomainsRoot);
ShellApi::exec('chmod -R 755 ' . $homeRoot);
ShellApi::exec('chmod -R 755 ' . $settings['domainRoot']);
ShellApi::exec('chmod -R 755 ' . $settings['domainPublic']);