diff --git a/docker-compose.yml b/docker-compose.yml index ead3d25cf..29896365d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ services: - READ_ONLY=0 - BOT_DISABLE=0 - COINS_NAME=Dramacoins - - DEFAULT_TIME_FILTER=day + - DEFAULT_TIME_FILTER=all - DEFAULT_THEME=dark - DEFAULT_COLOR=ff66ac #YOU HAVE TO PICK ONE OF THOSE COLORS OR SHIT WILL BREAK: ff66ac, 805ad5, 62ca56, 38a169, 80ffff, 2a96f3, eb4963, ff0000, f39731, 30409f, 3e98a7, e4432d, 7b9ae4, ec72de, 7f8fa6, f8db58 - SLOGAN=Dude bussy lmao diff --git a/files/routes/comments.py b/files/routes/comments.py index ce480c4d2..bf5a25784 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -45,7 +45,9 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None): if not pid: if comment.parent_submission: pid = comment.parent_submission - else: pid = 6489 + elif "rdrama" in request.host: pid = 6489 + elif "pcm" in request.host: pid = 382 + else: pid = 1 try: pid = int(pid) except: abort(404) diff --git a/files/routes/front.py b/files/routes/front.py index 8fe8531be..88c76393e 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -361,13 +361,11 @@ def changelog(v): @auth_desired def random_post(v): - x = g.db.query(Submission).filter(Submission.deleted_utc == 0, Submission.is_banned == False) - total = x.count() - n = random.randint(0, total - 1) + n = random.randint(1, total - 2) - post = x.offset(n).limit(1).first() + post = x.all()[n] return redirect(f"/post/{post.id}") @cache.memoize(timeout=86400) diff --git a/files/templates/header.html b/files/templates/header.html index 86791d519..6356b287a 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -161,7 +161,7 @@ diff --git a/files/templates/settings_security.html b/files/templates/settings_security.html index badd2ac13..a42ec6519 100644 --- a/files/templates/settings_security.html +++ b/files/templates/settings_security.html @@ -290,10 +290,6 @@ - diff --git a/setup b/setup index ace8e9573..ae934bccb 100644 --- a/setup +++ b/setup @@ -1,4 +1,3 @@ -sysctl vm.overcommit_memory=1 sudo apt update sudo apt install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - @@ -8,4 +7,5 @@ apt-cache policy docker-ce sudo apt install docker-ce sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose -docker-compose up +sysctl vm.overcommit_memory=1 +docker-compose up \ No newline at end of file