Skip to content

Commit a438b7c

Browse files
authored
Merge pull request ghostunnel#685 from ghostunnel/cs/website-2
Website design and language tweaks
2 parents 81edbf2 + 682b852 commit a438b7c

7 files changed

Lines changed: 256 additions & 34 deletions

File tree

magefile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,5 +1167,5 @@ func (Website) Build(ctx context.Context) error {
11671167
// Requires Hugo to be installed.
11681168
func (Website) Serve(ctx context.Context) error {
11691169
mg.CtxDeps(ctx, Website.Build)
1170-
return sh.Run("hugo", "server", "--source", "website")
1170+
return sh.RunV("hugo", "server", "--source", "website")
11711171
}

website/content/_index.md

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,57 +34,55 @@ socket.
3434
Ghostunnel also supports UNIX domain sockets, PROXY protocol v2, systemd/launchd
3535
socket activation, and more. See the [documentation](docs/) for details.
3636

37-
## Quick Start
37+
## Install
3838

39-
Start a Ghostunnel in server mode to proxy TLS connections to a backend:
39+
Pre-built binaries for Linux, macOS, and Windows are available under [Releases](/releases).
40+
41+
Via Homebrew:
4042

4143
```bash
42-
ghostunnel server \
43-
--listen localhost:8443 \
44-
--target localhost:8080 \
45-
--keystore server-keystore.p12 \
46-
--cacert cacert.pem \
47-
--allow-cn client
44+
brew install ghostunnel
4845
```
4946

50-
Start a Ghostunnel in client mode to wrap connections in TLS:
47+
Via Docker (see [Docker Hub](https://hub.docker.com/r/ghostunnel/ghostunnel) for all
48+
available tags):
5149

5250
```bash
53-
ghostunnel client \
54-
--listen localhost:8080 \
55-
--target localhost:8443 \
56-
--keystore client-combined.pem \
57-
--cacert cacert.pem
51+
docker pull ghostunnel/ghostunnel:latest-distroless # Distroless (recommended)
52+
docker pull ghostunnel/ghostunnel:latest-alpine # Alpine
53+
docker pull ghostunnel/ghostunnel:latest-debian # Debian
5854
```
5955

60-
## Install
61-
62-
Pre-built binaries for Linux, macOS, and Windows are available on
63-
[GitHub Releases](https://github.com/ghostunnel/ghostunnel/releases)
64-
([latest](https://github.com/ghostunnel/ghostunnel/releases/latest)).
65-
66-
Via Homebrew:
56+
Compile from source (replace `VERSION` with a [release tag](https://github.com/ghostunnel/ghostunnel/releases)):
6757

6858
```bash
69-
brew install ghostunnel
59+
go install github.com/ghostunnel/ghostunnel@VERSION
7060
```
7161

72-
Via Go (replace `VERSION` with a [release tag](https://github.com/ghostunnel/ghostunnel/releases)):
62+
## Usage
63+
64+
Start a Ghostunnel in server mode to proxy TLS connections to a backend:
7365

7466
```bash
75-
go install github.com/ghostunnel/ghostunnel@VERSION
67+
ghostunnel server \
68+
--listen :8443 \
69+
--target localhost:8080 \
70+
--keystore server-keystore.p12 \
71+
--cacert cacert.pem \
72+
--allow-cn client
7673
```
7774

78-
Via Docker:
75+
Start a Ghostunnel in client mode to wrap connections in TLS:
7976

8077
```bash
81-
docker pull ghostunnel/ghostunnel:latest-distroless # Distroless (recommended)
82-
docker pull ghostunnel/ghostunnel:latest-alpine # Alpine
83-
docker pull ghostunnel/ghostunnel:latest-debian # Debian
78+
ghostunnel client \
79+
--listen localhost:8080 \
80+
--target example.com:8443 \
81+
--keystore client-combined.pem \
82+
--cacert cacert.pem
8483
```
8584

86-
See [Docker Hub](https://hub.docker.com/r/ghostunnel/ghostunnel) for all
87-
available tags.
85+
See [Docs](/docs) for more in-depth usage information.
8886

8987
## Supported Platforms
9088

website/data/binaries.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Binary assets available on GitHub Releases, grouped by the version
2+
# range in which each set of binaries was first published.
3+
#
4+
# "from" is inclusive. Each entry's assets apply to all releases from
5+
# that version onward, until overridden by a later entry. Entries
6+
# must be ordered oldest-first.
7+
8+
- from: "v1.7.1"
9+
assets:
10+
- { os: "Linux", arch: "x86_64", file: "ghostunnel-linux-amd64" }
11+
- { os: "Linux", arch: "ARM64", file: "ghostunnel-linux-arm64" }
12+
- { os: "macOS", arch: "x86_64", file: "ghostunnel-darwin-amd64" }
13+
- { os: "macOS", arch: "ARM64", file: "ghostunnel-darwin-arm64" }
14+
- { os: "macOS", arch: "Universal", file: "ghostunnel-darwin-universal" }
15+
- { os: "Windows", arch: "x86_64", file: "ghostunnel-windows-amd64.exe" }

website/hugo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enableGitInfo = true
1111
[[module.mounts]]
1212
source = "../docs"
1313
target = "content/docs"
14-
excludeFiles = ["spiffe-workload-api-demo/**", "*.tmpl"]
14+
files = ["! spiffe-workload-api-demo/**", "! *.tmpl"]
1515
[[module.mounts]]
1616
source = "../releases"
1717
target = "content/releases"

website/layouts/_default/list.html

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>
1818
{{ else if eq .Section "releases" }}
1919
<article class="content">
2020
<h1>{{ .Title }}</h1>
21-
<p>All releases of Ghostunnel, in reverse chronological order. Pre-built binaries are available on <a href="https://github.com/ghostunnel/ghostunnel/releases">GitHub Releases</a> and Docker images can be found on <a href="https://hub.docker.com/r/ghostunnel/ghostunnel">Docker Hub</a>.</p>
21+
<p>All releases of Ghostunnel, in reverse chronological order. Pre-built binaries are available on <a href="https://github.com/ghostunnel/ghostunnel/releases">GitHub Releases</a> (linked below) and Docker images can be found on <a href="https://hub.docker.com/r/ghostunnel/ghostunnel">Docker Hub</a>.</p>
2222
{{ $pages := .Pages.ByDate.Reverse }}
2323
{{ range $i, $p := $pages }}
24+
{{ if eq $i 1 }}
25+
<div id="older-releases" class="older-releases" hidden>
26+
{{ end }}
2427
<div class="release-entry" id="{{ $p.Title }}">
2528
<div class="release-header">
2629
<h2>{{ $p.Title }}</h2>
@@ -41,7 +44,26 @@ <h2>{{ $p.Title }}</h2>
4144
<p class="release-changelog"><a href="https://github.com/ghostunnel/ghostunnel/compare/{{ $prev.Title }}...{{ $p.Title }}">Full Changelog: {{ $prev.Title }}...{{ $p.Title }}</a></p>
4245
{{ end }}
4346
</div>
47+
{{ if eq $i 0 }}
48+
<div class="release-downloads">
49+
<div class="download-bar">
50+
<span class="download-label">Downloads</span>
51+
<span class="download-items">
52+
<a class="download-link" href="https://github.com/ghostunnel/ghostunnel/releases/download/{{ $p.Title }}/ghostunnel-linux-amd64"><span class="download-os">Linux</span> <span class="download-arch">x86_64</span></a>
53+
<a class="download-link" href="https://github.com/ghostunnel/ghostunnel/releases/download/{{ $p.Title }}/ghostunnel-linux-arm64"><span class="download-os">Linux</span> <span class="download-arch">ARM64</span></a>
54+
<a class="download-link" href="https://github.com/ghostunnel/ghostunnel/releases/download/{{ $p.Title }}/ghostunnel-darwin-amd64"><span class="download-os">macOS</span> <span class="download-arch">x86_64</span></a>
55+
<a class="download-link" href="https://github.com/ghostunnel/ghostunnel/releases/download/{{ $p.Title }}/ghostunnel-darwin-arm64"><span class="download-os">macOS</span> <span class="download-arch">ARM64</span></a>
56+
<a class="download-link" href="https://github.com/ghostunnel/ghostunnel/releases/download/{{ $p.Title }}/ghostunnel-darwin-universal"><span class="download-os">macOS</span> <span class="download-arch">Universal</span></a>
57+
<a class="download-link" href="https://github.com/ghostunnel/ghostunnel/releases/download/{{ $p.Title }}/ghostunnel-windows-amd64.exe"><span class="download-os">Windows</span> <span class="download-arch">x86_64</span></a>
58+
</span>
59+
</div>
60+
</div>
61+
{{ end }}
62+
</div>
63+
{{ end }}
64+
{{ if gt (len $pages) 1 }}
4465
</div>
66+
<button class="show-all-releases" onclick="var el=document.getElementById('older-releases');el.hidden=!el.hidden;this.textContent=el.hidden?'Show all releases ({{ sub (len $pages) 1 }} more)':'Show fewer releases';">Show all releases ({{ sub (len $pages) 1 }} more)</button>
4567
{{ end }}
4668
</article>
4769
{{ else }}

website/static/css/style.css

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,17 +547,31 @@ a:hover {
547547
gap: 0.25rem;
548548
}
549549

550+
.content {
551+
max-width: 100%;
552+
overflow-x: hidden;
553+
}
554+
550555
.content table {
551556
display: block;
552557
overflow-x: auto;
553558
-webkit-overflow-scrolling: touch;
554-
white-space: nowrap;
555559
}
556560

557561
.content th,
558562
.content td {
559563
padding: 0.35rem 0.5rem;
560564
font-size: 0.8rem;
565+
min-width: 5rem;
566+
}
567+
568+
.content pre {
569+
max-width: calc(100vw - 2rem);
570+
}
571+
572+
.content td code,
573+
.content th code {
574+
word-break: break-all;
561575
}
562576
}
563577

@@ -654,6 +668,90 @@ a:hover {
654668
font-size: 0.85rem;
655669
}
656670

671+
/* =============================================
672+
Show all releases
673+
============================================= */
674+
.show-all-releases {
675+
display: inline;
676+
background: none;
677+
border: none;
678+
padding: 0;
679+
color: var(--link);
680+
font-size: 0.9rem;
681+
font-weight: 400;
682+
cursor: pointer;
683+
transition: color 0.15s ease;
684+
}
685+
686+
.show-all-releases:hover {
687+
color: var(--link-hover);
688+
text-decoration: underline;
689+
}
690+
691+
/* =============================================
692+
Release downloads
693+
============================================= */
694+
.download-bar {
695+
display: flex;
696+
align-items: center;
697+
gap: 0.75rem;
698+
padding: 0.6rem 1.25rem;
699+
border-top: 1px solid var(--border);
700+
background: var(--frost);
701+
font-size: 0.82rem;
702+
}
703+
704+
.download-label {
705+
color: var(--text-muted);
706+
font-weight: 600;
707+
font-size: 0.7rem;
708+
text-transform: uppercase;
709+
letter-spacing: 0.06em;
710+
flex-shrink: 0;
711+
}
712+
713+
.download-items {
714+
display: flex;
715+
flex-wrap: wrap;
716+
gap: 0.4rem;
717+
}
718+
719+
.download-link {
720+
display: inline-flex;
721+
align-items: center;
722+
gap: 0.35rem;
723+
padding: 0.2rem 0.6rem;
724+
border: 1px solid var(--border);
725+
border-radius: 5px;
726+
background: var(--bg-card);
727+
color: var(--text);
728+
font-size: 0.78rem;
729+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
730+
}
731+
732+
.download-link:hover {
733+
border-color: var(--accent);
734+
box-shadow: var(--shadow-sm);
735+
text-decoration: none;
736+
color: var(--accent);
737+
}
738+
739+
.download-os {
740+
font-weight: 600;
741+
}
742+
743+
.download-arch {
744+
color: var(--text-muted);
745+
}
746+
747+
@media (max-width: 600px) {
748+
.download-bar {
749+
flex-direction: column;
750+
align-items: flex-start;
751+
gap: 0.4rem;
752+
}
753+
}
754+
657755
/* =============================================
658756
Release meta
659757
============================================= */
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
(function () {
2+
var API_URL =
3+
"https://api.github.com/repos/ghostunnel/ghostunnel/releases?per_page=100";
4+
5+
var OS_LABELS = {
6+
linux: "Linux",
7+
darwin: "macOS",
8+
windows: "Windows",
9+
};
10+
11+
var ARCH_LABELS = {
12+
amd64: "x86_64",
13+
arm64: "ARM64",
14+
universal: "Universal",
15+
};
16+
17+
function parseAssetName(name) {
18+
// Expected: ghostunnel-{os}-{arch}[.exe]
19+
var m = name.match(/^ghostunnel-(\w+)-(\w+?)(\.exe)?$/);
20+
if (!m) return null;
21+
return { os: m[1], arch: m[2], exe: !!m[3] };
22+
}
23+
24+
function renderDownloads(container, assets) {
25+
// Group by OS
26+
var byOS = {};
27+
assets.forEach(function (a) {
28+
var info = parseAssetName(a.name);
29+
if (!info) return;
30+
if (!byOS[info.os]) byOS[info.os] = [];
31+
byOS[info.os].push({ info: info, url: a.browser_download_url, name: a.name, size: a.size });
32+
});
33+
34+
var osOrder = ["linux", "darwin", "windows"];
35+
var items = [];
36+
37+
osOrder.forEach(function (os) {
38+
if (!byOS[os]) return;
39+
byOS[os].forEach(function (asset) {
40+
var label = OS_LABELS[asset.info.os] || asset.info.os;
41+
var arch = ARCH_LABELS[asset.info.arch] || asset.info.arch;
42+
var sizeMB = (asset.size / (1024 * 1024)).toFixed(1);
43+
items.push(
44+
'<a class="download-link" href="' + asset.url + '" title="' + asset.name + '">' +
45+
'<span class="download-os">' + label + '</span> ' +
46+
'<span class="download-arch">' + arch + '</span>' +
47+
'<span class="download-size">' + sizeMB + ' MB</span>' +
48+
"</a>"
49+
);
50+
});
51+
});
52+
53+
if (items.length === 0) return;
54+
55+
container.innerHTML =
56+
'<div class="download-bar">' +
57+
'<span class="download-label">Downloads</span>' +
58+
'<span class="download-items">' + items.join("") + '</span>' +
59+
"</div>";
60+
}
61+
62+
function populate(releases) {
63+
var tagMap = {};
64+
releases.forEach(function (r) {
65+
if (r.assets && r.assets.length > 0) {
66+
tagMap[r.tag_name] = r.assets;
67+
}
68+
});
69+
70+
var containers = document.querySelectorAll(".release-downloads[data-tag]");
71+
containers.forEach(function (el) {
72+
var tag = el.getAttribute("data-tag");
73+
if (tagMap[tag]) {
74+
renderDownloads(el, tagMap[tag]);
75+
}
76+
});
77+
}
78+
79+
// Fetch all releases (up to 100, which covers all current releases)
80+
fetch(API_URL)
81+
.then(function (res) {
82+
if (!res.ok) return [];
83+
return res.json();
84+
})
85+
.then(populate)
86+
.catch(function () {
87+
// Silently fail — GitHub/Docker links in the header are the fallback
88+
});
89+
})();

0 commit comments

Comments
 (0)