1
0
Fork 0
mirror of https://github.com/overleaf/toolkit.git synced 2025-04-19 15:28:06 +02:00

Rebrand SHARELATEX_ variables in overleaf.rc

This commit is contained in:
mserranom 2024-02-09 10:22:00 +01:00
parent 9c5ac3a568
commit 456772dfbe
13 changed files with 47 additions and 47 deletions

View file

@ -204,5 +204,5 @@
## 2020-10-09
### Added
- Add `SHARELATEX_PORT` option to `overleaf.rc` file, which defaults
- Add `OVERLEAF_PORT` option to `overleaf.rc` file, which defaults
to `80`, same as the previous hard-coded value. ([documentation](./doc/overleaf-rc.md))

View file

@ -45,7 +45,7 @@ function build_environment() {
}
function canonicalize_data_paths() {
SHARELATEX_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$SHARELATEX_DATA_PATH")
OVERLEAF_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$OVERLEAF_DATA_PATH")
MONGO_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$MONGO_DATA_PATH")
REDIS_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$REDIS_DATA_PATH")
GIT_BRIDGE_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$GIT_BRIDGE_DATA_PATH")
@ -56,8 +56,8 @@ function set_base_vars() {
DOCKER_COMPOSE_FLAGS=(-f "$TOOLKIT_ROOT/lib/docker-compose.base.yml")
local image_name
if [[ -n ${SHARELATEX_IMAGE_NAME:-} ]]; then
image_name="$SHARELATEX_IMAGE_NAME"
if [[ -n ${OVERLEAF_IMAGE_NAME:-} ]]; then
image_name="$OVERLEAF_IMAGE_NAME"
elif [[ $SERVER_PRO == "true" ]]; then
image_name="quay.io/sharelatex/sharelatex-pro"
else
@ -65,12 +65,12 @@ function set_base_vars() {
fi
export IMAGE="$image_name:$IMAGE_VERSION"
if [[ ${SHARELATEX_LISTEN_IP:-null} == "null" ]];
if [[ ${OVERLEAF_LISTEN_IP:-null} == "null" ]];
then
echo "WARNING: the value of SHARELATEX_LISTEN_IP is not set in config/overleaf.rc. This value must be set to the public IP address for direct container access. Defaulting to 0.0.0.0" >&2
SHARELATEX_LISTEN_IP="0.0.0.0"
echo "WARNING: the value of OVERLEAF_LISTEN_IP is not set in config/overleaf.rc. This value must be set to the public IP address for direct container access. Defaulting to 0.0.0.0" >&2
OVERLEAF_LISTEN_IP="0.0.0.0"
fi
export SHARELATEX_LISTEN_IP
export OVERLEAF_LISTEN_IP
if [[ $SERVER_PRO != "true" || $IMAGE_VERSION_MAJOR -lt 4 ]]; then
# Force git bridge to be disabled if not ServerPro >= 4
@ -88,8 +88,8 @@ function set_base_vars() {
export MONGO_URL
export REDIS_HOST
export REDIS_PORT
export SHARELATEX_DATA_PATH
export SHARELATEX_PORT
export OVERLEAF_DATA_PATH
export OVERLEAF_PORT
}
# Set environment variables for docker-compose.redis.yml
@ -118,7 +118,7 @@ function set_mongo_vars() {
function set_sibling_containers_vars() {
DOCKER_COMPOSE_FLAGS+=(-f "$TOOLKIT_ROOT/lib/docker-compose.sibling-containers.yml")
export DOCKER_SOCKET_PATH
export SHARELATEX_DATA_PATH
export OVERLEAF_DATA_PATH
}
# Set environment variables for docker-compose.nginx.yml

View file

@ -185,11 +185,11 @@ function check_config_files() {
source "$TOOLKIT_ROOT/$config_file"
# Check some vars from the RC file
if [[ "${SHARELATEX_DATA_PATH:-null}" != "null" ]]; then
print_point 2 "SHARELATEX_DATA_PATH: $SHARELATEX_DATA_PATH"
if [[ "${OVERLEAF_DATA_PATH:-null}" != "null" ]]; then
print_point 2 "OVERLEAF_DATA_PATH: $OVERLEAF_DATA_PATH"
else
print_point 2 "SHARELATEX_DATA_PATH: MISSING !"
add_warning "rc file, SHARELATEX_DATA_PATH not set"
print_point 2 "OVERLEAF_DATA_PATH: MISSING !"
add_warning "rc file, OVERLEAF_DATA_PATH not set"
fi
print_point 2 "SERVER_PRO: $SERVER_PRO"
@ -209,11 +209,11 @@ function check_config_files() {
fi
print_point 2 "SIBLING_CONTAINERS_ENABLED: $SIBLING_CONTAINERS_ENABLED"
fi
if [[ "${SHARELATEX_LISTEN_IP:-null}" != "null" ]]; then
print_point 2 "SHARELATEX_LISTEN_IP: ${SHARELATEX_LISTEN_IP}"
if [[ "${OVERLEAF_LISTEN_IP:-null}" != "null" ]]; then
print_point 2 "OVERLEAF_LISTEN_IP: ${OVERLEAF_LISTEN_IP}"
fi
if [[ "${SHARELATEX_PORT:-null}" != "null" ]]; then
print_point 2 "SHARELATEX_PORT: ${SHARELATEX_PORT}"
if [[ "${OVERLEAF_PORT:-null}" != "null" ]]; then
print_point 2 "OVERLEAF_PORT: ${OVERLEAF_PORT}"
fi
print_point 2 "MONGO_ENABLED: $MONGO_ENABLED"

View file

@ -48,7 +48,7 @@ Inside the overleaf container, the Overleaf software runs as a set of micro-serv
- `/etc/sharelatex/settings.coffee`: unified settings file for the microservices
- `/var/log/sharelatex/`: logs for each microservice
- `/var/www/sharelatex/`: code for the various microservices
- `/var/lib/sharelatex/`: the mount-point for persistent data (corresponds to the directory indicated by `SHARELATEX_DATA_PATH` on the host)
- `/var/lib/sharelatex/`: the mount-point for persistent data (corresponds to the directory indicated by `OVERLEAF_DATA_PATH` on the host)
## The MongoDB and Redis Containers

View file

@ -16,25 +16,25 @@ This is useful when running multiple instances of Overleaf on one host, as each
- Default: overleaf
### `SHARELATEX_DATA_PATH`
### `OVERLEAF_DATA_PATH`
Sets the path to the directory that will be mounted into the main `sharelatex` container, and used to store compile data. This can be either a full path (beginning with a `/`), or relative to the base directory of the toolkit.
- Default: data/sharelatex
### `SHARELATEX_LISTEN_IP`
### `OVERLEAF_LISTEN_IP`
Sets the host IP address(es) that the container will bind to. For example, if this is set to `0.0.0.0`, then the web interface will be available on any host IP address.
Since https://github.com/overleaf/toolkit/pull/77 the listen mode of the application container was changed to `localhost` only, so the value of `SHARELATEX_LISTEN_IP` must be set to the public IP address for direct container access.
Since https://github.com/overleaf/toolkit/pull/77 the listen mode of the application container was changed to `localhost` only, so the value of `OVERLEAF_LISTEN_IP` must be set to the public IP address for direct container access.
Setting `SHARELATEX_LISTEN_IP` to either `0.0.0.0` or the external IP of your host will typically cause errors when used in conjunction with the [TLS Proxy](tls-proxy.md).
Setting `OVERLEAF_LISTEN_IP` to either `0.0.0.0` or the external IP of your host will typically cause errors when used in conjunction with the [TLS Proxy](tls-proxy.md).
- Default: `127.0.0.1`
### `SHARELATEX_PORT`
### `OVERLEAF_PORT`
Sets the host port that the container will bind to. For example, if this is set to `8099` and `SHARELATEX_LISTEN_IP` is set to `127.0.0.1`, then the web interface will be available on `http://localhost:8099`.
Sets the host port that the container will bind to. For example, if this is set to `8099` and `OVERLEAF_LISTEN_IP` is set to `127.0.0.1`, then the web interface will be available on `http://localhost:8099`.
- Default: 80
@ -158,7 +158,7 @@ Sets the host port that the [TLS Proxy](tls-proxy.md) container will bind to for
Sets the host IP address(es) that the [TLS Proxy](tls-proxy.md) container will bind to for http redirect. For example, if this is set to `127.0.1.1` then http connections to `127.0.1.1` will be redirected to the https web interface.
Typically this should be set to the external IP of your host. Do not set it to `0.0.0.0` as this will typically cause a conflict with `SHARELATEX_LISTEN_IP`.
Typically this should be set to the external IP of your host. Do not set it to `0.0.0.0` as this will typically cause a conflict with `OVERLEAF_LISTEN_IP`.
- Default: `127.0.1.1`

View file

@ -5,7 +5,7 @@ The Overleaf Toolkit needs to store persistent data, such as the files required
## Data Directories
The Overleaf container requires a directory in which to store data relating to LaTeX compiles. This directory is set with the `SHARELATEX_DATA_PATH` variable in `config/overleaf.rc`.
The Overleaf container requires a directory in which to store data relating to LaTeX compiles. This directory is set with the `OVERLEAF_DATA_PATH` variable in `config/overleaf.rc`.
The MongoDB container, if it is enabled, requires a directory in which to store it's database files, and the same is true of the Redis container. These directories can also be configured in `config/overleaf.rc`.

View file

@ -7,9 +7,9 @@ In Server Pro, it is possible to have each LaTeX project be compiled in a separa
When sandboxed compiles are enabled, the toolkit will mount the docker socket from the host into the overleaf container, so that the compiler service in the container can create new docker containers on the host. Then for each run of the compiler in each project, the LaTeX compiler service (CLSI) will do the following:
- Write out the project files to a location inside the `SHARELATEX_DATA_PATH`,
- Write out the project files to a location inside the `OVERLEAF_DATA_PATH`,
- Use the mounted docker socket to create a new `texlive` container for the compile run
- Have the `texlive` container read the project data from the location under `SHARELATEX_DATA_PATH`
- Have the `texlive` container read the project data from the location under `OVERLEAF_DATA_PATH`
- Compile the project inside the `texlive` container

View file

@ -60,7 +60,7 @@ You will see some output like this:
- config/overleaf.rc
- status: present
- values
- SHARELATEX_DATA_PATH: data/sharelatex
- OVERLEAF_DATA_PATH: data/sharelatex
- SERVER_PRO: false
- MONGO_ENABLED: true
- REDIS_ENABLED: true
@ -110,7 +110,7 @@ The `Configuration` section contains information about the files in the `config/
- config/overleaf.rc
- status: present
- values
- SHARELATEX_DATA_PATH: /tmp/sharelatex
- OVERLEAF_DATA_PATH: /tmp/sharelatex
- SERVER_PRO: false
- MONGO_ENABLED: false
- REDIS_ENABLED: true
@ -120,7 +120,7 @@ The `Configuration` section contains information about the files in the `config/
The above example shows a few problems:
- The `SHARELATEX_DATA_PATH` variable is set to `/tmp/sharelatex`, which is probably not a safe place to put important data
- The `OVERLEAF_DATA_PATH` variable is set to `/tmp/sharelatex`, which is probably not a safe place to put important data
- The `MONGO_ENABLED` variable is set to `false`, so the toolkit will not provision it's own MongoDB database. In this case, we had better be sure to set `MONGO_URL` to point to a MongoDB database managed outside of the toolkit
- the `config/variables.env` file is missing
@ -133,7 +133,7 @@ The `Warnings` section shows a summary of problems discovered by the doctor scri
```
====== Warnings ======
- configuration file variables.env not found
- rc file, SHARELATEX_DATA_PATH not set
- rc file, OVERLEAF_DATA_PATH not set
====== End =======
```

View file

@ -29,7 +29,7 @@ TLS_PORT=443
By default the https web interface will be available on `https://127.0.1.1:443`. Connections to `http://127.0.1.1:80` will be redirected to `https://127.0.1.1:443`. To change the IP address that NGINX listens on, set the `NGINX_HTTP_LISTEN_IP` and `NGINX_TLS_LISTEN_IP` variables. The ports can be changed via the `NGINX_HTTP_PORT` and `TLS_PORT` variables.
If NGINX fails to start with the error message `Error starting userland proxy: listen tcp4 ... bind: address already in use` ensure that `SHARELATEX_LISTEN_IP:SHARELATEX_PORT` does not overlap with `NGINX_HTTP_LISTEN_IP:NGINX_HTTP_PORT`.
If NGINX fails to start with the error message `Error starting userland proxy: listen tcp4 ... bind: address already in use` ensure that `OVERLEAF_LISTEN_IP:OVERLEAF_PORT` does not overlap with `NGINX_HTTP_LISTEN_IP:NGINX_HTTP_PORT`.
```mermaid
sequenceDiagram
@ -53,7 +53,7 @@ sequenceDiagram
note over sharelatex: sharlatex:80
%% User connects to localhost HTTP
user->>+ internal: HTTP
note over internal: SHARELATEX_LISTEN_IP:SHARELATEX_PORT
note over internal: OVERLEAF_LISTEN_IP:OVERLEAF_PORT
internal->>+sharelatex: HTTP
note over sharelatex: sharlatex:80
```

View file

@ -3,12 +3,12 @@
PROJECT_NAME=overleaf
# Sharelatex container
# Uncomment the SHARELATEX_IMAGE_NAME variable to use a user-defined image.
# SHARELATEX_IMAGE_NAME=sharelatex/sharelatex
SHARELATEX_DATA_PATH=data/sharelatex
# Uncomment the OVERLEAF_IMAGE_NAME variable to use a user-defined image.
# OVERLEAF_IMAGE_NAME=sharelatex/sharelatex
OVERLEAF_DATA_PATH=data/sharelatex
SERVER_PRO=false
SHARELATEX_LISTEN_IP=127.0.0.1
SHARELATEX_PORT=80
OVERLEAF_LISTEN_IP=127.0.0.1
OVERLEAF_PORT=80
# Sibling Containers
SIBLING_CONTAINERS_ENABLED=false

View file

@ -2,8 +2,8 @@
PROJECT_NAME=overleaf
SERVER_PRO=false
SHARELATEX_DATA_PATH=data/sharelatex
SHARELATEX_PORT=80
OVERLEAF_DATA_PATH=data/sharelatex
OVERLEAF_PORT=80
# Sibling containers
SIBLING_CONTAINERS_ENABLED=false

View file

@ -7,9 +7,9 @@ services:
image: "${IMAGE}"
container_name: sharelatex
volumes:
- "${SHARELATEX_DATA_PATH}:/var/lib/sharelatex"
- "${OVERLEAF_DATA_PATH}:/var/lib/sharelatex"
ports:
- "${SHARELATEX_LISTEN_IP:-127.0.0.1}:${SHARELATEX_PORT:-80}:80"
- "${OVERLEAF_LISTEN_IP:-127.0.0.1}:${OVERLEAF_PORT:-80}:80"
environment:
GIT_BRIDGE_ENABLED: "${GIT_BRIDGE_ENABLED}"
GIT_BRIDGE_HOST: "git-bridge"

View file

@ -8,5 +8,5 @@ services:
DOCKER_RUNNER: 'true'
SANDBOXED_COMPILES: 'true'
SANDBOXED_COMPILES_SIBLING_CONTAINERS: 'true'
SANDBOXED_COMPILES_HOST_DIR: "${SHARELATEX_DATA_PATH}/data/compiles"
SYNCTEX_BIN_HOST_PATH: "${SHARELATEX_DATA_PATH}/bin/synctex"
SANDBOXED_COMPILES_HOST_DIR: "${OVERLEAF_DATA_PATH}/data/compiles"
SYNCTEX_BIN_HOST_PATH: "${OVERLEAF_DATA_PATH}/bin/synctex"