Skip to content

Commit

Permalink
docs: update for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
woodjme committed Jun 27, 2024
1 parent 6b1c36f commit d54e4e0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 23 deletions.
11 changes: 5 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
UNIFI_USER=
UNIFI_PASS=
UNIFI_CONTROLLER_URL=
UNIFI_CONTROLLER_URL=https://unifi.guestgate.cloud
UNIFI_CONTROLLER_TYPE=standalone
UNIFI_SITE_IDENTIFIER=default
SESSION_SECRET=secretString
AUTH=simple
REDIRECTURL=https://guestgate.cloud
PORT=80
LOG_AUTH_DRIVER=none
LOG_LEVEL=info
AUTH=none
REDIRECTURL=/success.html
NODE_ENV=production
PORT=80
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# unifi-hotspot

This repository hosts a versatile external captive portal server designed for authorizing Wi-Fi guests on Unifi products. The application supports flexible user data storage solutions, including integration with Google Sheets and webhooks.

> **Exciting News!**
>
> Coming soon! Simplify your experience with our upcoming hosted version of this application. Perfect for those who prefer a hassle-free setup or are willing to pay a premium for a managed solution. Don't miss out on early access—sign up now [here](https://guestgate.cloud)!
## What's New in V3

### Breaking Changes
This repository hosts a versatile external captive portal server designed for authorizing Wi-Fi guests on Unifi products. The application supports flexible user data storage solutions, including integration with Google Sheets and webhooks.

- The `URI` environment variable has been renamed to `UNIFI_CONTROLLER_URL`.
- The `SITENAME` environment variable has been renamed to `UNIFI_SITE_IDENTIFIER`.
- The `LOG_AUTH_GOOGLE_SERVICE_ACCOUNT_EMAIL` and `LOG_AUTH_GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY` environment variables have been replaced with `LOG_AUTH_GOOGLE_CREDENTIALS`.
## What's New in V3

### Features and Improvements

- Added support for devices with built-in controllers such as the Unifi Dream Machine.
- Upgraded to NodeJS Version 20.
- Codebase rewritten in Typescript.

### Breaking Changes

- The `URI` environment variable has been renamed to `UNIFI_CONTROLLER_URL`.
- The `SITENAME` environment variable has been renamed to `UNIFI_SITE_IDENTIFIER`.
- The `LOG_AUTH_GOOGLE_SERVICE_ACCOUNT_EMAIL` and `LOG_AUTH_GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY` environment variables have been replaced with `LOG_AUTH_GOOGLE_CREDENTIALS`.

## Documentation

For detailed information on how to set up and use this application, please refer to the [Documentation](https://docs.unifi-hotspot.jamiewood.io).
51 changes: 42 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,54 @@
## What's New in V3

### Features and Improvements

- Added support for devices with built-in controllers such as the Unifi Dream Machine.
- Upgraded to NodeJS Version 20.
- Codebase rewritten in Typescript.

### Breaking Changes

- The `URI` environment variable has been renamed to `UNIFI_CONTROLLER_URL`.
- The `SITENAME` environment variable has been renamed to `UNIFI_SITE_IDENTIFIER`.
- The `LOG_AUTH_GOOGLE_SERVICE_ACCOUNT_EMAIL` and `LOG_AUTH_GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY` environment variables have been replaced with `LOG_AUTH_GOOGLE_CREDENTIALS`.

### Features and Improvements
## Quick Start Guide

- Added support for devices with built-in controllers such as the Unifi Dream Machine.
- Upgraded to NodeJS Version 20.
- Codebase rewritten in Typescript.
### Configure Unifi Controller

## Quick Start Guide
_todo video_
This step varies quite a bit from controller version to controller version but the idea is:

- Configure a new WLAN and enable Hotspot Portal (sometimes called Guest Control)
- Go to the landing portal settings page (Insights -> Hotspot -> Landing Page)
- Choose External Portal Server and set the Exteral Portal Server to the IP of this service
- Enable Show Landing Page
- Enable HTTPs Redirect Support
- Optionally Enable Domain and Secure Portal

### Setup Captive Portal

#### Clone the repo

```sh
git clone https://github.com/woodjme/unifi-hotspot.git
cd unifi-hotspot
```

#### Install Dependencies

`npm install --omit=dev`

#### Configure Environment

A full list of environment variables can be found [here](#environment-variables).

`cp .env.example .env`

#### Start Service

`npm start`

### Docker

Expand All @@ -43,8 +78,6 @@ woodjme/unifi-hotspot

Once started, navigate to the path `guest/s/$SITENAME/` to test the splash page.

You then need to configure the Unifi portal to point to this container. To do this, go to the `Unifi Control Panel` -> `Guest Control` -> `Enable Guest Control` -> `External Portal Server` -> Add the `IP Address` or `DNS Name` of your server/container host.

## Authentication

### None
Expand Down Expand Up @@ -145,7 +178,7 @@ You must provide `UNIFI_USER`, `UNIFI_PASS`, and `UNIFI_CONTROLLER_URL` for the
| `UNIFI_SITE_IDENTIFIER` | `default` | The site identifier in your Unifi controller |
| `SESSION_SECRET` | `myrandomstring` | A secret for the express user session |
| `AUTH` | `none OR userInfo OR simple OR custom` | The auth page you want to display |
| `REDIRECTURL` | `https://google.com` | The page to redirect to after auth |
| `REDIRECTURL` | `/success.html` | The page to redirect to after auth |
| `LOG_AUTH_DRIVER` | `googlesheets` | The driver to use to capture user data |
| `LOG_AUTH_$DRIVER_$OPT` | `n/a` | Options set for each log_auth driver |
| `PORT` | `4545` | The port to run the application on |
| `PORT` | `80` | The port to run the application on |

0 comments on commit d54e4e0

Please sign in to comment.