Creates a guest portal where users can see guests wifi settings with a QR code to easily join the network.
Only works if using Unifi Controller.
- See wifi password and share to guests via qr code or by copy pasting the text.
- Change the guest wifi password with api or frontend.
Env varibale | Required | Default Value | Notes |
---|---|---|---|
UNIFI_CONTROLLER_HOST | true | none | |
UNIFI_CONTROLLER_PORT | true | none | |
UNIFI_CONTROLLER_USERNAME | true | none | |
UNIFI_CONTROLLER_PASSWORD | true | none | |
UNIFI_SELECTED_NETWORK_ID | false | none | Opens a portal with wifi networks and their IDs if not provided |
NEXT_PUBLIC_HEADER_NAME | false | Guest Wifi | |
CHANGE_WIFI_TOKEN | false | none | enables wifi password change ui and api if set |
DEBUG | false | false |
-
Create a docker container with this image and set the env variables listed above:
- Docker run running on port 3030 example:
docker run -p 3030:3000 -e UNIFI_CONTROLLER_HOST=* -e UNIFI_CONTROLLER_PORT=* -e UNIFI_CONTROLLER_USERNAME=* -e UNIFI_CONTROLLER_PASSWORD=* -e UNIFI_SELECTED_NETWORK_ID=* nextjs-home-wifi:latest
-
Next steps will depend if you have already set the UNIFI_SELECTED_NETWORK_ID env variable or not.
- If with UNIFI_SELECTED_NETWORK_ID:
- Open site on port 3030 or any port specified, and the index page ("/") will show the wifi info with the QR code.
- If without UNIFI_SELECTED_NETWORK_ID:
- If with UNIFI_SELECTED_NETWORK_ID:
- Open the folder directory with terminal.
- Create a .env file at root and insert the environmental variables mentioned above.
- Do step 2 of the docker installation instructions above.
- Run "yarn build"
- Run "yarn start"
- Allows changing selected Wifi network's password
- Only available if env variable CHANGE_WIFI_TOKEN is provided
- The wifi password set under UNIFI_SELECTED_NETWORK_ID can be changed via:
-
API call via http://[ip]:[port]/api/wifi/change-password
- Send a POST request with the following body:
key Notes token same as the CHANGE_WIFI_TOKEN newPassword cannnot be less than 8 and more than 63 characters -
Change the password via the frontend in http://[ip]:[port]/change-password
- Use the CHANGE_WIFI_TOKEN env variable as the authentication token
-
- Next.js for frontend and the backend
- Node-unifiapi (https://github.com/delian/node-unifiapi) to get the unifi wifi credentials.
- Tailwind css for styling