Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SS_DASHBOARD fix, rclone working, small fixes/changes - please check #142

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0f9ea02
Merge pull request #1 from littlebizzy/master
backamblock Jan 22, 2022
8b8daaf
pilot file explanation
backamblock Jan 22, 2022
c98f802
addition to pilot explanation
backamblock Jan 22, 2022
a212c9e
rclone
backamblock Jan 23, 2022
636a304
rclone
backamblock Jan 23, 2022
25fa3fe
rclone
backamblock Jan 23, 2022
d5553e0
rclone
backamblock Jan 23, 2022
60eea70
rclone
backamblock Jan 24, 2022
48b4e08
Merge branch 'littlebizzy:master' into master
backamblock Jan 24, 2022
34053d0
let user choose what to backup
backamblock Jan 24, 2022
e22f163
removed comment because integrated into ss-config
backamblock Jan 24, 2022
437c218
rclone command working, but need to check key "unauthorized"
backamblock Jan 24, 2022
6765e6d
not it works - application key must have both read and write access
backamblock Jan 24, 2022
a764e10
rclone works fine, additional info in ss-config
backamblock Jan 24, 2022
608d220
warnings and comments for rclone
backamblock Jan 24, 2022
2b60fbe
typo
backamblock Jan 24, 2022
288e94f
typo
backamblock Jan 24, 2022
b871a63
add missing values to ss-update-config
backamblock Jan 24, 2022
bbba8be
typo
backamblock Jan 24, 2022
a52fb4d
Update rclone-conf.txt
backamblock Jan 25, 2022
575f49e
Update ss-config-sample.txt
backamblock Jan 25, 2022
d2fa728
add --fast-list to reduce API calls by a lot
backamblock Jan 25, 2022
ba62a55
update SS_DUMP_MYSQL_FILES in ss-clean-files
backamblock Jan 25, 2022
c095899
fix staging switcher malformed URLs littlebizzy/slickstack#121
backamblock Jan 25, 2022
eab09d4
Merge branch 'littlebizzy:master' into master
backamblock Jan 25, 2022
cfdeb1f
update to reflect current ss-config.bak folder
backamblock Jan 26, 2022
f9b2705
replace SS_DASHBOARD with SS_WORDPRESS_ADMIN_DASHBOARD to make the se…
backamblock Jan 27, 2022
221a1bd
fix blacklist of mandatory plugin for german ecommerce
backamblock Jan 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bash/ss-clean-files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fi
#### SS-Clean-Files: Delete MySQL Directory Backup If Not Explicity Enabled ########################
####################################################################################################

if [[ "$SS_DUMP_MYSQL_FILES" != "true" ]]; then
if [[ "$SS_DUMP_DATABASE_FILES" != "true" ]]; then
rm /var/www/meta/mysql.bak/
fi

Expand All @@ -130,7 +130,7 @@ fi
####################################################################################################

## delete old ss-config backups ##
find /var/www/meta/ -maxdepth 1 -name "ss-config.bak*" -type f -mtime +3 -delete
find /var/www/backups/config -maxdepth 1 -name "ss-config.bak*" -type f -mtime +3 -delete

####################################################################################################
#### SS-Clean-Files: Delete Outdated + Unnecessary SlickStack Files ################################
Expand Down Expand Up @@ -575,7 +575,7 @@ find /var/www/html/ -name "*.config" -type f -delete ## ss conflicts (Nginx hack
# find /var/www/html/ -name "*.wpress" -type f -delete ## All In One Migration archives

## various delete types ##
find /var/www/html/ -name ".DS_Store*" -type f -delete ## camera files?
find /var/www/html/ -name ".DS_Store*" -type f -delete ## macOS files

