mirror of
https://github.com/YunoHost-Apps/seafile_ynh.git
synced 2024-09-03 20:26:01 +02:00
parent
9df8e5b078
commit
25bb354d14
4 changed files with 27 additions and 2 deletions
11
conf/add_sso_conf.py
Normal file
11
conf/add_sso_conf.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import json
|
||||||
|
|
||||||
|
with open("/etc/ssowat/conf.json.persistent", "r") as jsonFile:
|
||||||
|
data = json.load(jsonFile)
|
||||||
|
if "unprotected_urls" in data:
|
||||||
|
data["unprotected_urls"].append("/seafhttp")
|
||||||
|
else:
|
||||||
|
data["unprotected_urls"] = ["/seafhttp"]
|
||||||
|
|
||||||
|
with open("/etc/ssowat/conf.json.persistent", "w") as jsonFile:
|
||||||
|
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))
|
8
conf/remove_sso_conf.py
Normal file
8
conf/remove_sso_conf.py
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import json
|
||||||
|
|
||||||
|
with open("/etc/ssowat/conf.json.persistent", "r") as jsonFile:
|
||||||
|
data = json.load(jsonFile)
|
||||||
|
data["unprotected_urls"].remove("/seafhttp")
|
||||||
|
|
||||||
|
with open("/etc/ssowat/conf.json.persistent", "w") as jsonFile:
|
||||||
|
jsonFile.write(json.dumps(data, indent=4, sort_keys=True))
|
|
@ -129,8 +129,11 @@ sudo yunohost firewall allow $seafile_port
|
||||||
sudo su - www-data -c "/var/www/seafile/seafile-server-4.0.6/seafile.sh start"
|
sudo su - www-data -c "/var/www/seafile/seafile-server-4.0.6/seafile.sh start"
|
||||||
sudo su - www-data -c "$final_path/first_launch.exp $admin_email $admin_password"
|
sudo su - www-data -c "$final_path/first_launch.exp $admin_email $admin_password"
|
||||||
|
|
||||||
#sudo yunohost app setting seafile skipped_urls -v "/media"
|
# add sso config to unprotect domain.tld/seafhttp in /etc/ssowat/conf.json.persistent
|
||||||
#sudo yunohost app setting seafile unprotected_urls -v "/"
|
sudo python ../conf/add_sso_config.py
|
||||||
|
|
||||||
|
# unprotect media
|
||||||
|
sudo yunohost app setting seafile unprotected_uris -v "/media"
|
||||||
|
|
||||||
if [ "$is_public" = "No" ]
|
if [ "$is_public" = "No" ]
|
||||||
then
|
then
|
||||||
|
|
|
@ -20,6 +20,9 @@ sudo yunohost firewall disallow $seafile_port
|
||||||
|
|
||||||
sudo yunohost service remove seafile-server
|
sudo yunohost service remove seafile-server
|
||||||
|
|
||||||
|
# remove sso config to unprotect domain.tld/seafhttp in /etc/ssowat/conf.json.persistent
|
||||||
|
sudo python ../conf/remove_sso_config.py
|
||||||
|
|
||||||
# Restart services
|
# Restart services
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
Loading…
Reference in a new issue