From b8c593ef883627e078cd2375dd68b886b1aa2577 Mon Sep 17 00:00:00 2001 From: Stephen J Carnam Date: Sun, 5 Nov 2023 12:09:08 -0800 Subject: [PATCH] rebrand --- vscode.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/vscode.php b/vscode.php index 94a83dd..4b5bc13 100644 --- a/vscode.php +++ b/vscode.php @@ -18,7 +18,7 @@ class VSCode { public function __construct() { global $hcpp; $hcpp->webdav = $this; - $hcpp->add_action( 'cg_pws_generate_website_cert', [ $this, 'cg_pws_generate_website_cert' ] ); + $hcpp->add_action( 'dev_pw_generate_website_cert', [ $this, 'dev_pw_generate_website_cert' ] ); $hcpp->add_action( 'post_change_user_shell', [ $this, 'post_change_user_shell' ] ); $hcpp->add_action( 'hcpp_invoke_plugin', [ $this, 'hcpp_invoke_plugin' ] ); $hcpp->add_action( 'post_delete_user', [ $this, 'post_delete_user' ] ); @@ -61,16 +61,16 @@ public function hcpp_plugin_enabled( $plugin ) { } // Intercept the certificate generation and copy over ssl certs for the vscode domain. - public function cg_pws_generate_website_cert( $cmd ) { - if ( strpos( $cmd, '/vscode-' ) !== false && strpos( $cmd, '/cg_pws_ssl && ') !== false ) { + public function dev_pw_generate_website_cert( $cmd ) { + if ( strpos( $cmd, '/vscode-' ) !== false && strpos( $cmd, '/dev_pw_ssl && ') !== false ) { // Omit the v-delete-web-domain-ssl, v-add-web-domain-ssl, and v-add-web-domain-ssl-force cmds. global $hcpp; $path = $hcpp->delLeftMost( $cmd, '/usr/local/hestia/bin/v-add-web-domain-ssl' ); $path = '/home' . $hcpp->delLeftMost( $path, '/home' ); - $path = $hcpp->delRightMost( $path, '/cg_pws_ssl &&' ); + $path = $hcpp->delRightMost( $path, '/dev_pw_ssl &&' ); $cmd = $hcpp->delRightMost( $cmd, '/usr/local/hestia/bin/v-delete-web-domain-ssl ' ); - $cmd .= " mkdir -p $path/ssl ; cp -r $path/cg_pws_ssl/* $path/ssl "; + $cmd .= " mkdir -p $path/ssl ; cp -r $path/dev_pw_ssl/* $path/ssl "; $cmd = $hcpp->do_action( 'vscode_generate_website_cert', $cmd ); } return $cmd; @@ -208,8 +208,8 @@ public function setup( $user ) { $content ); - // Uncomment basic auth for non-Personal Web Server edition. - if ( !property_exists( $hcpp, 'cg_pws' ) ) { + // Uncomment basic auth for non-Devstia Preview edition. + if ( !property_exists( $hcpp, 'dev_pw' ) ) { $content = str_replace( "#auth_basic", "auth_basic", $content ); } file_put_contents( $conf, $content ); @@ -223,20 +223,20 @@ public function setup( $user ) { $content ); - // Uncomment basic auth on SSL for non-Personal Web Server edition. - if ( !property_exists( $hcpp, 'cg_pws' ) ) { + // Uncomment basic auth on SSL for non-Devstia Preview edition. + if ( !property_exists( $hcpp, 'dev_pw' ) ) { $content = str_replace( "#auth_basic", "auth_basic", $content ); } file_put_contents( $ssl_conf, $content ); - // Generate website cert if it doesn't exist for Personal Web Server edition. - if ( property_exists( $hcpp, 'cg_pws' ) ) { + // Generate website cert if it doesn't exist for Devstia Preview edition. + if ( property_exists( $hcpp, 'dev_pw' ) ) { // Always regenerate the cert to ensure it's up to date. - $hcpp->cg_pws->generate_website_cert( $user, ["vscode-$user.$domain"] ); + $hcpp->dev_pw->generate_website_cert( $user, ["vscode-$user.$domain"] ); }else{ - // Force SSL on non-Personal Web Server edition. + // Force SSL on non-Devstia Preview edition. $force_ssl_conf = "/home/$user/conf/web/vscode-$user.$domain/nginx.forcessl.conf"; $content = "return 301 https://\$host\$request_uri;"; file_put_contents( $force_ssl_conf, $content );