## delete apache junk files ##
find /var/www/html/ -name ".htaccess*" -type f -delete ## not supported by Nginx servers (poorly coded WP plugins etc should never require .htaccess files)
Expand Down
37 changes: 28 additions & 9 deletions bash/ss-config-sample.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,30 @@ GUEST_PASSWORD="@GUEST_PASSWORD"
## RCLONE_TYPE = [b2|dropbox|etc] choose a supported rclone cloud storage provider ##
## RCLONE_MODE = [copy|sync] copy avoids data loss but complicates restores ##
## RCLONE_REMOTE_PATH = [*must be unique*] storage path on your remote service ##
## RCLONE_CLIENT_ID = [*must be unique*] might be account ID or application ID ##
## RCLONE_CLIENT_ID = [*must be unique*] might be account key ID or application key ID ##
## RCLONE_CLIENT_SECRET = [*must be unique*] might be master key or application key ##
## RCLONE_USER = [*must be unique*] some services want to know your username ##
## RCLONE_PASSWORD = [*must be unique*] some services want to know your password ##
## RCLONE_TOKEN = [*must be unique*] usually a one-time token you must generate ##

RCLONE_TYPE="b2" ## only b2 will be supported at first (not yet)
RCLONE_MODE="copy"
RCLONE_REMOTE_PATH="/websites/example.com"
RCLONE_CLIENT_ID=""
RCLONE_CLIENT_SECRET=""
## RCLONE_BACKUP_PATH = [/var/www/|/var/www/backups/] select backups subfolder when you enable SS_DUMP_FILES ##
## RCLONE_PARALLEL_TRANSFERS = [15|100|...] number of parallel transfers - more is faster ##
## about parallel transfers: 1000 on 2c VPS = 200% CPU, 500 = 120% CPU, 100 = 10% CPU ##
## WARNING: when you set parallel transfers high and have files that are big, it could crash your VPS. ##
## when you have files over 5GB, it will chunk that data to 96MB and stores them in RAM. 96MB*transfers=RAM Usage ##
## WARNING: "/var/www/" will exceed the free limit of 2500 daily Class C Transactions! 1 file/chunk makes 2 API calls ##
## "/var/www/backups/" and SS_DUMP_FILES recommended ##
## b2 Application key must have read and write permissions ##

RCLONE_TYPE="b2" ## only b2 supported for now
RCLONE_MODE="copy" ## recommended to leave "copy" and use b2 lifecycle rules
RCLONE_REMOTE_PATH="/bucketname/@SITE_DOMAIN" ## for b2, use bucketname (and then subfolder)
RCLONE_CLIENT_ID="" ## fill with b2 key ID
RCLONE_CLIENT_SECRET="" ## fill with b2 key
RCLONE_USER=""
RCLONE_PASSWORD=""
RCLONE_TOKEN=""
RCLONE_BACKUP_PATH="/var/www/"
RCLONE_PARALLEL_TRANSFERS="15" ## default 15 - recommended lower for big files

####################################################################################################
####################################################################################################
Expand All @@ -182,10 +192,18 @@ RCLONE_TOKEN=""

## SS_APP = [wordpress|mysql|magento] more options coming soon (send us your feedback) ##
## SS_LANGUAGE = [en_US|de_DE|etc] affects minor features like skip cache slugs ##
## SS_PILOT_FILE = [*must be unique*] secret Gist file for multi-server management ##

SS_APP="@SS_APP" ## only wordpress is stable
SS_LANGUAGE="@SS_LANGUAGE" ## en_US best supported currently

## SS_PILOT_FILE = [*must be unique*] secret Gist file for multi-server management ##
## in the pilot file you can enter all variable of ss-config that you want to change ##
## check the current version of ss-worker.txt on github to see what variables are already implemented ##
## enter them VARIABLE_NAME="variable value" like seen here, one in each line ##
## paste the full URL to your secret gist in this config or during the install ##
## your ss-config will be updated on every ss-worker run (see the interval settings section below) ##
## some updated settings may only be used when running ss-update or other specialized ss functions ##

