From 014af7d3f50940dd2e39d82699ad537f28d4d411 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Sun, 17 Aug 2025 23:23:05 +0300 Subject: [PATCH 01/11] Initial test --- ct/overleaf.sh | 45 ++++++++++++++++++++++ frontend/public/json/overleaf.json | 36 ++++++++++++++++++ install/overleaf-install.sh | 61 ++++++++++++++++++++++++++++++ misc/build.func | 2 +- misc/install.func | 2 +- 5 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 ct/overleaf.sh create mode 100644 frontend/public/json/overleaf.json create mode 100644 install/overleaf-install.sh diff --git a/ct/overleaf.sh b/ct/overleaf.sh new file mode 100644 index 000000000..3fd34561f --- /dev/null +++ b/ct/overleaf.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: [YourUserName] +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/overleaf/toolkit + +APP="Overleaf" +var_tags="${var_tags:-latex;docker}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/overleaf-toolkit ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + msg_info "Updating $APP via Overleaf Toolkit" + cd /opt/overleaf-toolkit + git pull -q || true + bin/upgrade || bin/up -d + msg_ok "Update Successful" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" diff --git a/frontend/public/json/overleaf.json b/frontend/public/json/overleaf.json new file mode 100644 index 000000000..8ecec6865 --- /dev/null +++ b/frontend/public/json/overleaf.json @@ -0,0 +1,36 @@ +{ + "name": "Overleaf", + "slug": "overleaf", + "categories": [11], + "date_created": "2025-08-17", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 80, + "documentation": "https://docs.overleaf.com/on-premises", + "website": "https://github.com/overleaf/toolkit", + "logo": "https://upload.wikimedia.org/wikipedia/commons/2/2a/Overleaf_Logo.svg", + "description": "Overleaf is an open-source, real-time collaborative LaTeX editor that compiles projects server-side with TeX Live. This installs the official Overleaf Toolkit on Docker in an LXC and defaults to Community Edition (AGPL-3.0, self-hosted, community-supported). Community Edition targets trusted environments and omits enterprise features such as SSO via SAML/LDAP, sandboxed compiles, optimized TeX Live, and early security notices; these are in Server Pro, which you can switch to later without redoing your configuration.", + "install_methods": [ + { + "type": "default", + "script": "ct/overleaf.sh", + "resources": { + "cpu": 2, + "ram": 4096, + "hdd": 20, + "os": "debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { "text": "After startup, create the first admin at http:///launchpad.", "type": "info" }, + { "text": "Toolkit lives in /opt/overleaf-toolkit. Use bin/up, bin/stop, bin/doctor.", "type": "info" }, + { "text": "After editing /opt/overleaf-toolkit/config/overleaf.rc, redeploy with: cd /opt/overleaf-toolkit && bin/up --build.", "type": "info" } + ] +} diff --git a/install/overleaf-install.sh b/install/overleaf-install.sh new file mode 100644 index 000000000..cb18c8a3b --- /dev/null +++ b/install/overleaf-install.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Copyright (c) 2021-2025 community-scripts ORG +# Author: EEJoshua +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/overleaf/toolkit + +# Import Functions und Setup +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +apt update +apt install -y git ca-certificates curl gnupg +install -d -m 0755 /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc +chmod a+r /etc/apt/keyrings/docker.asc +echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" >/etc/apt/sources.list.d/docker.list +apt update +apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +systemctl enable --now docker +msg_ok "Installed Dependencies" + +msg_info "Setup Overleaf" +install -d -m 0755 /opt +if [[ -d /opt/overleaf-toolkit/.git ]]; then + git -C /opt/overleaf-toolkit pull -q +else + git clone -q https://github.com/overleaf/toolkit.git /opt/overleaf-toolkit +fi +cd /opt/overleaf-toolkit + +bin/init > "$CFG" + +grep -q '^SIBLING_CONTAINERS_ENABLED=' "$CFG" \ + && sed -i 's/^SIBLING_CONTAINERS_ENABLED=.*/SIBLING_CONTAINERS_ENABLED=false/' "$CFG" \ + || echo 'SIBLING_CONTAINERS_ENABLED=false' >> "$CFG" + +bin/up -d +IPV4="$(hostname -I | awk '{print $1}')" +echo "Overleaf is starting. URL: http://${IPV4}" +echo "First step: create the admin user at http://${IPV4}/launchpad" +echo "Toolkit dir: /opt/overleaf-toolkit" +msg_ok "Setup Overleaf" + +motd_ssh +customize + +msg_info "Cleaning up" +apt -y autoremove +apt -y autoclean +msg_ok "Cleaned" \ No newline at end of file diff --git a/misc/build.func b/misc/build.func index c40a57bd1..21292e31b 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1438,7 +1438,7 @@ EOF' fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/${var_install}.sh)" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/main/install/${var_install}.sh)" } destroy_lxc() { diff --git a/misc/install.func b/misc/install.func index e3751c295..a62b95f59 100644 --- a/misc/install.func +++ b/misc/install.func @@ -31,7 +31,7 @@ catch_errors() { # This function handles errors error_handler() { - source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) + source <(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/refs/heads/overleaf/misc/api.func) printf "\e[?25h" local exit_code="$?" local line_number="$1" From cee799ee0cdcfab785bbf44407ec922c3ff50e61 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Sun, 17 Aug 2025 23:26:31 +0300 Subject: [PATCH 02/11] Link update --- misc/build.func | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/build.func b/misc/build.func index 21292e31b..967b005e4 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1438,7 +1438,7 @@ EOF' fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/main/install/${var_install}.sh)" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/refs/heads/overleaf/install/${var_install}.sh)" } destroy_lxc() { From 322552056c63f63baf69dae1fe078edef5b93772 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Sun, 17 Aug 2025 23:32:12 +0300 Subject: [PATCH 03/11] source line --- ct/overleaf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/overleaf.sh b/ct/overleaf.sh index 3fd34561f..88a7a0f05 100644 --- a/ct/overleaf.sh +++ b/ct/overleaf.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash - +source <(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/refs/heads/overleaf/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: [YourUserName] # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE From 8dbc48616daa7d8324d815307d3b46d15fad0e0a Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Sun, 17 Aug 2025 23:42:25 +0300 Subject: [PATCH 04/11] Make install silent --- install/overleaf-install.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/install/overleaf-install.sh b/install/overleaf-install.sh index cb18c8a3b..8bfa0f976 100644 --- a/install/overleaf-install.sh +++ b/install/overleaf-install.sh @@ -14,27 +14,27 @@ network_check update_os msg_info "Installing Dependencies" -apt update -apt install -y git ca-certificates curl gnupg +apt -qq update >/dev/null +$STD apt -qq install -y git ca-certificates curl gnupg install -d -m 0755 /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" >/etc/apt/sources.list.d/docker.list -apt update -apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -systemctl enable --now docker +apt -qq update >/dev/null +$STD apt -qq install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +$STD systemctl enable --now docker msg_ok "Installed Dependencies" msg_info "Setup Overleaf" install -d -m 0755 /opt if [[ -d /opt/overleaf-toolkit/.git ]]; then - git -C /opt/overleaf-toolkit pull -q + $STD git -C /opt/overleaf-toolkit pull -q else - git clone -q https://github.com/overleaf/toolkit.git /opt/overleaf-toolkit + $STD git clone -q https://github.com/overleaf/toolkit.git /opt/overleaf-toolkit fi cd /opt/overleaf-toolkit -bin/init > "$CFG" -bin/up -d +$STD bin/up -d IPV4="$(hostname -I | awk '{print $1}')" echo "Overleaf is starting. URL: http://${IPV4}" echo "First step: create the admin user at http://${IPV4}/launchpad" @@ -56,6 +56,6 @@ motd_ssh customize msg_info "Cleaning up" -apt -y autoremove -apt -y autoclean -msg_ok "Cleaned" \ No newline at end of file +$STD apt -y autoremove +$STD apt -y autoclean +msg_ok "Cleaned" From 49ad54466f2bd49b19f0b0c03ad5e2fff449adbc Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Sun, 17 Aug 2025 23:47:40 +0300 Subject: [PATCH 05/11] Make update silent --- ct/overleaf.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ct/overleaf.sh b/ct/overleaf.sh index 88a7a0f05..4ec262fa2 100644 --- a/ct/overleaf.sh +++ b/ct/overleaf.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source <(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/refs/heads/overleaf/misc/build.func) # Copyright (c) 2021-2025 community-scripts ORG -# Author: [YourUserName] +# Author: EEJoshua # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/overleaf/toolkit @@ -27,16 +27,18 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Updating $APP via Overleaf Toolkit" + msg_info "Updating $APP" cd /opt/overleaf-toolkit - git pull -q || true - bin/upgrade || bin/up -d + $STD git pull -q || true + $STD bin/upgrade || $STD bin/up -d msg_ok "Update Successful" exit } +msg_info "Creating container" start build_container +msg_info "Finalizing" description msg_ok "Completed Successfully!\n" From 07fa8d8b495370e5191f7debb8168f694ea5c1f1 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Sun, 17 Aug 2025 23:50:23 +0300 Subject: [PATCH 06/11] Unnecessary messages --- ct/overleaf.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ct/overleaf.sh b/ct/overleaf.sh index 4ec262fa2..0dc210cd5 100644 --- a/ct/overleaf.sh +++ b/ct/overleaf.sh @@ -35,10 +35,8 @@ function update_script() { exit } -msg_info "Creating container" start build_container -msg_info "Finalizing" description msg_ok "Completed Successfully!\n" From c00a071ac70168161a2b1d6e5a08f65f8c8dcd39 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Mon, 18 Aug 2025 00:05:04 +0300 Subject: [PATCH 07/11] script updates --- install/overleaf-install.sh | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/install/overleaf-install.sh b/install/overleaf-install.sh index 8bfa0f976..4631b1be4 100644 --- a/install/overleaf-install.sh +++ b/install/overleaf-install.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash + # Copyright (c) 2021-2025 community-scripts ORG # Author: EEJoshua # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/overleaf/toolkit -# Import Functions und Setup source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 @@ -14,14 +14,13 @@ network_check update_os msg_info "Installing Dependencies" -apt -qq update >/dev/null -$STD apt -qq install -y git ca-certificates curl gnupg +$STD apt-get install -y git ca-certificates curl gnupg install -d -m 0755 /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc chmod a+r /etc/apt/keyrings/docker.asc echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" >/etc/apt/sources.list.d/docker.list -apt -qq update >/dev/null -$STD apt -qq install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +$STD apt-get update +$STD apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin $STD systemctl enable --now docker msg_ok "Installed Dependencies" @@ -33,7 +32,6 @@ else $STD git clone -q https://github.com/overleaf/toolkit.git /opt/overleaf-toolkit fi cd /opt/overleaf-toolkit - $STD bin/init > "$CFG" +msg_ok "Setup Overleaf" +msg_info "Starting Overleaf" $STD bin/up -d IPV4="$(hostname -I | awk '{print $1}')" -echo "Overleaf is starting. URL: http://${IPV4}" echo "First step: create the admin user at http://${IPV4}/launchpad" -echo "Toolkit dir: /opt/overleaf-toolkit" -msg_ok "Setup Overleaf" +msg_ok "Started Overleaf" motd_ssh customize msg_info "Cleaning up" -$STD apt -y autoremove -$STD apt -y autoclean +$STD apt-get -y autoremove +$STD apt-get -y autoclean msg_ok "Cleaned" From 8264906f61b5e1b2c8bd2b72bbf1c459f125453e Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Mon, 18 Aug 2025 00:08:50 +0300 Subject: [PATCH 08/11] Move message --- ct/overleaf.sh | 2 ++ install/overleaf-install.sh | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ct/overleaf.sh b/ct/overleaf.sh index 0dc210cd5..359018353 100644 --- a/ct/overleaf.sh +++ b/ct/overleaf.sh @@ -43,3 +43,5 @@ msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" +echo -e "${INFO}${YW} First step: create the admin user at:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}/launchpad${CL}" diff --git a/install/overleaf-install.sh b/install/overleaf-install.sh index 4631b1be4..7273cde0b 100644 --- a/install/overleaf-install.sh +++ b/install/overleaf-install.sh @@ -46,8 +46,7 @@ msg_ok "Setup Overleaf" msg_info "Starting Overleaf" $STD bin/up -d -IPV4="$(hostname -I | awk '{print $1}')" -echo "First step: create the admin user at http://${IPV4}/launchpad" + msg_ok "Started Overleaf" motd_ssh From f5b6088315835ba8e8a3d2bac8c910f92b2dd32e Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Mon, 18 Aug 2025 00:10:53 +0300 Subject: [PATCH 09/11] Cosmetics --- ct/overleaf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/overleaf.sh b/ct/overleaf.sh index 359018353..dad658943 100644 --- a/ct/overleaf.sh +++ b/ct/overleaf.sh @@ -27,7 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Updating $APP" + msg_info "Updating $APP\n" cd /opt/overleaf-toolkit $STD git pull -q || true $STD bin/upgrade || $STD bin/up -d From ee72fc087aa33a6f7409faf3fb33bf815106db44 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Mon, 18 Aug 2025 00:13:03 +0300 Subject: [PATCH 10/11] Revert "Cosmetics" This reverts commit f5b6088315835ba8e8a3d2bac8c910f92b2dd32e. --- ct/overleaf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/overleaf.sh b/ct/overleaf.sh index dad658943..359018353 100644 --- a/ct/overleaf.sh +++ b/ct/overleaf.sh @@ -27,7 +27,7 @@ function update_script() { msg_error "No ${APP} Installation Found!" exit fi - msg_info "Updating $APP\n" + msg_info "Updating $APP" cd /opt/overleaf-toolkit $STD git pull -q || true $STD bin/upgrade || $STD bin/up -d From b979a62230b112c6d12f9b2d73519fc9eef59bac Mon Sep 17 00:00:00 2001 From: "DESKTOP-UULMCR6\\Joshua" Date: Mon, 18 Aug 2025 00:22:15 +0300 Subject: [PATCH 11/11] Revert link changes --- ct/overleaf.sh | 2 +- misc/build.func | 2 +- misc/install.func | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ct/overleaf.sh b/ct/overleaf.sh index 359018353..e0112d171 100644 --- a/ct/overleaf.sh +++ b/ct/overleaf.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/refs/heads/overleaf/misc/build.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) # Copyright (c) 2021-2025 community-scripts ORG # Author: EEJoshua # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE diff --git a/misc/build.func b/misc/build.func index 967b005e4..c40a57bd1 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1438,7 +1438,7 @@ EOF' fi msg_ok "Customized LXC Container" - lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/refs/heads/overleaf/install/${var_install}.sh)" + lxc-attach -n "$CTID" -- bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/install/${var_install}.sh)" } destroy_lxc() { diff --git a/misc/install.func b/misc/install.func index a62b95f59..e3751c295 100644 --- a/misc/install.func +++ b/misc/install.func @@ -31,7 +31,7 @@ catch_errors() { # This function handles errors error_handler() { - source <(curl -fsSL https://raw.githubusercontent.com/EEJoshua/ProxmoxVED/refs/heads/overleaf/misc/api.func) + source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/api.func) printf "\e[?25h" local exit_code="$?" local line_number="$1"