1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/photoprism_ynh.git synced 2024-09-03 19:56:41 +02:00

Fix assets is existing

This commit is contained in:
Limezy 2022-06-12 14:20:25 +07:00
parent ff280ffecc
commit eca3623baf
3 changed files with 8 additions and 15 deletions

View file

@ -163,9 +163,8 @@ ynh_script_progression --message="Creating a data directory..." --time --weight=
datadir=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
mkdir -p $datadir
mkdir "$datadir/assets/"
mv "$final_path/build/assets/"* "$datadir/assets/"
mkdir -p "$datadir/assets/"
mv -f "$final_path/build/assets/"* "$datadir/assets/"
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"

View file

@ -84,14 +84,9 @@ ynh_script_progression --message="Restoring the data directory..." --time --weig
ynh_restore_file --origin_path="$datadir" --not_mandatory
mkdir -p $datadir
mkdir -p "$datadir/assets/"
mv -f "$final_path/build/assets/"* "$datadir/assets/"
# FIXME: this should be managed by the core in the future
# Here, as a packager, you may have to tweak the ownerhsip/permissions
# such that the appropriate users (e.g. maybe www-data) can access
# files in some cases.
# But FOR THE LOVE OF GOD, do not allow r/x for "others" on the entire folder -
# this will be treated as a security issue.
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"

View file

@ -121,8 +121,9 @@ pushd "$final_path"
# Setup node environment
export NODE_OPTIONS=--max_old_space_size=1024
# Build server from source
ynh_secure_remove --file="$final_path/build"
make all install DESTDIR=$final_path/build 2>&1
ynh_use_nodejs
env "$ynh_node_load_PATH" npm install -g npm
env "$ynh_node_load_PATH" make dep-tensorflow dep-js dep-go build-js install DESTDIR=$final_path/build 2>&1
ynh_secure_remove --file="$final_path/go"
popd
@ -131,9 +132,7 @@ popd
#=================================================
ynh_script_progression --message="Updating data directory..." --time --weight=1
ynh_secure_remove --file="$datadir/assets"
mkdir "$datadir/assets/"
mv "$final_path/build/assets/"* "$datadir/assets/"
mv -f "$final_path/build/assets/"* "$datadir/assets/"
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"