lw-ObjStor4cPanel
This is experimental for the time being
This is a custom transport script that will allow cPanel/WHM backups to be sent to Liquid Web Object Storage.
I assume the user understands the concept of access keys, secret keys, buckets, and has a bucket already set up in Object Storage.
Requirements
Only docker is required to build the RPMs for this - see instructions below.
Before installing, you must have a valid Access Key and Secret Key in Object Storage, and a valid bucket within that account.
Usage
You must already have a bucket created in Object Storage.
You must already have a valid Access Key and Secret Key (manage.liquidweb.com)
- Go clone this repository container -
https://github.com/jakdept/rpmbuild-docker.git
- Build the github CentOS6 and CentOS7 docker containers.
- To build the Cent6 RPM run the following:
docker run --rm -v $(pwd)/:/home/rpmbuild/package jakdept/rpmbuild:cent6 rpmbuild -bb SPECS/S3CompatibleMultithread.spec
- To build the Cent7 RPM run the following:
docker run --rm -v $(pwd)/:/home/rpmbuild/package jakdept/rpmbuild:cent7 rpmbuild -bb SPECS/S3CompatibleMultithread.spec
- Get your build binary from the folder
x86_64
and put it on the server.
- Install that RPM on the server.
- Go to Backup Configuration in WHM and edit the LW Object Storage destination.
- Change Remote Host to the name of the bucket you are going to use.
- Change Remote Account Username to the Access Key.
- Change Remote Password to the Secret Key.
- Backup Directory can be modified if you want to put backups in a different directory on the server. If backing multiple servers up to the same bucket, you should use different Backup Directories.
Testing
You can run some (limited) tests without a valid configuration for Liquidweb's Object Storage, however in order to run all tests you need a valid configuration. This configuration should be stored in env vars:
export PWD="/"
export ACCESSKEY="accessKey"
export SECRETKEY="secretKey"
export BUCKET="bucketName"
With this in place, and go installed, you can view test coverage with:
go test -v -coverprofile=$TMPDIR/c.out && go tool cover -html=$TMPDIR/c.out