Remove DEPRECATED_DOMAIN_LIST and deprecated domains

This commit is contained in:
dangered wolf 2023-12-08 21:22:13 -05:00
parent 448f9dc80f
commit c5dbb8f5db
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58
10 changed files with 4 additions and 27 deletions

View file

@ -1,10 +1,9 @@
BRANDING_NAME = "FixTweet / FixupX" BRANDING_NAME = "FixTweet / FixupX"
STANDARD_DOMAIN_LIST = "fxtwitter.com,fixupx.com,twittpr.com" STANDARD_DOMAIN_LIST = "fxtwitter.com,fixupx.com,twittpr.com"
DIRECT_MEDIA_DOMAINS = "d.fxtwitter.com,dl.fxtwitter.com,d.pxtwitter.com,d.twittpr.com,dl.pxtwitter.com,dl.twittpr.com,d.fixupx.com,d.xfixup.com,dl.fixupx.com,dl.xfixup.com" DIRECT_MEDIA_DOMAINS = "d.fxtwitter.com,dl.fxtwitter.com,d.twittpr.com,dl.twittpr.com,d.fixupx.com,d.xfixup.com,dl.fixupx.com,dl.xfixup.com"
TEXT_ONLY_DOMAINS = "t.fxtwitter.com,t.twittpr.com,t.fixupx.com" TEXT_ONLY_DOMAINS = "t.fxtwitter.com,t.twittpr.com,t.fixupx.com"
INSTANT_VIEW_DOMAINS = "i.fxtwitter.com,i.twittpr.com,i.fixupx.com" INSTANT_VIEW_DOMAINS = "i.fxtwitter.com,i.twittpr.com,i.fixupx.com"
GALLERY_DOMAINS = "g.fxtwitter.com,g.twittpr.com,g.fixupx.com" GALLERY_DOMAINS = "g.fxtwitter.com,g.twittpr.com,g.fixupx.com"
DEPRECATED_DOMAIN_LIST = "pxtwitter.com,www.pxtwitter.com"
MOSAIC_DOMAIN_LIST = "mosaic.fxtwitter.com" MOSAIC_DOMAIN_LIST = "mosaic.fxtwitter.com"
API_HOST_LIST = "api.fxtwitter.com,api-canary.fxtwitter.com" API_HOST_LIST = "api.fxtwitter.com,api-canary.fxtwitter.com"
HOST_URL = "https://fxtwitter.com" HOST_URL = "https://fxtwitter.com"

View file

@ -43,8 +43,7 @@ let envVariables = [
'EMBED_URL', 'EMBED_URL',
'MOSAIC_DOMAIN_LIST', 'MOSAIC_DOMAIN_LIST',
'API_HOST_LIST', 'API_HOST_LIST',
'SENTRY_DSN', 'SENTRY_DSN'
'DEPRECATED_DOMAIN_LIST'
]; ];
// Create defines for all environment variables // Create defines for all environment variables

View file

@ -11,7 +11,6 @@
"STANDARD_DOMAIN_LIST": "fxtwitter.com,fixupx.com,twittpr.com", "STANDARD_DOMAIN_LIST": "fxtwitter.com,fixupx.com,twittpr.com",
"DIRECT_MEDIA_DOMAINS": "d.fxtwitter.com,dl.fxtwitter.com,d.fixupx.com,dl.fixupx.com", "DIRECT_MEDIA_DOMAINS": "d.fxtwitter.com,dl.fxtwitter.com,d.fixupx.com,dl.fixupx.com",
"MOSAIC_DOMAIN_LIST": "mosaic.fxtwitter.com", "MOSAIC_DOMAIN_LIST": "mosaic.fxtwitter.com",
"DEPRECATED_DOMAIN_LIST": "pxtwitter.com,www.pxtwitter.com",
"API_HOST_LIST": "api.fxtwitter.com", "API_HOST_LIST": "api.fxtwitter.com",
"HOST_URL": "https://fxtwitter.com", "HOST_URL": "https://fxtwitter.com",
"REDIRECT_URL": "https://github.com/FixTweet/FixTweet", "REDIRECT_URL": "https://github.com/FixTweet/FixTweet",

View file

