JhumanJ / OpnForm

Beautiful Open-Source Form Builder
https://opnform.com
GNU Affero General Public License v3.0
1.93k stars 267 forks source link

Storage and AWS .Env #419

Closed 4m0ses closed 3 months ago

4m0ses commented 3 months ago

Hey everyone,

I'm currently working on setting up a Docker Compose file and planning to create a video tutorial to guide others through the process. However, I've encountered an issue.

I've stored my AWS credentials in the .env file, but when attempting to upload an image, I'm receiving an error stating that it can't find the credentials. Does this require AWS CLI to be installed and the configuration file to be properly set up?

Can we change the storage to local or can we change to storj

The error message I'm seeing indicates that there's an issue with missing environment variables: AWS_BUCKET, AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY. This likely means that the application is unable to access these variables, causing the upload process to fail.

I'll continue investigating to determine the exact cause of the issue and will provide updates as I make progress. If anyone has encountered a similar issue or has suggestions on how to resolve it, please feel free to share your insights.

Thanks!

Error: 172.22.0.1 - - [22/May/2024:20:02:10 +0000] "POST /api/vapor/signed-storage-url HTTP/1.0" 500 33 "https://forms.youthpwr.org/forms/my-form-j6xuxw/edit" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36" opnform | [22-May-2024 20:02:10 UTC] [2024-05-22 20:02:10] local.DEBUG: Un-handled Exception: Unable to issue signed URL. Missing environment variables: AWS_BUCKET, AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY {"exception":"[object] (InvalidArgumentException(code: 0): Unable to issue signed URL. Missing environment variables: AWS_BUCKET, AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY at /app/vendor/laravel/vapor-core/src/Http/Controllers/SignedStorageUrlController.php:109)

JhumanJ commented 3 months ago

Hi there, looking forward to seeing your video! What .env file did you change? It needs to be the back-end Laravel .env file (check how to configure it in docker here). In our curent Docker setup we use local storage - you can check in php-fpm-wrapper.sh. If you're going to do it with docker compose, then the best option probably is to use minio for file storage, which is comptabile with s3. Here's a laravel tutorial on how to use s3 with Laravel.

4m0ses commented 3 months ago

I used both .env files - .env.docker and .env.example. and this is because i encounted an issue where i needed the

NUXT_PUBLIC_APP_URL=/ NUXT_PUBLIC_API_BASE=/api NUXT_PRIVATE_API_BASE=http://localhost/api

As the share url was not showing the base url, for example it would come with /form/23h2 and not example.com/form/3232jh without the NUXT_PUBLIC_APP_URL=/.

When i docker exec into the container and echo AWS creds i could see it comes through but still was not being picked up. I will check out the video and see if i can crack it.

Also any way to prevent sign-ups and should be by invite only

JhumanJ commented 3 months ago

Hi there any update from you on this? We'll change the docker setup soon so I'll resolve this for now. We'll also work on the invite-only mode soon!