Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost

master
Aevann1 2022-10-18 12:20:35 +02:00
commit 6e65a0c198
12 changed files with 121 additions and 13 deletions

View File

@ -74,7 +74,6 @@ if not path.isfile(f'/site_settings.json'):
@app.before_request
def before_request():
g.agent = request.headers.get("User-Agent")
if not g.agent and request.path != '/kofi':
return 'Please use a "User-Agent" header!', 403
@ -94,6 +93,13 @@ def before_request():
g.webview = '; wv) ' in ua
g.inferior_browser = 'iphone' in ua or 'ipad' in ua or 'ipod' in ua or 'mac os' in ua or ' firefox/' in ua
#### WPD TEMP #### temporary WPD migration logic: redirect to /
if request.host == 'watchpeopledie.co' and app.config["SERVER_NAME"] == "watchpeopledie.co":
request.path = request.path.rstrip('/')
if not request.path: request.path = '/'
if request.path != '/':
return redirect('/')
#### END WPD TEMP ####
request.path = request.path.rstrip('/')
if not request.path: request.path = '/'
request.full_path = request.full_path.rstrip('?').rstrip('/')

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -52,7 +52,7 @@ if SITE == "localhost": SITE_FULL = 'http://' + SITE
else: SITE_FULL = 'https://' + SITE
if SITE == 'pcmemes.net': CC = "SPLASH MOUNTAIN"
if SITE_NAME == 'PCM': CC = "SPLASH MOUNTAIN"
else: CC = "COUNTRY CLUB"
CC_TITLE = CC.title()
@ -993,8 +993,10 @@ for k, val in temp:
if SITE_NAME != 'rDrama':
AWARDS_DISABLED.append('progressivestack')
if SITE == 'pcmemes.net':
AWARDS_DISABLED.extend(['ban','pizzashill','marsey','bird','grass','chud','unblockable'])
if SITE_NAME == 'PCM':
# Previous set of disabled, changed temporarily by request 2022-10-17
#AWARDS_DISABLED.extend(['ban','pizzashill','marsey','bird','grass','chud','unblockable'])
AWARDS_DISABLED.extend(['unblockable'])
AWARDS_DISABLED.remove('ghost')
elif SITE_NAME == 'WPD':
AWARDS_DISABLED.remove('lootbox')
@ -1067,7 +1069,7 @@ if SITE == 'rdrama.net':
'carpathianflorist': CARP_ID,
'carpathian florist': CARP_ID,
'the_homocracy': HOMO_ID,
'justcool393', JUSTCOOL_ID
'justcool393': JUSTCOOL_ID
}
elif SITE_NAME == 'WPD':
REDDIT_NOTIFS_SITE.update({'watchpeopledie', 'makemycoffin'})

View File

@ -36,13 +36,12 @@ def get_mentions(queries):
mentions = []
for kind, query in itertools.product(kinds, queries):
try:
data = requests.get(f'https://api.pushshift.io/reddit/{kind}/search?html_decode=true&q={query}&size=1', timeout=5).json()['data']
# Special cases: PokemonGoRaids says 'Marsey' a lot unrelated to us.
# SubSimulatorGPT2 is just bots
data = requests.get(f'https://api.pushshift.io/reddit/{kind}/search?html_decode=true&q={query}&subreddit=!PokemonGoRaids,!SubSimulatorGPT2&size=1', timeout=5).json()['data']
except: break
for i in data:
# Special case: PokemonGoRaids says 'Marsey' a lot unrelated to us.
if i['subreddit'] == 'PokemonGoRaids': continue
if kind == 'comment':
body = i["body"].replace('>', '> ')
text = f'<blockquote><p>{body}</p></blockquote>'

View File

@ -106,6 +106,11 @@ def auth_desired_with_logingate(f):
v = get_logged_in_user()
if app.config['SETTINGS']['login_required'] and not v: abort(401)
#### WPD TEMP #### disable this /logged_out thing on .co
if request.host == 'watchpeopledie.co':
return make_response(f(*args, v=v, **kwargs))
#### END WPD TEMP ####
if not v and not request.path.startswith('/logged_out'):
return redirect(f"/logged_out{request.full_path}")

View File

@ -358,7 +358,7 @@ def award_thing(v, thing_type, id):
if author.marsify: body = marsify(body)
thing.body_html = sanitize(body, limit_pings=5)
g.db.add(thing)
elif ("Femboy" in kind and kind == v.house):
elif ("Femboy" in kind and kind == v.house) or kind == 'rainbow':
if author.rainbow: author.rainbow += 86400
else: author.rainbow = int(time.time()) + 86400
badge_grant(user=author, badge_id=171)

View File

