diff --git a/conf/arm.src b/conf/386.src similarity index 58% rename from conf/arm.src rename to conf/386.src index 2237baf..989d46a 100644 --- a/conf/arm.src +++ b/conf/386.src @@ -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 diff --git a/conf/x86-64.src b/conf/amd64.src similarity index 58% rename from conf/x86-64.src rename to conf/amd64.src index 08a339a..f42530c 100644 --- a/conf/x86-64.src +++ b/conf/amd64.src @@ -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 diff --git a/conf/arm6.src b/conf/arm6.src new file mode 100644 index 0000000..4024108 --- /dev/null +++ b/conf/arm6.src @@ -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 diff --git a/conf/arm64.src b/conf/arm64.src index 43cf820..fef4309 100644 --- a/conf/arm64.src +++ b/conf/arm64.src @@ -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 diff --git a/conf/arm7.src b/conf/arm7.src new file mode 100644 index 0000000..37b8792 --- /dev/null +++ b/conf/arm7.src @@ -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 diff --git a/conf/systemd.service b/conf/systemd.service index 4fc0878..b2134d2 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -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] diff --git a/scripts/_common.sh b/scripts/_common.sh index f611de5..28b4f50 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -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 diff --git a/scripts/install b/scripts/install index 2611508..eade927 100755 --- a/scripts/install +++ b/scripts/install @@ -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" #=================================================