1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00
This commit is contained in:
ericgaspar 2021-01-09 21:15:52 +01:00
parent bde14727d5
commit 87d89af8e2
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 17 additions and 2 deletions

1
conf/passwd Normal file
View file

@ -0,0 +1 @@
__ADMIN__:__PASSWORD__

View file

@ -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