From fe0a00d02dde66228927da476df50a52b594338f Mon Sep 17 00:00:00 2001 From: Michel Roegl-Brunner <73236783+michelroegl-brunner@users.noreply.github.com> Date: Fri, 25 Apr 2025 15:11:29 +0200 Subject: [PATCH] Remove Seafile (#4058) --- ct/headers/seafile | 6 - ct/seafile.sh | 43 ----- frontend/public/json/seafile.json | 49 ----- install/seafile-install.sh | 285 ------------------------------ 4 files changed, 383 deletions(-) delete mode 100644 ct/headers/seafile delete mode 100644 ct/seafile.sh delete mode 100644 frontend/public/json/seafile.json delete mode 100644 install/seafile-install.sh diff --git a/ct/headers/seafile b/ct/headers/seafile deleted file mode 100644 index 5095b635a..000000000 --- a/ct/headers/seafile +++ /dev/null @@ -1,6 +0,0 @@ - _____ _____ __ - / ___/___ ____ _/ __(_) /__ - \__ \/ _ \/ __ `/ /_/ / / _ \ - ___/ / __/ /_/ / __/ / / __/ -/____/\___/\__,_/_/ /_/_/\___/ - diff --git a/ct/seafile.sh b/ct/seafile.sh deleted file mode 100644 index 5e1d8a759..000000000 --- a/ct/seafile.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) -# Copyright (c) 2021-2025 tteck -# Author: dave-yap (dave-yap) -# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# Source: https://seafile.com/ - -APP="Seafile" -var_tags="${var_tags:-documents}" -var_cpu="${var_cpu:-2}" -var_ram="${var_ram:-2048}" -var_disk="${var_disk:-20}" -var_os="${var_os:-debian}" -var_version="${var_version:-12}" -var_unprivileged="${var_unprivileged:-1}" - -header_info "$APP" -base_settings - -variables -color -catch_errors - -function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -f /etc/systemd/system/seafile.service ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_ok "No upgrade path available now." - 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}:8000${CL}" \ No newline at end of file diff --git a/frontend/public/json/seafile.json b/frontend/public/json/seafile.json deleted file mode 100644 index 8cda3235b..000000000 --- a/frontend/public/json/seafile.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "Seafile", - "slug": "seafile", - "categories": [ - 12 - ], - "date_created": "2025-03-11", - "type": "ct", - "updateable": false, - "privileged": false, - "interface_port": 8000, - "documentation": "https://manual.seafile.com/11.0/deploy", - "website": "https://seafile.com", - "logo": "https://manual.seafile.com/11.0/media/seafile-transparent-1024.png", - "config_path": "/opt/seafile/conf/seahub_settings.py", - "description": "Seafile is an open source file sync and share platform, focusing on reliability and performance.", - "install_methods": [ - { - "type": "default", - "script": "ct/seafile.sh", - "resources": { - "cpu": 2, - "ram": 2048, - "hdd": 20, - "os": "debian", - "version": "12" - } - } - ], - "default_credentials": { - "username": null, - "password": null - }, - "notes": [ - { - "text": "Application credentials: `cat ~/seafile.creds`", - "type": "info" - }, - { - "text": "Change STORAGE_DIR value in `external-storage.sh` and run `bash external-storage.sh` to use your defined storage instead of internal.", - "type": "info" - }, - { - "text": "Execute `~/domain.sh ` to enable access to Seafile via your domain. Example: ~/domain.sh https://seafile.example.com", - "type": "info" - } - ] -} - diff --git a/install/seafile-install.sh b/install/seafile-install.sh deleted file mode 100644 index 4e2326b39..000000000 --- a/install/seafile-install.sh +++ /dev/null @@ -1,285 +0,0 @@ -#!/usr/bin/env bash - -# Copyright (c) 2021-2025 community-scripts ORG -# Author: dave-yap -# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE -# Source: https://seafile.com/ - -source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" -color -verb_ip6 -catch_errors -setting_up_container -network_check -update_os - -msg_info "Installing Dependencies (Patience)" -$STD apt-get install -y expect -msg_ok "Installed Dependencies" - -msg_info "Installing MariaDB" -$STD apt-get install -y mariadb-server -systemctl start mariadb -msg_ok "Installed MariaDB" - -msg_info "Setup MariaDB for Seafile" -CCNET_DB="ccnet_db" -SEAFILE_DB="seafile_db" -SEAHUB_DB="seahub_db" -DB_USER="seafile" -DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) -ADMIN_EMAIL="admin@localhost.local" -ADMIN_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13) -sudo -u mysql mysql -s -e "CREATE DATABASE $CCNET_DB CHARACTER SET utf8;" -sudo -u mysql mysql -s -e "CREATE DATABASE $SEAFILE_DB CHARACTER SET utf8;" -sudo -u mysql mysql -s -e "CREATE DATABASE $SEAHUB_DB CHARACTER SET utf8;" -sudo -u mysql mysql -s -e "CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PASS';" -sudo -u mysql mysql -s -e "GRANT ALL PRIVILEGES ON $CCNET_DB.* TO '$DB_USER'@localhost;" -sudo -u mysql mysql -s -e "GRANT ALL PRIVILEGES ON $SEAFILE_DB.* TO '$DB_USER'@localhost;" -sudo -u mysql mysql -s -e "GRANT ALL PRIVILEGES ON $SEAHUB_DB.* TO '$DB_USER'@localhost;" -{ - echo "Application Credentials" - echo "CCNET_DB: $CCNET_DB" - echo "SEAFILE_DB: $SEAFILE_DB" - echo "SEAHUB_DB: $SEAHUB_DB" - echo "DB_USER: $DB_USER" - echo "DB_PASS: $DB_PASS" - echo "ADMIN_EMAIL: $ADMIN_EMAIL" - echo "ADMIN_PASS: $ADMIN_PASS" -} >>~/seafile.creds -msg_ok "MariaDB setup for Seafile" - -msg_info "Installing Seafile Python Dependencies" -$STD apt-get install -y \ - python3 \ - python3-dev \ - python3-setuptools \ - python3-pip \ - libmariadb-dev \ - ldap-utils \ - libldap2-dev \ - libsasl2-dev \ - pkg-config -$STD pip3 install \ - django \ - future \ - mysqlclient \ - pymysql \ - pillow \ - pylibmc \ - captcha \ - markupsafe \ - jinja2 \ - sqlalchemy \ - psd-tools \ - django-pylibmc \ - django_simple_captcha \ - djangosaml2 \ - pysaml2 \ - pycryptodome \ - cffi \ - lxml \ - python-ldap -msg_ok "Installed Seafile Python Dependecies" - -msg_info "Installing Seafile" -IP=$(ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1) -mkdir -p /opt/seafile -useradd seafile -mkdir -p /home/seafile -chown seafile: /home/seafile -chown seafile: /opt/seafile -$STD su - seafile -c "curl -fsSL https://s3.eu-central-1.amazonaws.com/download.seadrive.org/seafile-server_11.0.13_x86-64.tar.gz -o seafile-server_11.0.13_x86-64.tar.gz" -$STD su - seafile -c "tar -xzf seafile-server_11.0.13_x86-64.tar.gz -C /opt/seafile/" -$STD su - seafile -c "expect <>/opt/seafile/conf/seahub_settings.py -CACHES = { - 'default': { - 'BACKEND': 'django_pylibmc.memcached.PyLibMCCache', - 'LOCATION': '127.0.0.1:11211', - }, -} -EOF -msg_ok "Memcached Started" - -msg_info "Adjusting Conf files" -sed -i "0,/127.0.0.1/s/127.0.0.1/0.0.0.0/" /opt/seafile/conf/gunicorn.conf.py -sed -i "0,/SERVICE_URL = \"http:\/\/$IP\"/s/SERVICE_URL = \"http:\/\/$IP\"/SERVICE_URL = \"http:\/\/$IP:8000\"/" /opt/seafile/conf/seahub_settings.py -echo -e "\nFILE_SERVER_ROOT = \"http://$IP:8082\"" >>/opt/seafile/conf/seahub_settings.py -echo -e "CSRF_TRUSTED_ORIGINS = [\"http://$IP/\"]" >>/opt/seafile/conf/seahub_settings.py -echo -e "ALLOWED_HOSTS = [\"$IP\"]" >>/opt/seafile/conf/seahub_settings.py -echo -e "CSRF_TRUSTED_ORIGINS = ['http://$IP/']" >>/opt/seafile/conf/seahub_settings.py -msg_ok "Conf files adjusted" - -msg_info "Setting up Seafile" -$STD su - seafile -c "bash /opt/seafile/seafile-server-latest/seafile.sh start" -$STD su - seafile -c "expect </etc/systemd/system/seafile.service -[Unit] -Description=Seafile File-hosting -After=network.target mysql.service memcached.service -Wants=mysql.service memcached.service - -[Service] -Type=oneshot -User=seafile -Group=seafile -WorkingDirectory=/opt/seafile -RemainAfterExit=yes - -ExecStart=/opt/seafile/seafile-server-latest/seafile.sh start -ExecStart=/opt/seafile/seafile-server-latest/seahub.sh start -ExecStop=/opt/seafile/seafile-server-latest/seahub.sh stop -ExecStop=/opt/seafile/seafile-server-latest/seafile.sh stop - -Restart=on-failure -RestartSec=5s - -[Install] -WantedBy=multi-user.target -EOF -systemctl enable --now -q seafile.service -msg_ok "Created Services" - -msg_info "Creating External Storage script" -cat <<'EOF' >~/external-storage.sh -#!/bin/bash -STORAGE_DIR="/path/to/your/external/storage" - -# Move the seafile-data folder to external storage -mv /opt/seafile/seafile-data $STORAGE_DIR/seafile-data - -# Create a symlink for access -ln -s $STORAGE_DIR/seafile-data /opt/seafile/seafile-data -EOF -chmod +x ~/external-storage.sh -msg_ok "Bash Script for External Storage created" - -msg_info "Creating Domain access script" -cat <<'EOF' >~/domain.sh -#!/bin/bash -DOMAIN=$1 -IP=$(ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1) -DOMAIN_NOSCHEME=$(echo $DOMAIN | sed 's|^https://||') - -#Change the CORS to provided domain -sed -i "s|SERVICE_URL = \"http://$IP:8000\"|SERVICE_URL = \"$DOMAIN\"|g" /opt/seafile/conf/seahub_settings.py -sed -i "s|CSRF_TRUSTED_ORIGINS = \[\"http://$IP/\"\]|CSRF_TRUSTED_ORIGINS = \[\"$DOMAIN/\"\]|g" /opt/seafile/conf/seahub_settings.py -sed -i "s|FILE_SERVER_ROOT = \"http://$IP:8082\"|FILE_SERVER_ROOT = \"$DOMAIN/seafhttp\"|g" /opt/seafile/conf/seahub_settings.py -sed -i "s|ALLOWED_HOSTS = \[\"$IP\"\]|ALLOWED_HOSTS = \[\"\.$DOMAIN_NOSCHEME\"\]|g" /opt/seafile/conf/seahub_settings.py - -systemctl restart seafile -echo "Seafile server restarted! Access it at $DOMAIN." -EOF -chmod +x ~/domain.sh -msg_ok "Bash Script for Domain access created" - -motd_ssh -customize - -msg_info "Cleaning up" -rm -rf /home/seafile/seafile*.tar.gz -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned"