mirror of
https://github.com/YunoHost-Apps/ztncui_ynh.git
synced 2024-09-03 18:06:05 +02:00
commit
269d45567f
7 changed files with 24 additions and 31 deletions
|
@ -20,7 +20,7 @@ It allows you to take control of your own ZeroTier network without relying on th
|
|||
|
||||
|
||||
|
||||
**Shipped version:** 20210310~ynh3
|
||||
**Shipped version:** 20220103~ynh4
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ It allows you to take control of your own ZeroTier network without relying on th
|
|||
|
||||
|
||||
|
||||
**Version incluse :** 20210310~ynh3
|
||||
**Version incluse :** 20220103~ynh4
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
SOURCE_URL=https://github.com/key-networks/ztncui/archive/d966c51e38f98ade21d1e1de3ff5013e05285898.zip
|
||||
SOURCE_SUM=D1E860CB3C712F537BFACAAE8DA5BF4852C8288C4277B27344C06E1F9057B087
|
||||
SOURCE_URL=https://github.com/key-networks/ztncui/archive/8fb29fa60771bdaa1e66157c7c383cb56afa0c8f.zip
|
||||
SOURCE_SUM=37a2f57eb199c5121ec28c61c5a294afe3ec095751504c635f6f1c2b06568e66
|
||||
SOURCE_SUM_PRG=sha256sum
|
||||
SOURCE_FORMAT=zip
|
||||
SOURCE_IN_SUBDIR=true
|
||||
|
|
3
conf/env
Normal file
3
conf/env
Normal file
|
@ -0,0 +1,3 @@
|
|||
ZT_TOKEN=__ZT_TOKEN__
|
||||
ZT_ADDR=__ZT_ADDR__
|
||||
HTTP_PORT=__PORT__
|
|
@ -6,7 +6,7 @@
|
|||
"en": "ZeroTier network controller user interface",
|
||||
"fr": "Interface utilisateur pour le contrôleur de réseau ZeroTier"
|
||||
},
|
||||
"version": "20210310~ynh3",
|
||||
"version": "20220103~ynh4",
|
||||
"url": "https://key-networks.com/ztncui",
|
||||
"upstream": {
|
||||
"license": "GPL-3.0-only",
|
||||
|
|
|
@ -120,19 +120,17 @@ popd
|
|||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
# Setup env file
|
||||
mkdir -p $final_path
|
||||
env_file=$final_path/src/.env
|
||||
touch $env_file
|
||||
chmod 600 $env_file
|
||||
# Let's retrieve information on the ZeroTier installation
|
||||
zt_token="$(</var/lib/zerotier-one/authtoken.secret)"
|
||||
zt_addr="localhost:$(</var/lib/zerotier-one/zerotier-one.port)"
|
||||
|
||||
echo "ZT_TOKEN=$(</var/lib/zerotier-one/authtoken.secret)" >> $env_file
|
||||
echo "ZT_ADDR=localhost:$(</var/lib/zerotier-one/zerotier-one.port)" >> $env_file
|
||||
echo "HTTP_PORT=$port" >> $env_file
|
||||
ynh_add_config --template="env" --destination="$final_path/src/.env"
|
||||
chown $app:$app "$final_path/src/.env"
|
||||
chmod 600 "$final_path/src/.env"
|
||||
|
||||
# Setup user credentials file
|
||||
hashedpassword=$(echo -n "$password" | $final_path/src/node_modules/.bin/argon2-cli -e)
|
||||
echo "{\"$admin\":{\"name\":\"$admin\",\"pass_set\":true,\"hash\":\"$hashedpassword\"}}" >> "$final_path/src/etc/passwd"
|
||||
echo "{\"$admin\":{\"name\":\"$admin\",\"pass_set\":true,\"hash\":\"$hashedpassword\"}}" > "$final_path/src/etc/passwd"
|
||||
|
||||
# Store user settings
|
||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||
|
|
|
@ -34,12 +34,6 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||
|
||||
# If db_name doesn't exist, create it
|
||||
if [ -z "$db_name" ]; then
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
fi
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
if [ -z "$final_path" ]; then
|
||||
final_path=/var/www/$app
|
||||
|
@ -60,6 +54,9 @@ if [ -z "$admin" ] || [ -z "$hashedpassword" ]; then
|
|||
pass_set="false"
|
||||
ynh_app_setting_set --app=$app --key=admin --value=$admin
|
||||
ynh_app_setting_set --app=$hashedpassword --key=hashedpassword --value=$hashedpassword
|
||||
|
||||
# Setup user credentials file
|
||||
echo "{\"$admin\":{\"name\":\"$admin\",\"pass_set\":$pass_set,\"hash\":\"$hashedpassword\"}}" > "$final_path/src/etc/passwd"
|
||||
else
|
||||
pass_set="true"
|
||||
fi
|
||||
|
@ -149,18 +146,13 @@ popd
|
|||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
# Setup env file
|
||||
mkdir -p $final_path
|
||||
env_file=$final_path/src/.env
|
||||
touch $env_file
|
||||
chmod 600 $env_file
|
||||
# Let's retrieve information on the ZeroTier installation
|
||||
zt_token="$(</var/lib/zerotier-one/authtoken.secret)"
|
||||
zt_addr="localhost:$(</var/lib/zerotier-one/zerotier-one.port)"
|
||||
|
||||
echo "ZT_TOKEN=$(</var/lib/zerotier-one/authtoken.secret)" >> $env_file
|
||||
echo "ZT_ADDR=localhost:$(</var/lib/zerotier-one/zerotier-one.port)" >> $env_file
|
||||
echo "HTTP_PORT=$port" >> $env_file
|
||||
|
||||
# Setup user credentials file
|
||||
echo "{\"$admin\":{\"name\":\"$admin\",\"pass_set\":$pass_set,\"hash\":\"$hashedpassword\"}}" >> "$final_path/src/etc/passwd"
|
||||
ynh_add_config --template="env" --destination="$final_path/src/.env"
|
||||
chown $app:$app "$final_path/src/.env"
|
||||
chmod 600 "$final_path/src/.env"
|
||||
|
||||
#=================================================
|
||||
# LINK CERTIFICATES
|
||||
|
|
Loading…
Reference in a new issue