WPCloudDeploy / wp-cloud-deploy

WPCloudDeploy is a WordPress plugin that allows you to easily deploy and manage your own dedicated high-performance WordPress servers and sites at any cloud server provider.
https://wpclouddeploy.com
Other
91 stars 42 forks source link

Support for Custom S3 Endpoints #60

Closed batonac closed 2 years ago

batonac commented 2 years ago

Enabling custom S3 Endpoints in the standard backup scripts/configurations opens up the door to a slew of new providers beyond Amazon AWS S3.

These changes were specifically tested with the Backblaze S3 storage API, and confirmed to work, at least as far as creating a backup is concerned.

I'm still a bit fuzzy on the correlation between local backups and remote backup in the restore function, so that might need a bit more work.

I also may have been a bit too generous with where all the new s3_endpoint variable is being included, as it's not relevant to save it to the local server credentials file, at the moment anyway. This might be relevant if paired with a solution such as https://github.com/wbingli/awscli-plugin-endpoint in the future, but I opted to use the aws-cli --endpoint-url= parameter for now.

elindydotcom commented 2 years ago

Started testing this. The biggest issue I see is that the schedule FULL BACKUP option and the schedule SITE BACKUP option doesn't respect the endpoint. This is in the 08-backup.txt bash script (option 5 and 3).

Otherwise, the basic tests passed and did not seem to break the native AWS backup.

I tested against a digitalocean spaces bucket instead of a backblaze account to make sure there wasn't anything backblaze specific in the code.

batonac commented 2 years ago

okay, I added the endpoint-url option to the sync commands as well. I think that explains some of the confusion I was having with the remote backup functionality. thanks for catching that.

elindydotcom commented 2 years ago

It looks like the endpoint was added to the missing areas but the actually endpoint parameter isn't being included in the configuration files that the the cron process reads when the linux cron triggers the backup script.

I think maybe we'll go ahead and merge this in and then handle that since you did most of the work already.