Skip to content

Commit eb80326

Browse files
committed
Merge branch 'master' of https://github.com/MiranDaniel/f1rewall
2 parents 49c674d + aeb6d19 commit eb80326

File tree

7 files changed

+102
-12
lines changed

7 files changed

+102
-12
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*venv*
2-
*pycache*
2+
*pycache*
3+
*VS*

app.py

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
"""
22
Copyright 2021 MiranDaniel
3-
43
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5-
64
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7-
85
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.
96
"""
107

@@ -19,6 +16,38 @@
1916
print(exc)
2017
quit(1)
2118

19+
if "dark_theme" not in config:
20+
print("!! Theme not defined")
21+
if "recaptcha" in config:
22+
if "public" not in config["recaptcha"]:
23+
print("!! Recaptcha public key is not defined, exiting")
24+
quit(1)
25+
if "private" not in config["recaptcha"]:
26+
print("!! Recaptcha private key is not defined, exiting")
27+
quit(1)
28+
else:
29+
print("!! Recaptcha config doesnt exist, exiting")
30+
quit(1)
31+
32+
if "discord" in config:
33+
if "welcome_room" not in config["discord"]:
34+
print("!! Discord welcome room not defined, exiting")
35+
quit(1)
36+
if "private" not in config["discord"]:
37+
print("!! Discord private key is not defined, exiting")
38+
quit(1)
39+
else:
40+
print("!! Discord config doesnt exist, exiting")
41+
quit(1)
42+
43+
if "server" in config:
44+
if "port" not in config["server"]:
45+
print("!! Server port not defined, exiting")
46+
quit(1)
47+
else:
48+
print("!! Sever config not defined, exiting")
49+
quit(1)
50+
2251
def recaptcha(token):
2352
recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify'
2453
payload = {

config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# anyone with your Discord private key can controll your bot!
55
#
66

7+
78
# false for light theme
89
# true for dark theme
910
dark_theme: false
@@ -13,13 +14,16 @@ recaptcha:
1314
public:
1415

1516
# DO NOT LEAK THIS
17+
# put your private recapthca key here!
1618
private:
1719

1820
discord:
1921
# users will be invited to this room, it should be public
22+
# put your welcome room ID here
2023
welcome_room:
2124

2225
# DO NOT LEAK THIS
26+
# put your Discord bot token here
2327
private:
2428

2529
server:

docs/cloudflare_tunnel.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# How to set up the Cloudflare tunnel to host your gateway
2+
3+
**Warning: this method requires you to change your domain namesevers to Cloudflare**
4+
5+
Cloudflare tunnel is an easy way to host your gateway on a subdomain (ex. chat.<>.<>)
6+
7+
## Cloudflare docs
8+
9+
1. https://support.cloudflare.com/hc/en-us/articles/201720164-Creating-a-Cloudflare-account-and-adding-a-website
10+
2. https://support.cloudflare.com/hc/en-us/articles/205195708
11+
3. https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide
12+
13+
## Notes
14+
When setting up your tunnel, it's application localhost post has to match your preconfigured port in config.yaml!

docs/customising.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# How to customise your gateway
2+
3+
This gateway is fully customisables.
4+
5+
## Logo customisation
6+
7+
To change the app logo, head to `static/wordmark.png` and replace it with yours.
8+
9+
## Background customisation
10+
11+
To change the background, head to `static/background.png` and replace it with the background you want.
12+
You can also apply gradients in the `templates/index.html` file.
13+
14+
## Theme customisation
15+
16+
To customise the theme, change the `dark_theme` value in your `config.yaml` file.
17+
18+
## Website design customisation
19+
20+
To customise the rest of the website, simply edit the `templates/index.html` file to fit your needs.

readme.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
# f1rewall
2+
*The sleek, simple and scalable invite gateway for your Discord community*
3+
4+
---
5+
6+
7+
Light theme default | Dark theme default
8+
:-------------------------:|:-------------------------:
9+
<img src="https://media.discordapp.net/attachments/795438999761977394/910258446681657374/unknown.png" height="200"/> | <img src="https://cdn.discordapp.com/attachments/795438999761977394/910258701204602920/unknown.png" height="200"/>
10+
11+
*All websites elements can be customised easily*
12+
13+
---
214

315
## Setup guide:
416

@@ -54,11 +66,13 @@ Congrats! Your recaptcha is now ready!
5466
2. Run `sh run.sh` to start the server
5567
3. The script will now host your gateway on the port specified in config.yaml
5668

57-
### 5. Firewall configuration
69+
## Network configuration
70+
71+
### 1. Firewall configuration
5872

5973
1. Configure your firewall and open the port specified in config.yaml
6074

61-
### 6. DNS configuration
75+
### 2a. DNS configuration
6276

6377
Remember to set a static IP and host on port 80.
6478
If you want to stop the Apache server from running on port 80, use `sudo systemctl stop apache2`
@@ -67,26 +81,29 @@ Follow this guide to redirect your chat.<>.<> domain to your chat gateway. https
6781

6882
You can also use the CloudFlare Argo Tunnel.
6983

70-
### 6. Additional configuration
84+
### 2b. CloudFlare tunnel configuration
85+
86+
Read the documentation file in `docs/clouflare_tunnel.md`
87+
88+
## Discord configuration
7189

7290
1. Make sure the gateway works
7391
2. Disallow users on your server from making new invites, let only the bot create them
7492
3. Put your logo in static/wordmark.png
7593
4. Put the website background in static/background.png
7694
5. Set the `dark_theme` value in config.yaml to set the website text color
7795

78-
## Modifications
79-
80-
The website look can be changed in the templates/index.html file
96+
## Customisation
8197

98+
Read the documentation file in `docs/customisation.md`
8299

83100
## Support
84101

85102
This project is provided for free. Free as in freedom, not beer.
86103

87104
If you're having issues with the app please open an issue or discussion thread.
88105

89-
I'll try my best to help you.
106+
Private support can be provided. Find the contact information on https://mirandaniel.com/
90107

91108
## Donations
92109

templates/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<html lang="en">
2-
2+
<!--
3+
Copyright 2021 MiranDaniel
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
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.
7+
-->
38
<head>
49
<meta charset="UTF-8">
510
<meta http-equiv="X-UA-Compatible" content="IE=edge">

0 commit comments

Comments
 (0)