Skip to content

Commit 35032a2

Browse files
dorlugasigalCopilot
andcommitted
chore(site): drop Cloudflare Pages, ship docs site only via GitHub Pages
Cloudflare Pages edge has been silently dropping TLS handshakes for *.termbeam.pages.dev (production, branch alias, and immutable per-deploy aliases all return ERR_SOCKET_NOT_CONNECTED) while wrangler still reports successful deploys. Rather than chase Cloudflare support, retire that target and standardize on the GitHub Pages mirror, which is healthy. - site.yml: remove matrix, Cloudflare artifact upload, and the deploy-cloudflare-pages job; site now builds and deploys once via actions/deploy-pages. - astro.config.mjs: drop CF_PAGES / DEPLOY_TARGET detection; hardcode GitHub Pages site + /TermBeam base. - package.json: homepage -> https://dorlugasigal.github.io/TermBeam. - README + AboutModal: drop the duplicate "Website" link that pointed at termbeam.pages.dev (unified site, "Docs" now covers both). - Frontend manifest, index.html, server login page: PWA / apple-touch icons switch from absolute https://termbeam.pages.dev/icons/... URLs to relative /icons/... (already served by the TermBeam server itself, no CDN dependency needed). - CSP: drop the now-unused https://termbeam.pages.dev allowlist entry from img-src. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0ee0976 commit 35032a2

9 files changed

Lines changed: 15 additions & 87 deletions

File tree

.github/workflows/site.yml

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ concurrency:
2222
jobs:
2323
build:
2424
runs-on: ubuntu-latest
25-
strategy:
26-
matrix:
27-
target:
28-
- name: github-pages
29-
deploy_target: ''
30-
site_url: ''
31-
- name: cloudflare
32-
deploy_target: cloudflare
33-
site_url: https://termbeam.pages.dev
3425
defaults:
3526
run:
3627
working-directory: packages/site
@@ -44,23 +35,13 @@ jobs:
4435
- name: Install dependencies
4536
run: npm ci
4637
- name: Build with Astro
47-
env:
48-
DEPLOY_TARGET: ${{ matrix.target.deploy_target }}
49-
SITE_URL: ${{ matrix.target.site_url }}
5038
run: npm run build
5139
- name: Upload Pages artifact
52-
if: matrix.target.name == 'github-pages'
5340
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
5441
with:
5542
path: packages/site/dist
56-
- name: Upload Cloudflare artifact
57-
if: matrix.target.name == 'cloudflare'
58-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
59-
with:
60-
name: cloudflare-dist
61-
path: packages/site/dist
6243

63-
deploy-github-pages:
44+
deploy:
6445
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
6546
needs: build
6647
runs-on: ubuntu-latest
@@ -75,30 +56,3 @@ jobs:
7556
- name: Deploy to GitHub Pages
7657
id: deploy
7758
uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
78-
79-
deploy-cloudflare-pages:
80-
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
81-
needs: build
82-
runs-on: ubuntu-latest
83-
permissions:
84-
contents: read
85-
deployments: write
86-
environment:
87-
name: cloudflare-pages
88-
url: https://termbeam.pages.dev
89-
steps:
90-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
91-
with:
92-
sparse-checkout: packages/site
93-
- name: Download Cloudflare build
94-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
95-
with:
96-
name: cloudflare-dist
97-
path: packages/site/dist
98-
- name: Deploy to Cloudflare Pages
99-
uses: cloudflare/wrangler-action@9acf94ace14e7dc412b076f2c5c20b8ce93c79cd # v3
100-
with:
101-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
102-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
103-
workingDirectory: packages/site
104-
command: pages deploy dist --project-name=termbeam --branch=main

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
TermBeam lets you access your terminal from a phone, tablet, or any browser — no SSH, no port forwarding, no configuration needed. Run one command and scan the QR code.
1818

