Merge pull request 'update: update fork before making new pull request.' (#1) from teddit/teddit:main into main
Reviewed-on: https://codeberg.org/NunoSempere/teddit/pulls/1
This commit is contained in:
commit
494c7f5417
|
@ -10,26 +10,26 @@ jobs:
|
|||
steps:
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v2
|
||||
-
|
||||
name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: "Checkout repository"
|
||||
uses: "actions/checkout@v2"
|
||||
uses: "actions/checkout@v3"
|
||||
-
|
||||
name: Build and push to Docker Hub and Github Packages Docker Registry
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
|
|
|
@ -9,26 +9,26 @@ jobs:
|
|||
steps:
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v2
|
||||
-
|
||||
name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: "Checkout repository"
|
||||
uses: "actions/checkout@v2"
|
||||
uses: "actions/checkout@v3"
|
||||
-
|
||||
name: Build and push to Docker Hub and Github Packages Docker Registry
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
push: true
|
||||
tags: |
|
||||
|
|
|
@ -51,6 +51,7 @@ Community instances:
|
|||
| [teddit.rawbit.ninja](https://teddit.rawbit.ninja) | [yqu4yj5lju7bmlwpzpml...onion](http://yqu4yj5lju7bmlwpzpmltb5gsu6cw7nnbcxxx4iqemwa56nxjiggf4qd.onion) | | Operated by https://rawbit.ninja |
|
||||
| [teddit.artemislena.eu](https://teddit.artemislena.eu) | [teddit.lpoaj7z2zkajuhgnlltp...onion](http://teddit.lpoaj7z2zkajuhgnlltpeqh3zyq7wk2iyeggqaduhgxhyajtdt2j7wad.onion) | | Operated by https://artemislena.eu |
|
||||
| [teddit.manasiwibi.com](https://teddit.manasiwibi.com) | [24fympskb....onion](http://24fympskbrdgbf4afuvhqwwl2tv3y2vwxg5t2ktozd4j5b3fob5ntzyd.onion/) | | Operated by https://manasiwibi.com/ |
|
||||
| [teddit.hostux.net](https://teddit.hostux.net) | | | Operated by https://hostux.net |
|
||||
|
||||
<!--
|
||||
Remove the Changelog section, because the CHANGELOG.md is not updated anymore
|
||||
|
|
|
@ -193,6 +193,14 @@ module.exports = function(request, fs) {
|
|||
let youtubeRegex = /(?<=href=")(https?:\/\/)([A-z.]+\.)?youtu(be\.com|\.be)(?=.+")/gm;
|
||||
let twitterRegex = /(?<=href=")(https?:\/\/)(www\.)?twitter\.com(?=.+")/gm;
|
||||
let instagramRegex = /(?<=href=")(https?:\/\/)(www+\.)?instagram.com(?=.+")/gm;
|
||||
let quoraRegex = /(?<=href=")(https?:\/\/)([A-z.]+\.)?quora\.com(?=.+")/gm;
|
||||
|
||||
/*
|
||||
* regex pattern to replace imgur links (imgur.com, imgur.io, i.stack.imgur.com)
|
||||
* source: https://github.com/libredirect/libredirect/blob/32c4a0211e3b721d46219c05cba93f1a42cf3773/src/config/config.json#L317
|
||||
* license: GNU GPL v3 License -> https://github.com/libredirect/libredirect/blob/32c4a0211e3b721d46219c05cba93f1a42cf3773/LICENSE
|
||||
*/
|
||||
let imgurRegex = /(?<=href=")(https?:\/{2})([im]\.)?(stack\.)?imgur\.(com|io)(?=.+")/gm;
|
||||
|
||||
let protocol = config.https_enabled || config.api_force_https ? 'https://' : 'http://'
|
||||
|
||||
|
@ -260,6 +268,14 @@ module.exports = function(request, fs) {
|
|||
if(user_preferences.domain_instagram)
|
||||
str = str.replace(instagramRegex, protocol + user_preferences.domain_instagram)
|
||||
|
||||
if(typeof(user_preferences.domain_quora) != 'undefined')
|
||||
if(user_preferences.domain_quora)
|
||||
str = str.replace(quoraRegex, protocol + user_preferences.domain_quora)
|
||||
|
||||
if(typeof(user_preferences.domain_imgur) != 'undefined')
|
||||
if(user_preferences.domain_imgur)
|
||||
str = str.replace(imgurRegex, protocol + user_preferences.domain_imgur)
|
||||
|
||||
return str
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
"url": "https://tedd.it"
|
||||
},
|
||||
{
|
||||
"url": "https://wiki.privacytools.io",
|
||||
"url": "https://teddit.privacytools.io",
|
||||
"onion": "http://jnuonmf2n36sfdmyksqqqyab3w63cq4kx24olyjleh5z6zzfvyt7uqqd.onion",
|
||||
"notes": "Part of: https://www.privacytools.io"
|
||||
},
|
||||
|
@ -109,5 +109,9 @@
|
|||
"url":"https://teddit.manasiwibi.com/",
|
||||
"onion":"http://24fympskbrdgbf4afuvhqwwl2tv3y2vwxg5t2ktozd4j5b3fob5ntzyd.onion/",
|
||||
"notes":"Operated by https://manasiwibi.com/"
|
||||
},
|
||||
{
|
||||
"url": "https://teddit.hostux.net",
|
||||
"notes": "Managed by https://hostux.net"
|
||||
}
|
||||
]
|
||||
|
|
|
@ -40,7 +40,7 @@ homeRoute.get([`/:sort?`, '/frontpage'], async (req, res, next) => {
|
|||
: false;
|
||||
if (proxyable) {
|
||||
let media_url = '';
|
||||
const replacable_media_domains = ['i.redd.it', 'v.redd.it', 'external-preview.redd.it']
|
||||
const replacable_media_domains = ['i.redd.it', 'v.redd.it', 'external-preview.redd.it', 'preview.redd.it']
|
||||
if (req.query.teddit_proxy) {
|
||||
if (replacable_media_domains.includes(req.query.teddit_proxy)) {
|
||||
let full_url = req.protocol + '://' + req.get('host') + req.originalUrl;
|
||||
|
|
|
@ -101,6 +101,24 @@ overridingRoutes.all('*', (req, res, next) => {
|
|||
});
|
||||
}
|
||||
|
||||
let domainQuora = req.query.domain_quora;
|
||||
if (domainQuora) {
|
||||
req.cookies.domain_quora = domainQuora;
|
||||
res.cookie('domain_quora', domainQuora, {
|
||||
maxAge: 31536000,
|
||||
httpOnly: true,
|
||||
});
|
||||
}
|
||||
|
||||
let domainImgur = req.query.domain_imgur;
|
||||
if (domainImgur) {
|
||||
req.cookies.domain_imgur = domainImgur;
|
||||
res.cookie('domain_imgur', domainImgur, {
|
||||
maxAge: 31536000,
|
||||
httpOnly: true,
|
||||
});
|
||||
}
|
||||
|
||||
let videosMuted = req.query.videos_muted;
|
||||
if (videosMuted) {
|
||||
req.cookies.videos_muted = videosMuted;
|
||||
|
|
|
@ -15,6 +15,8 @@ function resetPreferences(res) {
|
|||
res.clearCookie('domain_twitter');
|
||||
res.clearCookie('domain_youtube');
|
||||
res.clearCookie('domain_instagram');
|
||||
res.clearCookie('domain_quora');
|
||||
res.clearCookie('domain_imgur');
|
||||
res.clearCookie('videos_muted');
|
||||
res.clearCookie('prefer_frontpage');
|
||||
res.clearCookie('show_large_gallery_images');
|
||||
|
@ -92,6 +94,8 @@ preferenceRoutes.post('/saveprefs', (req, res, next) => {
|
|||
let domain_twitter = req.body.domain_twitter;
|
||||
let domain_youtube = req.body.domain_youtube;
|
||||
let domain_instagram = req.body.domain_instagram;
|
||||
let domain_quora = req.body.domain_quora;
|
||||
let domain_imgur = req.body.domain_imgur;
|
||||
let videos_muted = req.body.videos_muted;
|
||||
let prefer_frontpage = req.body.prefer_frontpage;
|
||||
let show_large_gallery_images = req.body.show_large_gallery_images;
|
||||
|
@ -172,6 +176,14 @@ preferenceRoutes.post('/saveprefs', (req, res, next) => {
|
|||
maxAge: 365 * 24 * 60 * 60 * 1000,
|
||||
httpOnly: true,
|
||||
});
|
||||
res.cookie('domain_quora', domain_quora, {
|
||||
maxAge: 365 * 24 * 60 * 60 * 1000,
|
||||
httpOnly: true,
|
||||
});
|
||||
res.cookie('domain_imgur', domain_imgur, {
|
||||
maxAge: 365 * 24 * 60 * 60 * 1000,
|
||||
httpOnly: true,
|
||||
});
|
||||
|
||||
if (prefer_frontpage === 'on') prefer_frontpage = 'true';
|
||||
res.cookie('prefer_frontpage', prefer_frontpage, {
|
||||
|
|
|
@ -84,6 +84,7 @@ nav .nav-item.left a {
|
|||
}
|
||||
nav .nav-item.left img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
vertical-align: bottom;
|
||||
margin: 0 7px 0 0;
|
||||
}
|
||||
|
@ -280,9 +281,11 @@ header .tabmenu li.active a {
|
|||
color: white;
|
||||
padding: 16px;
|
||||
}
|
||||
input, select {
|
||||
padding: 2px;
|
||||
}
|
||||
input[type="submit"],
|
||||
.btn {
|
||||
padding: 3px;
|
||||
margin-top: 7px;
|
||||
margin-right: 10px;
|
||||
border-radius: 0;
|
||||
|
|
|
@ -26,11 +26,23 @@ html
|
|||
else
|
||||
input(type="text", name="domain_youtube", id="domain_youtube", placeholder="e.g. invidious.site")
|
||||
.setting
|
||||
label(for="domain_instagram") Replace Instagram links with Bibliogram (blank to disable):
|
||||
label(for="domain_instagram") Replace Instagram links with Bibliogram (blank to disable):
|
||||
if(user_preferences.domain_instagram != '' && typeof(user_preferences.domain_instagram) != 'undefined')
|
||||
input(type="text", name="domain_instagram", id="domain_instagram", value="" + user_preferences.domain_instagram + "", placeholder="e.g. bibliogram.art")
|
||||
else
|
||||
input(type="text", name="domain_instagram", id="domain_instagram", placeholder="e.g. bibliogram.art")
|
||||
.setting
|
||||
label(for="domain_quora") Replace Quora links with Quetre (blank to disable):
|
||||
if(user_preferences.domain_quora != '' && typeof(user_preferences.domain_quora) != 'undefined')
|
||||
input(type="text", name="domain_quora", id="domain_quora", value="" + user_preferences.domain_quora + "", placeholder="e.g. quetre.iket.me")
|
||||
else
|
||||
input(type="text", name="domain_quora", id="domain_quora", placeholder="e.g. quetre.iket.me")
|
||||
.setting
|
||||
label(for="domain_imgur") Replace Imgur links with Rimgo (blank to disable):
|
||||
if(user_preferences.domain_imgur != '' && typeof(user_preferences.domain_imgur) != 'undefined')
|
||||
input(type="text", name="domain_imgur", id="domain_imgur", value="" + user_preferences.domain_imgur + "", placeholder="e.g. rimgo.bcow.xyz")
|
||||
else
|
||||
input(type="text", name="domain_imgur", id="domain_imgur", placeholder="e.g. rimgo.bcow.xyz")
|
||||
legend Display
|
||||
.setting
|
||||
label(for="theme") Theme:
|
||||
|
@ -41,30 +53,36 @@ html
|
|||
option(value="dark") Dark
|
||||
option(value="sepia") Sepia
|
||||
option(value="nord") Nord
|
||||
if(user_preferences.theme == 'white')
|
||||
else if(user_preferences.theme == 'white')
|
||||
option(value="auto") Auto
|
||||
option(value="white", selected="selected") White
|
||||
option(value="dark") Dark
|
||||
option(value="sepia") Sepia
|
||||
option(value="nord") Nord
|
||||
if(user_preferences.theme === 'dark')
|
||||
else if(user_preferences.theme === 'dark')
|
||||
option(value="auto") Auto
|
||||
option(value="white") White
|
||||
option(value="dark", selected="selected") Dark
|
||||
option(value="sepia") Sepia
|
||||
option(value="nord") Nord
|
||||
if(user_preferences.theme === 'sepia')
|
||||
else if(user_preferences.theme === 'sepia')
|
||||
option(value="auto") Auto
|
||||
option(value="white") White
|
||||
option(value="dark") Dark
|
||||
option(value="sepia", selected="selected") Sepia
|
||||
option(value="nord") Nord
|
||||
if(user_preferences.theme === 'nord')
|
||||
else if(user_preferences.theme === 'nord')
|
||||
option(value="auto") Auto
|
||||
option(value="white") White
|
||||
option(value="dark") Dark
|
||||
option(value="sepia") Sepia
|
||||
option(value="nord", selected="selected") Nord
|
||||
else
|
||||
option(value="auto") Auto
|
||||
option(value="white") White
|
||||
option(value="dark") Dark
|
||||
option(value="sepia") Sepia
|
||||
option(value="nord") Nord
|
||||
.setting
|
||||
label(for="flairs") Show flairs:
|
||||
if(!user_preferences.flairs || user_preferences.flairs == 'true')
|
||||
|
|
Loading…
Reference in New Issue