From 9d36c01fdee90b25ab4ef667c7305bd72c969a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 22 Oct 2017 21:33:18 +0200 Subject: [PATCH] Enable Preview and refactor source install --- conf/homeserver.yaml | 12 ++++++------ scripts/_common.sh | 14 +++++++------- scripts/install | 5 +++-- scripts/upgrade | 6 +----- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/conf/homeserver.yaml b/conf/homeserver.yaml index 922af14..ccc204f 100644 --- a/conf/homeserver.yaml +++ b/conf/homeserver.yaml @@ -197,7 +197,7 @@ thumbnail_sizes: # Is the preview URL API enabled? If enabled, you *must* specify # an explicit url_preview_ip_range_blacklist of IPs that the spider is # denied from accessing. -url_preview_enabled: False +url_preview_enabled: True # List of IP address CIDR ranges that the URL preview spider is denied # 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, # causing serious security issues. # -# url_preview_ip_range_blacklist: -# - '127.0.0.0/8' -# - '10.0.0.0/8' -# - '172.16.0.0/12' -# - '192.168.0.0/16' +url_preview_ip_range_blacklist: +- '127.0.0.0/8' +- '10.0.0.0/8' +- '172.16.0.0/12' +- '192.168.0.0/16' # # 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. diff --git a/scripts/_common.sh b/scripts/_common.sh index 47562a9..12eb686 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -13,24 +13,24 @@ install_dependances() { pip install --upgrade virtualenv } -install_from_source() { +setup_dir() { # Create empty dir for synapse mkdir -p /var/lib/matrix-synapse mkdir -p /var/log/matrix-synapse mkdir -p /etc/matrix-synapse/conf.d mkdir -p $final_path +} +install_source() { # Install synapse in virtualenv virtualenv -p python2.7 $final_path PS1="" cp ../conf/virtualenv_activate $final_path/bin/activate source $final_path/bin/activate pip install --upgrade pip - pip install --upgrade cffi - pip install --upgrade ndg-httpsclient - pip install --upgrade setuptools - pip install https://github.com/matrix-org/synapse/tarball/master - pip install psycopg2 + pip install --upgrade cffi ndg-httpsclient setuptools + pip install --upgrade https://github.com/matrix-org/synapse/tarball/master + pip install --upgrade psycopg2 lxml # Set permission 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) # diff --git a/scripts/install b/scripts/install index 9647656..768b8c1 100644 --- a/scripts/install +++ b/scripts/install @@ -60,8 +60,9 @@ ynh_psql_create_user $synapse_db_user $synapse_db_pwd 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 directory Install synapse in virtualenv -install_from_source +# Create directory and Install synapse in virtualenv +setup_dir +install_source # Open access to server without a button the home cp ../conf/add_sso_conf.py $final_path diff --git a/scripts/upgrade b/scripts/upgrade index 21f78f0..8e310c8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -127,11 +127,7 @@ set_certificat_access config_coturn # Upgrade manually Synapse -PS1="" -source $final_path/bin/activate -pip install --upgrade pip -pip install --upgrade setuptools -pip install --upgrade https://github.com/matrix-org/synapse/tarball/master +install_source # Set new settings ynh_app_setting_set $app synapse_version $synapse_version