2021-03-16 23:36:39 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# COMMON VARIABLES
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# dependencies used by the app
|
2021-11-28 15:30:15 +01:00
|
|
|
pkg_dependencies="acl nim libsass-dev"
|
2021-03-16 23:36:39 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# PERSONAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2021-04-18 03:40:36 +02:00
|
|
|
function build_nitter {
|
2022-06-19 13:32:12 +02:00
|
|
|
pushd "$final_path"
|
2021-04-18 03:40:36 +02:00
|
|
|
chown -R $app:$app $final_path
|
2022-01-02 18:21:06 +01:00
|
|
|
sudo -u $app env "PATH=/opt/yunohost/$app/nim-installation/bin:$(sudo -u $app sh -c 'echo $PATH')" nimble build -d:release -y -d:danger --passC:"-flto" --passL:"-flto" 2>&1
|
|
|
|
sudo -u $app env "PATH=/opt/yunohost/$app/nim-installation/bin:$(sudo -u $app sh -c 'echo $PATH')" strip -s nitter 2>&1
|
|
|
|
sudo -u $app env "PATH=/opt/yunohost/$app/nim-installation/bin:$(sudo -u $app sh -c 'echo $PATH')" nimble scss -y 2>&1
|
2021-04-18 03:40:36 +02:00
|
|
|
mkdir -p $final_path/tmp
|
|
|
|
chown -R root:root $final_path
|
2022-06-19 13:32:12 +02:00
|
|
|
popd
|
2021-04-18 03:40:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function set_permissions {
|
|
|
|
chown -R root:$app $final_path
|
|
|
|
chown -R $app:$app $final_path/tmp
|
|
|
|
chmod -R g=u,g-w,o-rwx $final_path
|
|
|
|
setfacl -n -m u:www-data:--x $final_path
|
|
|
|
setfacl -nR -m u:www-data:r-x -m d:u:www-data:r-x $final_path/public
|
|
|
|
}
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# EXPERIMENTAL HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2021-03-16 23:36:39 +01:00
|
|
|
#=================================================
|
|
|
|
# FUTURE OFFICIAL HELPERS
|
|
|
|
#=================================================
|