Skip to content

Commit

Permalink
Login
Browse files Browse the repository at this point in the history
  • Loading branch information
MiranDaniel committed Mar 10, 2022
1 parent 699616e commit d128642
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 1 deletion.
37 changes: 37 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Copyright 2021-2022 MiranDaniel


The Software is provided to you by the Licensor under
the License, as defined below, subject to the following
condition.

Without limiting other conditions in the
License, the grant of rights under the License will not
include, and the License does not grant to you, the
right to Sell the Software.

For purposes of the
foregoing, “Sell” means practicing any or all of the
rights granted to you under the License to provide to
third parties, for a fee or other consideration
(including without limitation fees for hosting or
consulting/ support services related to the Software), a
product or service whose value derives, entirely or
substantially, from the functionality of the Software.
Any license notice or attribution required by the
License must also include this Commons Cause License
Condition notice.


THE SOFTWARE IS PROVIDED "AS IS",
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,48 @@ This branch hosts the f1rewall 2.0 version.
Still under development, do not use, feel free to contribute :)


---

Version: `2.0.0-alpha.1`

---

## License

```text
Copyright 2021-2022 MiranDaniel
The Software is provided to you by the Licensor under
the License, as defined below, subject to the following
condition.
Without limiting other conditions in the
License, the grant of rights under the License will not
include, and the License does not grant to you, the
right to Sell the Software.
For purposes of the
foregoing, “Sell” means practicing any or all of the
rights granted to you under the License to provide to
third parties, for a fee or other consideration
(including without limitation fees for hosting or
consulting/ support services related to the Software), a
product or service whose value derives, entirely or
substantially, from the functionality of the Software.
Any license notice or attribution required by the
License must also include this Commons Cause License
Condition notice.
THE SOFTWARE IS PROVIDED "AS IS",
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
28 changes: 28 additions & 0 deletions blueprints/dash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import multiprocessing

from flask import Blueprint, render_template, abort, request, redirect
from source import conf
from source import utils
from source import captcha
from source import invites

import threading

utils.check_os()
utils.check_setup()

dashboard = Blueprint('dashboard', __name__,
template_folder='templates')

configuration = conf.load_conf()


@dashboard.route('/admin/login')
def login():
return render_template(
"login.jinja2",
captcha=configuration.captcha,
public=configuration.captcha_public,
args=configuration.args,
kwargs=configuration.kwargs
)
8 changes: 8 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

#
# Version 2.0.0-alpha.1
#


from flask import Flask

from blueprints import gate
from blueprints import dash

from source import utils

Expand All @@ -17,6 +24,7 @@

app = Flask(__name__)
app.register_blueprint(gate.gateway)
app.register_blueprint(dash.dashboard)


@catch_goodbye()
Expand Down
2 changes: 1 addition & 1 deletion source/invites.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self):
self.poolSizeDefault = self.poolSize

def debug(self):
return # disable debug mode
#return # disable debug mode

print("::InvitePool::DEBUG:: " + str(self.pool))

Expand Down
Binary file added static/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/wordmark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions templates/admin.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>

</body>
</html>
53 changes: 53 additions & 0 deletions templates/login.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>f1rewall admin</title>
<link rel="icon" href="https://cdn.discordapp.com/attachments/921927247349305364/942517715145482240/F1rewall_Logo_Flames.png">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
{% if captcha == "recaptcha"%}
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
{% elif captcha == "hcaptcha" %}
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
{% endif %}
</head>
<body class="bg-dark text-light text-center">
<main>
<div class="container my-5">
<div class="row">
<div class="col">
<h1 class="display-6">f1rewall dashboard login</h1>
</div>
</div>
<div class="row mx-auto" style="width: 33%; min-width: 300px;">
<div class="col">
<form class="mx-auto">
<div class="form-group">
<label for="username">Username</label>
<input type="text" name="username" id="username" class="form-control form-control-sm">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" name="password" id="password" class="form-control form-control-sm">
</div>
<div class="form-group my-3">
{% if captcha == "recaptcha"%}
<form action="?" method="POST" class="f">
<div data-callback="alertSuccess" data-theme="{{args["theme"]}}" class="g-recaptcha" data-sitekey="{{public}}"></div>
</form>
{% elif captcha == "hcaptcha" %}
<div data-callback="alertSuccess" class="h-captcha" data-sitekey="{{ public }}"></div>
{% else %}
<p>Invalid captcha setting, please contact admin</p>
{% endif %}
</div>
<div class="form-group">
<button style="width: 100%" type="submit" class="btn btn-light btn-block">Login</button>
</div>
</form>
</div>
</div>
</div>
</main>
</body>
</html>

0 comments on commit d128642

Please sign in to comment.