19-
[Full documentation](https://dorlugasigal.github.io/TermBeam/) · [Website](https://termbeam.pages.dev)
19+
[Full documentation](https://dorlugasigal.github.io/TermBeam/)
2020

2121
https://github.com/user-attachments/assets/9dd4f3d7-f017-4314-9b3a-f6a5688e3671
2222

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
],
4040
"author": "Dor Lugasi <dorlugasigal@gmail.com>",
4141
"license": "MIT",
42-
"homepage": "https://termbeam.pages.dev",
42+
"homepage": "https://dorlugasigal.github.io/TermBeam",
4343
"repository": {
4444
"type": "git",
4545
"url": "https://github.com/dorlugasigal/TermBeam.git"

packages/site/astro.config.mjs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@
22
import { defineConfig } from 'astro/config';
33
import starlight from '@astrojs/starlight';
44

5-
// Build target is driven by env so the same source can ship to multiple hosts:
6-
// default: GitHub Pages — base /TermBeam, site dorlugasigal.github.io
7-
// Cloudflare Pages: detected automatically via CF_PAGES=1 (set by Cloudflare's
8-
// Git integration during builds) OR explicitly via DEPLOY_TARGET=cloudflare.
9-
// Base /, site from CF_PAGES_URL (set by Cloudflare) or SITE_URL.
10-
const explicitTarget = process.env.DEPLOY_TARGET;
11-
const isCF = explicitTarget === 'cloudflare' || process.env.CF_PAGES === '1';
12-
13-
const site = isCF
14-
? process.env.SITE_URL || process.env.CF_PAGES_URL || 'https://termbeam.pages.dev'
15-
: 'https://dorlugasigal.github.io';
16-
const base = isCF ? '/' : '/TermBeam';
17-
const ogImage = `${site.replace(/\/$/, '')}${base === '/' ? '' : base}/og-image.png`;
5+
const site = 'https://dorlugasigal.github.io';
6+
const base = '/TermBeam';
7+
const ogImage = `${site}${base}/og-image.png`;
188

199
// https://astro.build/config
2010
export default defineConfig({

src/frontend/index.html

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@
1111
<meta name="mobile-web-app-capable" content="yes" />
1212
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
1313
<link rel="icon" type="image/png" href="/icons/icon-192.png" />
14-
<link
15-
rel="apple-touch-icon"
16-
sizes="180x180"
17-
href="https://termbeam.pages.dev/icons/icon-180.png"
18-
/>
19-
<link
20-
rel="apple-touch-icon"
21-
sizes="192x192"
22-
href="https://termbeam.pages.dev/icons/icon-192.png"
23-
/>
14+
<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180.png" />
15+
<link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192.png" />
2416
<link rel="manifest" href="/manifest.webmanifest" />
2517
<title>TermBeam</title>
2618
<script>

src/frontend/src/components/Modals/AboutModal.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,6 @@ export function AboutModal({ open, onClose, version }: AboutModalProps) {
9595
>
9696
Docs
9797
</a>
98-
<a
99-
href="https://termbeam.pages.dev"
100-
target="_blank"
101-
rel="noopener noreferrer"
102-
style={{ color: 'var(--accent)', fontSize: '0.9rem' }}
103-
>
104-
Website
105-
</a>
10698
</div>
10799

108100
<div className={styles.actions} style={{ justifyContent: 'flex-start' }}>

src/frontend/vite.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ export default defineConfig({
2525
theme_color: '#1e1e1e',
2626
icons: [
2727
{
28-
src: 'https://termbeam.pages.dev/icons/icon-180.png',
28+
src: '/icons/icon-180.png',
2929
sizes: '180x180',
3030
type: 'image/png',
3131
},
3232
{
33-
src: 'https://termbeam.pages.dev/icons/icon-192.png',
33+
src: '/icons/icon-192.png',
3434
sizes: '192x192',
3535
type: 'image/png',
3636
},
3737
{
38-
src: 'https://termbeam.pages.dev/icons/icon-512.png',
38+
src: '/icons/icon-512.png',
3939
sizes: '512x512',
4040
type: 'image/png',
4141
},
4242
{
43-
src: 'https://termbeam.pages.dev/icons/icon-512.png',
43+
src: '/icons/icon-512.png',
4444
sizes: '512x512',
4545
type: 'image/png',
4646
purpose: 'any maskable',

src/server/auth.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const LOGIN_HTML = `<!DOCTYPE html>
1010
<meta name="mobile-web-app-capable" content="yes" />
1111
<meta name="theme-color" content="#1e1e1e" />
1212
<link rel="icon" type="image/png" href="/icons/icon-192.png" />
13-
<link rel="apple-touch-icon" sizes="180x180" href="https://termbeam.pages.dev/icons/icon-180.png" />
14-
<link rel="apple-touch-icon" sizes="192x192" href="https://termbeam.pages.dev/icons/icon-192.png" />
13+
<link rel="apple-touch-icon" sizes="180x180" href="/icons/icon-180.png" />
14+
<link rel="apple-touch-icon" sizes="192x192" href="/icons/icon-192.png" />
1515
<link rel="manifest" href="/manifest.webmanifest" />
1616
<title>TermBeam — Login</title>
1717
<style>

src/server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function createTermBeamServer(overrides = {}) {
9999
res.setHeader('Cache-Control', isPwaAsset ? 'public, max-age=86400' : 'no-store');
100100
res.setHeader(
101101
'Content-Security-Policy',
102-
"default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; img-src 'self' data: https://img.shields.io https://github.com https://raw.githubusercontent.com https://avatars.githubusercontent.com https://api.securityscorecards.dev https://termbeam.pages.dev; connect-src 'self' ws: wss: https://cdn.jsdelivr.net; font-src 'self' https://cdn.jsdelivr.net",
102+
"default-src 'self'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; img-src 'self' data: https://img.shields.io https://github.com https://raw.githubusercontent.com https://avatars.githubusercontent.com https://api.securityscorecards.dev; connect-src 'self' ws: wss: https://cdn.jsdelivr.net; font-src 'self' https://cdn.jsdelivr.net",
103103
);
104104
next();
105105
});

0 commit comments

Comments
 (0)