Initial commit
This commit is contained in:
1
quick/.gitignore
vendored
Normal file
1
quick/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.sh
|
25
quick/create-config.sh.example
Normal file
25
quick/create-config.sh.example
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
. "${SCRIPT_DIR}/settings.sh" || {
|
||||
echo "no settings" && exit 1
|
||||
}
|
||||
|
||||
wp core config --dbname=$PROJECT_NAME --dbuser=$PROJECT_NAME --dbpass=$PROJECT_NAME --dbhost=db --dbprefix=$TABLE_PREFIX
|
||||
|
||||
sed -i 's/<?php//' "${PROJECT_WEB_ROOT}/wp-config.php"
|
||||
|
||||
cat << \EOF | cat - "${PROJECT_WEB_ROOT}/wp-config.php" > /tmp/out && mv /tmp/out "${PROJECT_WEB_ROOT}/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
|
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
wp plugin deactivate really-simple-ssl
|
15
quick/local/replace-domain.sh.example
Normal file
15
quick/local/replace-domain.sh.example
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
. "${SCRIPT_DIR}/../settings.sh" || {
|
||||
echo "no settings" && exit 1
|
||||
}
|
||||
|
||||
TABLE_WP_OPTIONS="${TABLE_PREFIX}options"
|
||||
TABLE_WP_POSTS="${TABLE_PREFIX}posts"
|
||||
TABLE_WP_POSTMETA="${TABLE_PREFIX}postmeta"
|
||||
|
||||
wp search-replace "https://${PROD_DOMAIN}" "http://${LOCAL_DOMAIN}" ${TABLE_WP_OPTIONS} ${TABLE_WP_POSTS} ${TABLE_WP_POSTMETA} --report-changed-only=true
|
||||
wp search-replace "https:\/\/${PROD_DOMAIN}" "http:\/\/${LOCAL_DOMAIN}" ${TABLE_WP_OPTIONS} ${TABLE_WP_POSTS} ${TABLE_WP_POSTMETA} --report-changed-only=true
|
||||
|
||||
wp search-replace "${PROD_DOMAIN}" "${LOCAL_DOMAIN}" ${TABLE_WP_OPTIONS} ${TABLE_WP_POSTS} ${TABLE_WP_POSTMETA} --report-changed-only=true
|
20
quick/restore-perms.sh.example
Normal file
20
quick/restore-perms.sh.example
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
WP_CONTENT_DIRS=(
|
||||
plugins
|
||||
upgrade
|
||||
uploads
|
||||
)
|
||||
|
||||
export WEB_GID=33
|
||||
|
||||
perms() {
|
||||
sudo chown -R $UID:$WEB_GID "$1"
|
||||
find "$1" -type d -exec chmod g+rwx '{}' \;
|
||||
find "$1" -type f -exec chmod g+rw '{}' \;
|
||||
}
|
||||
|
||||
for DIR in "${WP_CONTENT_DIRS[@]}"; do
|
||||
perms "$SCRIPT_DIR/../wp-content/$DIR"
|
||||
done
|
10
quick/settings.sh.example
Executable file
10
quick/settings.sh.example
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
export PROJECT_NAME=wpstudio
|
||||
export PROJECT_WEB_ROOT="${SCRIPT_DIR}/.."
|
||||
|
||||
export TABLE_PREFIX="wp_"
|
||||
|
||||
export PROD_DOMAIN=wpstudio.ru
|
||||
export LOCAL_DOMAIN=wpstudio.local.wpstudio.ru
|
Reference in New Issue
Block a user