diff --git a/docker-compose.yml b/docker-compose.yml index 7cab26997..691c16797 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,44 +6,10 @@ services: context: . volumes: - "./:/service" + env_file: env environment: - DATABASE_URL=postgresql://postgres@postgres:5432 - - MASTER_KEY=3435tdfsdudebussylmaoxxt43 - REDIS_URL=redis://redis - - DOMAIN=localhost - - SITE_NAME=Drama - - GIPHY_KEY=3435tdfsdudebussylmaoxxt43 - - DISCORD_SERVER_ID=3435tdfsdudebussylmaoxxt43 - - DISCORD_CLIENT_ID=3435tdfsdudebussylmaoxxt43 - - DISCORD_CLIENT_SECRET=3435tdfsdudebussylmaoxxt43 - - DISCORD_BOT_TOKEN=3435tdfsdudebussylmaoxxt43 - #- HCAPTCHA_SITEKEY=3435tdfsdudebussylmaoxxt43 - - HCAPTCHA_SECRET=3435tdfsdudebussylmaoxxt43 - - YOUTUBE_KEY=3435tdfsdudebussylmaoxxt43 - #- PUSHER_ID=3435tdfsdudebussylmaoxxt43 - - PUSHER_KEY=3435tdfsdudebussylmaoxxt43 - - IMGUR_KEY=3435tdfsdudebussylmaoxxt43 - - SPAM_SIMILARITY_THRESHOLD=0.5 - - SPAM_URL_SIMILARITY_THRESHOLD=0.1 - - SPAM_SIMILAR_COUNT_THRESHOLD=10 - - COMMENT_SPAM_SIMILAR_THRESHOLD=0.5 - - COMMENT_SPAM_COUNT_THRESHOLD=10 - - READ_ONLY=0 - - BOT_DISABLE=0 - - DEFAULT_TIME_FILTER=all - - DEFAULT_THEME=midnight - - DEFAULT_COLOR=ff66ac - - GUMROAD_TOKEN=3435tdfsdudebussylmaoxxt43 - - GUMROAD_LINK=https://marsey1.gumroad.com/l/tfcvri - - GUMROAD_ID=tfcvri - - CARD_VIEW=1 - - DISABLE_DOWNVOTES=0 - - DUES=0 - - MAIL_USERNAME=blahblahblah@gmail.com - - MAIL_PASSWORD=3435tdfsdudebussylmaoxxt43 - - DESCRIPTION=rdrama.net caters to drama in all forms such as Real life, videos, photos, gossip, rumors, news sites, Reddit, and Beyond™. There isn't drama we won't touch, and we want it all! - - CF_KEY=3435tdfsdudebussylmaoxxt43 - - CF_ZONE=3435tdfsdudebussylmaoxxt43 links: - "redis" - "postgres" diff --git a/env.sh b/env similarity index 96% rename from env.sh rename to env index 5f75c2e03..27da3b208 100644 --- a/env.sh +++ b/env @@ -1,4 +1,3 @@ -export DATABASE_URL="postgresql://postgres@localhost:5432" export MASTER_KEY="3435tdfsdudebussylmaoxxt43" export DOMAIN="localhost" export SITE_NAME="Drama" diff --git a/files/__main__.py b/files/__main__.py index c5c967b75..df1558a8b 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -30,7 +30,7 @@ faulthandler.enable() app.config["SITE_NAME"]=environ.get("SITE_NAME").strip() app.config["GUMROAD_LINK"]=environ.get("GUMROAD_LINK", "https://marsey1.gumroad.com/l/tfcvri").strip() app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False -app.config['DATABASE_URL'] = environ.get("DATABASE_URL") +app.config['DATABASE_URL'] = environ.get("DATABASE_URL", "postgresql://postgres@localhost:5432") app.config['SECRET_KEY'] = environ.get('MASTER_KEY') app.config["SERVER_NAME"] = environ.get("DOMAIN").strip() app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 2628000 diff --git a/files/assets/css/main.css b/files/assets/css/main.css index b9004e1a5..9dcc6f06e 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -4442,7 +4442,7 @@ textarea { } @media (min-width: 992px) { .card-columns { - column-count: 5 !important; + column-count: 6 !important; } } .container, .container-fluid { @@ -4634,7 +4634,7 @@ code { .fa,.fas,.far,.fal,.fad,.fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-sm{font-size:.875em}.fa-2x{font-size:2em}.fa-fw{text-align:center;width:1.25em}.fa-flip-horizontal{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-align-left:before{content:"\f036"}.fa-android:before{content:"\f17b"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-alt-down:before{content:"\f354"}.fa-arrow-alt-up:before{content:"\f357"}.fa-arrow-right:before{content:"\f061"}.fa-arrows-v:before{content:"\f07d"}.fa-badge-check:before{content:"\f336"}.fa-balance-scale:before{content:"\f24e"}.fa-ban:before{content:"\f05e"}.fa-bars:before{content:"\f0c9"}.fa-bell:before{content:"\f0f3"}.fa-bold:before{content:"\f032"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-open:before{content:"\f518"}.fa-broom:before{content:"\f51a"}.fa-bug:before{content:"\f188"}.fa-bullhorn:before{content:"\f0a1"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-week:before{content:"\f784"}.fa-candy-cane:before{content:"\f786"}.fa-cat:before{content:"\f6be"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-circle:before{content:"\f111"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clock:before{content:"\f017"}.fa-code:before{content:"\f121"}.fa-cog:before{content:"\f013"}.fa-comment:before{content:"\f075"}.fa-comment-alt-smile:before{content:"\f4aa"}.fa-comment-dots:before{content:"\f4ad"}.fa-comments:before{content:"\f086"}.fa-compress-alt:before{content:"\f422"}.fa-copy:before{content:"\f0c5"}.fa-crown:before{content:"\f521"}.fa-discord:before{content:"\f392"}.fa-dna:before{content:"\f471"}.fa-dollar-sign:before{content:"\f155"}.fa-edit:before{content:"\f044"}.fa-ellipsis-h:before{content:"\f141"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open-text:before{content:"\f658"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand-alt:before{content:"\f424"}.fa-external-link-alt:before{content:"\f35d"}.fa-eye:before{content:"\f06e"}.fa-eye-evil:before{content:"\f6db"}.fa-eye-slash:before{content:"\f070"}.fa-feather-alt:before{content:"\f56b"}.fa-file-signature:before{content:"\f573"}.fa-filter:before{content:"\f0b0"}.fa-fire:before{content:"\f06d"}.fa-flag:before{content:"\f024"}.fa-frown:before{content:"\f119"}.fa-gavel:before{content:"\f0e3"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-github:before{content:"\f09b"}.fa-globe:before{content:"\f0ac"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-home-alt:before{content:"\f80a"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-image:before{content:"\f03e"}.fa-infinity:before{content:"\f534"}.fa-info-circle:before{content:"\f05a"}.fa-italic:before{content:"\f033"}.fa-knife-kitchen:before{content:"\f6f5"}.fa-laugh-squint:before{content:"\f59b"}.fa-lights-holiday:before{content:"\f7b2"}.fa-link:before{content:"\f0c1"}.fa-lock:before{content:"\f023"}.fa-lock-alt:before{content:"\f30d"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-microphone-stand:before{content:"\f8cb"}.fa-mistletoe:before{content:"\f7b4"}.fa-music:before{content:"\f001"}.fa-palette:before{content:"\f53f"}.fa-pencil:before{content:"\f040"}.fa-pizza-slice:before{content:"\f818"}.fa-poop:before{content:"\f619"}.fa-quote-right:before{content:"\f10e"}.fa-random:before{content:"\f074"}.fa-reply:before{content:"\f3e5"}.fa-robot:before{content:"\f544"}.fa-save:before{content:"\f0c7"}.fa-scroll-old:before{content:"\f70f"}.fa-search:before{content:"\f002"}.fa-seedling:before{content:"\f4d8"}.fa-sign-out:before{content:"\f08b"}.fa-smile-beam:before{content:"\f5b8"}.fa-smoke:before{content:"\f760"}.fa-snooze:before{content:"\f880"}.fa-snowflake:before{content:"\f2dc"}.fa-sparkles:before{content:"\f890"}.fa-spider:before{content:"\f717"}.fa-square:before{content:"\f0c8"}.fa-store:before{content:"\f54e"}.fa-thumbtack:before{content:"\f08d";padding:2px;}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-train:before{content:"\f238"}.fa-trash-alt:before{content:"\f2ed"}.fa-treasure-chest:before{content:"\f723"}.fa-trophy:before{content:"\f091"}.fa-twitter:before{content:"\f099"}.fa-user:before{content:"\f007"}.fa-user-circle:before{content:"\f2bd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-friends:before{content:"\f500"}.fa-user-lock:before{content:"\f502"}.fa-user-minus:before{content:"\f503"}.fa-user-plus:before{content:"\f234"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-times:before{content:"\f235"}.fa-volume:before{content:"\f6a8"}.fa-volume-mute:before{content:"\f6a9"}@font-face{font-family:'font awesome 5 brands';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/fa-brands-400.eot);src:url(../fonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-brands-400.woff2) format("woff2"),url(../fonts/fa-brands-400.woff) format("woff"),url(../fonts/fa-brands-400.ttf) format("truetype"),url(../fonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:'font awesome 5 brands'!important}@font-face{font-family:'font awesome 5 duotone';font-style:normal;font-weight:900;font-display:swap;src:url(../fonts/fa-duotone-900.eot);src:url(../fonts/fa-duotone-900.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-duotone-900.woff2) format("woff2"),url(../fonts/fa-duotone-900.woff) format("woff"),url(../fonts/fa-duotone-900.ttf) format("truetype"),url(../fonts/fa-duotone-900.svg#fontawesome) format("svg")}.fad{position:relative;font-family:'font awesome 5 duotone'!important;font-weight:900}.fad:before{position:absolute;color:var(--fa-primary-color,inherit);opacity:1;opacity:var(--fa-primary-opacity,1)}.fad:after{color:var(--fa-secondary-color,inherit);opacity:.4;opacity:var(--fa-secondary-opacity,0.4)}.fad.fa-stack-1x,.fad.fa-stack-2x{position:absolute}.fad.fa-stack-1x:before,.fad.fa-stack-2x:before,.fad.fa-fw:before{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.fad.fa-align-left:after{content:"\10f036"}.fad.fa-arrow-alt-circle-down:after{content:"\10f358"}.fad.fa-arrow-alt-circle-up:after{content:"\10f35b"}.fad.fa-arrow-alt-down:after{content:"\10f354"}.fad.fa-arrow-alt-up:after{content:"\10f357"}.fad.fa-arrow-right:after{content:"\10f061"}.fad.fa-arrows-v:after{content:"\10f07d"}.fad.fa-badge-check:after{content:"\10f336"}.fad.fa-balance-scale:after{content:"\10f24e"}.fad.fa-ban:after{content:"\10f05e"}.fad.fa-bars:after{content:"\10f0c9"}.fad.fa-bell:after{content:"\10f0f3"}.fad.fa-bold:after{content:"\10f032"}.fad.fa-book:after{content:"\10f02d"}.fad.fa-book-dead:after{content:"\10f6b7"}.fad.fa-book-open:after{content:"\10f518"}.fad.fa-broom:after{content:"\10f51a"}.fad.fa-bug:after{content:"\10f188"}.fad.fa-bullhorn:after{content:"\10f0a1"}.fad.fa-calendar:after{content:"\10f133"}.fad.fa-calendar-alt:after{content:"\10f073"}.fad.fa-calendar-day:after{content:"\10f783"}.fad.fa-calendar-week:after{content:"\10f784"}.fad.fa-candy-cane:after{content:"\10f786"}.fad.fa-cat:after{content:"\10f6be"}.fad.fa-check:after{content:"\10f00c"}.fad.fa-check-circle:after{content:"\10f058"}.fad.fa-circle:after{content:"\10f111"}.fad.fa-clipboard:after{content:"\10f328"}.fad.fa-clipboard-check:after{content:"\10f46c"}.fad.fa-clock:after{content:"\10f017"}.fad.fa-code:after{content:"\10f121"}.fad.fa-cog:after{content:"\10f013"}.fad.fa-comment:after{content:"\10f075"}.fad.fa-comment-alt-smile:after{content:"\10f4aa"}.fad.fa-comment-dots:after{content:"\10f4ad"}.fad.fa-comments:after{content:"\10f086"}.fad.fa-compress-alt:after{content:"\10f422"}.fad.fa-copy:after{content:"\10f0c5"}.fad.fa-crown:after{content:"\10f521"}.fad.fa-dna:after{content:"\10f471"}.fad.fa-dollar-sign:after{content:"\10f155"}.fad.fa-edit:after{content:"\10f044"}.fad.fa-ellipsis-h:after{content:"\10f141"}.fad.fa-envelope:after{content:"\10f0e0"}.fad.fa-envelope-open-text:after{content:"\10f658"}.fad.fa-exclamation-circle:after{content:"\10f06a"}.fad.fa-exclamation-triangle:after{content:"\10f071"}.fad.fa-expand-alt:after{content:"\10f424"}.fad.fa-external-link-alt:after{content:"\10f35d"}.fad.fa-eye:after{content:"\10f06e"}.fad.fa-eye-evil:after{content:"\10f6db"}.fad.fa-eye-slash:after{content:"\10f070"}.fad.fa-feather-alt:after{content:"\10f56b"}.fad.fa-file-signature:after{content:"\10f573"}.fad.fa-filter:after{content:"\10f0b0"}.fad.fa-fire:after{content:"\10f06d"}.fad.fa-flag:after{content:"\10f024"}.fad.fa-frown:after{content:"\10f119"}.fad.fa-gavel:after{content:"\10f0e3"}.fad.fa-ghost:after{content:"\10f6e2"}.fad.fa-gift:after{content:"\10f06b"}.fad.fa-globe:after{content:"\10f0ac"}.fad.fa-grin-beam-sweat:after{content:"\10f583"}.fad.fa-home-alt:after{content:"\10f80a"}.fad.fa-id-badge:after{content:"\10f2c1"}.fad.fa-id-card:after{content:"\10f2c2"}.fad.fa-image:after{content:"\10f03e"}.fad.fa-infinity:after{content:"\10f534"}.fad.fa-info-circle:after{content:"\10f05a"}.fad.fa-italic:after{content:"\10f033"}.fad.fa-knife-kitchen:after{content:"\10f6f5"}.fad.fa-laugh-squint:after{content:"\10f59b"}.fad.fa-lights-holiday:after{content:"\10f7b2"}.fad.fa-link:after{content:"\10f0c1"}.fad.fa-lock:after{content:"\10f023"}.fad.fa-lock-alt:after{content:"\10f30d"}.fad.fa-long-arrow-left:after{content:"\10f177"}.fad.fa-long-arrow-right:after{content:"\10f178"}.fad.fa-microphone-stand:after{content:"\10f8cb"}.fad.fa-mistletoe:after{content:"\10f7b4"}.fad.fa-music:after{content:"\10f001"}.fad.fa-palette:after{content:"\10f53f"}.fad.fa-pencil:after{content:"\10f040"}.fad.fa-pizza-slice:after{content:"\10f818"}.fad.fa-poop:after{content:"\10f619"}.fad.fa-quote-right:after{content:"\10f10e"}.fad.fa-random:after{content:"\10f074"}.fad.fa-reply:after{content:"\10f3e5"}.fad.fa-robot:after{content:"\10f544"}.fad.fa-save:after{content:"\10f0c7"}.fad.fa-scroll-old:after{content:"\10f70f"}.fad.fa-search:after{content:"\10f002"}.fad.fa-seedling:after{content:"\10f4d8"}.fad.fa-sign-out:after{content:"\10f08b"}.fad.fa-smile-beam:after{content:"\10f5b8"}.fad.fa-smoke:after{content:"\10f760"}.fad.fa-snooze:after{content:"\10f880"}.fad.fa-snowflake:after{content:"\10f2dc"}.fad.fa-sparkles:after{content:"\10f890"}.fad.fa-spider:after{content:"\10f717"}.fad.fa-square:after{content:"\10f0c8"}.fad.fa-store:after{content:"\10f54e"}.fad.fa-thumbtack:after{content:"\10f08d"}.fad.fa-times:after{content:"\10f00d"}.fad.fa-times-circle:after{content:"\10f057"}.fad.fa-train:after{content:"\10f238"}.fad.fa-trash-alt:after{content:"\10f2ed"}.fad.fa-treasure-chest:after{content:"\10f723"}.fad.fa-trophy:after{content:"\10f091"}.fad.fa-user:after{content:"\10f007"}.fad.fa-user-circle:after{content:"\10f2bd"}.fad.fa-user-cog:after{content:"\10f4fe"}.fad.fa-user-friends:after{content:"\10f500"}.fad.fa-user-lock:after{content:"\10f502"}.fad.fa-user-minus:after{content:"\10f503"}.fad.fa-user-plus:after{content:"\10f234"}.fad.fa-user-slash:after{content:"\10f506"}.fad.fa-user-tag:after{content:"\10f507"}.fad.fa-user-times:after{content:"\10f235"}.fad.fa-volume:after{content:"\10f6a8"}.fad.fa-volume-mute:after{content:"\10f6a9"}@font-face{font-family:'font awesome 5 pro';font-style:normal;font-weight:300;font-display:swap;src:url(../fonts/fa-light-300.eot);src:url(../fonts/fa-light-300.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-light-300.woff2) format("woff2"),url(../fonts/fa-light-300.woff) format("woff"),url(../fonts/fa-light-300.ttf) format("truetype"),url(../fonts/fa-light-300.svg#fontawesome) format("svg")}.fal{font-family:'font awesome 5 pro'!important;;font-weight:300}@font-face{font-family:'font awesome 5 pro';font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/fa-regular-400.eot);src:url(../fonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-regular-400.woff2) format("woff2"),url(../fonts/fa-regular-400.woff) format("woff"),url(../fonts/fa-regular-400.ttf) format("truetype"),url(../fonts/fa-regular-400.svg#fontawesome) format("svg")}.far{font-family:'font awesome 5 pro'!important;;font-weight:400}@font-face{font-family:'font awesome 5 pro';font-style:normal;font-weight:900;font-display:swap;src:url(../fonts/fa-solid-900.eot);src:url(../fonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../fonts/fa-solid-900.woff2) format("woff2"),url(../fonts/fa-solid-900.woff) format("woff"),url(../fonts/fa-solid-900.ttf) format("truetype"),url(../fonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.fas{font-family:'font awesome 5 pro'!important;font-weight:900} -.fa-fish:before{content:"\f578"}.fa-gingerbread-man:before{content:"\f79d"}.fa-fireplace:before{content:"\f79a"}.fa-angry:before{content:"\f556"}.fad.fa-gingerbread-man:after{content:"\10f79d"}.fad.fa-fireplace:after{content:"\10f79a"}.fad.fa-angry:after{content:"\10f556"}.fa-stocking:before{content:"\f7d5"}.fad.fa-stocking:after{content:"\10f7d5"}.fa-columns:before{content:"\f0db"}.fad.fa-columns:after{content:"\10f0db"}.fa-shield:before{content:"\f132"}.fad.fa-shield:after{content:"\10f132"}.fa-dice-six:before{content:"\f526"}.fad.fa-dice-six:after{content:"\10f526"}.fa-badge:before{content:"\f335"}.fad.fa-badge:after{content:"\10f335"}.fa-users:before{content:"\f0c0"}.fad.fa-users:after{content:"\10f0c0"}.fa-user-crown:before{content:"\f6a4"}.fad.fa-user-crown:after{content:"\10f6a4"}.fa-radiation-alt:before{content:"\f7ba"}.fad.fa-radiation-alt:after{content:"\10f7ba"}.fa-golf-club:before{content:"\f451"}.fad.fa-golf-club:after{content:"\10f451"}.fa-memory:before{content:"\f538"}.fad.fa-memory:after{content:"\10f538"}.fa-award:before{content:"\f559"}.fad.fa-award:after{content:"\10f559"}.fa-sack-dollar:before{content:"\f81d"}.fad.fa-sack-dollar:after{content:"\10f81d"}.fa-history:before{content:"\f1da"}.fad.fa-history:after{content:"\10f1da"} +.fa-fish:before{content:"\f578"}.fa-gingerbread-man:before{content:"\f79d"}.fa-fireplace:before{content:"\f79a"}.fa-angry:before{content:"\f556"}.fad.fa-gingerbread-man:after{content:"\10f79d"}.fad.fa-fireplace:after{content:"\10f79a"}.fad.fa-angry:after{content:"\10f556"}.fa-stocking:before{content:"\f7d5"}.fad.fa-stocking:after{content:"\10f7d5"}.fa-columns:before{content:"\f0db"}.fad.fa-columns:after{content:"\10f0db"}.fa-shield:before{content:"\f132"}.fad.fa-shield:after{content:"\10f132"}.fa-dice-six:before{content:"\f526"}.fad.fa-dice-six:after{content:"\10f526"}.fa-badge:before{content:"\f335"}.fad.fa-badge:after{content:"\10f335"}.fa-users:before{content:"\f0c0"}.fad.fa-users:after{content:"\10f0c0"}.fa-user-crown:before{content:"\f6a4"}.fad.fa-user-crown:after{content:"\10f6a4"}.fa-radiation-alt:before{content:"\f7ba"}.fad.fa-radiation-alt:after{content:"\10f7ba"}.fa-golf-club:before{content:"\f451"}.fad.fa-golf-club:after{content:"\10f451"}.fa-memory:before{content:"\f538"}.fad.fa-memory:after{content:"\10f538"}.fa-award:before{content:"\f559"}.fad.fa-award:after{content:"\10f559"}.fa-sack-dollar:before{content:"\f81d"}.fad.fa-sack-dollar:after{content:"\10f81d"}.fa-history:before{content:"\f1da"}.fad.fa-history:after{content:"\10f1da"}.fa-flag-usa:before{content:"\f74d"}.fad.fa-flag-usa:after{content:"\10f74d"}.fa-car-tilt:before{content:"\f5e5"}.fad.fa-car-tilt:after{content:"\10f5e5"} lite-youtube { background-color: #000; diff --git a/files/assets/images/emojis/marseyscooter.webp b/files/assets/images/emojis/marseyscooter.webp new file mode 100644 index 000000000..3209ebfbc Binary files /dev/null and b/files/assets/images/emojis/marseyscooter.webp differ diff --git a/files/assets/js/emoji_modal.js b/files/assets/js/emoji_modal.js index 2ad608707..768be6a87 100644 --- a/files/assets/js/emoji_modal.js +++ b/files/assets/js/emoji_modal.js @@ -14,6 +14,8 @@ function loadEmojis(form) { xhr.onload = function() { emojis = { 'marsey': JSON.parse(xhr.response), + + 'marseyalphabet': ['marseyalphaa','marseyalphab','marseyalphac','marseyalphad','marseyalphae','marseyalphaf','marseyalphag','marseyalphah','marseyalphai','marseyalphaj','marseyalphak','marseyalphal','marseyalpham','marseyalphan','marseyalphao','marseyalphap','marseyalphaq','marseyalphar','marseyalphas','marseyalphat','marseyalphau','marseyalphav','marseyalphaw','marseyalphax','marseyalphay','marseyalphaz','marseyalphanumeric0','marseyalphanumeric1','marseyalphanumeric2','marseyalphanumeric3','marseyalphanumeric4','marseyalphanumeric5','marseyalphanumeric6','marseyalphanumeric7','marseyalphanumeric8','marseyalphanumeric9','marseyalphazexclamationpoint','marseyalphazperiod','marseyalphazquestionmark'], 'platy': ['platytrans','platyfuckyou','plarsy','platyabused','platyblizzard','platyboxer','platydevil','platyfear','platygirlmagic','platygolong','platyhaes','platyking','platylove','platyneet','platyold','platypatience','platypopcorn','platyrich','platysarcasm','platysilly','platysleeping','platythink','platytired','platytuxedomask','platyblush','platybruh','platycaveman','platycheer','platydown','platyeyes','platyheart','platylol','platymicdrop','platynooo','platysalute','platyseethe','platythumbsup','platywave'], diff --git a/files/assets/js/marked.js b/files/assets/js/marked.js index 21ad69f15..81287eef6 100644 --- a/files/assets/js/marked.js +++ b/files/assets/js/marked.js @@ -8,6 +8,7 @@ function markdown(first, second) { if(emojis != null){ for(i = 0; i < emojis.length; i++){ var emoji = emojis[i][0] + if (emoji.includes('marseyrandom')) continue var remoji = emoji.replace(/:/g,''); if (remoji.startsWith("!#") || remoji.startsWith("#!")) { diff --git a/files/assets/js/userpage_v.js b/files/assets/js/userpage_v.js index f758f32ab..1914cd766 100644 --- a/files/assets/js/userpage_v.js +++ b/files/assets/js/userpage_v.js @@ -81,8 +81,11 @@ function updateBux(mobile=false) { } function transferCoins(mobile=false) { - let t = event.target; - t.disabled = true; + for(let el of document.getElementsByClassName('profile-toggleable')) { + el.classList.add('d-none'); + } + + this.disabled = true; let amount = parseInt(document.getElementById("coin-transfer-amount").value); let transferred = amount - Math.ceil(amount*TRANSFER_TAX); @@ -99,12 +102,15 @@ function transferCoins(mobile=false) { } ); - setTimeout(_ => t.disabled = false, 2000); + setTimeout(_ => this.disabled = false, 2000); } function transferBux(mobile=false) { - let t = event.target; - t.disabled = true; + for(let el of document.getElementsByClassName('profile-toggleable')) { + el.classList.add('d-none'); + } + + this.disabled = true; let amount = parseInt(document.getElementById("bux-transfer-amount").value); let username = document.getElementById('username').innerHTML @@ -120,7 +126,7 @@ function transferBux(mobile=false) { } ); - setTimeout(_ => t.disabled = false, 2000); + setTimeout(_ => this.disabled = false, 2000); } function submitFormAjax(e) { diff --git a/files/assets/ruqqus_v1.7.apk b/files/assets/ruqqus_v1.7.apk new file mode 100644 index 000000000..09a31ea1c Binary files /dev/null and b/files/assets/ruqqus_v1.7.apk differ diff --git a/files/classes/comment.py b/files/classes/comment.py index ac4dd90a4..64b2235b2 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -242,12 +242,7 @@ class Comment(Base): @property @lazy def permalink(self): - if self.post and self.post.club: - if self.post.sub: f"{SITE_FULL}/s/{self.post.sub}/comment/{self.id}?context=8#context" - else: f"{SITE_FULL}/comment/{self.id}?context=8#context" - - if self.post: return f"{self.post.permalink}/{self.id}?context=8#context" - else: return f"{SITE_FULL}/comment/{self.id}?context=8#context" + return f"{SITE_FULL}/comment/{self.id}?context=8#context" @property @lazy diff --git a/files/classes/mod.py b/files/classes/mod.py index 1d5aafcdd..3b1f2d7aa 100644 --- a/files/classes/mod.py +++ b/files/classes/mod.py @@ -1,12 +1,20 @@ from sqlalchemy import * from sqlalchemy.orm import relationship from files.__main__ import Base +from files.helpers.lazy import * +from time import strftime, gmtime class Mod(Base): __tablename__ = "mods" user_id = Column(Integer, ForeignKey("users.id"), primary_key=True) sub = Column(String, ForeignKey("subs.name"), primary_key=True) + created_utc = Column(Integer) def __repr__(self): - return f"" \ No newline at end of file + return f"" + + @property + @lazy + def created_datetime(self): + return str(strftime("%d/%B/%Y %H:%M:%S UTC", gmtime(self.created_utc))) \ No newline at end of file diff --git a/files/classes/sub.py b/files/classes/sub.py index c7b9f92ce..852decaa3 100644 --- a/files/classes/sub.py +++ b/files/classes/sub.py @@ -2,9 +2,11 @@ from sqlalchemy import * from files.__main__ import Base from files.helpers.lazy import lazy from os import environ -from files.helpers.const import * SITE_NAME = environ.get("SITE_NAME", '').strip() +SITE = environ.get("DOMAIN", '').strip() +if SITE == "localhost": SITE_FULL = 'http://' + SITE +else: SITE_FULL = 'https://' + SITE class Sub(Base): @@ -14,6 +16,7 @@ class Sub(Base): sidebar_html = Column(String) sidebarurl = Column(String) bannerurl = Column(String) + css = Column(String) def __repr__(self): return f"" diff --git a/files/classes/user.py b/files/classes/user.py index 8acc2eda4..3c88a2557 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -153,7 +153,14 @@ class User(Base): @lazy def mods(self, sub): - return self.admin_level > 1 or g.db.query(Mod.user_id).filter_by(user_id=self.id, sub=sub).one_or_none() + return self.id == AEVANN_ID or g.db.query(Mod.user_id).filter_by(user_id=self.id, sub=sub).one_or_none() + + @lazy + def mod_date(self, sub): + if self.id == AEVANN_ID: return 1 + mod = g.db.query(Mod).filter_by(user_id=self.id, sub=sub).one_or_none() + if not mod: return None + return mod.created_utc @property @lazy diff --git a/files/helpers/const.py b/files/helpers/const.py index 580c5192b..fc9581d1e 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -362,6 +362,14 @@ AWARDS = { "color": "text-pink", "price": 300 }, + "scooter": { + "kind": "scooter", + "title": "Scooter", + "description": "Summons a scooter on the post.", + "icon": "fas fa-flag-usa", + "color": "text-muted", + "price": 300 + }, "wholesome": { "kind": "wholesome", "title": "Wholesome", @@ -369,6 +377,14 @@ AWARDS = { "icon": "fas fa-smile-beam", "color": "text-yellow", "price": 300 + }, + "tilt": { + "kind": "tilt", + "title": "Tilt", + "description": "Tilts the post by 1 degree (up to 4)", + "icon": "fas fa-car-tilt", + "color": "text-blue", + "price": 300 }, "ghosts": { "kind": "ghosts", diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index a91ab44f8..629dab803 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -7,7 +7,11 @@ from os import path, environ import re from mistletoe import markdown from json import loads, dump -from random import random +from random import random, choice + +db = db_session() +marseys = tuple(x[0] for x in db.query(Marsey.name).all()) +db.close() allowed_tags = tags = ['b', 'blockquote', @@ -203,7 +207,9 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): classes = 'emoji-md' remoji = emoji - if not edit and random() < 0.005 and 'marsey' in emoji: classes += ' golden' + if not edit and random() < 0.005 and ('marsey' in emoji or emoji in marseys): classes += ' golden' + + if remoji == 'marseyrandom': remoji = choice(marseys) if path.isfile(f'files/assets/images/emojis/{remoji}.webp'): new = re.sub(f'(?', new, re.I) @@ -218,14 +224,20 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): if emoji.startswith("!"): emoji = emoji[1:] classes = 'emoji mirrored' - if not edit and random() < 0.005 and 'marsey' in emoji: classes += ' golden' + if not edit and random() < 0.005 and ('marsey' in emoji or emoji in marseys): classes += ' golden' + + if emoji == 'marseyrandom': emoji = random.choice(marseys) + if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): sanitized = re.sub(f'(?', sanitized, re.I) if comment: marseys_used.add(emoji) elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'): classes = 'emoji' - if not edit and random() < 0.005 and 'marsey' in emoji: classes += ' golden' + if not edit and random() < 0.005 and ('marsey' in emoji or emoji in marseys): classes += ' golden' + + if emoji == 'marseyrandom': emoji = random.choice(marseys) + sanitized = re.sub(f'(?', sanitized, re.I) if comment: marseys_used.add(emoji) @@ -284,13 +296,19 @@ def filter_emojis_only(title, edit=False): if emoji.startswith("!"): emoji = emoji[1:] classes = 'emoji mirrored' - if not edit and random() < 0.005 and 'marsey' in emoji: classes += ' golden' + if not edit and random() < 0.005 and ('marsey' in emoji or emoji in marseys): classes += ' golden' + + if emoji == 'marseyrandom': emoji = random.choice(marseys) + if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): title = re.sub(f'(?', title, re.I) elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'): classes = 'emoji' - if not edit and random() < 0.005 and 'marsey' in emoji: classes += ' golden' + if not edit and random() < 0.005 and ('marsey' in emoji or emoji in marseys): classes += ' golden' + + if emoji == 'marseyrandom': emoji = random.choice(marseys) + title = re.sub(f'(?', title, re.I) if len(title) > 1500: abort(400) diff --git a/files/routes/awards.py b/files/routes/awards.py index 7464633f4..a0d9957a8 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -42,6 +42,14 @@ AWARDS3 = { "color": "text-pink", "price": 300 }, + "scooter": { + "kind": "scooter", + "title": "Scooter", + "description": "Summons a scooter on the post.", + "icon": "fas fa-flag-usa", + "color": "text-muted", + "price": 300 + }, "wholesome": { "kind": "wholesome", "title": "Wholesome", @@ -50,6 +58,14 @@ AWARDS3 = { "color": "text-yellow", "price": 300 }, + "tilt": { + "kind": "tilt", + "title": "Tilt", + "description": "Tilts the post by 1 degree (up to 4)", + "icon": "fas fa-car-tilt", + "color": "text-blue", + "price": 300 + }, } @app.get("/shop") diff --git a/files/routes/comments.py b/files/routes/comments.py index 8c9939e26..09bcce398 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -956,6 +956,49 @@ def unpin_comment(cid, v): g.db.commit() return {"message": "Comment unpinned!"} + +@app.post("/mod_pin/") +@auth_required +def mod_pin(cid, v): + + comment = get_comment(cid, v=v) + + if not comment: abort(404) + + if not (comment.post.sub and v.mods(comment.post.sub)): abort(403) + + comment.is_pinned = v.username + " (Mod)" + + g.db.add(comment) + + if v.id != comment.author_id: + message = f"@{v.username} (Mod) has pinned your [comment]({comment.permalink})!" + send_repeatable_notification(comment.author_id, message) + + g.db.commit() + return {"message": "Comment pinned!"} + + +@app.post("/mod_unpin/") +@auth_required +def mod_unpin(cid, v): + + comment = get_comment(cid, v=v) + + if not comment: abort(404) + + if not (comment.post.sub and v.mods(comment.post.sub)): abort(403) + + comment.is_pinned = None + g.db.add(comment) + + if v.id != comment.author_id: + message = f"@{v.username} (Mod) has unpinned your [comment]({comment.permalink})!" + send_repeatable_notification(comment.author_id, message) + g.db.commit() + return {"message": "Comment unpinned!"} + + @app.post("/save_comment/") @limiter.limit("1/second;30/minute;200/hour;1000/day") @auth_required diff --git a/files/routes/subs.py b/files/routes/subs.py index b198099b7..947e507c4 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -9,18 +9,18 @@ valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$") @app.get("/s//mods") @is_not_permabanned def mods(v, sub): - sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none() + sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() if not sub: abort(404) - mods = [x[0] for x in g.db.query(Mod.user_id).filter_by(sub=sub.name).all()] - users = g.db.query(User).filter(User.id.in_(mods)).all() + users = g.db.query(User, Mod).join(Mod, Mod.user_id==User.id).filter_by(sub=sub.name).order_by(Mod.created_utc).all() + return render_template("sub/mods.html", v=v, sub=sub, users=users) @app.post("/s//add_mod") @is_not_permabanned def add_mod(v, sub): - sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none() + sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() if not sub: abort(404) sub = sub.name @@ -32,10 +32,41 @@ def add_mod(v, sub): user = get_user(user) - mod = Mod(user_id=user.id, sub=sub) - g.db.add(mod) + existing = g.db.query(Mod).filter_by(user_id=user.id, sub=sub).one_or_none() - send_repeatable_notification(user.id, f"You have been added as a mod to /s/{sub}") + if not existing: + mod = Mod(user_id=user.id, sub=sub, created_utc=int(time.time())) + g.db.add(mod) + + send_repeatable_notification(user.id, f"You have been added as a mod to /s/{sub}") + + g.db.commit() + + return redirect(f'/s/{sub}/mods') + + +@app.post("/s//remove_mod") +@is_not_permabanned +def remove_mod(v, sub): + sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() + if not sub: abort(404) + sub = sub.name + + if not v.mods(sub): abort(403) + + uid = request.values.get('uid') + + if not uid: abort(400) + + try: uid = int(uid) + except: abort(400) + + mod = g.db.query(Mod).filter_by(user_id=uid, sub=sub).one_or_none() + if not mod: abort(400) + + g.db.delete(mod) + + send_repeatable_notification(uid, f"You have been removed as a mod from /s/{sub}") g.db.commit() @@ -70,7 +101,7 @@ def create_sub2(v): sub = Sub(name=name) g.db.add(sub) - mod = Mod(user_id=v.id, sub=sub.name) + mod = Mod(user_id=v.id, sub=sub.name, created_utc=int(time.time())) g.db.add(mod) g.db.commit() @@ -111,26 +142,47 @@ def sub_settings(v, sub): @limiter.limit("1/second;30/minute;200/hour;1000/day") @is_not_permabanned def post_sub_sidebar(v, sub): - sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none() + sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() if not sub: abort(404) if not v.mods(sub.name): abort(403) - sub.sidebar = request.values.get('sidebar', '').strip() + sub.sidebar = request.values.get('sidebar', '').strip()[:500] sub.sidebar_html = sanitize(sub.sidebar) - g.db.add(sub) + if len(sub.sidebar_html) > 1000: return "Sidebar is too big!" - ma = ModAction( - kind="change_sidebar", - user_id=v.id - ) - g.db.add(ma) + g.db.add(sub) g.db.commit() return redirect(f'/s/{sub.name}/settings') +@app.post('/s//css') +@limiter.limit("1/second;30/minute;200/hour;1000/day") +@is_not_permabanned +def post_sub_css(v, sub): + sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() + if not sub: abort(404) + + if not v.mods(sub.name): abort(403) + + sub.css = request.values.get('css', '').strip() + g.db.add(sub) + + g.db.commit() + + return redirect(f'/s/{sub.name}/settings') + + +@app.get("/s//css") +def get_sub_css(sub): + sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() + if not sub: abort(404) + resp=make_response(sub.css or "") + resp.headers.add("Content-Type", "text/css") + return resp + @app.post("/s//banner") @limiter.limit("1/second;30/minute;200/hour;1000/day") @is_not_permabanned diff --git a/files/routes/users.py b/files/routes/users.py index c60d1d0f9..1d8faf1ec 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -392,9 +392,7 @@ def leaderboard(v): @app.get("/@/css") def get_css(username): user = get_user(username) - if user.css: css = user.css - else: css = "" - resp=make_response(css) + resp=make_response(user.css or "") resp.headers.add("Content-Type", "text/css") return resp diff --git a/files/templates/admin/sidebar.html b/files/templates/admin/sidebar.html index a0f29c8a7..ab5d6e1c4 100644 --- a/files/templates/admin/sidebar.html +++ b/files/templates/admin/sidebar.html @@ -25,7 +25,7 @@
-
+ diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 78b6e21c1..08326aff7 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} {% if v %} - + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 31d9002d1..8abd47785 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} + {% if sub and sub.css and not request.path.endswith('settings') %} + + {% endif %} + @@ -217,9 +221,7 @@ {% if v %} {% if sub %} - - /s/{[sub.name]} banner - + /s/{{sub.name}} banner {% elif SITE_NAME == 'Drama' %} {% set path = "assets/images/" + SITE_NAME + "/banners_bhm" %} {% set image = "/static/" + path + "/" + listdir('files/' + path)|random() + '?a=21' %} diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 3635da6dd..dbea2f1a2 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -18,6 +18,9 @@ + @@ -69,6 +72,9 @@
+
+
+
@@ -100,7 +106,7 @@
- + - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 158f0bb23..1f54c9ee1 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 99d8b2820..43933efb9 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/notifications.html b/files/templates/notifications.html index 3bfc65f7d..e86535253 100644 --- a/files/templates/notifications.html +++ b/files/templates/notifications.html @@ -30,7 +30,7 @@ Messages - {% if v.admin_level > 2 %} + {% if v.admin_level > 1 %}
+ + +

