/guest-portal

External UniFi guest portal

Primary LanguagePHPCreative Commons Attribution 4.0 InternationalCC-BY-4.0

UniFi Guest Portal

CC-BY-4.0 GitHub Workflow Status GitHub release (latest SemVer) Docker

Usage

Docker Compose

Here's a template docker-compose.yml file:

version: "3.7"
services:

  backend:
    image: carlgo11/guest-portal:backend
    restart: unless-stopped
    read_only: true
    tmpfs:
      - /tmp
    env_file:
      - mysql.env
      - unifi.env

  frontend:
    image: carlgo11/guest-portal:frontend
    restart: unless-stopped
    user: nginx
    volumes:
      - "./resources/nginx.conf:/etc/nginx/nginx.conf"
      - "./resources/images/:/guest-portal/public/img/bg/"
    read_only: true
    tmpfs:
      - /tmp
    ports:
      - "8080:8080"

  database:
    image: linuxserver/mariadb:alpine
    restart: unless-stopped
    volumes:
      - "mysql:/var/lib/mysql"
      - "./resources/db-template.sql:/config/initdb.d/db.sql:ro"
    environment:
      MYSQL_ROOT_PASSWORD: password
    env_file:
      - mysql.env

volumes:
  mysql:

Environment variables

Name Default Description Example
MYSQL_HOST MySQL server url database.docker/127.0.0.1
MYSQL_PORT MySQL server port 3306
MYSQL_USER MySQL username guest-portal
MYSQL_PASSWORD MySQL password password
MYSQL_DATABASE MySQL database name guest-portal
UNIFI_USER UniFi Hotspot username guest-portal
UNIFI_PASSWORD UniFi Hotspot password password
UNIFI_URL UniFi Controller IP/URL & port https://192.168.1.2:8443
UNIFI_SITE default UniFi Site default
UNIFI_VERSION Controller version 5.13.32

Example portal showcase

License

This work is licensed under the GPLv3.
To view a copy of this license, visit LICENSE.