Skip to content

Commit b95e6ec

Browse files
dave-yaptremor021bvdberg01MickLeskmichelroegl-brunner
authored
Seafile - Minor bug fix: domain.sh script fix (#3046)
* Create zitadel-install.sh * Create zitadel.json * Create zitadel.sh * Update zitadel.sh Edit reference back to upstream build.func * Update zitadel.json Co-authored-by: Slaviša Arežina <[email protected]> * Update zitadel.sh Co-authored-by: Slaviša Arežina <[email protected]> * Update zitadel.sh Co-authored-by: Slaviša Arežina <[email protected]> * Update zitadel.sh Co-authored-by: Slaviša Arežina <[email protected]> * Update zitadel.sh Co-authored-by: Slaviša Arežina <[email protected]> * Update zitadel.sh * Update zitadel-install.sh Co-authored-by: Slaviša Arežina <[email protected]> * Update zitadel-install.sh Co-authored-by: Slaviša Arežina <[email protected]> * Update zitadel.sh Co-authored-by: bvdberg01 <[email protected]> * Update zitadel.json Co-authored-by: bvdberg01 <[email protected]> * Use declared variables in config files * Remove other architectures * Update to fit changes requested Include mc for install; removal of variable ARCH and put into direct links; correct the default resources required * Update zitadel.sh Co-authored-by: bvdberg01 <[email protected]> * Update zitadel-install.sh Co-authored-by: bvdberg01 <[email protected]> * Update zitadel-install.sh Co-authored-by: bvdberg01 <[email protected]> * Made changes to fit suggestions * Update zitadel-install.sh correct version output * Update zitadel-install.sh * Update path for version.txt * Set update part default to our project defaults * Update zitadel.sh, Remove v befor ${RELEASE} * Update zitadel-install.sh * Created Seafile script * Update seafile-install.sh Removed sudo and tarball when cleaning up. * Update seafile-install.sh * Updated script Corrected source and remove comments * Move dependencies Move Python installation and dependencies down to Python block. Fix typos. * Update seafile-install.sh Missing -y * Fix typo * Remove python lib deps version pinning * Update seafile-install.sh * Use generated password instead of plain text * Change reference * Reset reference * Update seafile-install.sh * Update seafile.json * Fix syntax error * Fix uploading files error and broken MOTD * Fix systemd file and corrected domain.sh script * Added better explanation of domain.sh script usage * Edited script creation date --------- Co-authored-by: Slaviša Arežina <[email protected]> Co-authored-by: bvdberg01 <[email protected]> Co-authored-by: CanbiZ <[email protected]> Co-authored-by: Michel Roegl-Brunner <[email protected]>
1 parent 936a526 commit b95e6ec

File tree

2 files changed

+58
-50
lines changed

2 files changed

+58
-50
lines changed

install/seafile-install.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ msg_info "Adjusting Conf files"
188188
sed -i "0,/127.0.0.1/s/127.0.0.1/0.0.0.0/" /opt/seafile/conf/gunicorn.conf.py
189189
sed -i "0,/SERVICE_URL = \"http:\/\/$IP\"/s/SERVICE_URL = \"http:\/\/$IP\"/SERVICE_URL = \"http:\/\/$IP:8000\"/" /opt/seafile/conf/seahub_settings.py
190190
echo -e "\nFILE_SERVER_ROOT = \"http://$IP:8082\"" >> /opt/seafile/conf/seahub_settings.py
191+
echo -e "CSRF_TRUSTED_ORIGINS = [\"http://$IP/\"]" >> /opt/seafile/conf/seahub_settings.py
192+
echo -e "ALLOWED_HOSTS = [\"$IP\"]" >> /opt/seafile/conf/seahub_settings.py
191193
echo -e "CSRF_TRUSTED_ORIGINS = ['http://$IP/']" >> /opt/seafile/conf/seahub_settings.py
192194
msg_ok "Conf files adjusted"
193195

@@ -224,14 +226,15 @@ After=network.target mysql.service memcached.service
224226
Wants=mysql.service memcached.service
225227
226228
[Service]
227-
Type=forking
229+
Type=oneshot
228230
User=seafile
229231
Group=seafile
230232
WorkingDirectory=/opt/seafile
233+
RemainAfterExit=yes
231234
232-
ExecStart=/opt/seafile/seafile-server-latest/seafile.sh start
233-
ExecStartPost=/opt/seafile/seafile-server-latest/seahub.sh start
234-
ExecStop=/opt/seafile/seafile-server-latest/seahub.sh stop
235+
ExecStart=/opt/seafile/seafile-server-latest/seafile.sh start
236+
ExecStart=/opt/seafile/seafile-server-latest/seahub.sh start
237+
ExecStop=/opt/seafile/seafile-server-latest/seahub.sh stop
235238
ExecStop=/opt/seafile/seafile-server-latest/seafile.sh stop
236239
237240
Restart=on-failure
@@ -265,8 +268,13 @@ IP=$(ip a s dev eth0 | awk '/inet / {print $2}' | cut -d/ -f1)
265268
DOMAIN_NOSCHEME=$(echo $DOMAIN | sed 's|^https://||')
266269
267270
#Change the CORS to provided domain
268-
sed -i "s|CSRF_TRUSTED_ORIGINS = ['http://$IP:8000/']|CSRF_TRUSTED_ORIGINS = ['$DOMAIN']|g" /opt/seafile/conf/seahub_settings.py
271+
sed -i "s|SERVICE_URL = \"http://$IP:8000\"|SERVICE_URL = \"$DOMAIN\"|g" /opt/seafile/conf/seahub_settings.py
272+
sed -i "s|CSRF_TRUSTED_ORIGINS = \[\"http://$IP/\"\]|CSRF_TRUSTED_ORIGINS = \[\"$DOMAIN/\"\]|g" /opt/seafile/conf/seahub_settings.py
269273
sed -i "s|FILE_SERVER_ROOT = \"http://$IP:8082\"|FILE_SERVER_ROOT = \"$DOMAIN/seafhttp\"|g" /opt/seafile/conf/seahub_settings.py
274+
sed -i "s|ALLOWED_HOSTS = \[\"$IP\"\]|ALLOWED_HOSTS = \[\"\.$DOMAIN_NOSCHEME\"\]|g" /opt/seafile/conf/seahub_settings.py
275+
276+
systemctl restart seafile
277+
echo "Seafile server restarted! Access it at $DOMAIN."
270278
EOF
271279
chmod +x ~/domain.sh
272280
msg_ok "Bash Script for Domain access created"

json/seafile.json

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
{
2-
"name": "Seafile",
3-
"slug": "Seafile",
4-
"categories": [
5-
12
6-
],
7-
"date_created": "2025-03-11",
8-
"type": "ct",
9-
"updateable": false,
10-
"privileged": false,
11-
"interface_port": 8000,
12-
"documentation": "https://manual.seafile.com/11.0/deploy",
13-
"website": "https://seafile.com",
14-
"logo": "https://manual.seafile.com/11.0/media/seafile-transparent-1024.png",
15-
"description": "Seafile is an open source file sync and share platform, focusing on reliability and performance.",
16-
"install_methods": [
17-
{
18-
"type": "default",
19-
"script": "ct/seafile.sh",
20-
"resources": {
21-
"cpu": 2,
22-
"ram": 2048,
23-
"hdd": 20,
24-
"os": "debian",
25-
"version": "12"
26-
}
27-
}
28-
],
29-
"default_credentials": {
30-
"username": null,
31-
"password": null
32-
},
33-
"notes": [
34-
{
35-
"text": "Application credentials: `cat ~/seafile.creds`",
36-
"type": "info"
2+
"name": "Seafile",
3+
"slug": "Seafile",
4+
"categories": [
5+
12
6+
],
7+
"date_created": "2025-03-11",
8+
"type": "ct",
9+
"updateable": false,
10+
"privileged": false,
11+
"interface_port": 8000,
12+
"documentation": "https://manual.seafile.com/11.0/deploy",
13+
"website": "https://seafile.com",
14+
"logo": "https://manual.seafile.com/11.0/media/seafile-transparent-1024.png",
15+
"description": "Seafile is an open source file sync and share platform, focusing on reliability and performance.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/seafile.sh",
20+
"resources": {
21+
"cpu": 2,
22+
"ram": 2048,
23+
"hdd": 20,
24+
"os": "debian",
25+
"version": "12"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
3732
},
38-
{
39-
"text": "Change STORAGE_DIR value in `external-storage.sh` and run `bash external-storage.sh` to use your defined storage instead of internal.",
40-
"type": "info"
41-
},
42-
{
43-
"text": "Execute `~/domain.sh <HTTPS://YOUR_DOMAIN.COM_HERE>` to enable access to Seafile via your domain",
44-
"type": "info"
45-
}
46-
]
47-
}
33+
"notes": [
34+
{
35+
"text": "Application credentials: `cat ~/seafile.creds`",
36+
"type": "info"
37+
},
38+
{
39+
"text": "Change STORAGE_DIR value in `external-storage.sh` and run `bash external-storage.sh` to use your defined storage instead of internal.",
40+
"type": "info"
41+
},
42+
{
43+
"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",
44+
"type": "info"
45+
}
46+
]
47+
}

0 commit comments

Comments
 (0)