47 lines
1.6 KiB
YAML
47 lines
1.6 KiB
YAML
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 |