Commit Graph

896 Commits

Author SHA1 Message Date
Rob White
25468060d7 Merge pull request #540 from nodogsplash/4.5.0beta
Release 4.5.0
2020-03-03 21:49:36 +00:00
Rob White
965cbb8b9d Release 4.5.0
Changelog:
  * Add - Enable https protocol for remote FAS [bluewavenet]
  * Add - trusted devices list to ndsctl json output [bluewavenet]
  * Add - option unescape_callback_enabled [bluewavenet]
  * Add - get_client_token library utility [bluewavenet]
  * Add - utf-8 to PreAuth header [bluewavenet]
  * Add - PreAuth Support for hashed id (hid) if sent by NDS [bluewavenet]
  * Add - library script shebang warning for systems not running Busybox [bluewavenet]
  * Add - htmlentityencode function, encode gatewayname in templated splash page [bluewavenet]
  * Add - htmlentity encode gatewayname on login page (PreAuth) [bluewavenet]
  * Add - Simple customisation of log file location for PreAuth and BinAuth [bluewavenet]
  * Add - option use_outdated_mhd [bluewavenet]
  * Add - url-encode and htmlentity-encode gatewayname on startup [bluewavenet]
  * Add - Allow special characters in username (PreAuth) [bluewavenet]
  * Add - Documentation updates [bluewavenet]
  * Add - Various style and cosmetic updates  [bluewavenet]
  * Fix - Change library script shebang to bash in Debian [bluewavenet]
  * Fix - Remove unnecessary characters causing script execution failure in Debian [bluewavenet]
  * Fix - Add missing NULL parameter in MHD_OPTION_UNESCAPE_CALLBACK [skra72] [bluewavenet]
  * Fix - Script failures running on Openwrt 19.07.0 [bluewavenet]
  * Fix - Preauth, status=authenticated [bluewavenet]
  * Fix - Prevent ndsctl from running if called from a Binauth script. [bluewavenet]
  * Fix - Minor changes in Library scripts for better portability [bluewavenet]
  * Fix - Prevent php notices on pedantic php servers [bluewavenet]
  * Fix - broken remote image retrieval (PreAuth) [bluewavenet]
  * Fix - Allow use of "#" in gatewayname [bluewavenet]

Signed-off-by: Rob White <rob@blue-wave.net>
2020-03-03 21:44:05 +00:00
Rob White
fc825f5837 Merge pull request #539 from nodogsplash/4.5.0beta
Set version to 4.5.0beta
2020-03-03 19:50:04 +00:00
Rob White
4649d7505b Documentation updates
Signed-off-by: Rob White <rob@blue-wave.net>
2020-03-03 19:39:37 +00:00
Rob White
6c69d54b22 Set version to 4.5.0beta and include more style updates
Preparing for v4.5.0 release

Signed-off-by: Rob White <rob@blue-wave.net>
2020-03-03 14:28:23 +00:00
Rob White
a7b66956fb Merge pull request #538 from nodogsplash/4.4.1beta
Coding style update - use // for single line comments
2020-03-03 13:47:17 +00:00
Rob White
65a1a38d4f Coding style update - use // for single line comments
Signed-off-by: Rob White <rob@blue-wave.net>
2020-03-03 13:39:07 +00:00
Rob White
d9e4756910 Merge pull request #535 from nodogsplash/4.4.1beta
Tidy up main_loop, removing namespace pollution
2020-03-01 23:31:21 +00:00
Rob White
197f7e1e49 Tidy up main_loop, removing namespace pollution
Signed-off-by: Rob White <rob@blue-wave.net>
2020-03-01 23:24:33 +00:00
Rob White
a7ef01f413 Enable https protocol for remote FAS
Previously a remote FAS could not use https protocol without generating
browser security errors or warnings so NDS enforced use of http.

A new FAS level, fas_secure_enabled = 3 is introduced here.

Level 3 is the same as level 2 except the use of https protocol is
enforced for FAS. In addition, the "authmon" daemon is loaded.

This daemon allows the external FAS, after client verification is complete,
to effectively traverse inbound firewalls and address translation to
achieve NDS authentication without generating browser security warnings.
or errors.

A fully functional https fas script is provided (fas-aes-https.php).

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-29 16:50:07 +00:00
Rob White
3265c836a6 Merge pull request #529 from nodogsplash/4.4.1beta
ndsctl: add trusted devices list to json output.
2020-02-22 15:27:54 +00:00
Rob White
92c12beae7 ndsctl: add trusted devices list to json output.
The ndsctl json command now counts the number of trusted devices and
outputs a list of them in json array format.

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-22 15:00:57 +00:00
Rob White
aa54541fca Fix comments in config files
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-17 00:12:38 +00:00
Rob White
0bb8988b8f Merge pull request #525 from nodogsplash/4.4.1beta
Fix: Allow use of "#" and "'" (single quote/asterisk) in gatewayname
2020-02-15 21:24:24 +00:00
Rob White
2a2b3693cc Fix: Allow use of "#" and "'" (single quote/asterisk) in gatewayname
See issue #516

"#" is used as a comment indicator in nodogsplash.conf
This fix allows the character to be present as part of an option value.
If the character occurs at the beginning of the line,
the line will be considered as a comment.

"'" (single quote/asterisk) is used as a uci delimiter.
If this character is required in gatewayname then use the
htmlentity &#39; instead.
The default config files have been updated to reflect this.

The demo preauth scripts have been modified to ensure
gatewayname is properly escaped.


Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-15 15:59:48 +00:00
Rob White
6603d57622 Merge pull request #524 from nodogsplash/4.4.1beta
PreAuth: Fix broken remote image retrieval
2020-02-12 16:08:02 +00:00
Rob White
d834feed21 PreAuth: Fix broken remote image retrieval
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-12 15:59:00 +00:00
Rob White
af4e5853ad Merge pull request #523 from nodogsplash/4.4.1beta
url-encode gatewayname on startup
2020-02-12 15:45:32 +00:00
Rob White
9a0f67e5be Preauth: Allow special characters in username
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-12 14:39:24 +00:00
Rob White
2876dbbc7b url-encode gatewayname on startup
Allow special characters in gatewayname to be passed to fas/preauth

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-12 14:33:04 +00:00
Rob White
f8936e7d2c Add htmlentities "&" and "+"
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-12 13:07:58 +00:00
Rob White
2f8647793a Merge pull request #522 from nodogsplash/4.4.1beta
Add option use_outdated_mhd
2020-02-12 11:37:23 +00:00
Rob White
beb316166a Shorten MHD version check
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-10 23:21:53 +00:00
Rob White
15ba5ea4c8 Add option use_outdated_mhd
See issue #515

MHD_get_version is used to determine the installed (runtime) version of
libmicrohttpd (MHD).
If the version is earlier than 0.9.69, then by default, NDS will terminate.

However, if option use_outdated_mhd is set to 1, NDS starts normally
but logs an error.

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-10 20:58:40 +00:00
Rob White
cfe13c7362 Merge pull request #519 from nodogsplash/4.4.1beta
Htmlencode gatewayname at startup and cosmetic updates
2020-02-08 01:15:44 +00:00
Rob White
dd3d33cbc8 Encode gatewayname at startup
Reduces overhead slightly for templated splash page

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-08 00:58:51 +00:00
Rob White
d9f8d9fe8c Minor cosmetic fixes
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-08 00:58:51 +00:00
Rob White
d28a80fbff Remove unused constant, multiple cosmetic improvements
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-08 00:58:51 +00:00
Rob White
73bcc0e7e4 FAS: Prevent php notices on pedantic php servers
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-08 00:58:51 +00:00
Rob White
5ec9e8bec4 Merge pull request #517 from nodogsplash/4.4.1beta
4.4.1beta Enhancements and bug fixes
2020-02-07 23:06:17 +00:00
Rob White
df705bbd79 PreAuth and BinAuth: Add simple customisation of log file location.
The log file location is now determined by simply setting the variables
mountpoint, logdir and logname in the PreAuth and BinAuth examples.

The default is to use mountpoint /tmp with /run suggested for Raspbian.
These default locations are both tmpfs so protect system flash from wear
but will not survive a reboot.

More suitable storage can be chosen for a production system (eg usb stick)

The log file size is limited by a simple algorithm that takes into account
other useage of the storage:
F=available space
L=logsize
R=Ratio of available to log size
C=capacity, storage size less other non log usage
This gives two equations.
R=F/L
C=F+L
Solving for L:
L=C/(R+1)
If the minimum value of R is 10
then L(max)=(F(current)+L(current))/11

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:41:50 +00:00
Rob White
f90b3ae29f Library scripts: Minor changes for better portability
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:41:50 +00:00
Rob White
9bcc21d723 BinAuth: Prevent ndsctl from running if called from a Binauth script.
See issue #503

If ndsctl is called within a Binauth script it deadlocks as NDS is in
the middle of its client authentication logic when BinAuth is called.
It should not be necessary to run ndsctl from Binauth anyway as it does not
provide any useful post authentation functionality.

This commit prevents ndsctl from being run using a modified version of
the existing ndsctl.lock logic.

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:41:50 +00:00
Rob White
dd3fe012cd PreAuth: htmlentity encode gatewayname on login page
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:41:50 +00:00
Rob White
9fb70f3ce2 Add option: option unescape_callback_enabled
Disabled is 0 (default)
Enabled is 1

This allows custom unescape  in MHD.

MHD needs to unescape characters sent in query strings by browsers.
When this option is disabled, MHD uses its builtin unescape.
When enabled, MHD uses /usr/lib/nodogsplash/unescape.sh

The unescape.sh library is safe as all incoming queries are escaped
by the client browser and the argument containing string to be unescaped
is quoted by NDS.

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:41:50 +00:00
Rob White
9a636527e8 Add htmlentityencode function, encode gatewayname in templated splash page
Note on characters in gatewayname:
# ' and " are invalid in both uci config and nodogsplash.conf so cannot be used.

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:41:49 +00:00
Rob White
b542ff41a9 Add shebang warning
Busybox provides "ash" which is compatible with "bash",
yet requires a shebang of "sh"
For systems not using Busybox (eg Debian) Makefile uses sed to change to "bash"

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:41:49 +00:00
Rob White
7cfddc7ccb Preauth: Support hashed id (hid) if sent by NDS; Fix status=authenticated
Also: remove leading blank line in header html

Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:41:49 +00:00
Rob White
271f823b3c Preauth: Add missing "=" and add utf-8 to header
Signed-off-by: Rob White <rob@blue-wave.net>
2020-02-05 19:39:49 +00:00
Rob White
a14c69b6df Merge pull request #511 from nodogsplash/4.4.1beta
Add missing NULL parameter and fix script failures
2020-01-27 16:32:36 +00:00
Rob White
d55c1759c9 Fix: Script failures running on Openwrt 19.07.0
Not seen on other versions or snapshot.

Signed-off-by: Rob White <rob@blue-wave.net>
2020-01-27 16:22:10 +00:00
Rob White
0751790030 Fix: Add missing NULL parameter in MHD_OPTION_UNESCAPE_CALLBACK
This caused a subtle memory corruption resulting in MHD failing to start,
starting NDS from the command line to fail unless argument -d2 was used
and probably other strange anomalies. But only some targets eg RPi/Raspian,
but probably not seen on OpenWrt.

Fix was found by @skra72, many thanks.

Signed-off-by: Rob White <rob@blue-wave.net>
2020-01-27 16:22:10 +00:00
Rob White
f9262c67a7 Merge pull request #504 from nodogsplash/4.4.1beta
Documentation for get_client_token
2020-01-22 09:44:55 +00:00
Rob White
c7b8b8f6a4 Documentation for get_client_token
Signed-off-by: Rob White <rob@blue-wave.net>
2020-01-22 09:39:26 +00:00
Rob White
0ae13c033b Merge pull request #502 from nodogsplash/debian-testing
debian: fixes to allow library scripts to run
2020-01-19 21:39:56 +00:00
Rob White
07fae43757 Remove unnecessary characters causing script execution failure in Debian
Signed-off-by: Rob White <rob@blue-wave.net>
2020-01-18 20:15:33 +00:00
Rob White
546e870a44 debian: change library script shebang to bash
Signed-off-by: Rob White <rob@blue-wave.net>
2020-01-18 09:45:16 +00:00
Rob White
b5b05c7032 Merge pull request #494 from nodogsplash/4.4.1beta
Add get_client_token library utility
2020-01-11 16:25:49 +00:00
Rob White
84594da947 Add get_client_token library utility
Signed-off-by: Rob White <rob@blue-wave.net>
2020-01-11 16:18:17 +00:00
Rob White
82b602c2d6 Merge pull request #493 from nodogsplash/4.4.1beta
bump to v4.4.1beta
2020-01-09 11:18:29 +00:00