Skip to content

Commit b5ea5a9

Browse files
committed
dev: rename database driver environmental variable
from: `TORRUST_TRACKER_DATABASE` to: `TORRUST_TRACKER_DATABASE_DRIVER`
1 parent 9388dcb commit b5ea5a9

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

Containerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ RUN ["/busybox/cp", "-sp", "/busybox/sh","/busybox/cat","/busybox/ls","/busybox/
9696
COPY --from=gcc --chmod=0555 /usr/local/bin/su-exec /bin/su-exec
9797

9898
ARG TORRUST_TRACKER_PATH_CONFIG="/etc/torrust/tracker/tracker.toml"
99-
ARG TORRUST_TRACKER_DATABASE="sqlite3"
99+
ARG TORRUST_TRACKER_DATABASE_DRIVER="sqlite3"
100100
ARG USER_ID=1000
101101
ARG UDP_PORT=6969
102102
ARG HTTP_PORT=7070
103103
ARG API_PORT=1212
104104

105105
ENV TORRUST_TRACKER_PATH_CONFIG=${TORRUST_TRACKER_PATH_CONFIG}
106-
ENV TORRUST_TRACKER_DATABASE=${TORRUST_TRACKER_DATABASE}
106+
ENV TORRUST_TRACKER_DATABASE_DRIVER=${TORRUST_TRACKER_DATABASE_DRIVER}
107107
ENV USER_ID=${USER_ID}
108108
ENV UDP_PORT=${UDP_PORT}
109109
ENV HTTP_PORT=${HTTP_PORT}

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
image: torrust-tracker:release
55
tty: true
66
environment:
7-
- TORRUST_TRACKER_DATABASE=${TORRUST_TRACKER_DATABASE:-mysql}
7+
- TORRUST_TRACKER_DATABASE_DRIVER=${TORRUST_TRACKER_DATABASE_DRIVER:-mysql}
88
- TORRUST_TRACKER_API_ADMIN_TOKEN=${TORRUST_TRACKER_API_ADMIN_TOKEN:-MyAccessToken}
99
networks:
1010
- server_side

docs/containers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ The following environmental variables can be set:
140140

141141
- `TORRUST_TRACKER_PATH_CONFIG` - The in-container path to the tracker configuration file, (default: `"/etc/torrust/tracker/tracker.toml"`).
142142
- `TORRUST_TRACKER_API_ADMIN_TOKEN` - Override of the admin token. If set, this value overrides any value set in the config.
143-
- `TORRUST_TRACKER_DATABASE` - The database type used for the container, (options: `sqlite3`, `mysql`, default `sqlite3`). Please Note: This dose not override the database configuration within the `.toml` config file.
143+
- `TORRUST_TRACKER_DATABASE_DRIVER` - The database type used for the container, (options: `sqlite3`, `mysql`, default `sqlite3`). Please Note: This dose not override the database configuration within the `.toml` config file.
144144
- `TORRUST_TRACKER_CONFIG` - Load config from this environmental variable instead from a file, (i.e: `TORRUST_TRACKER_CONFIG=$(cat tracker-tracker.toml)`).
145145
- `USER_ID` - The user id for the runtime crated `torrust` user. Please Note: This user id should match the ownership of the host-mapped volumes, (default `1000`).
146146
- `UDP_PORT` - The port for the UDP tracker. This should match the port used in the configuration, (default `6969`).

share/container/entry_script_sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,29 @@ chmod -R 2770 /var/lib/torrust /var/log/torrust /etc/torrust
2626

2727

2828
# Install the database and config:
29-
if [ -n "$TORRUST_TRACKER_DATABASE" ]; then
30-
if cmp_lc "$TORRUST_TRACKER_DATABASE" "sqlite3"; then
29+
if [ -n "$TORRUST_TRACKER_DATABASE_DRIVER" ]; then
30+
if cmp_lc "$TORRUST_TRACKER_DATABASE_DRIVER" "sqlite3"; then
3131

3232
# Select sqlite3 empty database
3333
default_database="/usr/share/torrust/default/database/tracker.sqlite3.db"
3434

3535
# Select sqlite3 default configuration
3636
default_config="/usr/share/torrust/default/config/tracker.container.sqlite3.toml"
3737

38-
elif cmp_lc "$TORRUST_TRACKER_DATABASE" "mysql"; then
38+
elif cmp_lc "$TORRUST_TRACKER_DATABASE_DRIVER" "mysql"; then
3939

4040
# (no database file needed for mysql)
4141

4242
# Select default mysql configuration
4343
default_config="/usr/share/torrust/default/config/tracker.container.mysql.toml"
4444

4545
else
46-
echo "Error: Unsupported Database Type: \"$TORRUST_TRACKER_DATABASE\"."
46+
echo "Error: Unsupported Database Type: \"$TORRUST_TRACKER_DATABASE_DRIVER\"."
4747
echo "Please Note: Supported Database Types: \"sqlite3\", \"mysql\"."
4848
exit 1
4949
fi
5050
else
51-
echo "Error: \"\$TORRUST_TRACKER_DATABASE\" was not set!"; exit 1;
51+
echo "Error: \"\$TORRUST_TRACKER_DATABASE_DRIVER\" was not set!"; exit 1;
5252
fi
5353

5454
install_config="/etc/torrust/tracker/tracker.toml"

0 commit comments

Comments
 (0)