diff --git a/conf/passwd b/conf/passwd new file mode 100644 index 0000000..61a88b3 --- /dev/null +++ b/conf/passwd @@ -0,0 +1 @@ +__ADMIN__:__PASSWORD__ \ No newline at end of file diff --git a/scripts/install b/scripts/install index 15375e3..d6f85d5 100755 --- a/scripts/install +++ b/scripts/install @@ -89,6 +89,17 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path mkdir -p $final_path cp -R ../sources/* $final_path/ +#================================================= +# CREATE A SERVER CERTIFICATE +#================================================= + +pushd "$final_path" + openssl req -newkey rsa:2048 -nodes -keyout data/key.pem -x509 -days 365 -out data/cert.pem \ + -subj "/C=/ST=/L=/O=/OU=/CN=/emailAddress=" + #chown root:ssl-cert data/{key.pem,cert.pem} + chmod 640 data/{key.pem,cert.pem} +popd + #================================================= # NGINX CONFIGURATION #================================================= @@ -117,14 +128,17 @@ ynh_add_systemd_config # MODIFY A CONFIG FILE #================================================= -#ynh_replace_string --match_string="match_string" --replace_string="replace_string" --target_file="$final_path/CONFIG_FILE" +cp ../conf/passwd $final_path/data/passwd + +ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/data/passwd" +ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/data/passwd" #================================================= # STORE THE CONFIG FILE CHECKSUM #================================================= # Calculate and store the config file checksum into the app settings -#ynh_store_file_checksum --file="$final_path/CONFIG_FILE" +ynh_store_file_checksum --file="$final_path/data/passwd" #================================================= # GENERIC FINALIZATION