SS_PILOT_FILE="@SS_PILOT_FILE"

## SS_DATABASE_REMOTE = [false|true] skips MySQL install if true (remote database) ##
Expand Down Expand Up @@ -627,6 +645,7 @@ SS_INSTALL_WORDPRESS_CORE_CLEANUP_OPTIONS="true"
## disable any given task by setting interval to random string (e.g. never) ##

## [often|regular|quarter-hourly|half-hourly|hourly|quarter-daily|half-daily|daily|half-weekly|weekly|half-monthly|monthly|sometimes] ##
## often = 2min, regular = 5min, sometimes = 2months

## INTERVAL_SS_CHECK = [often|regular|quarter-hourly|half-hourly|hourly] ##
## INTERVAL_SS_CLEAN_DATABASE = [hourly|quarter-daily|half-daily|daily|half-weekly|weekly] ##
Expand Down Expand Up @@ -715,7 +734,7 @@ INTERVAL_SS_PURGE_OPCACHE="never" ## default = never
INTERVAL_SS_PURGE_REDIS="never" ## default = never
INTERVAL_SS_PURGE_TRANSIENTS="never" ## default = never
INTERVAL_SS_REBOOT_MACHINE="never" ## default = never
INTERVAL_SS_REMOTE_BACKUP="never" ## default = never (not functional yet)
INTERVAL_SS_REMOTE_BACKUP="never" ## default = never
INTERVAL_SS_RESET_PASSWORD_SFTP="never" ## default = never
INTERVAL_SS_RESTART_MYSQL="never" ## default = never
INTERVAL_SS_RESTART_NGINX="never" ## default = never
Expand Down
6 changes: 3 additions & 3 deletions bash/ss-install-wordpress-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ rm "$TMP_WORDPRESS_CONFIG_DEV"
wget -O "$TMP_SS_CONSTANTS_PHP" "$MIRROR_SS_CONSTANTS_PHP"

## set SlickStack dashboard ##
if [[ -z "$SS_DASHBOARD" ]]; then
sed -i "s/@SS_DASHBOARD/true/g" "$TMP_SS_CONSTANTS_PHP"
if [[ -z "$SS_WORDPRESS_ADMIN_DASHBOARD" ]]; then
sed -i "s/@SS_WORDPRESS_ADMIN_DASHBOARD/true/g" "$TMP_SS_CONSTANTS_PHP"
else
sed -i "s/@SS_DASHBOARD/${SS_DASHBOARD}/g" "$TMP_SS_CONSTANTS_PHP"
sed -i "s/@SS_WORDPRESS_ADMIN_DASHBOARD/${SS_WORDPRESS_ADMIN_DASHBOARD}/g" "$TMP_SS_CONSTANTS_PHP"
fi

SYSTEM_SERVER_SOFTWARE=$(nginx -v |& sed 's#nginx version: nginx/##')
Expand Down
8 changes: 6 additions & 2 deletions bash/ss-remote-backup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ sleep "$SLEEP_MESSAGE_BEGIN"
## this will copy/sync the entire SlickStack directory structure to your remote cloud ##
## we hardcode the local path and cloud service nickname for stability reasons ##

rclone "$RCLONE_MODE" --transfers 15 --retries 5 "/var/www/" "slickstack:${RCLONE_REMOTE_PATH}"
# tell rclone to use slickstack rclone.conf
RCLONE_CONFIG="/var/www/meta/rclone.conf"
export RCLONE_CONFIG

## consider changing to "slickstack:/websites/${SITE_DOMAIN}"
rclone "${RCLONE_MODE}" "${RCLONE_BACKUP_PATH}" "slickstack:${RCLONE_REMOTE_PATH}" --transfers "${RCLONE_PARALLEL_TRANSFERS}" --retries 5 --fast-list

