mirror of
https://github.com/YunoHost-Apps/hotspot_ynh.git
synced 2024-09-03 19:25:53 +02:00
Fix some bugs on Chromium and IE
This commit is contained in:
parent
7f3b3c8b36
commit
a1107f960a
7 changed files with 102 additions and 44 deletions
|
@ -241,17 +241,19 @@ fi
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
# Check IPv6 delegated prefix from vpnclient
|
# Check IPv6 delegated prefix from vpnclient
|
||||||
if [ "${ynh_ip6_net}" == none ]; then
|
vpnclient_ip6_net=$(moulinette_vpnclient_get ip6_net)
|
||||||
ynh_ip6_net=$(moulinette_vpnclient_get ip6_net)
|
|
||||||
ynh_ip6_addr=$(moulinette_vpnclient_get ip6_addr)
|
|
||||||
|
|
||||||
moulinette_set ip6_net "${ynh_ip6_net}"
|
if [ ! -z "${vpnclient_ip6_addr}" ]; then
|
||||||
moulinette_set ip6_addr "${ynh_ip6_addr}"
|
if [ "${ynh_ip6_net}" == none ]; then
|
||||||
else
|
ynh_ip6_net=$vpnclient_ip6_net
|
||||||
vpnclient_ip6_net=$(moulinette_vpnclient_get ip6_net)
|
ynh_ip6_addr=$(moulinette_vpnclient_get ip6_addr)
|
||||||
|
|
||||||
if [ "${ynh_ip6_net}" != "${vpnclient_ip6_net}" ]; then
|
moulinette_set ip6_net "${ynh_ip6_net}"
|
||||||
echo "[WARN] The IPv6 delegated prefix is different from the vpnclient one"
|
moulinette_set ip6_addr "${ynh_ip6_addr}"
|
||||||
|
else
|
||||||
|
if [ "${ynh_ip6_net}" != "${vpnclient_ip6_net}" ]; then
|
||||||
|
echo "[WARN] The IPv6 delegated prefix is different from the vpnclient one"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -47,14 +47,6 @@
|
||||||
"fr": "Choisissez un mot de passe wifi (au minimum 8 caractères pour le WPA2)"
|
"fr": "Choisissez un mot de passe wifi (au minimum 8 caractères pour le WPA2)"
|
||||||
},
|
},
|
||||||
"example": "VhegT8oev0jZI"
|
"example": "VhegT8oev0jZI"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "ip6_net",
|
|
||||||
"ask": {
|
|
||||||
"en": "Select your IPv6 delegated prefix (leave empty if your Internet Service Provider does not give you a delegated prefix, but you will not have IPv6)",
|
|
||||||
"fr": "Sélectionnez votre préfixe IPv6 délégué (laisser vide si votre Fournisseur d'Accès à Internet ne vous donne pas de préfixe délégué, mais vous n'aurez pas d'IPv6)"
|
|
||||||
},
|
|
||||||
"example": "2001:db8:42::"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
61
manifest.json.options
Normal file
61
manifest.json.options
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{
|
||||||
|
"name": "Wifi Hotspot",
|
||||||
|
"id": "hotspot",
|
||||||
|
"description": {
|
||||||
|
"en": "Wifi Hotspot",
|
||||||
|
"fr": "Hotspot Wifi"
|
||||||
|
},
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"developer": {
|
||||||
|
"name": "Julien Vaubourg",
|
||||||
|
"email": "julien@vaubourg.com",
|
||||||
|
"url": "http://julien.vaubourg.com"
|
||||||
|
},
|
||||||
|
"multi_instance": "false",
|
||||||
|
"arguments": {
|
||||||
|
"install" : [
|
||||||
|
{
|
||||||
|
"name": "domain",
|
||||||
|
"ask": {
|
||||||
|
"en": "Choose a domain for the web administration",
|
||||||
|
"fr": "Choisissez un domaine pour l'administration web"
|
||||||
|
},
|
||||||
|
"example": "domain.org"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "path",
|
||||||
|
"ask": {
|
||||||
|
"en": "Choose a path for the web administration",
|
||||||
|
"fr": "Choissez un chemin pour l'administration web"
|
||||||
|
},
|
||||||
|
"example": "/wifiadmin",
|
||||||
|
"default": "/wifiadmin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "wifi_ssid",
|
||||||
|
"ask": {
|
||||||
|
"en": "Choose a wifi name (SSID)",
|
||||||
|
"fr": "Choisissez un nom pour le wifi (SSID)"
|
||||||
|
},
|
||||||
|
"example": "myNeutralNetwork",
|
||||||
|
"default": "myNeutralNetwork"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "wifi_passphrase",
|
||||||
|
"ask": {
|
||||||
|
"en": "Choose a wifi password (at least 8 characters for WPA2)",
|
||||||
|
"fr": "Choisissez un mot de passe wifi (au minimum 8 caractères pour le WPA2)"
|
||||||
|
},
|
||||||
|
"example": "VhegT8oev0jZI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ip6_net",
|
||||||
|
"ask": {
|
||||||
|
"en": "Select your IPv6 delegated prefix (leave empty if your Internet Service Provider does not give you a delegated prefix, but you will not have IPv6)",
|
||||||
|
"fr": "Sélectionnez votre préfixe IPv6 délégué (laisser vide si votre Fournisseur d'Accès à Internet ne vous donne pas de préfixe délégué, mais vous n'aurez pas d'IPv6)"
|
||||||
|
},
|
||||||
|
"example": "2001:db8:42::"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,7 +5,13 @@ domain=${1}
|
||||||
url_path=${2}
|
url_path=${2}
|
||||||
wifi_ssid=${3}
|
wifi_ssid=${3}
|
||||||
wifi_passphrase=${4}
|
wifi_passphrase=${4}
|
||||||
ip6_net=${5}
|
|
||||||
|
##
|
||||||
|
## These arguments are optional but YunoHost is not yet able to handle them with the web installer
|
||||||
|
## See manifest.json.options
|
||||||
|
##
|
||||||
|
#
|
||||||
|
#ip6_net=${5}
|
||||||
|
|
||||||
# Check arguments
|
# Check arguments
|
||||||
if [ -z "${wifi_ssid}" -o -z "${wifi_passphrase}" ]; then
|
if [ -z "${wifi_ssid}" -o -z "${wifi_passphrase}" ]; then
|
||||||
|
@ -34,27 +40,29 @@ fi
|
||||||
# Install packages
|
# Install packages
|
||||||
# TODO: Replace isc-dhcp-server by dnsmasq (currently negotiating with the YunoHost team to
|
# TODO: Replace isc-dhcp-server by dnsmasq (currently negotiating with the YunoHost team to
|
||||||
# also replace bind9 by dnsmasq)
|
# also replace bind9 by dnsmasq)
|
||||||
#sudo apt-get update
|
packages='php5-fpm sipcalc hostapd radvd isc-dhcp-server iptables wireless-tools wireless-tools'
|
||||||
sudo apt-get --assume-yes --force-yes install hostapd radvd isc-dhcp-server iptables php5-fpm wireless-tools
|
sudo apt-get --assume-yes --force-yes install ${packages}
|
||||||
|
|
||||||
# Extra packages
|
if [ $? -ne 0 ]; then
|
||||||
sudo apt-get --assume-yes --force-yes install sipcalc wireless-tools
|
sudo apt-get update
|
||||||
|
sudo apt-get --assume-yes --force-yes install ${packages}
|
||||||
|
fi
|
||||||
|
|
||||||
# Compute extra arguments
|
# Compute extra arguments
|
||||||
if [ -z "${ip6_net}" ]; then
|
if [ -z "${ip6_net}" ]; then
|
||||||
ip6_net=none
|
ip6_net=none
|
||||||
ip6_addr=none
|
ip6_addr=none
|
||||||
else
|
#else
|
||||||
ip6_net=$(bash ../conf/ipv6_expanded "${ip6_net}")
|
# ip6_net=$(bash ../conf/ipv6_expanded "${ip6_net}")
|
||||||
|
#
|
||||||
if [ -z "${ip6_net}" ]; then
|
# if [ -z "${ip6_net}" ]; then
|
||||||
echo "ERROR: The IPv6 Delegated Prefix format looks bad" >&2
|
# echo "ERROR: The IPv6 Delegated Prefix format looks bad" >&2
|
||||||
exit 1
|
# exit 1
|
||||||
fi
|
# fi
|
||||||
|
#
|
||||||
ip6_addr="$(echo "${ip6_net}" | cut -d: -f1-7):42"
|
# ip6_addr="$(echo "${ip6_net}" | cut -d: -f1-7):42"
|
||||||
ip6_net=$(bash ../conf/ipv6_compressed "${ip6_net}")
|
# ip6_net=$(bash ../conf/ipv6_compressed "${ip6_net}")
|
||||||
ip6_addr=$(bash ../conf/ipv6_compressed "${ip6_addr}")
|
# ip6_addr=$(bash ../conf/ipv6_compressed "${ip6_addr}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wifi_device=$(sudo iwconfig 2>&1 | grep 802.11 | head -n1 | awk '{ print $1 }')
|
wifi_device=$(sudo iwconfig 2>&1 | grep 802.11 | head -n1 | awk '{ print $1 }')
|
||||||
|
@ -104,9 +112,6 @@ sudo chown -R root: /var/www/wifiadmin/
|
||||||
sudo chmod -R 0644 /var/www/wifiadmin/*
|
sudo chmod -R 0644 /var/www/wifiadmin/*
|
||||||
sudo find /var/www/wifiadmin/ -type d -exec chmod +x {} \;
|
sudo find /var/www/wifiadmin/ -type d -exec chmod +x {} \;
|
||||||
|
|
||||||
# Create user for the web admin
|
|
||||||
sudo useradd -MUr wifiadmin
|
|
||||||
|
|
||||||
# Fix confs
|
# Fix confs
|
||||||
## hostapd
|
## hostapd
|
||||||
sudo sed 's|^DAEMON_CONF=$|&/etc/hostapd/hostapd.conf|' -i /etc/init.d/hostapd
|
sudo sed 's|^DAEMON_CONF=$|&/etc/hostapd/hostapd.conf|' -i /etc/init.d/hostapd
|
||||||
|
|
|
@ -22,12 +22,8 @@ sudo service nginx reload
|
||||||
# Remove sources
|
# Remove sources
|
||||||
sudo rm -rf /var/www/wifiadmin/
|
sudo rm -rf /var/www/wifiadmin/
|
||||||
|
|
||||||
# Remove user
|
|
||||||
sudo userdel -f wifiadmin
|
|
||||||
|
|
||||||
# Remove packets
|
# Remove packets
|
||||||
# The yunohost policy is currently to not uninstall packets (dependency problems)
|
# The yunohost policy is currently to not uninstall packets (dependency problems)
|
||||||
## sudo apt-get --assume-yes --force-yes remove hostapd radvd isc-dhcp-server iptables
|
## sudo apt-get --assume-yes --force-yes remove hostapd radvd isc-dhcp-server iptables sipcalc wireless-tools
|
||||||
## sudo apt-get --assume-yes --force-yes remove sipcalc wireless-tools
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
@ -9,7 +9,8 @@ $(document).ready(function() {
|
||||||
|
|
||||||
$('input[type="file"]').change(function() {
|
$('input[type="file"]').change(function() {
|
||||||
var choosertxtid = '#' + $(this).attr('id') + '_choosertxt';
|
var choosertxtid = '#' + $(this).attr('id') + '_choosertxt';
|
||||||
$(choosertxtid).val($(this).val());
|
|
||||||
|
$(choosertxtid).val($(this).val().replace(/^.*[\/\\]/, ''));
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.dropdown-menu li').click(function() {
|
$('.dropdown-menu li').click(function() {
|
||||||
|
@ -32,6 +33,7 @@ $(document).ready(function() {
|
||||||
$('#save').click(function() {
|
$('#save').click(function() {
|
||||||
$(this).prop('disabled', true);
|
$(this).prop('disabled', true);
|
||||||
$('#save-loading').show();
|
$('#save-loading').show();
|
||||||
|
$('#form').submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#status .close').click(function() {
|
$('#status .close').click(function() {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-offset-2 col-sm-8">
|
<div class="col-sm-offset-2 col-sm-8">
|
||||||
<form method="post" enctype="multipart/form-data" action="?/settings" class="form-horizontal" role="form">
|
<form method="post" enctype="multipart/form-data" action="?/settings" class="form-horizontal" role="form" id="form">
|
||||||
<input type="hidden" name="_method" value="put" />
|
<input type="hidden" name="_method" value="put" />
|
||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
|
|
Loading…
Add table
Reference in a new issue