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:
parent
8ebe0d359b
commit
284f6b93de
4 changed files with 7 additions and 7 deletions
|
@ -14,6 +14,7 @@
|
|||
upgrade=1
|
||||
upgrade=1 from_commit=0705f4ffb4f7538a1aa33a801f95766ee23367db
|
||||
upgrade=1 from_commit=35774cc0eabb82b03230210689fa060d5f2b0bd8
|
||||
upgrade=1 from_commit=dbf0a2c9359ccd62b55132cace548b17e44af9bf
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
incorrect_path=0
|
||||
|
@ -26,3 +27,5 @@
|
|||
name=Fix postgresql helper from old_version_for_CI_2 branch
|
||||
; commit=35774cc0eabb82b03230210689fa060d5f2b0bd8
|
||||
name=Migrate from self signed certificate to cert managed by Yunohost from old_version_for_CI_3 branch
|
||||
; commit=dbf0a2c9359ccd62b55132cace548b17e44af9bf
|
||||
name=Before permission implementation
|
||||
|
|
|
@ -11,7 +11,6 @@ install_sources() {
|
|||
|
||||
mkdir -p $final_path
|
||||
chown $synapse_user:root -R $final_path
|
||||
chown $synapse_user:root -R $data_path
|
||||
|
||||
if [ -n "$(uname -m | grep arm)" ]
|
||||
then
|
||||
|
@ -37,10 +36,6 @@ install_sources() {
|
|||
sudo -u "$synapse_user" env PATH=$PATH rustup update
|
||||
else
|
||||
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
|
||||
|
||||
# Install virtualenv if it don't exist
|
||||
|
|
|
@ -151,7 +151,7 @@ ynh_install_app_dependencies $dependances
|
|||
#=================================================
|
||||
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 turnserver ssl-cert
|
||||
|
||||
|
|
|
@ -143,8 +143,10 @@ if [ -e "/var/lib/matrix-$app" ]; then
|
|||
mv "$data_path" "$old_data_dir_path"
|
||||
fi
|
||||
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
|
||||
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
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue