-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
656 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.git | ||
.github | ||
.idea | ||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
img/bg.* | ||
Gemfile.lock | ||
composer.lock | ||
_api/composer.lock | ||
vendor/ | ||
.bundle | ||
_site | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
FROM alpine | ||
|
||
### | ||
# Jekyll | ||
### | ||
|
||
# Install Jekyll dependencies | ||
RUN apk add --no-cache build-base libxml2-dev libxslt-dev ruby-full ruby-dev gcc linux-headers | ||
|
||
# Copy Jekyll files | ||
RUN adduser -D -u 1000 -h /tmp/www www | ||
COPY --chown=www:www jekyll /tmp/jekyll | ||
WORKDIR /tmp/jekyll | ||
|
||
USER www | ||
|
||
# Install gems | ||
RUN bundle config build.nokogiri --use-system-libraries | ||
RUN bundle config set path 'vendor/bundle' | ||
RUN bundle install | ||
|
||
# Build site | ||
RUN bundle exec jekyll build | ||
|
||
USER root | ||
RUN mv _site /opt/www/ | ||
|
||
# Remove Jekyll dependencies | ||
RUN apk del build-base libxml2-dev libxslt-dev ruby-full ruby-dev gcc linux-headers | ||
|
||
### | ||
# PHP | ||
### | ||
|
||
# Install PHP dependencies | ||
RUN apk add --no-cache php-fpm php-curl php-json php-session composer | ||
|
||
# Set up PHP-FPM | ||
COPY php-install.sh / | ||
RUN chmod +x /php-install.sh; /bin/sh /php-install.sh; rm /php-install.sh | ||
|
||
# Copy PHP files | ||
COPY ./php /opt/php | ||
WORKDIR /opt/php | ||
|
||
# Install libraries | ||
RUN composer install --no-dev | ||
|
||
RUN apk del composer | ||
|
||
### | ||
# Nginx | ||
### | ||
|
||
# Install Nginx | ||
RUN apk add --no-cache nginx | ||
|
||
# Copy Nginx virtual server config | ||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
# Bug fixes | ||
RUN mkdir /run/nginx | ||
RUN sed -i 's/cgi.fix_pathinfo= 0/cgi.fix_pathinfo=1/g' /etc/php7/php.ini | ||
ONBUILD RUN chown www:www /opt/www/ -R | ||
|
||
EXPOSE 80 | ||
CMD php-fpm7 && nginx; tail -F /var/log/nginx/error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
# Unify Guest Portal | ||
# UniFi Guest Portal | ||
|
||
## Usage | ||
|
||
```BASH | ||
docker run -p 80:80 carlgo11/guest-portal | ||
``` | ||
|
||
Optionally, add some background images: | ||
|
||
```BASH | ||
docker run -p 80:80 -v $(pwd)/bg.webp:/opt/www/img/bg.webp -v $(pwd)/bg.jpg:/opt/www/img/bg.jpg carlgo11/guest-portal | ||
``` | ||
|
||
## Environment variables | ||
|
||
|Name|Default|Description|Example| | ||
|----|-------|-----------|-------| | ||
|UNIFI_USER| |UniFi Hotspot username|api | ||
|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 | ||
|
||
## License | ||
|
||
This work is licensed under the Creative Commons Attribution 4.0 International License. | ||
To view a copy of this license, visit [LICENSE](LICENSE). | ||
To view a copy of this license, visit [LICENSE](LICENSE). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'jekyll' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
theme: null | ||
exclude: | ||
- vendor/bundle | ||
- vendor/cache | ||
- .bundle | ||
- .gitignore | ||
- composer.json | ||
- Gemfile | ||
theme: null | ||
exclude: | ||
- vendor/bundle | ||
- vendor/cache | ||
- .bundle | ||
- .gitignore | ||
- composer.json | ||
- Gemfile | ||
- README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<!-- Awaiting approval --> | ||
<div id="approval" class="view"> | ||
<div class="spinner"> | ||
<div class="spinner-grow spinner-grow-lg text-success" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
<div class="btn-back noselect"><i class="fas fa-chevron-left "></i> Back</div> | ||
<h2 class="noselect">Waiting for | ||
approval...</h2> | ||
<!-- Awaiting approval --> | ||
<div id="approval" class="view"> | ||
<div class="spinner"> | ||
<div class="spinner-grow spinner-grow-lg text-success" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
<div class="btn-back noselect"><i class="fas fa-chevron-left "></i> Back</div> | ||
<h2 class="noselect">Waiting for | ||
approval...</h2> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<!-- Error --> | ||
<div id="error" class="view"> | ||
<div class="btn-back noselect"><i class="fas fa-chevron-left "></i> Back</div> | ||
<div id="error-container"> | ||
<h1><i class="far fa-frown text-danger noselect"></i></h1> | ||
<h2 id="error-msg">Error:</h2> | ||
</div> | ||
<!-- Error --> | ||
<div id="error" class="view"> | ||
<div class="btn-back noselect"><i class="fas fa-chevron-left "></i> Back</div> | ||
<div id="error-container"> | ||
<h1><i class="far fa-frown text-danger noselect"></i></h1> | ||
<h2 id="error-msg">Error:</h2> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<!-- Form --> | ||
<div id="form" class="view"> | ||
<form method="POST" action="/submit.php"> | ||
<h1 class="title noselect">Guest Wifi</h1> | ||
<div class="input-group"> | ||
<input class="form-control" type="text" placeholder="Enter your login code" pattern="^\d{5}(?:-)?\d{5}$" | ||
autocomplete="one-time-code" autofocus="" autocapitalize="off" spellcheck="false" inputmode="numeric" | ||
required="" id="otp" maxlength="11" name="code"> | ||
|
||
<span class="input-group-btn"> | ||
<button type="submit" class="btn btn-success ">Connect <i class="fas fa-chevron-right"></i></button> | ||
</span> | ||
</div> | ||
|
||
<div class="separator noselect">or</div> | ||
<button type="button" class="btn btn-danger form-control" id="manual"><i class="fas fa-comment"></i> Manual | ||
approval</button> | ||
</form> | ||
<!-- Form --> | ||
<div id="form" class="view"> | ||
<form method="POST" action="/api/submit.php"> | ||
<h1 class="title noselect">Guest Wifi</h1> | ||
<div class="input-group"> | ||
<input class="form-control" type="text" placeholder="Enter your login code" pattern="^\d{5}(?:-)?\d{5}$" | ||
autocomplete="one-time-code" autofocus="" autocapitalize="off" spellcheck="false" inputmode="numeric" | ||
required="" id="otp" maxlength="11" name="code"> | ||
|
||
<span class="input-group-btn"> | ||
<button type="submit" class="btn btn-success ">Connect <i class="fas fa-chevron-right"></i></button> | ||
</span> | ||
</div> | ||
|
||
<div class="separator noselect">or</div> | ||
<button type="button" class="btn btn-danger form-control" id="manual"><i class="fas fa-comment"></i> Manual | ||
approval</button> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<!-- Loading --> | ||
<div id="loading" class="view"> | ||
<h1>Communicating with network...</h1> | ||
<div> | ||
<div class="spinner-grow text-success" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
<!-- Loading --> | ||
<div id="loading" class="view"> | ||
<h1>Communicating with network...</h1> | ||
<div> | ||
<div class="spinner-grow text-success" role="status"> | ||
<span class="sr-only">Loading...</span> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!-- Success --> | ||
<div id="success" class="view"> | ||
<h1>Welcome! 😄</h1> | ||
<!-- Success --> | ||
<div id="success" class="view"> | ||
<h1>Welcome! 😄</h1> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
<html lang="en-us"> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width initial-scale=1"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>Guest WiFi</title> | ||
<link rel="icon" href="/img/favicon.svg" type="image/x-icon" /> | ||
<link rel="icon" href="/img/favicon.png" type="image/png" /> | ||
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png" sizes="256x256" /> | ||
<link rel="stylesheet" href="/css/bootstrap.min.css" /> | ||
<link rel="stylesheet" href="/css/main.css" /> | ||
<link rel="stylesheet" href="/css/all.min.css" /> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
{{ content }} | ||
</div> | ||
<script src="/js/jquery.min.js"></script> | ||
<script src="/js/jquery-ui.min.js"></script> | ||
<script src="/js/modenizr-webp.min.js"></script> | ||
{% if page.name == 'index.html' %}<script src="/js/main.js"></script>{% endif %} | ||
{% if page.name == 'admin.html' %}<script src="/js/admin.js"></script>{% endif %} | ||
</body> | ||
|
||
<html lang="en-us"> | ||
|
||
<head> | ||
<meta name="viewport" content="width=device-width initial-scale=1"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>Guest WiFi</title> | ||
<link rel="icon" href="/img/favicon.svg" type="image/x-icon" /> | ||
<link rel="icon" href="/img/favicon.png" type="image/png" /> | ||
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png" sizes="256x256" /> | ||
<link rel="stylesheet" href="/css/bootstrap.min.css" /> | ||
<link rel="stylesheet" href="/css/main.css" /> | ||
<link rel="stylesheet" href="/css/all.min.css" /> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
{{ content }} | ||
</div> | ||
<script src="/js/jquery.min.js"></script> | ||
<script src="/js/jquery-ui.min.js"></script> | ||
<script src="/js/modenizr-webp.min.js"></script> | ||
{% if page.name == 'index.html' %}<script src="/js/main.js"></script>{% endif %} | ||
{% if page.name == 'admin.html' %}<script src="/js/admin.js"></script>{% endif %} | ||
</body> | ||
|
||
</html> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.