jina verze

This commit is contained in:
2026-08-12 10:53:04 +02:00
parent f186ec26a8
commit 93d4f24f07
43 changed files with 1686 additions and 1959 deletions
+8 -18
View File
@@ -33,16 +33,16 @@ function wordpressExec() {
local domain="$1"
[[ -n "$domain" ]] || { appError "Domain not specified"; return 1; }
domain=$(domainPrepare "$domain")
shift || true
shift
openlitespeedExec wp --path="$olsPodVhostsPath/$domain/www" --allow-root --skip-plugins --skip-themes --require="$olsPodPrivatePath/$domain/bootstrap.php" --exec='error_reporting(0);define("WP_DEBUG",false);' "$@"
openlitespeedExec wp --path=/var/www/vhosts/"$domain"/www --allow-root --skip-plugins --skip-themes --require=/var/www/data/"$domain"/bootstrap.php --exec='error_reporting(0);define("WP_DEBUG",false);' "$@"
}
function wordpressSalt() {
local domain="$1"
[[ -n "$domain" ]] || { appError "Domain not specified"; return 1; }
domain=$(domainPrepare "$domain")
shift || true
shift
wordpressExec "$domain" config shuffle-salts;
}
@@ -76,7 +76,7 @@ function wordpressConfigUpdate() {
local ug bootstrapFile tmpFile
ug=$(domainToUser "$domain")
bootstrapFile="$olsPrivatePath/$domain/bootstrap.php"
bootstrapFile="$openlitespeedVhostDataPath/$domain/bootstrap.php"
tmpFile="$bootstrapFile".tmp
local databaseName databaseUser databasePass redisUser redisPass postfixUser postfixPass key
@@ -91,11 +91,6 @@ function wordpressConfigUpdate() {
[[ -n "${!key}" ]] || { appError "wordpressConfigUpdate: $key is empty"; return 1; }
done
# aliases...
local aliasList aliasFirst error
run aliasList error openlitespeedConfigVhostAliasList "$domain"
aliasFirst=$(awk 'NR==1' <<< "$aliasList")
cat > "$tmpFile" <<PHP
<?php
@@ -115,13 +110,8 @@ define('SODEW_SMTP_USER', '${postfixUser}@${postfixDefaultRealm}');
define('SODEW_SMTP_PASS', '$postfixPass');
define('SODEW_SMTP_HOST', '$postfixHost');
define('SODEW_SMTP_POSTMASTER', '$postfixPostmaster');
define('HOSTING_WP_DOMAIN', "$domain");
PHP
# adding a constant for the alias — if it exists
[[ -n "$aliasFirst" ]] && printf "define('HOSTING_WP_INTERNAL_URL', '%s');\n" "$aliasFirst" >> "$tmpFile"
chown -R -- "$ug:$ug" "$tmpFile" || { appError "Change owner of vhost data directory failed: $tmpFile"; return 1; }
chmod 600 -- "$tmpFile" || { appError "Change permissions of vhost data files failed: $tmpFile"; return 1; }
mv -f -- "$tmpFile" "$bootstrapFile" || return 1
@@ -134,7 +124,7 @@ function wordpressConfigDefine() {
domain=$(domainPrepare "$1")
domainCheck "$domain" || return 1
local configFile="$olsVhostsPath/$domain/www/wp-config.php"
local configFile="$vhostsPath/$domain/www/wp-config.php"
[[ -f "$configFile" ]] || { appError "File not found: $configFile"; return 1; }
local constants=(
@@ -173,7 +163,7 @@ function wordpressConfigRebuild() {
wordpressConfigUpdate "$domain" || return 1
local muPluginsPath ug
muPluginsPath="$olsVhostsPath/$domain/www/wp-content/mu-plugins"
muPluginsPath="$vhostsPath/$domain/www/wp-content/mu-plugins"
ug=$(domainToUser "$domain")
[[ -d "$muPluginsPath" ]] || mkdir -p -- "$muPluginsPath" || { appError "Create directory failed: $muPluginsPath"; return 1; }
@@ -288,8 +278,8 @@ function wordpressDomainUpdate() {
wordpressSearchReplace "$domain" "$rootOld" "$siteNew"
fi
if [[ -n "$abspathOld" ]]; then
printInfo "$wordpressLabel Replace in DB (6): $abspathOld --> $olsPodVhostsPath/$domain/www"
wordpressSearchReplace "$domain" "$abspathOld" "$olsPodVhostsPath/$domain/www"
printInfo "$wordpressLabel Replace in DB (6): $abspathOld --> /var/www/vhosts/$domain/www"
wordpressSearchReplace "$domain" "$abspathOld" "/var/www/vhosts/$domain/www"
fi
printInfo "$wordpressLabel Replace in DB (7): $hostOld --> $domain"