From e7e4ef4b60b8ea0dbe4ddf6da8f21a09718c470e Mon Sep 17 00:00:00 2001 From: randomguy Date: Sat, 9 Jan 2021 21:14:19 +0530 Subject: [PATCH 1/7] delete config.js --- config.js.template | 47 ---------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 config.js.template diff --git a/config.js.template b/config.js.template deleted file mode 100644 index be8cac8..0000000 --- a/config.js.template +++ /dev/null @@ -1,47 +0,0 @@ -const config = { - domain: process.env.DOMAIN || '127.0.0.1', // Or for example 'teddit.net' - use_reddit_oauth: process.env.USE_REDDIT_OAUTH === 'true' || false, // If false, teddit uses Reddit's public API. If true, you need to have your own Reddit app ID (enter the app ID to the "reddit_app_id" config key). - cert_dir: process.env.CERT_DIR || '', // For example '/home/teddit/letsencrypt/live/teddit.net', if you are using https. No trailing slash. - theme: process.env.THEME || 'dark', // One of: 'dark', '' - flairs_enabled: process.env.FLAIRS_ENABLED !== 'true' || true, // Enables the rendering of user and link flairs on teddit - highlight_controversial: process.env.HIGHLIGHT_CONTROVERSIAL !== 'true' || true, // Enables controversial comments to be indicated by a typographical dagger (†) - api_enabled: process.env.API_ENABLED !== 'true' || true, // Teddit API feature. Might increase loads significantly on your instance. - video_enabled: process.env.VIDEO_ENABLED !== 'true' || true, - redis_enabled: process.env.REDIS_ENABLED !== 'true' || true, // If disabled, does not cache Reddit API calls - redis_host: process.env.REDIS_HOST || '127.0.0.1', - redis_port: process.env.REDIS_PORT || 6379, - ssl_port: process.env.SSL_PORT || 8088, - nonssl_port: process.env.NONSSL_PORT || 8080, - listen_address: process.env.LISTEN_ADDRESS || '0.0.0.0', - https_enabled: process.env.HTTPS_ENABLED === 'true' || false, - redirect_http_to_https: process.env.REDIRECT_HTTP_TO_HTTPS === 'true' || false, - redirect_www: process.env.REDIRECT_WWW === 'true' || false, - use_compression: process.env.USE_COMPRESSION !== 'true' || true, - use_view_cache: process.env.USE_VIEW_CACHE === 'true' || false, - use_helmet: process.env.USE_HELMET === 'true' || false, // Recommended to be true when using https - use_helmet_hsts: process.env.USE_HELMET_HSTS === 'true' || false, // Recommended to be true when using https - trust_proxy: process.env.TRUST_PROXY === 'true' || false, // Enable trust_proxy if you are using reverse proxy like nginx - trust_proxy_address: process.env.TRUST_PROXY_ADDRESS || '127.0.0.1', - nsfw_enabled: process.env.NSFW_ENABLED !== 'true' || true, // Enable NSFW (over 18) content. If false, a warning is shown to the user before opening any NSFW post. When the NFSW content is disabled, NSFW posts are hidden from subreddits and from user page feeds. Note: Users can set this to true or false from their preferences. - post_comments_sort: process.env.POST_COMMENTS_SORT || 'confidence', // "confidence" is the default sorting in Reddit. Must be one of: confidence, top, new, controversial, old, random, qa, live. - reddit_app_id: process.env.REDDIT_APP_ID || 'ABfYqdDc9qPh1w', // If "use_reddit_oauth" config key is set to true, you have to obtain your Reddit app ID. For testing purposes it's okay to use this project's default app ID. Create your Reddit app here: https://old.reddit.com/prefs/apps/. Make sure to create an "installed app" type of app. - setexs: { - /**, - * Redis cache expiration values (in seconds). - * When the cache expires, new content is fetched from Reddit's API (when - * the given URL is revisited). - */ - frontpage: 600, - subreddit: 600, - posts: 600, - user: 600, - searches: 600, - sidebar: 60 * 60 * 24 * 7, // 7 days - shorts: 60 * 60 * 24 * 31, - wikis: 60* 60 * 24 * 7 - }, - valid_media_domains: ['preview.redd.it', 'external-preview.redd.it', 'i.redd.it', 'v.redd.it', 'a.thumbs.redditmedia.com', 'b.thumbs.redditmedia.com', 'emoji.redditmedia.com', 'thumbs.gfycat.com', 'i.ytimg.com'], - reddit_api_error_text: `Seems like your instance is either blocked (e.g. due to API rate limiting), reddit is currently down, or your API key is expired and not renewd properly. This can also happen for other reasons.` -}; - -module.exports = config; From 3177ea11730ad640ea60317f731adcd617856e90 Mon Sep 17 00:00:00 2001 From: randomguy Date: Sun, 10 Jan 2021 14:09:40 +0530 Subject: [PATCH 2/7] nord.css file --- static/css/nord.css | 184 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 static/css/nord.css diff --git a/static/css/nord.css b/static/css/nord.css new file mode 100644 index 0000000..eb201fa --- /dev/null +++ b/static/css/nord.css @@ -0,0 +1,184 @@ +:root { + --nordbg: #0F0F0F; + --nordbglight: #252525; + --nordlinkcolor: #599bff; +} + +body.nord { + background: var(--nordbg); + color: #cacaca; +} +body.nord nav { + background: #1f1f1f; +} +body.nord .top-links a { + background: var(--nordbg); + color: #bfbfbf; +} +body.nord header { + background: var(--nordbglight); + color: #f1f1f1; +} +body.nord #post header div a { + color: var(--nordlinkcolor); + text-decoration: none; +} +body.nord a { + color: #f5f5f5; +} +body.nord a:hover, body.nord a:focus { + color: #3d8aff; + text-decoration: underline; +} +body.nord #post header div a:hover, +body.nord #post header div a:focus { + text-decoration: underline; +} +body.nord input[type="submit"]:hover, +body.nord input[type="submit"]:focus, +body.nord .btn:hover, +body.nord .btn:focus { + background: white; + color: black; + text-decoration: none; +} +body.nord form legend { + border-bottom: 1px solid #353535; +} +body.nord #post .title a { + color: var(--nordlinkcolor); +} +body.nord #post .submitted { + color: #a5a5a5; +} +body.nord #post .usertext-body { + background: #0a0a0a; + border: 1px solid #404040; +} +body.nord #post .infobar { + background-color: #d2d2d2; + color: #2f2f2f; +} +body.nord #post .infobar.blue { + background: #c7e3f9; + border: 1px solid #4b78a4; +} +body.nord #post .infobar a { + color: #0356d4; +} +body.nord header .tabmenu li a { + background: #3e3e3e; +} +body.nord header .tabmenu li a:hover, body.nord header .tabmenu li a:focus { + text-decoration: underline; + color: white; +} +body.nord #search { + color: #d2d2d2; +} +body.nord .md { + color: #dadada; +} +body.nord .md blockquote, body.nord .md del { + color: #777777; +} +body.nord .md code, body.nord .md pre { + background: black; + color: white; +} +body.nord .comment .body blockquote { + background: #313131; + color: #afafaf; + border-color: #464646; +} +body.nord .even-depth { + background: var(--nordbg); +} +body.nord .odd-depth { + background: var(--nordbglight); +} + +body.nord .comment .comment { + border-left: 1px solid #545454; +} + +body.nord .comment .meta .created a { + color: #7b7b7b; +} +body.nord .comment details summary { + color: #868686; +} +body.nord .comment details summary::-webkit-details-marker, +body.nord .comment details summary::marker { + color: #868686; +} +body.nord #links .link .entry .title a h2 { + color: #f0f0f0; +} +body.nord #links .link .entry .title a:visited h2 { + color: #6f6f6f; +} +body.nord #links .link .image .no-image, +body.nord #user .entry .image .no-image { + filter: opacity(0.5); +} +body.nord #user .comment { + width: 100%; + background: var(--nordbg); +} +body.nord #links .link .upvotes { + color: #858585; +} +body.nord .upvotes .arrow, +body.nord .score .arrow { + filter: opacity(0.5); +} +body.nord #links .link .entry .meta a { + color: #c7c7c7; +} +body.nord .content .bottom img { + filter: invert(1); +} +body.nord .container .content { + border: 1px solid #5e5e5e; +} +body.nord input[type="submit"], +body.nord .btn { + background: black; + color: white; +} +body.nord #post .crosspost { + background: var(--nordbg); +} +body.nord .view-more-links a { + background: black; + color: white; +} +body.nord .md .md-spoiler-text:not(.revealed):active, +body.nord .md .md-spoiler-text:not(.revealed):focus, +body.nord .md .md-spoiler-text:not(.revealed):hover { + background: white; + color: black; +} +body.nord .comment .body a, +body.nord .usertext-body a { + color: #3d99fb; +} +body.nord header .tabmenu li.active a { + background: #acacac; + color: #151515; +} +body.nord #search form input[type="text"] { + background: #0f0f0f; + color: white; +} +body.nord footer { + background: #2f2f2f; +} +body.nord footer a { + color: #999; +} +body.nord .flair { + color: #eaeaea !important; + background-color: #404040 !important; +} From 11a6ebd746ac5d733a74d3547a98219e38590d5a Mon Sep 17 00:00:00 2001 From: random_guy52 Date: Mon, 11 Jan 2021 02:23:57 +0100 Subject: [PATCH 3/7] Add 'CHANGELOG.md' --- CHANGELOG.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f359365 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,41 @@ +# Changelog +# Changelog + +## 2021-1-10 + +## Added + +- Edit date for comments + +## Fixed + +- Position of subscribe button in mobile +- Link colours + +## 2021-1-09 + +## Added + +- User info on top of entries +- r/all + +## Fixed +- Previous/Next links on page. + +## 2021-1-08 + +## Added + +- Subscribe to subreddits + +## Fixed + +- Fixed subreddit view when there are no subscriptions. + + + + + + + + From 50e1415b7edecf7c4cac35c9396644c29565b5cf Mon Sep 17 00:00:00 2001 From: random_guy52 Date: Mon, 11 Jan 2021 03:27:11 +0100 Subject: [PATCH 4/7] Update 'CHANGELOG.md' --- CHANGELOG.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f359365..60a0add 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,34 +1,33 @@ # Changelog -# Changelog -## 2021-1-10 +## 2021-01-10 -## Added +### Added - Edit date for comments -## Fixed +### Fixed - Position of subscribe button in mobile -- Link colours +- Inconsistency of Link colours -## 2021-1-09 +## 2021-01-09 -## Added +### Added - User info on top of entries -- r/all +- r/all even when users have subscriptions -## Fixed +### Fixed - Previous/Next links on page. -## 2021-1-08 +## 2021-01-08 -## Added +### Added -- Subscribe to subreddits +- Subscribe to subreddits and manage subscriptions from preferences page. -## Fixed +### Fixed - Fixed subreddit view when there are no subscriptions. From 54aba5b18664b87fb27d5cd260847147a456ebb2 Mon Sep 17 00:00:00 2001 From: random_guy52 Date: Mon, 11 Jan 2021 07:20:19 +0100 Subject: [PATCH 5/7] Add 'config.js.template' --- config.js.template | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 config.js.template diff --git a/config.js.template b/config.js.template new file mode 100644 index 0000000..be8cac8 --- /dev/null +++ b/config.js.template @@ -0,0 +1,47 @@ +const config = { + domain: process.env.DOMAIN || '127.0.0.1', // Or for example 'teddit.net' + use_reddit_oauth: process.env.USE_REDDIT_OAUTH === 'true' || false, // If false, teddit uses Reddit's public API. If true, you need to have your own Reddit app ID (enter the app ID to the "reddit_app_id" config key). + cert_dir: process.env.CERT_DIR || '', // For example '/home/teddit/letsencrypt/live/teddit.net', if you are using https. No trailing slash. + theme: process.env.THEME || 'dark', // One of: 'dark', '' + flairs_enabled: process.env.FLAIRS_ENABLED !== 'true' || true, // Enables the rendering of user and link flairs on teddit + highlight_controversial: process.env.HIGHLIGHT_CONTROVERSIAL !== 'true' || true, // Enables controversial comments to be indicated by a typographical dagger (†) + api_enabled: process.env.API_ENABLED !== 'true' || true, // Teddit API feature. Might increase loads significantly on your instance. + video_enabled: process.env.VIDEO_ENABLED !== 'true' || true, + redis_enabled: process.env.REDIS_ENABLED !== 'true' || true, // If disabled, does not cache Reddit API calls + redis_host: process.env.REDIS_HOST || '127.0.0.1', + redis_port: process.env.REDIS_PORT || 6379, + ssl_port: process.env.SSL_PORT || 8088, + nonssl_port: process.env.NONSSL_PORT || 8080, + listen_address: process.env.LISTEN_ADDRESS || '0.0.0.0', + https_enabled: process.env.HTTPS_ENABLED === 'true' || false, + redirect_http_to_https: process.env.REDIRECT_HTTP_TO_HTTPS === 'true' || false, + redirect_www: process.env.REDIRECT_WWW === 'true' || false, + use_compression: process.env.USE_COMPRESSION !== 'true' || true, + use_view_cache: process.env.USE_VIEW_CACHE === 'true' || false, + use_helmet: process.env.USE_HELMET === 'true' || false, // Recommended to be true when using https + use_helmet_hsts: process.env.USE_HELMET_HSTS === 'true' || false, // Recommended to be true when using https + trust_proxy: process.env.TRUST_PROXY === 'true' || false, // Enable trust_proxy if you are using reverse proxy like nginx + trust_proxy_address: process.env.TRUST_PROXY_ADDRESS || '127.0.0.1', + nsfw_enabled: process.env.NSFW_ENABLED !== 'true' || true, // Enable NSFW (over 18) content. If false, a warning is shown to the user before opening any NSFW post. When the NFSW content is disabled, NSFW posts are hidden from subreddits and from user page feeds. Note: Users can set this to true or false from their preferences. + post_comments_sort: process.env.POST_COMMENTS_SORT || 'confidence', // "confidence" is the default sorting in Reddit. Must be one of: confidence, top, new, controversial, old, random, qa, live. + reddit_app_id: process.env.REDDIT_APP_ID || 'ABfYqdDc9qPh1w', // If "use_reddit_oauth" config key is set to true, you have to obtain your Reddit app ID. For testing purposes it's okay to use this project's default app ID. Create your Reddit app here: https://old.reddit.com/prefs/apps/. Make sure to create an "installed app" type of app. + setexs: { + /**, + * Redis cache expiration values (in seconds). + * When the cache expires, new content is fetched from Reddit's API (when + * the given URL is revisited). + */ + frontpage: 600, + subreddit: 600, + posts: 600, + user: 600, + searches: 600, + sidebar: 60 * 60 * 24 * 7, // 7 days + shorts: 60 * 60 * 24 * 31, + wikis: 60* 60 * 24 * 7 + }, + valid_media_domains: ['preview.redd.it', 'external-preview.redd.it', 'i.redd.it', 'v.redd.it', 'a.thumbs.redditmedia.com', 'b.thumbs.redditmedia.com', 'emoji.redditmedia.com', 'thumbs.gfycat.com', 'i.ytimg.com'], + reddit_api_error_text: `Seems like your instance is either blocked (e.g. due to API rate limiting), reddit is currently down, or your API key is expired and not renewd properly. This can also happen for other reasons.` +}; + +module.exports = config; From f0642a992587a04781184d07c20f20268d19b8b1 Mon Sep 17 00:00:00 2001 From: random_guy52 Date: Mon, 11 Jan 2021 07:20:46 +0100 Subject: [PATCH 6/7] Delete 'static/css/nord.css' --- static/css/nord.css | 184 -------------------------------------------- 1 file changed, 184 deletions(-) delete mode 100644 static/css/nord.css diff --git a/static/css/nord.css b/static/css/nord.css deleted file mode 100644 index eb201fa..0000000 --- a/static/css/nord.css +++ /dev/null @@ -1,184 +0,0 @@ -:root { - --nordbg: #0F0F0F; - --nordbglight: #252525; - --nordlinkcolor: #599bff; -} - -body.nord { - background: var(--nordbg); - color: #cacaca; -} -body.nord nav { - background: #1f1f1f; -} -body.nord .top-links a { - background: var(--nordbg); - color: #bfbfbf; -} -body.nord header { - background: var(--nordbglight); - color: #f1f1f1; -} -body.nord #post header div a { - color: var(--nordlinkcolor); - text-decoration: none; -} -body.nord a { - color: #f5f5f5; -} -body.nord a:hover, body.nord a:focus { - color: #3d8aff; - text-decoration: underline; -} -body.nord #post header div a:hover, -body.nord #post header div a:focus { - text-decoration: underline; -} -body.nord input[type="submit"]:hover, -body.nord input[type="submit"]:focus, -body.nord .btn:hover, -body.nord .btn:focus { - background: white; - color: black; - text-decoration: none; -} -body.nord form legend { - border-bottom: 1px solid #353535; -} -body.nord #post .title a { - color: var(--nordlinkcolor); -} -body.nord #post .submitted { - color: #a5a5a5; -} -body.nord #post .usertext-body { - background: #0a0a0a; - border: 1px solid #404040; -} -body.nord #post .infobar { - background-color: #d2d2d2; - color: #2f2f2f; -} -body.nord #post .infobar.blue { - background: #c7e3f9; - border: 1px solid #4b78a4; -} -body.nord #post .infobar a { - color: #0356d4; -} -body.nord header .tabmenu li a { - background: #3e3e3e; -} -body.nord header .tabmenu li a:hover, body.nord header .tabmenu li a:focus { - text-decoration: underline; - color: white; -} -body.nord #search { - color: #d2d2d2; -} -body.nord .md { - color: #dadada; -} -body.nord .md blockquote, body.nord .md del { - color: #777777; -} -body.nord .md code, body.nord .md pre { - background: black; - color: white; -} -body.nord .comment .body blockquote { - background: #313131; - color: #afafaf; - border-color: #464646; -} -body.nord .even-depth { - background: var(--nordbg); -} -body.nord .odd-depth { - background: var(--nordbglight); -} - -body.nord .comment .comment { - border-left: 1px solid #545454; -} - -body.nord .comment .meta .created a { - color: #7b7b7b; -} -body.nord .comment details summary { - color: #868686; -} -body.nord .comment details summary::-webkit-details-marker, -body.nord .comment details summary::marker { - color: #868686; -} -body.nord #links .link .entry .title a h2 { - color: #f0f0f0; -} -body.nord #links .link .entry .title a:visited h2 { - color: #6f6f6f; -} -body.nord #links .link .image .no-image, -body.nord #user .entry .image .no-image { - filter: opacity(0.5); -} -body.nord #user .comment { - width: 100%; - background: var(--nordbg); -} -body.nord #links .link .upvotes { - color: #858585; -} -body.nord .upvotes .arrow, -body.nord .score .arrow { - filter: opacity(0.5); -} -body.nord #links .link .entry .meta a { - color: #c7c7c7; -} -body.nord .content .bottom img { - filter: invert(1); -} -body.nord .container .content { - border: 1px solid #5e5e5e; -} -body.nord input[type="submit"], -body.nord .btn { - background: black; - color: white; -} -body.nord #post .crosspost { - background: var(--nordbg); -} -body.nord .view-more-links a { - background: black; - color: white; -} -body.nord .md .md-spoiler-text:not(.revealed):active, -body.nord .md .md-spoiler-text:not(.revealed):focus, -body.nord .md .md-spoiler-text:not(.revealed):hover { - background: white; - color: black; -} -body.nord .comment .body a, -body.nord .usertext-body a { - color: #3d99fb; -} -body.nord header .tabmenu li.active a { - background: #acacac; - color: #151515; -} -body.nord #search form input[type="text"] { - background: #0f0f0f; - color: white; -} -body.nord footer { - background: #2f2f2f; -} -body.nord footer a { - color: #999; -} -body.nord .flair { - color: #eaeaea !important; - background-color: #404040 !important; -} From b5ca498abdcb958d98f63ca5f39d24bc1b61173b Mon Sep 17 00:00:00 2001 From: random_guy52 Date: Tue, 12 Jan 2021 16:33:49 +0100 Subject: [PATCH 7/7] Update 'CHANGELOG.md' --- CHANGELOG.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60a0add..b360d1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,34 +1,24 @@ # Changelog -## 2021-01-10 - +## 2021-01-12 +### Added +- Added r/popular to list of subreddits +## 2021-01-10 ### Added - - Edit date for comments - ### Fixed - - Position of subscribe button in mobile - Inconsistency of Link colours - ## 2021-01-09 - ### Added - - User info on top of entries - r/all even when users have subscriptions - ### Fixed - Previous/Next links on page. - ## 2021-01-08 - ### Added - - Subscribe to subreddits and manage subscriptions from preferences page. - ### Fixed - - Fixed subreddit view when there are no subscriptions.