...
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 , noting its nameand record its name. (You will put this name into both the API & webapp
.env
files at a later point)Set its access policy Access Policy to “public” (under Buckets > Bucket Name)
Then create an access key (screenshot below) Access Key and record the key/secret key for use in the next step
...
Connecting MinIO to the LiteFarm API
For running the export server, the only necessary changes to your API .env
file are adding your bucket name and the MinIO endpoint:
In packages/api/.env
you will have to add three new environment variables:
Code Block |
---|
# The default minio port MINIO_ENDPOINT=http://localhost:9000 |
And change the value of two environment variables that might already exist in your .env
(otherwise, please add them):
Code Block |
---|
# Set #both Setof asthese into theyour MinIO bucket name client 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 aws-cli credentials 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
...