1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

Fix issues on home dir path management

This commit is contained in:
Josué Tille 2021-03-14 15:25:48 +01:00
parent 8ebe0d359b
commit 284f6b93de
No known key found for this signature in database
GPG key ID: 716A6C99B04194EF
4 changed files with 7 additions and 7 deletions

View file

@ -14,6 +14,7 @@
upgrade=1 upgrade=1
upgrade=1 from_commit=0705f4ffb4f7538a1aa33a801f95766ee23367db upgrade=1 from_commit=0705f4ffb4f7538a1aa33a801f95766ee23367db
upgrade=1 from_commit=35774cc0eabb82b03230210689fa060d5f2b0bd8 upgrade=1 from_commit=35774cc0eabb82b03230210689fa060d5f2b0bd8
upgrade=1 from_commit=dbf0a2c9359ccd62b55132cace548b17e44af9bf
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
incorrect_path=0 incorrect_path=0
@ -26,3 +27,5 @@
name=Fix postgresql helper from old_version_for_CI_2 branch name=Fix postgresql helper from old_version_for_CI_2 branch
; commit=35774cc0eabb82b03230210689fa060d5f2b0bd8 ; commit=35774cc0eabb82b03230210689fa060d5f2b0bd8
name=Migrate from self signed certificate to cert managed by Yunohost from old_version_for_CI_3 branch name=Migrate from self signed certificate to cert managed by Yunohost from old_version_for_CI_3 branch
; commit=dbf0a2c9359ccd62b55132cace548b17e44af9bf
name=Before permission implementation

View file

@ -11,7 +11,6 @@ install_sources() {
mkdir -p $final_path mkdir -p $final_path
chown $synapse_user:root -R $final_path chown $synapse_user:root -R $final_path
chown $synapse_user:root -R $data_path
if [ -n "$(uname -m | grep arm)" ] if [ -n "$(uname -m | grep arm)" ]
then then
@ -37,10 +36,6 @@ install_sources() {
sudo -u "$synapse_user" env PATH=$PATH rustup update sudo -u "$synapse_user" env PATH=$PATH rustup update
else else
sudo -u "$synapse_user" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable' sudo -u "$synapse_user" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable'
mv $data_path/.cargo $final_path/
mv $data_path/.rustup $final_path/
ln -s $final_path/.cargo $data_path/.cargo
ln -s $final_path/.rustup $data_path/.rustup
fi fi
# Install virtualenv if it don't exist # Install virtualenv if it don't exist

View file

@ -151,7 +151,7 @@ ynh_install_app_dependencies $dependances
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." --weight=3 ynh_script_progression --message="Configuring system user..." --weight=3
ynh_system_user_create --username=$synapse_user --home_dir=$data_path ynh_system_user_create --username=$synapse_user --home_dir=$final_path
adduser $synapse_user ssl-cert adduser $synapse_user ssl-cert
adduser turnserver ssl-cert adduser turnserver ssl-cert

View file

@ -143,8 +143,10 @@ if [ -e "/var/lib/matrix-$app" ]; then
mv "$data_path" "$old_data_dir_path" mv "$data_path" "$old_data_dir_path"
fi fi
mv "/var/lib/matrix-$app" "$data_path" mv "/var/lib/matrix-$app" "$data_path"
fi
if ! grep -q "$final_path" /etc/passwd; then
# matrix-synapse:x:994:994::/var/lib/matrix-synapse:/usr/sbin/nologin # matrix-synapse:x:994:994::/var/lib/matrix-synapse:/usr/sbin/nologin
sed --in-place -r "s@matrix-$app\:x\:(\n*:\n*)\:\:/var/lib/matrix-$app\:/usr/sbin/nologin@matrix-$app\:x\:(\n*:\n*)\:\:$final_path\:/usr/sbin/nologin@g" /etc/passwd sed --in-place -r "s@matrix-$app\:x\:([[:digit:]]+\:[[:digit:]]+)\:\:/.*/matrix-$app\:/usr/sbin/nologin@matrix-$app\:x\:\1\:\:$final_path\:/usr/sbin/nologin@g" /etc/passwd
fi fi
#================================================= #=================================================