Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace App\Controller\Frontend; use Symfony\Component\HttpFoundation\Request; u..
Decoded Output download
<?php
namespace App\Controller\Frontend; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Form\Form; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\ConstraintViolationList; use App\Controller\Controller; use App\Event\EventQueue; use App\Service\Logger; use App\Entity\Site as SiteEntity; use App\Entity\Certificate as CertificateEntity; use App\Entity\NodejsSettings as NodejsSettingsEntity; use App\Entity\PhpSettings as PhpSettingsEntity; use App\Entity\PythonSettings as PythonSettingsEntity; use App\Entity\Database as DatabaseEntity; use App\Entity\DatabaseUser as DatabaseUserEntity; use App\Entity\DatabaseServer as DatabaseServerEntity; use App\Entity\User as UserEntity; use App\Entity\Manager\ConfigManager; use App\Entity\Manager\SiteManager as SiteEntityManager; use App\Entity\Manager\CertificateManager as CertificateEntityManager; use App\Entity\Manager\DatabaseManager as DatabaseEntityManager; use App\Entity\Manager\DatabaseUserManager as DatabaseUserEntityManager; use App\Entity\Manager\DatabaseServerManager as DatabaseServerEntityManager; use App\Entity\Manager\VhostTemplateManager as VhostTemplateEntityManager; use App\Database\Connection as DatabaseConnection; use App\Database\Manager as DatabaseManager; use App\Site\Nginx\Vhost\StaticTemplate as StaticVhostTemplate; use App\Site\Nginx\Vhost\PhpTemplate as PhpVhostTemplate; use App\Site\Nginx\Vhost\PythonTemplate as PythonVhostTemplate; use App\Site\Nginx\Vhost\ReverseProxyTemplate as ReverseProxyVhostTemplate; use App\Site\Nginx\Vhost\Processor\RedirectDomain as RedirectDomainProcessor; use App\Site\Nginx\Vhost\Processor\RedirectServerName as RedirectServerNameProcessor; use App\Site\Nginx\Vhost\Processor\ServerName as ServerNameProcessor; use App\Site\Parser\DomainName as DomainNameParser; use App\Site\Ssl\Generator\RsaKeyGenerator; use App\Site\Creator\NodejsSite as NodejsSiteCreator; use App\Site\Creator\StaticSite as StaticSiteCreator; use App\Site\Creator\PhpSite as PhpSiteCreator; use App\Site\Creator\PythonSite as PythonSiteCreator; use App\Site\Creator\ReverseProxySite as ReverseProxySiteCreator; use App\Site\Ssl\DistinguishedName; use App\Site\Ssl\Generator\CsrGenerator; use App\Site\Ssl\Util\Openssl; use App\Site\NodejsSite; use App\Site\StaticSite; use App\Site\PhpSite; use App\Site\PythonSite; use App\Site\ReverseProxySite; use App\Util\PasswordGenerator; use App\Site\Application\WordPressInstaller; use App\Service\Crypto; class NewSiteController extends Controller { private const WORDPRESS_VHOST_TEMPLATE_NAME = "WordPress"; private const NODEJS_VHOST_TEMPLATE_NAME = "Nodejs"; private const STATIC_SITE_VHOST_TEMPLATE_NAME = "Static"; private const PYTHON_VHOST_TEMPLATE_NAME = "Python"; private const REVERSE_PROXY_VHOST_TEMPLATE_NAME = "ReverseProxy"; private const VARNISH_CACHE_SERVER = "127.0.0.1:6081"; private const PASSWORD_LENGTH = 20; private ConfigManager $configManager; private SiteEntityManager $siteEntityManager; private CertificateEntityManager $certificateEntityManager; private DatabaseEntityManager $databaseEntityManager; private DatabaseUserEntityManager $databaseUserEntityManager; private DatabaseServerEntityManager $databaseServerEntityManager; private DomainNameParser $domainNameParser; private VhostTemplateEntityManager $vhostTemplateEntityManager; private ValidatorInterface $validator; private array $wordPressDefaultConfigValues = ["FS_METHOD" => ["value" => "direct", "raw" => false], "WP_DEBUG_DISPLAY" => ["value" => "false", "raw" => true], "WP_DEBUG_LOG" => ["value" => "true", "raw" => true], "CONCATENATE_SCRIPTS" => ["value" => "false", "raw" => true], "AUTOSAVE_INTERVAL" => ["value" => 600, "raw" => true], "WP_POST_REVISIONS" => ["value" => 5, "raw" => true], "EMPTY_TRASH_DAYS" => ["value" => 21, "raw" => true]]; private array $wordPressMultiSiteConfigValues = ["WP_ALLOW_MULTISITE" => ["value" => "true", "raw" => true], "MULTISITE" => ["value" => "true", "raw" => true], "SUBDOMAIN_INSTALL" => ["value" => "false", "raw" => true], "DOMAIN_CURRENT_SITE" => ["value" => '', "raw" => false], "PATH_CURRENT_SITE" => ["value" => "/", "raw" => false], "SITE_ID_CURRENT_SITE" => ["value" => 1, "raw" => true], "BLOG_ID_CURRENT_SITE" => ["value" => 1, "raw" => true]]; public function __construct(ConfigManager $configManager, SiteEntityManager $siteEntityManager, CertificateEntityManager $certificateEntityManager, DatabaseEntityManager $databaseEntityManager, DatabaseUserEntityManager $databaseUserEntityManager, DatabaseServerEntityManager $databaseServerEntityManager, VhostTemplateEntityManager $vhostTemplateEntityManager, DomainNameParser $domainNameParser, ValidatorInterface $validator, TranslatorInterface $translator, Logger $logger) { goto b212c; Bab88: parent::__construct($translator, $logger); goto D3e3a; D5381: $this->siteEntityManager = $siteEntityManager; goto b4e0a; b9200: $this->domainNameParser = $domainNameParser; goto c9ea7; b212c: $this->configManager = $configManager; goto D5381; C827b: $this->databaseEntityManager = $databaseEntityManager; goto C4a30; d2224: $this->vhostTemplateEntityManager = $vhostTemplateEntityManager; goto b9200; C4a30: $this->databaseUserEntityManager = $databaseUserEntityManager; goto eec09; eec09: $this->databaseServerEntityManager = $databaseServerEntityManager; goto d2224; b4e0a: $this->certificateEntityManager = $certificateEntityManager; goto C827b; c9ea7: $this->validator = $validator; goto Bab88; D3e3a: } public function index(Request $request) : Response { goto A45fb; Cbad4: $response = $this->render("Frontend/Site/New/index.html.twig", ["user" => $user]); goto d3233; e1ffb: $user = $this->getUser(); goto Cbad4; e3373: if (true === $hasPermissions) { goto e305a; } goto Ce80b; d3233: c7354: goto B631c; A45fb: $hasPermissions = $this->hasPermissions(); goto e3373; c3d28: goto c7354; goto af783; B631c: return $response; goto A2cda; Ce80b: $response = $this->redirect($this->generateUrl("clp_sites")); goto c3d28; af783: e305a: goto e1ffb; A2cda: } public function newPythonSite(Request $request) : Response { goto A2aad; D8d63: $response = $this->redirect($this->generateUrl("clp_sites")); goto E881f; A1046: return $response; goto e82bb; C1829: cfacf: goto c83e3; A2aad: $hasPermissions = $this->hasPermissions(); goto E43e8; d7805: $form->handleRequest($request); goto A421d; E3ab3: $response = $this->render("Frontend/Site/New/python.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto C2977; C2977: ba024: goto A1046; ca3a0: Edc84: goto E3ab3; A421d: if (!(true === $form->isSubmitted())) { goto A930d; } goto b5867; E881f: goto ba024; goto Ce650; c83e3: A930d: goto ca3a0; b5867: $response = $this->handleCreatePythonSiteForm($request, $form); goto b1239; acf43: if (!(true === $request->isMethod("POST"))) { goto Edc84; } goto d7805; b1239: if (!(false === is_null($response))) { goto cfacf; } goto A5fe0; Ce650: e9003: goto d5ab4; b757e: $form = $this->createPythonSiteForm($pythonSettings); goto acf43; E43e8: if (true === $hasPermissions) { goto e9003; } goto D8d63; A553d: $pythonSettings = new PythonSettingsEntity(); goto b757e; A5fe0: return $response; goto C1829; d5ab4: $user = $this->getUser(); goto A553d; e82bb: } private function createPythonSiteForm(PythonSettingsEntity $pythonSettings) : Form { goto C3883; c79b5: return $form; goto fa8fc; F8347: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto c79b5; C3883: $form = $this->createForm("App\Form\SiteNewPythonType", $pythonSettings, ["action" => $this->generateUrl("clp_site_python_new"), "method" => "POST", "attr" => ["id" => "new-python-site-form"]]); goto F8347; fa8fc: } private function handleCreatePythonSiteForm(Request $request, Form $form) { goto fc773; fc773: if (true === $form->isValid()) { goto F50d8; } goto C4b77; ccc70: try { goto c7589; c7589: $session = $request->getSession(); goto B7e1b; B4843: $response = $this->redirect($this->generateUrl("clp_sites")); goto B2574; cd807: $session->getFlashBag()->set("success", $this->translator->trans("Site has been created.")); goto B4843; B2574: return $response; goto f42a3; a596d: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto d4ab6; E9e3a: if (false === is_null($vhostTemplateEntity)) { goto beab9; } goto a596d; B671e: $eventData = ["site" => $domainName, "siteUser" => $siteUser, "pythonVersion" => $pythonVersion, "port" => $port]; goto C4113; B7e1b: $domainName = $form->get("domainName")->getData(); goto b603c; C4113: EventQueue::addEvent(EventQueue::EVENT_SITE_PYTHON_CREATE, $user, $eventData, $request); goto cd807; b603c: $pythonVersion = $form->get("pythonVersion")->getData(); goto Bc2e2; e8d1f: $this->createPythonSite($domainName, $pythonVersion, $port, $siteUser, $siteUserPassword); goto B671e; Bc2e2: $port = $form->get("port")->getData(); goto c6f08; Fd12f: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto C5659; f42a3: E56c5: goto c8cf6; e73a8: beab9: goto a04a8; C5659: $vhostTemplateName = self::PYTHON_VHOST_TEMPLATE_NAME; goto bfa18; c6f08: $siteUser = $form->get("siteUser")->getData(); goto Fd12f; a04a8: $user = $this->getUser(); goto e8d1f; bfa18: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto E9e3a; d4ab6: goto E56c5; goto e73a8; c8cf6: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("danger", $this->translator->trans("An error has occurred, error message: %errorMessage%", ["%errorMessage%" => $e->getMessage()])); } goto Ff46b; A1c16: goto e459b; goto Fdad5; Fdad5: F50d8: goto ccc70; Ff46b: e459b: goto ac72a; C4b77: $this->formErrors = $this->getErrorMessages($form); goto A1c16; ac72a: } public function newReverseProxy(Request $request) : Response { goto df7bd; A7649: F492a: goto Bbe09; e469c: $user = $this->getUser(); goto c956f; b6d52: $form->handleRequest($request); goto Ededa; df7bd: $hasPermissions = $this->hasPermissions(); goto f62f3; f62f3: if (true === $hasPermissions) { goto A89c3; } goto D950a; C5e12: goto De2b7; goto Bf32c; c956f: $form = $this->createReverseProxyForm(); goto d6800; Ededa: if (!(true === $form->isSubmitted())) { goto ba0c1; } goto a19ce; e28f8: D6085: goto Acb98; A1483: if (!(false === is_null($response))) { goto D6085; } goto D6430; Dd91b: De2b7: goto Ca1bd; d6800: if (!(true === $request->isMethod("POST"))) { goto F492a; } goto b6d52; Acb98: ba0c1: goto A7649; Bbe09: $response = $this->render("Frontend/Site/New/reverse-proxy.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto Dd91b; Bf32c: A89c3: goto e469c; D950a: $response = $this->redirect($this->generateUrl("clp_sites")); goto C5e12; a19ce: $response = $this->handleReverseProxyForm($request, $form); goto A1483; Ca1bd: return $response; goto F2a24; D6430: return $response; goto e28f8; F2a24: } private function createReverseProxyForm() : Form { goto Bf416; e213a: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto Ee7c2; Bf416: $form = $this->createForm("App\Form\SiteNewReverseProxyType", [], ["action" => $this->generateUrl("clp_site_reverse_proxy_new"), "method" => "POST", "attr" => ["id" => "new-reverse-proxy-form"]]); goto e213a; Ee7c2: return $form; goto d6e5c; d6e5c: } private function handleReverseProxyForm(Request $request, Form $form) { goto bebe3; d2ab5: goto d648d; goto baedb; f84ba: try { goto C6df9; F8592: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto b0636; A4f11: $session->getFlashBag()->set("success", $this->translator->trans("Reverse Proxy has been created.")); goto Daa9c; cf3ce: $domainName = $form->get("domainName")->getData(); goto F5cfe; C24ee: e3ec7: goto bb7be; e052d: $this->createReverseProxySite($domainName, $reverseProxyUrl, $siteUser, $siteUserPassword); goto d9cce; ee3e3: return $response; goto f7b82; bb7be: $user = $this->getUser(); goto e052d; Daa9c: $response = $this->redirect($this->generateUrl("clp_sites")); goto ee3e3; E1a23: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto E3935; D22a7: EventQueue::addEvent(EventQueue::EVENT_SITE_REVERSE_PROXY_CREATE, $user, $eventData, $request); goto A4f11; E3935: $reverseProxyUrl = $form->get("reverseProxyUrl")->getData(); goto c4c27; b0636: goto c3161; goto C24ee; f7b82: c3161: goto Eeb08; Feaff: if (false === is_null($vhostTemplateEntity)) { goto e3ec7; } goto F8592; F5cfe: $siteUser = $form->get("siteUser")->getData(); goto E1a23; d9cce: $eventData = ["site" => $domainName, "siteUser" => $siteUser, "reverseProxyUrl" => $reverseProxyUrl]; goto D22a7; c4c27: $vhostTemplateName = self::REVERSE_PROXY_VHOST_TEMPLATE_NAME; goto F7830; C6df9: $session = $request->getSession(); goto cf3ce; F7830: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto Feaff; Eeb08: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("danger", $this->translator->trans("An error has occurred, error message: %errorMessage%", ["%errorMessage%" => $e->getMessage()])); } goto A0f8c; baedb: e6118: goto f84ba; A0f8c: d648d: goto F0566; e2438: $this->formErrors = $this->getErrorMessages($form); goto d2ab5; bebe3: if (true === $form->isValid()) { goto e6118; } goto e2438; F0566: } public function newNodejsSite(Request $request) : Response { goto E67b6; E97af: return $response; goto c6211; eb17b: f7f30: goto a9f0e; Bb2f2: e8d8b: goto f9d81; A23f3: $response = $this->handleCreateNodejsSiteForm($request, $form); goto D0b19; f9d81: $user = $this->getUser(); goto b36fe; Cae7e: return $response; goto a4c9b; D0b19: if (!(false === is_null($response))) { goto A753a; } goto Cae7e; a4c9b: A753a: goto c2174; b36fe: $nodejsSettings = new NodejsSettingsEntity(); goto f2273; C7413: $response = $this->redirect($this->generateUrl("clp_sites")); goto Baac2; acee7: Aeb2b: goto E97af; ae369: if (true === $hasPermissions) { goto e8d8b; } goto C7413; c2174: ba782: goto eb17b; f2273: $form = $this->createNodejsSiteForm($nodejsSettings); goto aed81; a9f0e: $response = $this->render("Frontend/Site/New/nodejs.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto acee7; E67b6: $hasPermissions = $this->hasPermissions(); goto ae369; a6826: if (!(true === $form->isSubmitted())) { goto ba782; } goto A23f3; aed81: if (!(true === $request->isMethod("POST"))) { goto f7f30; } goto e0209; e0209: $form->handleRequest($request); goto a6826; Baac2: goto Aeb2b; goto Bb2f2; c6211: } private function createNodejsSiteForm(NodejsSettingsEntity $nodejsSettings) : Form { goto Ed016; d13df: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto Fceed; Ed016: $form = $this->createForm("App\Form\SiteNewNodejsType", $nodejsSettings, ["action" => $this->generateUrl("clp_site_nodejs_new"), "method" => "POST", "attr" => ["id" => "new-nodejs-site-form"]]); goto d13df; Fceed: return $form; goto af562; af562: } private function handleCreateNodejsSiteForm(Request $request, Form $form) { goto ad55f; F454b: $this->formErrors = $this->getErrorMessages($form); goto Ecb2e; F7580: a1cfe: goto a02fc; ad55f: if (true === $form->isValid()) { goto a1cfe; } goto F454b; a02fc: try { goto a35ef; D2eb2: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto F39ef; f5714: $nodejsVersion = $form->get("nodejsVersion")->getData(); goto A5dd0; D3dd0: D495a: goto abb17; a6abd: EventQueue::addEvent(EventQueue::EVENT_SITE_NODEJS_CREATE, $user, $eventData, $request); goto d01ac; Eed5b: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto f1314; a8851: $response = $this->redirect($this->generateUrl("clp_sites")); goto c2184; c2184: return $response; goto Ee23b; a35ef: $session = $request->getSession(); goto f764d; Bf2c5: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto c46f2; F39ef: if (false === is_null($vhostTemplateEntity)) { goto D495a; } goto Bf2c5; e617c: $siteUser = $form->get("siteUser")->getData(); goto Eed5b; Ee23b: a2d1a: goto da04e; abb17: $user = $this->getUser(); goto D7302; D7302: $this->createNodejsSite($domainName, $nodejsVersion, $port, $siteUser, $siteUserPassword); goto f4f19; f764d: $domainName = $form->get("domainName")->getData(); goto f5714; d01ac: $session->getFlashBag()->set("success", $this->translator->trans("Site has been created.")); goto a8851; f1314: $vhostTemplateName = self::NODEJS_VHOST_TEMPLATE_NAME; goto D2eb2; c46f2: goto a2d1a; goto D3dd0; f4f19: $eventData = ["site" => $domainName, "siteUser" => $siteUser, "nodejsVersion" => $nodejsVersion, "port" => $port]; goto a6abd; A5dd0: $port = $form->get("port")->getData(); goto e617c; da04e: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("danger", $this->translator->trans("An error has occurred, error message: %errorMessage%", ["%errorMessage%" => $e->getMessage()])); } goto F6a0f; F6a0f: Cdfae: goto De94d; Ecb2e: goto Cdfae; goto F7580; De94d: } public function newStaticSite(Request $request) : Response { goto A0085; d3386: $response = $this->handleCreateStaticSiteForm($request, $form); goto eae9e; A9e26: if (!(true === $request->isMethod("POST"))) { goto C4d08; } goto Be9ee; d7c86: C4d08: goto ff3c4; adf37: E3bc9: goto d7c86; F00d1: if (!(true === $form->isSubmitted())) { goto E3bc9; } goto d3386; d35d8: if (true === $hasPermissions) { goto dbc37; } goto f4123; A0085: $hasPermissions = $this->hasPermissions(); goto d35d8; A45ec: goto Fd0b0; goto B96ef; b943e: $form = $this->createStaticSiteForm(); goto A9e26; B96ef: dbc37: goto d4b7a; eae9e: if (!(false === is_null($response))) { goto Ab61f; } goto e70bc; e70bc: return $response; goto a566a; f4123: $response = $this->redirect($this->generateUrl("clp_sites")); goto A45ec; a566a: Ab61f: goto adf37; F1eec: Fd0b0: goto Ea0be; Be9ee: $form->handleRequest($request); goto F00d1; Ea0be: return $response; goto A7449; d4b7a: $user = $this->getUser(); goto b943e; ff3c4: $response = $this->render("Frontend/Site/New/static.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto F1eec; A7449: } private function createStaticSiteForm() : Form { goto b4e61; b4e61: $form = $this->createForm("App\Form\SiteNewStaticType", [], ["action" => $this->generateUrl("clp_site_static_new"), "method" => "POST", "attr" => []]); goto bab4d; d7e14: return $form; goto cb4aa; bab4d: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto d7e14; cb4aa: } private function handleCreateStaticSiteForm(Request $request, Form $form) { goto deb25; deb8a: $this->formErrors = $this->getErrorMessages($form); goto Bcec5; A49d7: try { goto Ad44f; dd4bd: $eventData = ["site" => $domainName, "siteUser" => $siteUser]; goto D2d16; c3d2e: return $response; goto A90c5; B0ce4: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto Cd2d6; f501e: $user = $this->getUser(); goto C5dab; Cd2d6: goto Bab3f; goto b9d64; E0eaa: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto E0719; c2b17: $siteUser = $form->get("siteUser")->getData(); goto F4f79; cf518: $domainName = $form->get("domainName")->getData(); goto c2b17; b9d64: E49a7: goto f501e; A90c5: Bab3f: goto B7f56; B4bfd: $session->getFlashBag()->set("success", $this->translator->trans("Site has been created.")); goto cda40; E0719: if (false === is_null($vhostTemplateEntity)) { goto E49a7; } goto B0ce4; cda40: $response = $this->redirect($this->generateUrl("clp_sites")); goto c3d2e; C5dab: $this->createStaticSite($domainName, $siteUser, $siteUserPassword); goto dd4bd; Ad44f: $session = $request->getSession(); goto cf518; Ef948: $vhostTemplateName = self::STATIC_SITE_VHOST_TEMPLATE_NAME; goto E0eaa; F4f79: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto Ef948; D2d16: EventQueue::addEvent(EventQueue::EVENT_SITE_STATIC_CREATE, $user, $eventData, $request); goto B4bfd; B7f56: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("danger", $this->translator->trans("An error has occurred, error message: %errorMessage%", ["%errorMessage%" => $e->getMessage()])); } goto efe82; deb25: if (true === $form->isValid()) { goto Be3da; } goto deb8a; Ca5e4: Be3da: goto A49d7; efe82: b579b: goto Eba2f; Bcec5: goto b579b; goto Ca5e4; Eba2f: } public function newPhpSite(Request $request) : Response { goto D6b98; b92ea: return $response; goto c98a3; c98a3: E6568: goto Bc77d; Bbe70: $form->handleRequest($request); goto A5e84; d6fe7: $response = $this->redirect($this->generateUrl("clp_sites")); goto C1bf7; C1bf7: goto E798b; goto bb2e1; Dd1c9: return $response; goto ee66e; E7bf8: E798b: goto Dd1c9; Aab0a: if (true === $hasPermissions) { goto Ffe38; } goto d6fe7; D6b98: $hasPermissions = $this->hasPermissions(); goto Aab0a; fb4a2: $response = $this->render("Frontend/Site/New/php.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto E7bf8; A5e84: if (!(true === $form->isSubmitted())) { goto C5fa1; } goto Bfc88; bb2e1: Ffe38: goto Ecfbd; F6089: $form = $this->createPhpSiteForm(); goto C25b9; Ecfbd: $user = $this->getUser(); goto F6089; Bc77d: C5fa1: goto Af589; Bfc88: $response = $this->handleCreatePhpSiteForm($request, $form); goto ba276; Af589: e3840: goto fb4a2; ba276: if (!(false === is_null($response))) { goto E6568; } goto b92ea; C25b9: if (!(true === $request->isMethod("POST"))) { goto e3840; } goto Bbe70; ee66e: } private function createPhpSiteForm() : Form { goto f8163; f8163: $form = $this->createForm("App\Form\SiteNewPhpType", [], ["action" => $this->generateUrl("clp_site_php_new"), "method" => "POST", "attr" => []]); goto c22ce; B8676: return $form; goto f2b74; c22ce: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto B8676; f2b74: } private function handleCreatePhpSiteForm(Request $request, Form $form) { goto cba95; Ff6d9: $this->formErrors = $this->getErrorMessages($form); goto D27c5; Ab164: c4bc0: goto E6488; F52b8: try { goto f4dbe; ffe1b: $vhostTemplateName = $form->get("application")->getData(); goto c0814; c03ed: $rootDirectory = $domainName; goto Aac23; F41fd: ce825: goto B2bdf; F3030: $eventData = ["site" => $domainName, "vhostTemplateName" => $vhostTemplateName, "phpVersion" => $phpVersion, "siteUser" => $siteUser]; goto d7caf; dde50: $varnishCacheSettings = []; goto bf1f5; E1682: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto Fff73; affa1: $rootDirectory = sprintf("%s/%s", $rootDirectory, ltrim(rtrim($vhostTemplateEntity->getRootDirectory(), "/"), "/")); goto B8c93; C11cb: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto Ce1fd; f8fe4: $phpVersion = $form->get("phpVersion")->getData(); goto c7e19; Cb8a9: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto E1682; Ce1fd: goto e9ce4; goto F41fd; b8098: $varnishCacheSettings = (array) json_decode($vhostTemplateEntity->getVarnishCacheSettings(), true); goto A6de5; B8c93: B667e: goto dde50; c7e19: $siteUser = $form->get("siteUser")->getData(); goto Cb8a9; f4dbe: $session = $request->getSession(); goto ffe1b; df290: $this->createPhpSite($domainName, $rootDirectory, $phpVersion, $vhostTemplateName, $siteUser, $siteUserPassword, $varnishCacheSettings); goto F3030; Aac23: if (!(false === empty($vhostTemplateEntity->getRootDirectory()))) { goto B667e; } goto affa1; B696a: $session->getFlashBag()->set("success", $this->translator->trans("Site has been created.")); goto baba3; Dac06: e9ce4: goto Bed17; B2bdf: $user = $this->getUser(); goto c03ed; bf1f5: if (!(false === empty($vhostTemplateEntity->getVarnishCacheSettings()))) { goto c392a; } goto b8098; baba3: $response = $this->redirect($this->generateUrl("clp_sites")); goto fd344; fd344: return $response; goto Dac06; c0814: $domainName = $form->get("domainName")->getData(); goto f8fe4; A6de5: c392a: goto df290; d7caf: EventQueue::addEvent(EventQueue::EVENT_SITE_PHP_CREATE, $user, $eventData, $request); goto B696a; Fff73: if (false === is_null($vhostTemplateEntity)) { goto ce825; } goto C11cb; Bed17: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("danger", $this->translator->trans("An error has occurred, error message: %errorMessage%", ["%errorMessage%" => $e->getMessage()])); } goto Ab164; db953: ad8f8: goto F52b8; cba95: if (true === $form->isValid()) { goto ad8f8; } goto Ff6d9; D27c5: goto c4bc0; goto db953; E6488: } public function newWordPressSite(Request $request) : Response { goto A2cf9; Ddc8e: E3259: goto E3131; A2cf9: $hasPermissions = $this->hasPermissions(); goto e8363; A3411: a4b6f: goto e6594; Aa96c: $user = $this->getUser(); goto ea876; f0da1: return $response; goto c4994; b8104: if (!(false === is_null($response))) { goto b1109; } goto f0da1; d507e: F1972: goto A3411; Bb658: $form->handleRequest($request); goto Df476; c4994: b1109: goto d507e; da409: goto E3259; goto B9b81; c346e: $response = $this->handleCreateWordPressSiteForm($request, $form); goto b8104; e8363: if (true === $hasPermissions) { goto Be56b; } goto ab645; ab645: $response = $this->redirect($this->generateUrl("clp_sites")); goto da409; B9b81: Be56b: goto Aa96c; e6594: $response = $this->render("Frontend/Site/New/wordpress.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto Ddc8e; ea876: $form = $this->createWordPressSiteForm(); goto Ff4d8; E3131: return $response; goto dea1e; Ff4d8: if (!(true === $request->isMethod("POST"))) { goto a4b6f; } goto Bb658; Df476: if (!(true === $form->isSubmitted())) { goto F1972; } goto c346e; dea1e: } private function createWordPressSiteForm() : Form { goto bc916; bc916: $form = $this->createForm("App\Form\SiteNewWordPressType", [], ["action" => $this->generateUrl("clp_site_wordpress_new"), "method" => "POST", "attr" => ["id" => "new-wordpress-site-form"]]); goto D0c3b; D0c3b: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto d8ecb; d8ecb: return $form; goto f549a; f549a: } private function handleCreateWordPressSiteForm(Request $request, Form $form) { goto Ae953; Ae953: if (true === $form->isValid()) { goto Eecd7; } goto cd3f0; F2373: Eecd7: goto B67bb; cd3f0: $this->formErrors = $this->getErrorMessages($form); goto e411a; B67bb: try { goto c753f; E034e: $this->installWordPress($isMultiSite, $url, $title, $adminUserName, $adminPassword, $adminEmail, $siteEntity, $activeDatabaseServerEntity, $databaseEntity, $databaseUserEntity); goto e95e1; A6565: $databaseName = $this->getUniqueDatabaseName($generatedName); goto D61f7; c753f: $user = $this->getUser(); goto F616e; e95e1: $siteCredentials[$this->translator->trans("Database")] = [$this->translator->trans("Host") => $activeDatabaseServerEntity->getHost(), $this->translator->trans("Port") => $activeDatabaseServerEntity->getPort(), $this->translator->trans("Database Name") => $databaseName, $this->translator->trans("Database User Name") => $databaseUserName, $this->translator->trans("Database User Password") => $databaseUserPassword]; goto e92b0; f11c2: $databaseManager = new DatabaseManager($activeDatabaseServerEntity); goto B8c3a; f1a84: $databaseEntity->setSite($siteEntity); goto b56db; B0e01: $instance = $request->attributes->get("instance"); goto fa8e0; Aa73e: $generatedName = $this->generateNameFromDomainName($domainName); goto A780e; B3406: $databaseEntity->setDatabaseServer($activeDatabaseServerEntity); goto D7d30; e2b8a: $varnishCacheSettings = []; goto ffee2; Cc47e: $phpVersion = $vhostTemplateEntity->getPhpVersion(); goto e2b8a; b56db: $databaseUserEntity = $this->databaseUserEntityManager->createEntity(); goto f42d4; fa8e0: $siteCredentials = [$this->translator->trans("Site") => [$this->translator->trans("IP Address") => $instance->getIpv4PublicIp(), $this->translator->trans("Domain Name") => sprintf("https://%s", $domainName), $this->translator->trans("Site User") => $siteUser, $this->translator->trans("Password") => $siteUserPassword]]; goto ce022; de58b: $adminPassword = $form->get("adminPassword")->getData(); goto F41cb; B4729: return $response; goto d6dc5; B8c3a: $databaseManager->createDatabase($databaseEntity); goto d7729; D61f7: $databaseUserName = $this->getUniqueDatabaseUserName($generatedName); goto c1c1e; e1673: e9d00: goto c2782; d7729: $databaseManager->createUser($databaseUserEntity); goto E7376; d53bf: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::WORDPRESS_VHOST_TEMPLATE_NAME); goto Cc47e; c6c8e: $title = $form->get("siteTitle")->getData(); goto f36ca; A32a4: $response = $this->redirect($this->generateUrl("clp_site_wordpress_installed")); goto B4729; Ebe2c: $databaseUserEntity->setDatabase($databaseEntity); goto B2d80; A780e: $siteUser = $form->get("siteUser")->getData(); goto cebe2; B6821: $domainName = $form->get("domainName")->getData(); goto Aa73e; d68e2: $databaseEntity = $this->databaseEntityManager->createEntity(); goto B3406; cebe2: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto d53bf; a3dae: $siteEntity->addDatabase($databaseEntity); goto f11c2; c1c1e: $databaseUserPassword = PasswordGenerator::generate(self::PASSWORD_LENGTH); goto F84a7; e824d: A04bd: goto Bdc23; d60c1: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto d68e2; D6730: $varnishCacheSettings = (array) json_decode($vhostTemplateEntity->getVarnishCacheSettings(), true); goto e1673; abaa4: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto B0e01; f42d4: $databaseUserEntity->setUserName($databaseUserName); goto e853b; E72ed: $databaseUserEntity->setPermissions(DatabaseUserEntity::PERMISSIONS_READ_WRITE); goto Ebe2c; e92b0: $siteCredentials["WordPress"] = [$this->translator->trans("Admin E-Mail") => $adminEmail, $this->translator->trans("Admin User Name") => $adminUserName, $this->translator->trans("Admin Password") => $adminPassword, $this->translator->trans("Admin Url") => sprintf("https://%s/wp-admin/", rtrim($domainName, "/"))]; goto e824d; F84a7: $url = sprintf("https://%s", $siteEntity->getDomainName()); goto c6c8e; F616e: $session = $request->getSession(); goto B6821; A83cb: $isMultiSite = $form->get("multiSite")->getData(); goto d60c1; ffee2: if (!(false === empty($vhostTemplateEntity->getVarnishCacheSettings()))) { goto e9d00; } goto D6730; ce022: if (!(false === is_null($siteEntity))) { goto A04bd; } goto A6565; F41cb: $adminEmail = $form->get("adminEmail")->getData(); goto A83cb; e853b: $databaseUserEntity->setPassword(Crypto::encrypt($databaseUserPassword)); goto E72ed; Aa70e: EventQueue::addEvent(EventQueue::EVENT_SITE_WORDPRESS_CREATE, $user, $eventData, $request); goto A32a4; f36ca: $adminUserName = $form->get("adminUserName")->getData(); goto de58b; B2d80: $databaseEntity->addUser($databaseUserEntity); goto a3dae; E7376: $this->siteEntityManager->updateEntity($siteEntity); goto E034e; c2782: $siteEntity = $this->createPhpSite($domainName, $domainName, $phpVersion, self::WORDPRESS_VHOST_TEMPLATE_NAME, $siteUser, $siteUserPassword, $varnishCacheSettings); goto abaa4; Bdc23: $session->set("siteCredentials", $siteCredentials); goto Ec6b8; D7d30: $databaseEntity->setName($databaseName); goto f1a84; Ec6b8: $eventData = ["site" => $domainName, "siteUser" => $siteUser]; goto Aa70e; d6dc5: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("danger", $this->translator->trans("An error has occurred, error message: %errorMessage%", ["%errorMessage%" => $e->getMessage()])); } goto A9490; A9490: Eaf83: goto D98f2; e411a: goto Eaf83; goto F2373; D98f2: } private function installWordPress(bool $isMultiSite, string $url, string $title, string $adminUserName, string $adminPassword, string $adminEmail, SiteEntity $siteEntity, DatabaseServerEntity $databaseServerEntity, DatabaseEntity $databaseEntity, DatabaseUserEntity $databaseUserEntity) : void { goto be4ab; Df126: $wordPressInstaller->downloadAndExtractLatestVersion(); goto D9488; cfcff: $databaseUserName = $databaseUserEntity->getUserName(); goto dc7a1; a3123: $wordPressInstaller->resetPermissions(); goto Ba9ca; F1a76: foreach ($this->wordPressMultiSiteConfigValues as $key => $config) { $wordPressInstaller->setConfigValue($key, $config["value"], $config["raw"]); dc491: } goto E62d5; ed585: $wordPressInstaller->installCore($isMultiSite, $url, $title, $adminUserName, $adminPassword, $adminEmail); goto C5cd8; D9488: $wordPressInstaller->createConfig($databaseHost, $databaseName, $databaseUserName, $databaseUserPassword); goto ed585; b2b6c: $databaseName = $databaseEntity->getName(); goto cfcff; dc7a1: $databaseUserPassword = Crypto::decrypt($databaseUserEntity->getPassword()); goto e33a1; c9f66: if (!(true === $isMultiSite)) { goto fd8be; } goto e647e; e647e: $this->wordPressMultiSiteConfigValues["DOMAIN_CURRENT_SITE"]["value"] = $siteEntity->getDomainName(); goto F1a76; Cacc4: e4c6c: goto c9f66; Bf9c8: fd8be: goto a3123; E62d5: d70f6: goto Bf9c8; e33a1: $wordPressInstaller = new WordPressInstaller($siteEntity); goto Df126; C5cd8: foreach ($this->wordPressDefaultConfigValues as $key => $config) { $wordPressInstaller->setConfigValue($key, $config["value"], $config["raw"]); d17e5: } goto Cacc4; be4ab: $databaseHost = sprintf("%s:%s", $databaseServerEntity->getHost(), $databaseServerEntity->getPort()); goto b2b6c; Ba9ca: } private function createPhpSite(string $domainName, string $rootDirectory, string $phpVersion, string $vhostTemplateName, string $siteUser, string $siteUserPassword, array $varnishCacheSettings = []) : SiteEntity { goto a5fc9; ac6e3: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto b7415; c7150: $phpSite->setCertificate($certificateEntity); goto d8b32; E5577: $phpSettingsEntity = new PhpSettingsEntity(); goto ee2d0; a31df: $subdomain = false === empty($subdomain) ? $subdomain : null; goto A4672; adbc4: $siteEntity->setUser($siteUser); goto a00f5; A4672: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto D7c4e; C007f: $phpSiteCreator->createVarnishCacheStructure($varnishCacheSettings); goto eaca5; f2889: db89b: goto B6a6b; f33dc: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto Fca4a; B178a: $phpSiteCreator->createPhpFpmPool(); goto e5fde; e71d0: $vhostTemplate = new PhpVhostTemplate($phpSite); goto fa36d; fec61: $phpSettingsEntity->setSite($siteEntity); goto ec686; f5969: f38cf: goto Af216; daed3: $phpSite->setRegistrableDomain($registrableDomain); goto d9d4c; C8b7d: $this->siteEntityManager->updateEntity($siteEntity); goto a6a51; b8a5b: a4ec7: goto ad5b4; E259b: $subjectAlternativeNames = []; goto E4e71; D1bad: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto D7add; Ce252: $subdomain = $resolvedDomainName->subDomain()->toString(); goto a31df; B267c: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto Ee1e3; fc033: $subjectAlternativeNames[] = $registrableDomain; goto D81be; E5aed: $siteEntity->setType(SiteEntity::TYPE_PHP); goto f1a6a; ee2d0: $siteEntity->setPhpSettings($phpSettingsEntity); goto F7655; c5e77: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto Abb14; } goto fc01b; c19cc: $varnishCacheSettings = array_merge($defaultVarnishCacheSettings, $varnishCacheSettings); goto C007f; b8292: $phpSiteCreator->reloadNginxService(); goto F8bb7; ff6bf: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto D8641; a3c1a: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto fd4d9; B8d8b: $rsaKeyGenerator = new RsaKeyGenerator(); goto F00ef; f1a6a: $siteEntity->setDomainName($domainName); goto adbc4; a84d6: $phpSiteCreator->createRootDirectory(); goto bbaa5; a6a51: return $siteEntity; goto D6eac; ae108: if (!(true === $varnishCache)) { goto db89b; } goto ca6d6; E4e71: if (!(true === is_null($subdomain))) { goto dd264; } goto B267c; f6b87: $siteEntity->setVarnishCache(true); goto ad4a1; e186e: $phpSiteCreator->createIndexPhp(); goto ab2ed; F8bb7: $phpSiteCreator->resetPermissions(); goto e71d0; C3358: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto Fee08; bfa5a: $vhostTemplate->build(); goto f33dc; D7add: if (!(false === empty($redirectionVhostTemplate))) { goto d3992; } goto A860f; B77c8: $csr = $csrGenerator->generate(); goto a3c1a; c335e: $constraintViolationList = new ConstraintViolationList(); goto A13bd; C400a: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto B64be; F7655: $phpSettingsEntity->setPhpVersion($phpVersion); goto fec61; ca6d6: $phpSite->setVarnishCache(true); goto B6171; cd442: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto abba2; } goto fc033; B1462: $certificateEntity->setSite($siteEntity); goto B8d8b; D7c4e: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto aaa93; D81be: abba2: goto a9efe; b7415: $certificateEntity->setCertificate($selfSignedCertificate); goto c6dd3; a00f5: $siteEntity->setUserPassword($siteUserPassword); goto Cfc1f; aaa93: $siteEntity = $this->siteEntityManager->createEntity(); goto E5aed; d40dc: $phpSiteCreator->createUser(); goto a84d6; B6171: $defaultVarnishCacheSettings = ["enabled" => false, "server" => self::VARNISH_CACHE_SERVER, "cacheTagPrefix" => substr(md5(time()), 0, 4)]; goto c19cc; A860f: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto Ba826; B6a6b: $phpSiteCreator->createNginxVhost(); goto b8292; Af216: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect-http3"); goto Bda8a; a9efe: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto f8d03; Bda8a: fddea: goto D1bad; E8919: $certificateEntity->setCsr($csr); goto ac6e3; c17d7: $phpSite->setUserPassword($siteEntity->getUserPassword()); goto ef20f; b1dff: $phpSettingsConstraints = $this->validator->validate($phpSettingsEntity); goto D4537; B64be: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto Ce252; Ba826: d3992: goto bef9f; d8b32: $phpSite->setPhpSettings($phpSettingsEntity); goto E28ff; bef9f: Abb14: goto F9150; ef20f: $phpSite->setDomainName($domainName); goto daed3; B9fc9: $phpSiteCreator = new PhpSiteCreator($phpSite); goto d40dc; ad5b4: $certificateEntity = $this->certificateEntityManager->createEntity(); goto B1462; ad4a1: F3a1b: goto c5e77; Ee1e3: dd264: goto cd442; A2af5: $phpSite->setRootDirectory($siteEntity->getRootDirectory()); goto c7150; A63f9: throw new \Exception(implode("; ", $errorMessages)); goto b8a5b; fa36d: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto bb6f7; ec686: $siteConstraints = $this->validator->validate($siteEntity); goto b1dff; d4cc3: $constraintViolationList->addAll($phpSettingsConstraints); goto c59d2; E5205: $phpSite->setUser($siteEntity->getUser()); goto c17d7; A13bd: $constraintViolationList->addAll($siteConstraints); goto d4cc3; F00ef: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto E259b; Fee08: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto e2937; D8641: goto fddea; goto f5969; bbaa5: $phpSiteCreator->createLogrotateFile(); goto e186e; d9d4c: $phpSite->setSubdomain($subdomain); goto A2af5; D4537: if (!(count($siteConstraints) || count($phpSettingsConstraints))) { goto a4ec7; } goto c335e; Fca4a: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto C8b7d; F9150: $siteEntity->setVhostTemplate($vhostTemplate); goto E5577; e5fde: $phpSiteCreator->reloadPhpFpmService(); goto ae108; bb6f7: $vhostTemplate->resetProcessors(); goto C3358; E28ff: $phpSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto B9fc9; b9ee9: if (!(false === empty($varnishCache))) { goto F3a1b; } goto f6b87; f5cd3: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto E8919; eaca5: $phpSite->setVarnishCacheSettings($varnishCacheSettings); goto f2889; fd4d9: $certificateEntity->setDefaultCertificate(true); goto f5cd3; Cfc1f: $siteEntity->setRootDirectory($rootDirectory); goto b9ee9; f8d03: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto B77c8; e2937: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto bfa5a; Bb081: $phpSite = new PhpSite(); goto E5205; a5fc9: $varnishCache = false === empty($varnishCacheSettings) ? true : false; goto c1f4b; c1f4b: $rootDirectory = trim(rtrim(ltrim($rootDirectory, "/")), "/"); goto C400a; ab2ed: $phpSiteCreator->createPrivateKeyAndCertificate(); goto B178a; c6dd3: $siteEntity->setCertificate($certificateEntity); goto Bb081; fc01b: if (true === isset($_ENV["APP_HTTP3"]) && "true" === $_ENV["APP_HTTP3"]) { goto f38cf; } goto ff6bf; c59d2: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto A63f9; D6eac: } private function createNodejsSite(string $domainName, string $nodejsVersion, string $port, string $siteUser, string $siteUserPassword) : SiteEntity { goto F912d; F2a1a: $vhostTemplate->build(); goto aa338; B80ca: if (!(true === is_null($subdomain))) { goto Bb4b6; } goto afa85; e1fbc: $siteEntity = $this->siteEntityManager->createEntity(); goto c344a; Df064: $nodejsSiteCreator->createLogrotateFile(); goto Db58a; E0863: $subjectAlternativeNames = []; goto B80ca; C26db: $siteEntity->setUser($siteUser); goto B7449; D7ab4: $nodejsSiteCreator->createRootDirectory(); goto Df064; Cf32e: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto b7f20; afb6b: $siteEntity->setNodejsSettings($nodejsSettingsEntity); goto B4095; A9611: $nodejsSiteCreator->createUser(); goto D7ab4; e16b6: $csr = $csrGenerator->generate(); goto Ca211; D2624: $nodejsSiteCreator->installNodejs(); goto bef74; Db58a: $nodejsSiteCreator->createNvmDirectory(); goto D2624; Db829: $subjectAlternativeNames[] = $registrableDomain; goto F30c7; Aa120: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect-http3"); goto b5938; c5d12: $siteEntity->setDomainName($domainName); goto C26db; B9c1b: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto E0863; be354: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::NODEJS_VHOST_TEMPLATE_NAME); goto Fec99; bef74: $nodejsSiteCreator->createPrivateKeyAndCertificate(); goto d9fdc; fee6d: $nodejsSettingsConstraints = $this->validator->validate($nodejsSettingsEntity); goto d51bd; e6368: if (true === isset($_ENV["APP_HTTP3"]) && "true" === $_ENV["APP_HTTP3"]) { goto aee78; } goto C93f9; c344a: $siteEntity->setType(SiteEntity::TYPE_NODEJS); goto c5d12; d3c30: $nodejsSite = new NodejsSite(); goto c9c53; c706e: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto b4125; fc333: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto F2a1a; C549b: $nodejsSite->setRootDirectory($siteEntity->getRootDirectory()); goto f84ea; C2e8e: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto C41b0; a060e: $nodejsSettingsEntity->setSite($siteEntity); goto eec16; C41b0: $certificateEntity->setCsr($csr); goto A81e8; afa85: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto c5b2e; c9c53: $nodejsSite->setUser($siteEntity->getUser()); goto B6908; Bca1a: $nodejsSite->setDomainName($domainName); goto f5598; C9c39: $constraintViolationList = new ConstraintViolationList(); goto Fbcbb; F132f: ac5bf: goto C0c42; f174f: $siteEntity->setRootDirectory($domainName); goto B2825; D06f2: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto Baa6b; B6908: $nodejsSite->setUserPassword($siteEntity->getUserPassword()); goto Bca1a; d1e51: $nodejsSiteCreator->resetPermissions(); goto f95c0; A083a: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto A850e; Fec99: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto e1fbc; b5938: cd71e: goto A083a; b7f20: $vhostTemplate->resetProcessors(); goto D06f2; f58bf: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto c8f4c; } goto Db829; c702c: return $siteEntity; goto f5b5a; A81e8: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto f4070; f97c4: $subdomain = false === empty($subdomain) ? $subdomain : null; goto be354; f5598: $nodejsSite->setRegistrableDomain($registrableDomain); goto C0544; aa338: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto c706e; B2825: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto be6d9; } goto e6368; ad565: throw new \Exception(implode("; ", $errorMessages)); goto B881e; f80d0: $nodejsSettingsEntity->setPort($port); goto a060e; f84ea: $nodejsSite->setCertificate($certificateEntity); goto c50b2; f4070: $certificateEntity->setCertificate($selfSignedCertificate); goto b1f56; Eda05: $certificateEntity->setDefaultCertificate(true); goto C2e8e; A850e: if (!(false === empty($redirectionVhostTemplate))) { goto ac5bf; } goto D9950; Fbcbb: $constraintViolationList->addAll($siteConstraints); goto Fdc32; B4095: $nodejsSettingsEntity->setNodejsVersion($nodejsVersion); goto f80d0; fa7d0: $nodejsSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto Eac52; C0c42: be6d9: goto dd418; eec16: $siteConstraints = $this->validator->validate($siteEntity); goto fee6d; c51fd: $subdomain = $resolvedDomainName->subDomain()->toString(); goto f97c4; A43e8: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto c51fd; A6047: $certificateEntity->setSite($siteEntity); goto f03b5; b1f56: $siteEntity->setCertificate($certificateEntity); goto d3c30; c50b2: $nodejsSite->setNodejsSettings($nodejsSettingsEntity); goto fa7d0; cf92f: goto cd71e; goto d0eeb; dd418: $siteEntity->setVhostTemplate($vhostTemplate); goto A8ffd; C0544: $nodejsSite->setSubdomain($subdomain); goto C549b; Ca211: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto Eda05; d0eeb: aee78: goto Aa120; c5b2e: Bb4b6: goto f58bf; A8ffd: $nodejsSettingsEntity = new NodejsSettingsEntity(); goto afb6b; d9fdc: $nodejsSiteCreator->createNginxVhost(); goto e32fa; b4125: $this->siteEntityManager->updateEntity($siteEntity); goto c702c; F912d: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto A43e8; Baa6b: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto fc333; f03b5: $rsaKeyGenerator = new RsaKeyGenerator(); goto B9c1b; d7bb9: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto ad565; C93f9: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto cf92f; Bd62b: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto e16b6; B881e: b3dae: goto F196a; D9950: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto F132f; F196a: $certificateEntity = $this->certificateEntityManager->createEntity(); goto A6047; e32fa: $nodejsSiteCreator->reloadNginxService(); goto d1e51; f95c0: $vhostTemplate = new StaticVhostTemplate($nodejsSite); goto Cf32e; B7449: $siteEntity->setUserPassword($siteUserPassword); goto f174f; d51bd: if (!(count($siteConstraints) || count($nodejsSettingsConstraints))) { goto b3dae; } goto C9c39; F30c7: c8f4c: goto c2d07; c2d07: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto Bd62b; Eac52: $nodejsSiteCreator = new NodejsSiteCreator($nodejsSite); goto A9611; Fdc32: $constraintViolationList->addAll($nodejsSettingsConstraints); goto d7bb9; f5b5a: } private function createPythonSite(string $domainName, string $pythonVersion, string $port, string $siteUser, string $siteUserPassword) : SiteEntity { goto F2d4f; Dfa3e: A8702: goto Fbc37; dc34d: if (!(count($siteConstraints) || count($pythonSettingsConstraints))) { goto C9e8c; } goto D639f; dc3f5: if (!(false === empty($redirectionVhostTemplate))) { goto b58b5; } goto f5fad; aa009: $pythonSiteCreator->writePythonVersionFile(); goto a87ea; c9f8c: $pythonSite->setCertificate($certificateEntity); goto Ca7bc; Eb74d: $pythonSettingsEntity->setPort($port); goto C832e; b1883: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto d3679; } goto afe10; ee577: $siteEntity->setDomainName($domainName); goto fd1f5; b3153: $constraintViolationList->addAll($pythonSettingsConstraints); goto edc75; De3ab: $pythonSiteCreator->createRootDirectory(); goto A599e; A599e: $pythonSiteCreator->createLogrotateFile(); goto aa009; C7ad9: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto d481b; f8b72: $subdomain = false === empty($subdomain) ? $subdomain : null; goto a1e92; Aba31: $rsaKeyGenerator = new RsaKeyGenerator(); goto C7ad9; e260d: b58b5: goto Dfa3e; d4169: $vhostTemplate = new PythonVhostTemplate($pythonSite); goto B8c7e; F2ad8: $certificateEntity->setCsr($csr); goto d7da2; A2094: $pythonSettingsConstraints = $this->validator->validate($pythonSettingsEntity); goto dc34d; b6b39: $siteEntity->setType(SiteEntity::TYPE_PYTHON); goto ee577; dbd64: $certificateEntity = $this->certificateEntityManager->createEntity(); goto D59f5; bb287: goto d7892; goto F0f6f; e01ae: $siteEntity = $this->siteEntityManager->createEntity(); goto b6b39; D5e1f: a33a0: goto b1883; A6f4b: $pythonSiteCreator->resetPermissions(); goto d4169; F0f6f: F21bf: goto B5697; E85ed: C9e8c: goto dbd64; C364e: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto e4cef; ac7d6: if (true === isset($_ENV["APP_HTTP3"]) && "true" === $_ENV["APP_HTTP3"]) { goto F21bf; } goto dd3ba; Ed0ea: $vhostTemplate->resetProcessors(); goto fb18f; f274e: $siteEntity->setRootDirectory($domainName); goto A2303; e2b27: d7892: goto bf59f; c8260: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto F2ad8; d7da2: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto dcc0b; e4cef: $subdomain = $resolvedDomainName->subDomain()->toString(); goto f8b72; Da667: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto e3fd5; d9634: $constraintViolationList->addAll($siteConstraints); goto b3153; b6328: $pythonSite->setRegistrableDomain($registrableDomain); goto f84be; ad3fd: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto cef37; Cddbc: $pythonSite = new PythonSite(); goto A490e; bf59f: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto dc3f5; a1e92: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::PYTHON_VHOST_TEMPLATE_NAME); goto d8a4d; Fbc37: $siteEntity->setVhostTemplate($vhostTemplate); goto C8aac; Cc285: d3679: goto b224c; a1d2d: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto D9fa1; dd3ba: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto bb287; afe10: $subjectAlternativeNames[] = $registrableDomain; goto Cc285; bb7b0: $pythonSite->setDomainName($domainName); goto b6328; C832e: $pythonSettingsEntity->setSite($siteEntity); goto b2b96; Bcd0f: $pythonSiteCreator->createUser(); goto De3ab; E80dc: $pythonSite->setRootDirectory($siteEntity->getRootDirectory()); goto c9f8c; Cbb82: $pythonSite->setUserPassword($siteEntity->getUserPassword()); goto bb7b0; dcc0b: $certificateEntity->setCertificate($selfSignedCertificate); goto a903b; a8292: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto e6d36; decc4: $pythonSiteCreator->reloadNginxService(); goto A6f4b; Cbff3: $pythonSettingsEntity->setPythonVersion($pythonVersion); goto Eb74d; e5372: $this->siteEntityManager->updateEntity($siteEntity); goto ad3fd; b5b40: if (!(true === is_null($subdomain))) { goto a33a0; } goto Bbf74; cef37: return $siteEntity; goto Ecfe6; fb18f: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto E6afc; d8a4d: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto e01ae; D639f: $constraintViolationList = new ConstraintViolationList(); goto d9634; c2808: $pythonSiteCreator->createNginxVhost(); goto decc4; f84be: $pythonSite->setSubdomain($subdomain); goto E80dc; a87ea: $pythonSiteCreator->createPrivateKeyAndCertificate(); goto c2808; Bbf74: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto D5e1f; b2b96: $siteConstraints = $this->validator->validate($siteEntity); goto A2094; e6d36: $certificateEntity->setDefaultCertificate(true); goto c8260; e5901: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto e5372; B8c7e: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto Ed0ea; a903b: $siteEntity->setCertificate($certificateEntity); goto Cddbc; edc75: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto bcaa9; F2951: $siteEntity->setPythonSettings($pythonSettingsEntity); goto Cbff3; b224c: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto a1d2d; E6afc: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto Da667; b19f9: $pythonSiteCreator = new PythonSiteCreator($pythonSite); goto Bcd0f; f5fad: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto e260d; D59f5: $certificateEntity->setSite($siteEntity); goto Aba31; A2303: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto A8702; } goto ac7d6; D9fa1: $csr = $csrGenerator->generate(); goto a8292; e3fd5: $vhostTemplate->build(); goto e5901; bcaa9: throw new \Exception(implode("; ", $errorMessages)); goto E85ed; Ca7bc: $pythonSite->setPythonSettings($pythonSettingsEntity); goto Eac2b; B5697: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect-http3"); goto e2b27; d481b: $subjectAlternativeNames = []; goto b5b40; A490e: $pythonSite->setUser($siteEntity->getUser()); goto Cbb82; Bc84a: $siteEntity->setUserPassword($siteUserPassword); goto f274e; fd1f5: $siteEntity->setUser($siteUser); goto Bc84a; F2d4f: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto C364e; Eac2b: $pythonSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto b19f9; C8aac: $pythonSettingsEntity = new PythonSettingsEntity(); goto F2951; Ecfe6: } private function createStaticSite(string $domainName, string $siteUser, string $siteUserPassword) : SiteEntity { goto F4ff4; a854a: $certificateEntity->setDefaultCertificate(true); goto bafe2; e883b: if (!(true === is_null($subdomain))) { goto D343a; } goto Ec5b6; A39f0: if (!count($siteConstraints)) { goto c71a5; } goto B96d5; d3077: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto d5fc3; A0ff7: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto Eb69c; ff3ae: $staticSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto Fa3cc; B56d7: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto F34a1; } goto Eebc6; acf1f: $certificateEntity = $this->certificateEntityManager->createEntity(); goto A142e; Cc398: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto a854a; Fc78e: $staticSiteCreator->createRootDirectory(); goto b07dd; fe289: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto d50bb; F3063: D343a: goto ddcea; eb7af: $siteEntity->setVhostTemplate($vhostTemplate); goto B54d2; B5640: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto Ddf71; ada27: $vhostTemplate = new StaticVhostTemplate($staticSite); goto B5640; E91bc: goto A92c0; goto D6339; D6339: ec7ea: goto F4113; b61b5: $staticSite->setRootDirectory($siteEntity->getRootDirectory()); goto Efd20; Eebc6: if (true === isset($_ENV["APP_HTTP3"]) && "true" === $_ENV["APP_HTTP3"]) { goto ec7ea; } goto Dec15; bafe2: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto Bbb63; A75c6: F34a1: goto eb7af; Cfd32: $vhostTemplate->build(); goto A0ff7; F7343: d29f1: goto D2a24; bf464: $siteEntity->setType(SiteEntity::TYPE_STATIC); goto Ab3e3; Bda4d: if (!(false === empty($redirectionVhostTemplate))) { goto Dfc85; } goto f080d; D6fad: throw new \Exception(implode("; ", $errorMessages)); goto Eacc6; Dec15: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto E91bc; ba51f: $staticSite->setSubdomain($subdomain); goto b61b5; Fa3cc: $staticSiteCreator = new StaticSiteCreator($staticSite); goto Bf789; c04c3: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto da527; Eacc6: c71a5: goto acf1f; b3468: $subjectAlternativeNames[] = $registrableDomain; goto F7343; Db55b: $staticSiteCreator->reloadNginxService(); goto F0a36; E1a7f: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto a59ba; d50bb: $siteEntity = $this->siteEntityManager->createEntity(); goto bf464; Efd20: $staticSite->setCertificate($certificateEntity); goto ff3ae; F0a36: $staticSiteCreator->resetPermissions(); goto ada27; a8413: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto b45e4; e456a: $staticSite->setRegistrableDomain($registrableDomain); goto ba51f; fa073: $siteEntity->setCertificate($certificateEntity); goto e8525; d54ba: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto D6fad; E62a8: $siteEntity->setRootDirectory($domainName); goto B56d7; f080d: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto a3197; d5fc3: $subjectAlternativeNames = []; goto e883b; a3197: Dfc85: goto A75c6; ff092: $certificateEntity->setCertificate($selfSignedCertificate); goto fa073; da527: $subdomain = $resolvedDomainName->subDomain()->toString(); goto Fc72b; Ba6d4: $staticSite->setDomainName($domainName); goto e456a; Fc72b: $subdomain = false === empty($subdomain) ? $subdomain : null; goto b265b; b265b: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::STATIC_SITE_VHOST_TEMPLATE_NAME); goto fe289; b45e4: $csr = $csrGenerator->generate(); goto Cc398; dcd1b: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto Cfd32; e7e62: $this->siteEntityManager->updateEntity($siteEntity); goto e31a2; b9cf8: $siteEntity->setUserPassword($siteUserPassword); goto E62a8; Ab3e3: $siteEntity->setDomainName($domainName); goto bc97c; ddcea: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto d29f1; } goto b3468; e8532: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto ff092; e8525: $staticSite = new StaticSite(); goto Cfaf9; F4ff4: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto c04c3; d2461: $staticSite->setUserPassword($siteEntity->getUserPassword()); goto Ba6d4; Eb69c: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto e7e62; D2a24: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto a8413; Eab09: $staticSiteCreator->createNginxVhost(); goto Db55b; Cfaf9: $staticSite->setUser($siteEntity->getUser()); goto d2461; D6feb: $constraintViolationList->addAll($siteConstraints); goto d54ba; bc97c: $siteEntity->setUser($siteUser); goto b9cf8; ec573: A92c0: goto fd126; A142e: $certificateEntity->setSite($siteEntity); goto Dc272; Dc272: $rsaKeyGenerator = new RsaKeyGenerator(); goto d3077; Bf789: $staticSiteCreator->createUser(); goto Fc78e; B640f: $staticSiteCreator->createPrivateKeyAndCertificate(); goto Eab09; b07dd: $staticSiteCreator->createLogrotateFile(); goto B025f; e31a2: return $siteEntity; goto B9769; Ddf71: $vhostTemplate->resetProcessors(); goto E1a7f; F4113: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect-http3"); goto ec573; Bbb63: $certificateEntity->setCsr($csr); goto e8532; B54d2: $siteConstraints = $this->validator->validate($siteEntity); goto A39f0; Ec5b6: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto F3063; B025f: $staticSiteCreator->createIndexHtml(); goto B640f; fd126: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto Bda4d; a59ba: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto dcd1b; B96d5: $constraintViolationList = new ConstraintViolationList(); goto D6feb; B9769: } private function createReverseProxySite(string $domainName, string $reverseProxyUrl, string $siteUser, string $siteUserPassword) : SiteEntity { goto c7d4c; cf03e: $reversProxySiteCreator->createUser(); goto D0a47; C0829: if (true === isset($_ENV["APP_HTTP3"]) && "true" === $_ENV["APP_HTTP3"]) { goto Bff98; } goto e15b4; b9c8a: $vhostTemplate = new ReverseProxyVhostTemplate($reverseProxySite); goto f75f1; b2a64: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto a156e; a156e: $certificateEntity->setDefaultCertificate(true); goto f22a9; Ad5d6: if (!count($siteConstraints)) { goto b1ad7; } goto B4f38; f06ad: goto D38bd; goto C0f58; e194e: $constraintViolationList->addAll($siteConstraints); goto b41ed; ba716: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto E9fd0; D0a47: $reversProxySiteCreator->createRootDirectory(); goto e9890; b30d4: $siteEntity->setDomainName($domainName); goto D3abc; e15b4: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto f06ad; b41ed: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto B8cbe; Bbd08: $reversProxySiteCreator->createPrivateKeyAndCertificate(); goto D627f; e69cb: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto afa65; Bec48: $siteEntity->setReverseProxyUrl($reverseProxyUrl); goto eabc6; f802e: $reverseProxySite->setDomainName($domainName); goto c9cb8; B8cbe: throw new \Exception(implode("; ", $errorMessages)); goto f61bb; D5059: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto C1f0a; } goto f19b2; eabc6: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto b0368; } goto C0829; c9cb8: $reverseProxySite->setRegistrableDomain($registrableDomain); goto A48dc; e44df: D38bd: goto fdfdc; C6870: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto A6062; D9e99: $reverseProxySite = new ReverseProxySite(); goto C0564; E4f60: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto ed86d; e4f14: $vhostTemplate->resetProcessors(); goto c31b5; F7ee9: $reverseProxySite->setRootDirectory($siteEntity->getRootDirectory()); goto C82d4; bd93c: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::REVERSE_PROXY_VHOST_TEMPLATE_NAME); goto c5495; B1c2b: $siteEntity->setRootDirectory($domainName); goto Bec48; Abc82: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto Eed78; D3abc: $siteEntity->setUser($siteUser); goto ace58; A6062: c44f4: goto Bbc42; D69ad: $siteEntity->setVhostTemplate($vhostTemplate); goto De003; C0f58: Bff98: goto A5e79; F1b51: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto a747d; ace58: $siteEntity->setUserPassword($siteUserPassword); goto B1c2b; c31b5: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto e3bba; c5495: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto C635b; B4f38: $constraintViolationList = new ConstraintViolationList(); goto e194e; c7d4c: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto b2e4d; E9fd0: $vhostTemplate->build(); goto e69cb; B5bba: $subdomain = false === empty($subdomain) ? $subdomain : null; goto bd93c; B15b0: if (!(true === is_null($subdomain))) { goto Ceae9; } goto E4f60; C0564: $reverseProxySite->setUser($siteEntity->getUser()); goto B8b6c; D008a: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto Abc82; afa65: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto cf1a9; Eed78: $csr = $csrGenerator->generate(); goto b2a64; e9890: $reversProxySiteCreator->createLogrotateFile(); goto Bbd08; Db572: $reverseProxySite->setReverseProxyUrl($reverseProxyUrl); goto a5e66; bbd4c: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto cbffe; f19b2: $subjectAlternativeNames[] = $registrableDomain; goto C7d8c; C82d4: $reverseProxySite->setCertificate($certificateEntity); goto Db572; a5e66: $reverseProxySite->setVhostTemplate($siteEntity->getVhostTemplate()); goto e8c34; F1206: $reversProxySiteCreator->resetPermissions(); goto b9c8a; A2973: $certificateEntity->setCsr($csr); goto F1b51; f22a9: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto A2973; f75f1: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto e4f14; cbffe: $subjectAlternativeNames = []; goto B15b0; fc3ba: $rsaKeyGenerator = new RsaKeyGenerator(); goto bbd4c; ed86d: Ceae9: goto D5059; d8317: $certificateEntity->setSite($siteEntity); goto fc3ba; Cd7c0: $siteEntity->setCertificate($certificateEntity); goto D9e99; b2e4d: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto d239b; D627f: $reversProxySiteCreator->createNginxVhost(); goto B09c4; E59e3: if (!(false === empty($redirectionVhostTemplate))) { goto c44f4; } goto C6870; F4f13: $certificateEntity = $this->certificateEntityManager->createEntity(); goto d8317; fdfdc: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto E59e3; fb0ca: $siteEntity->setType(SiteEntity::TYPE_REVERSE_PROXY); goto b30d4; e3bba: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto ba716; C1c53: return $siteEntity; goto Dd6ca; A5e79: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect-http3"); goto e44df; C635b: $siteEntity = $this->siteEntityManager->createEntity(); goto fb0ca; f61bb: b1ad7: goto F4f13; A48dc: $reverseProxySite->setSubdomain($subdomain); goto F7ee9; B09c4: $reversProxySiteCreator->reloadNginxService(); goto F1206; e8c34: $reversProxySiteCreator = new ReverseProxySiteCreator($reverseProxySite); goto cf03e; B8b6c: $reverseProxySite->setUserPassword($siteEntity->getUserPassword()); goto f802e; De003: $siteConstraints = $this->validator->validate($siteEntity); goto Ad5d6; cf1a9: $this->siteEntityManager->updateEntity($siteEntity); goto C1c53; Bbc42: b0368: goto D69ad; d239b: $subdomain = $resolvedDomainName->subDomain()->toString(); goto B5bba; C7d8c: C1f0a: goto D008a; a747d: $certificateEntity->setCertificate($selfSignedCertificate); goto Cd7c0; Dd6ca: } public function installedWordPressSite(Request $request) : Response { goto d5503; D609d: goto D200b; goto a6687; a3a64: $siteCredentials = $this->renderSiteCredentials($siteCredentials); goto ef550; a2ac6: $siteCredentials = $session->get("siteCredentials"); goto c0bf7; d5503: $session = $request->getSession(); goto a2ac6; a6687: d2fc9: goto a3a64; cee90: D200b: goto be068; ef550: $response = $this->render("Frontend/Site/New/wordpress-installed.html.twig", ["siteCredentials" => $siteCredentials]); goto f4055; A067a: $response = $this->redirect($this->generateUrl("clp_sites")); goto D609d; be068: return $response; goto Ae7b9; f4055: return $response; goto cee90; c0bf7: if (false === empty($siteCredentials)) { goto d2fc9; } goto A067a; Ae7b9: } private function renderSiteCredentials(array $siteCredentials) : string { goto cb3b7; db6dd: cdc74: goto D722e; D3b1e: foreach ($siteCredentials as $section => $sectionData) { goto Eaf64; bb93a: foreach ($sectionData as $key => $value) { $renderedCredentials .= sprintf("%s: %s", $key, $value) . PHP_EOL; Ebd63: } goto a9720; De74e: Ac90e: goto F89b1; Eaf64: $renderedCredentials .= $section . PHP_EOL; goto f57da; a9720: F7a01: goto B3282; f57da: $renderedCredentials .= "------------------------------------------------------" . PHP_EOL; goto bb93a; B3282: $renderedCredentials .= PHP_EOL; goto De74e; F89b1: } goto db6dd; D722e: return $renderedCredentials; goto C5084; cb3b7: $renderedCredentials = ''; goto D3b1e; C5084: } private function getVhostTemplateEntity(string $name) : mixed { goto c176b; Adee5: fe802: goto Ddec4; C898d: throw new \Exception($this->translator->trans("Vhost Template %vhostTemplate% does not exist.", ["%vhostTemplate%" => $name])); goto Adee5; Ddec4: return $vhostTemplateEntity; goto c89e8; A541a: if (!(true === is_null($vhostTemplateEntity))) { goto fe802; } goto C898d; c176b: $vhostTemplateEntity = $this->vhostTemplateEntityManager->findOneByName($name); goto A541a; c89e8: } private function getConstraintViolationListErrorMessages(ConstraintViolationList $constraintViolationList) : array { goto b76a7; b76a7: $errorMessages = []; goto B1fa7; D47e7: return $errorMessages; goto B95ab; B1fa7: foreach ($constraintViolationList as $constraint) { $errorMessages[] = sprintf("%s: %s", $constraint->getPropertyPath(), $constraint->getMessage()); f7df3: } goto d7431; d7431: b0402: goto D47e7; B95ab: } private function generateNameFromDomainName(string $domainName) : string { goto c6820; c6820: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto ff9d1; Fc7a7: $name = sprintf("%s-%s", $explodedRegistrableDomain[0] ?? '', implode("-", $explodedSubdomain)); goto baa4e; ea691: d2058: goto a8985; D5e61: if ("www" == $subdomain) { goto d2058; } goto D93cc; E9162: b52e9: goto af68f; f537f: if (!(false === empty($subdomain))) { goto fcb55; } goto Cfec8; a8985: $name = $explodedRegistrableDomain[0] ?? ''; goto E9162; ad618: $subdomain = $resolvedDomainName->subDomain()->toString(); goto c55f3; Eabd9: goto b52e9; goto ea691; ff9d1: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto ad618; D93cc: $name = $explodedRegistrableDomain[0] ?? ''; goto f537f; af68f: return $name; goto F85e8; Cfec8: $explodedSubdomain = explode(".", $subdomain); goto Fc7a7; c55f3: $explodedRegistrableDomain = explode(".", $registrableDomain); goto D5e61; baa4e: fcb55: goto Eabd9; F85e8: } private function getUniqueDatabaseName(string $databaseName) : string { goto Bc4ba; cf650: $i++; goto E726b; f24e8: E2058: goto c965f; b3847: aa2ae: goto Ff4cf; dd81e: if (!(strlen($uniqueDatabaseName) <= 3)) { goto Ea071; } goto f0690; Ff4cf: if (!(0 < $i)) { goto E2058; } goto c8226; E726b: if (true === $databaseExists) { goto aa2ae; } goto fd642; F85ae: return $uniqueDatabaseName; goto feb5a; Bc4ba: $uniqueDatabaseName = $databaseName; goto dd81e; d977c: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto A7cc3; c965f: $databaseExists = in_array($uniqueDatabaseName, $databases); goto cf650; ab548: $databases = $databaseConnection->getDatabases(); goto b3847; B8288: $i = 0; goto d977c; A7cc3: $databaseConnection = new DatabaseConnection($activeDatabaseServerEntity); goto ab548; f0690: $uniqueDatabaseName = sprintf("%s-db", $uniqueDatabaseName); goto cea77; c8226: $uniqueDatabaseName = sprintf("%s-%s", $databaseName, $i); goto f24e8; cea77: Ea071: goto B8288; fd642: bea7b: goto F85ae; feb5a: } private function getUniqueDatabaseUserName(string $databaseUserName) : string { goto a3d15; A2d9e: $uniqueDatabaseUserName = mb_substr($uniqueDatabaseUserName, 0, 32); goto c717e; Cbdc7: $i = 0; goto F1e7a; a5355: if (false === is_null($databaseUserEntity)) { goto E626e; } goto c4e20; a3d15: $uniqueDatabaseUserName = $databaseUserName; goto A583b; F0663: if (!(0 < $i)) { goto f946e; } goto A73de; A583b: if (!(strlen($uniqueDatabaseUserName) <= 3)) { goto e8af0; } goto Df3c3; c4e20: A3627: goto A2d9e; A73de: $uniqueDatabaseUserName = sprintf("%s-%s", $databaseUserName, $i); goto A993f; A993f: f946e: goto F9af1; F9af1: $databaseUserEntity = $this->databaseUserEntityManager->findOneByUserName($uniqueDatabaseUserName); goto F7e8d; Df3c3: $uniqueDatabaseUserName = sprintf("%s-db", $uniqueDatabaseUserName); goto D0482; c717e: return $uniqueDatabaseUserName; goto f6d8f; D0482: e8af0: goto Cbdc7; F1e7a: E626e: goto F0663; F7e8d: $i++; goto a5355; f6d8f: } private function hasPermissions() : bool { goto Af4c7; aa445: if (!(UserEntity::ROLE_USER != $user->getRole())) { goto dee12; } goto A37f8; Af4c7: $user = $this->getUser(); goto aa445; C1630: return false; goto ccf02; fda64: dee12: goto C1630; A37f8: return true; goto fda64; ccf02: } } ?>
Did this file decode correctly?
Original Code
<?php
namespace App\Controller\Frontend; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Form\Form; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; use Symfony\Component\Validator\ConstraintViolationList; use App\Controller\Controller; use App\Event\EventQueue; use App\Service\Logger; use App\Entity\Site as SiteEntity; use App\Entity\Certificate as CertificateEntity; use App\Entity\NodejsSettings as NodejsSettingsEntity; use App\Entity\PhpSettings as PhpSettingsEntity; use App\Entity\PythonSettings as PythonSettingsEntity; use App\Entity\Database as DatabaseEntity; use App\Entity\DatabaseUser as DatabaseUserEntity; use App\Entity\DatabaseServer as DatabaseServerEntity; use App\Entity\User as UserEntity; use App\Entity\Manager\ConfigManager; use App\Entity\Manager\SiteManager as SiteEntityManager; use App\Entity\Manager\CertificateManager as CertificateEntityManager; use App\Entity\Manager\DatabaseManager as DatabaseEntityManager; use App\Entity\Manager\DatabaseUserManager as DatabaseUserEntityManager; use App\Entity\Manager\DatabaseServerManager as DatabaseServerEntityManager; use App\Entity\Manager\VhostTemplateManager as VhostTemplateEntityManager; use App\Database\Connection as DatabaseConnection; use App\Database\Manager as DatabaseManager; use App\Site\Nginx\Vhost\StaticTemplate as StaticVhostTemplate; use App\Site\Nginx\Vhost\PhpTemplate as PhpVhostTemplate; use App\Site\Nginx\Vhost\PythonTemplate as PythonVhostTemplate; use App\Site\Nginx\Vhost\ReverseProxyTemplate as ReverseProxyVhostTemplate; use App\Site\Nginx\Vhost\Processor\RedirectDomain as RedirectDomainProcessor; use App\Site\Nginx\Vhost\Processor\RedirectServerName as RedirectServerNameProcessor; use App\Site\Nginx\Vhost\Processor\ServerName as ServerNameProcessor; use App\Site\Parser\DomainName as DomainNameParser; use App\Site\Ssl\Generator\RsaKeyGenerator; use App\Site\Creator\NodejsSite as NodejsSiteCreator; use App\Site\Creator\StaticSite as StaticSiteCreator; use App\Site\Creator\PhpSite as PhpSiteCreator; use App\Site\Creator\PythonSite as PythonSiteCreator; use App\Site\Creator\ReverseProxySite as ReverseProxySiteCreator; use App\Site\Ssl\DistinguishedName; use App\Site\Ssl\Generator\CsrGenerator; use App\Site\Ssl\Util\Openssl; use App\Site\NodejsSite; use App\Site\StaticSite; use App\Site\PhpSite; use App\Site\PythonSite; use App\Site\ReverseProxySite; use App\Util\PasswordGenerator; use App\Site\Application\WordPressInstaller; use App\Service\Crypto; class NewSiteController extends Controller { private const WORDPRESS_VHOST_TEMPLATE_NAME = "\127\x6f\162\x64\120\162\145\x73\x73"; private const NODEJS_VHOST_TEMPLATE_NAME = "\116\x6f\144\145\152\x73"; private const STATIC_SITE_VHOST_TEMPLATE_NAME = "\123\x74\141\x74\x69\143"; private const PYTHON_VHOST_TEMPLATE_NAME = "\x50\171\164\x68\x6f\x6e"; private const REVERSE_PROXY_VHOST_TEMPLATE_NAME = "\122\145\x76\x65\162\x73\x65\120\x72\x6f\170\171"; private const VARNISH_CACHE_SERVER = "\x31\x32\67\x2e\x30\x2e\x30\56\x31\x3a\x36\60\70\61"; private const PASSWORD_LENGTH = 20; private ConfigManager $configManager; private SiteEntityManager $siteEntityManager; private CertificateEntityManager $certificateEntityManager; private DatabaseEntityManager $databaseEntityManager; private DatabaseUserEntityManager $databaseUserEntityManager; private DatabaseServerEntityManager $databaseServerEntityManager; private DomainNameParser $domainNameParser; private VhostTemplateEntityManager $vhostTemplateEntityManager; private ValidatorInterface $validator; private array $wordPressDefaultConfigValues = ["\106\x53\x5f\115\105\124\110\117\x44" => ["\166\141\154\x75\x65" => "\x64\x69\x72\x65\x63\x74", "\162\x61\x77" => false], "\127\x50\x5f\104\105\102\125\x47\137\x44\111\123\x50\x4c\x41\x59" => ["\x76\141\x6c\165\145" => "\x66\x61\154\x73\145", "\x72\141\x77" => true], "\x57\120\137\x44\105\102\125\x47\137\x4c\117\x47" => ["\166\141\x6c\165\145" => "\164\162\165\x65", "\162\x61\167" => true], "\103\x4f\116\x43\x41\x54\105\116\x41\124\105\x5f\123\x43\122\111\120\x54\x53" => ["\166\x61\154\x75\145" => "\x66\x61\154\163\145", "\x72\x61\x77" => true], "\x41\125\124\117\123\x41\x56\105\137\111\116\124\105\x52\126\101\114" => ["\166\141\154\165\145" => 600, "\x72\x61\167" => true], "\127\120\137\120\117\x53\124\137\122\105\126\x49\123\111\x4f\116\123" => ["\x76\x61\154\x75\145" => 5, "\162\x61\x77" => true], "\105\115\x50\124\131\x5f\124\x52\x41\123\110\x5f\x44\101\131\x53" => ["\166\141\154\x75\x65" => 21, "\x72\141\167" => true]]; private array $wordPressMultiSiteConfigValues = ["\127\120\137\x41\x4c\x4c\x4f\x57\137\x4d\125\114\x54\x49\123\x49\124\x45" => ["\166\141\154\x75\x65" => "\164\x72\x75\145", "\162\141\167" => true], "\x4d\125\x4c\124\111\123\111\124\105" => ["\166\x61\x6c\x75\x65" => "\x74\x72\165\145", "\x72\x61\167" => true], "\x53\125\x42\x44\x4f\x4d\x41\111\x4e\137\x49\116\x53\x54\101\x4c\x4c" => ["\x76\141\154\x75\x65" => "\x66\141\154\x73\145", "\162\141\x77" => true], "\104\x4f\115\x41\x49\116\137\x43\125\122\x52\105\x4e\x54\137\x53\x49\124\x45" => ["\x76\x61\154\165\145" => '', "\x72\141\x77" => false], "\x50\x41\x54\x48\137\x43\x55\x52\x52\x45\x4e\x54\137\123\111\124\x45" => ["\x76\141\154\x75\x65" => "\x2f", "\162\x61\167" => false], "\123\111\x54\105\137\111\104\x5f\x43\x55\x52\x52\105\116\124\137\123\x49\124\x45" => ["\x76\141\x6c\165\145" => 1, "\162\x61\x77" => true], "\x42\x4c\x4f\107\x5f\111\x44\137\103\125\x52\122\105\x4e\x54\137\x53\x49\124\x45" => ["\x76\141\x6c\x75\x65" => 1, "\162\141\x77" => true]]; public function __construct(ConfigManager $configManager, SiteEntityManager $siteEntityManager, CertificateEntityManager $certificateEntityManager, DatabaseEntityManager $databaseEntityManager, DatabaseUserEntityManager $databaseUserEntityManager, DatabaseServerEntityManager $databaseServerEntityManager, VhostTemplateEntityManager $vhostTemplateEntityManager, DomainNameParser $domainNameParser, ValidatorInterface $validator, TranslatorInterface $translator, Logger $logger) { goto b212c; Bab88: parent::__construct($translator, $logger); goto D3e3a; D5381: $this->siteEntityManager = $siteEntityManager; goto b4e0a; b9200: $this->domainNameParser = $domainNameParser; goto c9ea7; b212c: $this->configManager = $configManager; goto D5381; C827b: $this->databaseEntityManager = $databaseEntityManager; goto C4a30; d2224: $this->vhostTemplateEntityManager = $vhostTemplateEntityManager; goto b9200; C4a30: $this->databaseUserEntityManager = $databaseUserEntityManager; goto eec09; eec09: $this->databaseServerEntityManager = $databaseServerEntityManager; goto d2224; b4e0a: $this->certificateEntityManager = $certificateEntityManager; goto C827b; c9ea7: $this->validator = $validator; goto Bab88; D3e3a: } public function index(Request $request) : Response { goto A45fb; Cbad4: $response = $this->render("\x46\162\x6f\x6e\164\145\x6e\x64\57\x53\x69\x74\x65\57\x4e\x65\167\57\x69\156\144\145\170\56\x68\x74\x6d\154\56\x74\x77\x69\147", ["\x75\163\x65\x72" => $user]); goto d3233; e1ffb: $user = $this->getUser(); goto Cbad4; e3373: if (true === $hasPermissions) { goto e305a; } goto Ce80b; d3233: c7354: goto B631c; A45fb: $hasPermissions = $this->hasPermissions(); goto e3373; c3d28: goto c7354; goto af783; B631c: return $response; goto A2cda; Ce80b: $response = $this->redirect($this->generateUrl("\x63\x6c\x70\x5f\163\151\x74\x65\163")); goto c3d28; af783: e305a: goto e1ffb; A2cda: } public function newPythonSite(Request $request) : Response { goto A2aad; D8d63: $response = $this->redirect($this->generateUrl("\143\x6c\160\x5f\163\x69\x74\x65\x73")); goto E881f; A1046: return $response; goto e82bb; C1829: cfacf: goto c83e3; A2aad: $hasPermissions = $this->hasPermissions(); goto E43e8; d7805: $form->handleRequest($request); goto A421d; E3ab3: $response = $this->render("\106\162\x6f\156\x74\145\x6e\x64\57\x53\151\164\145\57\116\x65\167\x2f\160\x79\x74\x68\157\156\x2e\150\x74\x6d\x6c\56\164\x77\151\147", ["\165\x73\x65\x72" => $user, "\x66\157\x72\155" => $form->createView(), "\x66\x6f\x72\x6d\x45\162\162\157\x72\163" => $this->formErrors]); goto C2977; C2977: ba024: goto A1046; ca3a0: Edc84: goto E3ab3; A421d: if (!(true === $form->isSubmitted())) { goto A930d; } goto b5867; E881f: goto ba024; goto Ce650; c83e3: A930d: goto ca3a0; b5867: $response = $this->handleCreatePythonSiteForm($request, $form); goto b1239; acf43: if (!(true === $request->isMethod("\120\x4f\x53\124"))) { goto Edc84; } goto d7805; b1239: if (!(false === is_null($response))) { goto cfacf; } goto A5fe0; Ce650: e9003: goto d5ab4; b757e: $form = $this->createPythonSiteForm($pythonSettings); goto acf43; E43e8: if (true === $hasPermissions) { goto e9003; } goto D8d63; A553d: $pythonSettings = new PythonSettingsEntity(); goto b757e; A5fe0: return $response; goto C1829; d5ab4: $user = $this->getUser(); goto A553d; e82bb: } private function createPythonSiteForm(PythonSettingsEntity $pythonSettings) : Form { goto C3883; c79b5: return $form; goto fa8fc; F8347: $form->add("\x73\x75\x62\x6d\x69\x74", SubmitType::class, ["\x61\x74\x74\x72" => ["\x63\x6c\x61\163\163" => "\x62\164\x6e\x20\142\x74\156\55\x6c\x67\40\142\164\156\x2d\142\x6c\x75\x65"], "\154\141\x62\x65\x6c" => "\x43\x72\145\x61\164\x65"]); goto c79b5; C3883: $form = $this->createForm("\101\x70\160\x5c\x46\157\x72\x6d\134\123\x69\164\x65\x4e\x65\167\x50\x79\164\x68\157\x6e\x54\171\x70\x65", $pythonSettings, ["\x61\143\x74\x69\157\156" => $this->generateUrl("\x63\154\x70\137\x73\151\164\x65\137\x70\171\164\150\157\x6e\137\156\145\x77"), "\x6d\145\x74\x68\x6f\144" => "\120\117\123\x54", "\141\164\x74\x72" => ["\151\144" => "\x6e\145\167\x2d\x70\x79\164\150\157\x6e\55\163\151\x74\x65\55\x66\x6f\x72\155"]]); goto F8347; fa8fc: } private function handleCreatePythonSiteForm(Request $request, Form $form) { goto fc773; fc773: if (true === $form->isValid()) { goto F50d8; } goto C4b77; ccc70: try { goto c7589; c7589: $session = $request->getSession(); goto B7e1b; B4843: $response = $this->redirect($this->generateUrl("\x63\154\x70\137\x73\x69\x74\145\x73")); goto B2574; cd807: $session->getFlashBag()->set("\163\x75\143\143\x65\163\x73", $this->translator->trans("\123\x69\x74\145\x20\x68\x61\163\x20\142\145\x65\x6e\40\143\x72\145\141\164\145\144\x2e")); goto B4843; B2574: return $response; goto f42a3; a596d: throw new \Exception(sprintf("\x56\150\157\x73\164\40\x74\x65\155\160\154\141\164\x65\40\42\x25\x73\42\40\156\157\164\x20\x66\x6f\165\x6e\x64\x2e", $vhostTemplateName)); goto d4ab6; E9e3a: if (false === is_null($vhostTemplateEntity)) { goto beab9; } goto a596d; B671e: $eventData = ["\163\151\164\145" => $domainName, "\x73\151\164\145\125\x73\x65\x72" => $siteUser, "\160\x79\x74\150\x6f\156\x56\145\x72\x73\151\157\x6e" => $pythonVersion, "\x70\x6f\162\164" => $port]; goto C4113; B7e1b: $domainName = $form->get("\x64\157\155\141\151\156\116\141\x6d\145")->getData(); goto b603c; C4113: EventQueue::addEvent(EventQueue::EVENT_SITE_PYTHON_CREATE, $user, $eventData, $request); goto cd807; b603c: $pythonVersion = $form->get("\x70\171\164\150\157\x6e\126\145\162\163\x69\157\156")->getData(); goto Bc2e2; e8d1f: $this->createPythonSite($domainName, $pythonVersion, $port, $siteUser, $siteUserPassword); goto B671e; Bc2e2: $port = $form->get("\x70\157\x72\x74")->getData(); goto c6f08; Fd12f: $siteUserPassword = $form->get("\163\x69\x74\x65\125\x73\x65\162\120\141\x73\x73\x77\x6f\x72\x64")->getData(); goto C5659; f42a3: E56c5: goto c8cf6; e73a8: beab9: goto a04a8; C5659: $vhostTemplateName = self::PYTHON_VHOST_TEMPLATE_NAME; goto bfa18; c6f08: $siteUser = $form->get("\x73\x69\164\145\x55\163\145\x72")->getData(); goto Fd12f; a04a8: $user = $this->getUser(); goto e8d1f; bfa18: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto E9e3a; d4ab6: goto E56c5; goto e73a8; c8cf6: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\x64\x61\x6e\147\x65\162", $this->translator->trans("\101\x6e\40\x65\x72\162\157\162\x20\x68\141\x73\40\157\x63\x63\165\162\x72\x65\x64\x2c\40\145\162\162\x6f\162\40\155\x65\x73\163\x61\x67\x65\72\x20\x25\x65\162\x72\x6f\162\x4d\145\163\163\141\147\145\45", ["\x25\x65\x72\162\x6f\162\115\145\163\163\x61\x67\x65\x25" => $e->getMessage()])); } goto Ff46b; A1c16: goto e459b; goto Fdad5; Fdad5: F50d8: goto ccc70; Ff46b: e459b: goto ac72a; C4b77: $this->formErrors = $this->getErrorMessages($form); goto A1c16; ac72a: } public function newReverseProxy(Request $request) : Response { goto df7bd; A7649: F492a: goto Bbe09; e469c: $user = $this->getUser(); goto c956f; b6d52: $form->handleRequest($request); goto Ededa; df7bd: $hasPermissions = $this->hasPermissions(); goto f62f3; f62f3: if (true === $hasPermissions) { goto A89c3; } goto D950a; C5e12: goto De2b7; goto Bf32c; c956f: $form = $this->createReverseProxyForm(); goto d6800; Ededa: if (!(true === $form->isSubmitted())) { goto ba0c1; } goto a19ce; e28f8: D6085: goto Acb98; A1483: if (!(false === is_null($response))) { goto D6085; } goto D6430; Dd91b: De2b7: goto Ca1bd; d6800: if (!(true === $request->isMethod("\x50\x4f\x53\124"))) { goto F492a; } goto b6d52; Acb98: ba0c1: goto A7649; Bbe09: $response = $this->render("\x46\162\157\x6e\x74\x65\x6e\x64\57\x53\x69\164\145\57\x4e\145\x77\57\162\145\x76\145\x72\x73\x65\55\160\162\157\170\171\x2e\x68\x74\x6d\x6c\56\x74\x77\151\147", ["\165\x73\x65\x72" => $user, "\x66\x6f\x72\x6d" => $form->createView(), "\x66\x6f\162\x6d\105\162\x72\157\162\x73" => $this->formErrors]); goto Dd91b; Bf32c: A89c3: goto e469c; D950a: $response = $this->redirect($this->generateUrl("\143\x6c\x70\137\x73\x69\164\145\163")); goto C5e12; a19ce: $response = $this->handleReverseProxyForm($request, $form); goto A1483; Ca1bd: return $response; goto F2a24; D6430: return $response; goto e28f8; F2a24: } private function createReverseProxyForm() : Form { goto Bf416; e213a: $form->add("\163\165\x62\x6d\151\164", SubmitType::class, ["\x61\x74\164\x72" => ["\x63\154\141\163\x73" => "\142\x74\x6e\x20\142\164\x6e\x2d\x6c\147\40\x62\164\x6e\55\142\x6c\165\x65"], "\x6c\141\x62\x65\154" => "\x43\x72\145\141\164\145"]); goto Ee7c2; Bf416: $form = $this->createForm("\101\x70\160\x5c\x46\157\x72\x6d\134\123\x69\164\145\116\145\x77\x52\x65\166\x65\x72\163\x65\x50\x72\x6f\x78\171\124\x79\160\x65", [], ["\x61\x63\x74\x69\157\156" => $this->generateUrl("\143\154\160\x5f\x73\x69\164\145\x5f\162\145\166\x65\x72\163\x65\x5f\x70\x72\x6f\x78\x79\x5f\x6e\145\x77"), "\x6d\x65\164\x68\x6f\144" => "\x50\117\123\124", "\141\x74\164\162" => ["\151\x64" => "\156\x65\167\55\x72\x65\166\145\x72\x73\x65\x2d\160\162\157\x78\x79\55\146\x6f\162\x6d"]]); goto e213a; Ee7c2: return $form; goto d6e5c; d6e5c: } private function handleReverseProxyForm(Request $request, Form $form) { goto bebe3; d2ab5: goto d648d; goto baedb; f84ba: try { goto C6df9; F8592: throw new \Exception(sprintf("\x56\x68\157\163\x74\40\164\x65\155\160\154\141\164\145\40\x22\45\163\42\40\x6e\157\x74\x20\146\157\165\x6e\x64\x2e", $vhostTemplateName)); goto b0636; A4f11: $session->getFlashBag()->set("\163\x75\x63\x63\x65\163\163", $this->translator->trans("\122\x65\x76\145\x72\x73\145\40\x50\x72\x6f\x78\171\x20\150\141\163\x20\142\145\x65\156\x20\x63\x72\x65\141\164\145\x64\56")); goto Daa9c; cf3ce: $domainName = $form->get("\144\x6f\155\x61\151\x6e\116\x61\x6d\x65")->getData(); goto F5cfe; C24ee: e3ec7: goto bb7be; e052d: $this->createReverseProxySite($domainName, $reverseProxyUrl, $siteUser, $siteUserPassword); goto d9cce; ee3e3: return $response; goto f7b82; bb7be: $user = $this->getUser(); goto e052d; Daa9c: $response = $this->redirect($this->generateUrl("\x63\154\160\137\163\x69\x74\x65\x73")); goto ee3e3; E1a23: $siteUserPassword = $form->get("\163\x69\164\145\x55\163\145\x72\x50\x61\x73\x73\167\157\x72\x64")->getData(); goto E3935; D22a7: EventQueue::addEvent(EventQueue::EVENT_SITE_REVERSE_PROXY_CREATE, $user, $eventData, $request); goto A4f11; E3935: $reverseProxyUrl = $form->get("\162\145\x76\x65\162\163\145\120\x72\x6f\x78\x79\125\x72\154")->getData(); goto c4c27; b0636: goto c3161; goto C24ee; f7b82: c3161: goto Eeb08; Feaff: if (false === is_null($vhostTemplateEntity)) { goto e3ec7; } goto F8592; F5cfe: $siteUser = $form->get("\x73\x69\164\x65\125\x73\145\162")->getData(); goto E1a23; d9cce: $eventData = ["\163\151\x74\145" => $domainName, "\163\151\164\145\125\x73\x65\162" => $siteUser, "\162\x65\x76\145\x72\163\145\120\x72\x6f\x78\171\125\x72\154" => $reverseProxyUrl]; goto D22a7; c4c27: $vhostTemplateName = self::REVERSE_PROXY_VHOST_TEMPLATE_NAME; goto F7830; C6df9: $session = $request->getSession(); goto cf3ce; F7830: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto Feaff; Eeb08: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\x64\x61\x6e\x67\145\162", $this->translator->trans("\x41\x6e\40\145\162\x72\x6f\162\x20\x68\x61\x73\x20\x6f\143\x63\x75\x72\162\x65\144\x2c\x20\x65\162\162\x6f\162\40\x6d\145\x73\x73\141\147\x65\x3a\x20\45\145\162\162\x6f\x72\115\x65\163\163\141\x67\x65\45", ["\45\x65\162\162\157\x72\x4d\x65\163\x73\141\147\x65\45" => $e->getMessage()])); } goto A0f8c; baedb: e6118: goto f84ba; A0f8c: d648d: goto F0566; e2438: $this->formErrors = $this->getErrorMessages($form); goto d2ab5; bebe3: if (true === $form->isValid()) { goto e6118; } goto e2438; F0566: } public function newNodejsSite(Request $request) : Response { goto E67b6; E97af: return $response; goto c6211; eb17b: f7f30: goto a9f0e; Bb2f2: e8d8b: goto f9d81; A23f3: $response = $this->handleCreateNodejsSiteForm($request, $form); goto D0b19; f9d81: $user = $this->getUser(); goto b36fe; Cae7e: return $response; goto a4c9b; D0b19: if (!(false === is_null($response))) { goto A753a; } goto Cae7e; a4c9b: A753a: goto c2174; b36fe: $nodejsSettings = new NodejsSettingsEntity(); goto f2273; C7413: $response = $this->redirect($this->generateUrl("\143\154\x70\x5f\x73\151\164\x65\163")); goto Baac2; acee7: Aeb2b: goto E97af; ae369: if (true === $hasPermissions) { goto e8d8b; } goto C7413; c2174: ba782: goto eb17b; f2273: $form = $this->createNodejsSiteForm($nodejsSettings); goto aed81; a9f0e: $response = $this->render("\106\x72\157\156\x74\145\x6e\x64\x2f\123\x69\164\x65\x2f\116\145\x77\57\x6e\x6f\x64\145\x6a\163\56\150\164\155\154\x2e\x74\x77\151\x67", ["\x75\163\145\x72" => $user, "\146\157\x72\x6d" => $form->createView(), "\x66\x6f\162\155\105\x72\x72\x6f\162\163" => $this->formErrors]); goto acee7; E67b6: $hasPermissions = $this->hasPermissions(); goto ae369; a6826: if (!(true === $form->isSubmitted())) { goto ba782; } goto A23f3; aed81: if (!(true === $request->isMethod("\x50\x4f\123\124"))) { goto f7f30; } goto e0209; e0209: $form->handleRequest($request); goto a6826; Baac2: goto Aeb2b; goto Bb2f2; c6211: } private function createNodejsSiteForm(NodejsSettingsEntity $nodejsSettings) : Form { goto Ed016; d13df: $form->add("\163\x75\142\155\x69\164", SubmitType::class, ["\141\164\x74\x72" => ["\x63\154\x61\163\163" => "\x62\x74\x6e\x20\142\x74\156\55\x6c\147\x20\142\164\156\x2d\x62\154\165\145"], "\x6c\141\x62\145\x6c" => "\103\162\x65\141\164\145"]); goto Fceed; Ed016: $form = $this->createForm("\101\x70\160\x5c\x46\x6f\162\x6d\x5c\123\151\164\145\116\145\x77\x4e\x6f\144\x65\152\163\x54\x79\160\x65", $nodejsSettings, ["\x61\143\x74\x69\x6f\156" => $this->generateUrl("\143\154\160\137\x73\x69\x74\145\x5f\x6e\157\144\x65\152\163\x5f\156\x65\x77"), "\155\x65\164\x68\x6f\x64" => "\x50\117\123\124", "\141\164\x74\x72" => ["\x69\144" => "\156\x65\167\x2d\x6e\x6f\144\145\x6a\163\55\163\151\x74\x65\x2d\146\x6f\x72\155"]]); goto d13df; Fceed: return $form; goto af562; af562: } private function handleCreateNodejsSiteForm(Request $request, Form $form) { goto ad55f; F454b: $this->formErrors = $this->getErrorMessages($form); goto Ecb2e; F7580: a1cfe: goto a02fc; ad55f: if (true === $form->isValid()) { goto a1cfe; } goto F454b; a02fc: try { goto a35ef; D2eb2: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto F39ef; f5714: $nodejsVersion = $form->get("\156\x6f\144\x65\152\163\126\145\162\163\x69\157\156")->getData(); goto A5dd0; D3dd0: D495a: goto abb17; a6abd: EventQueue::addEvent(EventQueue::EVENT_SITE_NODEJS_CREATE, $user, $eventData, $request); goto d01ac; Eed5b: $siteUserPassword = $form->get("\163\x69\x74\x65\x55\x73\x65\x72\120\141\163\x73\167\x6f\x72\x64")->getData(); goto f1314; a8851: $response = $this->redirect($this->generateUrl("\x63\154\160\137\163\151\x74\145\x73")); goto c2184; c2184: return $response; goto Ee23b; a35ef: $session = $request->getSession(); goto f764d; Bf2c5: throw new \Exception(sprintf("\x56\x68\157\163\164\x20\x74\145\x6d\160\154\x61\x74\145\40\42\x25\163\x22\40\x6e\157\x74\x20\146\x6f\165\x6e\x64\56", $vhostTemplateName)); goto c46f2; F39ef: if (false === is_null($vhostTemplateEntity)) { goto D495a; } goto Bf2c5; e617c: $siteUser = $form->get("\x73\x69\x74\145\x55\163\x65\162")->getData(); goto Eed5b; Ee23b: a2d1a: goto da04e; abb17: $user = $this->getUser(); goto D7302; D7302: $this->createNodejsSite($domainName, $nodejsVersion, $port, $siteUser, $siteUserPassword); goto f4f19; f764d: $domainName = $form->get("\x64\x6f\x6d\x61\x69\156\x4e\141\155\x65")->getData(); goto f5714; d01ac: $session->getFlashBag()->set("\x73\x75\x63\x63\145\x73\163", $this->translator->trans("\123\151\164\145\40\150\141\163\x20\x62\145\x65\156\x20\143\162\x65\141\x74\x65\x64\x2e")); goto a8851; f1314: $vhostTemplateName = self::NODEJS_VHOST_TEMPLATE_NAME; goto D2eb2; c46f2: goto a2d1a; goto D3dd0; f4f19: $eventData = ["\x73\x69\164\x65" => $domainName, "\163\x69\164\x65\x55\x73\145\x72" => $siteUser, "\156\x6f\x64\x65\152\x73\x56\x65\x72\163\x69\157\156" => $nodejsVersion, "\160\157\162\x74" => $port]; goto a6abd; A5dd0: $port = $form->get("\160\157\x72\x74")->getData(); goto e617c; da04e: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\144\x61\x6e\147\x65\x72", $this->translator->trans("\101\156\40\x65\162\x72\157\x72\40\150\x61\163\40\157\143\x63\165\162\x72\145\x64\x2c\x20\x65\162\x72\157\x72\40\x6d\x65\163\x73\x61\x67\145\72\x20\45\145\x72\x72\x6f\x72\x4d\145\x73\x73\141\147\145\45", ["\45\x65\162\162\157\x72\x4d\145\163\163\x61\147\145\x25" => $e->getMessage()])); } goto F6a0f; F6a0f: Cdfae: goto De94d; Ecb2e: goto Cdfae; goto F7580; De94d: } public function newStaticSite(Request $request) : Response { goto A0085; d3386: $response = $this->handleCreateStaticSiteForm($request, $form); goto eae9e; A9e26: if (!(true === $request->isMethod("\x50\117\x53\x54"))) { goto C4d08; } goto Be9ee; d7c86: C4d08: goto ff3c4; adf37: E3bc9: goto d7c86; F00d1: if (!(true === $form->isSubmitted())) { goto E3bc9; } goto d3386; d35d8: if (true === $hasPermissions) { goto dbc37; } goto f4123; A0085: $hasPermissions = $this->hasPermissions(); goto d35d8; A45ec: goto Fd0b0; goto B96ef; b943e: $form = $this->createStaticSiteForm(); goto A9e26; B96ef: dbc37: goto d4b7a; eae9e: if (!(false === is_null($response))) { goto Ab61f; } goto e70bc; e70bc: return $response; goto a566a; f4123: $response = $this->redirect($this->generateUrl("\143\154\160\137\x73\x69\x74\x65\x73")); goto A45ec; a566a: Ab61f: goto adf37; F1eec: Fd0b0: goto Ea0be; Be9ee: $form->handleRequest($request); goto F00d1; Ea0be: return $response; goto A7449; d4b7a: $user = $this->getUser(); goto b943e; ff3c4: $response = $this->render("\x46\x72\157\x6e\164\145\x6e\144\57\x53\x69\x74\145\x2f\x4e\x65\x77\x2f\x73\x74\x61\x74\x69\143\x2e\150\x74\x6d\x6c\x2e\x74\x77\x69\147", ["\x75\163\x65\162" => $user, "\x66\157\162\x6d" => $form->createView(), "\146\157\162\x6d\105\162\162\157\162\163" => $this->formErrors]); goto F1eec; A7449: } private function createStaticSiteForm() : Form { goto b4e61; b4e61: $form = $this->createForm("\x41\160\160\134\x46\x6f\x72\155\134\x53\151\x74\x65\x4e\x65\167\x53\x74\141\164\151\143\124\171\160\x65", [], ["\x61\x63\x74\151\157\x6e" => $this->generateUrl("\x63\x6c\160\x5f\x73\x69\x74\x65\x5f\163\164\141\164\x69\x63\137\156\145\x77"), "\x6d\145\164\x68\157\x64" => "\120\x4f\x53\x54", "\x61\164\164\x72" => []]); goto bab4d; d7e14: return $form; goto cb4aa; bab4d: $form->add("\163\x75\142\x6d\151\x74", SubmitType::class, ["\x61\164\x74\162" => ["\x63\154\x61\x73\163" => "\142\164\x6e\40\x62\164\x6e\x2d\x6c\147\40\142\x74\x6e\x2d\142\x6c\x75\x65"], "\x6c\x61\x62\x65\154" => "\x43\162\x65\x61\164\145"]); goto d7e14; cb4aa: } private function handleCreateStaticSiteForm(Request $request, Form $form) { goto deb25; deb8a: $this->formErrors = $this->getErrorMessages($form); goto Bcec5; A49d7: try { goto Ad44f; dd4bd: $eventData = ["\x73\151\164\x65" => $domainName, "\x73\x69\164\145\125\163\145\162" => $siteUser]; goto D2d16; c3d2e: return $response; goto A90c5; B0ce4: throw new \Exception(sprintf("\x56\x68\x6f\x73\164\40\164\x65\155\x70\154\141\164\145\40\x22\45\x73\42\x20\x6e\157\164\x20\146\157\165\x6e\144\x2e", $vhostTemplateName)); goto Cd2d6; f501e: $user = $this->getUser(); goto C5dab; Cd2d6: goto Bab3f; goto b9d64; E0eaa: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto E0719; c2b17: $siteUser = $form->get("\163\151\x74\145\125\x73\x65\x72")->getData(); goto F4f79; cf518: $domainName = $form->get("\x64\x6f\x6d\141\151\x6e\x4e\141\x6d\x65")->getData(); goto c2b17; b9d64: E49a7: goto f501e; A90c5: Bab3f: goto B7f56; B4bfd: $session->getFlashBag()->set("\163\x75\143\143\145\163\163", $this->translator->trans("\x53\x69\164\x65\40\x68\x61\x73\x20\142\145\x65\x6e\x20\143\x72\x65\x61\x74\145\x64\x2e")); goto cda40; E0719: if (false === is_null($vhostTemplateEntity)) { goto E49a7; } goto B0ce4; cda40: $response = $this->redirect($this->generateUrl("\x63\154\160\x5f\x73\x69\164\x65\x73")); goto c3d2e; C5dab: $this->createStaticSite($domainName, $siteUser, $siteUserPassword); goto dd4bd; Ad44f: $session = $request->getSession(); goto cf518; Ef948: $vhostTemplateName = self::STATIC_SITE_VHOST_TEMPLATE_NAME; goto E0eaa; F4f79: $siteUserPassword = $form->get("\163\x69\164\145\125\x73\x65\x72\120\141\163\163\x77\x6f\x72\144")->getData(); goto Ef948; D2d16: EventQueue::addEvent(EventQueue::EVENT_SITE_STATIC_CREATE, $user, $eventData, $request); goto B4bfd; B7f56: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\x64\141\x6e\x67\145\162", $this->translator->trans("\101\x6e\40\x65\162\x72\x6f\162\x20\150\x61\163\x20\x6f\x63\x63\x75\x72\x72\x65\144\x2c\40\145\x72\162\157\162\40\x6d\145\163\163\141\147\145\72\40\x25\145\162\x72\x6f\x72\x4d\x65\163\x73\141\147\x65\45", ["\x25\x65\x72\162\157\x72\x4d\145\x73\x73\141\x67\x65\45" => $e->getMessage()])); } goto efe82; deb25: if (true === $form->isValid()) { goto Be3da; } goto deb8a; Ca5e4: Be3da: goto A49d7; efe82: b579b: goto Eba2f; Bcec5: goto b579b; goto Ca5e4; Eba2f: } public function newPhpSite(Request $request) : Response { goto D6b98; b92ea: return $response; goto c98a3; c98a3: E6568: goto Bc77d; Bbe70: $form->handleRequest($request); goto A5e84; d6fe7: $response = $this->redirect($this->generateUrl("\x63\x6c\160\137\x73\x69\164\x65\163")); goto C1bf7; C1bf7: goto E798b; goto bb2e1; Dd1c9: return $response; goto ee66e; E7bf8: E798b: goto Dd1c9; Aab0a: if (true === $hasPermissions) { goto Ffe38; } goto d6fe7; D6b98: $hasPermissions = $this->hasPermissions(); goto Aab0a; fb4a2: $response = $this->render("\x46\162\157\x6e\x74\145\156\x64\x2f\x53\x69\x74\145\57\116\x65\167\57\160\150\160\56\150\x74\155\x6c\x2e\164\167\151\147", ["\165\163\145\162" => $user, "\146\157\x72\155" => $form->createView(), "\x66\157\x72\x6d\105\162\162\x6f\x72\163" => $this->formErrors]); goto E7bf8; A5e84: if (!(true === $form->isSubmitted())) { goto C5fa1; } goto Bfc88; bb2e1: Ffe38: goto Ecfbd; F6089: $form = $this->createPhpSiteForm(); goto C25b9; Ecfbd: $user = $this->getUser(); goto F6089; Bc77d: C5fa1: goto Af589; Bfc88: $response = $this->handleCreatePhpSiteForm($request, $form); goto ba276; Af589: e3840: goto fb4a2; ba276: if (!(false === is_null($response))) { goto E6568; } goto b92ea; C25b9: if (!(true === $request->isMethod("\120\117\x53\x54"))) { goto e3840; } goto Bbe70; ee66e: } private function createPhpSiteForm() : Form { goto f8163; f8163: $form = $this->createForm("\x41\160\x70\x5c\x46\x6f\x72\155\x5c\x53\x69\x74\x65\116\145\x77\x50\150\160\x54\171\160\x65", [], ["\x61\143\164\x69\157\156" => $this->generateUrl("\x63\x6c\160\137\163\x69\x74\x65\137\x70\150\x70\x5f\x6e\x65\167"), "\155\x65\164\150\x6f\144" => "\x50\x4f\x53\124", "\141\x74\164\162" => []]); goto c22ce; B8676: return $form; goto f2b74; c22ce: $form->add("\x73\165\142\x6d\x69\164", SubmitType::class, ["\x61\x74\x74\162" => ["\x63\x6c\x61\163\163" => "\x62\164\x6e\x20\x62\x74\156\55\154\147\x20\x62\x74\x6e\55\142\154\165\x65"], "\x6c\x61\x62\145\154" => "\103\162\145\x61\164\x65"]); goto B8676; f2b74: } private function handleCreatePhpSiteForm(Request $request, Form $form) { goto cba95; Ff6d9: $this->formErrors = $this->getErrorMessages($form); goto D27c5; Ab164: c4bc0: goto E6488; F52b8: try { goto f4dbe; ffe1b: $vhostTemplateName = $form->get("\141\160\x70\154\x69\143\x61\164\151\x6f\x6e")->getData(); goto c0814; c03ed: $rootDirectory = $domainName; goto Aac23; F41fd: ce825: goto B2bdf; F3030: $eventData = ["\x73\151\x74\145" => $domainName, "\166\150\157\163\164\x54\145\155\160\154\x61\164\145\116\x61\x6d\x65" => $vhostTemplateName, "\160\150\160\x56\x65\162\163\x69\157\156" => $phpVersion, "\x73\151\164\x65\125\x73\145\x72" => $siteUser]; goto d7caf; dde50: $varnishCacheSettings = []; goto bf1f5; E1682: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto Fff73; affa1: $rootDirectory = sprintf("\x25\x73\x2f\x25\x73", $rootDirectory, ltrim(rtrim($vhostTemplateEntity->getRootDirectory(), "\x2f"), "\x2f")); goto B8c93; C11cb: throw new \Exception(sprintf("\126\150\157\163\164\40\x74\x65\x6d\160\154\x61\164\145\40\42\x25\163\42\40\x6e\x6f\164\40\x66\157\165\156\144\x2e", $vhostTemplateName)); goto Ce1fd; f8fe4: $phpVersion = $form->get("\x70\150\160\126\x65\x72\163\x69\x6f\x6e")->getData(); goto c7e19; Cb8a9: $siteUserPassword = $form->get("\x73\151\x74\145\125\163\x65\162\x50\x61\x73\x73\x77\x6f\x72\144")->getData(); goto E1682; Ce1fd: goto e9ce4; goto F41fd; b8098: $varnishCacheSettings = (array) json_decode($vhostTemplateEntity->getVarnishCacheSettings(), true); goto A6de5; B8c93: B667e: goto dde50; c7e19: $siteUser = $form->get("\163\x69\x74\145\125\x73\x65\x72")->getData(); goto Cb8a9; f4dbe: $session = $request->getSession(); goto ffe1b; df290: $this->createPhpSite($domainName, $rootDirectory, $phpVersion, $vhostTemplateName, $siteUser, $siteUserPassword, $varnishCacheSettings); goto F3030; Aac23: if (!(false === empty($vhostTemplateEntity->getRootDirectory()))) { goto B667e; } goto affa1; B696a: $session->getFlashBag()->set("\x73\165\x63\143\145\163\163", $this->translator->trans("\123\x69\x74\x65\x20\150\141\163\40\142\x65\x65\x6e\40\x63\162\x65\x61\164\x65\x64\56")); goto baba3; Dac06: e9ce4: goto Bed17; B2bdf: $user = $this->getUser(); goto c03ed; bf1f5: if (!(false === empty($vhostTemplateEntity->getVarnishCacheSettings()))) { goto c392a; } goto b8098; baba3: $response = $this->redirect($this->generateUrl("\143\154\160\137\163\151\x74\x65\163")); goto fd344; fd344: return $response; goto Dac06; c0814: $domainName = $form->get("\144\157\x6d\141\151\x6e\116\x61\x6d\x65")->getData(); goto f8fe4; A6de5: c392a: goto df290; d7caf: EventQueue::addEvent(EventQueue::EVENT_SITE_PHP_CREATE, $user, $eventData, $request); goto B696a; Fff73: if (false === is_null($vhostTemplateEntity)) { goto ce825; } goto C11cb; Bed17: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\x64\141\x6e\x67\x65\162", $this->translator->trans("\x41\156\x20\x65\x72\162\x6f\162\40\150\x61\x73\x20\x6f\143\x63\165\x72\x72\x65\x64\x2c\x20\145\162\x72\157\x72\40\155\145\x73\x73\141\x67\x65\x3a\40\x25\145\x72\x72\x6f\162\x4d\x65\x73\163\x61\x67\145\x25", ["\x25\x65\x72\x72\157\162\115\145\163\x73\141\147\x65\45" => $e->getMessage()])); } goto Ab164; db953: ad8f8: goto F52b8; cba95: if (true === $form->isValid()) { goto ad8f8; } goto Ff6d9; D27c5: goto c4bc0; goto db953; E6488: } public function newWordPressSite(Request $request) : Response { goto A2cf9; Ddc8e: E3259: goto E3131; A2cf9: $hasPermissions = $this->hasPermissions(); goto e8363; A3411: a4b6f: goto e6594; Aa96c: $user = $this->getUser(); goto ea876; f0da1: return $response; goto c4994; b8104: if (!(false === is_null($response))) { goto b1109; } goto f0da1; d507e: F1972: goto A3411; Bb658: $form->handleRequest($request); goto Df476; c4994: b1109: goto d507e; da409: goto E3259; goto B9b81; c346e: $response = $this->handleCreateWordPressSiteForm($request, $form); goto b8104; e8363: if (true === $hasPermissions) { goto Be56b; } goto ab645; ab645: $response = $this->redirect($this->generateUrl("\x63\154\160\x5f\x73\151\x74\145\x73")); goto da409; B9b81: Be56b: goto Aa96c; e6594: $response = $this->render("\106\162\157\156\164\145\x6e\x64\57\x53\x69\164\145\57\x4e\x65\167\57\167\x6f\162\x64\160\x72\x65\163\x73\56\150\164\155\x6c\56\164\167\x69\147", ["\x75\163\x65\x72" => $user, "\146\x6f\162\155" => $form->createView(), "\146\157\x72\x6d\x45\162\x72\x6f\162\x73" => $this->formErrors]); goto Ddc8e; ea876: $form = $this->createWordPressSiteForm(); goto Ff4d8; E3131: return $response; goto dea1e; Ff4d8: if (!(true === $request->isMethod("\x50\x4f\123\124"))) { goto a4b6f; } goto Bb658; Df476: if (!(true === $form->isSubmitted())) { goto F1972; } goto c346e; dea1e: } private function createWordPressSiteForm() : Form { goto bc916; bc916: $form = $this->createForm("\x41\160\160\x5c\x46\157\x72\x6d\x5c\123\151\x74\145\116\145\x77\x57\x6f\162\144\x50\x72\x65\x73\163\x54\x79\x70\x65", [], ["\141\143\164\151\157\x6e" => $this->generateUrl("\143\x6c\x70\137\x73\x69\x74\x65\x5f\167\x6f\162\144\160\162\145\x73\x73\137\x6e\x65\167"), "\x6d\x65\164\x68\157\144" => "\x50\117\123\x54", "\x61\x74\x74\x72" => ["\151\x64" => "\156\x65\167\x2d\x77\157\162\x64\x70\x72\145\163\163\x2d\x73\151\x74\x65\x2d\x66\x6f\162\155"]]); goto D0c3b; D0c3b: $form->add("\163\165\x62\155\151\x74", SubmitType::class, ["\x61\164\x74\162" => ["\143\x6c\x61\x73\163" => "\x62\164\156\x20\142\164\156\55\154\x67\x20\142\x74\x6e\x2d\x62\x6c\x75\x65"], "\x6c\141\x62\145\x6c" => "\x43\162\145\x61\164\145"]); goto d8ecb; d8ecb: return $form; goto f549a; f549a: } private function handleCreateWordPressSiteForm(Request $request, Form $form) { goto Ae953; Ae953: if (true === $form->isValid()) { goto Eecd7; } goto cd3f0; F2373: Eecd7: goto B67bb; cd3f0: $this->formErrors = $this->getErrorMessages($form); goto e411a; B67bb: try { goto c753f; E034e: $this->installWordPress($isMultiSite, $url, $title, $adminUserName, $adminPassword, $adminEmail, $siteEntity, $activeDatabaseServerEntity, $databaseEntity, $databaseUserEntity); goto e95e1; A6565: $databaseName = $this->getUniqueDatabaseName($generatedName); goto D61f7; c753f: $user = $this->getUser(); goto F616e; e95e1: $siteCredentials[$this->translator->trans("\104\x61\164\x61\142\x61\163\x65")] = [$this->translator->trans("\x48\x6f\x73\x74") => $activeDatabaseServerEntity->getHost(), $this->translator->trans("\120\x6f\x72\164") => $activeDatabaseServerEntity->getPort(), $this->translator->trans("\x44\x61\164\141\x62\x61\x73\x65\40\116\x61\x6d\x65") => $databaseName, $this->translator->trans("\104\x61\164\x61\142\x61\x73\x65\40\x55\163\x65\162\40\x4e\x61\155\145") => $databaseUserName, $this->translator->trans("\x44\141\x74\x61\x62\x61\163\145\40\x55\163\145\x72\x20\x50\x61\x73\163\167\x6f\x72\144") => $databaseUserPassword]; goto e92b0; f11c2: $databaseManager = new DatabaseManager($activeDatabaseServerEntity); goto B8c3a; f1a84: $databaseEntity->setSite($siteEntity); goto b56db; B0e01: $instance = $request->attributes->get("\151\156\x73\x74\x61\156\x63\x65"); goto fa8e0; Aa73e: $generatedName = $this->generateNameFromDomainName($domainName); goto A780e; B3406: $databaseEntity->setDatabaseServer($activeDatabaseServerEntity); goto D7d30; e2b8a: $varnishCacheSettings = []; goto ffee2; Cc47e: $phpVersion = $vhostTemplateEntity->getPhpVersion(); goto e2b8a; b56db: $databaseUserEntity = $this->databaseUserEntityManager->createEntity(); goto f42d4; fa8e0: $siteCredentials = [$this->translator->trans("\x53\151\164\x65") => [$this->translator->trans("\x49\120\40\x41\144\144\x72\145\x73\163") => $instance->getIpv4PublicIp(), $this->translator->trans("\104\157\x6d\141\151\156\40\116\141\155\x65") => sprintf("\150\x74\164\160\163\x3a\57\x2f\x25\163", $domainName), $this->translator->trans("\123\151\164\145\x20\125\x73\145\162") => $siteUser, $this->translator->trans("\x50\141\163\163\167\x6f\162\144") => $siteUserPassword]]; goto ce022; de58b: $adminPassword = $form->get("\141\144\155\151\x6e\x50\141\x73\163\167\x6f\162\144")->getData(); goto F41cb; B4729: return $response; goto d6dc5; B8c3a: $databaseManager->createDatabase($databaseEntity); goto d7729; D61f7: $databaseUserName = $this->getUniqueDatabaseUserName($generatedName); goto c1c1e; e1673: e9d00: goto c2782; d7729: $databaseManager->createUser($databaseUserEntity); goto E7376; d53bf: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::WORDPRESS_VHOST_TEMPLATE_NAME); goto Cc47e; c6c8e: $title = $form->get("\x73\151\x74\145\124\x69\164\x6c\x65")->getData(); goto f36ca; A32a4: $response = $this->redirect($this->generateUrl("\x63\154\160\137\163\x69\164\x65\x5f\167\157\x72\x64\x70\x72\x65\x73\x73\137\151\156\163\164\x61\154\154\x65\144")); goto B4729; Ebe2c: $databaseUserEntity->setDatabase($databaseEntity); goto B2d80; A780e: $siteUser = $form->get("\163\x69\x74\145\125\x73\x65\x72")->getData(); goto cebe2; B6821: $domainName = $form->get("\144\157\155\141\151\x6e\116\x61\x6d\145")->getData(); goto Aa73e; d68e2: $databaseEntity = $this->databaseEntityManager->createEntity(); goto B3406; cebe2: $siteUserPassword = $form->get("\163\151\x74\145\125\163\x65\162\x50\141\x73\x73\x77\x6f\162\x64")->getData(); goto d53bf; a3dae: $siteEntity->addDatabase($databaseEntity); goto f11c2; c1c1e: $databaseUserPassword = PasswordGenerator::generate(self::PASSWORD_LENGTH); goto F84a7; e824d: A04bd: goto Bdc23; d60c1: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto d68e2; D6730: $varnishCacheSettings = (array) json_decode($vhostTemplateEntity->getVarnishCacheSettings(), true); goto e1673; abaa4: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto B0e01; f42d4: $databaseUserEntity->setUserName($databaseUserName); goto e853b; E72ed: $databaseUserEntity->setPermissions(DatabaseUserEntity::PERMISSIONS_READ_WRITE); goto Ebe2c; e92b0: $siteCredentials["\127\x6f\162\x64\x50\x72\x65\163\163"] = [$this->translator->trans("\x41\x64\155\x69\x6e\x20\105\55\x4d\141\151\x6c") => $adminEmail, $this->translator->trans("\101\x64\x6d\x69\x6e\x20\125\163\145\162\40\x4e\141\155\x65") => $adminUserName, $this->translator->trans("\x41\x64\155\151\x6e\x20\120\x61\163\163\x77\x6f\x72\144") => $adminPassword, $this->translator->trans("\x41\x64\155\151\x6e\40\x55\162\154") => sprintf("\150\164\164\160\163\x3a\57\x2f\x25\x73\x2f\x77\160\55\141\144\x6d\151\156\57", rtrim($domainName, "\x2f"))]; goto e824d; F84a7: $url = sprintf("\150\x74\x74\x70\x73\72\x2f\57\45\x73", $siteEntity->getDomainName()); goto c6c8e; F616e: $session = $request->getSession(); goto B6821; A83cb: $isMultiSite = $form->get("\155\165\x6c\x74\x69\123\151\x74\x65")->getData(); goto d60c1; ffee2: if (!(false === empty($vhostTemplateEntity->getVarnishCacheSettings()))) { goto e9d00; } goto D6730; ce022: if (!(false === is_null($siteEntity))) { goto A04bd; } goto A6565; F41cb: $adminEmail = $form->get("\x61\x64\155\151\x6e\x45\x6d\141\151\154")->getData(); goto A83cb; e853b: $databaseUserEntity->setPassword(Crypto::encrypt($databaseUserPassword)); goto E72ed; Aa70e: EventQueue::addEvent(EventQueue::EVENT_SITE_WORDPRESS_CREATE, $user, $eventData, $request); goto A32a4; f36ca: $adminUserName = $form->get("\141\144\x6d\x69\x6e\x55\x73\x65\162\x4e\x61\x6d\145")->getData(); goto de58b; B2d80: $databaseEntity->addUser($databaseUserEntity); goto a3dae; E7376: $this->siteEntityManager->updateEntity($siteEntity); goto E034e; c2782: $siteEntity = $this->createPhpSite($domainName, $domainName, $phpVersion, self::WORDPRESS_VHOST_TEMPLATE_NAME, $siteUser, $siteUserPassword, $varnishCacheSettings); goto abaa4; Bdc23: $session->set("\x73\x69\x74\x65\103\162\x65\144\x65\156\164\151\x61\x6c\x73", $siteCredentials); goto Ec6b8; D7d30: $databaseEntity->setName($databaseName); goto f1a84; Ec6b8: $eventData = ["\x73\x69\164\x65" => $domainName, "\163\x69\164\145\x55\x73\x65\162" => $siteUser]; goto Aa70e; d6dc5: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\x64\141\x6e\x67\145\x72", $this->translator->trans("\101\x6e\40\x65\x72\162\x6f\162\40\150\141\x73\40\157\143\x63\165\x72\162\145\x64\x2c\40\x65\x72\162\x6f\x72\x20\x6d\x65\163\163\x61\147\145\72\40\x25\145\x72\162\157\x72\x4d\145\163\163\141\x67\x65\45", ["\x25\x65\162\162\x6f\x72\115\x65\163\163\141\147\x65\45" => $e->getMessage()])); } goto A9490; A9490: Eaf83: goto D98f2; e411a: goto Eaf83; goto F2373; D98f2: } private function installWordPress(bool $isMultiSite, string $url, string $title, string $adminUserName, string $adminPassword, string $adminEmail, SiteEntity $siteEntity, DatabaseServerEntity $databaseServerEntity, DatabaseEntity $databaseEntity, DatabaseUserEntity $databaseUserEntity) : void { goto be4ab; Df126: $wordPressInstaller->downloadAndExtractLatestVersion(); goto D9488; cfcff: $databaseUserName = $databaseUserEntity->getUserName(); goto dc7a1; a3123: $wordPressInstaller->resetPermissions(); goto Ba9ca; F1a76: foreach ($this->wordPressMultiSiteConfigValues as $key => $config) { $wordPressInstaller->setConfigValue($key, $config["\x76\x61\x6c\165\x65"], $config["\x72\141\167"]); dc491: } goto E62d5; ed585: $wordPressInstaller->installCore($isMultiSite, $url, $title, $adminUserName, $adminPassword, $adminEmail); goto C5cd8; D9488: $wordPressInstaller->createConfig($databaseHost, $databaseName, $databaseUserName, $databaseUserPassword); goto ed585; b2b6c: $databaseName = $databaseEntity->getName(); goto cfcff; dc7a1: $databaseUserPassword = Crypto::decrypt($databaseUserEntity->getPassword()); goto e33a1; c9f66: if (!(true === $isMultiSite)) { goto fd8be; } goto e647e; e647e: $this->wordPressMultiSiteConfigValues["\104\117\x4d\101\x49\116\x5f\x43\125\x52\122\x45\116\124\137\123\x49\x54\x45"]["\x76\141\154\x75\145"] = $siteEntity->getDomainName(); goto F1a76; Cacc4: e4c6c: goto c9f66; Bf9c8: fd8be: goto a3123; E62d5: d70f6: goto Bf9c8; e33a1: $wordPressInstaller = new WordPressInstaller($siteEntity); goto Df126; C5cd8: foreach ($this->wordPressDefaultConfigValues as $key => $config) { $wordPressInstaller->setConfigValue($key, $config["\x76\141\154\165\145"], $config["\x72\141\x77"]); d17e5: } goto Cacc4; be4ab: $databaseHost = sprintf("\x25\x73\x3a\x25\x73", $databaseServerEntity->getHost(), $databaseServerEntity->getPort()); goto b2b6c; Ba9ca: } private function createPhpSite(string $domainName, string $rootDirectory, string $phpVersion, string $vhostTemplateName, string $siteUser, string $siteUserPassword, array $varnishCacheSettings = []) : SiteEntity { goto a5fc9; ac6e3: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto b7415; c7150: $phpSite->setCertificate($certificateEntity); goto d8b32; E5577: $phpSettingsEntity = new PhpSettingsEntity(); goto ee2d0; a31df: $subdomain = false === empty($subdomain) ? $subdomain : null; goto A4672; adbc4: $siteEntity->setUser($siteUser); goto a00f5; A4672: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto D7c4e; C007f: $phpSiteCreator->createVarnishCacheStructure($varnishCacheSettings); goto eaca5; f2889: db89b: goto B6a6b; f33dc: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto Fca4a; B178a: $phpSiteCreator->createPhpFpmPool(); goto e5fde; e71d0: $vhostTemplate = new PhpVhostTemplate($phpSite); goto fa36d; fec61: $phpSettingsEntity->setSite($siteEntity); goto ec686; f5969: f38cf: goto Af216; daed3: $phpSite->setRegistrableDomain($registrableDomain); goto d9d4c; C8b7d: $this->siteEntityManager->updateEntity($siteEntity); goto a6a51; b8a5b: a4ec7: goto ad5b4; E259b: $subjectAlternativeNames = []; goto E4e71; D1bad: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto D7add; Ce252: $subdomain = $resolvedDomainName->subDomain()->toString(); goto a31df; B267c: $subjectAlternativeNames[] = sprintf("\x77\167\x77\56\x25\x73", $domainName); goto Ee1e3; fc033: $subjectAlternativeNames[] = $registrableDomain; goto D81be; E5aed: $siteEntity->setType(SiteEntity::TYPE_PHP); goto f1a6a; ee2d0: $siteEntity->setPhpSettings($phpSettingsEntity); goto F7655; c5e77: if (!(true === is_null($subdomain) || "\167\x77\x77" == $subdomain)) { goto Abb14; } goto fc01b; c19cc: $varnishCacheSettings = array_merge($defaultVarnishCacheSettings, $varnishCacheSettings); goto C007f; b8292: $phpSiteCreator->reloadNginxService(); goto F8bb7; ff6bf: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\x2e\57\56\x2e\57\56\56\x2f\x72\145\163\157\165\x72\143\x65\163\57\x6e\x67\x69\x6e\170\x2f\166\x68\x6f\163\x74\137\164\x65\x6d\x70\x6c\x61\x74\x65\57\162\145\144\x69\162\x65\x63\x74"); goto D8641; a3c1a: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto fd4d9; B8d8b: $rsaKeyGenerator = new RsaKeyGenerator(); goto F00ef; f1a6a: $siteEntity->setDomainName($domainName); goto adbc4; a84d6: $phpSiteCreator->createRootDirectory(); goto bbaa5; a6a51: return $siteEntity; goto D6eac; ae108: if (!(true === $varnishCache)) { goto db89b; } goto ca6d6; E4e71: if (!(true === is_null($subdomain))) { goto dd264; } goto B267c; f6b87: $siteEntity->setVarnishCache(true); goto ad4a1; e186e: $phpSiteCreator->createIndexPhp(); goto ab2ed; F8bb7: $phpSiteCreator->resetPermissions(); goto e71d0; C3358: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto Fee08; bfa5a: $vhostTemplate->build(); goto f33dc; D7add: if (!(false === empty($redirectionVhostTemplate))) { goto d3992; } goto A860f; B77c8: $csr = $csrGenerator->generate(); goto a3c1a; c335e: $constraintViolationList = new ConstraintViolationList(); goto A13bd; C400a: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto B64be; F7655: $phpSettingsEntity->setPhpVersion($phpVersion); goto fec61; ca6d6: $phpSite->setVarnishCache(true); goto B6171; cd442: if (!(false === is_null($subdomain) && "\x77\167\167" == $subdomain)) { goto abba2; } goto fc033; B1462: $certificateEntity->setSite($siteEntity); goto B8d8b; D7c4e: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto aaa93; D81be: abba2: goto a9efe; b7415: $certificateEntity->setCertificate($selfSignedCertificate); goto c6dd3; a00f5: $siteEntity->setUserPassword($siteUserPassword); goto Cfc1f; aaa93: $siteEntity = $this->siteEntityManager->createEntity(); goto E5aed; d40dc: $phpSiteCreator->createUser(); goto a84d6; B6171: $defaultVarnishCacheSettings = ["\x65\x6e\141\x62\154\145\x64" => false, "\163\x65\162\166\145\x72" => self::VARNISH_CACHE_SERVER, "\143\x61\x63\150\145\x54\141\x67\x50\x72\x65\x66\x69\x78" => substr(md5(time()), 0, 4)]; goto c19cc; A860f: $vhostTemplate = sprintf("\x25\163\45\x73", $redirectionVhostTemplate, $vhostTemplate); goto Ba826; B6a6b: $phpSiteCreator->createNginxVhost(); goto b8292; Af216: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\56\x2f\x2e\x2e\x2f\x2e\x2e\57\x72\145\x73\x6f\x75\162\143\145\x73\x2f\156\147\151\156\x78\57\x76\x68\157\163\164\137\x74\x65\x6d\x70\154\141\x74\145\x2f\162\145\x64\151\x72\145\x63\164\x2d\x68\x74\x74\160\x33"); goto Bda8a; a9efe: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto f8d03; Bda8a: fddea: goto D1bad; E8919: $certificateEntity->setCsr($csr); goto ac6e3; c17d7: $phpSite->setUserPassword($siteEntity->getUserPassword()); goto ef20f; b1dff: $phpSettingsConstraints = $this->validator->validate($phpSettingsEntity); goto D4537; B64be: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto Ce252; Ba826: d3992: goto bef9f; d8b32: $phpSite->setPhpSettings($phpSettingsEntity); goto E28ff; bef9f: Abb14: goto F9150; ef20f: $phpSite->setDomainName($domainName); goto daed3; B9fc9: $phpSiteCreator = new PhpSiteCreator($phpSite); goto d40dc; ad5b4: $certificateEntity = $this->certificateEntityManager->createEntity(); goto B1462; ad4a1: F3a1b: goto c5e77; Ee1e3: dd264: goto cd442; A2af5: $phpSite->setRootDirectory($siteEntity->getRootDirectory()); goto c7150; A63f9: throw new \Exception(implode("\73\40", $errorMessages)); goto b8a5b; fa36d: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto bb6f7; ec686: $siteConstraints = $this->validator->validate($siteEntity); goto b1dff; d4cc3: $constraintViolationList->addAll($phpSettingsConstraints); goto c59d2; E5205: $phpSite->setUser($siteEntity->getUser()); goto c17d7; A13bd: $constraintViolationList->addAll($siteConstraints); goto d4cc3; F00ef: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto E259b; Fee08: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto e2937; D8641: goto fddea; goto f5969; bbaa5: $phpSiteCreator->createLogrotateFile(); goto e186e; d9d4c: $phpSite->setSubdomain($subdomain); goto A2af5; D4537: if (!(count($siteConstraints) || count($phpSettingsConstraints))) { goto a4ec7; } goto c335e; Fca4a: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto C8b7d; F9150: $siteEntity->setVhostTemplate($vhostTemplate); goto E5577; e5fde: $phpSiteCreator->reloadPhpFpmService(); goto ae108; bb6f7: $vhostTemplate->resetProcessors(); goto C3358; E28ff: $phpSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto B9fc9; b9ee9: if (!(false === empty($varnishCache))) { goto F3a1b; } goto f6b87; f5cd3: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto E8919; eaca5: $phpSite->setVarnishCacheSettings($varnishCacheSettings); goto f2889; fd4d9: $certificateEntity->setDefaultCertificate(true); goto f5cd3; Cfc1f: $siteEntity->setRootDirectory($rootDirectory); goto b9ee9; f8d03: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto B77c8; e2937: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto bfa5a; Bb081: $phpSite = new PhpSite(); goto E5205; a5fc9: $varnishCache = false === empty($varnishCacheSettings) ? true : false; goto c1f4b; c1f4b: $rootDirectory = trim(rtrim(ltrim($rootDirectory, "\x2f")), "\x2f"); goto C400a; ab2ed: $phpSiteCreator->createPrivateKeyAndCertificate(); goto B178a; c6dd3: $siteEntity->setCertificate($certificateEntity); goto Bb081; fc01b: if (true === isset($_ENV["\x41\x50\x50\137\110\124\124\120\63"]) && "\x74\162\x75\x65" === $_ENV["\101\x50\x50\137\x48\x54\x54\x50\x33"]) { goto f38cf; } goto ff6bf; c59d2: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto A63f9; D6eac: } private function createNodejsSite(string $domainName, string $nodejsVersion, string $port, string $siteUser, string $siteUserPassword) : SiteEntity { goto F912d; F2a1a: $vhostTemplate->build(); goto aa338; B80ca: if (!(true === is_null($subdomain))) { goto Bb4b6; } goto afa85; e1fbc: $siteEntity = $this->siteEntityManager->createEntity(); goto c344a; Df064: $nodejsSiteCreator->createLogrotateFile(); goto Db58a; E0863: $subjectAlternativeNames = []; goto B80ca; C26db: $siteEntity->setUser($siteUser); goto B7449; D7ab4: $nodejsSiteCreator->createRootDirectory(); goto Df064; Cf32e: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto b7f20; afb6b: $siteEntity->setNodejsSettings($nodejsSettingsEntity); goto B4095; A9611: $nodejsSiteCreator->createUser(); goto D7ab4; e16b6: $csr = $csrGenerator->generate(); goto Ca211; D2624: $nodejsSiteCreator->installNodejs(); goto bef74; Db58a: $nodejsSiteCreator->createNvmDirectory(); goto D2624; Db829: $subjectAlternativeNames[] = $registrableDomain; goto F30c7; Aa120: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\x2f\x2e\56\x2f\x2e\x2e\57\56\56\x2f\x72\x65\163\157\165\x72\143\x65\x73\x2f\156\147\151\x6e\170\57\x76\150\157\x73\x74\137\164\145\155\x70\x6c\x61\164\145\x2f\x72\145\144\x69\162\x65\x63\164\55\150\x74\164\160\63"); goto b5938; c5d12: $siteEntity->setDomainName($domainName); goto C26db; B9c1b: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto E0863; be354: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::NODEJS_VHOST_TEMPLATE_NAME); goto Fec99; bef74: $nodejsSiteCreator->createPrivateKeyAndCertificate(); goto d9fdc; fee6d: $nodejsSettingsConstraints = $this->validator->validate($nodejsSettingsEntity); goto d51bd; e6368: if (true === isset($_ENV["\x41\120\x50\137\110\x54\x54\120\63"]) && "\164\x72\165\x65" === $_ENV["\101\120\x50\137\x48\124\x54\120\63"]) { goto aee78; } goto C93f9; c344a: $siteEntity->setType(SiteEntity::TYPE_NODEJS); goto c5d12; d3c30: $nodejsSite = new NodejsSite(); goto c9c53; c706e: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto b4125; fc333: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto F2a1a; C549b: $nodejsSite->setRootDirectory($siteEntity->getRootDirectory()); goto f84ea; C2e8e: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto C41b0; a060e: $nodejsSettingsEntity->setSite($siteEntity); goto eec16; C41b0: $certificateEntity->setCsr($csr); goto A81e8; afa85: $subjectAlternativeNames[] = sprintf("\x77\x77\x77\x2e\45\163", $domainName); goto c5b2e; c9c53: $nodejsSite->setUser($siteEntity->getUser()); goto B6908; Bca1a: $nodejsSite->setDomainName($domainName); goto f5598; C9c39: $constraintViolationList = new ConstraintViolationList(); goto Fbcbb; F132f: ac5bf: goto C0c42; f174f: $siteEntity->setRootDirectory($domainName); goto B2825; D06f2: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto Baa6b; B6908: $nodejsSite->setUserPassword($siteEntity->getUserPassword()); goto Bca1a; d1e51: $nodejsSiteCreator->resetPermissions(); goto f95c0; A083a: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto A850e; Fec99: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto e1fbc; b5938: cd71e: goto A083a; b7f20: $vhostTemplate->resetProcessors(); goto D06f2; f58bf: if (!(false === is_null($subdomain) && "\167\167\167" == $subdomain)) { goto c8f4c; } goto Db829; c702c: return $siteEntity; goto f5b5a; A81e8: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto f4070; f97c4: $subdomain = false === empty($subdomain) ? $subdomain : null; goto be354; f5598: $nodejsSite->setRegistrableDomain($registrableDomain); goto C0544; aa338: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto c706e; B2825: if (!(true === is_null($subdomain) || "\167\x77\167" == $subdomain)) { goto be6d9; } goto e6368; ad565: throw new \Exception(implode("\73\40", $errorMessages)); goto B881e; f80d0: $nodejsSettingsEntity->setPort($port); goto a060e; f84ea: $nodejsSite->setCertificate($certificateEntity); goto c50b2; f4070: $certificateEntity->setCertificate($selfSignedCertificate); goto b1f56; Eda05: $certificateEntity->setDefaultCertificate(true); goto C2e8e; A850e: if (!(false === empty($redirectionVhostTemplate))) { goto ac5bf; } goto D9950; Fbcbb: $constraintViolationList->addAll($siteConstraints); goto Fdc32; B4095: $nodejsSettingsEntity->setNodejsVersion($nodejsVersion); goto f80d0; fa7d0: $nodejsSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto Eac52; C0c42: be6d9: goto dd418; eec16: $siteConstraints = $this->validator->validate($siteEntity); goto fee6d; c51fd: $subdomain = $resolvedDomainName->subDomain()->toString(); goto f97c4; A43e8: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto c51fd; A6047: $certificateEntity->setSite($siteEntity); goto f03b5; b1f56: $siteEntity->setCertificate($certificateEntity); goto d3c30; c50b2: $nodejsSite->setNodejsSettings($nodejsSettingsEntity); goto fa7d0; cf92f: goto cd71e; goto d0eeb; dd418: $siteEntity->setVhostTemplate($vhostTemplate); goto A8ffd; C0544: $nodejsSite->setSubdomain($subdomain); goto C549b; Ca211: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto Eda05; d0eeb: aee78: goto Aa120; c5b2e: Bb4b6: goto f58bf; A8ffd: $nodejsSettingsEntity = new NodejsSettingsEntity(); goto afb6b; d9fdc: $nodejsSiteCreator->createNginxVhost(); goto e32fa; b4125: $this->siteEntityManager->updateEntity($siteEntity); goto c702c; F912d: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto A43e8; Baa6b: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto fc333; f03b5: $rsaKeyGenerator = new RsaKeyGenerator(); goto B9c1b; d7bb9: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto ad565; C93f9: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\x2e\56\x2f\x2e\56\x2f\56\56\x2f\162\145\x73\x6f\x75\x72\x63\x65\x73\x2f\156\147\151\156\x78\x2f\166\x68\x6f\x73\164\x5f\164\145\155\160\x6c\x61\164\x65\x2f\x72\x65\144\151\x72\x65\x63\164"); goto cf92f; Bd62b: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto e16b6; B881e: b3dae: goto F196a; D9950: $vhostTemplate = sprintf("\45\163\45\163", $redirectionVhostTemplate, $vhostTemplate); goto F132f; F196a: $certificateEntity = $this->certificateEntityManager->createEntity(); goto A6047; e32fa: $nodejsSiteCreator->reloadNginxService(); goto d1e51; f95c0: $vhostTemplate = new StaticVhostTemplate($nodejsSite); goto Cf32e; B7449: $siteEntity->setUserPassword($siteUserPassword); goto f174f; d51bd: if (!(count($siteConstraints) || count($nodejsSettingsConstraints))) { goto b3dae; } goto C9c39; F30c7: c8f4c: goto c2d07; c2d07: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto Bd62b; Eac52: $nodejsSiteCreator = new NodejsSiteCreator($nodejsSite); goto A9611; Fdc32: $constraintViolationList->addAll($nodejsSettingsConstraints); goto d7bb9; f5b5a: } private function createPythonSite(string $domainName, string $pythonVersion, string $port, string $siteUser, string $siteUserPassword) : SiteEntity { goto F2d4f; Dfa3e: A8702: goto Fbc37; dc34d: if (!(count($siteConstraints) || count($pythonSettingsConstraints))) { goto C9e8c; } goto D639f; dc3f5: if (!(false === empty($redirectionVhostTemplate))) { goto b58b5; } goto f5fad; aa009: $pythonSiteCreator->writePythonVersionFile(); goto a87ea; c9f8c: $pythonSite->setCertificate($certificateEntity); goto Ca7bc; Eb74d: $pythonSettingsEntity->setPort($port); goto C832e; b1883: if (!(false === is_null($subdomain) && "\167\167\x77" == $subdomain)) { goto d3679; } goto afe10; ee577: $siteEntity->setDomainName($domainName); goto fd1f5; b3153: $constraintViolationList->addAll($pythonSettingsConstraints); goto edc75; De3ab: $pythonSiteCreator->createRootDirectory(); goto A599e; A599e: $pythonSiteCreator->createLogrotateFile(); goto aa009; C7ad9: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto d481b; f8b72: $subdomain = false === empty($subdomain) ? $subdomain : null; goto a1e92; Aba31: $rsaKeyGenerator = new RsaKeyGenerator(); goto C7ad9; e260d: b58b5: goto Dfa3e; d4169: $vhostTemplate = new PythonVhostTemplate($pythonSite); goto B8c7e; F2ad8: $certificateEntity->setCsr($csr); goto d7da2; A2094: $pythonSettingsConstraints = $this->validator->validate($pythonSettingsEntity); goto dc34d; b6b39: $siteEntity->setType(SiteEntity::TYPE_PYTHON); goto ee577; dbd64: $certificateEntity = $this->certificateEntityManager->createEntity(); goto D59f5; bb287: goto d7892; goto F0f6f; e01ae: $siteEntity = $this->siteEntityManager->createEntity(); goto b6b39; D5e1f: a33a0: goto b1883; A6f4b: $pythonSiteCreator->resetPermissions(); goto d4169; F0f6f: F21bf: goto B5697; E85ed: C9e8c: goto dbd64; C364e: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto e4cef; ac7d6: if (true === isset($_ENV["\101\120\x50\x5f\x48\124\x54\x50\x33"]) && "\x74\x72\x75\145" === $_ENV["\101\x50\120\137\x48\124\124\x50\x33"]) { goto F21bf; } goto dd3ba; Ed0ea: $vhostTemplate->resetProcessors(); goto fb18f; f274e: $siteEntity->setRootDirectory($domainName); goto A2303; e2b27: d7892: goto bf59f; c8260: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto F2ad8; d7da2: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto dcc0b; e4cef: $subdomain = $resolvedDomainName->subDomain()->toString(); goto f8b72; Da667: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto e3fd5; d9634: $constraintViolationList->addAll($siteConstraints); goto b3153; b6328: $pythonSite->setRegistrableDomain($registrableDomain); goto f84be; ad3fd: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto cef37; Cddbc: $pythonSite = new PythonSite(); goto A490e; bf59f: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto dc3f5; a1e92: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::PYTHON_VHOST_TEMPLATE_NAME); goto d8a4d; Fbc37: $siteEntity->setVhostTemplate($vhostTemplate); goto C8aac; Cc285: d3679: goto b224c; a1d2d: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto D9fa1; dd3ba: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\x2e\x2f\x2e\x2e\x2f\x2e\56\x2f\x72\145\163\x6f\x75\162\x63\145\x73\x2f\x6e\147\x69\156\x78\x2f\166\150\x6f\163\x74\137\x74\145\155\x70\154\141\164\145\x2f\162\145\144\x69\x72\x65\143\x74"); goto bb287; afe10: $subjectAlternativeNames[] = $registrableDomain; goto Cc285; bb7b0: $pythonSite->setDomainName($domainName); goto b6328; C832e: $pythonSettingsEntity->setSite($siteEntity); goto b2b96; Bcd0f: $pythonSiteCreator->createUser(); goto De3ab; E80dc: $pythonSite->setRootDirectory($siteEntity->getRootDirectory()); goto c9f8c; Cbb82: $pythonSite->setUserPassword($siteEntity->getUserPassword()); goto bb7b0; dcc0b: $certificateEntity->setCertificate($selfSignedCertificate); goto a903b; a8292: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto e6d36; decc4: $pythonSiteCreator->reloadNginxService(); goto A6f4b; Cbff3: $pythonSettingsEntity->setPythonVersion($pythonVersion); goto Eb74d; e5372: $this->siteEntityManager->updateEntity($siteEntity); goto ad3fd; b5b40: if (!(true === is_null($subdomain))) { goto a33a0; } goto Bbf74; cef37: return $siteEntity; goto Ecfe6; fb18f: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto E6afc; d8a4d: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto e01ae; D639f: $constraintViolationList = new ConstraintViolationList(); goto d9634; c2808: $pythonSiteCreator->createNginxVhost(); goto decc4; f84be: $pythonSite->setSubdomain($subdomain); goto E80dc; a87ea: $pythonSiteCreator->createPrivateKeyAndCertificate(); goto c2808; Bbf74: $subjectAlternativeNames[] = sprintf("\167\x77\x77\x2e\45\x73", $domainName); goto D5e1f; b2b96: $siteConstraints = $this->validator->validate($siteEntity); goto A2094; e6d36: $certificateEntity->setDefaultCertificate(true); goto c8260; e5901: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto e5372; B8c7e: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto Ed0ea; a903b: $siteEntity->setCertificate($certificateEntity); goto Cddbc; edc75: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto bcaa9; F2951: $siteEntity->setPythonSettings($pythonSettingsEntity); goto Cbff3; b224c: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto a1d2d; E6afc: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto Da667; b19f9: $pythonSiteCreator = new PythonSiteCreator($pythonSite); goto Bcd0f; f5fad: $vhostTemplate = sprintf("\45\163\45\x73", $redirectionVhostTemplate, $vhostTemplate); goto e260d; D59f5: $certificateEntity->setSite($siteEntity); goto Aba31; A2303: if (!(true === is_null($subdomain) || "\167\167\167" == $subdomain)) { goto A8702; } goto ac7d6; D9fa1: $csr = $csrGenerator->generate(); goto a8292; e3fd5: $vhostTemplate->build(); goto e5901; bcaa9: throw new \Exception(implode("\x3b\x20", $errorMessages)); goto E85ed; Ca7bc: $pythonSite->setPythonSettings($pythonSettingsEntity); goto Eac2b; B5697: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\x2e\x2f\56\56\x2f\56\x2e\x2f\x72\145\163\157\165\162\x63\x65\x73\57\156\x67\151\x6e\170\57\x76\150\157\x73\164\x5f\x74\x65\155\160\154\x61\164\145\57\x72\x65\x64\x69\162\x65\x63\164\55\150\x74\x74\160\63"); goto e2b27; d481b: $subjectAlternativeNames = []; goto b5b40; A490e: $pythonSite->setUser($siteEntity->getUser()); goto Cbb82; Bc84a: $siteEntity->setUserPassword($siteUserPassword); goto f274e; fd1f5: $siteEntity->setUser($siteUser); goto Bc84a; F2d4f: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto C364e; Eac2b: $pythonSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto b19f9; C8aac: $pythonSettingsEntity = new PythonSettingsEntity(); goto F2951; Ecfe6: } private function createStaticSite(string $domainName, string $siteUser, string $siteUserPassword) : SiteEntity { goto F4ff4; a854a: $certificateEntity->setDefaultCertificate(true); goto bafe2; e883b: if (!(true === is_null($subdomain))) { goto D343a; } goto Ec5b6; A39f0: if (!count($siteConstraints)) { goto c71a5; } goto B96d5; d3077: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto d5fc3; A0ff7: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto Eb69c; ff3ae: $staticSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto Fa3cc; B56d7: if (!(true === is_null($subdomain) || "\x77\x77\x77" == $subdomain)) { goto F34a1; } goto Eebc6; acf1f: $certificateEntity = $this->certificateEntityManager->createEntity(); goto A142e; Cc398: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto a854a; Fc78e: $staticSiteCreator->createRootDirectory(); goto b07dd; fe289: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto d50bb; F3063: D343a: goto ddcea; eb7af: $siteEntity->setVhostTemplate($vhostTemplate); goto B54d2; B5640: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto Ddf71; ada27: $vhostTemplate = new StaticVhostTemplate($staticSite); goto B5640; E91bc: goto A92c0; goto D6339; D6339: ec7ea: goto F4113; b61b5: $staticSite->setRootDirectory($siteEntity->getRootDirectory()); goto Efd20; Eebc6: if (true === isset($_ENV["\101\120\x50\137\110\124\x54\120\63"]) && "\x74\162\x75\145" === $_ENV["\101\120\120\137\110\124\x54\x50\x33"]) { goto ec7ea; } goto Dec15; bafe2: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto Bbb63; A75c6: F34a1: goto eb7af; Cfd32: $vhostTemplate->build(); goto A0ff7; F7343: d29f1: goto D2a24; bf464: $siteEntity->setType(SiteEntity::TYPE_STATIC); goto Ab3e3; Bda4d: if (!(false === empty($redirectionVhostTemplate))) { goto Dfc85; } goto f080d; D6fad: throw new \Exception(implode("\73\40", $errorMessages)); goto Eacc6; Dec15: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\56\x2f\x2e\56\x2f\56\56\57\162\145\163\x6f\x75\x72\143\x65\163\57\156\x67\151\x6e\170\57\x76\x68\x6f\163\164\x5f\x74\x65\x6d\160\154\141\164\145\x2f\162\145\144\151\x72\145\143\164"); goto E91bc; ba51f: $staticSite->setSubdomain($subdomain); goto b61b5; Fa3cc: $staticSiteCreator = new StaticSiteCreator($staticSite); goto Bf789; c04c3: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto da527; Eacc6: c71a5: goto acf1f; b3468: $subjectAlternativeNames[] = $registrableDomain; goto F7343; Db55b: $staticSiteCreator->reloadNginxService(); goto F0a36; E1a7f: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto a59ba; d50bb: $siteEntity = $this->siteEntityManager->createEntity(); goto bf464; Efd20: $staticSite->setCertificate($certificateEntity); goto ff3ae; F0a36: $staticSiteCreator->resetPermissions(); goto ada27; a8413: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto b45e4; e456a: $staticSite->setRegistrableDomain($registrableDomain); goto ba51f; fa073: $siteEntity->setCertificate($certificateEntity); goto e8525; d54ba: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto D6fad; E62a8: $siteEntity->setRootDirectory($domainName); goto B56d7; f080d: $vhostTemplate = sprintf("\x25\x73\x25\163", $redirectionVhostTemplate, $vhostTemplate); goto a3197; d5fc3: $subjectAlternativeNames = []; goto e883b; a3197: Dfc85: goto A75c6; ff092: $certificateEntity->setCertificate($selfSignedCertificate); goto fa073; da527: $subdomain = $resolvedDomainName->subDomain()->toString(); goto Fc72b; Ba6d4: $staticSite->setDomainName($domainName); goto e456a; Fc72b: $subdomain = false === empty($subdomain) ? $subdomain : null; goto b265b; b265b: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::STATIC_SITE_VHOST_TEMPLATE_NAME); goto fe289; b45e4: $csr = $csrGenerator->generate(); goto Cc398; dcd1b: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto Cfd32; e7e62: $this->siteEntityManager->updateEntity($siteEntity); goto e31a2; b9cf8: $siteEntity->setUserPassword($siteUserPassword); goto E62a8; Ab3e3: $siteEntity->setDomainName($domainName); goto bc97c; ddcea: if (!(false === is_null($subdomain) && "\167\167\x77" == $subdomain)) { goto d29f1; } goto b3468; e8532: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto ff092; e8525: $staticSite = new StaticSite(); goto Cfaf9; F4ff4: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto c04c3; d2461: $staticSite->setUserPassword($siteEntity->getUserPassword()); goto Ba6d4; Eb69c: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto e7e62; D2a24: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto a8413; Eab09: $staticSiteCreator->createNginxVhost(); goto Db55b; Cfaf9: $staticSite->setUser($siteEntity->getUser()); goto d2461; D6feb: $constraintViolationList->addAll($siteConstraints); goto d54ba; bc97c: $siteEntity->setUser($siteUser); goto b9cf8; ec573: A92c0: goto fd126; A142e: $certificateEntity->setSite($siteEntity); goto Dc272; Dc272: $rsaKeyGenerator = new RsaKeyGenerator(); goto d3077; Bf789: $staticSiteCreator->createUser(); goto Fc78e; B640f: $staticSiteCreator->createPrivateKeyAndCertificate(); goto Eab09; b07dd: $staticSiteCreator->createLogrotateFile(); goto B025f; e31a2: return $siteEntity; goto B9769; Ddf71: $vhostTemplate->resetProcessors(); goto E1a7f; F4113: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\x2e\x2e\57\56\x2e\57\56\x2e\x2f\x72\145\x73\x6f\165\x72\143\145\163\x2f\156\x67\x69\x6e\170\x2f\166\150\157\163\164\x5f\x74\x65\x6d\160\154\x61\164\145\x2f\x72\145\x64\151\x72\145\x63\164\55\150\164\164\x70\63"); goto ec573; Bbb63: $certificateEntity->setCsr($csr); goto e8532; B54d2: $siteConstraints = $this->validator->validate($siteEntity); goto A39f0; Ec5b6: $subjectAlternativeNames[] = sprintf("\x77\x77\x77\56\45\163", $domainName); goto F3063; B025f: $staticSiteCreator->createIndexHtml(); goto B640f; fd126: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto Bda4d; a59ba: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto dcd1b; B96d5: $constraintViolationList = new ConstraintViolationList(); goto D6feb; B9769: } private function createReverseProxySite(string $domainName, string $reverseProxyUrl, string $siteUser, string $siteUserPassword) : SiteEntity { goto c7d4c; cf03e: $reversProxySiteCreator->createUser(); goto D0a47; C0829: if (true === isset($_ENV["\101\x50\x50\x5f\110\x54\124\x50\63"]) && "\164\x72\165\x65" === $_ENV["\101\x50\x50\x5f\110\x54\x54\120\63"]) { goto Bff98; } goto e15b4; b9c8a: $vhostTemplate = new ReverseProxyVhostTemplate($reverseProxySite); goto f75f1; b2a64: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto a156e; a156e: $certificateEntity->setDefaultCertificate(true); goto f22a9; Ad5d6: if (!count($siteConstraints)) { goto b1ad7; } goto B4f38; f06ad: goto D38bd; goto C0f58; e194e: $constraintViolationList->addAll($siteConstraints); goto b41ed; ba716: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto E9fd0; D0a47: $reversProxySiteCreator->createRootDirectory(); goto e9890; b30d4: $siteEntity->setDomainName($domainName); goto D3abc; e15b4: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\x2e\57\x2e\x2e\57\x2e\x2e\x2f\x72\145\163\157\x75\x72\x63\x65\x73\x2f\x6e\147\x69\156\x78\57\x76\150\157\x73\164\137\x74\145\x6d\160\x6c\x61\164\x65\57\162\x65\144\151\x72\x65\143\x74"); goto f06ad; b41ed: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto B8cbe; Bbd08: $reversProxySiteCreator->createPrivateKeyAndCertificate(); goto D627f; e69cb: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto afa65; Bec48: $siteEntity->setReverseProxyUrl($reverseProxyUrl); goto eabc6; f802e: $reverseProxySite->setDomainName($domainName); goto c9cb8; B8cbe: throw new \Exception(implode("\73\x20", $errorMessages)); goto f61bb; D5059: if (!(false === is_null($subdomain) && "\x77\x77\167" == $subdomain)) { goto C1f0a; } goto f19b2; eabc6: if (!(true === is_null($subdomain) || "\167\167\x77" == $subdomain)) { goto b0368; } goto C0829; c9cb8: $reverseProxySite->setRegistrableDomain($registrableDomain); goto A48dc; e44df: D38bd: goto fdfdc; C6870: $vhostTemplate = sprintf("\45\163\x25\163", $redirectionVhostTemplate, $vhostTemplate); goto A6062; D9e99: $reverseProxySite = new ReverseProxySite(); goto C0564; E4f60: $subjectAlternativeNames[] = sprintf("\167\167\167\56\45\x73", $domainName); goto ed86d; e4f14: $vhostTemplate->resetProcessors(); goto c31b5; F7ee9: $reverseProxySite->setRootDirectory($siteEntity->getRootDirectory()); goto C82d4; bd93c: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::REVERSE_PROXY_VHOST_TEMPLATE_NAME); goto c5495; B1c2b: $siteEntity->setRootDirectory($domainName); goto Bec48; Abc82: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto Eed78; D3abc: $siteEntity->setUser($siteUser); goto ace58; A6062: c44f4: goto Bbc42; D69ad: $siteEntity->setVhostTemplate($vhostTemplate); goto De003; C0f58: Bff98: goto A5e79; F1b51: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto a747d; ace58: $siteEntity->setUserPassword($siteUserPassword); goto B1c2b; c31b5: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto e3bba; c5495: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto C635b; B4f38: $constraintViolationList = new ConstraintViolationList(); goto e194e; c7d4c: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto b2e4d; E9fd0: $vhostTemplate->build(); goto e69cb; B5bba: $subdomain = false === empty($subdomain) ? $subdomain : null; goto bd93c; B15b0: if (!(true === is_null($subdomain))) { goto Ceae9; } goto E4f60; C0564: $reverseProxySite->setUser($siteEntity->getUser()); goto B8b6c; D008a: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto Abc82; afa65: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto cf1a9; Eed78: $csr = $csrGenerator->generate(); goto b2a64; e9890: $reversProxySiteCreator->createLogrotateFile(); goto Bbd08; Db572: $reverseProxySite->setReverseProxyUrl($reverseProxyUrl); goto a5e66; bbd4c: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto cbffe; f19b2: $subjectAlternativeNames[] = $registrableDomain; goto C7d8c; C82d4: $reverseProxySite->setCertificate($certificateEntity); goto Db572; a5e66: $reverseProxySite->setVhostTemplate($siteEntity->getVhostTemplate()); goto e8c34; F1206: $reversProxySiteCreator->resetPermissions(); goto b9c8a; A2973: $certificateEntity->setCsr($csr); goto F1b51; f22a9: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto A2973; f75f1: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto e4f14; cbffe: $subjectAlternativeNames = []; goto B15b0; fc3ba: $rsaKeyGenerator = new RsaKeyGenerator(); goto bbd4c; ed86d: Ceae9: goto D5059; d8317: $certificateEntity->setSite($siteEntity); goto fc3ba; Cd7c0: $siteEntity->setCertificate($certificateEntity); goto D9e99; b2e4d: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto d239b; D627f: $reversProxySiteCreator->createNginxVhost(); goto B09c4; E59e3: if (!(false === empty($redirectionVhostTemplate))) { goto c44f4; } goto C6870; F4f13: $certificateEntity = $this->certificateEntityManager->createEntity(); goto d8317; fdfdc: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto E59e3; fb0ca: $siteEntity->setType(SiteEntity::TYPE_REVERSE_PROXY); goto b30d4; e3bba: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto ba716; C1c53: return $siteEntity; goto Dd6ca; A5e79: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\x2e\x2f\56\x2e\x2f\x2e\x2e\57\x72\145\x73\x6f\x75\162\143\145\x73\x2f\x6e\147\151\156\170\57\x76\x68\x6f\163\164\x5f\164\145\x6d\160\x6c\141\164\x65\57\x72\x65\144\151\x72\145\143\x74\x2d\x68\x74\164\160\63"); goto e44df; C635b: $siteEntity = $this->siteEntityManager->createEntity(); goto fb0ca; f61bb: b1ad7: goto F4f13; A48dc: $reverseProxySite->setSubdomain($subdomain); goto F7ee9; B09c4: $reversProxySiteCreator->reloadNginxService(); goto F1206; e8c34: $reversProxySiteCreator = new ReverseProxySiteCreator($reverseProxySite); goto cf03e; B8b6c: $reverseProxySite->setUserPassword($siteEntity->getUserPassword()); goto f802e; De003: $siteConstraints = $this->validator->validate($siteEntity); goto Ad5d6; cf1a9: $this->siteEntityManager->updateEntity($siteEntity); goto C1c53; Bbc42: b0368: goto D69ad; d239b: $subdomain = $resolvedDomainName->subDomain()->toString(); goto B5bba; C7d8c: C1f0a: goto D008a; a747d: $certificateEntity->setCertificate($selfSignedCertificate); goto Cd7c0; Dd6ca: } public function installedWordPressSite(Request $request) : Response { goto d5503; D609d: goto D200b; goto a6687; a3a64: $siteCredentials = $this->renderSiteCredentials($siteCredentials); goto ef550; a2ac6: $siteCredentials = $session->get("\163\x69\x74\x65\103\x72\145\144\145\156\164\x69\141\x6c\163"); goto c0bf7; d5503: $session = $request->getSession(); goto a2ac6; a6687: d2fc9: goto a3a64; cee90: D200b: goto be068; ef550: $response = $this->render("\x46\162\x6f\156\x74\x65\156\x64\x2f\x53\x69\164\x65\57\116\145\167\57\x77\157\162\144\160\x72\x65\x73\163\x2d\x69\156\x73\164\141\154\x6c\x65\x64\x2e\x68\x74\155\x6c\x2e\x74\x77\151\x67", ["\x73\151\164\145\103\162\145\x64\145\156\x74\x69\x61\x6c\x73" => $siteCredentials]); goto f4055; A067a: $response = $this->redirect($this->generateUrl("\143\x6c\x70\x5f\163\151\x74\145\163")); goto D609d; be068: return $response; goto Ae7b9; f4055: return $response; goto cee90; c0bf7: if (false === empty($siteCredentials)) { goto d2fc9; } goto A067a; Ae7b9: } private function renderSiteCredentials(array $siteCredentials) : string { goto cb3b7; db6dd: cdc74: goto D722e; D3b1e: foreach ($siteCredentials as $section => $sectionData) { goto Eaf64; bb93a: foreach ($sectionData as $key => $value) { $renderedCredentials .= sprintf("\45\x73\x3a\40\45\163", $key, $value) . PHP_EOL; Ebd63: } goto a9720; De74e: Ac90e: goto F89b1; Eaf64: $renderedCredentials .= $section . PHP_EOL; goto f57da; a9720: F7a01: goto B3282; f57da: $renderedCredentials .= "\x2d\x2d\55\x2d\55\55\55\x2d\55\x2d\x2d\x2d\x2d\55\x2d\x2d\55\x2d\x2d\55\55\x2d\55\55\x2d\55\55\55\x2d\x2d\x2d\x2d\55\55\x2d\x2d\55\x2d\55\x2d\55\55\x2d\x2d\x2d\55\x2d\x2d\x2d\55\55\55\x2d\55" . PHP_EOL; goto bb93a; B3282: $renderedCredentials .= PHP_EOL; goto De74e; F89b1: } goto db6dd; D722e: return $renderedCredentials; goto C5084; cb3b7: $renderedCredentials = ''; goto D3b1e; C5084: } private function getVhostTemplateEntity(string $name) : mixed { goto c176b; Adee5: fe802: goto Ddec4; C898d: throw new \Exception($this->translator->trans("\126\x68\x6f\163\x74\40\x54\145\x6d\x70\x6c\x61\x74\145\x20\45\166\x68\x6f\163\x74\x54\145\155\160\154\141\x74\x65\45\x20\x64\x6f\x65\x73\x20\156\x6f\164\40\x65\170\151\163\164\x2e", ["\45\x76\x68\157\x73\x74\x54\145\155\x70\154\x61\x74\145\45" => $name])); goto Adee5; Ddec4: return $vhostTemplateEntity; goto c89e8; A541a: if (!(true === is_null($vhostTemplateEntity))) { goto fe802; } goto C898d; c176b: $vhostTemplateEntity = $this->vhostTemplateEntityManager->findOneByName($name); goto A541a; c89e8: } private function getConstraintViolationListErrorMessages(ConstraintViolationList $constraintViolationList) : array { goto b76a7; b76a7: $errorMessages = []; goto B1fa7; D47e7: return $errorMessages; goto B95ab; B1fa7: foreach ($constraintViolationList as $constraint) { $errorMessages[] = sprintf("\45\163\x3a\x20\x25\x73", $constraint->getPropertyPath(), $constraint->getMessage()); f7df3: } goto d7431; d7431: b0402: goto D47e7; B95ab: } private function generateNameFromDomainName(string $domainName) : string { goto c6820; c6820: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto ff9d1; Fc7a7: $name = sprintf("\x25\163\55\45\163", $explodedRegistrableDomain[0] ?? '', implode("\55", $explodedSubdomain)); goto baa4e; ea691: d2058: goto a8985; D5e61: if ("\x77\167\x77" == $subdomain) { goto d2058; } goto D93cc; E9162: b52e9: goto af68f; f537f: if (!(false === empty($subdomain))) { goto fcb55; } goto Cfec8; a8985: $name = $explodedRegistrableDomain[0] ?? ''; goto E9162; ad618: $subdomain = $resolvedDomainName->subDomain()->toString(); goto c55f3; Eabd9: goto b52e9; goto ea691; ff9d1: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto ad618; D93cc: $name = $explodedRegistrableDomain[0] ?? ''; goto f537f; af68f: return $name; goto F85e8; Cfec8: $explodedSubdomain = explode("\56", $subdomain); goto Fc7a7; c55f3: $explodedRegistrableDomain = explode("\x2e", $registrableDomain); goto D5e61; baa4e: fcb55: goto Eabd9; F85e8: } private function getUniqueDatabaseName(string $databaseName) : string { goto Bc4ba; cf650: $i++; goto E726b; f24e8: E2058: goto c965f; b3847: aa2ae: goto Ff4cf; dd81e: if (!(strlen($uniqueDatabaseName) <= 3)) { goto Ea071; } goto f0690; Ff4cf: if (!(0 < $i)) { goto E2058; } goto c8226; E726b: if (true === $databaseExists) { goto aa2ae; } goto fd642; F85ae: return $uniqueDatabaseName; goto feb5a; Bc4ba: $uniqueDatabaseName = $databaseName; goto dd81e; d977c: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto A7cc3; c965f: $databaseExists = in_array($uniqueDatabaseName, $databases); goto cf650; ab548: $databases = $databaseConnection->getDatabases(); goto b3847; B8288: $i = 0; goto d977c; A7cc3: $databaseConnection = new DatabaseConnection($activeDatabaseServerEntity); goto ab548; f0690: $uniqueDatabaseName = sprintf("\45\163\55\144\x62", $uniqueDatabaseName); goto cea77; c8226: $uniqueDatabaseName = sprintf("\x25\163\x2d\45\163", $databaseName, $i); goto f24e8; cea77: Ea071: goto B8288; fd642: bea7b: goto F85ae; feb5a: } private function getUniqueDatabaseUserName(string $databaseUserName) : string { goto a3d15; A2d9e: $uniqueDatabaseUserName = mb_substr($uniqueDatabaseUserName, 0, 32); goto c717e; Cbdc7: $i = 0; goto F1e7a; a5355: if (false === is_null($databaseUserEntity)) { goto E626e; } goto c4e20; a3d15: $uniqueDatabaseUserName = $databaseUserName; goto A583b; F0663: if (!(0 < $i)) { goto f946e; } goto A73de; A583b: if (!(strlen($uniqueDatabaseUserName) <= 3)) { goto e8af0; } goto Df3c3; c4e20: A3627: goto A2d9e; A73de: $uniqueDatabaseUserName = sprintf("\45\163\55\x25\x73", $databaseUserName, $i); goto A993f; A993f: f946e: goto F9af1; F9af1: $databaseUserEntity = $this->databaseUserEntityManager->findOneByUserName($uniqueDatabaseUserName); goto F7e8d; Df3c3: $uniqueDatabaseUserName = sprintf("\x25\163\55\144\142", $uniqueDatabaseUserName); goto D0482; c717e: return $uniqueDatabaseUserName; goto f6d8f; D0482: e8af0: goto Cbdc7; F1e7a: E626e: goto F0663; F7e8d: $i++; goto a5355; f6d8f: } private function hasPermissions() : bool { goto Af4c7; aa445: if (!(UserEntity::ROLE_USER != $user->getRole())) { goto dee12; } goto A37f8; Af4c7: $user = $this->getUser(); goto aa445; C1630: return false; goto ccf02; fda64: dee12: goto C1630; A37f8: return true; goto fda64; ccf02: } }
Function Calls
None |
Stats
MD5 | 84bf208c71c848cb3c9eb96300ff6e1a |
Eval Count | 0 |
Decode Time | 112 ms |