remotes/1693045480750635534/spooky-22
Aevann1 2022-01-15 08:01:39 +02:00
parent 81a5083960
commit 43e2aedbd2
9 changed files with 12 additions and 14 deletions

View File

@ -21,6 +21,7 @@ services:
- HCAPTCHA_SECRET=3435tdfsdudebussylmaoxxt43 - HCAPTCHA_SECRET=3435tdfsdudebussylmaoxxt43
- YOUTUBE_KEY=3435tdfsdudebussylmaoxxt43 - YOUTUBE_KEY=3435tdfsdudebussylmaoxxt43
- PUSHER_KEY=3435tdfsdudebussylmaoxxt43 - PUSHER_KEY=3435tdfsdudebussylmaoxxt43
- PUSHER_ID=3435tdfsdudebussylmaoxxt43
- IMGUR_KEY=3435tdfsdudebussylmaoxxt43 - IMGUR_KEY=3435tdfsdudebussylmaoxxt43
- SPAM_SIMILARITY_THRESHOLD=0.5 - SPAM_SIMILARITY_THRESHOLD=0.5
- SPAM_URL_SIMILARITY_THRESHOLD=0.1 - SPAM_URL_SIMILARITY_THRESHOLD=0.1

1
env
View File

@ -9,6 +9,7 @@ export DISCORD_CLIENT_SECRET="3435tdfsdudebussylmaoxxt43"
export DISCORD_BOT_TOKEN="3435tdfsdudebussylmaoxxt43" export DISCORD_BOT_TOKEN="3435tdfsdudebussylmaoxxt43"
export HCAPTCHA_SECRET="3435tdfsdudebussylmaoxxt43" export HCAPTCHA_SECRET="3435tdfsdudebussylmaoxxt43"
export YOUTUBE_KEY="3435tdfsdudebussylmaoxxt43" export YOUTUBE_KEY="3435tdfsdudebussylmaoxxt43"
export PUSHER_ID="3435tdfsdudebussylmaoxxt43"
export PUSHER_KEY="3435tdfsdudebussylmaoxxt43" export PUSHER_KEY="3435tdfsdudebussylmaoxxt43"
export IMGUR_KEY="3435tdfsdudebussylmaoxxt43" export IMGUR_KEY="3435tdfsdudebussylmaoxxt43"
export SPAM_SIMILARITY_THRESHOLD="0.5" export SPAM_SIMILARITY_THRESHOLD="0.5"

View File

@ -225,11 +225,6 @@ class User(Base):
if u.patron: return True if u.patron: return True
return False return False
@property
@lazy
def strid(self):
return str(self.id)
@cache.memoize(timeout=86400) @cache.memoize(timeout=86400)
def userpagelisting(self, v=None, page=1, sort="new", t="all"): def userpagelisting(self, v=None, page=1, sort="new", t="all"):

View File

@ -208,7 +208,7 @@ else:
BUG_THREAD = 0 BUG_THREAD = 0
WELCOME_MSG = f"Welcome to {SITE}!" WELCOME_MSG = f"Welcome to {SITE}!"
PUSHER_INSTANCE_ID = '02ddcc80-b8db-42be-9022-44c546b4dce6' PUSHER_ID = environ.get("PUSHER_ID", "").strip()
PUSHER_KEY = environ.get("PUSHER_KEY", "").strip() PUSHER_KEY = environ.get("PUSHER_KEY", "").strip()
BADGES = { BADGES = {

View File

@ -24,4 +24,4 @@ def post_embed(id, v):
@app.context_processor @app.context_processor
def inject_constants(): def inject_constants():
return {"num_banners":num_banners, "environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID": AUTOJANNY_ID, "NOTIFICATIONS_ID": NOTIFICATIONS_ID} return {"num_banners":num_banners, "environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID": AUTOJANNY_ID, "NOTIFICATIONS_ID": NOTIFICATIONS_ID, "PUSHER_ID": PUSHER_ID}

View File

@ -17,7 +17,7 @@ else: cc = "COUNTRY CLUB"
IMGUR_KEY = environ.get("IMGUR_KEY").strip() IMGUR_KEY = environ.get("IMGUR_KEY").strip()
beams_client = PushNotifications( beams_client = PushNotifications(
instance_id=PUSHER_INSTANCE_ID, instance_id=PUSHER_ID,
secret_key=PUSHER_KEY, secret_key=PUSHER_KEY,
) )
@ -469,7 +469,7 @@ def api_comment(v):
if parent.author.id != v.id: if parent.author.id != v.id:
try: try:
beams_client.publish_to_interests( beams_client.publish_to_interests(
interests=[str(parent.author.id)], interests=[f'{request.host}{parent.author.id}'],
publish_body={ publish_body={
'web': { 'web': {
'notification': { 'notification': {

View File

@ -14,7 +14,7 @@ from collections import Counter
site = environ.get("DOMAIN").strip() site = environ.get("DOMAIN").strip()
beams_client = PushNotifications(instance_id=PUSHER_INSTANCE_ID, secret_key=PUSHER_KEY) beams_client = PushNotifications(instance_id=PUSHER_ID, secret_key=PUSHER_KEY)
db = db_session() db = db_session()
@ -438,7 +438,7 @@ def message2(v, username):
try: try:
beams_client.publish_to_interests( beams_client.publish_to_interests(
interests=[str(user.id)], interests=[f'{request.host}{parent.author.id}'],
publish_body={ publish_body={
'web': { 'web': {
'notification': { 'notification': {

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta name="description" content="{{'DESCRIPTION' | app_config}}"> <meta name="description" content="{{'DESCRIPTION' | app_config}}">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' ajax.cloudflare.com; connect-src 'self' tls-use1.fpapi.io api.fpjs.io 02ddcc80-b8db-42be-9022-44c546b4dce6.pushnotifications.pusher.com; object-src 'none';"> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' ajax.cloudflare.com; connect-src 'self' tls-use1.fpapi.io api.fpjs.io {{PUSHER_ID}}.pushnotifications.pusher.com; object-src 'none';">
<script src="/static/assets/js/bootstrap.js?a=3"></script> <script src="/static/assets/js/bootstrap.js?a=3"></script>
{% if v %} {% if v %}

View File

@ -165,8 +165,9 @@
{% endif %} {% endif %}
{% if v %} {% if v %}
<div class="d-none" id="strid">{{v.strid}}</div> <div class="d-none" id="strid">{{request.host}}{{v.id}}</div>
<script src="/static/assets/js/pusher.js?a=3"></script> <div class="d-none" id="pusherid">{{PUSHER_ID}}</div>
<script src="/static/assets/js/pusher.js?a=5"></script>
{% endif %} {% endif %}
{% endblock %} {% endblock %}