Compare commits

..

13 Commits

Author SHA1 Message Date
community-scripts-pr-app[bot]
6bb97836b6 Update CHANGELOG.md (#4068) 2025-04-26 20:20:22 +02:00
George Liu
89bef0fb41 Element Synapse: Fix install script cd command error (#4066)
* Fix cd directory

* Point to forked repo for testing

* Point ct script to forked repo for testing

* Revert paths from fork back to base

* Update install/elementsynapse-install.sh

---------

Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
2025-04-26 03:36:40 +02:00
community-scripts-pr-app[bot]
51c4eba520 Update CHANGELOG.md (#4061)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-25 15:17:30 +02:00
community-scripts-pr-app[bot]
71a659e5b9 Update CHANGELOG.md (#4060)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-25 15:14:22 +02:00
Michel Roegl-Brunner
18e1e7d0b9 Only show update source when app is marked updateable (#4059) 2025-04-25 15:12:12 +02:00
Michel Roegl-Brunner
fe0a00d02d Remove Seafile (#4058) 2025-04-25 15:11:29 +02:00
community-scripts-pr-app[bot]
9068dbb7a2 Update CHANGELOG.md (#4056)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-25 14:45:43 +02:00
community-scripts-pr-app[bot]
8b489a9554 Update versions.json (#4057)
Co-authored-by: GitHub Actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-25 14:43:18 +02:00
Michel Roegl-Brunner
70e0d31f58 Update filebrowser.json (#4055) 2025-04-25 12:44:19 +02:00
community-scripts-pr-app[bot]
cd35b9b9a5 Update CHANGELOG.md (#4049)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-25 12:13:40 +02:00
Slaviša Arežina
2852c5b374 Check if Synapse-Admin service exists (#4050) 2025-04-25 08:42:11 +02:00
community-scripts-pr-app[bot]
2251f6bb5e Update versions.json (#4047)
Co-authored-by: GitHub Actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-04-25 08:41:24 +02:00
CanbiZ
98b8895de0 quickfix double " 2025-04-25 08:24:15 +02:00
11 changed files with 149 additions and 500 deletions

View File

@@ -14,6 +14,36 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment. All LXC instances created using this repository come pre-installed with Midnight Commander, which is a command-line tool (`mc`) that offers a user-friendly file and directory management interface for the terminal environment.
## 2025-04-26
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- Element Synapse: Fix install script cd command error [@thegeorgeliu](https://github.com/thegeorgeliu) ([#4066](https://github.com/community-scripts/ProxmoxVE/pull/4066))
## 2025-04-25
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- Element Synapse: Fix update for older versions [@tremor021](https://github.com/tremor021) ([#4050](https://github.com/community-scripts/ProxmoxVE/pull/4050))
### 🌐 Website
- #### 🐞 Bug Fixes
- Only show update source when app is marked updateable [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#4059](https://github.com/community-scripts/ProxmoxVE/pull/4059))
- #### 📝 Script Information
- Filebrowser: Add Category Files & Donwloads [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#4055](https://github.com/community-scripts/ProxmoxVE/pull/4055))
### 💥 Breaking Changes
- Removal of Seafile due to recurring problems [@michelroegl-brunner](https://github.com/michelroegl-brunner) ([#4058](https://github.com/community-scripts/ProxmoxVE/pull/4058))
## 2025-04-24 ## 2025-04-24
### 🚀 Updated Scripts ### 🚀 Updated Scripts

View File

@@ -51,7 +51,7 @@ function update_script() {
cp -r /opt/docmost/data /opt/ cp -r /opt/docmost/data /opt/
rm -rf /opt/docmost rm -rf /opt/docmost
temp_file=$(mktemp) temp_file=$(mktemp)
curl -fsSL "https://github.com/docmost/docmost/archive/refs/tags/v${RELEASE}.tar.gz" -o ""$temp_file"" curl -fsSL "https://github.com/docmost/docmost/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar -xzf "$temp_file" tar -xzf "$temp_file"
mv docmost-${RELEASE} /opt/docmost mv docmost-${RELEASE} /opt/docmost
cd /opt/docmost cd /opt/docmost

View File

@@ -47,6 +47,7 @@ function update_script() {
$STD apt-get -y upgrade $STD apt-get -y upgrade
msg_ok "Updated $APP LXC" msg_ok "Updated $APP LXC"
if [[ -f /systemd/system/synapse-admin.service ]]; then
msg_info "Updating Synapse-Admin" msg_info "Updating Synapse-Admin"
RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/"${APP}"_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then if [[ "${RELEASE}" != "$(cat /opt/"${APP}"_version.txt)" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
@@ -65,6 +66,7 @@ function update_script() {
else else
msg_ok "No update required. ${APP} is already at v${RELEASE}" msg_ok "No update required. ${APP} is already at v${RELEASE}"
fi fi
fi
exit exit
} }

View File

@@ -1,6 +0,0 @@
_____ _____ __
/ ___/___ ____ _/ __(_) /__
\__ \/ _ \/ __ `/ /_/ / / _ \
___/ / __/ /_/ / __/ / / __/
/____/\___/\__,_/_/ /_/_/\___/

View File

@@ -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}"

View File

@@ -1,7 +1,7 @@
{ {
"name": "File Browser", "name": "File Browser",
"slug": "filebrowser", "slug": "filebrowser",
"categories": [1], "categories": [1, 11],
"date_created": "2024-05-02", "date_created": "2024-05-02",
"type": "addon", "type": "addon",
"updateable": false, "updateable": false,

View File

@@ -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 <FULL_DOMAIN_URL_WITH_HTTPS_OR_HTTP>` to enable access to Seafile via your domain. Example: ~/domain.sh https://seafile.example.com",
"type": "info"
}
]
}

View File

@@ -1,8 +1,103 @@
[ [
{
"name": "zitadel/zitadel",
"version": "v2.71.8",
"date": "2025-04-25T11:50:04Z"
},
{
"name": "photoprism/photoprism",
"version": "250425-21ddba459",
"date": "2025-04-25T11:18:53Z"
},
{ {
"name": "fhem/fhem-mirror", "name": "fhem/fhem-mirror",
"version": "6.2", "version": "6.2",
"date": "2025-04-24T10:35:55Z" "date": "2025-04-25T10:34:09Z"
},
{
"name": "home-assistant/core",
"version": "2025.4.4",
"date": "2025-04-25T07:47:57Z"
},
{
"name": "donaldzou/WGDashboard",
"version": "v4.2.2",
"date": "2025-04-25T07:42:03Z"
},
{
"name": "evcc-io/evcc",
"version": "0.203.3",
"date": "2025-04-25T06:29:28Z"
},
{
"name": "mattermost/mattermost",
"version": "v10.6.2",
"date": "2025-04-15T08:14:23Z"
},
{
"name": "Jackett/Jackett",
"version": "v0.22.1823",
"date": "2025-04-25T05:52:52Z"
},
{
"name": "goauthentik/authentik",
"version": "version/2025.4.0-rc1",
"date": "2025-04-25T04:53:56Z"
},
{
"name": "immich-app/immich",
"version": "v1.132.2",
"date": "2025-04-25T03:07:06Z"
},
{
"name": "moghtech/komodo",
"version": "v1.17.3",
"date": "2025-04-25T02:33:19Z"
},
{
"name": "docmost/docmost",
"version": "v0.20.3",
"date": "2025-04-24T22:33:32Z"
},
{
"name": "mongodb/mongo",
"version": "r7.0.19",
"date": "2025-04-24T20:59:43Z"
},
{
"name": "keycloak/keycloak",
"version": "26.2.1",
"date": "2025-04-23T12:17:17Z"
},
{
"name": "rogerfar/rdt-client",
"version": "v2.0.110",
"date": "2025-04-24T19:11:06Z"
},
{
"name": "cross-seed/cross-seed",
"version": "v6.11.2",
"date": "2025-02-26T14:54:49Z"
},
{
"name": "dotnetfactory/fluid-calendar",
"version": "v1.4.0",
"date": "2025-04-24T16:20:17Z"
},
{
"name": "jhuckaby/Cronicle",
"version": "v0.9.79",
"date": "2025-04-24T15:53:43Z"
},
{
"name": "openobserve/openobserve",
"version": "v0.14.6-rc8",
"date": "2025-04-24T15:39:41Z"
},
{
"name": "Checkmk/checkmk",
"version": "v2.3.0p31",
"date": "2025-04-24T15:08:03Z"
}, },
{ {
"name": "glpi-project/glpi", "name": "glpi-project/glpi",
@@ -19,46 +114,16 @@
"version": "release-1.23.0", "version": "release-1.23.0",
"date": "2025-04-24T08:07:21Z" "date": "2025-04-24T08:07:21Z"
}, },
{
"name": "Jackett/Jackett",
"version": "v0.22.1822",
"date": "2025-04-24T06:06:38Z"
},
{ {
"name": "inventree/InvenTree", "name": "inventree/InvenTree",
"version": "0.17.11", "version": "0.17.11",
"date": "2025-04-24T05:25:55Z" "date": "2025-04-24T05:25:55Z"
}, },
{
"name": "openobserve/openobserve",
"version": "v0.14.6-rc7",
"date": "2025-04-24T04:02:56Z"
},
{
"name": "rogerfar/rdt-client",
"version": "v2.0.109",
"date": "2025-04-24T03:55:08Z"
},
{ {
"name": "syncthing/syncthing", "name": "syncthing/syncthing",
"version": "v2.0.0-beta.9", "version": "v2.0.0-beta.9",
"date": "2025-04-12T13:58:29Z" "date": "2025-04-12T13:58:29Z"
}, },
{
"name": "immich-app/immich",
"version": "v1.132.1",
"date": "2025-04-23T22:08:21Z"
},
{
"name": "keycloak/keycloak",
"version": "26.2.1",
"date": "2025-04-23T12:17:17Z"
},
{
"name": "mongodb/mongo",
"version": "r6.0.22",
"date": "2025-04-23T19:53:55Z"
},
{ {
"name": "Radarr/Radarr", "name": "Radarr/Radarr",
"version": "v5.22.4.9896", "version": "v5.22.4.9896",
@@ -94,26 +159,11 @@
"version": "v24.8", "version": "v24.8",
"date": "2025-03-18T07:33:51Z" "date": "2025-03-18T07:33:51Z"
}, },
{
"name": "docmost/docmost",
"version": "v0.20.1",
"date": "2025-04-23T13:44:12Z"
},
{
"name": "Checkmk/checkmk",
"version": "v2.3.0p31-rc1",
"date": "2025-04-23T13:16:47Z"
},
{ {
"name": "redis/redis", "name": "redis/redis",
"version": "7.4.3", "version": "7.4.3",
"date": "2025-04-23T12:00:04Z" "date": "2025-04-23T12:00:04Z"
}, },
{
"name": "donaldzou/WGDashboard",
"version": "v4.2.1",
"date": "2025-04-23T11:42:05Z"
},
{ {
"name": "Graylog2/graylog2-server", "name": "Graylog2/graylog2-server",
"version": "6.3.0-alpha.1", "version": "6.3.0-alpha.1",
@@ -124,11 +174,6 @@
"version": "337", "version": "337",
"date": "2025-04-23T08:26:31Z" "date": "2025-04-23T08:26:31Z"
}, },
{
"name": "mattermost/mattermost",
"version": "v10.6.2",
"date": "2025-04-15T08:14:23Z"
},
{ {
"name": "zabbix/zabbix", "name": "zabbix/zabbix",
"version": "7.2.6", "version": "7.2.6",
@@ -139,16 +184,6 @@
"version": "v7.4.1", "version": "v7.4.1",
"date": "2025-04-23T06:40:34Z" "date": "2025-04-23T06:40:34Z"
}, },
{
"name": "jhuckaby/Cronicle",
"version": "v0.9.78",
"date": "2025-04-23T01:38:28Z"
},
{
"name": "cross-seed/cross-seed",
"version": "v6.11.2",
"date": "2025-02-26T14:54:49Z"
},
{ {
"name": "minio/minio", "name": "minio/minio",
"version": "RELEASE.2025-04-22T22-12-26Z", "version": "RELEASE.2025-04-22T22-12-26Z",
@@ -169,11 +204,6 @@
"version": "jenkins-2.507", "version": "jenkins-2.507",
"date": "2025-04-22T15:22:53Z" "date": "2025-04-22T15:22:53Z"
}, },
{
"name": "evcc-io/evcc",
"version": "0.203.2",
"date": "2025-04-22T15:07:28Z"
},
{ {
"name": "OliveTin/OliveTin", "name": "OliveTin/OliveTin",
"version": "2025.4.22", "version": "2025.4.22",
@@ -294,16 +324,6 @@
"version": "v11.8.7", "version": "v11.8.7",
"date": "2025-04-19T11:19:29Z" "date": "2025-04-19T11:19:29Z"
}, },
{
"name": "home-assistant/core",
"version": "2025.4.3",
"date": "2025-04-19T10:23:38Z"
},
{
"name": "moghtech/komodo",
"version": "v1.17.2",
"date": "2025-04-19T06:56:25Z"
},
{ {
"name": "ollama/ollama", "name": "ollama/ollama",
"version": "v0.6.6", "version": "v0.6.6",
@@ -539,16 +559,6 @@
"version": "cassandra-5.0.4", "version": "cassandra-5.0.4",
"date": "2025-04-10T16:32:00Z" "date": "2025-04-10T16:32:00Z"
}, },
{
"name": "zitadel/zitadel",
"version": "v2.69.10",
"date": "2025-04-09T12:16:51Z"
},
{
"name": "goauthentik/authentik",
"version": "version/2025.2.4",
"date": "2025-04-08T18:39:57Z"
},
{ {
"name": "linkwarden/linkwarden", "name": "linkwarden/linkwarden",
"version": "v2.10.0", "version": "v2.10.0",
@@ -764,11 +774,6 @@
"version": "v0.34.1", "version": "v0.34.1",
"date": "2025-03-25T18:11:12Z" "date": "2025-03-25T18:11:12Z"
}, },
{
"name": "dotnetfactory/fluid-calendar",
"version": "v1.3.0",
"date": "2025-03-25T15:55:02Z"
},
{ {
"name": "hansmi/prometheus-paperless-exporter", "name": "hansmi/prometheus-paperless-exporter",
"version": "v0.0.7", "version": "v0.0.7",
@@ -814,11 +819,6 @@
"version": "v2.7.6", "version": "v2.7.6",
"date": "2025-03-21T19:24:53Z" "date": "2025-03-21T19:24:53Z"
}, },
{
"name": "photoprism/photoprism",
"version": "250321-57590c48b",
"date": "2025-03-21T11:48:16Z"
},
{ {
"name": "seanmorley15/AdventureLog", "name": "seanmorley15/AdventureLog",
"version": "v0.9.0", "version": "v0.9.0",

View File

@@ -64,7 +64,7 @@ export default function Buttons({ item }: { item: Script }) {
icon: <Code className="h-4 w-4" />, icon: <Code className="h-4 w-4" />,
text: "Install Source", text: "Install Source",
}, },
updateSourceUrl && { updateSourceUrl && item.updateable && {
href: updateSourceUrl, href: updateSourceUrl,
icon: <RefreshCcw className="h-4 w-4" />, icon: <RefreshCcw className="h-4 w-4" />,
text: "Update Source", text: "Update Source",

View File

@@ -64,7 +64,7 @@ mkdir -p /opt/synapse-admin
RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }') RELEASE=$(curl -fsSL https://api.github.com/repos/etkecc/synapse-admin/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
curl -fsSL "https://github.com/etkecc/synapse-admin/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file" curl -fsSL "https://github.com/etkecc/synapse-admin/archive/refs/tags/v${RELEASE}.tar.gz" -o "$temp_file"
tar xzf "$temp_file" -C /opt/synapse-admin --strip-components=1 tar xzf "$temp_file" -C /opt/synapse-admin --strip-components=1
cd /opt/synapse-adminsys cd /opt/synapse-admin
$STD yarn install --ignore-engines $STD yarn install --ignore-engines
msg_ok "Installed Element Synapse" msg_ok "Installed Element Synapse"

View File

@@ -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 <<EOF
spawn bash /opt/seafile/seafile-server-11.0.13/setup-seafile-mysql.sh
expect {
\"Press ENTER to continue\" {
send \"\r\"
}
}
expect {
\"What is the name of the server\" {
send \"Seafile\r\"
}
}
expect {
\"What is the ip or domain of the server\" {
send \"$IP\r\"
}
}
expect {
\"Which port do you want to use for the seafile fileserver\" {
send \"8082\r\"
}
}
expect {
\"1 or 2\" {
send \"2\r\"
}
}
expect {
\"What is the host of mysql server\" {
send \"localhost\r\"
}
}
expect {
\"What is the port of mysql server\" {
send \"3306\r\"
}
}
expect {
\"Which mysql user to use for seafile\" {
send \"seafile\r\"
}
}
expect {
\"What is the password for mysql user\" {
send \"$DB_PASS\r\"
}
}
expect {
\"Enter the existing database name for ccnet\" {
send \"$CCNET_DB\r\"
}
}
expect {
\"Enter the existing database name for seafile\" {
send \"$SEAFILE_DB\r\"
}
}
expect {
\"Enter the existing database name for seahub\" {
send \"$SEAHUB_DB\r\"
}
}
expect {
\"Press ENTER to continue, or Ctrl-C to abort\" {
send \"\r\"
}
}
expect eof
EOF"
msg_ok "Installed Seafile"
msg_info "Setting up Memcached"
$STD apt-get install -y \
memcached \
libmemcached-dev
$STD pip3 install \
pylibmc \
django-pylibmc
systemctl enable --now -q memcached
cat <<EOF >>/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 <<EOF
spawn bash /opt/seafile/seafile-server-latest/seahub.sh start
expect {
\"email\" {
send \"$ADMIN_EMAIL\r\"
}
}
expect {
\"password\" {
send \"$ADMIN_PASS\r\"
}
}
expect {
\"password again\" {
send \"$ADMIN_PASS\r\"
}
}
expect eof
EOF"
$STD su - seafile -c "bash /opt/seafile/seafile-server-latest/seahub.sh stop" || true
$STD su - seafile -c "bash /opt/seafile/seafile-server-latest/seafile.sh stop" || true
msg_ok "Seafile setup"
msg_info "Creating Services"
cat <<EOF >/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"