Skip to content

Commit d128642

Browse files
committed
Login
1 parent 699616e commit d128642

File tree

9 files changed

+181
-1
lines changed

9 files changed

+181
-1
lines changed

LICENSE

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Copyright 2021-2022 MiranDaniel
2+
3+
4+
The Software is provided to you by the Licensor under
5+
the License, as defined below, subject to the following
6+
condition.
7+
8+
Without limiting other conditions in the
9+
License, the grant of rights under the License will not
10+
include, and the License does not grant to you, the
11+
right to Sell the Software.
12+
13+
For purposes of the
14+
foregoing, “Sell” means practicing any or all of the
15+
rights granted to you under the License to provide to
16+
third parties, for a fee or other consideration
17+
(including without limitation fees for hosting or
18+
consulting/ support services related to the Software), a
19+
product or service whose value derives, entirely or
20+
substantially, from the functionality of the Software.
21+
Any license notice or attribution required by the
22+
License must also include this Commons Cause License
23+
Condition notice.
24+
25+
26+
THE SOFTWARE IS PROVIDED "AS IS",
27+
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
28+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
31+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
32+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
33+
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
34+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35+
SOFTWARE.
36+
37+

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,48 @@ This branch hosts the f1rewall 2.0 version.
77
Still under development, do not use, feel free to contribute :)
88

99

10+
---
11+
12+
Version: `2.0.0-alpha.1`
13+
14+
---
15+
16+
## License
17+
18+
```text
19+
Copyright 2021-2022 MiranDaniel
20+
21+
22+
The Software is provided to you by the Licensor under
23+
the License, as defined below, subject to the following
24+
condition.
25+
26+
Without limiting other conditions in the
27+
License, the grant of rights under the License will not
28+
include, and the License does not grant to you, the
29+
right to Sell the Software.
30+
31+
For purposes of the
32+
foregoing, “Sell” means practicing any or all of the
33+
rights granted to you under the License to provide to
34+
third parties, for a fee or other consideration
35+
(including without limitation fees for hosting or
36+
consulting/ support services related to the Software), a
37+
product or service whose value derives, entirely or
38+
substantially, from the functionality of the Software.
39+
Any license notice or attribution required by the
40+
License must also include this Commons Cause License
41+
Condition notice.
42+
1043
44+
THE SOFTWARE IS PROVIDED "AS IS",
45+
WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
46+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
47+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
48+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
49+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
50+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
51+
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
52+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53+
SOFTWARE.
54+
```

blueprints/dash.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import multiprocessing
2+
3+
from flask import Blueprint, render_template, abort, request, redirect
4+
from source import conf
5+
from source import utils
6+
from source import captcha
7+
from source import invites
8+
9+
import threading
10+
11+
utils.check_os()
12+
utils.check_setup()
13+
14+
dashboard = Blueprint('dashboard', __name__,
15+
template_folder='templates')
16+
17+
configuration = conf.load_conf()
18+
19+
20+
@dashboard.route('/admin/login')
21+
def login():
22+
return render_template(
23+
"login.jinja2",
24+
captcha=configuration.captcha,
25+
public=configuration.captcha_public,
26+
args=configuration.args,
27+
kwargs=configuration.kwargs
28+
)

main.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
2+
#
3+
# Version 2.0.0-alpha.1
4+
#
5+
6+
17
from flask import Flask
28

39
from blueprints import gate
10+
from blueprints import dash
411

512
from source import utils
613

@@ -17,6 +24,7 @@
1724

1825
app = Flask(__name__)
1926
app.register_blueprint(gate.gateway)
27+
app.register_blueprint(dash.dashboard)
2028

2129

2230
@catch_goodbye()

source/invites.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self):
2121
self.poolSizeDefault = self.poolSize
2222

2323
def debug(self):
24-
return # disable debug mode
24+
#return # disable debug mode
2525

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

static/background.png

4.64 KB
Loading

static/wordmark.png

1.01 KB
Loading

templates/admin.jinja2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
9+
</body>
10+
</html>

templates/login.jinja2

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>f1rewall admin</title>
6+
<link rel="icon" href="https://cdn.discordapp.com/attachments/921927247349305364/942517715145482240/F1rewall_Logo_Flames.png">
7+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
8+
{% if captcha == "recaptcha"%}
9+
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
10+
{% elif captcha == "hcaptcha" %}
11+
<script src="https://js.hcaptcha.com/1/api.js" async defer></script>
12+
{% endif %}
13+
</head>
14+
<body class="bg-dark text-light text-center">
15+
<main>
16+
<div class="container my-5">
17+
<div class="row">
18+
<div class="col">
19+
<h1 class="display-6">f1rewall dashboard login</h1>
20+
</div>
21+
</div>
22+
<div class="row mx-auto" style="width: 33%; min-width: 300px;">
23+
<div class="col">
24+
<form class="mx-auto">
25+
<div class="form-group">
26+
<label for="username">Username</label>
27+
<input type="text" name="username" id="username" class="form-control form-control-sm">
28+
</div>
29+
<div class="form-group">
30+
<label for="password">Password</label>
31+
<input type="password" name="password" id="password" class="form-control form-control-sm">
32+
</div>
33+
<div class="form-group my-3">
34+
{% if captcha == "recaptcha"%}
35+
<form action="?" method="POST" class="f">
36+
<div data-callback="alertSuccess" data-theme="{{args["theme"]}}" class="g-recaptcha" data-sitekey="{{public}}"></div>
37+
</form>
38+
{% elif captcha == "hcaptcha" %}
39+
<div data-callback="alertSuccess" class="h-captcha" data-sitekey="{{ public }}"></div>
40+
{% else %}
41+
<p>Invalid captcha setting, please contact admin</p>
42+
{% endif %}
43+
</div>
44+
<div class="form-group">
45+
<button style="width: 100%" type="submit" class="btn btn-light btn-block">Login</button>
46+
</div>
47+
</form>
48+
</div>
49+
</div>
50+
</div>
51+
</main>
52+
</body>
53+
</html>

0 commit comments

Comments
 (0)