Files
autodeploy/wp/create-config.sh.example
2022-02-26 16:46:50 +03:00

23 lines
567 B
Bash

#!/bin/bash
NAME=invatur
wp core config --dbname=$NAME --dbuser=$NAME --dbpass=$NAME --dbhost=db
sed -i 's/<?php//' wp-config.php
cat << \EOF | cat - wp-config.php > /tmp/out && mv /tmp/out wp-config.php
<?php
if (@$_SERVER['HTTP_HOST']) {
define('WP_SITEURL', 'http://'.$_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://'.$_SERVER['HTTP_HOST']);
}
//if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
// $_SERVER['HTTPS'] = 'on';
// $_SERVER['SERVER_PORT'] = 443;
//}
define('FS_METHOD', 'direct');
EOF
#wp plugin deactivate wp-force-https