From 26dc02790ec2102a88c2d6b439840b9d430bce50 Mon Sep 17 00:00:00 2001 From: Cameron Garnham Date: Fri, 25 Aug 2023 22:30:59 +0200 Subject: [PATCH] dev: more docker work --- .dockerignore | 2 +- .env.local | 6 +- .github/workflows/container.yaml | 76 ++++++++++++++++++++------ Dockerfile | 35 ++++-------- bin/install.sh | 2 +- compose.yaml | 18 +++--- config-index.sqlite.local.toml | 2 +- config-tracker.local.toml | 2 +- docker/README.md | 24 ++++---- docker/bin/build.sh | 8 +-- docker/bin/e2e/mysql/e2e-env-reset.sh | 2 +- docker/bin/e2e/mysql/e2e-env-up.sh | 8 +-- docker/bin/e2e/run-e2e-tests.sh | 7 ++- docker/bin/e2e/sqlite/e2e-env-reset.sh | 2 +- docker/bin/e2e/sqlite/e2e-env-up.sh | 6 +- docker/bin/run.sh | 10 ++-- licensing/agpl-3.0.md | 2 +- src/bootstrap/config.rs | 6 +- src/lib.rs | 18 +++--- tests/e2e/environment.rs | 2 +- 20 files changed, 136 insertions(+), 102 deletions(-) diff --git a/.dockerignore b/.dockerignore index daa3343c..ad44b50d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,5 +15,5 @@ /project-words.txt /README.md /rustfmt.toml -/storage/ +/lib/torrust/ /target/ diff --git a/.env.local b/.env.local index 90b3e4b3..59fdd662 100644 --- a/.env.local +++ b/.env.local @@ -1,6 +1,6 @@ -DATABASE_URL=sqlite://storage/database/data.db?mode=rwc -TORRUST_IDX_BACK_CONFIG= -TORRUST_IDX_BACK_USER_UID=1000 +DATABASE_URL=sqlite:///var/lib/torrust/database/data.db?mode=rwc +TORRUST_INDEX_CONFIG= +USER_UID=1000 TORRUST_TRACKER_CONFIG= TORRUST_TRACKER_USER_UID=1000 TORRUST_TRACKER_API_TOKEN=MyAccessToken diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml index 69a3a01d..8da85247 100644 --- a/.github/workflows/container.yaml +++ b/.github/workflows/container.yaml @@ -7,50 +7,92 @@ on: env: CARGO_TERM_COLOR: always + jobs: test: - name: Test + name: Test Release + runs-on: ubuntu-latest + + steps: + - id: setup + name: Setup Toolchain + uses: docker/setup-buildx-action@v2 + + - id: build_index + name: Build + uses: docker/build-push-action@v4 + with: + push: false + load: true + target: release + tags: torrust-index-backend:release + cache-from: type=gha + cache-to: type=gha,mode=max + + integration: + name: Integration runs-on: ubuntu-latest steps: - - id: checkout - name: Checkout Repository + - id: checkout_index + name: Checkout Repository (Index) uses: actions/checkout@v3 + with: + path: index + + - id: checkout_tracker + name: Checkout Repository (Tracker) + uses: actions/checkout@v3 + with: + repository: torrust/torrust-tracker + path: tracker - id: setup name: Setup Toolchain uses: docker/setup-buildx-action@v2 - - id: build + - id: build_index name: Build uses: docker/build-push-action@v4 with: + context: index push: false load: true - tags: torrust-index-backend:local + target: debug + tags: torrust-index-backend:debug cache-from: type=gha cache-to: type=gha,mode=max - - id: inspect - name: Inspect - run: docker image inspect torrust-index-backend:local + - id: build_tracker + name: Build + uses: docker/build-push-action@v4 + with: + context: index + push: false + load: true + target: debug + tags: torrust-tracker:debug + cache-from: type=gha + cache-to: type=gha,mode=max + + - id: inspect_index + name: Inspect Index + run: docker image inspect torrust-index-backend:debug + + - id: inspect_tracker + name: Inspect Tracker + run: docker image inspect torrust-tracker:debug - id: compose name: Compose Applications - run: | - export TORRUST_IDX_BACK_CONFIG=$(cat config-index.mysql.local.toml) - export TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) - - docker compose build \ - --build-arg TORRUST_IDX_BACK_CONFIG="$TORRUST_IDX_BACK_CONFIG" \ - --build-arg TORRUST_TRACKER_CONFIG="$TORRUST_TRACKER_CONFIG" + run: docker compose build - id: run name: Run Applications run: | - export TORRUST_IDX_BACK_CONFIG=$(cat config-index.mysql.local.toml) - export TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) + export TORRUST_INDEX_CONFIG=$(cat index/config-index.mysql.local.toml) + export TORRUST_TRACKER_CONFIG=$(cat index/config-tracker.local.toml) docker compose up --detach diff --git a/Dockerfile b/Dockerfile index 58df5823..88c3a957 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,47 +95,36 @@ RUN chmod -R u=rw,go=r,a+X /app RUN chmod -R a+x /app/bin -## Torrust-Index-Backend (debug) -FROM gcr.io/distroless/cc:debug as index_backend_debug - +## Runtime +FROM gcr.io/distroless/cc:debug as Runtime RUN ["/busybox/cp", "-sp", "/busybox/sh", "/bin/sh"] -ENV ENV=/etc/profile ARG USER_ID=1000 -ARG USER_NAME=appuser ARG API_PORT=3001 ENV USER_ID=${USER_ID} -ENV USER_NAME=${USER_NAME} ENV API_PORT=${API_PORT} ENV TZ=Etc/UTC EXPOSE ${API_PORT}/tcp -COPY --from=test_debug /app/ /usr/ +WORKDIR /home/torrust +RUN adduser --disabled-password --uid "${USER_ID}" "torrust" +RUN mkdir -p /var/lib/torrust; chown -R "${USER_ID}":"${USER_ID}" /var/lib/torrust; chmod -R 2775 /var/lib/torrust +ENV ENV=/etc/profile COPY ./docker/motd.debug /etc/motd - RUN echo '[ ! -z "$TERM" -a -r /etc/motd ] && cat /etc/motd' >> /etc/profile +USER "torrust":"torrust" -WORKDIR /home/${USER_NAME} -RUN adduser --disabled-password --uid "${USER_ID}" "${USER_NAME}" -USER "${USER_NAME}":"${USER_NAME}" +## Torrust-Index-Backend (debug) +FROM runtime as debug +COPY --from=test_debug /app/ /usr/ RUN env ## Torrust-Index-Backend (release) (default) -FROM gcr.io/distroless/cc:nonroot as index_backend -COPY --from=gcr.io/distroless/cc:debug /busybox/wget /usr/bin/wget +FROM runtime as release COPY --from=test /app/ /usr/ - -ARG API_PORT=3001 - -ENV API_PORT=${API_PORT} -ENV TZ=Etc/UTC - -EXPOSE ${API_PORT}/tcp - -HEALTHCHECK CMD ["/usr/bin/wget", "--no-verbose", "--tries=1", "--spider", "localhost:${API_PORT}"] - +HEALTHCHECK CMD ["/busybox/wget", "--no-verbose", "--tries=1", "--spider", "localhost:${API_PORT}"] CMD ["/usr/bin/torrust-index-backend"] diff --git a/bin/install.sh b/bin/install.sh index e98047eb..13e334eb 100755 --- a/bin/install.sh +++ b/bin/install.sh @@ -5,7 +5,7 @@ if ! [ -f "./config.toml" ]; then cp ./config-index.local.toml ./config.toml fi -# Generate storage directory if it does not exist +# Generate lib/torrust directory if it does not exist mkdir -p "./storage/database" # Generate the sqlite database for the index backend if it does not exist diff --git a/compose.yaml b/compose.yaml index f2efea3f..2bb40bb0 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,26 +1,28 @@ name: torrust services: - index-back: - image: torrust-index-backend:local + index: + image: torrust-index-backend:debug + entrypoint: torrust-index-backend tty: true environment: - - TORRUST_IDX_BACK_CONFIG=${TORRUST_IDX_BACK_CONFIG} - - TORRUST_IDX_BACK_CORS_PERMISSIVE=true + - TORRUST_INDEX_CONFIG=${TORRUST_INDEX_CONFIG} + - TORRUST_INDEX_CORS_PERMISSIVE=true - CARGO_HOME=/home/appuser/.cargo networks: - server_side ports: - 3001:3001 volumes: - - ./storage:/app/storage + - ./lib/torrust:/var/lib/torrust depends_on: - tracker - mailcatcher - mysql tracker: - image: torrust/tracker:develop + image: torrust-tracker:debug + entrypoint: torrust-tracker tty: true environment: - TORRUST_TRACKER_CONFIG=${TORRUST_TRACKER_CONFIG} @@ -31,7 +33,7 @@ services: - 6969:6969/udp - 1212:1212/tcp volumes: - - ./storage:/app/storage + - ./lib/torrust:/var/lib/torrust depends_on: - mysql @@ -58,7 +60,7 @@ services: environment: - MYSQL_ROOT_HOST=% - MYSQL_ROOT_PASSWORD=root_secret_password - - MYSQL_DATABASE=${TORRUST_IDX_BACK_MYSQL_DATABASE:-torrust_index_backend_e2e_testing} + - MYSQL_DATABASE=${TORRUST_INDEX_MYSQL_DATABASE:-torrust_index_backend_e2e_testing} - MYSQL_USER=db_user - MYSQL_PASSWORD=db_user_secret_password networks: diff --git a/config-index.sqlite.local.toml b/config-index.sqlite.local.toml index f050b4fb..94cdc2f6 100644 --- a/config-index.sqlite.local.toml +++ b/config-index.sqlite.local.toml @@ -20,7 +20,7 @@ max_password_length = 64 secret_key = "MaxVerstappenWC2021" [database] -connect_url = "sqlite://storage/database/torrust_index_backend_e2e_testing.db?mode=rwc" +connect_url = "sqlite:///var/lib/torrust/database/torrust_index_backend_e2e_testing.db?mode=rwc" [mail] email_verification_enabled = false diff --git a/config-tracker.local.toml b/config-tracker.local.toml index 9db1b578..0e621435 100644 --- a/config-tracker.local.toml +++ b/config-tracker.local.toml @@ -1,7 +1,7 @@ log_level = "info" mode = "public" db_driver = "Sqlite3" -db_path = "./storage/database/torrust_tracker_e2e_testing.db" +db_path = "/var/lib/torrust/database/torrust_tracker_e2e_testing.db" announce_interval = 120 min_announce_interval = 120 max_peer_timeout = 900 diff --git a/docker/README.md b/docker/README.md index e2732095..d4e4b3ec 100644 --- a/docker/README.md +++ b/docker/README.md @@ -3,11 +3,11 @@ ## Requirements - Docker version 20.10.21 -- You need to create the `storage` directory with this structure and files: +- You need to create the `lib/torrust` directory with this structure and files: ```s -$ tree storage/ -storage/ +$ tree lib/torrust/ +lib/torrust/ └── database   ├── data.db    └── tracker.db @@ -21,20 +21,20 @@ Build and run locally: ```s docker context use default -export TORRUST_IDX_BACK_USER_UID=$(id -u) -./docker/bin/build.sh $TORRUST_IDX_BACK_USER_UID +export USER_UID=$(id -u) +./docker/bin/build.sh $USER_UID ./bin/install.sh -./docker/bin/run.sh $TORRUST_IDX_BACK_USER_UID +./docker/bin/run.sh $USER_UID ``` Run using the pre-built public docker image: ```s -export TORRUST_IDX_BACK_USER_UID=$(id -u) +export USER_UID=$(id -u) docker run -it \ - --user="$TORRUST_IDX_BACK_USER_UID" \ + --user="$USER_UID" \ --publish 3001:3001/tcp \ - --volume "$(pwd)/storage":"/app/storage" \ + --volume "$(pwd)/lib/torrust":"/var/lib/torrust" \ torrust/index-backend ``` @@ -49,7 +49,7 @@ docker run -it \ The docker-compose configuration includes the MySQL service configuration. If you want to use MySQL instead of SQLite you have to change your `config.toml` or `config-idx-back.local.toml` configuration from: ```toml -connect_url = "sqlite://storage/database/data.db?mode=rwc" +connect_url = "sqlite:///var/lib/torrust/database/data.db?mode=rwc" ``` to: @@ -63,8 +63,8 @@ If you want to inject an environment variable into docker-compose you can use th Build and run it locally: ```s -TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} \ - TORRUST_IDX_BACK_CONFIG=$(cat config-index.mysql.local.toml) \ +USER_UID=${USER_UID:-1000} \ + TORRUST_INDEX_CONFIG=$(cat config-index.mysql.local.toml) \ TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) \ TORRUST_TRACKER_API_TOKEN=${TORRUST_TRACKER_API_TOKEN:-MyAccessToken} \ docker compose up -d --build diff --git a/docker/bin/build.sh b/docker/bin/build.sh index 23678c7d..29d6c264 100755 --- a/docker/bin/build.sh +++ b/docker/bin/build.sh @@ -1,13 +1,13 @@ #!/bin/bash -TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} +TORRUST_INDEX_USER_UID=${TORRUST_INDEX_USER_UID:-1000} TORRUST_IDX_BACK_RUN_AS_USER=${TORRUST_IDX_BACK_RUN_AS_USER:-appuser} echo "Building docker image ..." -echo "TORRUST_IDX_BACK_USER_UID: $TORRUST_IDX_BACK_USER_UID" +echo "TORRUST_INDEX_USER_UID: $TORRUST_INDEX_USER_UID" echo "TORRUST_IDX_BACK_RUN_AS_USER: $TORRUST_IDX_BACK_RUN_AS_USER" docker build \ - --build-arg UID="$TORRUST_IDX_BACK_USER_UID" \ + --build-arg UID="$TORRUST_INDEX_USER_UID" \ --build-arg RUN_AS_USER="$TORRUST_IDX_BACK_RUN_AS_USER" \ - --tag torrust-index-backend:local . + --target debug --tag torrust-index-backend:debug . diff --git a/docker/bin/e2e/mysql/e2e-env-reset.sh b/docker/bin/e2e/mysql/e2e-env-reset.sh index d8dc0764..ebf8418d 100755 --- a/docker/bin/e2e/mysql/e2e-env-reset.sh +++ b/docker/bin/e2e/mysql/e2e-env-reset.sh @@ -21,7 +21,7 @@ mysql -h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASSWORD -e "DROP DATABASE IF EXIST # Delete tracker database rm -f ./storage/database/torrust_tracker_e2e_testing.db -# Generate storage directory if it does not exist +# Generate lib/torrust directory if it does not exist mkdir -p "./storage/database" # Generate the sqlite database for the tracker if it does not exist diff --git a/docker/bin/e2e/mysql/e2e-env-up.sh b/docker/bin/e2e/mysql/e2e-env-up.sh index 16548e74..17f0cf40 100755 --- a/docker/bin/e2e/mysql/e2e-env-up.sh +++ b/docker/bin/e2e/mysql/e2e-env-up.sh @@ -1,11 +1,11 @@ #!/bin/bash -TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} \ +USER_UID=${USER_UID:-1000} \ docker compose build -TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} \ - TORRUST_IDX_BACK_CONFIG=$(cat config-index.mysql.local.toml) \ - TORRUST_IDX_BACK_MYSQL_DATABASE="torrust_index_backend_e2e_testing" \ +USER_UID=${USER_UID:-1000} \ + TORRUST_INDEX_CONFIG=$(cat config-index.mysql.local.toml) \ + TORRUST_INDEX_MYSQL_DATABASE="torrust_index_backend_e2e_testing" \ TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) \ TORRUST_TRACKER_API_TOKEN=${TORRUST_TRACKER_API_TOKEN:-MyAccessToken} \ docker compose up -d diff --git a/docker/bin/e2e/run-e2e-tests.sh b/docker/bin/e2e/run-e2e-tests.sh index c7a468fe..e6098f25 100755 --- a/docker/bin/e2e/run-e2e-tests.sh +++ b/docker/bin/e2e/run-e2e-tests.sh @@ -5,9 +5,9 @@ CURRENT_USER_ID=$(id -u) echo "User name: $CURRENT_USER_NAME" echo "User id: $CURRENT_USER_ID" -TORRUST_IDX_BACK_USER_UID=$CURRENT_USER_ID +TORRUST_INDEX_USER_UID=$CURRENT_USER_ID TORRUST_TRACKER_USER_UID=$CURRENT_USER_ID -export TORRUST_IDX_BACK_USER_UID +export TORRUST_INDEX_USER_UID export TORRUST_TRACKER_USER_UID wait_for_container_to_be_healthy() { @@ -37,7 +37,8 @@ wait_for_container_to_be_healthy() { # Install tool to create torrent files. # It's needed by some tests to generate and parse test torrent files. -cargo install imdl || exit 1 +cargo install cargo-binstall || exit 1 +cargo binstall imdl || exit 1 # Install app (no docker) that will run the test suite against the E2E testing # environment (in docker). diff --git a/docker/bin/e2e/sqlite/e2e-env-reset.sh b/docker/bin/e2e/sqlite/e2e-env-reset.sh index 8eeefd6f..a479025f 100755 --- a/docker/bin/e2e/sqlite/e2e-env-reset.sh +++ b/docker/bin/e2e/sqlite/e2e-env-reset.sh @@ -7,7 +7,7 @@ docker compose down rm -f ./storage/database/torrust_index_backend_e2e_testing.db rm -f ./storage/database/torrust_tracker_e2e_testing.db -# Generate storage directory if it does not exist +# Generate lib/torrust directory if it does not exist mkdir -p "./storage/database" # Generate the sqlite database for the index backend if it does not exist diff --git a/docker/bin/e2e/sqlite/e2e-env-up.sh b/docker/bin/e2e/sqlite/e2e-env-up.sh index 980fc833..b81c73db 100755 --- a/docker/bin/e2e/sqlite/e2e-env-up.sh +++ b/docker/bin/e2e/sqlite/e2e-env-up.sh @@ -1,10 +1,10 @@ #!/bin/bash -TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} \ +USER_UID=${USER_UID:-1000} \ docker compose build -TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} \ - TORRUST_IDX_BACK_CONFIG=$(cat config-index.sqlite.local.toml) \ +USER_UID=${USER_UID:-1000} \ + TORRUST_INDEX_CONFIG=$(cat config-index.sqlite.local.toml) \ TORRUST_TRACKER_CONFIG=$(cat config-tracker.local.toml) \ TORRUST_TRACKER_API_TOKEN=${TORRUST_TRACKER_API_TOKEN:-MyAccessToken} \ docker compose up -d diff --git a/docker/bin/run.sh b/docker/bin/run.sh index 48b86f02..8aeaeec6 100755 --- a/docker/bin/run.sh +++ b/docker/bin/run.sh @@ -1,11 +1,11 @@ #!/bin/bash -TORRUST_IDX_BACK_USER_UID=${TORRUST_IDX_BACK_USER_UID:-1000} -TORRUST_IDX_BACK_CONFIG=$(cat config.toml) +TORRUST_INDEX_USER_UID=${TORRUST_INDEX_USER_UID:-1000} +TORRUST_INDEX_CONFIG=$(cat config.toml) docker run -it \ - --user="$TORRUST_IDX_BACK_USER_UID" \ + --user="$TORRUST_INDEX_USER_UID" \ --publish 3001:3001/tcp \ - --env TORRUST_IDX_BACK_CONFIG="$TORRUST_IDX_BACK_CONFIG" \ - --volume "$(pwd)/storage":"/app/storage" \ + --env TORRUST_INDEX_CONFIG="$TORRUST_INDEX_CONFIG" \ + --volume "$(pwd)/lib/torrust":"/var/lib/torrust" \ torrust-index-backend diff --git a/licensing/agpl-3.0.md b/licensing/agpl-3.0.md index f2a1b1b6..5b51d312 100644 --- a/licensing/agpl-3.0.md +++ b/licensing/agpl-3.0.md @@ -225,7 +225,7 @@ conditions: A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an +in or on a volume of a lib/torrust or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index d07c3202..940e75d1 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -7,13 +7,13 @@ use std::env; /// The whole `config.toml` file content. It has priority over the config file. /// Even if the file is not on the default path. -pub const ENV_VAR_CONFIG: &str = "TORRUST_IDX_BACK_CONFIG"; +pub const ENV_VAR_CONFIG: &str = "TORRUST_INDEX_CONFIG"; /// The `config.toml` file location. -pub const ENV_VAR_CONFIG_PATH: &str = "TORRUST_IDX_BACK_CONFIG_PATH"; +pub const ENV_VAR_CONFIG_PATH: &str = "TORRUST_INDEX_CONFIG_PATH"; /// If present, CORS will be permissive. -pub const ENV_VAR_CORS_PERMISSIVE: &str = "TORRUST_IDX_BACK_CORS_PERMISSIVE"; +pub const ENV_VAR_CORS_PERMISSIVE: &str = "TORRUST_INDEX_CORS_PERMISSIVE"; // Default values diff --git a/src/lib.rs b/src/lib.rs index faffb360..c6244691 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,10 +81,10 @@ //! different OS, you will need to install the equivalent packages. Please //! refer to the documentation of your OS. //! -//! With the default configuration you will need to create the `storage` directory: +//! With the default configuration you will need to create the `lib/torrust` directory: //! //! ```text -//! storage/ +//! lib/torrust/ //! └── database //!    └── data.db //! ``` @@ -110,11 +110,11 @@ //! //! ```text //! mkdir -p ./storage/database \ -//! && export TORRUST_IDX_BACK_USER_UID=1000 \ +//! && export USER_UID=1000 \ //! && docker run -it \ -//! --user="$TORRUST_IDX_BACK_USER_UID" \ +//! --user="$USER_UID" \ //! --publish 3001:3001/tcp \ -//! --volume "$(pwd)/storage":"/app/storage" \ +//! --volume "$(pwd)/lib/torrust":"/var/lib/torrust" \ //! torrust/index-backend //! ``` //! @@ -204,10 +204,10 @@ //! //! For more information about configuration you can visit the documentation for the [`config`](crate::config) module. //! -//! Alternatively to the `config.toml` file you can use one environment variable `TORRUST_IDX_BACK_CONFIG` to pass the configuration to the tracker: +//! Alternatively to the `config.toml` file you can use one environment variable `TORRUST_INDEX_CONFIG` to pass the configuration to the tracker: //! //! ```text -//! TORRUST_IDX_BACK_CONFIG=$(cat config.toml) +//! TORRUST_INDEX_CONFIG=$(cat config.toml) //! cargo run //! ``` //! @@ -215,9 +215,9 @@ //! //! The env var contains the same data as the `config.toml`. It's particularly useful in you are [running the backend with docker](https://github.com/torrust/torrust-index-backend/tree/develop/docker). //! -//! > **NOTICE**: The `TORRUST_IDX_BACK_CONFIG` env var has priority over the `config.toml` file. +//! > **NOTICE**: The `TORRUST_INDEX_CONFIG` env var has priority over the `config.toml` file. //! -//! > **NOTICE**: You can also change the location for the configuration file with the `TORRUST_IDX_BACK_CONFIG_PATH` env var. +//! > **NOTICE**: You can also change the location for the configuration file with the `TORRUST_INDEX_CONFIG_PATH` env var. //! //! # Usage //! diff --git a/tests/e2e/environment.rs b/tests/e2e/environment.rs index 1dee9651..a9bb8fbd 100644 --- a/tests/e2e/environment.rs +++ b/tests/e2e/environment.rs @@ -98,7 +98,7 @@ impl TestEnv { /// Provides a database connect URL to connect to the database. For example: /// - /// `sqlite://storage/database/torrust_index_backend_e2e_testing.db?mode=rwc`. + /// `sqlite://var/lib/torrust/database/torrust_index_backend_e2e_testing.db?mode=rwc`. /// /// It's used to run SQL queries against the database needed for some tests. pub fn database_connect_url(&self) -> Option {