From 4316f0c03642460a11ab02131de71b07658ef608 Mon Sep 17 00:00:00 2001 From: Denny Cave Date: Sat, 22 Jul 2023 23:37:33 -0500 Subject: [PATCH] v1 --- manifest.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ standalone.yml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 manifest.yml create mode 100644 standalone.yml diff --git a/manifest.yml b/manifest.yml new file mode 100644 index 0000000..43ad86a --- /dev/null +++ b/manifest.yml @@ -0,0 +1,50 @@ +type: update +id: s3storage +name: S3 Storage Backend (Beta) +description: Mount any S3-compatible storage backend to your application node(s) for unlimited remote file storage with native performance. +envName: ${settings.envName} + +settings: + fields: + - type: string + caption: Access Key + name: accessKey + placeholder: Your bucket storage access key + required: true + - type: string + caption: Secret Key + name: secretKey + placeholder: Your bucket storage secret key + required: true + - type: string + caption: Bucket Endpoint + name: bucketEndpoint + placeholder: e.g. https://bucketname.s3.us-east-2.amazonaws.com + required: true + - type: string + caption: Bucket Folder + name: bucketFolder + placeholder: The folder within the bucket where files should be stored + default: uploads + required: true + - type: string + caption: Mount Point + name: mountPoint + default: /var/www/webroot/ROOT/wp-content/uploads + placeholder: The full path to the folder where you want the storage backend mounted + +onInstall: + #on master node + - cmd [cp]: |- + curl -sSL https://d.juicefs.com/install | sh - + cp /usr/local/bin/juicefs /sbin/mount.juicefs + echo "sqlite3:///var/www/webroot/s3storage.db ${settings.mountPoint} juicefs _netdev 0 0" >> /etc/fstab + user: root + + - cmd[${nodes.cp.master.id}]: + juicefs format --storage s3 --bucket ${settings.bucketEndpoint} --access-key ${settings.accessKey} --secret-key ${settings.secretKey} sqlite3:///var/www/webroot/s3storage.db ${settings.bucketFolder} + user: root + + - api [cp]: environment.control.RestartNodes + + # will storing in /var/webroot/ROOT be enough to store this on the distributed filesystem (glusterfs) in clusters? Or does need stored in different directory to ensure it's shared? \ No newline at end of file diff --git a/standalone.yml b/standalone.yml new file mode 100644 index 0000000..09d9f0c --- /dev/null +++ b/standalone.yml @@ -0,0 +1,47 @@ +type: update +id: s3storage +name: S3 Storage Backend - Standalone (Beta) +description: Mount a S3-compatible storage backend to your application node for native remote file offloading. +envName: ${settings.envName} + +targetNodes: + nodeGroup: cp + +settings: + fields: + - type: string + caption: Access Key + name: accessKey + placeholder: Your bucket storage access key + required: true + - type: string + caption: Secret Key + name: secretKey + placeholder: Your bucket storage secret key + required: true + - type: string + caption: Bucket Endpoint + name: bucketEndpoint + placeholder: e.g. https://bucketname.s3.us-east-2.amazonaws.com + required: true + - type: string + caption: Bucket Folder + name: bucketFolder + placeholder: The folder within the bucket where files should be stored + default: uploads + required: true + - type: string + caption: Mount Point + name: mountPoint + default: /var/www/webroot/ROOT/wp-content/uploads + placeholder: The full path to the folder where you want the storage backend mounted + +onInstall: + - cmd [cp]: |- + curl -sSL https://d.juicefs.com/install | sh - + cp /usr/local/bin/juicefs /sbin/mount.juicefs + echo "sqlite3:///var/www/webroot/s3storage.db ${settings.mountPoint} juicefs _netdev 0 0" >> /etc/fstab + juicefs format --storage s3 --bucket ${settings.bucketEndpoint} --access-key ${settings.accessKey} --secret-key ${settings.secretKey} sqlite3:///var/www/webroot/s3storage.db ${settings.bucketFolder} + user: root + + - api [cp]: environment.control.RestartNodes \ No newline at end of file