Spaces:
Paused
Paused
lain-iwakura
commited on
Commit
•
57fd3ba
1
Parent(s):
3c8d1eb
Create fallback.py
Browse files- fallback.py +61 -0
fallback.py
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from flask import Flask, Response, jsonify
|
2 |
+
from flask_cors import CORS
|
3 |
+
|
4 |
+
port = 7860
|
5 |
+
host = "0.0.0.0"
|
6 |
+
|
7 |
+
app = Flask(__name__)
|
8 |
+
CORS(app)
|
9 |
+
|
10 |
+
@app.route('/', defaults={'path': ''})
|
11 |
+
@app.route('/<path:path>', methods=['GET', 'POST'])
|
12 |
+
def catch_all(path):
|
13 |
+
# HTML content
|
14 |
+
html = '''<!DOCTYPE html>
|
15 |
+
<html lang="en">
|
16 |
+
<head>
|
17 |
+
<meta charset="UTF-8">
|
18 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
19 |
+
<title>Under maintenance</title>
|
20 |
+
<style>
|
21 |
+
body {
|
22 |
+
background-color: #f5f5f5;
|
23 |
+
color: #333;
|
24 |
+
font-family: Arial, sans-serif;
|
25 |
+
line-height: 1.5;
|
26 |
+
padding: 1em;
|
27 |
+
max-width: 800px;
|
28 |
+
margin: 0 auto
|
29 |
+
}
|
30 |
+
|
31 |
+
h1,
|
32 |
+
h2,
|
33 |
+
h3,
|
34 |
+
h4,
|
35 |
+
h5,
|
36 |
+
h6 {
|
37 |
+
font-weight: bold;
|
38 |
+
margin-top: 1.5em
|
39 |
+
}
|
40 |
+
</style>
|
41 |
+
</head>
|
42 |
+
<body>
|
43 |
+
<h1>A note from us</h1>
|
44 |
+
<hr>
|
45 |
+
<p>Hello, discord users and redditors. An inside man from the janitorai discord told me that you were using my proxy.</p>
|
46 |
+
<p>Stop using these proxies. Most, if not all of the proxies you use are made by 4chan users.</p><p>The code that all of these reverse proxies run were made by an anonymous user on 4chan.</p>
|
47 |
+
<p>You are all nothing but worthless leeches.</p>
|
48 |
+
<p>We do not like you. Stop using these proxies. Make your own.</p>
|
49 |
+
<hr>
|
50 |
+
<p>
|
51 |
+
Want to talk? Add me on Discord.<br>
|
52 |
+
<strong>Discord Username: "lainchan.org"</strong>
|
53 |
+
</p>
|
54 |
+
</body>
|
55 |
+
</html>'''
|
56 |
+
# html = '''HuggingFace is, once again, currently experiencing a DDoS attack. Please check back within 24 hours. Due to being banned from the JanitorAI server under false pretenses, I am unable to properly communicate with you all. Apologies for the inconvenience. Discord tag: Moxxie#4385'''
|
57 |
+
# return html
|
58 |
+
return Response(html, status=403)
|
59 |
+
|
60 |
+
if __name__ == '__main__':
|
61 |
+
app.run(host=host, port=port)
|