Initial commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/.idea
|
49
.gitignore-example
Normal file
49
.gitignore-example
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# Unnecessary files ignore
|
||||||
|
*.sql
|
||||||
|
*.gz
|
||||||
|
*.log
|
||||||
|
*.old
|
||||||
|
|
||||||
|
# wp config ignore
|
||||||
|
/wp-config.php
|
||||||
|
|
||||||
|
# wp-content uploads, backups and additional ignores
|
||||||
|
/wp-content/advanced-cache.php
|
||||||
|
/wp-content/aiowps_backups
|
||||||
|
/wp-content/backup-dup-lite
|
||||||
|
/wp-content/backupwordpress-*
|
||||||
|
/wp-content/backup*
|
||||||
|
/wp-content/cache
|
||||||
|
/wp-content/logs
|
||||||
|
/wp-content/updraft
|
||||||
|
/wp-content/wp-cache-config.php
|
||||||
|
/wp-content/webp-express
|
||||||
|
/wp-content/wp-rocket-config
|
||||||
|
|
||||||
|
# Letsencrypt dir ignore
|
||||||
|
/.well-known
|
||||||
|
|
||||||
|
# duplicator plugin wp-snapshots ignore
|
||||||
|
/wp-snapshots
|
||||||
|
/dup*.txt
|
||||||
|
|
||||||
|
# webmasters confirmation files
|
||||||
|
/yandex*.html
|
||||||
|
/google*.html
|
||||||
|
|
||||||
|
# IDE ignores
|
||||||
|
/.idea
|
||||||
|
|
||||||
|
# composer root vendor dir ignore
|
||||||
|
/vendor
|
||||||
|
|
||||||
|
# Apache htaccess ignore for resolve test/prod envs
|
||||||
|
/.htaccess
|
||||||
|
|
||||||
|
# Custom ignores
|
||||||
|
/*.txt
|
||||||
|
/serap*
|
||||||
|
/wp-content/gallery
|
||||||
|
/antibot8
|
||||||
|
/.tmb
|
||||||
|
/wp-config.bak.php
|
13
nerest-quick.sh
Executable file
13
nerest-quick.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
QUICK_DIR=quick
|
||||||
|
|
||||||
|
if [[ ! -d $QUICK_DIR ]]; then
|
||||||
|
echo "Quick dir not exists: ${QUICK_DIR}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd $QUICK_DIR
|
||||||
|
|
||||||
|
find ./ -name "*.sh.example" -exec sh -c 'F={}; cp -u $F ${F%.example}' \;
|
||||||
|
|
||||||
|
find ./ -name "*.sh" -exec sh -c 'F={}; chmod +x ${F}' \;
|
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
|
2
wp-content/upgrade/.gitignore
vendored
Normal file
2
wp-content/upgrade/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
Reference in New Issue
Block a user