1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nitter_ynh.git synced 2024-09-03 19:46:24 +02:00

Don't compile Nitter as root

This commit is contained in:
Jules Bertholet 2021-03-30 00:07:37 -04:00
parent 98bc19cac2
commit fa670c6fdd
3 changed files with 13 additions and 8 deletions

View file

@ -124,6 +124,7 @@ ynh_script_progression --message="Configuring system user..." --weight=1
# Create a system user
ynh_system_user_create --username=$app
usermod -d $final_path $app 2>&1
#=================================================
# SPECIFIC SETUP
@ -132,10 +133,11 @@ ynh_system_user_create --username=$app
#=================================================
ynh_script_progression --message="Compiling Nitter..." --weight=30
pushd "$final_path" || ynh_die
export PATH="$final_path/.nim/bin:$PATH"
nimble build -d:release -y
nimble scss -y
mkdir -p ./tmp
chown -R $app:$app $final_path
sudo -u $app "PATH=/opt/yunohost/$app/.nim/bin:$(sudo -u $app sh -c 'echo $PATH')" $final_path/.nim/bin/nimble build -d:release -y
sudo -u $app "PATH=/opt/yunohost/$app/.nim/bin:$(sudo -u $app sh -c 'echo $PATH')" $final_path/.nim/bin/nimble scss -y
mkdir -p $final_path/tmp
chown -R root:root $final_path
popd || ynh_die
#=================================================

View file

@ -63,6 +63,7 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei
# Create the dedicated user (if not existing)
ynh_system_user_create --username=$app
usermod -d $final_path $app 2>&1
#=================================================
# REINSTALL DEPENDENCIES

View file

@ -98,6 +98,7 @@ ynh_script_progression --message="Making sure dedicated system user exists..." -
# Create a dedicated user (if not existing)
ynh_system_user_create --username=$app
usermod -d $final_path $app 2>&1
#=================================================
# SPECIFIC UPGRADE
@ -106,10 +107,11 @@ ynh_system_user_create --username=$app
#=================================================
ynh_script_progression --message="Compiling Nitter..." --weight=30
pushd "$final_path" || ynh_die
export PATH="$final_path/.nim/bin:$PATH"
nimble build -d:release -y
nimble scss -y
mkdir -p ./tmp
chown -R $app:$app $final_path
sudo -u $app "PATH=/opt/yunohost/$app/.nim/bin:$(sudo -u $app sh -c 'echo $PATH')" $final_path/.nim/bin/nimble build -d:release -y
sudo -u $app "PATH=/opt/yunohost/$app/.nim/bin:$(sudo -u $app sh -c 'echo $PATH')" $final_path/.nim/bin/nimble scss -y
mkdir -p $final_path/tmp
chown -R root:root $final_path
popd || ynh_die
#=================================================