mirror of
https://github.com/YunoHost-Apps/collabora_ynh.git
synced 2024-09-03 18:16:25 +02:00
[enh] Add redirect
This commit is contained in:
parent
86b2fd458c
commit
aa007a043e
4 changed files with 64 additions and 4 deletions
42
check_process
Normal file
42
check_process
Normal file
|
@ -0,0 +1,42 @@
|
|||
# See here for more informations
|
||||
# https://github.com/YunoHost/package_check#syntax-check_process-file
|
||||
|
||||
# Move this file from check_process.default to check_process when you have filled it.
|
||||
|
||||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld" (DOMAIN)
|
||||
path="/" (PATH)
|
||||
is_public=1 (PUBLIC|public=1|private=0)
|
||||
password="pass"
|
||||
nextclouddomain="domain.tld"
|
||||
port="9980" (PORT)
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=0
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=0
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
incorrect_path=1
|
||||
port_already_use=0
|
||||
change_url=0
|
||||
;;; Levels
|
||||
Level 1=auto
|
||||
Level 2=auto
|
||||
Level 3=auto
|
||||
# Level 4:
|
||||
Level 4=1 (This app supports the Nextcloud LDAP auth)
|
||||
# Level 5:
|
||||
Level 5=auto
|
||||
Level 6=auto
|
||||
Level 7=auto
|
||||
Level 8=0
|
||||
Level 9=0
|
||||
Level 10=0
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=none
|
|
@ -1,5 +1,6 @@
|
|||
location / {
|
||||
|
||||
rewrite ^/$ https://__DOMAIN__/loleaflet/dist/admin/admin.html permanent;
|
||||
# static files
|
||||
location ^~ /loleaflet {
|
||||
proxy_pass https://localhost:9980;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "Collabora online package for YunoHost",
|
||||
"name": "Collabora Online",
|
||||
"id": "collabora",
|
||||
"packaging_format": 1,
|
||||
"description": {
|
||||
|
@ -11,7 +11,7 @@
|
|||
"maintainer": {
|
||||
"name": "rafi59",
|
||||
"email": "rafi59_dev@srvmaison.fr.nf",
|
||||
"url": "http://example.com"
|
||||
"url": "https://collaboraoffice.com"
|
||||
},
|
||||
"requirements": {
|
||||
"yunohost": ">= 2.7.2"
|
||||
|
@ -61,6 +61,17 @@
|
|||
"fr": "Choisissez un mot de passe pour l'administration de Collabora"
|
||||
},
|
||||
"example": "password",
|
||||
"default": ""
|
||||
|
||||
},
|
||||
{
|
||||
"name": "nextclouddomain",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "The domain of your Nextcloud instance",
|
||||
"fr": "Le domain de votre instance Nextcloud"
|
||||
},
|
||||
"example": "example.com",
|
||||
"default": ""
|
||||
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ app=$YNH_APP_INSTANCE_NAME
|
|||
domain=$YNH_APP_ARG_DOMAIN
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
password=$YNH_APP_ARG_PASSWORD
|
||||
nextcloud_domain=$YNH_APP_ARG_NEXTCLOUDDOMAIN
|
||||
|
||||
# Source YunoHost helpers
|
||||
source /usr/share/yunohost/helpers
|
||||
|
@ -32,6 +33,11 @@ ynh_app_setting_set "$app" is_public "$is_public"
|
|||
sudo yunohost app checkurl "${domain}" -a "$app" \
|
||||
|| ynh_die "Path not available: ${domain}"
|
||||
|
||||
# Find a free port
|
||||
port=$(ynh_find_port 9980)
|
||||
# Open this port
|
||||
yunohost firewall allow --no-upnp TCP $port 2>&1
|
||||
ynh_app_setting_set $app port $port
|
||||
|
||||
|
||||
sudo apt-get -yy install apt-transport-https
|
||||
|
@ -82,10 +88,9 @@ ynh_system_user_create $app
|
|||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
cp -a ../conf/loolwsd.xml /etc/loolwsd
|
||||
ynh_replace_string "__DOMAIN__" "$domain" "/etc/loolwsd/loolwsd.xml"
|
||||
ynh_replace_string "__DOMAIN__" "$nextcloud_domain" "/etc/loolwsd/loolwsd.xml"
|
||||
ynh_replace_string "__PASSWORD__" "$password" "/etc/loolwsd/loolwsd.xml"
|
||||
|
||||
|
||||
#=================================================
|
||||
# SETUP SYSTEMD
|
||||
#=================================================
|
||||
|
@ -101,5 +106,6 @@ if [[ $is_public -eq 1 ]]; then
|
|||
fi
|
||||
|
||||
# Reload services
|
||||
systemctl restart loolwsd
|
||||
sudo service nginx reload
|
||||
|
||||
|
|
Loading…
Reference in a new issue