Skip to content

Commit 49c674d

Browse files
committed
Comments
1 parent a1a2838 commit 49c674d

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

app.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,16 @@ def invite():
4545
border = "border-dark" if config["dark_theme"] else ""
4646
catpcha_theme = "dark" if config["dark_theme"] else "light"
4747

48-
@app.route("/")
48+
49+
@app.route("/") # main function
4950
def index():
50-
key = request.args.get('key')
51-
if key:
52-
r = recaptcha(key)
53-
if r["success"]:
54-
i = invite()
55-
return redirect(f"https://discord.gg/{i}")
56-
else:
57-
return render_template("index.html", public=config["recaptcha"]["public"], failed=True, theme=theme, border=border, catpcha_theme=catpcha_theme)
58-
59-
return render_template("index.html", public=config["recaptcha"]["public"], failed=False, theme=theme, border=border, catpcha_theme=catpcha_theme)
51+
key = request.args.get('key') # get key parameter from URL
52+
if key: # if key set
53+
r = recaptcha(key) # confirm captcha
54+
if r["success"]: # if ok
55+
i = invite() # generate new invite
56+
return redirect(f"https://discord.gg/{i}") # redirect user to new invite
57+
else: # if captcha invalid
58+
return render_template("index.html", public=config["recaptcha"]["public"], failed=True, theme=theme, border=border, catpcha_theme=catpcha_theme) # return error page
59+
# if not key
60+
return render_template("index.html", public=config["recaptcha"]["public"], failed=False, theme=theme, border=border, catpcha_theme=catpcha_theme) # return normal page

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ discord:
2525
server:
2626
# the script will host the gateway on this port
2727
# defaults to 80
28-
port: 80
28+
port: 5000

readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ Congrats! Your recaptcha is now ready!
6363
Remember to set a static IP and host on port 80.
6464
If you want to stop the Apache server from running on port 80, use `sudo systemctl stop apache2`
6565

66-
1. Follow this guide to redirect your chat.<>.<> domain to your chat gateway. https://www.namecheap.com/support/knowledgebase/article.aspx/9776/2237/how-to-create-a-subdomain-for-my-domain/
66+
Follow this guide to redirect your chat.<>.<> domain to your chat gateway. https://www.namecheap.com/support/knowledgebase/article.aspx/9776/2237/how-to-create-a-subdomain-for-my-domain/
67+
68+
You can also use the CloudFlare Argo Tunnel.
6769

6870
### 6. Additional configuration
6971

0 commit comments

Comments
 (0)