This is a Vue.js application allowing guests to self-register for WiFi access by creating a temporary user account in PacketFence.
npm install
npm run serve
npm run build
npm run lint
When running locally using npm run serve, create a .env file in the root directory with the following variables used by the development server's internal API (vue.config.js):
# Required PacketFence API credentials for the dev server
VUE_APP_PACKETFENCE_USERNAME=your-admin-username
VUE_APP_PACKETFENCE_PASSWORD=your-admin-password
# Required: Set PacketFence API URL (e.g., https://your-packetfence-ip:1443/api/v1)
# No default is provided in vue.config.js anymore
VUE_APP_PACKETFENCE_API_URL=https://your-packetfence-url:1443/api/v1 When running via Docker (using server.js), the following environment variables are needed (passed via docker run -e or docker-compose):
# Required PacketFence API credentials for the production server
VUE_APP_PACKETFENCE_USERNAME=your-admin-username
VUE_APP_PACKETFENCE_PASSWORD=your-admin-password
# Required: PacketFence API URL (No default is provided)
VUE_APP_PACKETFENCE_API_URL=https://your-packetfence-url:1443/api/v1
# Optional: Set to false if PacketFence uses a valid, trusted SSL certificate
PACKETFENCE_IGNORE_SSL=true
# Optional: Port for the Node.js server inside the container (Defaults to 8080)
# PORT=8080-
Build the Docker image after cloning the repository:
docker build -t mckselfservice-app:latest . -
Run the container:
docker run -d -p 8080:8080 \ -e VUE_APP_PACKETFENCE_USERNAME="YOUR_PF_ADMIN_USERNAME" \ -e VUE_APP_PACKETFENCE_PASSWORD="YOUR_PF_ADMIN_PASSWORD" \ -e VUE_APP_PACKETFENCE_API_URL="https://your-packetfence-url:1443/api/v1" \ --name mckselfservice-app \ --restart=unless-stopped \ alastairtech/mckselfservice-app:latest
- Replace
YOUR_PF_ADMIN_USERNAME,YOUR_PF_ADMIN_PASSWORD, and theVUE_APP_PACKETFENCE_API_URLvalue with your actual PacketFence details. -druns the container in detached mode.-p 8080:8080maps the host port 8080 to the container's port 8080.- You can optionally add
-e PACKETFENCE_IGNORE_SSL=falseif needed. --restart=unless-stoppedensures the container restarts automatically if it stops, unless manually stopped.
- Replace
-
Access the application: Open your browser and navigate to
http://<your-docker-host-ip>:8080(orhttp://localhost:8080if running locally).