mirror of
https://github.com/overleaf/toolkit.git
synced 2025-04-19 23:38:06 +02:00
2.5.0-1 built from sharelatex/sharelatex; includes upgrade & many more textlive packages, plus more
This commit is contained in:
parent
3edb946ca0
commit
db4a34f753
6 changed files with 2726 additions and 56 deletions
|
@ -5,86 +5,97 @@ set -euo pipefail
|
|||
#### Detect Toolkit Project Root ####
|
||||
# if realpath is not available, create a semi-equivalent function
|
||||
command -v realpath >/dev/null 2>&1 || realpath() {
|
||||
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
|
||||
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
|
||||
}
|
||||
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
|
||||
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"
|
||||
TOOLKIT_ROOT="$(realpath "$SCRIPT_DIR/..")"
|
||||
if [[ ! -d "$TOOLKIT_ROOT/bin" ]] || [[ ! -d "$TOOLKIT_ROOT/config" ]]; then
|
||||
echo "ERROR: could not find root of overleaf-toolkit project (inferred project root as '$TOOLKIT_ROOT')"
|
||||
exit 1
|
||||
echo "ERROR: could not find root of overleaf-toolkit project (inferred project root as '$TOOLKIT_ROOT')"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RC_FILE="$TOOLKIT_ROOT/config/overleaf.rc"
|
||||
|
||||
function __main__() {
|
||||
local SHARELATEX_IMAGE_VERSION
|
||||
SHARELATEX_IMAGE_VERSION="$(head -n 1 "$TOOLKIT_ROOT/config/version")"
|
||||
local MONGO_IMAGE="mongo:4.0"
|
||||
local REDIS_IMAGE="redis:5.0"
|
||||
local SHARELATEX_IMAGE_VERSION
|
||||
if [ -r "${TOOLKIT_ROOT}/config/tag" ]; then
|
||||
SHARELATEX_IMAGE_VERSION="$(head -n 1 "$TOOLKIT_ROOT/config/tag")"
|
||||
else
|
||||
SHARELATEX_IMAGE_VERSION="$(head -n 1 "$TOOLKIT_ROOT/config/version")"
|
||||
fi
|
||||
local MONGO_IMAGE="mongo:4.0"
|
||||
local REDIS_IMAGE="redis:5.0"
|
||||
|
||||
local MONGO_URL="mongodb://mongo/sharelatex"
|
||||
local REDIS_HOST="redis"
|
||||
local REDIS_PORT="6379"
|
||||
local MONGO_URL="mongodb://mongo/sharelatex"
|
||||
local REDIS_HOST="redis"
|
||||
local REDIS_PORT="6379"
|
||||
|
||||
if [[ ! "$SHARELATEX_IMAGE_VERSION" \
|
||||
=~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "ERROR: invalid version '${SHARELATEX_IMAGE_VERSION}'"
|
||||
exit 1
|
||||
fi
|
||||
if [ "${SHARELATEX_IMAGE_VERSION}" != "latest" ]; then
|
||||
if [[ ! "$SHARELATEX_IMAGE_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "ERROR: invalid version '${SHARELATEX_IMAGE_VERSION}'"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Load vars from the rc file
|
||||
# shellcheck disable=SC1090
|
||||
source "$RC_FILE"
|
||||
# Load vars from the rc file
|
||||
# shellcheck disable=SC1090
|
||||
source "$RC_FILE"
|
||||
|
||||
# Select which docker-compose files to load
|
||||
local compose_file_flags=("-f $TOOLKIT_ROOT/lib/docker-compose.base.yml")
|
||||
if [[ "$REDIS_ENABLED" == "true" ]]; then
|
||||
compose_file_flags+=("-f $TOOLKIT_ROOT/lib/docker-compose.redis.yml")
|
||||
fi
|
||||
if [[ "$MONGO_ENABLED" == "true" ]]; then
|
||||
compose_file_flags+=("-f $TOOLKIT_ROOT/lib/docker-compose.mongo.yml")
|
||||
fi
|
||||
if [[ "$SIBLING_CONTAINERS_ENABLED" == "true" ]]; then
|
||||
compose_file_flags+=("-f $TOOLKIT_ROOT/lib/docker-compose.sibling-containers.yml")
|
||||
fi
|
||||
# Select which docker-compose files to load
|
||||
local compose_file_flags=("-f $TOOLKIT_ROOT/lib/docker-compose.base.yml")
|
||||
if [[ "$REDIS_ENABLED" == "true" ]]; then
|
||||
compose_file_flags+=("-f $TOOLKIT_ROOT/lib/docker-compose.redis.yml")
|
||||
fi
|
||||
if [[ "$MONGO_ENABLED" == "true" ]]; then
|
||||
compose_file_flags+=("-f $TOOLKIT_ROOT/lib/docker-compose.mongo.yml")
|
||||
fi
|
||||
if [[ "$SIBLING_CONTAINERS_ENABLED" == "true" ]]; then
|
||||
compose_file_flags+=("-f $TOOLKIT_ROOT/lib/docker-compose.sibling-containers.yml")
|
||||
fi
|
||||
|
||||
# Include docker-compose.override.yml if it is present
|
||||
if [[ -f "$TOOLKIT_ROOT/config/docker-compose.override.yml" ]]; then
|
||||
compose_file_flags+=("-f $TOOLKIT_ROOT/config/docker-compose.override.yml")
|
||||
fi
|
||||
# Include docker-compose.override.yml if it is present
|
||||
if [[ -f "$TOOLKIT_ROOT/config/docker-compose.override.yml" ]]; then
|
||||
compose_file_flags+=("-f $TOOLKIT_ROOT/config/docker-compose.override.yml")
|
||||
fi
|
||||
|
||||
# Build up the flags to pass to docker-compose
|
||||
local project_name="${PROJECT_NAME:-overleaf}"
|
||||
# Build up the flags to pass to docker-compose
|
||||
local project_name="${PROJECT_NAME:-overleaf}"
|
||||
|
||||
local image_name="sharelatex/sharelatex"
|
||||
if [[ "${SERVER_PRO:-null}" == "true" ]]; then
|
||||
image_name="quay.io/sharelatex/sharelatex-pro"
|
||||
fi
|
||||
if [ ${#SHARELATEX_IMAGE_NAME} -eq 0 ]; then
|
||||
local image_name="sharelatex/sharelatex"
|
||||
else
|
||||
local image_name="${SHARELATEX_IMAGE_NAME}"
|
||||
fi
|
||||
if [[ "${SERVER_PRO:-null}" == "true" ]]; then
|
||||
image_name="quay.io/sharelatex/sharelatex-pro"
|
||||
fi
|
||||
|
||||
local full_image_spec="$image_name:$SHARELATEX_IMAGE_VERSION"
|
||||
local full_image_spec="$image_name:$SHARELATEX_IMAGE_VERSION"
|
||||
|
||||
# Canonicalize data paths
|
||||
SHARELATEX_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$SHARELATEX_DATA_PATH")
|
||||
MONGO_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$MONGO_DATA_PATH")
|
||||
REDIS_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$REDIS_DATA_PATH")
|
||||
# Canonicalize data paths
|
||||
SHARELATEX_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$SHARELATEX_DATA_PATH")
|
||||
SHARELATEX_DOCUMENTS_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$SHARELATEX_DOCUMENTS_PATH")
|
||||
MONGO_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$MONGO_DATA_PATH")
|
||||
REDIS_DATA_PATH=$(cd "$TOOLKIT_ROOT"; realpath "$REDIS_DATA_PATH")
|
||||
|
||||
# Print debug info
|
||||
if [[ "${RC_DEBUG:-null}" != "null" ]]; then
|
||||
echo ">>>>>>VARS>>>>>>"
|
||||
echo "$(set -o posix; set)" # print all vars
|
||||
echo "IMAGE_VERSION=$SHARELATEX_IMAGE_VERSION"
|
||||
echo "<<<<<<<<<<<<<<<<"
|
||||
echo ">>>>COMPOSE-ARGS>>>>"
|
||||
echo "-p $project_name"
|
||||
echo "${compose_file_flags[@]}"
|
||||
echo "$@"
|
||||
echo "<<<<<<<<<<<<<<<<<<<<"
|
||||
fi
|
||||
# Print debug info
|
||||
if [[ "${RC_DEBUG:-null}" != "null" ]]; then
|
||||
echo ">>>>>>VARS>>>>>>"
|
||||
echo "$(set -o posix; set)" # print all vars
|
||||
echo "IMAGE_VERSION=$SHARELATEX_IMAGE_VERSION"
|
||||
echo "<<<<<<<<<<<<<<<<"
|
||||
echo ">>>>COMPOSE-ARGS>>>>"
|
||||
echo "-p $project_name"
|
||||
echo "${compose_file_flags[@]}"
|
||||
echo "$@"
|
||||
echo "<<<<<<<<<<<<<<<<<<<<"
|
||||
fi
|
||||
|
||||
# Export vars for use in docker-compose files
|
||||
export IMAGE="$full_image_spec"
|
||||
export SHARELATEX_DATA_PATH
|
||||
export SHARELATEX_DOCUMENTS_PATH
|
||||
export SHARELATEX_PORT
|
||||
export DOCKER_SOCKET_PATH
|
||||
export MONGO_IMAGE
|
||||
|
|
|
@ -8,6 +8,7 @@ services:
|
|||
container_name: sharelatex
|
||||
volumes:
|
||||
- "${SHARELATEX_DATA_PATH}:/var/lib/sharelatex"
|
||||
- "${SHARELATEX_DOCUMENTS_PATH}:/var/www/Documents"
|
||||
ports:
|
||||
- "${SHARELATEX_PORT:-80}:80"
|
||||
environment:
|
||||
|
|
3
mitaei/sharelatex/.env
Normal file
3
mitaei/sharelatex/.env
Normal file
|
@ -0,0 +1,3 @@
|
|||
SHARELATEX_MONGO_URL="mongodb://mongo/sharelatex"
|
||||
SHARELATEX_REDIS_HOST=redis
|
||||
REDIS_HOST=redis
|
1
mitaei/sharelatex/.gitignore
vendored
Normal file
1
mitaei/sharelatex/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
tmp
|
17
mitaei/sharelatex/Dockerfile
Normal file
17
mitaei/sharelatex/Dockerfile
Normal file
|
@ -0,0 +1,17 @@
|
|||
FROM sharelatex/sharelatex
|
||||
|
||||
RUN apt -y update \
|
||||
; apt-get -y --no-install-recommends install \
|
||||
apt-utils \
|
||||
iputils-ping \
|
||||
lsof \
|
||||
net-tools \
|
||||
; apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
#RUN mv /etc/my_init.d/98_check_db_access.sh /tmp # for testing with docker, rather than docker-compose
|
||||
|
||||
# textlive update & install packages
|
||||
COPY packages.tl /tmp
|
||||
RUN tlmgr update --self \
|
||||
; tlmgr update --all \
|
||||
; for tlpkg in $(cat /tmp/packages.tl); do tlmgr install $tlpkg; done
|
2637
mitaei/sharelatex/packages.tl
Normal file
2637
mitaei/sharelatex/packages.tl
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue