diff --git a/Config/LibreTranslate/README.md b/Config/LibreTranslate/README.md index 99eb4b7..96504fe 100644 --- a/Config/LibreTranslate/README.md +++ b/Config/LibreTranslate/README.md @@ -1,8 +1,8 @@ -# LibreTranslate Configuration +# Libreranslate Configuration ## Install -1. Copy `env.example` to `.env` and adjust the values as necessary. +0. Copy `env.example` to `.env` and adjust the values as necessary. ``` cd $DOCKER_HOME/Config/LibreTranslate @@ -16,14 +16,14 @@ vi .env ./prep.sh ``` -1. If using a temporary location for `models/` such as `/tmp/`, ensure -that `prep.sh` is in `root`'s crontab. +2. If using a temporary location for `models/` such as `/tmp/`, ensure +that the reboot script is in `root`'s crontab to set the folders back up. ``` -@reboot /opt/Docker/Config/LibreTranslate/prep.sh +@reboot /opt/Docker/Config/LibreTranslate/cron-reboot.sh ``` -1. Start the container up as normal. +3. Start the container up as normal. ``` cp docker-compose.main.yml docker-compose.yml diff --git a/Config/LibreTranslate/cron-reboot.sh b/Config/LibreTranslate/cron-reboot.sh new file mode 100755 index 0000000..e454e97 --- /dev/null +++ b/Config/LibreTranslate/cron-reboot.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# 2025-07-26 Hyperling +# Ensure the LibreTranslate container starts correctly after a reboot, especially if placing models/ under /tmp/. + +## Setup ## + +DIR="$(dirname -- "${BASH_SOURCE[0]}")" +cd $DIR +source .env + +## Main ## + +# Shutdown the container. +docker compose down + +# Create folders. +prep.sh + +# Start the container. +docker compose up -d + +# Finish successfully. +exit 0 diff --git a/Config/LibreTranslate/env.example b/Config/LibreTranslate/env.example index 099ebf0..2f13ec2 100644 --- a/Config/LibreTranslate/env.example +++ b/Config/LibreTranslate/env.example @@ -12,10 +12,6 @@ COMPOSE_BAKE=true CPU=2.00 RAM=4.0G -# How much the users are able to utilize the server. -REQUESTS=100 -CHARACTERS=2000 - ### Languages ### ## Check for language model updates on each run. @@ -45,6 +41,5 @@ MODELS_DIR=../../Volumes/LibreTranslate/models ## Storing them in /tmp/ will cause them to get reset after reboots, but hides ## them from backup type locations such as Volumes/LibreTranslate/ and /var/. -## This will require a CRON entry for prepping the project dirs after a reboot. -## `@reboot /opt/Docker/Config/LibreTranslate/prep.sh` +## Please see the README for the CRON command related to this setting. # MODELS_DIR=/tmp/LibreTranslate/models