mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-21 15:10:25 +00:00
Update GitRepository.php
This commit is contained in:
parent
d1feb95eef
commit
e062e53e51
1 changed files with 10 additions and 8 deletions
|
@ -84,24 +84,26 @@ class GitRepository extends Model
|
||||||
|
|
||||||
if (!is_dir($sshPath)) {
|
if (!is_dir($sshPath)) {
|
||||||
shell_exec('mkdir -p ' . $sshPath);
|
shell_exec('mkdir -p ' . $sshPath);
|
||||||
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' -R ' . dirname($sshPath));
|
|
||||||
shell_exec('chmod 0700 ' . dirname($sshPath));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' -R ' . dirname($sshPath));
|
||||||
|
shell_exec('chmod 0700 ' . dirname($sshPath));
|
||||||
|
|
||||||
if (!file_exists($privateKeyFile)) {
|
if (!file_exists($privateKeyFile)) {
|
||||||
file_put_contents($privateKeyFile, $gitSSHKey->private_key);
|
file_put_contents($privateKeyFile, $gitSSHKey->private_key);
|
||||||
|
|
||||||
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' ' . $privateKeyFile);
|
|
||||||
shell_exec('chmod 0400 ' . $privateKeyFile);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' ' . $privateKeyFile);
|
||||||
|
shell_exec('chmod 0400 ' . $privateKeyFile);
|
||||||
|
|
||||||
if (!file_exists($publicKeyFile)) {
|
if (!file_exists($publicKeyFile)) {
|
||||||
file_put_contents($publicKeyFile, $gitSSHKey->public_key);
|
file_put_contents($publicKeyFile, $gitSSHKey->public_key);
|
||||||
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' ' . $publicKeyFile);
|
|
||||||
shell_exec('chmod 0400 ' . $publicKeyFile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' ' . $publicKeyFile);
|
||||||
|
shell_exec('chmod 0400 ' . $publicKeyFile);
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'privateKeyFile' => $privateKeyFile,
|
'privateKeyFile' => $privateKeyFile,
|
||||||
'publicKeyFile' => $publicKeyFile,
|
'publicKeyFile' => $publicKeyFile,
|
||||||
|
|
Loading…
Reference in a new issue