mirror of
https://github.com/YunoHost-Apps/BicBucStriim_ynh.git
synced 2024-09-03 18:15:53 +02:00
fix
This commit is contained in:
parent
8d7f095898
commit
fee2f59cfa
3 changed files with 16 additions and 17 deletions
|
@ -101,7 +101,7 @@ cp -r ../empty_library $books_path
|
||||||
|
|
||||||
# Disable BicBucStriim login if checked
|
# Disable BicBucStriim login if checked
|
||||||
if [[ $login -eq 1 ]]; then
|
if [[ $login -eq 1 ]]; then
|
||||||
sed -i -- 's/\[LOGIN_REQUIRED\] = 1/\[LOGIN_REQUIRED\] = 0/g' "$src_path"/index.php
|
sed -i -- 's/\[LOGIN_REQUIRED\] = 1/\[LOGIN_REQUIRED\] = 0/g' "$final_path"/index.php
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -109,25 +109,25 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R root: $src_path
|
chown -R root: $final_path
|
||||||
chmod -R ga+w $src_path/data
|
chmod -R ga+w $final_path/data
|
||||||
chown -R $admin "$books_path"
|
chown -R $admin "$books_path"
|
||||||
|
|
||||||
|
|
||||||
cp password.php $src_path/ynh_password.php
|
cp password.php $final_path/ynh_password.php
|
||||||
cd $src_path
|
cd $final_path
|
||||||
hash=$(php ynh_password.php $admin_pwd)
|
hash=$(php ynh_password.php $admin_pwd)
|
||||||
rm ynh_password.php
|
rm ynh_password.php
|
||||||
cd -
|
cd -
|
||||||
mail=$(ynh_user_get_info $admin mail)
|
mail=$(ynh_user_get_info $admin mail)
|
||||||
if ! ynh_package_is_installed "sqlite3" ; then
|
if ! ynh_package_is_installed "sqlite3" ; then
|
||||||
ynh_package_install sqlite3
|
ynh_package_install sqlite3
|
||||||
echo "INSERT INTO config (name, val) VALUES ('calibre_dir', '$books_path');" | sqlite3 $src_path/data/data.db
|
echo "INSERT INTO config (name, val) VALUES ('calibre_dir', '$books_path');" | sqlite3 $final_path/data/data.db
|
||||||
echo "UPDATE user SET username = '$admin', password = '$hash', email='$mail' WHERE id = 1;" | sqlite3 $src_path/data/data.db
|
echo "UPDATE user SET username = '$admin', password = '$hash', email='$mail' WHERE id = 1;" | sqlite3 $final_path/data/data.db
|
||||||
ynh_package_remove sqlite3
|
ynh_package_remove sqlite3
|
||||||
else
|
else
|
||||||
echo "INSERT INTO config (name, val) VALUES ('calibre_dir', '$books_path');" | sqlite3 $src_path/data/data.db
|
echo "INSERT INTO config (name, val) VALUES ('calibre_dir', '$books_path');" | sqlite3 $final_path/data/data.db
|
||||||
echo "UPDATE user SET username = '$admin', password = '$hash', email='$mail' WHERE id = 1;" | sqlite3 $src_path/data/data.db
|
echo "UPDATE user SET username = '$admin', password = '$hash', email='$mail' WHERE id = 1;" | sqlite3 $final_path/data/data.db
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -56,7 +56,7 @@ ynh_restore_file --origin_path="$final_path"
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
# you may need to make some file and/or directory writeable by www-data (nginx user)
|
# you may need to make some file and/or directory writeable by www-data (nginx user)
|
||||||
chown -R root: "$src_path"
|
chown -R root: "$final_path"
|
||||||
chown -R $admin "$books_path"
|
chown -R $admin "$books_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -70,9 +70,9 @@ ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependenc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Restore sources & data
|
# # Restore sources & data
|
||||||
src_path="/var/www/${app}"
|
# src_path="/var/www/${app}"
|
||||||
cp -a ./sources "$src_path"
|
# cp -a ./sources "$src_path"
|
||||||
|
|
||||||
books_path=/home/$admin/calibre_library
|
books_path=/home/$admin/calibre_library
|
||||||
cp -a ./data "$books_path"
|
cp -a ./data "$books_path"
|
||||||
|
|
|
@ -77,8 +77,6 @@ then
|
||||||
ynh_setup_source --dest_dir="$final_path"
|
ynh_setup_source --dest_dir="$final_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -116,10 +114,11 @@ ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependenc
|
||||||
#=================================================
|
#=================================================
|
||||||
# SECURE FILES AND DIRECTORIES
|
# SECURE FILES AND DIRECTORIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
books_path=/home/$admin/calibre_library
|
||||||
|
|
||||||
# Set permissions to app files
|
# Set permissions to app files
|
||||||
chown -R root: $src_path
|
chown -R root: $final_path
|
||||||
#chmod -R ga+w $src_path/data
|
#chmod -R ga+w $final_path/data
|
||||||
#chown -R $admin "$books_path"
|
#chown -R $admin "$books_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue