Skip to content

jcchikikomori/nodogsplash-mod

Repository files navigation

nodogsplash-mod

Modded version of nodogsplash sample page. Copied some huge portions of the original source code.

Under compliance of GPL version 2.0.

Features

  • Added jq as dependency to parse JSON
  • HTML5 Web page
  • Responsive mobile-first design
  • [WIP] Google Firebase (NOSQL) support to download JSON straight from a HTTP client (REST) then parse with jq

OpenWRT Setup

uci set nodogsplash.@nodogsplash[0].splashpage='splash.html'
uci set nodogsplash.@nodogsplash[0].binauth='/etc/nodogsplash/binauth.sh'
uci commit nodogsplash

API Access (Bearer Token)

The router scripts use a REST API that requires a Bearer JWT. Both bin/binauth.sh and bin/sync-users.sh now call curl as follows:

curl --location 'https://myadmincaptiva-project.example.com/api//users' \
  --header 'Authorization: Bearer replaceMyTokenPlease'

How to configure:

  • Replace replaceMyTokenPlease with your actual JWT.
  • Or set the environment variable API_TOKEN before running the scripts or in your init/cron config, e.g.:
export API_TOKEN="<your JWT here>"

Optional: override the API endpoint via API_URL.

Logging

Please read the documentation provided: https://openwrt.org/docs/guide-user/base-system/log.essentials

# List syslog
logread
 
# Write a message with a tag to syslog
logger -t TAG MESSAGE
 
# List syslog filtered by tag
logread -e TAG

Reminder

Make sure binauth.sh has proper permissions:

chmod u+x bin/binauth.sh