From 615b90bc12215ec691ef02183654a40451bee902 Mon Sep 17 00:00:00 2001 From: Jean-Yves <7360784+docjyJ@users.noreply.github.com> Date: Sun, 28 Sep 2025 13:20:50 +0200 Subject: [PATCH] Overleaf draft Signed-off-by: Jean-Yves <7360784+docjyJ@users.noreply.github.com> --- community-containers/overleaf/overleaf.json | 96 +++++++++++++++++++++ community-containers/overleaf/readme.md | 35 ++++++++ 2 files changed, 131 insertions(+) create mode 100644 community-containers/overleaf/overleaf.json create mode 100644 community-containers/overleaf/readme.md diff --git a/community-containers/overleaf/overleaf.json b/community-containers/overleaf/overleaf.json new file mode 100644 index 00000000..135b31a6 --- /dev/null +++ b/community-containers/overleaf/overleaf.json @@ -0,0 +1,96 @@ +{ + "aio_services_v1": [ + { + "container_name": "nextcloud-aio-overleaf-redis", + "display_name": "Overleaf Redis", + "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/overleaf", + "image": "redis", + "image_tag": "7", + "internal_port": "6379", + "restart": "unless-stopped", + "expose": [ + "6379" + ], + "environment": [ + "TZ=%TIMEZONE%" + ], + "volumes": [ + { + "source": "nextcloud_aio_overleaf_redis", + "destination": "/data", + "writeable": true + } + ] + }, + { + "container_name": "nextcloud-aio-overleaf-mongo", + "display_name": "Overleaf MongoDB", + "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/overleaf", + "image": "mongo", + "image_tag": "5", + "internal_port": "27017", + "restart": "unless-stopped", + "expose": [ + "27017" + ], + "environment": [ + "TZ=%TIMEZONE%" + ], + "volumes": [ + { + "source": "nextcloud_aio_overleaf_mongo", + "destination": "/data/db", + "writeable": true + } + ], + "backup_volumes": [ + "nextcloud_aio_overleaf_mongo" + ] + }, + { + "container_name": "nextcloud-aio-overleaf", + "display_name": "Overleaf", + "documentation": "https://github.com/nextcloud/all-in-one/tree/main/community-containers/overleaf", + "image": "sharelatex/sharelatex", + "image_tag": "latest", + "internal_port": "80", + "restart": "unless-stopped", + "depends_on": [ + "nextcloud-aio-overleaf-mongo", + "nextcloud-aio-overleaf-redis" + ], + "ports": [ + { + "ip_binding": "%APACHE_IP_BINDING%", + "port_number": "8050", + "protocol": "tcp" + } + ], + "environment": [ + "TZ=%TIMEZONE%", + "SHARELATEX_MONGO_URL=mongodb://nextcloud-aio-overleaf-mongo:27017/sharelatex", + "SHARELATEX_REDIS_HOST=nextcloud-aio-overleaf-redis", + "SHARELATEX_REDIS_PORT=6379", + "SHARELATEX_APP_NAME=Overleaf" + ], + "volumes": [ + { + "source": "nextcloud_aio_overleaf", + "destination": "/var/lib/sharelatex", + "writeable": true + } + ], + "backup_volumes": [ + "nextcloud_aio_overleaf", + "nextcloud_aio_overleaf_mongo" + ], + "nextcloud_exec_commands": [ + "echo 'Installing integration_overleaf app...'", + "php /var/www/html/occ app:install integration_overleaf", + "php /var/www/html/occ app:enable integration_overleaf", + "echo 'Configuring integration_overleaf base_url...'", + "php /var/www/html/occ config:app:set integration_overleaf base_url --value 'http://%NC_DOMAIN%:8050'" + ] + } + ] +} diff --git a/community-containers/overleaf/readme.md b/community-containers/overleaf/readme.md new file mode 100644 index 00000000..024217b5 --- /dev/null +++ b/community-containers/overleaf/readme.md @@ -0,0 +1,35 @@ +## Overleaf (Community Edition) +This community container deploys Overleaf CE with its required MongoDB and Redis services. + +### Notes +- After adding and starting the container, you can directly visit http://ip.address.of.server:8050/ to access your new Overleaf instance. +- To access Overleaf outside your local network with HTTPS, set up a reverse proxy in front of AIO. You can either follow the generic reverse proxy guide: https://github.com/nextcloud/all-in-one/blob/main/reverse-proxy.md or use the community Caddy container which can be adjusted to forward a subdomain like `overleaf.$NC_DOMAIN` to port 8050 on this server. +- Initial user/admin creation is handled inside Overleaf. This container does not integrate Overleaf authentication with Nextcloud users. +- If you run a firewall (e.g., ufw), ensure port 8050 is allowed or that your reverse proxy can reach it locally. +- The data directories for Overleaf and MongoDB are persisted and included in AIO backups automatically. +- See https://github.com/nextcloud/all-in-one/tree/main/community-containers#community-containers for how to add it to the AIO stack. + +### Nextcloud integration (auto-config) +When this container is added, AIO automatically: +- Installs and enables the Nextcloud app `integration_overleaf`. +- Sets its `base_url` to `http://%NC_DOMAIN%:8050` by default (reachable when accessing the server directly). + +If you publish Overleaf behind a reverse proxy on a subdomain (recommended), change the URL in Nextcloud accordingly, for example: +```bash +sudo docker exec --user www-data -it nextcloud-aio-nextcloud php /var/www/html/occ config:app:set integration_overleaf base_url --value "https://overleaf.%NC_DOMAIN%" +``` + +### Data and backups +- Overleaf data: stored in the volume `nextcloud_aio_overleaf` (mounted at `/var/lib/sharelatex`). +- MongoDB data: stored in the volume `nextcloud_aio_overleaf_mongo` (mounted at `/data/db`). +- Both are included in AIO backup/restore. Redis data is ephemeral by design and not included. + +### Advanced configuration +- The container uses the official `sharelatex/sharelatex` image and configures minimal required environment variables (MongoDB/Redis/Time zone). You can adjust Overleaf settings from the web UI afterwards. +- If you plan to expose Overleaf publicly, consider setting up rate-limiting and fail2ban in front of it. See the community Fail2ban container: https://github.com/nextcloud/all-in-one/tree/main/community-containers/fail2ban + +### Repository +https://github.com/overleaf/overleaf + +### Maintainer +https://github.com/docjyj