An extended Overleaf Community Edition Docker image
48
An extended Overleaf Community Edition Docker image, based on tuetenk0pp/sharelatex-full.
Compared to the official sharelatex/sharelatex image:
fonts/, so nothing has to be
downloaded while building the image)mintedsvg images through the addition of inkscapeUse the Overleaf Toolkit as described in
the Quick-Start Guide
and set the image in config/overleaf.rc:
OVERLEAF_IMAGE_NAME=lvcs/sharelatex
Alternatively, use a config/docker-compose.override.yml file as described
here:
services:
sharelatex:
image: lvcs/sharelatex
Warning
This method is not recommended. Use the Overleaf Toolkit instead.
Use the docker-compose.yml
provided in the official GitHub, but
change the image to lvcs/sharelatex. Also, note the additional
instructions in the official Wiki.
OVERLEAF_INVITE_TOKEN_SECRETImportant
Since Overleaf 6.2.0 the container refuses to start when this variable is missing (it exits with code 101 after printing `Your configuration is missing 1 required secret(s)`).
Overleaf uses this secret to encrypt the sharing-link tokens stored in the database. Unlike the other internal secrets, which the container generates on its first start, it has to be provided by you - and it must stay stable across restarts and upgrades: if it changes, all previously issued sharing links become invalid. Values shorter than 16 characters are rejected.
Generate a value with:
openssl rand -base64 32
OVERLEAF_INVITE_TOKEN_SECRET=<value> to
config/variables.env and restart with bin/up.sharelatex service
and restart the container.The image can authenticate users against an OpenID Connect provider (Keycloak, Authentik, Okta, Azure AD, ...). OIDC login is disabled until the provider is configured through environment variables, so the default behaviour is unchanged.
The feature is a port of the
overleaf-oidc patch
to Overleaf 6.3.0, implemented as file replacements inside the image (see
overlay/README.md).
With the Overleaf Toolkit, add the variables to config/overleaf.rc (they are
passed to the container) or to config/docker-compose.override.yml:
services:
sharelatex:
environment:
OVERLEAF_OIDC_ISSUER: https://idp.example.com/realms/myrealm
OVERLEAF_OIDC_AUTHORIZATION_URL: https://idp.example.com/realms/myrealm/protocol/openid-connect/auth
OVERLEAF_OIDC_TOKEN_URL: https://idp.example.com/realms/myrealm/protocol/openid-connect/token
OVERLEAF_OIDC_USERINFO_URL: https://idp.example.com/realms/myrealm/protocol/openid-connect/userinfo
OVERLEAF_OIDC_CALLBACK_URL: https://overleaf.example.com/login/oidc/callback
OVERLEAF_OIDC_CLIENT_ID: overleaf
OVERLEAF_OIDC_CLIENT_SECRET: <client-secret>
| Variable | Description |
|---|---|
OVERLEAF_OIDC_ISSUER | Issuer URL of the provider. OIDC login is disabled while this is unset. |
OVERLEAF_OIDC_AUTHORIZATION_URL | Authorization endpoint used to start the login flow. |
OVERLEAF_OIDC_TOKEN_URL | Token endpoint used to exchange the authorization code. |
OVERLEAF_OIDC_USERINFO_URL | Userinfo endpoint, its claims identify the user. |
OVERLEAF_OIDC_CALLBACK_URL | Redirect URI registered at the provider, base URL plus /login/oidc/callback. |
OVERLEAF_OIDC_CLIENT_ID | Client id registered at the provider. |
OVERLEAF_OIDC_CLIENT_SECRET | Client secret registered at the provider. |
OVERLEAF_OIDC_SCOPE | Scopes to request (default openid profile email). |
OVERLEAF_OIDC_MATCHING | Which claim identifies the account, id (the sub claim, default) or username (the preferred_username claim). |
OVERLEAF_ENABLE_LOCAL_LOGIN | Set to false to hide and disable the email/password login (default true). |
OVERLEAF_LOGIN_INFO_TEXT | HTML rendered above the login form (default Welcome to Overleaf! Log in to your account below.; set it to an empty value to show nothing). |
OVERLEAF_LOGIN_OIDC_BUTTON | Label of the SSO button (default Log in with SSO). |
OVERLEAF_OIDC_LOGIN_IN_NAVBAR | Set to true to also show the SSO button in the navigation bar (default false; it is always shown when local login is disabled). |
OVERLEAF_ENABLE_REGISTRATION | Set to false to hide the registration page. When unset, registration is hidden whenever OIDC is enabled. |
https://<your-overleaf-domain>/login/oidc/callbackclient_id and
client_secret in the request body (client_secret_post).openid profile email scopes must be available. The userinfo response
must contain the sub and email claims; given_name, family_name,
name and preferred_username are used when present./login; the reason is written to the container log
(OIDC login failed).All variables of the official image remain available (see the Overleaf documentation). The variables added by this image are the ones documented in the OIDC section above.
| Workflow | Trigger | Publishes to |
|---|---|---|
build-test.yml | pull requests to master, manual | – (builds and runs the tests) |
build-push-docker.yml | release published, manual | lvcs/sharelatex on Docker Hub |
build-push-ghcr.yml | release published, manual | ghcr.io/<owner>/<repo> (GitHub Packages) |
DOCKER_USER and
DOCKER_PASSWORD (a Docker Hub access token) in
Settings → Secrets and variables → Actions.GITHUB_TOKEN.latest), or start a workflow manually from the Actions tab
(Run workflow), which tags the image after the selected branch.The build requires BuildKit, which is the default in current Docker versions;
it is used to install the bundled fonts without copying them into an extra
image layer. On older setups, enable it explicitly (DOCKER_BUILDKIT=1 docker build ...).
docker build -t sharelatex .
docker run --rm --volume "$(pwd)/tests:/tests" --entrypoint=/bin/bash \
sharelatex -c "/bin/bash /tests/compile.sh"
Dockerfile extends the official sharelatex/sharelatex image; the OIDC
support is applied as file replacements in overlay/. The Dockerfile
verifies the checksum of the patched files before copying the overlay: when
the base image (or the upstream tuetenk0pp/sharelatex-full repository, which
drives the base image version) is updated, the build fails instead of silently
mixing the overlay with a newer application version. In that case, re-base the
overlay as described in overlay/README.md.
AGPL-3.0, see LICENSE.
Content type
Image
Digest
sha256:5c752609f…
Size
247 Bytes
Last updated
about 10 hours ago
docker pull lvcs/sharelatex:sha256-fd3ce0d5386d504e11c08131e1289f806c16e34180d40311ac1424660d3a4b65.sig