diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 8834e73..e2459e1 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -956,7 +956,7 @@ log_config: "/etc/matrix-__APP__/log.yaml" # 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 # locations. @@ -970,7 +970,7 @@ media_storage_providers: # Whether to wait for successful storage for local uploads store_synchronous: false config: - directory: "/home/yunohost.app/matrix-__APP__/media_storage" + directory: "__DATA_DIR__/media_storage" # The largest allowed upload size in bytes # diff --git a/conf/matrix-synapse.service b/conf/matrix-synapse.service index bc68929..fc6737e 100644 --- a/conf/matrix-synapse.service +++ b/conf/matrix-synapse.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=simple -User=matrix-__APP__ +User=__APP__ WorkingDirectory=/opt/yunohost/matrix-__APP__ BindPaths=/etc/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_MAC_ADMIN CAP_MAC_OVERRIDE 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] WantedBy=multi-user.target diff --git a/conf/virtualenv_activate b/conf/virtualenv_activate deleted file mode 100644 index a3b5883..0000000 --- a/conf/virtualenv_activate +++ /dev/null @@ -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 diff --git a/manifest.toml b/manifest.toml index 734d26c..d127c34 100644 --- a/manifest.toml +++ b/manifest.toml @@ -85,7 +85,7 @@ ram.runtime = "200M" [resources.permissions] 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.auth_header = true main.show_tile=false diff --git a/scripts/_common.sh b/scripts/_common.sh index 0563909..be31cd8 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -68,7 +68,7 @@ configure_synapse() { | sed -z 's|\n|\\n|g') local macaroon_secret_key_param='macaroon_secret_key: "'$macaroon_secret_key'"' 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'"' fi local registration_require_3pid_sed_param="" diff --git a/scripts/install b/scripts/install index ee3cf72..35ed322 100644 --- a/scripts/install +++ b/scripts/install @@ -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 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 #================================================= diff --git a/scripts/restore b/scripts/restore index fe5a03c..1f493ee 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,6 +26,14 @@ yunohost user create $YNH_APP_ID -F "Synapse Application" -d $domain -p "$synaps adduser $YNH_APP_ID 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 #=================================================