@ -17,7 +17,31 @@ from files.helpers.awards import award_timers
@limiter.limit("3/second;30/minute;5000/hour;10000/day")
@auth_desired_with_logingate
def front_all(v, sub=None, subdomain=None):
#### WPD TEMP #### special front logic
from files.helpers.security import generate_hash, validate_hash
from datetime import datetime
now = datetime.utcnow()
if request.host == 'watchpeopledie.co':
if v and not v.admin_level: # security: don't auto login admins
hash = generate_hash(f'{v.id}+{now.year}+{now.month}+{now.day}+{now.hour}+WPDusermigration')
return redirect(f'https://watchpeopledie.tv/logged_out?user={v.id}&code={hash}', 301)
else:
return render_template('wpdco.html')
elif request.host == 'watchpeopledie.tv' and not v: # security: don't try to login people into accounts more than once
req_user = request.values.get('user')
req_code = request.values.get('code')
if req_user and req_code:
from files.routes.login import on_login
user = get_account(req_user, graceful=True)
if user:
if user.admin_level:
abort(401)
else:
if validate_hash(req_code, f'{user.id}+{now.year}+{now.month}+{now.day}+{now.hour}+WPDusermigration'):
on_login(user)
return redirect('/')
return redirect('/logged_out')
#### WPD TEMP #### end special front logic
if sub:
sub = sub.strip().lower()
if sub == 'chudrama' and not (v and v.can_see_chudrama): abort(403)

View File

@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="description" content="People die and this is the place to see it. You only have one life, don't make the mistakes seen here.">
<style>
:root{--primary:#ff66ac}
body {
padding-top: 54px !important;
}
@media (max-width: 767.98px) {
body {
padding-top: 44px !important;
}
}
@media (min-width: 380px) {
#logo {
width: 100px;
margin-left: 0.5rem !important;
}
}
.pad {
padding-bottom: 7.4px;
padding-top: 7.4px;
}
</style>
<link rel="stylesheet" href="/assets/css/main.css?v=4032">
<link rel="stylesheet" href="/assets/css/midnight.css?v=4000">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="thumbnail" content="/i/WPD/site_preview.webp?v=3009">
<link rel="icon" type="image/webp" href="/i/WPD/icon.webp?v=3009">
<title>rip</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="apple-mobile-web-app-title" content="WPD">
<meta name="application-name" content="WPD">
<meta name="msapplication-TileColor" content="#ff66ac">
<meta name="msapplication-config" content="/assets/browserconfig.xml?v=3009">
<meta name="theme-color" content="#ff66ac">
</head>
<body id="rip">
<div class="container">
<div class="row justify-content-around" id="main-content-row">
<div class="col h-100 custom-gutters" id="main-content-col">
<div class="row justify-content-center">
<div class="col-10 col-md-5">
<div class="center">
<div class="col-10 col-md-5">
<div class="text-center px-3 my-8">
<img src="assets/images/WPD/WPDBYE_w_text_2.png">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -1020,7 +1020,8 @@ CREATE TABLE public.users (
is_muted boolean DEFAULT false NOT NULL,
coins_spent_on_hats integer DEFAULT 0 NOT NULL,
rainbow integer,
spider integer
spider integer,
homoween_zombie character varying(7) DEFAULT 'HEALTHY'::character varying
);

View File

@ -68,6 +68,8 @@ INSERT INTO public.badge_defs VALUES (163, 'Marsey Jacobs', 'Designed 10 hats!',
INSERT INTO public.badge_defs VALUES (166, 'Giorgio Armarsey', 'Designed 250 hats 😲', NULL);
INSERT INTO public.badge_defs VALUES (164, 'Marsey de Givenchy', 'Designed 50 hats, holy cap.', NULL);
INSERT INTO public.badge_defs VALUES (180, 'Marsey Consoomer', 'Conned rDrama out of sick merch in exchange for a donation to Redbubble.', 1664417205);
INSERT INTO public.badge_defs VALUES (181, 'Z', 'Z', 1666073382);
INSERT INTO public.badge_defs VALUES (182, 'V', 'V', 1666074754);
INSERT INTO public.badge_defs VALUES (168, 'BITTEN!', 'This user has been forcibly recruited to House Vampire', NULL);
INSERT INTO public.badge_defs VALUES (170, 'Marsified', 'This user''s comments get Marsified automatically', NULL);
INSERT INTO public.badge_defs VALUES (167, 'OwOified', 'This user''s comments get OwOified automatically', NULL);
@ -185,7 +187,7 @@ INSERT INTO public.badge_defs VALUES (134, '1 Year Old 🥰', 'This user has was
-- Name: badge_defs_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public.badge_defs_id_seq', 180, true);
SELECT pg_catalog.setval('public.badge_defs_id_seq', 182, true);
--
@ -2259,6 +2261,7 @@ INSERT INTO public.marseys (name, author_id, tags, created_utc) VALUES
('marseypepe',2,'ok rightoid mellokind frog reaction',NULL),
('marseypepe2',2,'reaction frog mellokind',NULL),
('marseypepsi',2,'cola coke soda soft drink pop red white blue usa america',NULL),
('marseypeterson',2,'jordan b peterson professor intellectual chud rightoid incel twelve rules for life zoloft depressed antidepressant depression tired old smart',1666054938),
('marseypharaoh',2,'egyptian aevann pyramids',NULL),
('marseypharaoh2',2,'gods egyptian aevann animated',NULL),
('marseypharaohcat',2,'egyptian illuminati aevann pyramid sand ancient alien artifact museum history king cleopatra',NULL),