1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/invidious_ynh.git synced 2024-09-03 19:15:55 +02:00

Update install

This commit is contained in:
ericgaspar 2023-05-20 09:49:07 +02:00
parent 7f05d6ffdc
commit 429d77dc87

View file

@ -52,14 +52,17 @@ pushd "$install_dir"
git reset --hard --quiet $version_commit git reset --hard --quiet $version_commit
popd popd
for i in $install_dir/config/sql/*.sql ; do #for i in $install_dir/config/sql/*.sql ; do
ynh_replace_string --match_string="kemal" --replace_string=$db_user --target_file="$i" ; # ynh_replace_string --match_string="kemal" --replace_string=$db_user --target_file="$i" ;
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < "$i" ; # ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < "$i" ;
done #done
chmod -R o-rwx "$install_dir" chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir" chown -R $app:www-data "$install_dir"
pushd "$install_dir"
make
popd
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================
@ -68,6 +71,20 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=3
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1
ynh_add_config --template="../conf/config.yml" --destination="$install_dir/config/config.yml"
chmod 600 "$install_dir/config/config.yml"
chown $app:$app "$install_dir/config/config.yml"
pushd "$install_dir"
./invidious --migrate
popd
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
@ -76,7 +93,7 @@ ynh_add_nginx_config
ynh_script_progression --message="Building Invidious.. (this will take some time and resources!)" --weight=60 ynh_script_progression --message="Building Invidious.. (this will take some time and resources!)" --weight=60
pushd "$install_dir" pushd "$install_dir"
ynh_exec_warn_less shards install --production #ynh_exec_warn_less shards install --production
ynh_exec_warn_less crystal build $install_dir/src/invidious.cr --release ynh_exec_warn_less crystal build $install_dir/src/invidious.cr --release
popd popd
@ -95,16 +112,6 @@ ynh_add_systemd_config
yunohost service add $app --description="Invidious is an alternative front-end to YouTube" --log="/var/log/$app/$app.log" yunohost service add $app --description="Invidious is an alternative front-end to YouTube" --log="/var/log/$app/$app.log"
#=================================================
# MODIFY A CONFIG FILE
#=================================================
ynh_script_progression --message="Modifying a config file..." --weight=1
ynh_add_config --template="../conf/config.yml" --destination="$install_dir/config/config.yml"
chmod 600 "$install_dir/config/config.yml"
chown $app:$app "$install_dir/config/config.yml"
#================================================= #=================================================
# START SYSTEMD SERVICE # START SYSTEMD SERVICE
#================================================= #=================================================