mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Fix install issues
This commit is contained in:
parent
db982309e9
commit
1cfd575980
7 changed files with 22 additions and 82 deletions
|
@ -956,7 +956,7 @@ log_config: "/etc/matrix-__APP__/log.yaml"
|
||||||
|
|
||||||
# Directory where uploaded images and attachments are stored.
|
# Directory where uploaded images and attachments are stored.
|
||||||
#
|
#
|
||||||
media_store_path: "/home/yunohost.app/matrix-__APP__/media"
|
media_store_path: "__DATA_DIR__/media"
|
||||||
|
|
||||||
# Media storage providers allow media to be stored in different
|
# Media storage providers allow media to be stored in different
|
||||||
# locations.
|
# locations.
|
||||||
|
@ -970,7 +970,7 @@ media_storage_providers:
|
||||||
# Whether to wait for successful storage for local uploads
|
# Whether to wait for successful storage for local uploads
|
||||||
store_synchronous: false
|
store_synchronous: false
|
||||||
config:
|
config:
|
||||||
directory: "/home/yunohost.app/matrix-__APP__/media_storage"
|
directory: "__DATA_DIR__/media_storage"
|
||||||
|
|
||||||
# The largest allowed upload size in bytes
|
# The largest allowed upload size in bytes
|
||||||
#
|
#
|
||||||
|
|
|
@ -4,7 +4,7 @@ After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=matrix-__APP__
|
User=__APP__
|
||||||
WorkingDirectory=/opt/yunohost/matrix-__APP__
|
WorkingDirectory=/opt/yunohost/matrix-__APP__
|
||||||
BindPaths=/etc/matrix-__APP__
|
BindPaths=/etc/matrix-__APP__
|
||||||
EnvironmentFile=/etc/default/matrix-__APP__
|
EnvironmentFile=/etc/default/matrix-__APP__
|
||||||
|
@ -41,7 +41,7 @@ CapabilityBoundingSet=~CAP_BLOCK_SUSPEND CAP_WAKE_ALARM
|
||||||
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
|
CapabilityBoundingSet=~CAP_SYS_TTY_CONFIG
|
||||||
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
|
CapabilityBoundingSet=~CAP_MAC_ADMIN CAP_MAC_OVERRIDE
|
||||||
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
|
CapabilityBoundingSet=~CAP_NET_ADMIN CAP_NET_BROADCAST CAP_NET_RAW
|
||||||
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
|
CapabilityBoundingSet=~CAP_SYS_ADMIN CAP_SYS_PTRACE CAP_SYSLOG
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
|
@ -1,76 +0,0 @@
|
||||||
# This file must be used with "source bin/activate" *from bash*
|
|
||||||
# you cannot run it directly
|
|
||||||
|
|
||||||
deactivate () {
|
|
||||||
# reset old environment variables
|
|
||||||
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
|
|
||||||
PATH="${_OLD_VIRTUAL_PATH:-}"
|
|
||||||
export PATH
|
|
||||||
unset _OLD_VIRTUAL_PATH
|
|
||||||
fi
|
|
||||||
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
|
|
||||||
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
|
|
||||||
export PYTHONHOME
|
|
||||||
unset _OLD_VIRTUAL_PYTHONHOME
|
|
||||||
fi
|
|
||||||
|
|
||||||
# This should detect bash and zsh, which have a hash command that must
|
|
||||||
# be called to get it to forget past commands. Without forgetting
|
|
||||||
# past commands the $PATH changes we made may not be respected
|
|
||||||
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
|
||||||
hash -r
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
|
|
||||||
PS1="${_OLD_VIRTUAL_PS1:-}"
|
|
||||||
export PS1
|
|
||||||
unset _OLD_VIRTUAL_PS1
|
|
||||||
fi
|
|
||||||
|
|
||||||
unset VIRTUAL_ENV
|
|
||||||
if [ ! "${1:-}" = "nondestructive" ] ; then
|
|
||||||
# Self destruct!
|
|
||||||
unset -f deactivate
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# unset irrelevant variables
|
|
||||||
deactivate nondestructive
|
|
||||||
|
|
||||||
VIRTUAL_ENV="__FINAL_PATH__"
|
|
||||||
export VIRTUAL_ENV
|
|
||||||
|
|
||||||
_OLD_VIRTUAL_PATH="$PATH"
|
|
||||||
PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
# unset PYTHONHOME if set
|
|
||||||
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
|
|
||||||
# could use `if (set -u; : $PYTHONHOME) ;` in bash
|
|
||||||
if [ -n "${PYTHONHOME:-}" ] ; then
|
|
||||||
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
|
|
||||||
unset PYTHONHOME
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
|
|
||||||
_OLD_VIRTUAL_PS1="${PS1:-}"
|
|
||||||
if [ "x(new) " != x ] ; then
|
|
||||||
PS1="(new) ${PS1:-}"
|
|
||||||
else
|
|
||||||
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
|
|
||||||
# special case for Aspen magic directories
|
|
||||||
# see http://www.zetadev.com/software/aspen/
|
|
||||||
PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
|
|
||||||
else
|
|
||||||
PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
export PS1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# This should detect bash and zsh, which have a hash command that must
|
|
||||||
# be called to get it to forget past commands. Without forgetting
|
|
||||||
# past commands the $PATH changes we made may not be respected
|
|
||||||
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
|
||||||
hash -r
|
|
||||||
fi
|
|
|
@ -85,7 +85,7 @@ ram.runtime = "200M"
|
||||||
|
|
||||||
[resources.permissions]
|
[resources.permissions]
|
||||||
main.url = "/"
|
main.url = "/"
|
||||||
main.additional_url = "__DOMAIN__/_matrix/cas_server.php/login"
|
main.additional_urls = ["__DOMAIN__/_matrix/cas_server.php/login"]
|
||||||
main.label = "Server SSO"
|
main.label = "Server SSO"
|
||||||
main.auth_header = true
|
main.auth_header = true
|
||||||
main.show_tile=false
|
main.show_tile=false
|
||||||
|
|
|
@ -68,7 +68,7 @@ configure_synapse() {
|
||||||
| sed -z 's|\n|\\n|g')
|
| sed -z 's|\n|\\n|g')
|
||||||
local macaroon_secret_key_param='macaroon_secret_key: "'$macaroon_secret_key'"'
|
local macaroon_secret_key_param='macaroon_secret_key: "'$macaroon_secret_key'"'
|
||||||
local auto_join_rooms_sed_param=""
|
local auto_join_rooms_sed_param=""
|
||||||
if [ -n $auto_join_rooms ]; then
|
if [ -n "$auto_join_rooms" ]; then
|
||||||
auto_join_rooms_sed_param='auto_join_rooms:\n - "'$auto_join_rooms'"'
|
auto_join_rooms_sed_param='auto_join_rooms:\n - "'$auto_join_rooms'"'
|
||||||
fi
|
fi
|
||||||
local registration_require_3pid_sed_param=""
|
local registration_require_3pid_sed_param=""
|
||||||
|
|
|
@ -128,6 +128,14 @@ ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_
|
||||||
adduser $YNH_APP_ID ssl-cert
|
adduser $YNH_APP_ID ssl-cert
|
||||||
adduser turnserver ssl-cert
|
adduser turnserver ssl-cert
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# FIX DB CONFIG
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Fixing database type..." --weight=1
|
||||||
|
|
||||||
|
ynh_psql_execute_as_root \
|
||||||
|
--sql="update pg_database set datcollate='C', datctype='C' where datname='$db_name';"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -26,6 +26,14 @@ yunohost user create $YNH_APP_ID -F "Synapse Application" -d $domain -p "$synaps
|
||||||
adduser $YNH_APP_ID ssl-cert
|
adduser $YNH_APP_ID ssl-cert
|
||||||
adduser turnserver ssl-cert
|
adduser turnserver ssl-cert
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# FIX DB CONFIG
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Fixing database type..." --weight=1
|
||||||
|
|
||||||
|
ynh_psql_execute_as_root \
|
||||||
|
--sql="update pg_database set datcollate='C', datctype='C' where datname='$db_name';"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE ALL CONFIG AND DATA
|
# RESTORE ALL CONFIG AND DATA
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue