commit ce098eceb108f94f89d00909cace929a72096698 Author: timoschneider Date: Thu Feb 26 10:45:13 2026 +0100 added existing config diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..1261132 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "overleaf"] + path = overleaf + url = https://github.com/overleaf/overleaf.git diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..3deea35 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,151 @@ +version: '3' +services: + overleaf: + restart: always + # Server Pro users: + # image: quay.io/sharelatex/sharelatex-pro + image: hub.anxietyprime.de/sharelatex:v6 + container_name: overleaf + depends_on: + mongo: + condition: service_healthy + redis-overleaf: + condition: service_started + links: + - mongo + - redis-overleaf + stop_grace_period: 60s + volumes: + - ./overleaf:/var/lib/overleaf + ######################################################################## + #### Server Pro: Uncomment the following line to mount the docker #### + #### socket, required for Sibling Containers to work #### + ######################################################################## + # - /var/run/docker.sock:/var/run/docker.sock + labels: + - "traefik.enable=true" + - "traefik.http.routers.overleaf.rule=Host(`tex.anxietyprime.de`)" + - "traefik.http.routers.overleaf.entrypoints=websecure" + - "traefik.http.routers.overleaf.tls.certresolver=letsencrypt" + - "traefik.http.services.overleaf.loadbalancer.server.port=80" + - "traefik.http.routers.overleaf.service=overleaf" + + environment: + + OVERLEAF_APP_NAME: Overleaf Dodo Edition + + OVERLEAF_MONGO_URL: mongodb://mongo:27017/sharelatex + + # Same property, unfortunately with different names in + # different locations + OVERLEAF_REDIS_HOST: redis-overleaf + REDIS_HOST: redis-overleaf + + ENABLED_LINKED_FILE_TYPES: 'project_file,project_output_file' + + # Enables Thumbnail generation using ImageMagick + ENABLE_CONVERSIONS: 'true' + + # Disables email confirmation requirement + EMAIL_CONFIRMATION_DISABLED: 'true' + + # temporary fix for LuaLaTex compiles + # see https://github.com/overleaf/overleaf/issues/695 + TEXMFVAR: /var/lib/overleaf/tmp/texmf-var + + ## Set for SSL via nginx-proxy + #VIRTUAL_HOST: 103.112.212.22 + + OVERLEAF_SITE_URL: https://tex.anxietyprime.de + # OVERLEAF_NAV_TITLE: Overleaf Community Edition + # OVERLEAF_HEADER_IMAGE_URL: http://example.com/mylogo.png + # OVERLEAF_ADMIN_EMAIL: support@it.com + + # OVERLEAF_LEFT_FOOTER: '[{"text": "Another page I want to link to can be found here"} ]' + # OVERLEAF_RIGHT_FOOTER: '[{"text": "Hello I am on the Right"} ]' + + # OVERLEAF_EMAIL_FROM_ADDRESS: "hello@example.com" + + # OVERLEAF_EMAIL_AWS_SES_ACCESS_KEY_ID: + # OVERLEAF_EMAIL_AWS_SES_SECRET_KEY: + + # OVERLEAF_EMAIL_SMTP_HOST: smtp.example.com + # OVERLEAF_EMAIL_SMTP_PORT: 587 + # OVERLEAF_EMAIL_SMTP_SECURE: false + # OVERLEAF_EMAIL_SMTP_USER: + # OVERLEAF_EMAIL_SMTP_PASS: + # OVERLEAF_EMAIL_SMTP_TLS_REJECT_UNAUTH: true + # OVERLEAF_EMAIL_SMTP_IGNORE_TLS: false + # OVERLEAF_EMAIL_SMTP_NAME: '127.0.0.1' + # OVERLEAF_EMAIL_SMTP_LOGGER: true + # OVERLEAF_CUSTOM_EMAIL_FOOTER: "This system is run by department x" + + # ENABLE_CRON_RESOURCE_DELETION: true + + ################ + ## Server Pro ## + ################ + + # SANDBOXED_COMPILES: 'true' + + # SANDBOXED_COMPILES_SIBLING_CONTAINERS: 'true' + # SANDBOXED_COMPILES_HOST_DIR: '/var/sharelatex_data/data/compiles' + + # DOCKER_RUNNER: 'false' + + ## Works with test LDAP server shown at bottom of docker compose + # OVERLEAF_LDAP_URL: 'ldap://ldap:389' + # OVERLEAF_LDAP_SEARCH_BASE: 'ou=people,dc=planetexpress,dc=com' + # OVERLEAF_LDAP_SEARCH_FILTER: '(uid={{username}})' + # OVERLEAF_LDAP_BIND_DN: 'cn=admin,dc=planetexpress,dc=com' + # OVERLEAF_LDAP_BIND_CREDENTIALS: 'GoodNewsEveryone' + # OVERLEAF_LDAP_EMAIL_ATT: 'mail' + # OVERLEAF_LDAP_NAME_ATT: 'cn' + # OVERLEAF_LDAP_LAST_NAME_ATT: 'sn' + # OVERLEAF_LDAP_UPDATE_USER_DETAILS_ON_LOGIN: 'true' + + # OVERLEAF_TEMPLATES_USER_ID: "578773160210479700917ee5" + # OVERLEAF_NEW_PROJECT_TEMPLATE_LINKS: '[ {"name":"All Templates","url":"/templates/all"}]' + + + # OVERLEAF_PROXY_LEARN: "true" + + mongo: + restart: always + image: mongo:6.0 + container_name: mongo + volumes: + - ./mongo_data:/data/db + - ./mongodb-init-replica-set.js:/docker-entrypoint-initdb.d/mongodb-init-replica-set.js:ro + environment: + MONGO_INITDB_DATABASE: sharelatex + extra_hosts: + # Required when using the automatic database setup for initializing the replica set. + # This override is not needed when running the setup after starting up mongo. + - mongo:127.0.0.1 + command: '--replSet overleaf' + healthcheck: + test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet + interval: 10s + timeout: 10s + retries: 5 + + redis-overleaf: + restart: always + image: redis:6.2 + container_name: redis-overleaf + volumes: + - ./redis_data:/data + +networks: + default: + external: + name: traefik + overleaf: + external: false + mongo: + external: false + mongo-overleaf-init: + external: false + redis-overleaf: + external: false diff --git a/mongodb-init-replica-set.js b/mongodb-init-replica-set.js new file mode 100644 index 0000000..8d99377 --- /dev/null +++ b/mongodb-init-replica-set.js @@ -0,0 +1 @@ +rs.initiate({ _id: "overleaf", members: [ { _id: 0, host: "mongo:27017" } ] }) diff --git a/overleaf b/overleaf new file mode 160000 index 0000000..6ca1a9e --- /dev/null +++ b/overleaf @@ -0,0 +1 @@ +Subproject commit 6ca1a9e472adcfa385ef85bb4a8923ab8397fd26 diff --git a/server-ce/Dockerfile b/server-ce/Dockerfile new file mode 100644 index 0000000..9a0957c --- /dev/null +++ b/server-ce/Dockerfile @@ -0,0 +1,180 @@ +# --------------------------------------------- +# Overleaf Community Edition (overleaf/overleaf) +# --------------------------------------------- + +ARG OVERLEAF_BASE_TAG=sharelatex/sharelatex-base:latest +FROM $OVERLEAF_BASE_TAG + +WORKDIR /overleaf + +# Add required source files +# ------------------------- +ADD server-ce/genScript.js /overleaf/genScript.js +ADD server-ce/services.js /overleaf/services.js +ADD package.json package-lock.json /overleaf/ +ADD libraries/ /overleaf/libraries/ +ADD services/ /overleaf/services/ +ADD tools/migrations/ /overleaf/tools/migrations/ + +# Add npm patches +# ----------------------- +ADD patches/ /overleaf/patches + +# Install npm dependencies and build webpack assets +# ------------------------ +RUN --mount=type=cache,target=/root/.cache \ + --mount=type=cache,target=/root/.npm \ + --mount=type=cache,target=/overleaf/services/web/node_modules/.cache,id=server-ce-webpack-cache \ + --mount=type=tmpfs,target=/tmp true \ +&& node genScript install | bash \ +&& node genScript compile | bash + +# Copy runit service startup scripts to its location +# -------------------------------------------------- +ADD server-ce/runit /etc/service + +# Copy runit global settings to its location +# ------------------------------------------ +ADD server-ce/config/env.sh /etc/overleaf/env.sh + +# Configure nginx +# --------------- +ADD server-ce/nginx/nginx.conf.template /etc/nginx/templates/nginx.conf.template +ADD server-ce/nginx/overleaf.conf /etc/nginx/sites-enabled/overleaf.conf +ADD server-ce/nginx/clsi-nginx.conf /etc/nginx/sites-enabled/clsi-nginx.conf + +# Configure log rotation +# ---------------------- +ADD server-ce/logrotate/overleaf /etc/logrotate.d/overleaf +RUN chmod 644 /etc/logrotate.d/overleaf + +# Configure cron tasks +# ---------------------- +ADD server-ce/cron /overleaf/cron +ADD server-ce/config/crontab-history /etc/cron.d/crontab-history +RUN chmod 600 /etc/cron.d/crontab-history +ADD server-ce/config/crontab-deletion /etc/cron.d/crontab-deletion +RUN chmod 600 /etc/cron.d/crontab-deletion + +# Copy Phusion Image startup and shutdown scripts to their locations +# ------------------------------------------------------------------ +COPY server-ce/init_scripts/ /etc/my_init.d/ +COPY server-ce/init_preshutdown_scripts/ /etc/my_init.pre_shutdown.d/ + +# Copy app settings files +# ----------------------- +COPY server-ce/config/settings.js /etc/overleaf/settings.js + +# Copy history-v1 files +# ----------------------- +COPY server-ce/config/production.json /overleaf/services/history-v1/config/production.json +COPY server-ce/config/custom-environment-variables.json /overleaf/services/history-v1/config/custom-environment-variables.json + +# Copy grunt thin wrapper +# ----------------------- +ADD server-ce/bin/grunt /usr/local/bin/grunt +RUN chmod +x /usr/local/bin/grunt + +# Copy history helper scripts +# --------------------------- +ADD server-ce/bin/flush-history-queues /overleaf/bin/flush-history-queues +RUN chmod +x /overleaf/bin/flush-history-queues +ADD server-ce/bin/force-history-resyncs /overleaf/bin/force-history-resyncs +RUN chmod +x /overleaf/bin/force-history-resyncs + +# Copy Latexmkrc +# ----------------------- +COPY server-ce/config/latexmkrc /usr/local/share/latexmk/LatexMk + +# File that controls open|closed status of the site +# ------------------------------------------------- +ENV SITE_MAINTENANCE_FILE="/etc/overleaf/site_status" +RUN touch $SITE_MAINTENANCE_FILE + +# Set Environment Variables +# -------------------------------- +ENV OVERLEAF_CONFIG=/etc/overleaf/settings.js + +ENV WEB_API_USER="overleaf" +ENV ADMIN_PRIVILEGE_AVAILABLE="true" + +ENV OVERLEAF_APP_NAME="Overleaf Community Edition" + +ENV OPTIMISE_PDF="true" + +# Phusion Image timeouts before sending SIGKILL to processes +# ---------------------------------------------------------- +ENV KILL_PROCESS_TIMEOUT=55 +ENV KILL_ALL_PROCESSES_TIMEOUT=55 +ENV GRACEFUL_SHUTDOWN_DELAY_SECONDS=1 + +ENV NODE_ENV="production" +ENV LOG_LEVEL="info" + +# Install all required TeX Live packages (sorted, no duplicates) and symlink biber +RUN tlmgr install \ + abstract \ + acro \ + adjustbox \ + amsfonts \ + amsmath \ + babel \ + babel-english \ + babel-german \ + beamer \ + biblatex \ + biblatex-iso690 \ + biber \ + booktabs \ + caption \ + cm-super \ + cmap \ + comment \ + csquotes \ + enumitem \ + environ \ + eurosym \ + everyshi \ + float \ + floatbytocbasic \ + glossaries \ + graphics \ + hyperxmp \ + ifmtarg \ + ifoddpage \ + koma-script \ + lastpage \ + lipsum \ + listings \ + lscapeenhanced \ + microtype \ + multirow \ + ncctools \ + pdfpages \ + pdflscape \ + pgfplots \ + pmboxdraw \ + preprint \ + scrhack \ + setspace \ + siunitx \ + silence \ + subfigure \ + supertabular \ + tabu \ + textcase \ + tikzpagenodes \ + titling \ + todonotes \ + totpages \ + translations \ + ulem \ + was \ + xcolor \ + xstring + +RUN ln -s /usr/local/texlive/2025/bin/aarch64-linux/biber /usr/local/bin/biber + +EXPOSE 80 + +ENTRYPOINT ["/sbin/my_init"]