mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Enable Preview and refactor source install
This commit is contained in:
parent
a5b20793cd
commit
3784e64eca
4 changed files with 17 additions and 20 deletions
|
@ -197,7 +197,7 @@ thumbnail_sizes:
|
||||||
# Is the preview URL API enabled? If enabled, you *must* specify
|
# Is the preview URL API enabled? If enabled, you *must* specify
|
||||||
# an explicit url_preview_ip_range_blacklist of IPs that the spider is
|
# an explicit url_preview_ip_range_blacklist of IPs that the spider is
|
||||||
# denied from accessing.
|
# denied from accessing.
|
||||||
url_preview_enabled: False
|
url_preview_enabled: True
|
||||||
|
|
||||||
# List of IP address CIDR ranges that the URL preview spider is denied
|
# List of IP address CIDR ranges that the URL preview spider is denied
|
||||||
# from accessing. There are no defaults: you must explicitly
|
# from accessing. There are no defaults: you must explicitly
|
||||||
|
@ -207,11 +207,11 @@ url_preview_enabled: False
|
||||||
# synapse to issue arbitrary GET requests to your internal services,
|
# synapse to issue arbitrary GET requests to your internal services,
|
||||||
# causing serious security issues.
|
# causing serious security issues.
|
||||||
#
|
#
|
||||||
# url_preview_ip_range_blacklist:
|
url_preview_ip_range_blacklist:
|
||||||
# - '127.0.0.0/8'
|
- '127.0.0.0/8'
|
||||||
# - '10.0.0.0/8'
|
- '10.0.0.0/8'
|
||||||
# - '172.16.0.0/12'
|
- '172.16.0.0/12'
|
||||||
# - '192.168.0.0/16'
|
- '192.168.0.0/16'
|
||||||
#
|
#
|
||||||
# List of IP address CIDR ranges that the URL preview spider is allowed
|
# List of IP address CIDR ranges that the URL preview spider is allowed
|
||||||
# to access even if they are specified in url_preview_ip_range_blacklist.
|
# to access even if they are specified in url_preview_ip_range_blacklist.
|
||||||
|
|
|
@ -13,24 +13,24 @@ install_dependances() {
|
||||||
pip install --upgrade virtualenv
|
pip install --upgrade virtualenv
|
||||||
}
|
}
|
||||||
|
|
||||||
install_from_source() {
|
setup_dir() {
|
||||||
# Create empty dir for synapse
|
# Create empty dir for synapse
|
||||||
mkdir -p /var/lib/matrix-synapse
|
mkdir -p /var/lib/matrix-synapse
|
||||||
mkdir -p /var/log/matrix-synapse
|
mkdir -p /var/log/matrix-synapse
|
||||||
mkdir -p /etc/matrix-synapse/conf.d
|
mkdir -p /etc/matrix-synapse/conf.d
|
||||||
mkdir -p $final_path
|
mkdir -p $final_path
|
||||||
|
}
|
||||||
|
|
||||||
|
install_source() {
|
||||||
# Install synapse in virtualenv
|
# Install synapse in virtualenv
|
||||||
virtualenv -p python2.7 $final_path
|
virtualenv -p python2.7 $final_path
|
||||||
PS1=""
|
PS1=""
|
||||||
cp ../conf/virtualenv_activate $final_path/bin/activate
|
cp ../conf/virtualenv_activate $final_path/bin/activate
|
||||||
source $final_path/bin/activate
|
source $final_path/bin/activate
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install --upgrade cffi
|
pip install --upgrade cffi ndg-httpsclient setuptools
|
||||||
pip install --upgrade ndg-httpsclient
|
pip install --upgrade https://github.com/matrix-org/synapse/tarball/master
|
||||||
pip install --upgrade setuptools
|
pip install --upgrade psycopg2 lxml
|
||||||
pip install https://github.com/matrix-org/synapse/tarball/master
|
|
||||||
pip install psycopg2
|
|
||||||
|
|
||||||
# Set permission
|
# Set permission
|
||||||
chown $synapse_user:root -R $final_path
|
chown $synapse_user:root -R $final_path
|
||||||
|
@ -127,7 +127,7 @@ set_access() { # example : set_access USER FILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
####### Solve issue
|
####### Solve issue https://dev.yunohost.org/issues/1006
|
||||||
|
|
||||||
# Install package(s)
|
# Install package(s)
|
||||||
#
|
#
|
||||||
|
|
|
@ -60,8 +60,9 @@ ynh_psql_create_user $synapse_db_user $synapse_db_pwd
|
||||||
ynh_psql_execute_as_root \
|
ynh_psql_execute_as_root \
|
||||||
"CREATE DATABASE $synapse_db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $synapse_db_user;"
|
"CREATE DATABASE $synapse_db_name ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' template=template0 OWNER $synapse_db_user;"
|
||||||
|
|
||||||
# Create directory Install synapse in virtualenv
|
# Create directory and Install synapse in virtualenv
|
||||||
install_from_source
|
setup_dir
|
||||||
|
install_source
|
||||||
|
|
||||||
# Open access to server without a button the home
|
# Open access to server without a button the home
|
||||||
cp ../conf/add_sso_conf.py $final_path
|
cp ../conf/add_sso_conf.py $final_path
|
||||||
|
|
|
@ -127,11 +127,7 @@ set_certificat_access
|
||||||
config_coturn
|
config_coturn
|
||||||
|
|
||||||
# Upgrade manually Synapse
|
# Upgrade manually Synapse
|
||||||
PS1=""
|
install_source
|
||||||
source $final_path/bin/activate
|
|
||||||
pip install --upgrade pip
|
|
||||||
pip install --upgrade setuptools
|
|
||||||
pip install --upgrade https://github.com/matrix-org/synapse/tarball/master
|
|
||||||
|
|
||||||
# Set new settings
|
# Set new settings
|
||||||
ynh_app_setting_set $app synapse_version $synapse_version
|
ynh_app_setting_set $app synapse_version $synapse_version
|
||||||
|
|
Loading…
Reference in a new issue