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 D9f54; c744d: $this->domainNameParser = $domainNameParser; goto Dd353; b2877: parent::__construct($translator, $logger); goto a9f6f; dff5c: $this->databaseEntityManager = $databaseEntityManager; goto e0144; d61b7: $this->vhostTemplateEntityManager = $vhostTemplateEntityManager; goto c744d; e0144: $this->databaseUserEntityManager = $databaseUserEntityManager; goto ab43c; E8104: $this->siteEntityManager = $siteEntityManager; goto A3724; ab43c: $this->databaseServerEntityManager = $databaseServerEntityManager; goto d61b7; D9f54: $this->configManager = $configManager; goto E8104; Dd353: $this->validator = $validator; goto b2877; A3724: $this->certificateEntityManager = $certificateEntityManager; goto dff5c; a9f6f: } public function index(Request $request) : Response { goto De3c9; c0bac: if (true === $hasPermissions) { goto e7a92; } goto a5535; d027c: f4ae3: goto a6623; a6623: return $response; goto a2238; a02b0: goto f4ae3; goto F9e00; De3c9: $hasPermissions = $this->hasPermissions(); goto c0bac; F9e00: e7a92: goto Da74f; cd4a0: $response = $this->render("Frontend/Site/New/index.html.twig", ["user" => $user]); goto d027c; a5535: $response = $this->redirect($this->generateUrl("clp_sites")); goto a02b0; Da74f: $user = $this->getUser(); goto cd4a0; a2238: } public function newPythonSite(Request $request) : Response { goto C68c8; C68c8: $hasPermissions = $this->hasPermissions(); goto af6f4; a78a2: a2ce9: goto a8b33; b3b0e: return $response; goto A184b; a8b33: return $response; goto C684c; eb34b: $response = $this->handleCreatePythonSiteForm($request, $form); goto e6a41; F8644: $response = $this->render("Frontend/Site/New/python.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto a78a2; d11b8: goto a2ce9; goto Bc864; db79f: $response = $this->redirect($this->generateUrl("clp_sites")); goto d11b8; Ef7d8: if (!(true === $form->isSubmitted())) { goto F532e; } goto eb34b; e6a41: if (!(false === is_null($response))) { goto C4734; } goto b3b0e; f808f: fbed7: goto F8644; A7ce6: $user = $this->getUser(); goto aed51; aed51: $pythonSettings = new PythonSettingsEntity(); goto bbab7; Bc864: F88f8: goto A7ce6; aa33d: if (!(true === $request->isMethod("POST"))) { goto fbed7; } goto e0e50; cc387: F532e: goto f808f; bbab7: $form = $this->createPythonSiteForm($pythonSettings); goto aa33d; e0e50: $form->handleRequest($request); goto Ef7d8; A184b: C4734: goto cc387; af6f4: if (true === $hasPermissions) { goto F88f8; } goto db79f; C684c: } private function createPythonSiteForm(PythonSettingsEntity $pythonSettings) : Form { goto b34d4; E81d5: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto c4ca1; c4ca1: return $form; goto Ad954; b34d4: $form = $this->createForm("App\Form\SiteNewPythonType", $pythonSettings, ["action" => $this->generateUrl("clp_site_python_new"), "method" => "POST", "attr" => ["id" => "new-python-site-form"]]); goto E81d5; Ad954: } private function handleCreatePythonSiteForm(Request $request, Form $form) { goto C0712; bc5df: aa06c: goto B838d; C0712: if (true === $form->isValid()) { goto Ea0fd; } goto E27bf; d7b2b: Ea0fd: goto C2781; E27bf: $this->formErrors = $this->getErrorMessages($form); goto Ce57e; C2781: try { goto d7611; d7611: $session = $request->getSession(); goto C0583; E1ed4: $this->createPythonSite($domainName, $pythonVersion, $port, $siteUser, $siteUserPassword); goto e680b; a7146: $pythonVersion = $form->get("pythonVersion")->getData(); goto ae16d; Bbbfe: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto D19bb; ec854: $siteUser = $form->get("siteUser")->getData(); goto Ecbae; Ecbae: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto B40b6; e680b: $eventData = ["site" => $domainName, "siteUser" => $siteUser, "pythonVersion" => $pythonVersion, "port" => $port]; goto f0bad; ca583: $user = $this->getUser(); goto E1ed4; e16e0: c784f: goto ca583; C0583: $domainName = $form->get("domainName")->getData(); goto a7146; d5b22: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto e0b17; f0bad: EventQueue::addEvent(EventQueue::EVENT_SITE_PYTHON_CREATE, $user, $eventData, $request); goto C517a; C83c2: return $response; goto A5122; C517a: $session->getFlashBag()->set("success", $this->translator->trans("Site has been created.")); goto b6722; B40b6: $vhostTemplateName = self::PYTHON_VHOST_TEMPLATE_NAME; goto Bbbfe; A5122: Dbc47: goto D7169; D19bb: if (false === is_null($vhostTemplateEntity)) { goto c784f; } goto d5b22; b6722: $response = $this->redirect($this->generateUrl("clp_sites")); goto C83c2; e0b17: goto Dbc47; goto e16e0; ae16d: $port = $form->get("port")->getData(); goto ec854; D7169: } 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 bc5df; Ce57e: goto aa06c; goto d7b2b; B838d: } public function newReverseProxy(Request $request) : Response { goto d2006; c7ca5: C6fc0: goto c003d; f44e4: if (!(true === $request->isMethod("POST"))) { goto A1d17; } goto e8e76; a8b4f: if (true === $hasPermissions) { goto D13e9; } goto Bbf26; A257c: $response = $this->handleReverseProxyForm($request, $form); goto Da050; Caa65: return $response; goto D1db6; d2006: $hasPermissions = $this->hasPermissions(); goto a8b4f; Bbf26: $response = $this->redirect($this->generateUrl("clp_sites")); goto bfa7a; c3adf: return $response; goto c7ca5; A74a4: aa485: goto Caa65; D5555: A1d17: goto Be558; bfa7a: goto aa485; goto C4f6f; E1cf3: $user = $this->getUser(); goto Eb44f; Eb44f: $form = $this->createReverseProxyForm(); goto f44e4; afed2: if (!(true === $form->isSubmitted())) { goto fb7fb; } goto A257c; Da050: if (!(false === is_null($response))) { goto C6fc0; } goto c3adf; c003d: fb7fb: goto D5555; Be558: $response = $this->render("Frontend/Site/New/reverse-proxy.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto A74a4; e8e76: $form->handleRequest($request); goto afed2; C4f6f: D13e9: goto E1cf3; D1db6: } private function createReverseProxyForm() : Form { goto Dc325; cac78: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto e38eb; Dc325: $form = $this->createForm("App\Form\SiteNewReverseProxyType", [], ["action" => $this->generateUrl("clp_site_reverse_proxy_new"), "method" => "POST", "attr" => ["id" => "new-reverse-proxy-form"]]); goto cac78; e38eb: return $form; goto d3ac0; d3ac0: } private function handleReverseProxyForm(Request $request, Form $form) { goto A6a07; b6249: goto Da7c9; goto F857a; B7adc: $this->formErrors = $this->getErrorMessages($form); goto b6249; A6a07: if (true === $form->isValid()) { goto Ae1d9; } goto B7adc; E5892: Da7c9: goto D40ba; F857a: Ae1d9: goto Bce8e; Bce8e: try { goto Be1ae; Da165: E29b2: goto Eea7b; Defe6: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto D32bc; aa354: $eventData = ["site" => $domainName, "siteUser" => $siteUser, "reverseProxyUrl" => $reverseProxyUrl]; goto E86c3; A96dd: $response = $this->redirect($this->generateUrl("clp_sites")); goto B75f7; B8c31: $vhostTemplateName = self::REVERSE_PROXY_VHOST_TEMPLATE_NAME; goto be3ba; be3ba: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto cd743; d3884: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto e515d; D5e8b: $siteUser = $form->get("siteUser")->getData(); goto Defe6; e6507: B58e4: goto A35e9; bc0d3: $domainName = $form->get("domainName")->getData(); goto D5e8b; A35e9: $user = $this->getUser(); goto D9776; e515d: goto E29b2; goto e6507; B75f7: return $response; goto Da165; D32bc: $reverseProxyUrl = $form->get("reverseProxyUrl")->getData(); goto B8c31; cd743: if (false === is_null($vhostTemplateEntity)) { goto B58e4; } goto d3884; e73bd: $session->getFlashBag()->set("success", $this->translator->trans("Reverse Proxy has been created.")); goto A96dd; E86c3: EventQueue::addEvent(EventQueue::EVENT_SITE_REVERSE_PROXY_CREATE, $user, $eventData, $request); goto e73bd; Be1ae: $session = $request->getSession(); goto bc0d3; D9776: $this->createReverseProxySite($domainName, $reverseProxyUrl, $siteUser, $siteUserPassword); goto aa354; Eea7b: } 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 E5892; D40ba: } public function newNodejsSite(Request $request) : Response { goto F2828; C9557: D5613: goto Bbfcf; Abcab: F3cb0: goto C9557; be195: $user = $this->getUser(); goto d41d4; A172a: $form = $this->createNodejsSiteForm($nodejsSettings); goto B74dd; e7fe5: return $response; goto Bdf02; c5dcd: C1ab4: goto E538d; d3221: if (true === $hasPermissions) { goto cc080; } goto c50a8; F5486: $form->handleRequest($request); goto f39ac; ea199: $response = $this->handleCreateNodejsSiteForm($request, $form); goto E390f; F2828: $hasPermissions = $this->hasPermissions(); goto d3221; e4bfb: cc080: goto be195; f39ac: if (!(true === $form->isSubmitted())) { goto F3cb0; } goto ea199; E390f: if (!(false === is_null($response))) { goto F7981; } goto e7fe5; B74dd: if (!(true === $request->isMethod("POST"))) { goto D5613; } goto F5486; Ab1dc: goto C1ab4; goto e4bfb; d41d4: $nodejsSettings = new NodejsSettingsEntity(); goto A172a; E538d: return $response; goto f34a0; Bdf02: F7981: goto Abcab; c50a8: $response = $this->redirect($this->generateUrl("clp_sites")); goto Ab1dc; Bbfcf: $response = $this->render("Frontend/Site/New/nodejs.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto c5dcd; f34a0: } private function createNodejsSiteForm(NodejsSettingsEntity $nodejsSettings) : Form { goto b8ba4; b8ba4: $form = $this->createForm("App\Form\SiteNewNodejsType", $nodejsSettings, ["action" => $this->generateUrl("clp_site_nodejs_new"), "method" => "POST", "attr" => ["id" => "new-nodejs-site-form"]]); goto F1424; D42b3: return $form; goto Ebf2d; F1424: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto D42b3; Ebf2d: } private function handleCreateNodejsSiteForm(Request $request, Form $form) { goto ee655; ee655: if (true === $form->isValid()) { goto ab4e1; } goto decd7; Ab6d1: try { goto e681b; e681b: $session = $request->getSession(); goto F720e; d1bfb: $port = $form->get("port")->getData(); goto a3665; Dc6bf: goto c54ce; goto D4282; b8030: EventQueue::addEvent(EventQueue::EVENT_SITE_NODEJS_CREATE, $user, $eventData, $request); goto c30e3; F720e: $domainName = $form->get("domainName")->getData(); goto Ccd34; eac5b: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto Dc6bf; B66a5: return $response; goto Fd096; e34df: if (false === is_null($vhostTemplateEntity)) { goto c5af0; } goto eac5b; Fd096: c54ce: goto B1225; E48fc: $vhostTemplateName = self::NODEJS_VHOST_TEMPLATE_NAME; goto C9b1d; Ccd34: $nodejsVersion = $form->get("nodejsVersion")->getData(); goto d1bfb; Ed837: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto E48fc; D4282: c5af0: goto d6cf4; a3665: $siteUser = $form->get("siteUser")->getData(); goto Ed837; ef4a7: $response = $this->redirect($this->generateUrl("clp_sites")); goto B66a5; d6cf4: $user = $this->getUser(); goto C0172; c30e3: $session->getFlashBag()->set("success", $this->translator->trans("Site has been created.")); goto ef4a7; C0172: $this->createNodejsSite($domainName, $nodejsVersion, $port, $siteUser, $siteUserPassword); goto Ddf8a; C9b1d: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto e34df; Ddf8a: $eventData = ["site" => $domainName, "siteUser" => $siteUser, "nodejsVersion" => $nodejsVersion, "port" => $port]; goto b8030; B1225: } 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 Dc3a8; decd7: $this->formErrors = $this->getErrorMessages($form); goto D60f0; f42eb: ab4e1: goto Ab6d1; D60f0: goto a5e26; goto f42eb; Dc3a8: a5e26: goto d00d0; d00d0: } public function newStaticSite(Request $request) : Response { goto B0134; Bb87a: return $response; goto a31aa; b7542: $response = $this->render("Frontend/Site/New/static.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto fe4f0; Eb39b: return $response; goto aee0d; Dd0d1: $response = $this->redirect($this->generateUrl("clp_sites")); goto Fafc4; a0f1e: if (true === $hasPermissions) { goto F4d9d; } goto Dd0d1; B0134: $hasPermissions = $this->hasPermissions(); goto a0f1e; Fd5d0: $user = $this->getUser(); goto d2261; fcd0d: if (!(false === is_null($response))) { goto bc507; } goto Eb39b; aee0d: bc507: goto b5663; D97d9: if (!(true === $request->isMethod("POST"))) { goto C7f47; } goto b5fca; Fd2e2: if (!(true === $form->isSubmitted())) { goto c3894; } goto b6a7f; B4f17: C7f47: goto b7542; fe4f0: Ce97a: goto Bb87a; b5fca: $form->handleRequest($request); goto Fd2e2; b5663: c3894: goto B4f17; b6a7f: $response = $this->handleCreateStaticSiteForm($request, $form); goto fcd0d; d2261: $form = $this->createStaticSiteForm(); goto D97d9; d71e1: F4d9d: goto Fd5d0; Fafc4: goto Ce97a; goto d71e1; a31aa: } private function createStaticSiteForm() : Form { goto A9893; b388f: return $form; goto a4554; A9893: $form = $this->createForm("App\Form\SiteNewStaticType", [], ["action" => $this->generateUrl("clp_site_static_new"), "method" => "POST", "attr" => []]); goto A7564; A7564: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto b388f; a4554: } private function handleCreateStaticSiteForm(Request $request, Form $form) { goto F965d; D9abc: try { goto d2bf4; D33c4: $siteUser = $form->get("siteUser")->getData(); goto aee0b; Fe51a: $vhostTemplateName = self::STATIC_SITE_VHOST_TEMPLATE_NAME; goto a14fb; e8646: $response = $this->redirect($this->generateUrl("clp_sites")); goto Dcc34; Feae9: $this->createStaticSite($domainName, $siteUser, $siteUserPassword); goto cee6b; d2bf4: $session = $request->getSession(); goto Cad2e; aee0b: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto Fe51a; Dcc34: return $response; goto c541a; A7477: $user = $this->getUser(); goto Feae9; Cad2e: $domainName = $form->get("domainName")->getData(); goto D33c4; c541a: eb6f7: goto D36a5; cac16: $session->getFlashBag()->set("success", $this->translator->trans("Site has been created.")); goto e8646; cee6b: $eventData = ["site" => $domainName, "siteUser" => $siteUser]; goto B4736; B4736: EventQueue::addEvent(EventQueue::EVENT_SITE_STATIC_CREATE, $user, $eventData, $request); goto cac16; F5e14: if (false === is_null($vhostTemplateEntity)) { goto B45e8; } goto E1b34; ba325: goto eb6f7; goto bbcab; bbcab: B45e8: goto A7477; E1b34: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto ba325; a14fb: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto F5e14; D36a5: } 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 fcfc9; A7835: $this->formErrors = $this->getErrorMessages($form); goto f4f53; fcfc9: a9d8c: goto E74d5; F965d: if (true === $form->isValid()) { goto D03a2; } goto A7835; a7397: D03a2: goto D9abc; f4f53: goto a9d8c; goto a7397; E74d5: } public function newPhpSite(Request $request) : Response { goto ed944; Dde7b: $response = $this->render("Frontend/Site/New/php.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto De8f8; D2494: $user = $this->getUser(); goto a3750; C86cc: if (true === $hasPermissions) { goto D3ad7; } goto adb91; E79d9: c9aba: goto f02e1; d0ff6: $form->handleRequest($request); goto de951; Bfd92: $response = $this->handleCreatePhpSiteForm($request, $form); goto D95ee; c119c: return $response; goto D52ab; De8f8: B474c: goto c119c; faf0a: if (!(true === $request->isMethod("POST"))) { goto C9804; } goto d0ff6; D95ee: if (!(false === is_null($response))) { goto c9aba; } goto C90a1; f02e1: c5abd: goto Cc2dd; dff35: D3ad7: goto D2494; adb91: $response = $this->redirect($this->generateUrl("clp_sites")); goto c1f5a; de951: if (!(true === $form->isSubmitted())) { goto c5abd; } goto Bfd92; ed944: $hasPermissions = $this->hasPermissions(); goto C86cc; c1f5a: goto B474c; goto dff35; a3750: $form = $this->createPhpSiteForm(); goto faf0a; Cc2dd: C9804: goto Dde7b; C90a1: return $response; goto E79d9; D52ab: } private function createPhpSiteForm() : Form { goto b1df5; A3a0a: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto A786c; b1df5: $form = $this->createForm("App\Form\SiteNewPhpType", [], ["action" => $this->generateUrl("clp_site_php_new"), "method" => "POST", "attr" => []]); goto A3a0a; A786c: return $form; goto d2b54; d2b54: } private function handleCreatePhpSiteForm(Request $request, Form $form) { goto e80c7; e80c7: if (true === $form->isValid()) { goto Dac89; } goto c8b32; c8b32: $this->formErrors = $this->getErrorMessages($form); goto a18ab; d8c7c: cd7c1: goto C1fc3; a18ab: goto cd7c1; goto e2186; e2186: Dac89: goto a1fb2; a1fb2: try { goto df1d7; Bbf50: if (!(false === empty($vhostTemplateEntity->getVarnishCacheSettings()))) { goto b63d3; } goto d3ea2; dee6c: Ef9b2: goto cf459; Ea9f9: $this->createPhpSite($domainName, $rootDirectory, $phpVersion, $vhostTemplateName, $siteUser, $siteUserPassword, $varnishCacheSettings); goto ab714; A2297: E814f: goto Ea901; c9690: return $response; goto A2297; cf459: $varnishCacheSettings = []; goto Bbf50; E0e35: $user = $this->getUser(); goto A9222; Cc8b4: $rootDirectory = sprintf("%s/%s", $rootDirectory, ltrim(rtrim($vhostTemplateEntity->getRootDirectory(), "/"), "/")); goto dee6c; a5562: throw new \Exception(sprintf("Vhost template "%s" not found.", $vhostTemplateName)); goto f564e; e6af5: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto a580c; aa728: $phpVersion = $form->get("phpVersion")->getData(); goto e81a2; ab714: $eventData = ["site" => $domainName, "vhostTemplateName" => $vhostTemplateName, "phpVersion" => $phpVersion, "siteUser" => $siteUser]; goto F34b3; a580c: if (false === is_null($vhostTemplateEntity)) { goto fe692; } goto a5562; eafde: $vhostTemplateName = $form->get("application")->getData(); goto d5d8f; d3ea2: $varnishCacheSettings = (array) json_decode($vhostTemplateEntity->getVarnishCacheSettings(), true); goto d7c6b; A9222: $rootDirectory = $domainName; goto E3b6e; d5d8f: $domainName = $form->get("domainName")->getData(); goto aa728; af00b: $session->getFlashBag()->set("success", $this->translator->trans("Site has been created.")); goto a8441; df1d7: $session = $request->getSession(); goto eafde; a2d65: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto e6af5; a8441: $response = $this->redirect($this->generateUrl("clp_sites")); goto c9690; Bd8a6: fe692: goto E0e35; e81a2: $siteUser = $form->get("siteUser")->getData(); goto a2d65; f564e: goto E814f; goto Bd8a6; d7c6b: b63d3: goto Ea9f9; E3b6e: if (!(false === empty($vhostTemplateEntity->getRootDirectory()))) { goto Ef9b2; } goto Cc8b4; F34b3: EventQueue::addEvent(EventQueue::EVENT_SITE_PHP_CREATE, $user, $eventData, $request); goto af00b; Ea901: } 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 d8c7c; C1fc3: } public function newWordPressSite(Request $request) : Response { goto ca6b9; ca6b9: $hasPermissions = $this->hasPermissions(); goto Ff964; Dd7f3: $response = $this->redirect($this->generateUrl("clp_sites")); goto efd0b; b21b0: ffcaa: goto F4707; C726f: Dc093: goto E81c8; A08c5: f3da5: goto cb5fb; Fd215: $form = $this->createWordPressSiteForm(); goto e785f; c6691: $response = $this->render("Frontend/Site/New/wordpress.html.twig", ["user" => $user, "form" => $form->createView(), "formErrors" => $this->formErrors]); goto A08c5; efd0b: goto f3da5; goto b21b0; Ff964: if (true === $hasPermissions) { goto ffcaa; } goto Dd7f3; Bfe3d: $form->handleRequest($request); goto b8d7c; cb5fb: return $response; goto c75d3; d38ed: if (!(false === is_null($response))) { goto Dc093; } goto e7bfc; B9e47: E5bfa: goto c6691; F4707: $user = $this->getUser(); goto Fd215; b8d7c: if (!(true === $form->isSubmitted())) { goto C53e8; } goto b2146; e785f: if (!(true === $request->isMethod("POST"))) { goto E5bfa; } goto Bfe3d; e7bfc: return $response; goto C726f; E81c8: C53e8: goto B9e47; b2146: $response = $this->handleCreateWordPressSiteForm($request, $form); goto d38ed; c75d3: } private function createWordPressSiteForm() : Form { goto d31e4; D9846: return $form; goto c4e66; E7a99: $form->add("submit", SubmitType::class, ["attr" => ["class" => "btn btn-lg btn-blue"], "label" => "Create"]); goto D9846; d31e4: $form = $this->createForm("App\Form\SiteNewWordPressType", [], ["action" => $this->generateUrl("clp_site_wordpress_new"), "method" => "POST", "attr" => ["id" => "new-wordpress-site-form"]]); goto E7a99; c4e66: } private function handleCreateWordPressSiteForm(Request $request, Form $form) { goto Eb0e4; a0d81: B712a: goto A2bce; ef85e: E2aa6: goto b1886; C26ca: goto E2aa6; goto a0d81; D2036: $this->formErrors = $this->getErrorMessages($form); goto C26ca; A2bce: try { goto ed6fc; ce527: $databaseUserEntity->setUserName($databaseUserName); goto ba0c4; Dd6d9: Dc10a: goto Fc7b2; ef7c7: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::WORDPRESS_VHOST_TEMPLATE_NAME); goto d0d9d; F63aa: $adminPassword = $form->get("adminPassword")->getData(); goto D73b9; d5ec7: $databaseUserName = $this->getUniqueDatabaseUserName($generatedName); goto D15d9; C78d1: $databaseUserEntity = $this->databaseUserEntityManager->createEntity(); goto ce527; Bde20: $eventData = ["site" => $domainName, "siteUser" => $siteUser]; goto Bc670; ee66d: $this->installWordPress($isMultiSite, $url, $title, $adminUserName, $adminPassword, $adminEmail, $siteEntity, $activeDatabaseServerEntity, $databaseEntity, $databaseUserEntity); goto fa5cb; E8ab8: $response = $this->redirect($this->generateUrl("clp_site_wordpress_installed")); goto E71e7; A5983: $url = sprintf("https://%s", $siteEntity->getDomainName()); goto b61b9; D9538: $instance = $request->attributes->get("instance"); goto ab023; a5567: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto D9538; Bc670: EventQueue::addEvent(EventQueue::EVENT_SITE_WORDPRESS_CREATE, $user, $eventData, $request); goto E8ab8; D26eb: $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 Dd6d9; c1894: $siteUserPassword = $form->get("siteUserPassword")->getData(); goto ef7c7; f4358: $databaseManager->createDatabase($databaseEntity); goto dc462; ba0c4: $databaseUserEntity->setPassword(Crypto::encrypt($databaseUserPassword)); goto a8587; ab023: $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 f453e; f1454: $siteEntity = $this->createPhpSite($domainName, $domainName, $phpVersion, self::WORDPRESS_VHOST_TEMPLATE_NAME, $siteUser, $siteUserPassword, $varnishCacheSettings); goto a5567; a2819: $isMultiSite = $form->get("multiSite")->getData(); goto b0af5; Eb818: $databaseEntity->setName($databaseName); goto cf250; Fc7b2: $session->set("siteCredentials", $siteCredentials); goto Bde20; D140c: $this->siteEntityManager->updateEntity($siteEntity); goto ee66d; B7a36: $databaseEntity->setDatabaseServer($activeDatabaseServerEntity); goto Eb818; Eda65: A7e8e: goto f1454; B5788: $siteEntity->addDatabase($databaseEntity); goto Db263; c7cc3: $siteUser = $form->get("siteUser")->getData(); goto c1894; cf250: $databaseEntity->setSite($siteEntity); goto C78d1; d0d9d: $phpVersion = $vhostTemplateEntity->getPhpVersion(); goto b15b1; b0af5: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto F6dd0; f453e: if (!(false === is_null($siteEntity))) { goto Dc10a; } goto Ed9e8; D73b9: $adminEmail = $form->get("adminEmail")->getData(); goto a2819; E71e7: return $response; goto e9903; c7aad: $domainName = $form->get("domainName")->getData(); goto c84e5; Ed9e8: $databaseName = $this->getUniqueDatabaseName($generatedName); goto d5ec7; a7b6b: if (!(false === empty($vhostTemplateEntity->getVarnishCacheSettings()))) { goto A7e8e; } goto b6d79; b61b9: $title = $form->get("siteTitle")->getData(); goto Ce813; ced33: $session = $request->getSession(); goto c7aad; Bd71d: $databaseUserEntity->setDatabase($databaseEntity); goto e1f2a; F6dd0: $databaseEntity = $this->databaseEntityManager->createEntity(); goto B7a36; b15b1: $varnishCacheSettings = []; goto a7b6b; D15d9: $databaseUserPassword = PasswordGenerator::generate(self::PASSWORD_LENGTH); goto A5983; ed6fc: $user = $this->getUser(); goto ced33; Ce813: $adminUserName = $form->get("adminUserName")->getData(); goto F63aa; b6d79: $varnishCacheSettings = (array) json_decode($vhostTemplateEntity->getVarnishCacheSettings(), true); goto Eda65; a8587: $databaseUserEntity->setPermissions(DatabaseUserEntity::PERMISSIONS_READ_WRITE); goto Bd71d; fa5cb: $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 D26eb; Db263: $databaseManager = new DatabaseManager($activeDatabaseServerEntity); goto f4358; c84e5: $generatedName = $this->generateNameFromDomainName($domainName); goto c7cc3; dc462: $databaseManager->createUser($databaseUserEntity); goto D140c; e1f2a: $databaseEntity->addUser($databaseUserEntity); goto B5788; e9903: } 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 ef85e; Eb0e4: if (true === $form->isValid()) { goto B712a; } goto D2036; b1886: } 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 Dd58f; Bb650: $wordPressInstaller->installCore($isMultiSite, $url, $title, $adminUserName, $adminPassword, $adminEmail); goto a4cf9; C056b: $databaseName = $databaseEntity->getName(); goto E07d2; a3719: $databaseUserPassword = Crypto::decrypt($databaseUserEntity->getPassword()); goto Ad5f2; e1549: acf3b: goto c4c14; a46d5: foreach ($this->wordPressMultiSiteConfigValues as $key => $config) { $wordPressInstaller->setConfigValue($key, $config["value"], $config["raw"]); Fadcc: } goto e1549; E07d2: $databaseUserName = $databaseUserEntity->getUserName(); goto a3719; E1ea7: $wordPressInstaller->resetPermissions(); goto A730f; c4c14: c5acb: goto E1ea7; B2eb2: $wordPressInstaller->downloadAndExtractLatestVersion(); goto Af3b7; Af3b7: $wordPressInstaller->createConfig($databaseHost, $databaseName, $databaseUserName, $databaseUserPassword); goto Bb650; ea64d: if (!(true === $isMultiSite)) { goto c5acb; } goto B368a; a4cf9: foreach ($this->wordPressDefaultConfigValues as $key => $config) { $wordPressInstaller->setConfigValue($key, $config["value"], $config["raw"]); cfef2: } goto eb5a3; Dd58f: $databaseHost = sprintf("%s:%s", $databaseServerEntity->getHost(), $databaseServerEntity->getPort()); goto C056b; B368a: $this->wordPressMultiSiteConfigValues["DOMAIN_CURRENT_SITE"]["value"] = $siteEntity->getDomainName(); goto a46d5; Ad5f2: $wordPressInstaller = new WordPressInstaller($siteEntity); goto B2eb2; eb5a3: aa44a: goto ea64d; A730f: } private function createPhpSite(string $domainName, string $rootDirectory, string $phpVersion, string $vhostTemplateName, string $siteUser, string $siteUserPassword, array $varnishCacheSettings = []) : SiteEntity { goto C746d; b02a7: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto ad156; e7313: $certificateEntity->setSite($siteEntity); goto b1d87; Cc956: $siteEntity->setUser($siteUser); goto c3e5e; Ff093: $phpSite->setPhpSettings($phpSettingsEntity); goto a173f; F74ec: Ccfe9: goto d5e26; f0253: $siteEntity->setType(SiteEntity::TYPE_PHP); goto b13b2; Aef71: $siteEntity->setCertificate($certificateEntity); goto Abb63; B49a4: $vhostTemplate->resetProcessors(); goto A4a65; E3656: $phpSettingsEntity->setPhpVersion($phpVersion); goto c3dd7; E6432: $phpSiteCreator->createNginxVhost(); goto Fc1db; ba73a: $siteEntity->setRootDirectory($rootDirectory); goto df91f; a173f: $phpSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto C6c3c; Dabb9: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto ca3ab; a323d: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto c091a; } goto E3da4; C0278: return $siteEntity; goto e0fe4; C90fa: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto Cc7dc; c3dd7: $phpSettingsEntity->setSite($siteEntity); goto A9d06; Fc1db: $phpSiteCreator->reloadNginxService(); goto ee71d; A30e0: $constraintViolationList = new ConstraintViolationList(); goto acb7f; D3735: $defaultVarnishCacheSettings = ["enabled" => false, "server" => self::VARNISH_CACHE_SERVER, "cacheTagPrefix" => substr(md5(time()), 0, 4)]; goto b325b; d23cc: $phpSite->setRegistrableDomain($registrableDomain); goto c97ff; Cf694: $subdomain = $resolvedDomainName->subDomain()->toString(); goto A826b; d5e26: $certificateEntity = $this->certificateEntityManager->createEntity(); goto e7313; A4a65: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto c4adc; edb9d: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto f7931; A4ba6: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto F5d63; e5b8b: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto A5f05; Cc7dc: $certificateEntity->setDefaultCertificate(true); goto b02a7; ad156: $certificateEntity->setCsr($csr); goto d30ac; D4d99: $phpSite->setCertificate($certificateEntity); goto Ff093; b2f06: $phpSettingsEntity = new PhpSettingsEntity(); goto e7136; adf53: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto Bcd96; F5d63: $this->siteEntityManager->updateEntity($siteEntity); goto C0278; f5e1e: $phpSettingsConstraints = $this->validator->validate($phpSettingsEntity); goto Ad29d; E9f4b: $phpSiteCreator->createIndexPhp(); goto E4218; b7b5c: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto A4ba6; b1d87: $rsaKeyGenerator = new RsaKeyGenerator(); goto c979a; c4adc: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto b5932; Fa9fa: $certificateEntity->setCertificate($selfSignedCertificate); goto Aef71; c3603: $subjectAlternativeNames[] = $registrableDomain; goto F7a4e; C746d: $varnishCache = false === empty($varnishCacheSettings) ? true : false; goto E1c03; A826b: $subdomain = false === empty($subdomain) ? $subdomain : null; goto f2bbe; a9e5b: $vhostTemplate->build(); goto b7b5c; E3da4: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto eb2c6; f7931: $csr = $csrGenerator->generate(); goto C90fa; C406e: Dfec8: goto C0f8d; B192f: $siteEntity->setVhostTemplate($vhostTemplate); goto b2f06; b13b2: $siteEntity->setDomainName($domainName); goto Cc956; d4c9d: $phpSite->setVarnishCacheSettings($varnishCacheSettings); goto d4436; d30ac: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto Fa9fa; fe964: $phpSite->setRootDirectory($siteEntity->getRootDirectory()); goto D4d99; ca3ab: a178d: goto df0d5; d4aff: $siteEntity = $this->siteEntityManager->createEntity(); goto f0253; b5d32: $phpSiteCreator->createPhpFpmPool(); goto addf8; b5932: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto a9e5b; eb2c6: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto e3097; Ebd5a: $phpSite->setUserPassword($siteEntity->getUserPassword()); goto C285d; Bed5b: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto B49a4; c97ff: $phpSite->setSubdomain($subdomain); goto fe964; b8a87: $siteEntity->setVarnishCache(true); goto Cb123; E1c03: $rootDirectory = trim(rtrim(ltrim($rootDirectory, "/")), "/"); goto adf53; e3097: if (!(false === empty($redirectionVhostTemplate))) { goto a178d; } goto Dabb9; A5881: if (!(true === $varnishCache)) { goto Af964; } goto A3ead; b325b: $varnishCacheSettings = array_merge($defaultVarnishCacheSettings, $varnishCacheSettings); goto c9f9d; E4218: $phpSiteCreator->createPrivateKeyAndCertificate(); goto b5d32; Ad29d: if (!(count($siteConstraints) || count($phpSettingsConstraints))) { goto Ccfe9; } goto A30e0; eca23: $phpSiteCreator->createRootDirectory(); goto Ab4de; Abb63: $phpSite = new PhpSite(); goto D9792; A3ead: $phpSite->setVarnishCache(true); goto D3735; C285d: $phpSite->setDomainName($domainName); goto d23cc; D9792: $phpSite->setUser($siteEntity->getUser()); goto Ebd5a; ee71d: $phpSiteCreator->resetPermissions(); goto Bde79; a15ad: $constraintViolationList->addAll($phpSettingsConstraints); goto e5b8b; C0f8d: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto Ee72a; } goto c3603; df0d5: c091a: goto B192f; acb7f: $constraintViolationList->addAll($siteConstraints); goto a15ad; A5f05: throw new \Exception(implode("; ", $errorMessages)); goto F74ec; c979a: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto a44c2; a44c2: $subjectAlternativeNames = []; goto ca866; f2bbe: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto F7b20; F8cfd: $phpSiteCreator->createUser(); goto eca23; Cb123: Abca6: goto a323d; F7b20: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto d4aff; Fdb92: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto edb9d; C6c3c: $phpSiteCreator = new PhpSiteCreator($phpSite); goto F8cfd; F7a4e: Ee72a: goto Fdb92; c9f9d: $phpSiteCreator->createVarnishCacheStructure($varnishCacheSettings); goto d4c9d; df91f: if (!(false === empty($varnishCache))) { goto Abca6; } goto b8a87; addf8: $phpSiteCreator->reloadPhpFpmService(); goto A5881; c3e5e: $siteEntity->setUserPassword($siteUserPassword); goto ba73a; A9d06: $siteConstraints = $this->validator->validate($siteEntity); goto f5e1e; Bcd96: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto Cf694; d4436: Af964: goto E6432; Bde79: $vhostTemplate = new PhpVhostTemplate($phpSite); goto Bed5b; Ab4de: $phpSiteCreator->createLogrotateFile(); goto E9f4b; e7136: $siteEntity->setPhpSettings($phpSettingsEntity); goto E3656; be63d: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto C406e; ca866: if (!(true === is_null($subdomain))) { goto Dfec8; } goto be63d; e0fe4: } private function createNodejsSite(string $domainName, string $nodejsVersion, string $port, string $siteUser, string $siteUserPassword) : SiteEntity { goto f5b6a; A4014: $nodejsSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto d3887; adde1: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto c3df2; a935d: $nodejsSite->setRegistrableDomain($registrableDomain); goto Ab86b; Db800: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto f7c60; c41b1: $nodejsSiteCreator->installNodejs(); goto c82fd; Ab86b: $nodejsSite->setSubdomain($subdomain); goto ab3e4; f3903: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto Cc77c; c0de0: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto C759e; } goto c0efe; c99b7: $nodejsSiteCreator->createLogrotateFile(); goto Ac61a; F3ff3: $siteConstraints = $this->validator->validate($siteEntity); goto A0cea; C948d: $siteEntity->setNodejsSettings($nodejsSettingsEntity); goto B5ab8; fcce3: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto c9f55; D8d4a: $subdomain = false === empty($subdomain) ? $subdomain : null; goto de938; df77f: throw new \Exception(implode("; ", $errorMessages)); goto b6e8c; B50ef: $nodejsSite = new NodejsSite(); goto C4132; Cf735: $nodejsSettingsEntity = new NodejsSettingsEntity(); goto C948d; b8918: $nodejsSettingsEntity->setPort($port); goto B90f1; c17b6: if (!(count($siteConstraints) || count($nodejsSettingsConstraints))) { goto Bad23; } goto De7c5; a2163: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto D2817; e6199: $siteEntity->setRootDirectory($domainName); goto e91dd; Ac61a: $nodejsSiteCreator->createNvmDirectory(); goto c41b1; B5ab8: $nodejsSettingsEntity->setNodejsVersion($nodejsVersion); goto b8918; d7ad6: $subdomain = $resolvedDomainName->subDomain()->toString(); goto D8d4a; f8a6e: $nodejsSite->setDomainName($domainName); goto a935d; a12fb: if (!(true === is_null($subdomain))) { goto a5e6c; } goto C6368; ab3e4: $nodejsSite->setRootDirectory($siteEntity->getRootDirectory()); goto d204c; ce1cb: $constraintViolationList->addAll($siteConstraints); goto cbb51; c82fd: $nodejsSiteCreator->createPrivateKeyAndCertificate(); goto b14c2; c0dd1: $certificateEntity->setSite($siteEntity); goto b3138; cfa0c: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto f8cea; B4130: $this->siteEntityManager->updateEntity($siteEntity); goto Bd3f7; aef7e: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto b51fb; d204c: $nodejsSite->setCertificate($certificateEntity); goto f1f93; f1f93: $nodejsSite->setNodejsSettings($nodejsSettingsEntity); goto A4014; f7c60: $certificateEntity->setCsr($csr); goto aef7e; eec51: $vhostTemplate->resetProcessors(); goto f864d; c0efe: $subjectAlternativeNames[] = $registrableDomain; goto ae621; De7c5: $constraintViolationList = new ConstraintViolationList(); goto ce1cb; de938: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::NODEJS_VHOST_TEMPLATE_NAME); goto c444c; F9aa5: $siteEntity = $this->siteEntityManager->createEntity(); goto bb356; b14c2: $nodejsSiteCreator->createNginxVhost(); goto A6cae; e91dd: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto Dccf1; } goto cfa0c; Fb060: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto eec51; d3887: $nodejsSiteCreator = new NodejsSiteCreator($nodejsSite); goto Fe841; D6519: Dccf1: goto E2064; Bd3f7: return $siteEntity; goto E4032; bf351: $vhostTemplate = new StaticVhostTemplate($nodejsSite); goto Fb060; cbb51: $constraintViolationList->addAll($nodejsSettingsConstraints); goto Eb836; Cc77c: $vhostTemplate->build(); goto adde1; D1d13: $certificateEntity = $this->certificateEntityManager->createEntity(); goto c0dd1; D241a: $certificateEntity->setDefaultCertificate(true); goto Db800; D2817: c0523: goto D6519; ee9cc: if (!(false === empty($redirectionVhostTemplate))) { goto c0523; } goto a2163; E4d82: $nodejsSiteCreator->createRootDirectory(); goto c99b7; Ae39d: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto Ed17a; Ed17a: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto dcfe8; E2064: $siteEntity->setVhostTemplate($vhostTemplate); goto Cf735; f8cea: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto ee9cc; B3ae6: $siteEntity->setUser($siteUser); goto Ab5bd; c9f55: $subjectAlternativeNames = []; goto a12fb; b3138: $rsaKeyGenerator = new RsaKeyGenerator(); goto fcce3; f864d: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto Fc3ad; a0846: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto D241a; C6368: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto a1574; b51fb: $certificateEntity->setCertificate($selfSignedCertificate); goto A3aa6; Fc3ad: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto f3903; A6cae: $nodejsSiteCreator->reloadNginxService(); goto e7806; A0cea: $nodejsSettingsConstraints = $this->validator->validate($nodejsSettingsEntity); goto c17b6; Ab5bd: $siteEntity->setUserPassword($siteUserPassword); goto e6199; B90f1: $nodejsSettingsEntity->setSite($siteEntity); goto F3ff3; Eb836: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto df77f; f5b6a: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto A80ad; b6e8c: Bad23: goto D1d13; c444c: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto F9aa5; c3df2: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto B4130; ae621: C759e: goto Ae39d; a1574: a5e6c: goto c0de0; bb356: $siteEntity->setType(SiteEntity::TYPE_NODEJS); goto ebacd; C4132: $nodejsSite->setUser($siteEntity->getUser()); goto A58a3; A3aa6: $siteEntity->setCertificate($certificateEntity); goto B50ef; ebacd: $siteEntity->setDomainName($domainName); goto B3ae6; A80ad: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto d7ad6; Fe841: $nodejsSiteCreator->createUser(); goto E4d82; A58a3: $nodejsSite->setUserPassword($siteEntity->getUserPassword()); goto f8a6e; e7806: $nodejsSiteCreator->resetPermissions(); goto bf351; dcfe8: $csr = $csrGenerator->generate(); goto a0846; E4032: } private function createPythonSite(string $domainName, string $pythonVersion, string $port, string $siteUser, string $siteUserPassword) : SiteEntity { goto cbf81; B391f: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto b5485; e5de4: $subjectAlternativeNames = []; goto afe5b; b3e18: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto Fc061; Ceb73: C297c: goto db5e4; b3456: C08f8: goto a2f2c; C36de: $pythonSiteCreator = new PythonSiteCreator($pythonSite); goto d1ebc; Fc061: $certificateEntity->setCsr($csr); goto e1fba; C042c: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto ed230; B8511: $vhostTemplate = new PythonVhostTemplate($pythonSite); goto D9ea8; C0722: $pythonSettingsEntity = new PythonSettingsEntity(); goto Feedf; d4611: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto cc53e; Bba10: $csr = $csrGenerator->generate(); goto Be5bf; Aa97a: $siteEntity->setCertificate($certificateEntity); goto D5480; d9d97: $pythonSiteCreator->writePythonVersionFile(); goto C2b4c; d049e: $pythonSettingsEntity->setPort($port); goto b181c; d9716: $pythonSite->setDomainName($domainName); goto Ada9a; f9605: $pythonSiteCreator->createRootDirectory(); goto Ce240; b9231: return $siteEntity; goto F3eb0; Cd265: $pythonSite->setRootDirectory($siteEntity->getRootDirectory()); goto Aee43; b181c: $pythonSettingsEntity->setSite($siteEntity); goto a16d8; d196b: $siteEntity->setUser($siteUser); goto C8c71; C806b: $certificateEntity->setCertificate($selfSignedCertificate); goto Aa97a; e98c8: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto Bba10; Aee43: $pythonSite->setCertificate($certificateEntity); goto c97ac; D9452: $vhostTemplate->resetProcessors(); goto a1528; af126: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto b3456; a1528: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto e9111; afe5b: if (!(true === is_null($subdomain))) { goto C08f8; } goto af126; c9e4a: $siteEntity->setType(SiteEntity::TYPE_PYTHON); goto F685b; C12a8: $pythonSettingsEntity->setPythonVersion($pythonVersion); goto d049e; c55dd: $siteEntity->setRootDirectory($domainName); goto ae593; cc53e: $this->siteEntityManager->updateEntity($siteEntity); goto cc294; f1949: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto c310d; e9111: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto f1949; c3089: $certificateEntity->setDefaultCertificate(true); goto b3e18; be0cb: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto e5de4; D5480: $pythonSite = new PythonSite(); goto Dff3e; d8108: throw new \Exception(implode("; ", $errorMessages)); goto Aa941; cc294: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto b9231; Ae7c5: $subdomain = false === empty($subdomain) ? $subdomain : null; goto ddba7; ad08c: e1fc8: goto Dcc1d; c49d9: $pythonSiteCreator->reloadNginxService(); goto A0b5a; F6770: $pythonSettingsConstraints = $this->validator->validate($pythonSettingsEntity); goto A0248; Edc4f: $certificateEntity->setSite($siteEntity); goto Abf70; a16d8: $siteConstraints = $this->validator->validate($siteEntity); goto F6770; Dff3e: $pythonSite->setUser($siteEntity->getUser()); goto Def1b; Ada9a: $pythonSite->setRegistrableDomain($registrableDomain); goto eb38c; cbf81: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto C042c; Eb7be: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto d8108; A0248: if (!(count($siteConstraints) || count($pythonSettingsConstraints))) { goto c14be; } goto Dad6c; Ae065: $subjectAlternativeNames[] = $registrableDomain; goto ad08c; f6b21: $constraintViolationList->addAll($siteConstraints); goto b5978; Ce240: $pythonSiteCreator->createLogrotateFile(); goto d9d97; Dcc1d: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto e98c8; A0b5a: $pythonSiteCreator->resetPermissions(); goto B8511; b5485: $siteEntity = $this->siteEntityManager->createEntity(); goto c9e4a; ae593: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto ad2e6; } goto f71c5; D5a80: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto Ceb73; C8c71: $siteEntity->setUserPassword($siteUserPassword); goto c55dd; c310d: $vhostTemplate->build(); goto d4611; b5978: $constraintViolationList->addAll($pythonSettingsConstraints); goto Eb7be; ed230: $subdomain = $resolvedDomainName->subDomain()->toString(); goto Ae7c5; C2b4c: $pythonSiteCreator->createPrivateKeyAndCertificate(); goto f4e51; Dad6c: $constraintViolationList = new ConstraintViolationList(); goto f6b21; Be5bf: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto c3089; F685b: $siteEntity->setDomainName($domainName); goto d196b; e7237: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto e597c; a2f2c: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto e1fc8; } goto Ae065; f4e51: $pythonSiteCreator->createNginxVhost(); goto c49d9; db5e4: ad2e6: goto ac78a; d1ebc: $pythonSiteCreator->createUser(); goto f9605; ddba7: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::PYTHON_VHOST_TEMPLATE_NAME); goto B391f; eb38c: $pythonSite->setSubdomain($subdomain); goto Cd265; dadae: $pythonSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto C36de; e597c: if (!(false === empty($redirectionVhostTemplate))) { goto C297c; } goto D5a80; f71c5: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto e7237; Aa941: c14be: goto c67cd; D9ea8: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto D9452; c97ac: $pythonSite->setPythonSettings($pythonSettingsEntity); goto dadae; e1fba: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto C806b; ac78a: $siteEntity->setVhostTemplate($vhostTemplate); goto C0722; Feedf: $siteEntity->setPythonSettings($pythonSettingsEntity); goto C12a8; c67cd: $certificateEntity = $this->certificateEntityManager->createEntity(); goto Edc4f; Abf70: $rsaKeyGenerator = new RsaKeyGenerator(); goto be0cb; Def1b: $pythonSite->setUserPassword($siteEntity->getUserPassword()); goto d9716; F3eb0: } private function createStaticSite(string $domainName, string $siteUser, string $siteUserPassword) : SiteEntity { goto F344e; e9b9d: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto E35d4; a0136: $staticSite->setRootDirectory($siteEntity->getRootDirectory()); goto ffd45; b703b: $certificateEntity->setDefaultCertificate(true); goto e21df; d40f9: $siteEntity->setRootDirectory($domainName); goto ed369; E76c3: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto f3626; E8190: $certificateEntity->setCsr($csr); goto a1be9; d3d1d: $staticSiteCreator->resetPermissions(); goto e82b0; D0fa3: throw new \Exception(implode("; ", $errorMessages)); goto Ce886; d30f5: $certificateEntity->setSite($siteEntity); goto b2b10; dccff: return $siteEntity; goto D8900; d3de8: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto e9b9d; c9967: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto b703b; A38bf: $staticSiteCreator->createUser(); goto A27a0; F5a72: $siteConstraints = $this->validator->validate($siteEntity); goto Fa207; F07c9: $staticSiteCreator->reloadNginxService(); goto d3d1d; F77c2: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto F87bf; cea43: $csr = $csrGenerator->generate(); goto c9967; E0910: $subjectAlternativeNames = []; goto Fc52c; f3626: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto cee37; Fc52c: if (!(true === is_null($subdomain))) { goto e8442; } goto C445d; ed369: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto fe5c4; } goto f1b19; Be814: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto B98b8; bf62b: $siteEntity->setVhostTemplate($vhostTemplate); goto F5a72; b20a7: $staticSiteCreator->createPrivateKeyAndCertificate(); goto cbfa0; Bcb9d: $constraintViolationList = new ConstraintViolationList(); goto e7c38; Be236: $staticSite = new StaticSite(); goto Ee67d; c51fd: $siteEntity = $this->siteEntityManager->createEntity(); goto ed462; B1f7a: $siteEntity->setUserPassword($siteUserPassword); goto d40f9; Fded0: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::STATIC_SITE_VHOST_TEMPLATE_NAME); goto Cad17; e82b0: $vhostTemplate = new StaticVhostTemplate($staticSite); goto D5c2b; e21df: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto E8190; efbab: E4a50: goto Be814; e7c38: $constraintViolationList->addAll($siteConstraints); goto Deb48; cbfa0: $staticSiteCreator->createNginxVhost(); goto F07c9; ffd45: $staticSite->setCertificate($certificateEntity); goto c72d3; cee37: $this->siteEntityManager->updateEntity($siteEntity); goto dccff; a1be9: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto F49f3; B98b8: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto cea43; Ce886: C804c: goto D4722; b2b10: $rsaKeyGenerator = new RsaKeyGenerator(); goto e71ea; d3532: $subjectAlternativeNames[] = $registrableDomain; goto efbab; b43e8: $vhostTemplate->build(); goto E76c3; F87bf: a1a91: goto Be8c5; f005c: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto Ee3bf; c67a9: $subdomain = false === empty($subdomain) ? $subdomain : null; goto Fded0; F9ca0: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto Bb5de; Ee3bf: $subdomain = $resolvedDomainName->subDomain()->toString(); goto c67a9; A27a0: $staticSiteCreator->createRootDirectory(); goto a3042; ed462: $siteEntity->setType(SiteEntity::TYPE_STATIC); goto Bd8ff; C445d: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto A272d; c972b: $staticSite->setUserPassword($siteEntity->getUserPassword()); goto A8d02; c5d10: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto E4a50; } goto d3532; F49f3: $certificateEntity->setCertificate($selfSignedCertificate); goto e4edc; f1b19: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto F9ca0; A8d02: $staticSite->setDomainName($domainName); goto fd19a; A272d: e8442: goto c5d10; D4722: $certificateEntity = $this->certificateEntityManager->createEntity(); goto d30f5; fd19a: $staticSite->setRegistrableDomain($registrableDomain); goto eb0aa; Cad17: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto c51fd; Be8c5: fe5c4: goto bf62b; F344e: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto f005c; De4ac: $staticSiteCreator->createIndexHtml(); goto b20a7; Ee67d: $staticSite->setUser($siteEntity->getUser()); goto c972b; eb0aa: $staticSite->setSubdomain($subdomain); goto a0136; a8676: $vhostTemplate->resetProcessors(); goto d3de8; E35d4: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto b43e8; faa2c: $staticSiteCreator = new StaticSiteCreator($staticSite); goto A38bf; D5c2b: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto a8676; Deb48: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto D0fa3; Bd796: $siteEntity->setUser($siteUser); goto B1f7a; e4edc: $siteEntity->setCertificate($certificateEntity); goto Be236; c72d3: $staticSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto faa2c; Bd8ff: $siteEntity->setDomainName($domainName); goto Bd796; e71ea: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto E0910; a3042: $staticSiteCreator->createLogrotateFile(); goto De4ac; Bb5de: if (!(false === empty($redirectionVhostTemplate))) { goto a1a91; } goto F77c2; Fa207: if (!count($siteConstraints)) { goto C804c; } goto Bcb9d; D8900: } private function createReverseProxySite(string $domainName, string $reverseProxyUrl, string $siteUser, string $siteUserPassword) : SiteEntity { goto e3b43; a24ef: $siteEntity->setDomainName($domainName); goto C2297; A13e1: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto aa8b3; b13c5: $vhostTemplate->build(); goto d0113; Ac196: $siteEntity->setReverseProxyUrl($reverseProxyUrl); goto a9d41; A9a49: $csr = $csrGenerator->generate(); goto Cd69f; d4ac5: if (!count($siteConstraints)) { goto B2cd4; } goto A2b15; e49ee: $certificateEntity->setSite($siteEntity); goto fdc9d; Ee386: F829d: goto c9437; bc59b: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::REVERSE_PROXY_VHOST_TEMPLATE_NAME); goto Ae8f5; b2bc2: if (!(true === is_null($subdomain))) { goto F829d; } goto C0e9b; Ef7b8: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto Dd7b5; B9b0e: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto c8c09; D3880: $reverseProxySite->setRootDirectory($siteEntity->getRootDirectory()); goto cf177; Dd7b5: $subdomain = $resolvedDomainName->subDomain()->toString(); goto E1f42; c2bfe: $subjectAlternativeNames[] = $registrableDomain; goto b34ea; Ebc3d: $siteConstraints = $this->validator->validate($siteEntity); goto d4ac5; a9d41: if (!(true === is_null($subdomain) || "www" == $subdomain)) { goto a3820; } goto f2540; F1c55: $reversProxySiteCreator->createPrivateKeyAndCertificate(); goto E2e95; E201e: $siteEntity = $this->siteEntityManager->createEntity(); goto ff002; C0e9b: $subjectAlternativeNames[] = sprintf("www.%s", $domainName); goto Ee386; fa719: throw new \Exception(implode("; ", $errorMessages)); goto e1d20; fb35e: $reversProxySiteCreator->resetPermissions(); goto B873e; B873e: $vhostTemplate = new ReverseProxyVhostTemplate($reverseProxySite); goto d6a39; fdc9d: $rsaKeyGenerator = new RsaKeyGenerator(); goto Faf20; Ae8f5: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto E201e; d6a39: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto f4581; f2540: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "/../../../resources/nginx/vhost_template/redirect"); goto Adf9d; D5b19: $subjectAlternativeNames = []; goto b2bc2; c8c09: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto b13c5; F70d1: $reversProxySiteCreator->reloadNginxService(); goto fb35e; Cd69f: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto f8a6c; c9437: if (!(false === is_null($subdomain) && "www" == $subdomain)) { goto d5f54; } goto c2bfe; ff002: $siteEntity->setType(SiteEntity::TYPE_REVERSE_PROXY); goto a24ef; C6f4e: $reverseProxySite = new ReverseProxySite(); goto a56ab; a56ab: $reverseProxySite->setUser($siteEntity->getUser()); goto A6070; cf177: $reverseProxySite->setCertificate($certificateEntity); goto B0494; b819f: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto fa719; Eeb90: return $siteEntity; goto fa222; dd3b3: $reversProxySiteCreator->createRootDirectory(); goto E1642; E2ee7: $this->siteEntityManager->updateEntity($siteEntity); goto Eeb90; C6e3c: $reverseProxySite->setRegistrableDomain($registrableDomain); goto c2136; A2b15: $constraintViolationList = new ConstraintViolationList(); goto Deaa2; da5b4: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto Ae0c1; f7110: $reverseProxySite->setDomainName($domainName); goto C6e3c; Adf9d: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto D0f72; e3b43: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto Ef7b8; Ee363: $certificateEntity = $this->certificateEntityManager->createEntity(); goto e49ee; f4581: $vhostTemplate->resetProcessors(); goto B0d83; E87f7: $reversProxySiteCreator = new ReverseProxySiteCreator($reverseProxySite); goto e9dc6; bbf6c: $siteEntity->setCertificate($certificateEntity); goto C6f4e; aa8b3: $certificateEntity->setCsr($csr); goto da5b4; ad306: dcfdf: goto c2275; c2275: a3820: goto b2ebc; d2dc9: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto d68fc; Ae0c1: $certificateEntity->setCertificate($selfSignedCertificate); goto bbf6c; E2e95: $reversProxySiteCreator->createNginxVhost(); goto F70d1; d0113: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto D79dc; Deaa2: $constraintViolationList->addAll($siteConstraints); goto b819f; A6070: $reverseProxySite->setUserPassword($siteEntity->getUserPassword()); goto f7110; e9dc6: $reversProxySiteCreator->createUser(); goto dd3b3; E1642: $reversProxySiteCreator->createLogrotateFile(); goto F1c55; b4ffd: $siteEntity->setRootDirectory($domainName); goto Ac196; f8a6c: $certificateEntity->setDefaultCertificate(true); goto A13e1; D0f72: if (!(false === empty($redirectionVhostTemplate))) { goto dcfdf; } goto bb4dc; c2136: $reverseProxySite->setSubdomain($subdomain); goto D3880; Bec0a: $reverseProxySite->setVhostTemplate($siteEntity->getVhostTemplate()); goto E87f7; e1d20: B2cd4: goto Ee363; d68fc: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto A9a49; E1f42: $subdomain = false === empty($subdomain) ? $subdomain : null; goto bc59b; Faf20: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto D5b19; B0d83: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto B9b0e; C2297: $siteEntity->setUser($siteUser); goto D8ac2; bb4dc: $vhostTemplate = sprintf("%s%s", $redirectionVhostTemplate, $vhostTemplate); goto ad306; D79dc: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto E2ee7; b2ebc: $siteEntity->setVhostTemplate($vhostTemplate); goto Ebc3d; b34ea: d5f54: goto d2dc9; D8ac2: $siteEntity->setUserPassword($siteUserPassword); goto b4ffd; B0494: $reverseProxySite->setReverseProxyUrl($reverseProxyUrl); goto Bec0a; fa222: } public function installedWordPressSite(Request $request) : Response { goto Ad856; ac564: $response = $this->render("Frontend/Site/New/wordpress-installed.html.twig", ["siteCredentials" => $siteCredentials]); goto bb0d2; bb0d2: return $response; goto f5984; ce463: goto c8741; goto Eaea9; c44a8: $siteCredentials = $this->renderSiteCredentials($siteCredentials); goto ac564; e9e1a: $siteCredentials = $session->get("siteCredentials"); goto Ca608; d253c: return $response; goto A5e79; Ca608: if (false === empty($siteCredentials)) { goto b7175; } goto D5e16; Ad856: $session = $request->getSession(); goto e9e1a; f5984: c8741: goto d253c; Eaea9: b7175: goto c44a8; D5e16: $response = $this->redirect($this->generateUrl("clp_sites")); goto ce463; A5e79: } private function renderSiteCredentials(array $siteCredentials) : string { goto bb5b8; e9f6e: E8f91: goto Eefca; Eefca: return $renderedCredentials; goto D76b1; bb5b8: $renderedCredentials = ''; goto e82f3; e82f3: foreach ($siteCredentials as $section => $sectionData) { goto B3b9a; D9514: A5ff3: goto Af824; C7e00: $renderedCredentials .= PHP_EOL; goto D9514; B3b9a: $renderedCredentials .= $section . PHP_EOL; goto A2873; A2873: $renderedCredentials .= "------------------------------------------------------" . PHP_EOL; goto B5f3d; ab879: bb0de: goto C7e00; B5f3d: foreach ($sectionData as $key => $value) { $renderedCredentials .= sprintf("%s: %s", $key, $value) . PHP_EOL; Ff3a4: } goto ab879; Af824: } goto e9f6e; D76b1: } private function getVhostTemplateEntity(string $name) : mixed { goto fc552; ffc3f: throw new \Exception($this->translator->trans("Vhost Template %vhostTemplate% does not exist.", ["%vhostTemplate%" => $name])); goto de395; A9fd0: if (!(true === is_null($vhostTemplateEntity))) { goto E2212; } goto ffc3f; fc552: $vhostTemplateEntity = $this->vhostTemplateEntityManager->findOneByName($name); goto A9fd0; de395: E2212: goto b5a2a; b5a2a: return $vhostTemplateEntity; goto Bb7b1; Bb7b1: } private function getConstraintViolationListErrorMessages(ConstraintViolationList $constraintViolationList) : array { goto c0d46; Cc6a3: foreach ($constraintViolationList as $constraint) { $errorMessages[] = sprintf("%s: %s", $constraint->getPropertyPath(), $constraint->getMessage()); D8555: } goto b3c8f; c0d46: $errorMessages = []; goto Cc6a3; b3c8f: ea311: goto cc457; cc457: return $errorMessages; goto Cb450; Cb450: } private function generateNameFromDomainName(string $domainName) : string { goto f87bd; ee4ba: af699: goto c78c9; fb8bc: if (!(false === empty($subdomain))) { goto Fc10d; } goto d5e4a; d5e4a: $explodedSubdomain = explode(".", $subdomain); goto F16f5; F9a24: if ("www" == $subdomain) { goto df766; } goto Faf40; Faf40: $name = $explodedRegistrableDomain[0] ?? ''; goto fb8bc; c78c9: return $name; goto C901f; D3077: $name = $explodedRegistrableDomain[0] ?? ''; goto ee4ba; d919b: Fc10d: goto dc476; f87bd: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto B0f27; Ad315: $explodedRegistrableDomain = explode(".", $registrableDomain); goto F9a24; B0f27: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto E9664; c9bfe: df766: goto D3077; dc476: goto af699; goto c9bfe; E9664: $subdomain = $resolvedDomainName->subDomain()->toString(); goto Ad315; F16f5: $name = sprintf("%s-%s", $explodedRegistrableDomain[0] ?? '', implode("-", $explodedSubdomain)); goto d919b; C901f: } private function getUniqueDatabaseName(string $databaseName) : string { goto E8ca6; F2a70: $databaseConnection = new DatabaseConnection($activeDatabaseServerEntity); goto D9741; D9741: $databases = $databaseConnection->getDatabases(); goto f70bb; B9a99: $i = 0; goto D405a; A12f2: return $uniqueDatabaseName; goto B9966; Ec7da: if (!(strlen($uniqueDatabaseName) <= 3)) { goto Babab; } goto C6c02; D405a: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto F2a70; E8ca6: $uniqueDatabaseName = $databaseName; goto Ec7da; C6c02: $uniqueDatabaseName = sprintf("%s-db", $uniqueDatabaseName); goto Eeda0; f70bb: E8e59: goto b118a; A1fbb: c96de: goto d1537; f3759: f1676: goto A12f2; b118a: if (!(0 < $i)) { goto c96de; } goto efaf0; d1537: $databaseExists = in_array($uniqueDatabaseName, $databases); goto E5f7a; efaf0: $uniqueDatabaseName = sprintf("%s-%s", $databaseName, $i); goto A1fbb; eb37d: if (true === $databaseExists) { goto E8e59; } goto f3759; E5f7a: $i++; goto eb37d; Eeda0: Babab: goto B9a99; B9966: } private function getUniqueDatabaseUserName(string $databaseUserName) : string { goto ba510; Cee3a: return $uniqueDatabaseUserName; goto d6e84; E9474: c54b9: goto Da51f; b88f1: cc158: goto c5299; Fd9a7: if (false === is_null($databaseUserEntity)) { goto c54b9; } goto de096; f806a: if (!(strlen($uniqueDatabaseUserName) <= 3)) { goto cc158; } goto Bbf62; fd9de: C31c1: goto f8e5f; f8e5f: $databaseUserEntity = $this->databaseUserEntityManager->findOneByUserName($uniqueDatabaseUserName); goto B5e8a; Bbf62: $uniqueDatabaseUserName = sprintf("%s-db", $uniqueDatabaseUserName); goto b88f1; Da51f: if (!(0 < $i)) { goto C31c1; } goto Bbf09; Bbf09: $uniqueDatabaseUserName = sprintf("%s-%s", $databaseUserName, $i); goto fd9de; de096: c6fb3: goto Cee3a; c5299: $i = 0; goto E9474; ba510: $uniqueDatabaseUserName = $databaseUserName; goto f806a; B5e8a: $i++; goto Fd9a7; d6e84: } private function hasPermissions() : bool { goto F6634; f0249: if (!(UserEntity::ROLE_USER != $user->getRole())) { goto F6477; } goto Cb6e7; eaa44: F6477: goto ca00b; ca00b: return false; goto E1d97; F6634: $user = $this->getUser(); goto f0249; Cb6e7: return true; goto eaa44; E1d97: } } 
 ?>

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 = "\x57\157\162\144\x50\162\145\163\163"; private const NODEJS_VHOST_TEMPLATE_NAME = "\x4e\157\x64\x65\152\x73"; private const STATIC_SITE_VHOST_TEMPLATE_NAME = "\123\x74\141\164\151\143"; private const PYTHON_VHOST_TEMPLATE_NAME = "\x50\171\164\150\157\156"; private const REVERSE_PROXY_VHOST_TEMPLATE_NAME = "\x52\145\166\x65\162\x73\145\x50\162\157\x78\171"; private const VARNISH_CACHE_SERVER = "\61\62\67\56\x30\56\x30\x2e\61\x3a\x36\60\x38\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\123\137\x4d\x45\124\110\117\104" => ["\166\x61\154\165\x65" => "\144\151\x72\145\x63\164", "\x72\141\x77" => false], "\127\120\137\x44\x45\x42\x55\x47\x5f\x44\x49\123\120\114\101\131" => ["\166\141\154\165\145" => "\146\141\x6c\163\145", "\162\141\167" => true], "\x57\x50\137\x44\x45\102\x55\x47\x5f\x4c\117\107" => ["\x76\x61\x6c\165\145" => "\164\x72\165\x65", "\162\141\167" => true], "\x43\x4f\x4e\x43\x41\124\x45\116\x41\124\105\137\x53\103\x52\x49\x50\124\x53" => ["\x76\141\154\165\145" => "\146\x61\x6c\x73\145", "\162\x61\x77" => true], "\x41\125\124\117\123\x41\x56\x45\137\x49\x4e\x54\x45\122\126\101\x4c" => ["\166\141\154\165\145" => 600, "\162\x61\x77" => true], "\127\120\x5f\120\x4f\x53\x54\137\x52\105\126\x49\x53\111\x4f\116\123" => ["\x76\x61\x6c\165\x65" => 5, "\x72\x61\167" => true], "\105\x4d\120\x54\x59\137\124\122\x41\x53\x48\x5f\x44\101\x59\123" => ["\166\141\x6c\x75\x65" => 21, "\x72\x61\x77" => true]]; private array $wordPressMultiSiteConfigValues = ["\127\120\x5f\x41\114\x4c\117\127\137\115\x55\114\124\111\123\x49\x54\105" => ["\166\141\154\165\145" => "\164\x72\165\145", "\162\141\x77" => true], "\x4d\x55\114\x54\x49\123\x49\x54\x45" => ["\166\141\x6c\x75\145" => "\164\162\x75\145", "\x72\x61\167" => true], "\x53\125\x42\104\117\115\101\111\x4e\137\111\x4e\x53\x54\101\x4c\x4c" => ["\x76\141\154\x75\x65" => "\146\141\154\163\145", "\162\141\x77" => true], "\104\x4f\115\x41\111\116\x5f\x43\x55\x52\x52\x45\116\x54\x5f\x53\x49\124\x45" => ["\166\141\154\165\x65" => '', "\x72\x61\x77" => false], "\120\x41\x54\x48\x5f\x43\x55\x52\122\x45\x4e\x54\x5f\123\111\124\105" => ["\166\141\154\x75\x65" => "\57", "\x72\141\167" => false], "\123\111\124\105\137\111\x44\x5f\103\x55\x52\122\x45\x4e\124\137\123\111\x54\105" => ["\166\x61\x6c\x75\x65" => 1, "\162\x61\x77" => true], "\102\114\x4f\x47\x5f\x49\x44\137\x43\125\x52\x52\105\116\124\137\123\x49\124\x45" => ["\166\141\154\165\x65" => 1, "\x72\x61\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 D9f54; c744d: $this->domainNameParser = $domainNameParser; goto Dd353; b2877: parent::__construct($translator, $logger); goto a9f6f; dff5c: $this->databaseEntityManager = $databaseEntityManager; goto e0144; d61b7: $this->vhostTemplateEntityManager = $vhostTemplateEntityManager; goto c744d; e0144: $this->databaseUserEntityManager = $databaseUserEntityManager; goto ab43c; E8104: $this->siteEntityManager = $siteEntityManager; goto A3724; ab43c: $this->databaseServerEntityManager = $databaseServerEntityManager; goto d61b7; D9f54: $this->configManager = $configManager; goto E8104; Dd353: $this->validator = $validator; goto b2877; A3724: $this->certificateEntityManager = $certificateEntityManager; goto dff5c; a9f6f: } public function index(Request $request) : Response { goto De3c9; c0bac: if (true === $hasPermissions) { goto e7a92; } goto a5535; d027c: f4ae3: goto a6623; a6623: return $response; goto a2238; a02b0: goto f4ae3; goto F9e00; De3c9: $hasPermissions = $this->hasPermissions(); goto c0bac; F9e00: e7a92: goto Da74f; cd4a0: $response = $this->render("\x46\162\157\x6e\164\145\156\144\x2f\x53\x69\x74\145\x2f\x4e\x65\167\57\151\156\x64\145\x78\x2e\x68\x74\155\154\x2e\x74\x77\x69\147", ["\x75\x73\x65\x72" => $user]); goto d027c; a5535: $response = $this->redirect($this->generateUrl("\x63\x6c\x70\x5f\x73\151\x74\x65\163")); goto a02b0; Da74f: $user = $this->getUser(); goto cd4a0; a2238: } public function newPythonSite(Request $request) : Response { goto C68c8; C68c8: $hasPermissions = $this->hasPermissions(); goto af6f4; a78a2: a2ce9: goto a8b33; b3b0e: return $response; goto A184b; a8b33: return $response; goto C684c; eb34b: $response = $this->handleCreatePythonSiteForm($request, $form); goto e6a41; F8644: $response = $this->render("\106\162\157\156\164\145\x6e\x64\57\123\x69\164\145\x2f\x4e\145\x77\57\x70\x79\164\x68\x6f\x6e\x2e\x68\164\x6d\x6c\x2e\164\x77\x69\147", ["\165\x73\145\162" => $user, "\146\157\x72\155" => $form->createView(), "\x66\x6f\x72\155\105\x72\x72\157\162\x73" => $this->formErrors]); goto a78a2; d11b8: goto a2ce9; goto Bc864; db79f: $response = $this->redirect($this->generateUrl("\143\154\160\137\x73\151\164\x65\x73")); goto d11b8; Ef7d8: if (!(true === $form->isSubmitted())) { goto F532e; } goto eb34b; e6a41: if (!(false === is_null($response))) { goto C4734; } goto b3b0e; f808f: fbed7: goto F8644; A7ce6: $user = $this->getUser(); goto aed51; aed51: $pythonSettings = new PythonSettingsEntity(); goto bbab7; Bc864: F88f8: goto A7ce6; aa33d: if (!(true === $request->isMethod("\120\117\123\x54"))) { goto fbed7; } goto e0e50; cc387: F532e: goto f808f; bbab7: $form = $this->createPythonSiteForm($pythonSettings); goto aa33d; e0e50: $form->handleRequest($request); goto Ef7d8; A184b: C4734: goto cc387; af6f4: if (true === $hasPermissions) { goto F88f8; } goto db79f; C684c: } private function createPythonSiteForm(PythonSettingsEntity $pythonSettings) : Form { goto b34d4; E81d5: $form->add("\x73\165\x62\155\151\x74", SubmitType::class, ["\x61\164\164\x72" => ["\x63\x6c\x61\x73\x73" => "\x62\164\x6e\x20\142\x74\x6e\55\154\147\x20\x62\x74\156\x2d\x62\x6c\x75\145"], "\154\141\x62\145\154" => "\103\162\145\x61\x74\145"]); goto c4ca1; c4ca1: return $form; goto Ad954; b34d4: $form = $this->createForm("\101\160\160\134\106\157\x72\155\134\x53\151\x74\145\x4e\x65\x77\120\x79\x74\150\157\x6e\x54\171\x70\x65", $pythonSettings, ["\141\x63\x74\151\157\156" => $this->generateUrl("\143\154\160\137\163\151\x74\145\137\160\x79\x74\150\157\156\x5f\x6e\145\x77"), "\155\145\x74\x68\157\144" => "\x50\117\123\x54", "\141\164\x74\162" => ["\151\144" => "\156\x65\x77\55\160\x79\x74\150\x6f\156\x2d\x73\151\x74\x65\55\x66\157\x72\x6d"]]); goto E81d5; Ad954: } private function handleCreatePythonSiteForm(Request $request, Form $form) { goto C0712; bc5df: aa06c: goto B838d; C0712: if (true === $form->isValid()) { goto Ea0fd; } goto E27bf; d7b2b: Ea0fd: goto C2781; E27bf: $this->formErrors = $this->getErrorMessages($form); goto Ce57e; C2781: try { goto d7611; d7611: $session = $request->getSession(); goto C0583; E1ed4: $this->createPythonSite($domainName, $pythonVersion, $port, $siteUser, $siteUserPassword); goto e680b; a7146: $pythonVersion = $form->get("\160\171\164\150\157\x6e\126\145\162\x73\151\x6f\x6e")->getData(); goto ae16d; Bbbfe: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto D19bb; ec854: $siteUser = $form->get("\163\x69\164\x65\x55\163\145\x72")->getData(); goto Ecbae; Ecbae: $siteUserPassword = $form->get("\163\151\x74\x65\125\163\145\162\x50\x61\x73\163\x77\157\x72\x64")->getData(); goto B40b6; e680b: $eventData = ["\163\x69\x74\145" => $domainName, "\163\x69\x74\145\x55\x73\145\162" => $siteUser, "\x70\x79\x74\150\157\x6e\126\x65\162\x73\151\x6f\x6e" => $pythonVersion, "\160\157\162\x74" => $port]; goto f0bad; ca583: $user = $this->getUser(); goto E1ed4; e16e0: c784f: goto ca583; C0583: $domainName = $form->get("\144\157\x6d\141\x69\x6e\x4e\141\155\x65")->getData(); goto a7146; d5b22: throw new \Exception(sprintf("\x56\x68\x6f\x73\164\40\x74\145\155\160\x6c\141\164\145\40\x22\x25\163\42\40\156\x6f\x74\x20\x66\x6f\165\156\144\x2e", $vhostTemplateName)); goto e0b17; f0bad: EventQueue::addEvent(EventQueue::EVENT_SITE_PYTHON_CREATE, $user, $eventData, $request); goto C517a; C83c2: return $response; goto A5122; C517a: $session->getFlashBag()->set("\163\x75\143\x63\145\x73\x73", $this->translator->trans("\123\x69\x74\x65\x20\x68\x61\x73\x20\x62\x65\145\x6e\x20\x63\x72\145\x61\x74\145\144\x2e")); goto b6722; B40b6: $vhostTemplateName = self::PYTHON_VHOST_TEMPLATE_NAME; goto Bbbfe; A5122: Dbc47: goto D7169; D19bb: if (false === is_null($vhostTemplateEntity)) { goto c784f; } goto d5b22; b6722: $response = $this->redirect($this->generateUrl("\x63\154\160\137\163\151\164\145\163")); goto C83c2; e0b17: goto Dbc47; goto e16e0; ae16d: $port = $form->get("\x70\x6f\162\x74")->getData(); goto ec854; D7169: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\x64\141\156\x67\x65\162", $this->translator->trans("\101\x6e\40\x65\x72\162\157\x72\x20\x68\141\163\x20\x6f\143\x63\165\162\x72\145\144\54\x20\x65\x72\162\157\x72\40\x6d\145\x73\163\141\147\145\x3a\40\x25\x65\x72\162\x6f\162\x4d\x65\163\163\141\147\145\x25", ["\45\x65\x72\162\x6f\x72\x4d\145\x73\x73\x61\147\x65\x25" => $e->getMessage()])); } goto bc5df; Ce57e: goto aa06c; goto d7b2b; B838d: } public function newReverseProxy(Request $request) : Response { goto d2006; c7ca5: C6fc0: goto c003d; f44e4: if (!(true === $request->isMethod("\120\x4f\123\124"))) { goto A1d17; } goto e8e76; a8b4f: if (true === $hasPermissions) { goto D13e9; } goto Bbf26; A257c: $response = $this->handleReverseProxyForm($request, $form); goto Da050; Caa65: return $response; goto D1db6; d2006: $hasPermissions = $this->hasPermissions(); goto a8b4f; Bbf26: $response = $this->redirect($this->generateUrl("\143\x6c\160\x5f\163\151\x74\145\163")); goto bfa7a; c3adf: return $response; goto c7ca5; A74a4: aa485: goto Caa65; D5555: A1d17: goto Be558; bfa7a: goto aa485; goto C4f6f; E1cf3: $user = $this->getUser(); goto Eb44f; Eb44f: $form = $this->createReverseProxyForm(); goto f44e4; afed2: if (!(true === $form->isSubmitted())) { goto fb7fb; } goto A257c; Da050: if (!(false === is_null($response))) { goto C6fc0; } goto c3adf; c003d: fb7fb: goto D5555; Be558: $response = $this->render("\x46\162\x6f\x6e\x74\145\156\x64\x2f\x53\x69\x74\145\x2f\x4e\x65\167\57\x72\145\166\x65\162\x73\x65\x2d\160\x72\x6f\170\171\x2e\150\x74\x6d\x6c\x2e\x74\x77\151\x67", ["\165\x73\x65\x72" => $user, "\146\157\x72\155" => $form->createView(), "\x66\x6f\162\x6d\105\162\x72\157\x72\x73" => $this->formErrors]); goto A74a4; e8e76: $form->handleRequest($request); goto afed2; C4f6f: D13e9: goto E1cf3; D1db6: } private function createReverseProxyForm() : Form { goto Dc325; cac78: $form->add("\x73\x75\142\155\151\164", SubmitType::class, ["\141\x74\x74\162" => ["\x63\154\x61\163\x73" => "\142\164\156\x20\x62\x74\x6e\55\154\147\x20\x62\x74\x6e\55\142\154\x75\145"], "\154\141\x62\x65\x6c" => "\x43\162\x65\141\164\145"]); goto e38eb; Dc325: $form = $this->createForm("\x41\160\160\134\106\157\162\x6d\134\123\x69\x74\145\x4e\x65\x77\x52\x65\166\145\162\163\x65\120\x72\157\x78\171\124\x79\x70\145", [], ["\x61\143\164\x69\157\x6e" => $this->generateUrl("\x63\154\160\137\x73\151\164\x65\137\162\x65\x76\145\x72\x73\145\x5f\160\x72\157\x78\x79\x5f\x6e\x65\x77"), "\x6d\145\x74\x68\157\144" => "\120\x4f\123\124", "\x61\x74\164\162" => ["\151\x64" => "\x6e\145\167\55\162\x65\166\145\x72\163\x65\x2d\160\x72\x6f\170\171\55\146\x6f\162\155"]]); goto cac78; e38eb: return $form; goto d3ac0; d3ac0: } private function handleReverseProxyForm(Request $request, Form $form) { goto A6a07; b6249: goto Da7c9; goto F857a; B7adc: $this->formErrors = $this->getErrorMessages($form); goto b6249; A6a07: if (true === $form->isValid()) { goto Ae1d9; } goto B7adc; E5892: Da7c9: goto D40ba; F857a: Ae1d9: goto Bce8e; Bce8e: try { goto Be1ae; Da165: E29b2: goto Eea7b; Defe6: $siteUserPassword = $form->get("\163\151\164\x65\x55\x73\x65\x72\120\x61\163\163\167\x6f\x72\144")->getData(); goto D32bc; aa354: $eventData = ["\163\151\x74\x65" => $domainName, "\x73\x69\x74\x65\x55\163\145\162" => $siteUser, "\x72\x65\166\x65\162\163\x65\x50\x72\x6f\170\171\x55\162\154" => $reverseProxyUrl]; goto E86c3; A96dd: $response = $this->redirect($this->generateUrl("\143\154\x70\x5f\163\x69\x74\x65\163")); goto B75f7; B8c31: $vhostTemplateName = self::REVERSE_PROXY_VHOST_TEMPLATE_NAME; goto be3ba; be3ba: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto cd743; d3884: throw new \Exception(sprintf("\126\150\x6f\163\x74\40\164\145\x6d\x70\x6c\x61\x74\145\x20\x22\x25\163\42\x20\156\157\164\40\x66\x6f\165\156\144\x2e", $vhostTemplateName)); goto e515d; D5e8b: $siteUser = $form->get("\163\151\x74\x65\x55\163\145\x72")->getData(); goto Defe6; e6507: B58e4: goto A35e9; bc0d3: $domainName = $form->get("\144\x6f\x6d\141\151\x6e\116\x61\155\145")->getData(); goto D5e8b; A35e9: $user = $this->getUser(); goto D9776; e515d: goto E29b2; goto e6507; B75f7: return $response; goto Da165; D32bc: $reverseProxyUrl = $form->get("\x72\x65\x76\145\162\x73\x65\x50\162\x6f\170\171\x55\162\x6c")->getData(); goto B8c31; cd743: if (false === is_null($vhostTemplateEntity)) { goto B58e4; } goto d3884; e73bd: $session->getFlashBag()->set("\x73\x75\x63\143\x65\163\163", $this->translator->trans("\x52\145\166\145\162\x73\x65\40\120\162\157\170\x79\x20\x68\x61\x73\40\142\x65\x65\156\x20\x63\x72\145\141\164\x65\x64\x2e")); goto A96dd; E86c3: EventQueue::addEvent(EventQueue::EVENT_SITE_REVERSE_PROXY_CREATE, $user, $eventData, $request); goto e73bd; Be1ae: $session = $request->getSession(); goto bc0d3; D9776: $this->createReverseProxySite($domainName, $reverseProxyUrl, $siteUser, $siteUserPassword); goto aa354; Eea7b: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\x64\x61\156\147\x65\162", $this->translator->trans("\101\156\40\x65\x72\162\157\x72\40\x68\141\163\x20\x6f\x63\143\x75\x72\162\145\144\x2c\40\x65\x72\162\157\162\x20\x6d\145\163\x73\141\147\145\x3a\x20\x25\x65\162\x72\157\x72\115\x65\x73\163\x61\x67\x65\x25", ["\x25\x65\162\x72\157\162\x4d\145\x73\163\141\x67\x65\x25" => $e->getMessage()])); } goto E5892; D40ba: } public function newNodejsSite(Request $request) : Response { goto F2828; C9557: D5613: goto Bbfcf; Abcab: F3cb0: goto C9557; be195: $user = $this->getUser(); goto d41d4; A172a: $form = $this->createNodejsSiteForm($nodejsSettings); goto B74dd; e7fe5: return $response; goto Bdf02; c5dcd: C1ab4: goto E538d; d3221: if (true === $hasPermissions) { goto cc080; } goto c50a8; F5486: $form->handleRequest($request); goto f39ac; ea199: $response = $this->handleCreateNodejsSiteForm($request, $form); goto E390f; F2828: $hasPermissions = $this->hasPermissions(); goto d3221; e4bfb: cc080: goto be195; f39ac: if (!(true === $form->isSubmitted())) { goto F3cb0; } goto ea199; E390f: if (!(false === is_null($response))) { goto F7981; } goto e7fe5; B74dd: if (!(true === $request->isMethod("\x50\x4f\123\124"))) { goto D5613; } goto F5486; Ab1dc: goto C1ab4; goto e4bfb; d41d4: $nodejsSettings = new NodejsSettingsEntity(); goto A172a; E538d: return $response; goto f34a0; Bdf02: F7981: goto Abcab; c50a8: $response = $this->redirect($this->generateUrl("\143\x6c\x70\x5f\x73\x69\164\145\163")); goto Ab1dc; Bbfcf: $response = $this->render("\106\x72\x6f\x6e\x74\145\156\x64\57\123\x69\164\145\x2f\116\145\x77\x2f\156\157\x64\x65\152\163\56\x68\x74\155\x6c\56\x74\x77\151\x67", ["\165\x73\x65\162" => $user, "\x66\x6f\162\155" => $form->createView(), "\146\157\162\155\x45\162\162\x6f\162\163" => $this->formErrors]); goto c5dcd; f34a0: } private function createNodejsSiteForm(NodejsSettingsEntity $nodejsSettings) : Form { goto b8ba4; b8ba4: $form = $this->createForm("\101\160\x70\x5c\106\x6f\x72\x6d\x5c\x53\x69\x74\145\x4e\x65\x77\116\157\x64\145\152\x73\124\x79\160\145", $nodejsSettings, ["\x61\143\164\151\157\156" => $this->generateUrl("\x63\x6c\160\x5f\x73\x69\x74\145\x5f\156\157\x64\x65\x6a\x73\137\x6e\145\x77"), "\155\145\164\x68\x6f\144" => "\x50\x4f\x53\124", "\x61\164\x74\162" => ["\x69\144" => "\x6e\x65\167\x2d\x6e\157\x64\145\x6a\163\x2d\x73\x69\164\145\55\146\x6f\x72\x6d"]]); goto F1424; D42b3: return $form; goto Ebf2d; F1424: $form->add("\163\165\142\155\151\164", SubmitType::class, ["\x61\x74\x74\162" => ["\143\154\x61\x73\163" => "\x62\164\x6e\40\142\x74\x6e\x2d\154\147\x20\142\x74\156\x2d\x62\154\165\x65"], "\154\141\142\x65\154" => "\103\x72\145\x61\164\145"]); goto D42b3; Ebf2d: } private function handleCreateNodejsSiteForm(Request $request, Form $form) { goto ee655; ee655: if (true === $form->isValid()) { goto ab4e1; } goto decd7; Ab6d1: try { goto e681b; e681b: $session = $request->getSession(); goto F720e; d1bfb: $port = $form->get("\x70\157\x72\x74")->getData(); goto a3665; Dc6bf: goto c54ce; goto D4282; b8030: EventQueue::addEvent(EventQueue::EVENT_SITE_NODEJS_CREATE, $user, $eventData, $request); goto c30e3; F720e: $domainName = $form->get("\144\x6f\x6d\x61\x69\x6e\116\x61\155\x65")->getData(); goto Ccd34; eac5b: throw new \Exception(sprintf("\126\x68\x6f\x73\164\x20\164\145\x6d\160\x6c\x61\x74\x65\x20\x22\x25\163\x22\x20\156\157\x74\x20\146\x6f\x75\156\144\x2e", $vhostTemplateName)); goto Dc6bf; B66a5: return $response; goto Fd096; e34df: if (false === is_null($vhostTemplateEntity)) { goto c5af0; } goto eac5b; Fd096: c54ce: goto B1225; E48fc: $vhostTemplateName = self::NODEJS_VHOST_TEMPLATE_NAME; goto C9b1d; Ccd34: $nodejsVersion = $form->get("\x6e\157\144\145\152\x73\126\x65\162\163\151\157\156")->getData(); goto d1bfb; Ed837: $siteUserPassword = $form->get("\163\151\164\145\125\163\x65\x72\120\141\x73\x73\167\x6f\x72\x64")->getData(); goto E48fc; D4282: c5af0: goto d6cf4; a3665: $siteUser = $form->get("\163\x69\164\145\x55\x73\x65\162")->getData(); goto Ed837; ef4a7: $response = $this->redirect($this->generateUrl("\x63\x6c\160\x5f\x73\151\x74\145\163")); goto B66a5; d6cf4: $user = $this->getUser(); goto C0172; c30e3: $session->getFlashBag()->set("\x73\165\x63\143\x65\x73\163", $this->translator->trans("\x53\x69\164\x65\40\150\x61\163\x20\142\x65\x65\156\40\143\162\145\141\x74\145\144\x2e")); goto ef4a7; C0172: $this->createNodejsSite($domainName, $nodejsVersion, $port, $siteUser, $siteUserPassword); goto Ddf8a; C9b1d: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto e34df; Ddf8a: $eventData = ["\163\x69\x74\145" => $domainName, "\163\x69\164\x65\125\163\145\x72" => $siteUser, "\x6e\157\x64\145\152\163\126\145\x72\163\151\157\156" => $nodejsVersion, "\x70\x6f\162\x74" => $port]; goto b8030; B1225: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\144\141\156\x67\145\162", $this->translator->trans("\101\x6e\x20\x65\x72\162\x6f\x72\40\150\x61\x73\x20\157\143\x63\165\162\x72\x65\144\54\x20\x65\162\162\157\x72\x20\155\x65\x73\x73\x61\x67\x65\x3a\x20\x25\145\162\x72\157\162\115\x65\x73\x73\x61\x67\x65\45", ["\45\145\x72\x72\x6f\x72\x4d\x65\163\x73\141\x67\145\45" => $e->getMessage()])); } goto Dc3a8; decd7: $this->formErrors = $this->getErrorMessages($form); goto D60f0; f42eb: ab4e1: goto Ab6d1; D60f0: goto a5e26; goto f42eb; Dc3a8: a5e26: goto d00d0; d00d0: } public function newStaticSite(Request $request) : Response { goto B0134; Bb87a: return $response; goto a31aa; b7542: $response = $this->render("\106\x72\157\x6e\164\145\156\x64\57\x53\151\164\x65\x2f\116\x65\x77\x2f\163\164\x61\x74\x69\x63\56\150\x74\155\154\x2e\x74\x77\x69\x67", ["\165\163\145\162" => $user, "\146\157\162\155" => $form->createView(), "\x66\x6f\162\x6d\105\x72\x72\157\x72\x73" => $this->formErrors]); goto fe4f0; Eb39b: return $response; goto aee0d; Dd0d1: $response = $this->redirect($this->generateUrl("\143\x6c\160\x5f\163\151\x74\x65\163")); goto Fafc4; a0f1e: if (true === $hasPermissions) { goto F4d9d; } goto Dd0d1; B0134: $hasPermissions = $this->hasPermissions(); goto a0f1e; Fd5d0: $user = $this->getUser(); goto d2261; fcd0d: if (!(false === is_null($response))) { goto bc507; } goto Eb39b; aee0d: bc507: goto b5663; D97d9: if (!(true === $request->isMethod("\x50\117\x53\124"))) { goto C7f47; } goto b5fca; Fd2e2: if (!(true === $form->isSubmitted())) { goto c3894; } goto b6a7f; B4f17: C7f47: goto b7542; fe4f0: Ce97a: goto Bb87a; b5fca: $form->handleRequest($request); goto Fd2e2; b5663: c3894: goto B4f17; b6a7f: $response = $this->handleCreateStaticSiteForm($request, $form); goto fcd0d; d2261: $form = $this->createStaticSiteForm(); goto D97d9; d71e1: F4d9d: goto Fd5d0; Fafc4: goto Ce97a; goto d71e1; a31aa: } private function createStaticSiteForm() : Form { goto A9893; b388f: return $form; goto a4554; A9893: $form = $this->createForm("\x41\160\x70\134\x46\x6f\162\x6d\x5c\123\x69\x74\145\116\x65\167\123\164\141\164\x69\143\x54\x79\160\145", [], ["\141\143\x74\x69\x6f\156" => $this->generateUrl("\x63\154\160\137\x73\151\164\145\x5f\x73\x74\141\x74\151\143\137\156\145\167"), "\155\145\164\x68\157\x64" => "\120\x4f\x53\124", "\141\x74\164\162" => []]); goto A7564; A7564: $form->add("\x73\x75\142\x6d\151\x74", SubmitType::class, ["\141\x74\164\x72" => ["\x63\x6c\141\163\x73" => "\x62\164\156\40\x62\164\x6e\x2d\x6c\x67\40\x62\164\x6e\x2d\142\154\x75\145"], "\x6c\141\142\145\x6c" => "\x43\162\x65\x61\164\x65"]); goto b388f; a4554: } private function handleCreateStaticSiteForm(Request $request, Form $form) { goto F965d; D9abc: try { goto d2bf4; D33c4: $siteUser = $form->get("\163\151\164\145\125\x73\x65\x72")->getData(); goto aee0b; Fe51a: $vhostTemplateName = self::STATIC_SITE_VHOST_TEMPLATE_NAME; goto a14fb; e8646: $response = $this->redirect($this->generateUrl("\143\x6c\160\x5f\163\151\164\x65\163")); goto Dcc34; Feae9: $this->createStaticSite($domainName, $siteUser, $siteUserPassword); goto cee6b; d2bf4: $session = $request->getSession(); goto Cad2e; aee0b: $siteUserPassword = $form->get("\x73\x69\x74\x65\125\163\145\x72\120\141\163\x73\x77\157\162\144")->getData(); goto Fe51a; Dcc34: return $response; goto c541a; A7477: $user = $this->getUser(); goto Feae9; Cad2e: $domainName = $form->get("\144\x6f\x6d\141\x69\156\116\x61\x6d\x65")->getData(); goto D33c4; c541a: eb6f7: goto D36a5; cac16: $session->getFlashBag()->set("\x73\165\x63\143\145\x73\x73", $this->translator->trans("\123\151\x74\145\x20\x68\141\163\40\x62\145\x65\x6e\40\143\162\145\141\x74\145\x64\x2e")); goto e8646; cee6b: $eventData = ["\x73\x69\x74\145" => $domainName, "\163\151\x74\145\125\x73\x65\162" => $siteUser]; goto B4736; B4736: EventQueue::addEvent(EventQueue::EVENT_SITE_STATIC_CREATE, $user, $eventData, $request); goto cac16; F5e14: if (false === is_null($vhostTemplateEntity)) { goto B45e8; } goto E1b34; ba325: goto eb6f7; goto bbcab; bbcab: B45e8: goto A7477; E1b34: throw new \Exception(sprintf("\126\x68\x6f\163\x74\40\164\x65\x6d\x70\x6c\141\164\145\x20\42\x25\163\x22\x20\156\157\x74\x20\146\157\165\156\144\x2e", $vhostTemplateName)); goto ba325; a14fb: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto F5e14; D36a5: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\144\x61\156\x67\145\x72", $this->translator->trans("\x41\x6e\x20\x65\162\x72\x6f\162\40\150\x61\163\x20\x6f\143\143\x75\x72\x72\145\x64\x2c\x20\145\x72\x72\157\x72\40\155\145\x73\163\x61\147\x65\72\40\45\x65\x72\162\x6f\162\115\145\x73\163\141\x67\145\x25", ["\45\145\162\x72\x6f\162\x4d\145\163\163\141\x67\145\x25" => $e->getMessage()])); } goto fcfc9; A7835: $this->formErrors = $this->getErrorMessages($form); goto f4f53; fcfc9: a9d8c: goto E74d5; F965d: if (true === $form->isValid()) { goto D03a2; } goto A7835; a7397: D03a2: goto D9abc; f4f53: goto a9d8c; goto a7397; E74d5: } public function newPhpSite(Request $request) : Response { goto ed944; Dde7b: $response = $this->render("\x46\x72\x6f\x6e\x74\145\156\x64\57\123\151\164\145\x2f\x4e\145\x77\x2f\160\150\x70\x2e\x68\x74\x6d\154\x2e\164\x77\151\x67", ["\165\163\x65\x72" => $user, "\x66\157\162\155" => $form->createView(), "\x66\x6f\162\155\x45\162\162\157\x72\x73" => $this->formErrors]); goto De8f8; D2494: $user = $this->getUser(); goto a3750; C86cc: if (true === $hasPermissions) { goto D3ad7; } goto adb91; E79d9: c9aba: goto f02e1; d0ff6: $form->handleRequest($request); goto de951; Bfd92: $response = $this->handleCreatePhpSiteForm($request, $form); goto D95ee; c119c: return $response; goto D52ab; De8f8: B474c: goto c119c; faf0a: if (!(true === $request->isMethod("\x50\x4f\123\x54"))) { goto C9804; } goto d0ff6; D95ee: if (!(false === is_null($response))) { goto c9aba; } goto C90a1; f02e1: c5abd: goto Cc2dd; dff35: D3ad7: goto D2494; adb91: $response = $this->redirect($this->generateUrl("\143\154\160\x5f\x73\x69\164\x65\x73")); goto c1f5a; de951: if (!(true === $form->isSubmitted())) { goto c5abd; } goto Bfd92; ed944: $hasPermissions = $this->hasPermissions(); goto C86cc; c1f5a: goto B474c; goto dff35; a3750: $form = $this->createPhpSiteForm(); goto faf0a; Cc2dd: C9804: goto Dde7b; C90a1: return $response; goto E79d9; D52ab: } private function createPhpSiteForm() : Form { goto b1df5; A3a0a: $form->add("\163\x75\142\x6d\x69\164", SubmitType::class, ["\141\164\x74\x72" => ["\x63\154\x61\x73\163" => "\142\x74\x6e\40\142\164\156\x2d\x6c\147\x20\142\x74\x6e\55\142\154\165\x65"], "\154\x61\142\145\x6c" => "\103\x72\x65\141\164\145"]); goto A786c; b1df5: $form = $this->createForm("\101\160\x70\134\106\x6f\x72\155\x5c\123\x69\x74\x65\x4e\x65\167\x50\150\160\124\x79\160\145", [], ["\x61\143\164\151\x6f\x6e" => $this->generateUrl("\143\x6c\x70\x5f\x73\151\x74\x65\137\x70\150\x70\x5f\x6e\145\x77"), "\x6d\x65\164\x68\x6f\144" => "\x50\x4f\x53\124", "\141\164\x74\162" => []]); goto A3a0a; A786c: return $form; goto d2b54; d2b54: } private function handleCreatePhpSiteForm(Request $request, Form $form) { goto e80c7; e80c7: if (true === $form->isValid()) { goto Dac89; } goto c8b32; c8b32: $this->formErrors = $this->getErrorMessages($form); goto a18ab; d8c7c: cd7c1: goto C1fc3; a18ab: goto cd7c1; goto e2186; e2186: Dac89: goto a1fb2; a1fb2: try { goto df1d7; Bbf50: if (!(false === empty($vhostTemplateEntity->getVarnishCacheSettings()))) { goto b63d3; } goto d3ea2; dee6c: Ef9b2: goto cf459; Ea9f9: $this->createPhpSite($domainName, $rootDirectory, $phpVersion, $vhostTemplateName, $siteUser, $siteUserPassword, $varnishCacheSettings); goto ab714; A2297: E814f: goto Ea901; c9690: return $response; goto A2297; cf459: $varnishCacheSettings = []; goto Bbf50; E0e35: $user = $this->getUser(); goto A9222; Cc8b4: $rootDirectory = sprintf("\x25\x73\57\45\163", $rootDirectory, ltrim(rtrim($vhostTemplateEntity->getRootDirectory(), "\57"), "\x2f")); goto dee6c; a5562: throw new \Exception(sprintf("\x56\150\x6f\163\x74\x20\x74\x65\x6d\160\x6c\x61\x74\x65\40\x22\45\x73\42\x20\x6e\x6f\164\40\x66\x6f\x75\x6e\x64\56", $vhostTemplateName)); goto f564e; e6af5: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto a580c; aa728: $phpVersion = $form->get("\x70\150\x70\126\145\162\x73\x69\157\156")->getData(); goto e81a2; ab714: $eventData = ["\163\151\x74\x65" => $domainName, "\166\x68\157\163\x74\x54\145\x6d\x70\x6c\141\x74\x65\116\x61\155\145" => $vhostTemplateName, "\x70\x68\x70\x56\145\162\163\151\157\x6e" => $phpVersion, "\x73\x69\164\x65\x55\x73\145\x72" => $siteUser]; goto F34b3; a580c: if (false === is_null($vhostTemplateEntity)) { goto fe692; } goto a5562; eafde: $vhostTemplateName = $form->get("\141\x70\x70\x6c\x69\143\141\164\x69\157\x6e")->getData(); goto d5d8f; d3ea2: $varnishCacheSettings = (array) json_decode($vhostTemplateEntity->getVarnishCacheSettings(), true); goto d7c6b; A9222: $rootDirectory = $domainName; goto E3b6e; d5d8f: $domainName = $form->get("\x64\157\x6d\x61\151\156\116\141\155\x65")->getData(); goto aa728; af00b: $session->getFlashBag()->set("\x73\x75\x63\143\145\163\x73", $this->translator->trans("\x53\x69\164\x65\40\x68\141\x73\40\142\x65\145\x6e\40\x63\162\145\x61\164\x65\144\56")); goto a8441; df1d7: $session = $request->getSession(); goto eafde; a2d65: $siteUserPassword = $form->get("\163\151\x74\145\x55\163\145\x72\120\141\163\x73\x77\x6f\x72\144")->getData(); goto e6af5; a8441: $response = $this->redirect($this->generateUrl("\143\154\x70\137\163\x69\x74\x65\x73")); goto c9690; Bd8a6: fe692: goto E0e35; e81a2: $siteUser = $form->get("\x73\151\164\145\125\x73\x65\162")->getData(); goto a2d65; f564e: goto E814f; goto Bd8a6; d7c6b: b63d3: goto Ea9f9; E3b6e: if (!(false === empty($vhostTemplateEntity->getRootDirectory()))) { goto Ef9b2; } goto Cc8b4; F34b3: EventQueue::addEvent(EventQueue::EVENT_SITE_PHP_CREATE, $user, $eventData, $request); goto af00b; Ea901: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\144\141\x6e\147\x65\x72", $this->translator->trans("\101\156\x20\x65\162\162\x6f\162\x20\150\x61\163\40\x6f\x63\143\165\162\x72\145\x64\x2c\x20\x65\x72\162\x6f\x72\x20\155\x65\163\x73\141\147\145\72\x20\45\145\x72\162\157\x72\115\x65\x73\x73\141\147\145\45", ["\45\145\162\162\x6f\162\x4d\x65\163\163\141\147\145\x25" => $e->getMessage()])); } goto d8c7c; C1fc3: } public function newWordPressSite(Request $request) : Response { goto ca6b9; ca6b9: $hasPermissions = $this->hasPermissions(); goto Ff964; Dd7f3: $response = $this->redirect($this->generateUrl("\x63\x6c\160\x5f\x73\x69\x74\145\x73")); goto efd0b; b21b0: ffcaa: goto F4707; C726f: Dc093: goto E81c8; A08c5: f3da5: goto cb5fb; Fd215: $form = $this->createWordPressSiteForm(); goto e785f; c6691: $response = $this->render("\106\x72\x6f\156\164\x65\x6e\144\57\123\x69\164\x65\x2f\x4e\145\167\57\x77\157\162\144\x70\x72\145\x73\163\56\150\164\x6d\154\56\164\167\151\147", ["\165\x73\x65\x72" => $user, "\146\157\162\x6d" => $form->createView(), "\x66\x6f\162\x6d\105\162\162\x6f\162\x73" => $this->formErrors]); goto A08c5; efd0b: goto f3da5; goto b21b0; Ff964: if (true === $hasPermissions) { goto ffcaa; } goto Dd7f3; Bfe3d: $form->handleRequest($request); goto b8d7c; cb5fb: return $response; goto c75d3; d38ed: if (!(false === is_null($response))) { goto Dc093; } goto e7bfc; B9e47: E5bfa: goto c6691; F4707: $user = $this->getUser(); goto Fd215; b8d7c: if (!(true === $form->isSubmitted())) { goto C53e8; } goto b2146; e785f: if (!(true === $request->isMethod("\x50\x4f\x53\124"))) { goto E5bfa; } goto Bfe3d; e7bfc: return $response; goto C726f; E81c8: C53e8: goto B9e47; b2146: $response = $this->handleCreateWordPressSiteForm($request, $form); goto d38ed; c75d3: } private function createWordPressSiteForm() : Form { goto d31e4; D9846: return $form; goto c4e66; E7a99: $form->add("\x73\165\142\x6d\151\164", SubmitType::class, ["\x61\164\164\162" => ["\x63\x6c\x61\163\163" => "\142\164\156\x20\142\164\x6e\55\154\x67\40\142\x74\x6e\55\142\x6c\165\145"], "\x6c\x61\x62\145\x6c" => "\x43\162\145\141\x74\145"]); goto D9846; d31e4: $form = $this->createForm("\x41\x70\160\x5c\x46\157\162\155\134\x53\151\164\x65\x4e\x65\x77\127\x6f\162\x64\x50\162\x65\x73\x73\x54\x79\160\x65", [], ["\141\x63\x74\151\x6f\156" => $this->generateUrl("\x63\154\x70\137\163\151\x74\145\x5f\167\x6f\x72\144\160\162\x65\x73\x73\x5f\156\145\x77"), "\x6d\145\164\150\157\x64" => "\120\117\x53\x54", "\x61\x74\164\162" => ["\151\x64" => "\156\145\x77\55\167\157\x72\x64\x70\162\145\x73\163\55\163\x69\164\x65\55\146\157\x72\x6d"]]); goto E7a99; c4e66: } private function handleCreateWordPressSiteForm(Request $request, Form $form) { goto Eb0e4; a0d81: B712a: goto A2bce; ef85e: E2aa6: goto b1886; C26ca: goto E2aa6; goto a0d81; D2036: $this->formErrors = $this->getErrorMessages($form); goto C26ca; A2bce: try { goto ed6fc; ce527: $databaseUserEntity->setUserName($databaseUserName); goto ba0c4; Dd6d9: Dc10a: goto Fc7b2; ef7c7: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::WORDPRESS_VHOST_TEMPLATE_NAME); goto d0d9d; F63aa: $adminPassword = $form->get("\141\x64\155\151\156\120\141\x73\x73\167\x6f\162\144")->getData(); goto D73b9; d5ec7: $databaseUserName = $this->getUniqueDatabaseUserName($generatedName); goto D15d9; C78d1: $databaseUserEntity = $this->databaseUserEntityManager->createEntity(); goto ce527; Bde20: $eventData = ["\x73\x69\164\145" => $domainName, "\x73\x69\164\x65\125\x73\145\162" => $siteUser]; goto Bc670; ee66d: $this->installWordPress($isMultiSite, $url, $title, $adminUserName, $adminPassword, $adminEmail, $siteEntity, $activeDatabaseServerEntity, $databaseEntity, $databaseUserEntity); goto fa5cb; E8ab8: $response = $this->redirect($this->generateUrl("\143\154\160\137\x73\x69\164\145\x5f\167\157\162\x64\x70\162\145\163\x73\137\151\x6e\163\x74\141\x6c\x6c\x65\x64")); goto E71e7; A5983: $url = sprintf("\x68\164\x74\160\x73\x3a\x2f\x2f\x25\x73", $siteEntity->getDomainName()); goto b61b9; D9538: $instance = $request->attributes->get("\x69\x6e\163\x74\141\156\x63\145"); goto ab023; a5567: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto D9538; Bc670: EventQueue::addEvent(EventQueue::EVENT_SITE_WORDPRESS_CREATE, $user, $eventData, $request); goto E8ab8; D26eb: $siteCredentials["\127\157\162\x64\x50\x72\145\x73\163"] = [$this->translator->trans("\x41\x64\x6d\x69\156\x20\x45\55\115\141\151\154") => $adminEmail, $this->translator->trans("\x41\144\155\x69\x6e\x20\x55\x73\x65\x72\40\116\141\x6d\x65") => $adminUserName, $this->translator->trans("\x41\x64\x6d\151\156\40\x50\x61\x73\163\x77\157\162\x64") => $adminPassword, $this->translator->trans("\101\x64\155\151\x6e\x20\125\162\154") => sprintf("\150\x74\x74\160\163\x3a\x2f\57\45\x73\x2f\x77\x70\55\x61\x64\x6d\151\156\57", rtrim($domainName, "\57"))]; goto Dd6d9; c1894: $siteUserPassword = $form->get("\163\x69\164\145\125\x73\x65\x72\x50\141\163\x73\x77\157\x72\x64")->getData(); goto ef7c7; f4358: $databaseManager->createDatabase($databaseEntity); goto dc462; ba0c4: $databaseUserEntity->setPassword(Crypto::encrypt($databaseUserPassword)); goto a8587; ab023: $siteCredentials = [$this->translator->trans("\x53\x69\164\x65") => [$this->translator->trans("\111\x50\40\x41\x64\144\x72\x65\163\x73") => $instance->getIpv4PublicIp(), $this->translator->trans("\104\x6f\155\x61\151\x6e\40\x4e\x61\155\x65") => sprintf("\x68\x74\164\x70\163\72\57\x2f\x25\x73", $domainName), $this->translator->trans("\x53\151\164\x65\40\x55\x73\145\162") => $siteUser, $this->translator->trans("\x50\141\x73\x73\x77\157\162\144") => $siteUserPassword]]; goto f453e; f1454: $siteEntity = $this->createPhpSite($domainName, $domainName, $phpVersion, self::WORDPRESS_VHOST_TEMPLATE_NAME, $siteUser, $siteUserPassword, $varnishCacheSettings); goto a5567; a2819: $isMultiSite = $form->get("\x6d\165\x6c\x74\151\x53\x69\164\x65")->getData(); goto b0af5; Eb818: $databaseEntity->setName($databaseName); goto cf250; Fc7b2: $session->set("\163\x69\x74\x65\103\x72\145\x64\145\x6e\164\151\141\154\x73", $siteCredentials); goto Bde20; D140c: $this->siteEntityManager->updateEntity($siteEntity); goto ee66d; B7a36: $databaseEntity->setDatabaseServer($activeDatabaseServerEntity); goto Eb818; Eda65: A7e8e: goto f1454; B5788: $siteEntity->addDatabase($databaseEntity); goto Db263; c7cc3: $siteUser = $form->get("\163\151\x74\x65\125\163\145\x72")->getData(); goto c1894; cf250: $databaseEntity->setSite($siteEntity); goto C78d1; d0d9d: $phpVersion = $vhostTemplateEntity->getPhpVersion(); goto b15b1; b0af5: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto F6dd0; f453e: if (!(false === is_null($siteEntity))) { goto Dc10a; } goto Ed9e8; D73b9: $adminEmail = $form->get("\141\144\x6d\x69\156\105\155\x61\151\154")->getData(); goto a2819; E71e7: return $response; goto e9903; c7aad: $domainName = $form->get("\x64\x6f\x6d\141\151\156\x4e\141\155\x65")->getData(); goto c84e5; Ed9e8: $databaseName = $this->getUniqueDatabaseName($generatedName); goto d5ec7; a7b6b: if (!(false === empty($vhostTemplateEntity->getVarnishCacheSettings()))) { goto A7e8e; } goto b6d79; b61b9: $title = $form->get("\x73\x69\x74\145\x54\151\x74\154\145")->getData(); goto Ce813; ced33: $session = $request->getSession(); goto c7aad; Bd71d: $databaseUserEntity->setDatabase($databaseEntity); goto e1f2a; F6dd0: $databaseEntity = $this->databaseEntityManager->createEntity(); goto B7a36; b15b1: $varnishCacheSettings = []; goto a7b6b; D15d9: $databaseUserPassword = PasswordGenerator::generate(self::PASSWORD_LENGTH); goto A5983; ed6fc: $user = $this->getUser(); goto ced33; Ce813: $adminUserName = $form->get("\141\x64\155\151\x6e\x55\x73\x65\x72\116\x61\x6d\x65")->getData(); goto F63aa; b6d79: $varnishCacheSettings = (array) json_decode($vhostTemplateEntity->getVarnishCacheSettings(), true); goto Eda65; a8587: $databaseUserEntity->setPermissions(DatabaseUserEntity::PERMISSIONS_READ_WRITE); goto Bd71d; fa5cb: $siteCredentials[$this->translator->trans("\x44\141\x74\x61\142\x61\x73\145")] = [$this->translator->trans("\x48\x6f\163\164") => $activeDatabaseServerEntity->getHost(), $this->translator->trans("\120\157\x72\164") => $activeDatabaseServerEntity->getPort(), $this->translator->trans("\104\x61\164\x61\x62\141\163\x65\x20\x4e\141\x6d\x65") => $databaseName, $this->translator->trans("\104\141\164\x61\x62\141\x73\145\x20\x55\x73\x65\x72\x20\x4e\141\x6d\x65") => $databaseUserName, $this->translator->trans("\104\141\164\x61\142\141\x73\145\x20\125\x73\x65\162\40\x50\x61\163\163\x77\x6f\x72\x64") => $databaseUserPassword]; goto D26eb; Db263: $databaseManager = new DatabaseManager($activeDatabaseServerEntity); goto f4358; c84e5: $generatedName = $this->generateNameFromDomainName($domainName); goto c7cc3; dc462: $databaseManager->createUser($databaseUserEntity); goto D140c; e1f2a: $databaseEntity->addUser($databaseUserEntity); goto B5788; e9903: } catch (\Exception $e) { $this->logger->exception($e); $session->getFlashBag()->set("\x64\x61\x6e\147\x65\x72", $this->translator->trans("\101\156\40\x65\x72\x72\x6f\162\40\150\x61\163\40\x6f\x63\x63\165\162\x72\145\x64\x2c\x20\145\162\x72\x6f\162\x20\x6d\x65\163\163\x61\147\145\x3a\40\45\x65\x72\x72\x6f\x72\115\145\x73\163\x61\x67\x65\45", ["\45\x65\x72\162\x6f\162\115\x65\163\163\x61\x67\145\x25" => $e->getMessage()])); } goto ef85e; Eb0e4: if (true === $form->isValid()) { goto B712a; } goto D2036; b1886: } 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 Dd58f; Bb650: $wordPressInstaller->installCore($isMultiSite, $url, $title, $adminUserName, $adminPassword, $adminEmail); goto a4cf9; C056b: $databaseName = $databaseEntity->getName(); goto E07d2; a3719: $databaseUserPassword = Crypto::decrypt($databaseUserEntity->getPassword()); goto Ad5f2; e1549: acf3b: goto c4c14; a46d5: foreach ($this->wordPressMultiSiteConfigValues as $key => $config) { $wordPressInstaller->setConfigValue($key, $config["\166\141\x6c\x75\145"], $config["\162\141\167"]); Fadcc: } goto e1549; E07d2: $databaseUserName = $databaseUserEntity->getUserName(); goto a3719; E1ea7: $wordPressInstaller->resetPermissions(); goto A730f; c4c14: c5acb: goto E1ea7; B2eb2: $wordPressInstaller->downloadAndExtractLatestVersion(); goto Af3b7; Af3b7: $wordPressInstaller->createConfig($databaseHost, $databaseName, $databaseUserName, $databaseUserPassword); goto Bb650; ea64d: if (!(true === $isMultiSite)) { goto c5acb; } goto B368a; a4cf9: foreach ($this->wordPressDefaultConfigValues as $key => $config) { $wordPressInstaller->setConfigValue($key, $config["\166\x61\154\165\145"], $config["\162\141\x77"]); cfef2: } goto eb5a3; Dd58f: $databaseHost = sprintf("\45\163\x3a\x25\163", $databaseServerEntity->getHost(), $databaseServerEntity->getPort()); goto C056b; B368a: $this->wordPressMultiSiteConfigValues["\104\x4f\115\101\x49\116\x5f\103\x55\x52\122\x45\x4e\x54\x5f\x53\111\x54\x45"]["\166\x61\154\165\145"] = $siteEntity->getDomainName(); goto a46d5; Ad5f2: $wordPressInstaller = new WordPressInstaller($siteEntity); goto B2eb2; eb5a3: aa44a: goto ea64d; A730f: } private function createPhpSite(string $domainName, string $rootDirectory, string $phpVersion, string $vhostTemplateName, string $siteUser, string $siteUserPassword, array $varnishCacheSettings = []) : SiteEntity { goto C746d; b02a7: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto ad156; e7313: $certificateEntity->setSite($siteEntity); goto b1d87; Cc956: $siteEntity->setUser($siteUser); goto c3e5e; Ff093: $phpSite->setPhpSettings($phpSettingsEntity); goto a173f; F74ec: Ccfe9: goto d5e26; f0253: $siteEntity->setType(SiteEntity::TYPE_PHP); goto b13b2; Aef71: $siteEntity->setCertificate($certificateEntity); goto Abb63; B49a4: $vhostTemplate->resetProcessors(); goto A4a65; E3656: $phpSettingsEntity->setPhpVersion($phpVersion); goto c3dd7; E6432: $phpSiteCreator->createNginxVhost(); goto Fc1db; ba73a: $siteEntity->setRootDirectory($rootDirectory); goto df91f; a173f: $phpSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto C6c3c; Dabb9: $vhostTemplate = sprintf("\x25\163\x25\x73", $redirectionVhostTemplate, $vhostTemplate); goto ca3ab; a323d: if (!(true === is_null($subdomain) || "\x77\x77\x77" == $subdomain)) { goto c091a; } goto E3da4; C0278: return $siteEntity; goto e0fe4; C90fa: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto Cc7dc; c3dd7: $phpSettingsEntity->setSite($siteEntity); goto A9d06; Fc1db: $phpSiteCreator->reloadNginxService(); goto ee71d; A30e0: $constraintViolationList = new ConstraintViolationList(); goto acb7f; D3735: $defaultVarnishCacheSettings = ["\145\x6e\141\x62\x6c\145\144" => false, "\163\x65\x72\x76\x65\162" => self::VARNISH_CACHE_SERVER, "\143\141\143\x68\145\x54\141\147\x50\x72\145\146\151\x78" => substr(md5(time()), 0, 4)]; goto b325b; d23cc: $phpSite->setRegistrableDomain($registrableDomain); goto c97ff; Cf694: $subdomain = $resolvedDomainName->subDomain()->toString(); goto A826b; d5e26: $certificateEntity = $this->certificateEntityManager->createEntity(); goto e7313; A4a65: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto c4adc; edb9d: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto f7931; A4ba6: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto F5d63; e5b8b: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto A5f05; Cc7dc: $certificateEntity->setDefaultCertificate(true); goto b02a7; ad156: $certificateEntity->setCsr($csr); goto d30ac; D4d99: $phpSite->setCertificate($certificateEntity); goto Ff093; b2f06: $phpSettingsEntity = new PhpSettingsEntity(); goto e7136; adf53: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto Bcd96; F5d63: $this->siteEntityManager->updateEntity($siteEntity); goto C0278; f5e1e: $phpSettingsConstraints = $this->validator->validate($phpSettingsEntity); goto Ad29d; E9f4b: $phpSiteCreator->createIndexPhp(); goto E4218; b7b5c: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto A4ba6; b1d87: $rsaKeyGenerator = new RsaKeyGenerator(); goto c979a; c4adc: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto b5932; Fa9fa: $certificateEntity->setCertificate($selfSignedCertificate); goto Aef71; c3603: $subjectAlternativeNames[] = $registrableDomain; goto F7a4e; C746d: $varnishCache = false === empty($varnishCacheSettings) ? true : false; goto E1c03; A826b: $subdomain = false === empty($subdomain) ? $subdomain : null; goto f2bbe; a9e5b: $vhostTemplate->build(); goto b7b5c; E3da4: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\x2e\x2f\x2e\56\57\56\56\x2f\162\x65\163\157\x75\162\143\x65\163\x2f\156\147\x69\156\x78\x2f\166\x68\x6f\x73\x74\137\164\x65\x6d\160\x6c\141\164\x65\x2f\x72\x65\x64\x69\162\x65\143\164"); goto eb2c6; f7931: $csr = $csrGenerator->generate(); goto C90fa; C406e: Dfec8: goto C0f8d; B192f: $siteEntity->setVhostTemplate($vhostTemplate); goto b2f06; b13b2: $siteEntity->setDomainName($domainName); goto Cc956; d4c9d: $phpSite->setVarnishCacheSettings($varnishCacheSettings); goto d4436; d30ac: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto Fa9fa; fe964: $phpSite->setRootDirectory($siteEntity->getRootDirectory()); goto D4d99; ca3ab: a178d: goto df0d5; d4aff: $siteEntity = $this->siteEntityManager->createEntity(); goto f0253; b5d32: $phpSiteCreator->createPhpFpmPool(); goto addf8; b5932: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto a9e5b; eb2c6: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto e3097; Ebd5a: $phpSite->setUserPassword($siteEntity->getUserPassword()); goto C285d; Bed5b: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto B49a4; c97ff: $phpSite->setSubdomain($subdomain); goto fe964; b8a87: $siteEntity->setVarnishCache(true); goto Cb123; E1c03: $rootDirectory = trim(rtrim(ltrim($rootDirectory, "\x2f")), "\x2f"); goto adf53; e3097: if (!(false === empty($redirectionVhostTemplate))) { goto a178d; } goto Dabb9; A5881: if (!(true === $varnishCache)) { goto Af964; } goto A3ead; b325b: $varnishCacheSettings = array_merge($defaultVarnishCacheSettings, $varnishCacheSettings); goto c9f9d; E4218: $phpSiteCreator->createPrivateKeyAndCertificate(); goto b5d32; Ad29d: if (!(count($siteConstraints) || count($phpSettingsConstraints))) { goto Ccfe9; } goto A30e0; eca23: $phpSiteCreator->createRootDirectory(); goto Ab4de; Abb63: $phpSite = new PhpSite(); goto D9792; A3ead: $phpSite->setVarnishCache(true); goto D3735; C285d: $phpSite->setDomainName($domainName); goto d23cc; D9792: $phpSite->setUser($siteEntity->getUser()); goto Ebd5a; ee71d: $phpSiteCreator->resetPermissions(); goto Bde79; a15ad: $constraintViolationList->addAll($phpSettingsConstraints); goto e5b8b; C0f8d: if (!(false === is_null($subdomain) && "\x77\x77\167" == $subdomain)) { goto Ee72a; } goto c3603; df0d5: c091a: goto B192f; acb7f: $constraintViolationList->addAll($siteConstraints); goto a15ad; A5f05: throw new \Exception(implode("\x3b\40", $errorMessages)); goto F74ec; c979a: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto a44c2; a44c2: $subjectAlternativeNames = []; goto ca866; f2bbe: $vhostTemplateEntity = $this->getVhostTemplateEntity($vhostTemplateName); goto F7b20; F8cfd: $phpSiteCreator->createUser(); goto eca23; Cb123: Abca6: goto a323d; F7b20: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto d4aff; Fdb92: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto edb9d; C6c3c: $phpSiteCreator = new PhpSiteCreator($phpSite); goto F8cfd; F7a4e: Ee72a: goto Fdb92; c9f9d: $phpSiteCreator->createVarnishCacheStructure($varnishCacheSettings); goto d4c9d; df91f: if (!(false === empty($varnishCache))) { goto Abca6; } goto b8a87; addf8: $phpSiteCreator->reloadPhpFpmService(); goto A5881; c3e5e: $siteEntity->setUserPassword($siteUserPassword); goto ba73a; A9d06: $siteConstraints = $this->validator->validate($siteEntity); goto f5e1e; Bcd96: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto Cf694; d4436: Af964: goto E6432; Bde79: $vhostTemplate = new PhpVhostTemplate($phpSite); goto Bed5b; Ab4de: $phpSiteCreator->createLogrotateFile(); goto E9f4b; e7136: $siteEntity->setPhpSettings($phpSettingsEntity); goto E3656; be63d: $subjectAlternativeNames[] = sprintf("\x77\x77\167\x2e\45\163", $domainName); goto C406e; ca866: if (!(true === is_null($subdomain))) { goto Dfec8; } goto be63d; e0fe4: } private function createNodejsSite(string $domainName, string $nodejsVersion, string $port, string $siteUser, string $siteUserPassword) : SiteEntity { goto f5b6a; A4014: $nodejsSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto d3887; adde1: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto c3df2; a935d: $nodejsSite->setRegistrableDomain($registrableDomain); goto Ab86b; Db800: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto f7c60; c41b1: $nodejsSiteCreator->installNodejs(); goto c82fd; Ab86b: $nodejsSite->setSubdomain($subdomain); goto ab3e4; f3903: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto Cc77c; c0de0: if (!(false === is_null($subdomain) && "\167\167\167" == $subdomain)) { goto C759e; } goto c0efe; c99b7: $nodejsSiteCreator->createLogrotateFile(); goto Ac61a; F3ff3: $siteConstraints = $this->validator->validate($siteEntity); goto A0cea; C948d: $siteEntity->setNodejsSettings($nodejsSettingsEntity); goto B5ab8; fcce3: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto c9f55; D8d4a: $subdomain = false === empty($subdomain) ? $subdomain : null; goto de938; df77f: throw new \Exception(implode("\x3b\40", $errorMessages)); goto b6e8c; B50ef: $nodejsSite = new NodejsSite(); goto C4132; Cf735: $nodejsSettingsEntity = new NodejsSettingsEntity(); goto C948d; b8918: $nodejsSettingsEntity->setPort($port); goto B90f1; c17b6: if (!(count($siteConstraints) || count($nodejsSettingsConstraints))) { goto Bad23; } goto De7c5; a2163: $vhostTemplate = sprintf("\x25\163\45\163", $redirectionVhostTemplate, $vhostTemplate); goto D2817; e6199: $siteEntity->setRootDirectory($domainName); goto e91dd; Ac61a: $nodejsSiteCreator->createNvmDirectory(); goto c41b1; B5ab8: $nodejsSettingsEntity->setNodejsVersion($nodejsVersion); goto b8918; d7ad6: $subdomain = $resolvedDomainName->subDomain()->toString(); goto D8d4a; f8a6e: $nodejsSite->setDomainName($domainName); goto a935d; a12fb: if (!(true === is_null($subdomain))) { goto a5e6c; } goto C6368; ab3e4: $nodejsSite->setRootDirectory($siteEntity->getRootDirectory()); goto d204c; ce1cb: $constraintViolationList->addAll($siteConstraints); goto cbb51; c82fd: $nodejsSiteCreator->createPrivateKeyAndCertificate(); goto b14c2; c0dd1: $certificateEntity->setSite($siteEntity); goto b3138; cfa0c: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\x2f\x2e\56\x2f\x2e\56\57\56\x2e\x2f\162\145\x73\157\x75\162\x63\x65\163\57\x6e\147\x69\x6e\170\x2f\x76\x68\x6f\163\x74\137\164\145\x6d\160\x6c\141\164\x65\x2f\x72\145\x64\x69\162\145\143\x74"); goto f8cea; B4130: $this->siteEntityManager->updateEntity($siteEntity); goto Bd3f7; aef7e: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto b51fb; d204c: $nodejsSite->setCertificate($certificateEntity); goto f1f93; f1f93: $nodejsSite->setNodejsSettings($nodejsSettingsEntity); goto A4014; f7c60: $certificateEntity->setCsr($csr); goto aef7e; eec51: $vhostTemplate->resetProcessors(); goto f864d; c0efe: $subjectAlternativeNames[] = $registrableDomain; goto ae621; De7c5: $constraintViolationList = new ConstraintViolationList(); goto ce1cb; de938: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::NODEJS_VHOST_TEMPLATE_NAME); goto c444c; F9aa5: $siteEntity = $this->siteEntityManager->createEntity(); goto bb356; b14c2: $nodejsSiteCreator->createNginxVhost(); goto A6cae; e91dd: if (!(true === is_null($subdomain) || "\167\167\x77" == $subdomain)) { goto Dccf1; } goto cfa0c; Fb060: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto eec51; d3887: $nodejsSiteCreator = new NodejsSiteCreator($nodejsSite); goto Fe841; D6519: Dccf1: goto E2064; Bd3f7: return $siteEntity; goto E4032; bf351: $vhostTemplate = new StaticVhostTemplate($nodejsSite); goto Fb060; cbb51: $constraintViolationList->addAll($nodejsSettingsConstraints); goto Eb836; Cc77c: $vhostTemplate->build(); goto adde1; D1d13: $certificateEntity = $this->certificateEntityManager->createEntity(); goto c0dd1; D241a: $certificateEntity->setDefaultCertificate(true); goto Db800; D2817: c0523: goto D6519; ee9cc: if (!(false === empty($redirectionVhostTemplate))) { goto c0523; } goto a2163; E4d82: $nodejsSiteCreator->createRootDirectory(); goto c99b7; Ae39d: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto Ed17a; Ed17a: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto dcfe8; E2064: $siteEntity->setVhostTemplate($vhostTemplate); goto Cf735; f8cea: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto ee9cc; B3ae6: $siteEntity->setUser($siteUser); goto Ab5bd; c9f55: $subjectAlternativeNames = []; goto a12fb; b3138: $rsaKeyGenerator = new RsaKeyGenerator(); goto fcce3; f864d: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto Fc3ad; a0846: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto D241a; C6368: $subjectAlternativeNames[] = sprintf("\167\167\x77\56\x25\x73", $domainName); goto a1574; b51fb: $certificateEntity->setCertificate($selfSignedCertificate); goto A3aa6; Fc3ad: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto f3903; A6cae: $nodejsSiteCreator->reloadNginxService(); goto e7806; A0cea: $nodejsSettingsConstraints = $this->validator->validate($nodejsSettingsEntity); goto c17b6; Ab5bd: $siteEntity->setUserPassword($siteUserPassword); goto e6199; B90f1: $nodejsSettingsEntity->setSite($siteEntity); goto F3ff3; Eb836: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto df77f; f5b6a: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto A80ad; b6e8c: Bad23: goto D1d13; c444c: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto F9aa5; c3df2: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto B4130; ae621: C759e: goto Ae39d; a1574: a5e6c: goto c0de0; bb356: $siteEntity->setType(SiteEntity::TYPE_NODEJS); goto ebacd; C4132: $nodejsSite->setUser($siteEntity->getUser()); goto A58a3; A3aa6: $siteEntity->setCertificate($certificateEntity); goto B50ef; ebacd: $siteEntity->setDomainName($domainName); goto B3ae6; A80ad: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto d7ad6; Fe841: $nodejsSiteCreator->createUser(); goto E4d82; A58a3: $nodejsSite->setUserPassword($siteEntity->getUserPassword()); goto f8a6e; e7806: $nodejsSiteCreator->resetPermissions(); goto bf351; dcfe8: $csr = $csrGenerator->generate(); goto a0846; E4032: } private function createPythonSite(string $domainName, string $pythonVersion, string $port, string $siteUser, string $siteUserPassword) : SiteEntity { goto cbf81; B391f: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto b5485; e5de4: $subjectAlternativeNames = []; goto afe5b; b3e18: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto Fc061; Ceb73: C297c: goto db5e4; b3456: C08f8: goto a2f2c; C36de: $pythonSiteCreator = new PythonSiteCreator($pythonSite); goto d1ebc; Fc061: $certificateEntity->setCsr($csr); goto e1fba; C042c: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto ed230; B8511: $vhostTemplate = new PythonVhostTemplate($pythonSite); goto D9ea8; C0722: $pythonSettingsEntity = new PythonSettingsEntity(); goto Feedf; d4611: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto cc53e; Bba10: $csr = $csrGenerator->generate(); goto Be5bf; Aa97a: $siteEntity->setCertificate($certificateEntity); goto D5480; d9d97: $pythonSiteCreator->writePythonVersionFile(); goto C2b4c; d049e: $pythonSettingsEntity->setPort($port); goto b181c; d9716: $pythonSite->setDomainName($domainName); goto Ada9a; f9605: $pythonSiteCreator->createRootDirectory(); goto Ce240; b9231: return $siteEntity; goto F3eb0; Cd265: $pythonSite->setRootDirectory($siteEntity->getRootDirectory()); goto Aee43; b181c: $pythonSettingsEntity->setSite($siteEntity); goto a16d8; d196b: $siteEntity->setUser($siteUser); goto C8c71; C806b: $certificateEntity->setCertificate($selfSignedCertificate); goto Aa97a; e98c8: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto Bba10; Aee43: $pythonSite->setCertificate($certificateEntity); goto c97ac; D9452: $vhostTemplate->resetProcessors(); goto a1528; af126: $subjectAlternativeNames[] = sprintf("\x77\167\167\56\45\x73", $domainName); goto b3456; a1528: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto e9111; afe5b: if (!(true === is_null($subdomain))) { goto C08f8; } goto af126; c9e4a: $siteEntity->setType(SiteEntity::TYPE_PYTHON); goto F685b; C12a8: $pythonSettingsEntity->setPythonVersion($pythonVersion); goto d049e; c55dd: $siteEntity->setRootDirectory($domainName); goto ae593; cc53e: $this->siteEntityManager->updateEntity($siteEntity); goto cc294; f1949: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto c310d; e9111: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto f1949; c3089: $certificateEntity->setDefaultCertificate(true); goto b3e18; be0cb: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto e5de4; D5480: $pythonSite = new PythonSite(); goto Dff3e; d8108: throw new \Exception(implode("\x3b\40", $errorMessages)); goto Aa941; cc294: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto b9231; Ae7c5: $subdomain = false === empty($subdomain) ? $subdomain : null; goto ddba7; ad08c: e1fc8: goto Dcc1d; c49d9: $pythonSiteCreator->reloadNginxService(); goto A0b5a; F6770: $pythonSettingsConstraints = $this->validator->validate($pythonSettingsEntity); goto A0248; Edc4f: $certificateEntity->setSite($siteEntity); goto Abf70; a16d8: $siteConstraints = $this->validator->validate($siteEntity); goto F6770; Dff3e: $pythonSite->setUser($siteEntity->getUser()); goto Def1b; Ada9a: $pythonSite->setRegistrableDomain($registrableDomain); goto eb38c; cbf81: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto C042c; Eb7be: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto d8108; A0248: if (!(count($siteConstraints) || count($pythonSettingsConstraints))) { goto c14be; } goto Dad6c; Ae065: $subjectAlternativeNames[] = $registrableDomain; goto ad08c; f6b21: $constraintViolationList->addAll($siteConstraints); goto b5978; Ce240: $pythonSiteCreator->createLogrotateFile(); goto d9d97; Dcc1d: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto e98c8; A0b5a: $pythonSiteCreator->resetPermissions(); goto B8511; b5485: $siteEntity = $this->siteEntityManager->createEntity(); goto c9e4a; ae593: if (!(true === is_null($subdomain) || "\x77\167\167" == $subdomain)) { goto ad2e6; } goto f71c5; D5a80: $vhostTemplate = sprintf("\x25\163\x25\163", $redirectionVhostTemplate, $vhostTemplate); goto Ceb73; C8c71: $siteEntity->setUserPassword($siteUserPassword); goto c55dd; c310d: $vhostTemplate->build(); goto d4611; b5978: $constraintViolationList->addAll($pythonSettingsConstraints); goto Eb7be; ed230: $subdomain = $resolvedDomainName->subDomain()->toString(); goto Ae7c5; C2b4c: $pythonSiteCreator->createPrivateKeyAndCertificate(); goto f4e51; Dad6c: $constraintViolationList = new ConstraintViolationList(); goto f6b21; Be5bf: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto c3089; F685b: $siteEntity->setDomainName($domainName); goto d196b; e7237: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto e597c; a2f2c: if (!(false === is_null($subdomain) && "\167\x77\x77" == $subdomain)) { goto e1fc8; } goto Ae065; f4e51: $pythonSiteCreator->createNginxVhost(); goto c49d9; db5e4: ad2e6: goto ac78a; d1ebc: $pythonSiteCreator->createUser(); goto f9605; ddba7: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::PYTHON_VHOST_TEMPLATE_NAME); goto B391f; eb38c: $pythonSite->setSubdomain($subdomain); goto Cd265; dadae: $pythonSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto C36de; e597c: if (!(false === empty($redirectionVhostTemplate))) { goto C297c; } goto D5a80; f71c5: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\56\x2e\57\56\56\x2f\56\x2e\57\162\x65\163\157\x75\x72\x63\145\163\x2f\x6e\147\x69\x6e\170\57\x76\150\x6f\x73\x74\137\164\x65\155\x70\154\x61\164\145\57\x72\145\144\151\x72\x65\x63\x74"); goto e7237; Aa941: c14be: goto c67cd; D9ea8: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto D9452; c97ac: $pythonSite->setPythonSettings($pythonSettingsEntity); goto dadae; e1fba: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto C806b; ac78a: $siteEntity->setVhostTemplate($vhostTemplate); goto C0722; Feedf: $siteEntity->setPythonSettings($pythonSettingsEntity); goto C12a8; c67cd: $certificateEntity = $this->certificateEntityManager->createEntity(); goto Edc4f; Abf70: $rsaKeyGenerator = new RsaKeyGenerator(); goto be0cb; Def1b: $pythonSite->setUserPassword($siteEntity->getUserPassword()); goto d9716; F3eb0: } private function createStaticSite(string $domainName, string $siteUser, string $siteUserPassword) : SiteEntity { goto F344e; e9b9d: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto E35d4; a0136: $staticSite->setRootDirectory($siteEntity->getRootDirectory()); goto ffd45; b703b: $certificateEntity->setDefaultCertificate(true); goto e21df; d40f9: $siteEntity->setRootDirectory($domainName); goto ed369; E76c3: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto f3626; E8190: $certificateEntity->setCsr($csr); goto a1be9; d3d1d: $staticSiteCreator->resetPermissions(); goto e82b0; D0fa3: throw new \Exception(implode("\x3b\40", $errorMessages)); goto Ce886; d30f5: $certificateEntity->setSite($siteEntity); goto b2b10; dccff: return $siteEntity; goto D8900; d3de8: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto e9b9d; c9967: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto b703b; A38bf: $staticSiteCreator->createUser(); goto A27a0; F5a72: $siteConstraints = $this->validator->validate($siteEntity); goto Fa207; F07c9: $staticSiteCreator->reloadNginxService(); goto d3d1d; F77c2: $vhostTemplate = sprintf("\x25\x73\x25\x73", $redirectionVhostTemplate, $vhostTemplate); goto F87bf; cea43: $csr = $csrGenerator->generate(); goto c9967; E0910: $subjectAlternativeNames = []; goto Fc52c; f3626: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto cee37; Fc52c: if (!(true === is_null($subdomain))) { goto e8442; } goto C445d; ed369: if (!(true === is_null($subdomain) || "\x77\x77\x77" == $subdomain)) { goto fe5c4; } goto f1b19; Be814: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto B98b8; bf62b: $siteEntity->setVhostTemplate($vhostTemplate); goto F5a72; b20a7: $staticSiteCreator->createPrivateKeyAndCertificate(); goto cbfa0; Bcb9d: $constraintViolationList = new ConstraintViolationList(); goto e7c38; Be236: $staticSite = new StaticSite(); goto Ee67d; c51fd: $siteEntity = $this->siteEntityManager->createEntity(); goto ed462; B1f7a: $siteEntity->setUserPassword($siteUserPassword); goto d40f9; Fded0: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::STATIC_SITE_VHOST_TEMPLATE_NAME); goto Cad17; e82b0: $vhostTemplate = new StaticVhostTemplate($staticSite); goto D5c2b; e21df: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto E8190; efbab: E4a50: goto Be814; e7c38: $constraintViolationList->addAll($siteConstraints); goto Deb48; cbfa0: $staticSiteCreator->createNginxVhost(); goto F07c9; ffd45: $staticSite->setCertificate($certificateEntity); goto c72d3; cee37: $this->siteEntityManager->updateEntity($siteEntity); goto dccff; a1be9: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto F49f3; B98b8: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto cea43; Ce886: C804c: goto D4722; b2b10: $rsaKeyGenerator = new RsaKeyGenerator(); goto e71ea; d3532: $subjectAlternativeNames[] = $registrableDomain; goto efbab; b43e8: $vhostTemplate->build(); goto E76c3; F87bf: a1a91: goto Be8c5; f005c: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto Ee3bf; c67a9: $subdomain = false === empty($subdomain) ? $subdomain : null; goto Fded0; F9ca0: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto Bb5de; Ee3bf: $subdomain = $resolvedDomainName->subDomain()->toString(); goto c67a9; A27a0: $staticSiteCreator->createRootDirectory(); goto a3042; ed462: $siteEntity->setType(SiteEntity::TYPE_STATIC); goto Bd8ff; C445d: $subjectAlternativeNames[] = sprintf("\x77\x77\x77\x2e\x25\x73", $domainName); goto A272d; c972b: $staticSite->setUserPassword($siteEntity->getUserPassword()); goto A8d02; c5d10: if (!(false === is_null($subdomain) && "\x77\167\167" == $subdomain)) { goto E4a50; } goto d3532; F49f3: $certificateEntity->setCertificate($selfSignedCertificate); goto e4edc; f1b19: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\x2f\x2e\56\x2f\x2e\x2e\x2f\56\x2e\x2f\x72\x65\163\157\165\162\x63\x65\163\57\x6e\147\x69\x6e\170\x2f\x76\x68\157\x73\164\137\164\145\x6d\x70\154\141\164\145\57\162\145\144\x69\x72\145\143\164"); goto F9ca0; A8d02: $staticSite->setDomainName($domainName); goto fd19a; A272d: e8442: goto c5d10; D4722: $certificateEntity = $this->certificateEntityManager->createEntity(); goto d30f5; fd19a: $staticSite->setRegistrableDomain($registrableDomain); goto eb0aa; Cad17: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto c51fd; Be8c5: fe5c4: goto bf62b; F344e: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto f005c; De4ac: $staticSiteCreator->createIndexHtml(); goto b20a7; Ee67d: $staticSite->setUser($siteEntity->getUser()); goto c972b; eb0aa: $staticSite->setSubdomain($subdomain); goto a0136; a8676: $vhostTemplate->resetProcessors(); goto d3de8; E35d4: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto b43e8; faa2c: $staticSiteCreator = new StaticSiteCreator($staticSite); goto A38bf; D5c2b: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto a8676; Deb48: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto D0fa3; Bd796: $siteEntity->setUser($siteUser); goto B1f7a; e4edc: $siteEntity->setCertificate($certificateEntity); goto Be236; c72d3: $staticSite->setVhostTemplate($siteEntity->getVhostTemplate()); goto faa2c; Bd8ff: $siteEntity->setDomainName($domainName); goto Bd796; e71ea: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto E0910; a3042: $staticSiteCreator->createLogrotateFile(); goto De4ac; Bb5de: if (!(false === empty($redirectionVhostTemplate))) { goto a1a91; } goto F77c2; Fa207: if (!count($siteConstraints)) { goto C804c; } goto Bcb9d; D8900: } private function createReverseProxySite(string $domainName, string $reverseProxyUrl, string $siteUser, string $siteUserPassword) : SiteEntity { goto e3b43; a24ef: $siteEntity->setDomainName($domainName); goto C2297; A13e1: $certificateEntity->setType(CertificateEntity::TYPE_SELF_SIGNED); goto aa8b3; b13c5: $vhostTemplate->build(); goto d0113; Ac196: $siteEntity->setReverseProxyUrl($reverseProxyUrl); goto a9d41; A9a49: $csr = $csrGenerator->generate(); goto Cd69f; d4ac5: if (!count($siteConstraints)) { goto B2cd4; } goto A2b15; e49ee: $certificateEntity->setSite($siteEntity); goto fdc9d; Ee386: F829d: goto c9437; bc59b: $vhostTemplateEntity = $this->getVhostTemplateEntity(self::REVERSE_PROXY_VHOST_TEMPLATE_NAME); goto Ae8f5; b2bc2: if (!(true === is_null($subdomain))) { goto F829d; } goto C0e9b; Ef7b8: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto Dd7b5; B9b0e: $vhostTemplate->addProcessor(new RedirectServerNameProcessor()); goto c8c09; D3880: $reverseProxySite->setRootDirectory($siteEntity->getRootDirectory()); goto cf177; Dd7b5: $subdomain = $resolvedDomainName->subDomain()->toString(); goto E1f42; c2bfe: $subjectAlternativeNames[] = $registrableDomain; goto b34ea; Ebc3d: $siteConstraints = $this->validator->validate($siteEntity); goto d4ac5; a9d41: if (!(true === is_null($subdomain) || "\x77\x77\x77" == $subdomain)) { goto a3820; } goto f2540; F1c55: $reversProxySiteCreator->createPrivateKeyAndCertificate(); goto E2e95; E201e: $siteEntity = $this->siteEntityManager->createEntity(); goto ff002; C0e9b: $subjectAlternativeNames[] = sprintf("\167\167\167\56\x25\x73", $domainName); goto Ee386; fa719: throw new \Exception(implode("\73\x20", $errorMessages)); goto e1d20; fb35e: $reversProxySiteCreator->resetPermissions(); goto B873e; B873e: $vhostTemplate = new ReverseProxyVhostTemplate($reverseProxySite); goto d6a39; fdc9d: $rsaKeyGenerator = new RsaKeyGenerator(); goto Faf20; Ae8f5: $vhostTemplate = $vhostTemplateEntity->getTemplate(); goto E201e; d6a39: $vhostTemplate->setContent($siteEntity->getVhostTemplate()); goto f4581; f2540: $redirectionVhostTemplateFile = realpath(dirname(__FILE__) . "\57\x2e\56\x2f\x2e\x2e\57\56\x2e\x2f\x72\x65\x73\157\x75\x72\x63\145\163\57\156\x67\151\x6e\x78\x2f\166\x68\x6f\x73\164\137\164\145\x6d\160\x6c\x61\164\x65\x2f\x72\145\x64\x69\x72\145\143\164"); goto Adf9d; D5b19: $subjectAlternativeNames = []; goto b2bc2; c8c09: $vhostTemplate->addProcessor(new RedirectDomainProcessor()); goto b13c5; F70d1: $reversProxySiteCreator->reloadNginxService(); goto fb35e; Cd69f: $selfSignedCertificate = Openssl::createSelfSignedCertificate($privateKey, $csr); goto f8a6c; c9437: if (!(false === is_null($subdomain) && "\167\167\167" == $subdomain)) { goto d5f54; } goto c2bfe; ff002: $siteEntity->setType(SiteEntity::TYPE_REVERSE_PROXY); goto a24ef; C6f4e: $reverseProxySite = new ReverseProxySite(); goto a56ab; a56ab: $reverseProxySite->setUser($siteEntity->getUser()); goto A6070; cf177: $reverseProxySite->setCertificate($certificateEntity); goto B0494; b819f: $errorMessages = $this->getConstraintViolationListErrorMessages($constraintViolationList); goto fa719; Eeb90: return $siteEntity; goto fa222; dd3b3: $reversProxySiteCreator->createRootDirectory(); goto E1642; E2ee7: $this->siteEntityManager->updateEntity($siteEntity); goto Eeb90; C6e3c: $reverseProxySite->setRegistrableDomain($registrableDomain); goto c2136; A2b15: $constraintViolationList = new ConstraintViolationList(); goto Deaa2; da5b4: $certificateEntity->setPrivateKey($privateKey->getPEM()); goto Ae0c1; f7110: $reverseProxySite->setDomainName($domainName); goto C6e3c; Adf9d: $redirectionVhostTemplate = file_get_contents($redirectionVhostTemplateFile); goto D0f72; e3b43: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto Ef7b8; Ee363: $certificateEntity = $this->certificateEntityManager->createEntity(); goto e49ee; f4581: $vhostTemplate->resetProcessors(); goto B0d83; E87f7: $reversProxySiteCreator = new ReverseProxySiteCreator($reverseProxySite); goto e9dc6; bbf6c: $siteEntity->setCertificate($certificateEntity); goto C6f4e; aa8b3: $certificateEntity->setCsr($csr); goto da5b4; ad306: dcfdf: goto c2275; c2275: a3820: goto b2ebc; d2dc9: $distinguishedName = new DistinguishedName($domainName, $subjectAlternativeNames); goto d68fc; Ae0c1: $certificateEntity->setCertificate($selfSignedCertificate); goto bbf6c; E2e95: $reversProxySiteCreator->createNginxVhost(); goto F70d1; d0113: $siteEntity->setVhostTemplate($vhostTemplate->getContent()); goto D79dc; Deaa2: $constraintViolationList->addAll($siteConstraints); goto b819f; A6070: $reverseProxySite->setUserPassword($siteEntity->getUserPassword()); goto f7110; e9dc6: $reversProxySiteCreator->createUser(); goto dd3b3; E1642: $reversProxySiteCreator->createLogrotateFile(); goto F1c55; b4ffd: $siteEntity->setRootDirectory($domainName); goto Ac196; f8a6c: $certificateEntity->setDefaultCertificate(true); goto A13e1; D0f72: if (!(false === empty($redirectionVhostTemplate))) { goto dcfdf; } goto bb4dc; c2136: $reverseProxySite->setSubdomain($subdomain); goto D3880; Bec0a: $reverseProxySite->setVhostTemplate($siteEntity->getVhostTemplate()); goto E87f7; e1d20: B2cd4: goto Ee363; d68fc: $csrGenerator = new CsrGenerator($privateKey, $distinguishedName); goto A9a49; E1f42: $subdomain = false === empty($subdomain) ? $subdomain : null; goto bc59b; Faf20: $privateKey = $rsaKeyGenerator->generatePrivateKey(); goto D5b19; B0d83: $vhostTemplate->addProcessor(new ServerNameProcessor()); goto B9b0e; C2297: $siteEntity->setUser($siteUser); goto D8ac2; bb4dc: $vhostTemplate = sprintf("\x25\x73\x25\163", $redirectionVhostTemplate, $vhostTemplate); goto ad306; D79dc: $siteEntity->setApplication($vhostTemplateEntity->getName()); goto E2ee7; b2ebc: $siteEntity->setVhostTemplate($vhostTemplate); goto Ebc3d; b34ea: d5f54: goto d2dc9; D8ac2: $siteEntity->setUserPassword($siteUserPassword); goto b4ffd; B0494: $reverseProxySite->setReverseProxyUrl($reverseProxyUrl); goto Bec0a; fa222: } public function installedWordPressSite(Request $request) : Response { goto Ad856; ac564: $response = $this->render("\x46\x72\157\x6e\164\145\156\144\57\x53\151\x74\x65\x2f\x4e\145\x77\57\167\157\x72\144\x70\x72\x65\x73\x73\x2d\151\x6e\163\x74\x61\154\x6c\145\x64\x2e\x68\164\155\x6c\x2e\x74\167\151\147", ["\x73\x69\164\145\x43\162\145\144\x65\156\164\x69\x61\154\163" => $siteCredentials]); goto bb0d2; bb0d2: return $response; goto f5984; ce463: goto c8741; goto Eaea9; c44a8: $siteCredentials = $this->renderSiteCredentials($siteCredentials); goto ac564; e9e1a: $siteCredentials = $session->get("\x73\151\x74\x65\x43\162\145\144\x65\x6e\164\151\x61\154\x73"); goto Ca608; d253c: return $response; goto A5e79; Ca608: if (false === empty($siteCredentials)) { goto b7175; } goto D5e16; Ad856: $session = $request->getSession(); goto e9e1a; f5984: c8741: goto d253c; Eaea9: b7175: goto c44a8; D5e16: $response = $this->redirect($this->generateUrl("\143\x6c\x70\137\x73\151\x74\x65\x73")); goto ce463; A5e79: } private function renderSiteCredentials(array $siteCredentials) : string { goto bb5b8; e9f6e: E8f91: goto Eefca; Eefca: return $renderedCredentials; goto D76b1; bb5b8: $renderedCredentials = ''; goto e82f3; e82f3: foreach ($siteCredentials as $section => $sectionData) { goto B3b9a; D9514: A5ff3: goto Af824; C7e00: $renderedCredentials .= PHP_EOL; goto D9514; B3b9a: $renderedCredentials .= $section . PHP_EOL; goto A2873; A2873: $renderedCredentials .= "\x2d\x2d\55\x2d\x2d\55\55\x2d\x2d\55\55\x2d\55\55\x2d\x2d\55\55\55\55\55\55\x2d\x2d\55\55\55\55\x2d\55\55\55\55\55\x2d\55\55\x2d\55\55\x2d\55\x2d\55\55\x2d\x2d\x2d\x2d\55\55\55\55\x2d" . PHP_EOL; goto B5f3d; ab879: bb0de: goto C7e00; B5f3d: foreach ($sectionData as $key => $value) { $renderedCredentials .= sprintf("\x25\x73\72\40\x25\x73", $key, $value) . PHP_EOL; Ff3a4: } goto ab879; Af824: } goto e9f6e; D76b1: } private function getVhostTemplateEntity(string $name) : mixed { goto fc552; ffc3f: throw new \Exception($this->translator->trans("\126\150\157\x73\x74\x20\124\145\x6d\x70\x6c\141\x74\x65\x20\x25\x76\150\157\163\x74\x54\x65\155\x70\154\x61\x74\145\45\x20\x64\x6f\x65\x73\x20\x6e\x6f\164\x20\x65\170\151\x73\x74\x2e", ["\x25\166\150\157\163\164\124\x65\155\160\x6c\141\x74\x65\45" => $name])); goto de395; A9fd0: if (!(true === is_null($vhostTemplateEntity))) { goto E2212; } goto ffc3f; fc552: $vhostTemplateEntity = $this->vhostTemplateEntityManager->findOneByName($name); goto A9fd0; de395: E2212: goto b5a2a; b5a2a: return $vhostTemplateEntity; goto Bb7b1; Bb7b1: } private function getConstraintViolationListErrorMessages(ConstraintViolationList $constraintViolationList) : array { goto c0d46; Cc6a3: foreach ($constraintViolationList as $constraint) { $errorMessages[] = sprintf("\45\x73\72\x20\x25\x73", $constraint->getPropertyPath(), $constraint->getMessage()); D8555: } goto b3c8f; c0d46: $errorMessages = []; goto Cc6a3; b3c8f: ea311: goto cc457; cc457: return $errorMessages; goto Cb450; Cb450: } private function generateNameFromDomainName(string $domainName) : string { goto f87bd; ee4ba: af699: goto c78c9; fb8bc: if (!(false === empty($subdomain))) { goto Fc10d; } goto d5e4a; d5e4a: $explodedSubdomain = explode("\56", $subdomain); goto F16f5; F9a24: if ("\167\167\167" == $subdomain) { goto df766; } goto Faf40; Faf40: $name = $explodedRegistrableDomain[0] ?? ''; goto fb8bc; c78c9: return $name; goto C901f; D3077: $name = $explodedRegistrableDomain[0] ?? ''; goto ee4ba; d919b: Fc10d: goto dc476; f87bd: $resolvedDomainName = $this->domainNameParser->resolveDomainName($domainName); goto B0f27; Ad315: $explodedRegistrableDomain = explode("\56", $registrableDomain); goto F9a24; B0f27: $registrableDomain = $resolvedDomainName->registrableDomain()->toString(); goto E9664; c9bfe: df766: goto D3077; dc476: goto af699; goto c9bfe; E9664: $subdomain = $resolvedDomainName->subDomain()->toString(); goto Ad315; F16f5: $name = sprintf("\45\163\x2d\x25\163", $explodedRegistrableDomain[0] ?? '', implode("\x2d", $explodedSubdomain)); goto d919b; C901f: } private function getUniqueDatabaseName(string $databaseName) : string { goto E8ca6; F2a70: $databaseConnection = new DatabaseConnection($activeDatabaseServerEntity); goto D9741; D9741: $databases = $databaseConnection->getDatabases(); goto f70bb; B9a99: $i = 0; goto D405a; A12f2: return $uniqueDatabaseName; goto B9966; Ec7da: if (!(strlen($uniqueDatabaseName) <= 3)) { goto Babab; } goto C6c02; D405a: $activeDatabaseServerEntity = $this->databaseServerEntityManager->getActiveDatabaseServer(); goto F2a70; E8ca6: $uniqueDatabaseName = $databaseName; goto Ec7da; C6c02: $uniqueDatabaseName = sprintf("\45\x73\x2d\x64\x62", $uniqueDatabaseName); goto Eeda0; f70bb: E8e59: goto b118a; A1fbb: c96de: goto d1537; f3759: f1676: goto A12f2; b118a: if (!(0 < $i)) { goto c96de; } goto efaf0; d1537: $databaseExists = in_array($uniqueDatabaseName, $databases); goto E5f7a; efaf0: $uniqueDatabaseName = sprintf("\45\x73\x2d\x25\163", $databaseName, $i); goto A1fbb; eb37d: if (true === $databaseExists) { goto E8e59; } goto f3759; E5f7a: $i++; goto eb37d; Eeda0: Babab: goto B9a99; B9966: } private function getUniqueDatabaseUserName(string $databaseUserName) : string { goto ba510; Cee3a: return $uniqueDatabaseUserName; goto d6e84; E9474: c54b9: goto Da51f; b88f1: cc158: goto c5299; Fd9a7: if (false === is_null($databaseUserEntity)) { goto c54b9; } goto de096; f806a: if (!(strlen($uniqueDatabaseUserName) <= 3)) { goto cc158; } goto Bbf62; fd9de: C31c1: goto f8e5f; f8e5f: $databaseUserEntity = $this->databaseUserEntityManager->findOneByUserName($uniqueDatabaseUserName); goto B5e8a; Bbf62: $uniqueDatabaseUserName = sprintf("\x25\163\55\x64\x62", $uniqueDatabaseUserName); goto b88f1; Da51f: if (!(0 < $i)) { goto C31c1; } goto Bbf09; Bbf09: $uniqueDatabaseUserName = sprintf("\45\163\55\45\x73", $databaseUserName, $i); goto fd9de; de096: c6fb3: goto Cee3a; c5299: $i = 0; goto E9474; ba510: $uniqueDatabaseUserName = $databaseUserName; goto f806a; B5e8a: $i++; goto Fd9a7; d6e84: } private function hasPermissions() : bool { goto F6634; f0249: if (!(UserEntity::ROLE_USER != $user->getRole())) { goto F6477; } goto Cb6e7; eaa44: F6477: goto ca00b; ca00b: return false; goto E1d97; F6634: $user = $this->getUser(); goto f0249; Cb6e7: return true; goto eaa44; E1d97: } }

Function Calls

None

Variables

None

Stats

MD5 ca42af683d3433898907549132a764cc
Eval Count 0
Decode Time 93 ms