Back

[CLOSED] How to use different Storage providers for functions?

  • 0
  • Self Hosted
  • Storage
Felipe Amaral
24 Jul, 2023, 15:46

Im using S3 as Appwrite Self-Hosted Storage, and now all builds are there. Can i use S3 only for Upload Files Buckets, and keep Builds and Functions locally?

TL;DR
The user wants to use different storage providers for different purposes: S3 for storage/uploads, and local storage for builds and deploys. It is stated that this may not be possible with Appwrite's current setup. The suggested solution is to customize the `init.php` file to modify the logic of the `getDevice` function. However, a possible workaround is provided: setting `_APP_STORAGE_DEVICE` as `s3` in the Appwrite configuration and filling in the S3 fields. This will allow S3 to be used for storage/uploads, as well as for functions builds and deploys. The cache, config, and certificates
Binyamin
24 Jul, 2023, 15:56

First, you can use S3 for Appwrite by setting _APP_STORAGE_DEVICE as s3 and filling all the S3 fields

TypeScript
_APP_STORAGE_DEVICE=s3
_APP_STORAGE_S3_ACCESS_KEY=
_APP_STORAGE_S3_SECRET=
_APP_STORAGE_S3_REGION=us-east-1
_APP_STORAGE_S3_BUCKET=

Second, this will be in use for:

  • Storage / Uploads
  • Functions builds
  • Functions deploys

The cache (half-way) & config & certificates will remain local

Felipe Amaral
24 Jul, 2023, 16:11

Can i split like this?

  • Storage / Uploads - Local
  • Functions builds - S3
  • Functions deploys - S3
Binyamin
24 Jul, 2023, 16:13

It won't work 😦

You can see here that Appwrite is getting the device for each of those three here using the getDevice function https://github.com/appwrite/appwrite/blob/master/app/init.php#L976-L986

That function is declared here https://github.com/appwrite/appwrite/blob/master/app/init.php#L988 And you can see that all called to this device will be treated the same.

If you want to avoid this you'll need to customize the init.php file of your Appwrite container changing the logic of getDevice function.

Felipe Amaral
24 Jul, 2023, 16:14

TY .. Close

Binyamin
24 Jul, 2023, 16:14

This can be a possible feature request

Drake
24 Jul, 2023, 16:56

[CLOSED] How to use different Storage providers for functions?

hamed
24 Jul, 2023, 18:08

Sorry, guys. I know this has already been closed. @Felipe Amaral may I ask why you want to do that?

Felipe Amaral
24 Jul, 2023, 18:48

Hello @hamed! I would like to know if i could separete store: builds and deploys in S3, and upload files (videos, pictures, docs, pdf) localy.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more