From db239876aa75cd61ca8b8d8201d37edfe917f653 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 4 Oct 2021 08:02:08 +0200 Subject: [PATCH 1/2] Fix --- conf/config.yml | 2 +- scripts/install | 3 +-- scripts/remove | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/conf/config.yml b/conf/config.yml index 7a4191b..a6e20b1 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -9,7 +9,7 @@ ## This setting is MANDATORY, unless 'database_url' is used. ## db: - user: __DB_NAME__ + user: __DB_USER__ password: __DB_PWD__ host: localhost port: 5432 diff --git a/scripts/install b/scripts/install index 1b29e10..197edb7 100644 --- a/scripts/install +++ b/scripts/install @@ -84,7 +84,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path" ynh_script_progression --message="Creating a PostgreSQL database..." --weight=2 db_name=$(ynh_sanitize_dbid --db_name=$app) -db_user=$db_name +db_user="kemal" ynh_app_setting_set --app=$app --key=db_name --value=$db_name ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_name --db_name=$db_name @@ -106,7 +106,6 @@ git clone https://github.com/iv-org/invidious "$final_path" --quiet # popd for i in $final_path/config/sql/*.sql ; do - 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" ; done diff --git a/scripts/remove b/scripts/remove index 2382b33..09d89c4 100644 --- a/scripts/remove +++ b/scripts/remove @@ -19,7 +19,7 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name +db_user="kemal" final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= diff --git a/scripts/restore b/scripts/restore index 823be32..28b4e7d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,7 +30,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name +db_user="kemal" db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 09c9eec..70a8fda 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) language=$(ynh_app_setting_get --app=$app --key=language) db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name +db_user="kemal" db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) #================================================= From 117514bc940766cde8bc51189cb536d088108948 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 4 Oct 2021 08:09:30 +0200 Subject: [PATCH 2/2] Fix --- conf/config.yml | 2 +- conf/crystal.src | 7 ------- scripts/install | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) delete mode 100644 conf/crystal.src diff --git a/conf/config.yml b/conf/config.yml index a6e20b1..732c686 100644 --- a/conf/config.yml +++ b/conf/config.yml @@ -29,7 +29,7 @@ db: ## Accepted values: a postgres:// URI ## Default: postgres://kemal:kemal@localhost:5432/invidious ## -#database_url: postgres://kemal:kemal@localhost:5432/invidious +#database_url: postgres://__DB_USER__:__DB_PWD__@localhost:5432/__DB_NAME__ ## ## Enable automatic table integrity check. This will create diff --git a/conf/crystal.src b/conf/crystal.src deleted file mode 100644 index b7d8145..0000000 --- a/conf/crystal.src +++ /dev/null @@ -1,7 +0,0 @@ -SOURCE_URL=https://github.com/crystal-lang/crystal/releases/download/1.0.0/crystal_1.0.0-1_amd64.deb -SOURCE_SUM=bc4c15bdfb32ae08daef40728fc8a1da260a4defd225f7ba309404d9e77dcd8d -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=deb -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME=crystal_1.0.0-1_amd64.deb -SOURCE_EXTRACT=false diff --git a/scripts/install b/scripts/install index 0e4cb99..d0db35f 100644 --- a/scripts/install +++ b/scripts/install @@ -136,7 +136,7 @@ popd #================================================= # MODIFY A CONFIG FILE #================================================= -ynh_script_progression --message="Modifying a config file..." +ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_add_config --template="../conf/config.yml" --destination="$final_path/config/config.yml" chmod 600 $final_path/config/config.yml