Banner

@@ -84,6 +86,8 @@
+ +
@@ -93,9 +97,34 @@
-
+ - + + +
+ +
+
+
+
+
+
+ + + + +
+
+
+
+

Edit CSS

+
+
+
+
+
+ +
diff --git a/files/templates/submission.html b/files/templates/submission.html index 84c8666b5..064cc4972 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -153,23 +153,13 @@ {% endif %} {% endif %} -{% if p.award_count("train") %} +{% if p.award_count("train") or p.award_count("scooter") %} +{% endif %} + +{% if p.award_count("train") %} + :#marseytrain: @@ -208,6 +213,54 @@ {% endif %} + +{% if p.award_count("scooter") %} + + + :#marseyscooter: + +{% endif %} + +{% if p.award_count("scooter") > 1 %} + + :#marseyscooter: + +{% endif %} + +{% if p.award_count("scooter") > 2 %} + + :#marseyscooter: + +{% endif %} + +{% if p.award_count("scooter") > 3 %} + + :#marseyscooter: + +{% endif %} + + + +{% if p.award_count("tilt") %} + +{% endif %} + + diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 541848e90..5959db266 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -129,7 +129,7 @@ post thumnail {% elif p.is_image %} - post thumnail + sidebar image {% elif p.is_video %} post thumnail diff --git a/files/templates/submit.html b/files/templates/submit.html index be3e22a20..63c7f225f 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %} @@ -257,7 +257,7 @@ checkForRequired() - + {% include "emoji_modal.html" %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index d45d16d63..0147f2cd4 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -704,7 +704,7 @@ {% if v %}
{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}
- +
{{u.username}}
{% endif %} @@ -734,7 +734,7 @@ {% endif %} - +