Locking Down API Key on Self-Hosted Through Cloudron

Do you know if you install an API key, do you need to comment out the line below so that it is locked down to only users with api keys?
From the README it seems Set maximum number of requests per minute per client (outside of limits set by api keys) so I believe you need to comment out the line here, but I am not sure.

Also below LT_REQUIRE_API_KEY_ORIGIN is set to true, maybe that means the instance is already locked down to only api keys?

Here is what I have in my .env file. My question is whether I need to comment out this export LT_REQ_LIMIT=30 or anything else to eliminate any usage without the API key.

#!/bin/bash

#export LT_LANGUAGE_MODELS=en,de,ar,az,ca,zh,cs,da,nl,eo,fi,fr,el,he,hi,hu,id,ga,it,ja,ko,fa,pl,pt,ru,sk,es,sv,tr,uk

export LT_LANGUAGE_MODELS=en,de,fr,es,it

# Add custom configuration here. See https://github.com/LibreTranslate/LibreTranslate/blob/main/README.md#arguments

export LT_FRONTEND_LANGUAGE_SOURCE=es

export LT_FRONTEND_LANGUAGE_TARGET=en

export LT_API_KEYS=true

export LT_API_KEYS_DB_PATH=/app/data/db/api_keys.db

export LT_REQ_LIMIT=30

export LT_THREADS=8

# Require API key for translations. If you enable this, you have to set an API key in the web ui as well

export LT_REQUIRE_API_KEY_ORIGIN=true

To configure requirement for api key to use, set --req-limit to 0 and add the --api-keys flag. Requests made without a proper api key will be rejected.

GitHub - LibreTranslate/LibreTranslate: Free and Open Source Machine Translation API. Self-hosted, offline capable and easy to setup.

1 Like