...
Just like AWS S3, in MinIO you can set up a bucket, generate access keys, and configure access rules from the graphical client… but the client can be accessed right on http://localhost:9090 by logging in with the user and password set in the file above. Very cool!
In the MInIO console:
Create a bucket and record its name. (you You will put its this name to put into both the API & webapp
.env
file files at a later point)Set its Access Policy to “public” (under Buckets > Bucket Name)
Then create an Access Key (screenshot below) and record the key/secret key for use in the next step
...
Connecting MinIO to the LiteFarm API
...
In packages/api/.env
you will have to add one three new environment variablevariables:
Code Block |
---|
# The default minio port MINIO_ENDPOINT=http://localhost:9000 |
And change the value of two environment variables that should might already exist in your .env
(otherwise, please add them):
Code Block |
---|
# Set both of these to your MinIO bucket name PRIVATE_BUCKET_NAME=<MinIO bucket name here> PUBLIC_BUCKET_NAME=<MinIO bucket name here> |
...
The S3 configurations in digitalOceanSpaces.js
(access key, secret access key) are not used by the export server, which instead spawns a node.js child process that runs the aws-cli. (Note: you may have to download aws-cli first to complete the next step).
Set your credentials with your MinIO access key + secret directly in the terminal using
...
These changes have already been done on this branch on GitHub: https://github.com/LiteFarmOrg/LiteFarm/tree/minio
Update: April 2023: As of https://github.com/LiteFarmOrg/LiteFarm/pull/2515 these code changes are now merged into integration and live.
Update the frontend .env
(for download link only)
So that the email link actually leads to a successful download, you will want to add two variables to your frontend .env
file:
In packages/webapp/.env
` (these are both new variables):
Code Block |
---|
VITE_DEV_BUCKET_NAME=<MinIO bucket name here> VITE_DEV_ENDPOINT=localhost:9000 |
(Finally!) Running the export server
Run Have the normal LiteFarm backend already running in a separate terminal window, then run the export server in packages/api
using
...