Skip to content

Commit c7d9f6c

Browse files
committed
Merge pull request #4 from etiennecollin/feat/qr-code
Release 1.2.0
2 parents 9ce8a75 + 603a0c1 commit c7d9f6c

26 files changed

+618
-217
lines changed

.dockerignore

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
README.md
2-
.env
3-
compose.yaml
4-
assets
1+
**
52

6-
Dockerfile
7-
.git
8-
.gitignore
3+
!backend/.cargo/**
4+
!backend/src/**
5+
!backend/Cargo.lock
6+
!backend/Cargo.toml
7+
8+
!frontend/next-env.d.ts
9+
!frontend/next.config.ts
10+
!frontend/package-lock.json
11+
!frontend/package.json
12+
!frontend/postcss.config.mjs
13+
!frontend/public/**
14+
!frontend/src/**
15+
!frontend/tsconfig.json
16+
17+
!scripts/**

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ WORKDIR /app
8181
RUN addgroup -g 1001 -S appgroup && \
8282
adduser -S appuser -u 1001 -G appgroup
8383

84+
# Copy entrypoint script
85+
COPY ./scripts/entrypoint.sh ./
86+
RUN chmod +x entrypoint.sh
87+
8488
# Copy run wrapper script
8589
COPY ./scripts/run_wrapper.sh ./
8690
RUN chmod +x run_wrapper.sh
@@ -108,4 +112,5 @@ ENV BACKEND_BIND_PORT="8080"
108112
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
109113
CMD /usr/local/bin/healthcheck.sh
110114

115+
ENTRYPOINT ["./entrypoint.sh"]
111116
CMD ["./run_wrapper.sh"]

README.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Perfect for businesses, cafes, hotels, and home networks that need to provide gu
1111
<!-- vim-markdown-toc GFM -->
1212

1313
- [✨ Features](#-features)
14-
- [🎫 Voucher Management](#-voucher-management)
14+
- [🎫 Voucher Management & WiFi QR Code](#-voucher-management--wifi-qr-code)
1515
- [🎨 Modern Interface](#-modern-interface)
1616
- [🔧 Technical Features](#-technical-features)
1717
- [🚀 Quick Start](#-quick-start)
@@ -28,7 +28,7 @@ Perfect for businesses, cafes, hotels, and home networks that need to provide gu
2828

2929
## ✨ Features
3030

31-
### 🎫 Voucher Management
31+
### 🎫 Voucher Management & WiFi QR Code
3232

3333
- **Quick Create** - Generate guest vouchers with preset durations (1 hour to 1 week)
3434
- **Custom Create** - Full control over voucher parameters:
@@ -41,6 +41,7 @@ Perfect for businesses, cafes, hotels, and home networks that need to provide gu
4141
- **Search Vouchers** - Search vouchers by name
4242
- **Bulk Operations** - Select and delete multiple vouchers
4343
- **Auto-cleanup** - Remove expired vouchers with a single click
44+
- **QR Code** - Easily connect guests to your network
4445

4546
### 🎨 Modern Interface
4647

@@ -110,18 +111,26 @@ Perfect for businesses, cafes, hotels, and home networks that need to provide gu
110111

111112
### Environment Variables
112113

113-
| Variable | Type | Description | Example (default if optional) |
114-
| ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
115-
| `UNIFI_CONTROLLER_URL` | Required | URL to your UniFi controller with protocol. | `https://unifi.example.com:8443` |
116-
| `UNIFI_API_KEY` | Required | API Key for your UniFi controller. | `abc123...` |
117-
| `UNIFI_SITE_ID` | Optional | Site ID of your UniFi controller. Using the value `default`, the backend will try to fetch the ID of the default site. | `default` (default) |
118-
| `FRONTEND_BIND_HOST` | Optional | Address on which the frontend server binds. | `0.0.0.0` (default) |
119-
| `FRONTEND_BIND_PORT` | Optional | Port on which the frontend server binds. | `3000` (default) |
120-
| `FRONTEND_TO_BACKEND_URL` | Optional | URL where the frontend will make its API requests to the backend. | `http://127.0.0.1` (default) |
121-
| `BACKEND_BIND_HOST` | Optional | Address on which the server binds. | `127.0.0.1` (default) |
122-
| `BACKEND_BIND_PORT` | Optional | Port on which the backend server binds. | `8080` (default) |
123-
| `BACKEND_LOG_LEVEL` | Optional | Log level of the Rust backend. | `info`(default) |
124-
| `TIMEZONE` | Optional | Server [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). | `UTC` (default) |
114+
Make sure to configure the required variables. The optional variables generally have default values that you should not have to change.
115+
116+
To configure the WiFi QR code, you are required to configure the `WIFI_SSID` and `WIFI_PASSWORD` variables.
117+
118+
| Variable | Type | Description | Example | Type |
119+
| ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------- |
120+
| `UNIFI_CONTROLLER_URL` | Required | URL to your UniFi controller with protocol. | `https://unifi.example.com:8443` | `string` |
121+
| `UNIFI_API_KEY` | Required | API Key for your UniFi controller. | `abc123...` | `string` |
122+
| `UNIFI_SITE_ID` | Optional | Site ID of your UniFi controller. Using the value `default`, the backend will try to fetch the ID of the default site. | `default` (default) | `string` |
123+
| `FRONTEND_BIND_HOST` | Optional | Address on which the frontend server binds. | `0.0.0.0` (default) | `IPv4` |
124+
| `FRONTEND_BIND_PORT` | Optional | Port on which the frontend server binds. | `3000` (default) | `u16` |
125+
| `FRONTEND_TO_BACKEND_URL` | Optional | URL where the frontend will make its API requests to the backend. | `http://127.0.0.1` (default) | `URL` |
126+
| `BACKEND_BIND_HOST` | Optional | Address on which the server binds. | `127.0.0.1` (default) | `IPv4` |
127+
| `BACKEND_BIND_PORT` | Optional | Port on which the backend server binds. | `8080` (default) | `u16` |
128+
| `BACKEND_LOG_LEVEL` | Optional | Log level of the Rust backend. | `info`(default) | `trace\|debug\|info\|warn\|error` |
129+
| `TIMEZONE` | Optional | [Timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) used to format dates and time. | `UTC` (default) | [`timezone`](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) |
130+
| `WIFI_SSID` | Optional | WiFi SSID used for the QR code. (required for QR code to be generated) | `My WiFi SSID` | `string` |
131+
| `WIFI_PASSWORD` | Optional | WiFi password used for the QR code (required for QR code to be generated) | `My WiFi Password` | `string` |
132+
| `WIFI_TYPE` | Optional | WiFi security type used. Defaults to `WPA` if a password is provided and `nopass` otherwise. | `WPA` | `WPA\|WEP\|nopass` |
133+
| `WIFI_HIDDEN` | Optional | Whether the WiFi SSID is hidden or broadcasted. | `false` (default) | `bool` |
125134

126135
### Getting UniFi API Credentials
127136

@@ -144,6 +153,9 @@ Perfect for businesses, cafes, hotels, and home networks that need to provide gu
144153
- Check all environment variables are set
145154
- Verify Docker container has network access to UniFi controller
146155
- Check logs: `docker compose logs unifi-voucher-manager`
156+
- **The WiFi QR code button is seems disabled**
157+
- Check the [Environment Variables](#environment-variables) section and make sure you configured the variables required for the WiFi QR code.
158+
- Check the browser console for variable configuration errors (generally by hitting `F12` and going to the 'console' tab).
147159

148160
### Getting Help
149161

backend/.dockerignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

frontend/.dockerignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

frontend/package-lock.json

Lines changed: 12 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12+
"next": "15.4.5",
13+
"qrcode.react": "^4.2.0",
1214
"react": "19.1.0",
13-
"react-dom": "19.1.0",
14-
"next": "15.4.5"
15+
"react-dom": "19.1.0"
1516
},
1617
"devDependencies": {
17-
"typescript": "^5",
18+
"@tailwindcss/postcss": "^4",
1819
"@types/node": "^20",
1920
"@types/react": "^19",
2021
"@types/react-dom": "^19",
21-
"@tailwindcss/postcss": "^4",
22-
"tailwindcss": "^4"
22+
"tailwindcss": "^4",
23+
"typescript": "^5"
2324
}
2425
}

frontend/public/qr.svg

Lines changed: 2 additions & 0 deletions
Loading

frontend/public/unifi.svg

Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)