@ -6,7 +6,6 @@ export const Constants = {
TEXT_ONLY_DOMAINS: TEXT_ONLY_DOMAINS.split(','), TEXT_ONLY_DOMAINS: TEXT_ONLY_DOMAINS.split(','),
INSTANT_VIEW_DOMAINS: INSTANT_VIEW_DOMAINS.split(','), INSTANT_VIEW_DOMAINS: INSTANT_VIEW_DOMAINS.split(','),
GALLERY_DOMAINS: GALLERY_DOMAINS.split(','), GALLERY_DOMAINS: GALLERY_DOMAINS.split(','),
DEPRECATED_DOMAIN_LIST: DEPRECATED_DOMAIN_LIST.split(','),
MOSAIC_DOMAIN_LIST: MOSAIC_DOMAIN_LIST.split(','), MOSAIC_DOMAIN_LIST: MOSAIC_DOMAIN_LIST.split(','),
API_HOST_LIST: API_HOST_LIST.split(','), API_HOST_LIST: API_HOST_LIST.split(','),
HOST_URL: HOST_URL, HOST_URL: HOST_URL,

View file

@ -384,10 +384,6 @@ export const handleStatus = async (
} }
} }
/* Notice that user is using deprecated domain */
if (flags?.deprecated) {
siteName = Strings.DEPRECATED_DOMAIN_NOTICE;
}
/* For supporting Telegram IV, we have to replace newlines with <br> within the og:description <meta> tag because of its weird (undocumented?) behavior. /* For supporting Telegram IV, we have to replace newlines with <br> within the og:description <meta> tag because of its weird (undocumented?) behavior.
If you don't use IV, it uses newlines just fine. Just like Discord and others. But with IV, suddenly newlines don't actually break the line anymore. If you don't use IV, it uses newlines just fine. Just like Discord and others. But with IV, suddenly newlines don't actually break the line anymore.
@ -438,13 +434,12 @@ export const handleStatus = async (
let providerEngagementText = getSocialProof(status) ?? Strings.DEFAULT_AUTHOR_TEXT; let providerEngagementText = getSocialProof(status) ?? Strings.DEFAULT_AUTHOR_TEXT;
providerEngagementText = providerEngagementText.replace(/ {4}/g, ' '); providerEngagementText = providerEngagementText.replace(/ {4}/g, ' ');
headers.push( headers.push(
`<link rel="alternate" href="{base}/owoembed?text={text}{deprecatedFlag}&status={status}&author={author}{provider}" type="application/json+oembed" title="{name}">`.format( `<link rel="alternate" href="{base}/owoembed?text={text}&status={status}&author={author}{provider}" type="application/json+oembed" title="{name}">`.format(
{ {
base: Constants.HOST_URL, base: Constants.HOST_URL,
text: flags.gallery text: flags.gallery
? status.author.name ? status.author.name
: encodeURIComponent(truncateWithEllipsis(authorText, 255)), : encodeURIComponent(truncateWithEllipsis(authorText, 255)),
deprecatedFlag: flags?.deprecated ? '&deprecated=true' : '',
status: encodeURIComponent(statusId), status: encodeURIComponent(statusId),
author: encodeURIComponent(status.author.screen_name || ''), author: encodeURIComponent(status.author.screen_name || ''),
name: status.author.name || '', name: status.author.name || '',

View file

@ -63,15 +63,6 @@ export const statusRequest = async (c: Context) => {
flags.direct = true; flags.direct = true;
} }
/* The pxtwitter.com domain is deprecated and statuses posted after deprecation
date will have a notice saying we've moved to fxtwitter.com! */
if (
Constants.DEPRECATED_DOMAIN_LIST.includes(url.hostname)
) {
console.log('Request to deprecated domain');
flags.deprecated = true;
}
/* TODO: Figure out what we're doing with FixTweet / FixupX branding in future */ /* TODO: Figure out what we're doing with FixTweet / FixupX branding in future */
if (/fixup/g.test(url.href)) { if (/fixup/g.test(url.href)) {
console.log(`We're using x domain`); console.log(`We're using x domain`);

View file

@ -218,9 +218,6 @@ This may be caused by API downtime or a new bug. Try again in a little while." p
ERROR_USER_NOT_FOUND: `Sorry, that user doesn't exist :(`, ERROR_USER_NOT_FOUND: `Sorry, that user doesn't exist :(`,
ERROR_UNKNOWN: `Unknown error occurred, sorry about that :(`, ERROR_UNKNOWN: `Unknown error occurred, sorry about that :(`,
DEPRECATED_DOMAIN_NOTICE: `We've moved! ➡ fxtwitter.com`,
DEPRECATED_DOMAIN_NOTICE_DISCORD: `We've moved! ➡ fxtwitter.com`,
ROBOTS_TXT: `# /-------------------------------------------\\ ROBOTS_TXT: `# /-------------------------------------------\\
# | _______ | # | _______ |
# | | | | # | | | |

1
src/types/env.d.ts vendored
View file

@ -4,7 +4,6 @@ declare const DIRECT_MEDIA_DOMAINS: string;
declare const TEXT_ONLY_DOMAINS: string; declare const TEXT_ONLY_DOMAINS: string;
declare const INSTANT_VIEW_DOMAINS: string; declare const INSTANT_VIEW_DOMAINS: string;
declare const GALLERY_DOMAINS: string; declare const GALLERY_DOMAINS: string;
declare const DEPRECATED_DOMAIN_LIST: string;
declare const HOST_URL: string; declare const HOST_URL: string;
declare const EMBED_URL: string; declare const EMBED_URL: string;
declare const REDIRECT_URL: string; declare const REDIRECT_URL: string;

View file

@ -5,7 +5,6 @@ type InputFlags = {
standard?: boolean; standard?: boolean;
direct?: boolean; direct?: boolean;
api?: boolean; api?: boolean;
deprecated?: boolean;
textOnly?: boolean; textOnly?: boolean;
isXDomain?: boolean; isXDomain?: boolean;
forceInstantView?: boolean; forceInstantView?: boolean;

View file

@ -44,7 +44,7 @@ export const app = new Hono<{
} else { } else {
console.log(`Domain not assigned to realm, falling back to Twitter: ${url.hostname}`); console.log(`Domain not assigned to realm, falling back to Twitter: ${url.hostname}`);
} }
/* Defaults to Twitter realm if unknown domain specified (such as the *.workers.dev hostname or deprecated domain) */ /* Defaults to Twitter realm if unknown domain specified (such as the *.workers.dev hostname) */
console.log(`/${realm}${url.pathname}`); console.log(`/${realm}${url.pathname}`);
return `/${realm}${url.pathname}`; return `/${realm}${url.pathname}`;