cleanup install script

This commit is contained in:
Benedikt Tissot 2021-04-05 17:05:31 +02:00
parent aa21f60051
commit b2871b79c0

View file

@ -183,44 +183,11 @@ ynh_script_progression --message="Configuring Mautrix-Bridge..." --weight=2
# WARNING : theses command are used in INSTALL, UPGRADE, CONFIG, CHANGE-URL (4 times) # WARNING : theses command are used in INSTALL, UPGRADE, CONFIG, CHANGE-URL (4 times)
# For any update do it in all files # For any update do it in all files
mautrix_config_path="$final_path/config.yaml" mautrix_config_path="$final_path/config.yaml"
# ynh_replace_string --match_string=__AS_TOKEN__ --replace_string="$generated" --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__HS_TOKEN__ --replace_string="$generated" --target_file="$mautrix_config_path"
as_token="\"This value is generated when generating the registration\"" as_token="\"This value is generated when generating the registration\""
hs_token="\"This value is generated when generating the registration\"" hs_token="\"This value is generated when generating the registration\""
write_bridge_config write_bridge_config
#Copy example-config.yaml to config.yaml
# cp ../conf/config.yaml "$mautrix_config_path"
# ynh_replace_string --match_string=__DOMAIN__ --replace_string="$domain" --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__SERVER_NAME__ --replace_string=$server_name --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__VERIFY_SERVER_SSL_CERTIFICATES__ --replace_string=true --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__MATRIX_SERVER_SUPPORTS_ASMUX__ --replace_string=false --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__PORT__ --replace_string=$port --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__MAUTRIX_BRIDGE_USER__ --replace_string=$mautrix_bridge_user --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__MAUTRIX_BRIDGE_DB_PWD__ --replace_string=$mautrix_bridge_db_pwd --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__MAUTRIX_BRIDGE_DB_NAME__ --replace_string=$mautrix_bridge_db_name --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__BOTNAME__ --replace_string=$botname --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__ENCRYPTION__ --replace_string=$encryption --target_file="$mautrix_config_path"
# if [ "$botusers" = "local" ]
# then
# ynh_replace_string --match_string=__BOTUSERS__ --replace_string=$server_name --target_file="$mautrix_config_path"
# else
# ynh_replace_string --match_string=__BOTUSERS__ --replace_string=$botusers --target_file="$mautrix_config_path"
# fi
# ynh_replace_string --match_string=__BOTADMIN__ --replace_string=$botadmin --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__APP__ --replace_string=$app --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__LOG_FILENAME__ --replace_string="/var/log/$app/$app.log" --target_file="$mautrix_config_path"
# # Options: debug, info, warn, error, fatal
# ynh_replace_string --match_string=__LOG_LEVEL__ --replace_string="error" --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__TELEGRAM_API_ID__ --replace_string=$apiid --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__TELEGRAM_API_HASH__ --replace_string=$apihash --target_file="$mautrix_config_path"
# ynh_replace_string --match_string=__TELEGRAM_BOT_TOKEN__ --replace_string=$bottoken --target_file="$mautrix_config_path"
#================================================= #=================================================
# INSTALL MAUTRIX-BRIDGE PYTHON MODULE # INSTALL MAUTRIX-BRIDGE PYTHON MODULE
#================================================= #=================================================
@ -229,7 +196,7 @@ mkdir -p /var/log/$app
# Configure Mautrix-Bridge # Configure Mautrix-Bridge
python3 -m venv $final_path python3 -m venv $final_path
$final_path/bin/pip3 install --upgrade setuptools wheel # HACK fixes "error: invalid command 'bdist_wheel'" $final_path/bin/pip3 install --upgrade setuptools wheel # HACK fixes "error: invalid command 'bdist_wheel'"
$final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[postgres,speedups,qr_login] # metrics,hq_thumbnails $final_path/bin/pip3 install --upgrade $final_path/src/mautrix-telegram.tar.gz[postgres,speedups,qr_login] # metrics,hq_thumbnails,e2be
# -r optional-requirements.txt # -r optional-requirements.txt
$final_path/bin/python3 -m mautrix_telegram -g -c "$mautrix_config_path" -r "$app_service_registration_path/$app.yaml" $final_path/bin/python3 -m mautrix_telegram -g -c "$mautrix_config_path" -r "$app_service_registration_path/$app.yaml"
# initialize the database # initialize the database