####################################################################################################
#### SS-Remote-Backup: Touch Timestamp File (End Script) ###########################################
Expand Down Expand Up @@ -76,5 +78,7 @@ touch "$TIMESTAMP_SS_REMOTE_BACKUP"
## Ref: https://medium.com/@mormesher/building-your-own-linux-cloud-backup-system-75750f47d550
## Ref: https://www.reddit.com/r/DataHoarder/comments/bb259k/backups_with_borg_rclone_gdrive/
## Ref: https://www.reddit.com/r/unRAID/comments/e6l4x6/tutorial_borg_rclone_v2_the_best_method_to/
## Ref: https://forum.rclone.org/t/rclone-config-different-path/4672/5
## Ref: https://linuxpip.org/rclone-examples/#Use_rclone_to_copy_the_whole_directoryfolder_including_directory_structure_and_contents

## SS_EOF
7 changes: 7 additions & 0 deletions bash/ss-update-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ if [[ -n "$RCLONE_TOKEN" ]]; then
sed -i "s|\(^RCLONE_TOKEN=\).*|RCLONE_TOKEN=\"$RCLONE_TOKEN\"|g" "$TMP_SS_CONFIG"
fi

if [[ -n "$RCLONE_BACKUP_PATH" ]]; then
sed -i "s|\(^RCLONE_BACKUP_PATH=\).*|RCLONE_BACKUP_PATH=\"$RCLONE_BACKUP_PATH\"|g" "$TMP_SS_CONFIG"
fi

if [[ -n "$RCLONE_PARALLEL_TRANSFERS" ]]; then
sed -i "s|\(^RCLONE_PARALLEL_TRANSFERS=\).*|RCLONE_PARALLEL_TRANSFERS=\"$RCLONE_PARALLEL_TRANSFERS\"|g" "$TMP_SS_CONFIG"
fi


## copy over general slickstack settings ##
Expand Down
6 changes: 3 additions & 3 deletions bash/ss-worker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ if [[ -z "$VALIDATE3_TMP_SS_CONSTANTS_PHP" ]]; then
fi

## set SlickStack dashboard ##
if [[ -z "$SS_DASHBOARD" ]]; then
sed -i "s/@SS_DASHBOARD/true/g" "$TMP_SS_CONSTANTS_PHP"
if [[ -z "$SS_WORDPRESS_ADMIN_DASHBOARD" ]]; then
sed -i "s/@SS_WORDPRESS_ADMIN_DASHBOARD/true/g" "$TMP_SS_CONSTANTS_PHP"
else
sed -i "s/@SS_DASHBOARD/${SS_WORDPRESS_ADMIN_DASHBOARD}/g" "$TMP_SS_CONSTANTS_PHP"
sed -i "s/@SS_WORDPRESS_ADMIN_DASHBOARD/${SS_WORDPRESS_ADMIN_DASHBOARD}/g" "$TMP_SS_CONSTANTS_PHP"
fi

SYSTEM_SERVER_SOFTWARE=$(nginx -v |& sed 's#nginx version: nginx/##')
Expand Down
1 change: 0 additions & 1 deletion crons/08-cron-daily.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ if [[ "$INTERVAL_SS_REMOTE_BACKUP" == "daily" ]]; then
source "$PATH_SS_REMOTE_BACKUP"
fi


## run ss-restart-mysql if set to daily ##
if [[ "$INTERVAL_SS_RESTART_MYSQL" == "daily" ]]; then
source "$PATH_SS_RESTART_MYSQL"
Expand Down
2 changes: 1 addition & 1 deletion modules/php-fpm/ss-constants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// ss general
define( 'SS_BUILD', '@SS_BUILD' );
define( 'SS_DASHBOARD', @SS_DASHBOARD ); // boolean
define( 'SS_WORDPRESS_ADMIN_DASHBOARD', @SS_WORDPRESS_ADMIN_DASHBOARD ); // boolean
define( 'SS_WORDPRESS_PLUGIN_BLACKLIST', @SS_WORDPRESS_PLUGIN_BLACKLIST ); // boolean
define( 'SS_WORDPRESS_PLUGIN_BLACKLIST_SOURCE', '@SS_WORDPRESS_PLUGIN_BLACKLIST_SOURCE' );

