From 5f6f45a3fbd2a1eae53ebb069135edee606486df Mon Sep 17 00:00:00 2001 From: Julien VAUBOURG Date: Fri, 26 Dec 2014 20:18:03 +0100 Subject: [PATCH] Add license headers --- TODO | 1 - conf/dnsmasq_dhcpdv4.conf.tpl | 17 +++++++ conf/dnsmasq_dhcpdv6.conf.tpl | 17 +++++++ conf/hostapd.conf.tpl | 20 ++++++++ conf/init_ynh-hotspot | 17 +++++++ conf/ipv6_compressed | 17 +++++++ conf/ipv6_expanded | 17 +++++++ conf/nginx_wifiadmin.conf | 55 +++++++++++++++------- conf/phpfpm_wifiadmin.conf | 82 ++++++++------------------------- scripts/install | 17 +++++++ scripts/remove | 17 +++++++ sources/config.php | 18 ++++++++ sources/controller.php | 18 ++++++++ sources/index.php | 20 +++++++- sources/public/css/style.css | 18 ++++++++ sources/public/js/custom.js | 18 ++++++++ sources/views/layout.html.php | 29 +++++++++++- sources/views/settings.html.php | 19 ++++++++ 18 files changed, 333 insertions(+), 84 deletions(-) diff --git a/TODO b/TODO index 32f35cb..1c5d23a 100644 --- a/TODO +++ b/TODO @@ -1,2 +1 @@ * Translate PHP interface in French -* Add license headers diff --git a/conf/dnsmasq_dhcpdv4.conf.tpl b/conf/dnsmasq_dhcpdv4.conf.tpl index a78faa8..07347cf 100644 --- a/conf/dnsmasq_dhcpdv4.conf.tpl +++ b/conf/dnsmasq_dhcpdv4.conf.tpl @@ -1,3 +1,20 @@ +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + # Do DHCP for this subnet. dhcp-range=interface:,.2,.254,4h diff --git a/conf/dnsmasq_dhcpdv6.conf.tpl b/conf/dnsmasq_dhcpdv6.conf.tpl index 3b4de02..d0edf50 100644 --- a/conf/dnsmasq_dhcpdv6.conf.tpl +++ b/conf/dnsmasq_dhcpdv6.conf.tpl @@ -1,3 +1,20 @@ +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + # Do DHCP and Router Advertisements for this subnet. Set the A bit in the RA # so that clients can use SLAAC addresses as well as DHCP ones. dhcp-range=interface:,,slaac,64,4h diff --git a/conf/hostapd.conf.tpl b/conf/hostapd.conf.tpl index 71d4357..8e73836 100644 --- a/conf/hostapd.conf.tpl +++ b/conf/hostapd.conf.tpl @@ -1,12 +1,32 @@ +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + interface= ssid= + hw_mode=g ieee80211n=1 wmm_enabled=1 + channel= macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 + wpa=2 wpa_passphrase= wpa_key_mgmt=WPA-PSK diff --git a/conf/init_ynh-hotspot b/conf/init_ynh-hotspot index b01b52f..86e64b2 100644 --- a/conf/init_ynh-hotspot +++ b/conf/init_ynh-hotspot @@ -9,6 +9,23 @@ # Description: Set prerequisites for wifi hotspot. ### END INIT INFO +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + # Functions ## State functions diff --git a/conf/ipv6_compressed b/conf/ipv6_compressed index 28c03d6..f627376 100644 --- a/conf/ipv6_compressed +++ b/conf/ipv6_compressed @@ -1,3 +1,20 @@ #!/bin/bash +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + sipcalc "${1}" | grep Compressed | awk '{ print $NF; }' diff --git a/conf/ipv6_expanded b/conf/ipv6_expanded index 8be7777..c0cc9c1 100644 --- a/conf/ipv6_expanded +++ b/conf/ipv6_expanded @@ -1,3 +1,20 @@ #!/bin/bash +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + sipcalc "${1}" | grep Expanded | awk '{ print $NF; }' diff --git a/conf/nginx_wifiadmin.conf b/conf/nginx_wifiadmin.conf index aac516b..0ec720c 100644 --- a/conf/nginx_wifiadmin.conf +++ b/conf/nginx_wifiadmin.conf @@ -1,19 +1,40 @@ +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + location { - alias ; - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - client_max_body_size 10G; - index index.php; - try_files $uri $uri/ index.php; - location ~ [^/]\.php(/|$) { - fastcgi_split_path_info ^(.+?\.php)(/.*)$; - fastcgi_pass unix:/var/run/php5-fpm-.sock; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_read_timeout 600; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; - } - include conf.d/yunohost_panel.conf.inc; + alias ; + + if($scheme = http) { + rewrite ^ https://$server_name$request_uri? permanent; + } + + client_max_body_size 10G; + index index.php; + try_files $uri $uri/ index.php; + + location ~ [^/]\.php(/|$) { + fastcgi_split_path_info ^(.+?\.php)(/.*)$; + fastcgi_pass unix:/var/run/php5-fpm-.sock; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_read_timeout 600; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; + } + + include conf.d/yunohost_panel.conf.inc; } diff --git a/conf/phpfpm_wifiadmin.conf b/conf/phpfpm_wifiadmin.conf index 4ade216..f6cd874 100644 --- a/conf/phpfpm_wifiadmin.conf +++ b/conf/phpfpm_wifiadmin.conf @@ -1,21 +1,25 @@ -; Start a new pool named 'www'. +; Wifi Hotspot app for YunoHost +; Copyright (C) 2015 Julien Vaubourg +; Contribute at https://github.com/jvaubourg/hotspot_ynh +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU Affero General Public License as published by +; the Free Software Foundation, either version 3 of the License, or +; (at your option) any later version. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU Affero General Public License for more details. +; +; You should have received a copy of the GNU Affero General Public License +; along with this program. If not, see . + +; Start a new pool named ''. ; the variable $pool can we used in any directive and will be replaced by the ; pool name ('www' here) [] -; Per pool prefix -; It only applies on the following directives: -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - ; The address on which to accept FastCGI requests. ; Valid syntaxes are: ; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on @@ -26,18 +30,6 @@ ; Note: This value is mandatory. listen = /var/run/php5-fpm-.sock -; Set listen(2) backlog. A value of '-1' means unlimited. -; Default Value: 128 (-1 on FreeBSD and OpenBSD) -;listen.backlog = -1 - -; List of ipv4 addresses of FastCGI clients which are allowed to connect. -; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original -; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - ; Set permissions for unix socket, if one is used. In Linux, read/write ; permissions must be set in order to allow connections from a web server. Many ; BSD-derived systems allow connections regardless of permissions. @@ -149,11 +141,6 @@ pm.status_path = /fpm-status ; Default Value: not set ping.path = /ping -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - ; The timeout for serving a single request after which the worker process will ; be killed. This option should be used when the 'max_execution_time' ini option ; does not stop script execution for some reason. A value of '0' means 'off'. @@ -181,17 +168,6 @@ rlimit_files = 4096 ; Default Value: system defined value rlimit_core = 0 -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - ; Chdir to this directory at the start. ; Note: relative path can be used. ; Default Value: current directory or / when chroot @@ -204,15 +180,6 @@ chdir = ; Default Value: no catch_workers_output = no -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - ; Additional php.ini defines, specific to this pool of workers. These settings ; overwrite the values previously defined in the php.ini. The directives are the ; same as the PHP SAPI: @@ -221,22 +188,13 @@ catch_workers_output = no ; php_admin_value/php_admin_flag - these directives won't be overwritten by ; PHP call 'ini_set' ; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - +; ; Defining 'extension' will load the corresponding shared extension from ; extension_dir. Defining 'disable_functions' or 'disable_classes' will not ; overwrite previously defined php.ini values, but will append the new value ; instead. - +; ; Note: path INI options can be relative and will be expanded with the prefix ; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M - php_value[upload_max_filesize] = 10G php_value[post_max_size] = 10G diff --git a/scripts/install b/scripts/install index 27b5031..df4639c 100644 --- a/scripts/install +++ b/scripts/install @@ -1,5 +1,22 @@ #!/bin/bash +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + # Retrieve arguments domain=${1} url_path=${2} diff --git a/scripts/remove b/scripts/remove index 3dadd3d..bf58957 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,5 +1,22 @@ #!/bin/bash +# Wifi Hotspot app for YunoHost +# Copyright (C) 2015 Julien Vaubourg +# Contribute at https://github.com/jvaubourg/hotspot_ynh +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + # Retrieve arguments domain=$(sudo yunohost app setting hotspot domain) diff --git a/sources/config.php b/sources/config.php index aac9f88..55d32e5 100644 --- a/sources/config.php +++ b/sources/config.php @@ -1,5 +1,23 @@ + * Contribute at https://github.com/jvaubourg/hotspot_ynh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + // Limonade configuration function configure() { option('env', ENV_PRODUCTION); diff --git a/sources/controller.php b/sources/controller.php index 1cb5637..f9cb0fc 100644 --- a/sources/controller.php +++ b/sources/controller.php @@ -1,5 +1,23 @@ + * Contribute at https://github.com/jvaubourg/hotspot_ynh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + function moulinette_get($var) { return htmlspecialchars(exec('sudo yunohost app setting hotspot '.escapeshellarg($var))); } diff --git a/sources/index.php b/sources/index.php index e0b55f1..483222b 100644 --- a/sources/index.php +++ b/sources/index.php @@ -1,11 +1,27 @@ + * Contribute at https://github.com/jvaubourg/hotspot_ynh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + require dirname(__FILE__).'/lib/limonade.php'; require dirname(__FILE__).'/controller.php'; - require dirname(__FILE__).'/lib/unix_func.php'; //require '/usr/share/php/php-gettext/gettext.inc'; - require dirname(__FILE__).'/config.php'; run(); diff --git a/sources/public/css/style.css b/sources/public/css/style.css index d72b197..c3ef0be 100644 --- a/sources/public/css/style.css +++ b/sources/public/css/style.css @@ -1,3 +1,21 @@ +/* Wifi Hotspot app for YunoHost + * Copyright (C) 2015 Julien Vaubourg + * Contribute at https://github.com/jvaubourg/hotspot_ynh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + li.status-info { color: #5BC0DE; } diff --git a/sources/public/js/custom.js b/sources/public/js/custom.js index 77355ea..631035a 100644 --- a/sources/public/js/custom.js +++ b/sources/public/js/custom.js @@ -1,3 +1,21 @@ +/* Wifi Hotspot app for YunoHost + * Copyright (C) 2015 Julien Vaubourg + * Contribute at https://github.com/jvaubourg/hotspot_ynh + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + $(document).ready(function() { $('.btn-group').button(); $('[data-toggle="tooltip"]').tooltip(); diff --git a/sources/views/layout.html.php b/sources/views/layout.html.php index 3b72a86..f724dda 100644 --- a/sources/views/layout.html.php +++ b/sources/views/layout.html.php @@ -1,22 +1,46 @@ + + + - - Wifi Hotspot <? echo (isset($title)) ? "| ".$title : "" ?> + + + + + +
@@ -42,4 +66,5 @@
- AGPL 3.0
+ diff --git a/sources/views/settings.html.php b/sources/views/settings.html.php index 05ebdaa..3ca03f5 100644 --- a/sources/views/settings.html.php +++ b/sources/views/settings.html.php @@ -1,3 +1,22 @@ + +