From d1286422afd1576194f931bf8024b92f0f2afb6c Mon Sep 17 00:00:00 2001 From: MiranDaniel Date: Thu, 10 Mar 2022 22:10:51 +0100 Subject: [PATCH] Login --- LICENSE | 37 ++++++++++++++++++++++++++++ README.md | 44 ++++++++++++++++++++++++++++++++++ blueprints/dash.py | 28 ++++++++++++++++++++++ main.py | 8 +++++++ source/invites.py | 2 +- static/background.png | Bin 0 -> 4747 bytes static/wordmark.png | Bin 0 -> 1034 bytes templates/admin.jinja2 | 10 ++++++++ templates/login.jinja2 | 53 +++++++++++++++++++++++++++++++++++++++++ 9 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 LICENSE create mode 100644 blueprints/dash.py create mode 100644 static/background.png create mode 100644 static/wordmark.png create mode 100644 templates/admin.jinja2 create mode 100644 templates/login.jinja2 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..159c9cc --- /dev/null +++ b/LICENSE @@ -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. + + diff --git a/README.md b/README.md index ad6e1f9..7bf31de 100644 --- a/README.md +++ b/README.md @@ -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. +``` diff --git a/blueprints/dash.py b/blueprints/dash.py new file mode 100644 index 0000000..3b9728d --- /dev/null +++ b/blueprints/dash.py @@ -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 + ) diff --git a/main.py b/main.py index fb42cfa..a01c637 100644 --- a/main.py +++ b/main.py @@ -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 @@ -17,6 +24,7 @@ app = Flask(__name__) app.register_blueprint(gate.gateway) +app.register_blueprint(dash.dashboard) @catch_goodbye() diff --git a/source/invites.py b/source/invites.py index 1b91d66..fc76134 100644 --- a/source/invites.py +++ b/source/invites.py @@ -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)) diff --git a/static/background.png b/static/background.png new file mode 100644 index 0000000000000000000000000000000000000000..1271528de6d38fbc0c9c7e9acd8fe524fd8b4b6f GIT binary patch literal 4747 zcmeHKi#ro){NE5Ego+sJa*j*67PcY|>L79#GNYV0F0)OR>uf6NhEvq!dL)!vqBfVA zq4CRHI{680RSnel%#k^V`mB_UNqfZyf5_j_C9;|?CsmP1qB7ArKL0)jY6T2NTkZj zN`XTD|A@n6QI7sM006}gKPT|%NkvTnK;@9rd0X%J0uFQZA z-hx^wAx`!G<3GZ{?o4i=nTVr>YQyFODE#YL47iic8O7waR;A<4ebK}U*&Vm7j!|VcFkBHQ7Hi&y!RL?W z4HGjMcK}Ft|3Yk{+w+l#HGxSI1c68H$4e?bE4J~w{)aA?}AokjRw{=U${ z)d#an1&krn>HDOhz0)rc=%ZAt@T|Qnu2%dS<0WsdtHjj1QK`mr%pw~zYQ^R-*_wKl z7rFsvIg~oE|K4j7uzn9Pb0=d6s=e3PP4Iuw(9L?;;c{Tg$QJRVU_AJFDjNZJ2udQ}-uiz6Vw3V6a<%Q-lgymnT zmm)1UoG6*^d}pi;s4|@X73rTG(mpD&Y}Y#z17uACMhv1`8q~n^1lo(uP#!ozce`c$ z>j3QltI;y)h6-GCoj1GT8Tk6vrfzW!J2>5Krgzsp$2&>6qp;waPcMTqj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wy>CVZ=LtoDC(~3{k&C*;YVY? zY%cot?x$jA&(GJB4=L2-{B|;H*|qd<&pPw3r{1P-slTjk-oID4UpaQ^;p6w(-7oEz k746^4PiAgl`0)R${?tu<=RQuDlMFJ$)78&qol`;+0Pph9eE + + + + Title + + + + + \ No newline at end of file diff --git a/templates/login.jinja2 b/templates/login.jinja2 new file mode 100644 index 0000000..e079d34 --- /dev/null +++ b/templates/login.jinja2 @@ -0,0 +1,53 @@ + + + + + f1rewall admin + + + {% if captcha == "recaptcha"%} + + {% elif captcha == "hcaptcha" %} + + {% endif %} + + +
+
+
+
+

f1rewall dashboard login

+
+
+
+
+
+
+ + +
+
+ + +
+
+ {% if captcha == "recaptcha"%} + +
+ + {% elif captcha == "hcaptcha" %} +
+ {% else %} +

Invalid captcha setting, please contact admin

+ {% endif %} +
+
+ +
+ +
+
+
+
+ + \ No newline at end of file