1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/galene_ynh.git synced 2024-09-03 18:36:31 +02:00

Upgrade source files

This commit is contained in:
ericgaspar 2021-02-20 14:29:12 +01:00
parent 312957d8bc
commit b1a90f2ae2
No known key found for this signature in database
GPG key ID: 574F281483054D44
8 changed files with 42 additions and 33 deletions

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/YunoHost-Apps/galene_ynh/releases/download/v0.3/galene_0.3_Linux_arm.tar.gz
SOURCE_SUM=0acfa1c29e2ab260332ef5d99fca18292f6dd3bdd52bd5b934387b67dadef9ba
SOURCE_URL=https://github.com/YunoHost-Apps/galene_ynh/releases/download/v0.3/galene_0.3_Linux_386.tar.gz
SOURCE_SUM=7264f573bc82185c88def851a70b1fe2b6f22c338ccf1e9c8fd9a80050c4be7e
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/YunoHost-Apps/galene_ynh/releases/download/v0.3/galene_0.3_Linux_x86_64.tar.gz
SOURCE_SUM=6f1804d5cc05ddfeaa8f82bbea1811e757e39e251c5bb12117437b6dd5721427
SOURCE_URL=https://github.com/YunoHost-Apps/galene_ynh/releases/download/v0.3/galene_0.3_Linux_amd64.tar.gz
SOURCE_SUM=0044483c52c392059463147df3762dd832350a5de6791e1fb4cb067cc39f880b
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

7
conf/arm6.src Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://github.com/YunoHost-Apps/galene_ynh/releases/download/v0.3/galene_0.3_Linux_arm6.tar.gz
SOURCE_SUM=230bb8c9649138171f44fa299cbaccac07ecc47e800e61194528e6dd044f37fa
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://github.com/YunoHost-Apps/galene_ynh/releases/download/v0.3/galene_0.3_Linux_arm64.tar.gz
SOURCE_SUM=83e3ed7b9463cbccf60323d2789718878d813a222e4d57ed22c28b641c60e630
SOURCE_SUM=7739c2e507e8a7deb8ea9f4a8de8a945d8ca8630a67c5c29851680a2cb208cc0
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true

7
conf/arm7.src Normal file
View file

@ -0,0 +1,7 @@
SOURCE_URL=https://github.com/YunoHost-Apps/galene_ynh/releases/download/v0.3/galene_0.3_Linux_arm7.tar.gz
SOURCE_SUM=5f81a71faf9450067eab29e57509258a23540374e3c2eb7ee71e616d87e3a10a
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -8,7 +8,7 @@ Type=simple
WorkingDirectory=__FINALPATH__/
User=__APP__
Group=__APP__
ExecStart=__FINALPATH__/galene -turn __PUBLIC_IP4__:1194
ExecStart=__FINALPATH__/galene -turn auto
LimitNOFILE=65536
[Install]

View file

@ -29,13 +29,13 @@ ynh_detect_arch(){
if [ -n "$(uname -m | grep arm64)" ] || [ -n "$(uname -m | grep aarch64)" ]; then
architecture="arm64"
elif [ -n "$(uname -m | grep 64)" ]; then
architecture="x86-64"
architecture="amd64"
elif [ -n "$(uname -m | grep 86)" ]; then
architecture="386"
elif [ -n "$(uname -m | grep armv7)" ]; then
architecture="arm"
architecture="arm7"
elif [ -n "$(uname -m | grep armv6)" ]; then
architecture="arm"
elif [ -n "$(uname -m | grep armv5)" ]; then
architecture="arm"
architecture="arm6"
else
architecture="unknown"
fi

View file

@ -75,14 +75,23 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
#=================================================
# CREATE DATA FOLDER
#=================================================
# Define app's data directory
data="$final_path/data"
# Create data folder
mkdir -p "$data"
#=================================================
# CREATE A SERVER CERTIFICATE
#=================================================
pushd "$final_path"
ynh_exec_warn_less openssl req -newkey rsa:2048 -nodes -keyout data/key.pem -x509 -days 365 -out data/cert.pem \
pushd "$final_path/data"
ynh_exec_warn_less openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out cert.pem \
-subj "/C=/ST=/L=/O=/OU=/CN=/emailAddress="
chmod 640 data/{key.pem,cert.pem}
chmod 640 {key.pem,cert.pem}
popd
#=================================================
@ -106,40 +115,26 @@ ynh_system_user_create --username=$app
#=================================================
ynh_script_progression --message="Configuring a systemd service..." --weight=1
public_ip4="$(curl ip.yunohost.org)" || true
# Create a dedicated systemd config
ynh_add_systemd_config --others_var="public_ip4"
ynh_add_systemd_config
#=================================================
# CREAT GROUPS FILE
# CREATE GROUPS FOLDER
#=================================================
# Define app's groups directory
groups="$final_path/groups"
# Create groups folders
# Create groups folder
mkdir -p "$groups"
#=================================================
# MODIFY A 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"
ynh_add_config --template="../conf/passwd" --destination="$final_path/data/passwd"
#mv ../conf/groupname.json $final_path/groups/$group_name.json
#ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="$final_path/groups/$group_name.json"
#ynh_replace_string --match_string="__PASSWORD__" --replace_string="$password" --target_file="$final_path/groups/$group_name.json"
ynh_add_config --template="../conf/groupname.json" --destination="$final_path/groups/$group_name.json"
#=================================================
# STORE THE CONFIG FILE CHECKSUM
#=================================================
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$final_path/data/passwd"
ynh_add_config --template="../conf/groupname.json" --destination="$final_path/groups/$group_name.json"
ynh_store_file_checksum --file="$final_path/groups/$group_name.json"
#=================================================