Expand Down
3 changes: 2 additions & 1 deletion modules/rclone/rclone-conf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ type = @RCLONE_TYPE
account = @RCLONE_CLIENT_ID
key = @RCLONE_CLIENT_SECRET
hard_delete = false
versions = false
versions = false ## leave disabled
upload_cutoff = 5G ## to minimize API calls on b2

## other
user = @RCLONE_USER
Expand Down
2 changes: 1 addition & 1 deletion modules/wordpress/blacklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,7 @@ truconversion-connect ;; utility
update-theme-and-plugins-from-zip-file ;; import/export
users-customers-import-export-for-wp-woocommerce ;; import/export (By WebToffee)
vc-templates-import-export ;; import/export
vendidero-helper
;; vendidero-helper ;; vendor updates (germanized pro for woocommerce vendidero.de)
;; video-user-manuals ;; utility
what-the-file ;; utility
widget-importer-exporter ;; import/export
Expand Down
4 changes: 3 additions & 1 deletion modules/wordpress/mu-plugins/xxx-common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function ss_admin_notices_staging() {
/** there are no SQL queries and settings are controlled by PHP defined constants */

function ss_menu() {
if (defined('SS_DASHBOARD') && (SS_DASHBOARD == false) ) {
if (defined('SS_WORDPRESS_ADMIN_DASHBOARD') && (SS_WORDPRESS_ADMIN_DASHBOARD == false) ) {
// do nothing
}
else {
Expand Down Expand Up @@ -555,6 +555,8 @@ function ss_environment_menu($admin_bar) {
$current_user = wp_get_current_user();

$ss_production_link = home_url( $path = '', $scheme = 'https' );
$ss_production_link = str_replace('staging.', '', $ss_production_link);
$ss_production_link = str_replace('dev.', '', $ss_production_link);

$ss_staging_link = str_replace('https://', 'https://staging.', $ss_production_link);
$ss_staging_link_fixed = str_replace('www.', '', $ss_staging_link);
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ UPDATE: we have temporarily removed the swapfile check function and will try to

* **NEW!** WordPress Core will now be reinstalled automatically every 2 months as per the default "sometimes" cron job... modify this schedule in `ss-config` by use ing the `SS_INTERVAL_INSTALL_WORDPRESS_CORE` variable (or disable it completely). We will continue to add more interval schedules so that every core SS script can be set to automatically run on any of our 12 core cron job schedules!

* **NEW!** We are experimenting with a new "dashboard" that lets admin-level WOrdPress users easily review their SlickStack related settings... if you want to disable this new feature for now, you can run `ss-update` to get the latest boilerplate then set `SS_DASHBOARD` to "false" in `ss-config` then run `ss-install-wordpress-config` again and the feature should then disappear.
* **NEW!** We are experimenting with a new "dashboard" that lets admin-level WOrdPress users easily review their SlickStack related settings... if you want to disable this new feature for now, you can run `ss-update` to get the latest boilerplate then set `SS_WORDPRESS_ADMIN_DASHBOARD` to "false" in `ss-config` then run `ss-install-wordpress-config` again and the feature should then disappear.

* **NEW!** There is now an interactive Bash wizard when you run `ss-install` on SlickStack servers (new servers) that don't yet have `ss-config` files. This helps admins save time in setting up new LEMP stacks by simply running thru a few options using the wizard and proceeding with the installation process without having to spend any time configuring the `ss-config` file manually as was previously required. This wizard now also has "defaults" for all prompts, meaning that for most options you can simply hit the ENTER key (besides critical fields like `SITE_DOMAIN` or `SITE_TLD` and so forth, which always require unique values to be input).

Expand Down