Skip to content

Commit

Permalink
refactor: update workers domain names
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Sep 28, 2023
1 parent 3a9d564 commit 7c1d1d9
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 50 deletions.
2 changes: 0 additions & 2 deletions apps/web/src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ class LensterDocument extends Document {
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />

{/* Prefetch and Preconnect */}
<link rel="preconnect" href="https://user-content.lenster.xyz" />
<link rel="dns-prefetch" href="https://user-content.lenster.xyz" />
<link rel="preconnect" href="https://static-assets.lenster.xyz" />
<link rel="dns-prefetch" href="https://static-assets.lenster.xyz" />

Expand Down
34 changes: 17 additions & 17 deletions docs/ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

The following ports are exposed by the repository

| Port | Description | Local endpoint | Production endpoint |
| ---- | -------------------------- | --------------------- | ---------------------------------- |
| 4783 | Web app | http://localhost:4783 | https://lenster.xyz |
| 4784 | Prerender app | http://localhost:4784 | https://prerender.lenster.xyz |
| 8082 | STS token generator worker | http://localhost:8082 | https://sts.lenster.xyz |
| 8083 | Metadata worker | http://localhost:8083 | https://metadata.lenster.xyz |
| 8084 | Freshdesk worker | http://localhost:8084 | https://freshdesk.lenster.xyz |
| 8085 | Snapshot relay worker | http://localhost:8085 | https://snapshot-relay.lenster.xyz |
| 8086 | ENS resolver worker | http://localhost:8086 | https://ens.lenster.xyz |
| 8087 | Oembed worker | http://localhost:8087 | https://oembed.lenster.xyz |
| 8088 | Leafwatch worker | http://localhost:8088 | https://leafwatch.lenster.xyz |
| 8089 | Achievements worker | http://localhost:8089 | https://achievements.lenster.xyz |
| 8090 | Invite worker | http://localhost:8090 | https://invite.lenster.xyz |
| 8091 | Feeds gateway | http://localhost:8091 | https://feeds.lenster.xyz |
| 8092 | Preferences worker | http://localhost:8092 | https://preferences.lenster.xyz |
| 8093 | Channels worker | http://localhost:8093 | https://channels.lenster.xyz |
| 8094 | Zora worker | http://localhost:8094 | https://zora.lenster.xyz |
| Port | Description | Local endpoint | Production endpoint |
| ---- | -------------------------- | --------------------- | ------------------------------ |
| 4783 | Web app | http://localhost:4783 | https://hey.xyz |
| 4784 | Prerender app | http://localhost:4784 | https://prerender.hey.xyz |
| 8082 | STS token generator worker | http://localhost:8082 | https://sts.hey.xyz |
| 8083 | Metadata worker | http://localhost:8083 | https://metadata.hey.xyz |
| 8084 | Freshdesk worker | http://localhost:8084 | https://freshdesk.hey.xyz |
| 8085 | Snapshot relay worker | http://localhost:8085 | https://snapshot-relay.hey.xyz |
| 8086 | ENS resolver worker | http://localhost:8086 | https://ens.hey.xyz |
| 8087 | Oembed worker | http://localhost:8087 | https://oembed.hey.xyz |
| 8088 | Leafwatch worker | http://localhost:8088 | https://leafwatch.hey.xyz |
| 8089 | Achievements worker | http://localhost:8089 | https://achievements.hey.xyz |
| 8090 | Invite worker | http://localhost:8090 | https://invite.hey.xyz |
| 8091 | Feeds gateway | http://localhost:8091 | https://feeds.hey.xyz |
| 8092 | Preferences worker | http://localhost:8092 | https://preferences.hey.xyz |
| 8093 | Channels worker | http://localhost:8093 | https://channels.hey.xyz |
| 8094 | Zora worker | http://localhost:8094 | https://zora.hey.xyz |
26 changes: 13 additions & 13 deletions packages/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,41 +74,41 @@ export const DEFAULT_OG = `${STATIC_IMAGES_URL}/og/logo.jpeg`;

// Workers
export const STS_GENERATOR_WORKER_URL = IS_PRODUCTION
? 'https://sts.lenster.xyz'
? 'https://sts.hey.xyz'
: 'http://localhost:8082';
export const METADATA_WORKER_URL = IS_PRODUCTION
? 'https://metadata.lenster.xyz'
? 'https://metadata.hey.xyz'
: 'http://localhost:8083';
export const FRESHDESK_WORKER_URL = IS_PRODUCTION
? 'https://freshdesk.lenster.xyz'
? 'https://freshdesk.hey.xyz'
: 'http://localhost:8084';
export const SNAPSHOR_RELAY_WORKER_URL = IS_PRODUCTION
? 'https://snapshot-relay.lenster.xyz'
? 'https://snapshot-relay.hey.xyz'
: 'http://localhost:8085';
export const ENS_WORKER_URL = IS_PRODUCTION
? 'https://ens.lenster.xyz'
? 'https://ens.hey.xyz'
: 'http://localhost:8086';
export const OEMBED_WORKER_URL = IS_PRODUCTION
? 'https://oembed.lenster.xyz'
? 'https://oembed.hey.xyz'
: 'http://localhost:8087';
export const LEAFWATCH_WORKER_URL = IS_PRODUCTION
? 'https://leafwatch.lenster.xyz'
? 'https://leafwatch.hey.xyz'
: 'http://localhost:8088';
export const ACHIEVEMENTS_WORKER_URL = 'https://achievements.lenster.xyz';
export const ACHIEVEMENTS_WORKER_URL = 'https://achievements.hey.xyz';
export const INVITE_WORKER_URL = IS_PRODUCTION
? 'https://invite.lenster.xyz'
? 'https://invite.hey.xyz'
: 'http://localhost:8090';
export const FEEDS_WORKER_URL = IS_PRODUCTION
? 'https://feeds.lenster.xyz'
? 'https://feeds.hey.xyz'
: 'http://localhost:8091';
export const PREFERENCES_WORKER_URL = IS_PRODUCTION
? 'https://preferences.lenster.xyz'
? 'https://preferences.hey.xyz'
: 'http://localhost:8092';
export const CHANNELS_WORKER_URL = IS_PRODUCTION
? 'https://channels.lenster.xyz'
? 'https://channels.hey.xyz'
: 'http://localhost:8093';
export const ZORA_WORKER_URL = IS_PRODUCTION
? 'https://zora.lenster.xyz'
? 'https://zora.hey.xyz'
: 'http://localhost:8094';

// Tokens / Keys
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/achievements/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keep_vars = true
node_compat = true

routes = [
{ pattern = "achievements.lenster.xyz", custom_domain = true }
{ pattern = "achievements.hey.xyz", custom_domain = true }
]

[placement]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/channels/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keep_vars = true
node_compat = true

routes = [
{ pattern = "channels.lenster.xyz", custom_domain = true }
{ pattern = "channels.hey.xyz", custom_domain = true }
]

kv_namespaces = [
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/ens/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ compatibility_date = "2023-01-25"
keep_vars = true

routes = [
{ pattern = "ens.lenster.xyz", custom_domain = true }
{ pattern = "ens.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/feeds/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keep_vars = true
node_compat = true

routes = [
{ pattern = "feeds.lenster.xyz", custom_domain = true }
{ pattern = "feeds.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/freshdesk/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ compatibility_date = "2023-01-25"
keep_vars = true

routes = [
{ pattern = "freshdesk.lenster.xyz", custom_domain = true }
{ pattern = "freshdesk.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/invite/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keep_vars = true
node_compat = true

routes = [
{ pattern = "invite.lenster.xyz", custom_domain = true }
{ pattern = "invite.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/leafwatch/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keep_vars = true
node_compat = true

routes = [
{ pattern = "leafwatch.lenster.xyz", custom_domain = true }
{ pattern = "leafwatch.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/metadata/src/handlers/postMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default async (request: WorkerRequest) => {
const signer = new EthereumSigner(request.env.BUNDLR_PRIVATE_KEY);
if (payload.content?.length) {
try {
const aiEndpoint = 'https://ai.lenster.xyz';
const aiEndpoint = 'https://ai.hey.xyz';
const fetchPayload = {
method: 'POST',
headers: { 'content-type': 'application/json' },
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/metadata/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keep_vars = true
node_compat = true

routes = [
{ pattern = "metadata.lenster.xyz", custom_domain = true }
{ pattern = "metadata.hey.xyz", custom_domain = true }
]

[placement]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/oembed/src/helper/getProxyUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const getProxyUrl = (url: string, isLarge: boolean, env: Env) => {

const isProduction = env.WORKER_ENV === 'production';
const workerUrl = isProduction
? 'https://oembed.lenster.xyz'
? 'https://oembed.hey.xyz'
: 'http://localhost:8087';

return `${workerUrl}/image?hash=${encode(url)}&transform=${
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/oembed/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ compatibility_date = "2023-01-25"
keep_vars = true

routes = [
{ pattern = "oembed.lenster.xyz", custom_domain = true }
{ pattern = "oembed.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/preferences/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keep_vars = true
node_compat = true

routes = [
{ pattern = "preferences.lenster.xyz", custom_domain = true }
{ pattern = "preferences.hey.xyz", custom_domain = true }
]

kv_namespaces = [
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/prerender/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ async function handleRequest(request: Request) {
if (re.test(userAgent)) {
const url = new URL(request.url);
const path = url.pathname;
const res = await fetch(`https://prerender.lenster.xyz/${path}`);
const res = await fetch(`https://prerender.hey.xyz/${path}`);

return res;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/workers/prerender/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ main = "src/index.ts"
compatibility_date = "2023-01-25"

routes = [
{ pattern = "lenster.xyz/u/*", zone_name = "lenster.xyz" },
{ pattern = "lenster.xyz/posts/*", zone_name = "lenster.xyz" }
{ pattern = "hey.xyz/u/*", zone_name = "hey.xyz" },
{ pattern = "hey.xyz/posts/*", zone_name = "hey.xyz" }
]
2 changes: 1 addition & 1 deletion packages/workers/snapshot-relay/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keep_vars = true
node_compat = true

routes = [
{ pattern = "snapshot-relay.lenster.xyz", custom_domain = true }
{ pattern = "snapshot-relay.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/sts-generator/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ compatibility_date = "2023-01-25"
keep_vars = true

routes = [
{ pattern = "sts.lenster.xyz", custom_domain = true }
{ pattern = "sts.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/zora/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ compatibility_date = "2023-01-25"
keep_vars = true

routes = [
{ pattern = "zora.lenster.xyz", custom_domain = true }
{ pattern = "zora.hey.xyz", custom_domain = true }
]

[env.production.vars]
Expand Down

0 comments on commit 7c1d1d9

Please sign in to comment.