Browse Source

refactor: remove old ynh_normalize_url_path

better description

remove ask for mandatory app install args

needs_exposed_ports 547 67 for service

add recommended User=root in service unit file
HugoPoi 4 years ago
parent
commit
bf890a9e27
6 changed files with 8 additions and 23 deletions
  1. 2 1
      conf/systemd.service
  2. 2 11
      manifest.json
  3. 1 1
      scripts/_common.sh
  4. 1 1
      scripts/install
  5. 1 1
      scripts/restore
  6. 1 8
      scripts/upgrade

+ 2 - 1
conf/systemd.service

@@ -1,10 +1,11 @@
 [Unit]
-Description=YunoHost Wifi Hotspot.
+Description=YunoHost Wifi Hotspot
 Requires=network.target
 After=network.target
 
 [Service]
 Type=oneshot
+User=root
 ExecStart=/usr/local/bin/ynh-hotspot start
 ExecStop=/usr/local/bin/ynh-hotspot stop
 RemainAfterExit=yes

+ 2 - 11
manifest.json

@@ -3,8 +3,8 @@
   "id": "hotspot",
   "packaging_format": 1,
   "description": {
-    "en": "Wifi Hotspot",
-    "fr": "Hotspot Wifi"
+    "en": "Create and manager wifi networks, share Internet access and use Yunohost apps accross wifi",
+    "fr": "Créer et configurer des réseaux wifi, partager l'accès a Internet et utiliser les applications Yunohost via wifi"
   },
   "url": "https://github.com/labriqueinternet/hotspot_ynh",
   "version": "1.2.0~ynh3",
@@ -27,20 +27,11 @@
       {
         "name": "domain",
         "type": "domain",
-        "ask": {
-            "en": "Choose a domain for the web administration",
-            "fr": "Choisissez un domaine pour l'administration web"
-        },
         "example": "domain.org"
       },
       {
         "name": "path",
         "type": "path",
-        "ask": {
-            "en": "Choose a path for the web administration",
-            "fr": "Choisissez un chemin pour l'administration web"
-        },
-        "example": "/wifiadmin",
         "default": "/wifiadmin"
       },
       {

+ 1 - 1
scripts/_common.sh

@@ -20,7 +20,7 @@ function check_armbian_nonfree_conflict()
   if dpkg --list | grep -q armbian-firmware; then
     echo "You are running Armbian and firmware-misc-nonfree are known to conflict with armbian-firwmare. " >&2
     echo "The package firmware-misc-nonfree is a dependency of firmware-ralink, so firmware-ralink will NOT be installed" >&2
-    echo "You can manually install firmware-ralink with 'sudo apt -o Dpkg::Options::=\"--force-overwrite\" firmware-ralink'" >&2
+    echo "You can manually install firmware-ralink with 'apt -o Dpkg::Options::=\"--force-overwrite\" firmware-ralink'" >&2
     nonfree_firmware_packages=$(echo $nonfree_firmware_packages | sed 's/ firmware-ralink//')
   fi
 

+ 1 - 1
scripts/install

@@ -290,7 +290,7 @@ fi
 #=================================================
 ynh_script_progression --message="Integrating service in YunoHost..."
 
-yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd"
+yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd" --needs_exposed_ports 547 67
 
 #=================================================
 # START SYSTEMD SERVICE

+ 1 - 1
scripts/restore

@@ -133,7 +133,7 @@ systemctl enable $service_name.service --quiet
 #=================================================
 ynh_script_progression --message="Integrating service in YunoHost..."
 
-yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd"
+yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd" --needs_exposed_ports 547 67
 
 #=================================================
 # START SYSTEMD SERVICE

+ 1 - 8
scripts/upgrade

@@ -81,13 +81,6 @@ ynh_clean_setup () {
 ynh_abort_if_errors
 
 #=================================================
-# CHECK THE PATH
-#=================================================
-
-# Normalize the URL path syntax
-path_url=$(ynh_normalize_url_path --path_url=$path_url)
-
-#=================================================
 # STANDARD UPGRADE STEPS
 #=================================================
 # STOP SYSTEMD SERVICE
@@ -199,7 +192,7 @@ find ${final_path}/ -type d -exec chmod +x {} \;
 #=================================================
 ynh_script_progression --message="Integrating service in YunoHost..."
 
-yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd"
+yunohost service add $service_name --description "Creates a Wi-Fi access point" --test_status "systemctl is-active hostapd" --needs_exposed_ports 547 67
 
 #=================================================
 # START SYSTEMD SERVICE