Skip to content

Commit 9b37dad

Browse files
authored
Generate / upload openwrt.meshtastic.org homepage (#93)
Generated from .github/openwrt-repo/README.md Move CSS to a shared stylesheet for the generated trees.
1 parent a78a3a1 commit 9b37dad

4 files changed

Lines changed: 240 additions & 112 deletions

File tree

‎.github/openwrt-repo/README.md‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,14 @@ For testing only. Please do not file issues about SNAPSHOT builds.
6666
echo "https://openwrt.meshtastic.org/main/$(cat /etc/apk/arch)/packages.adb" > /etc/apk/repositories.d/meshtastic.list
6767
wget https://openwrt.meshtastic.org/meshtastic-apk.pem -O /etc/apk/keys/meshtastic-apk.pem
6868
apk update
69-
```
69+
```
70+
71+
---
72+
73+
## Browse Repositories
74+
75+
- [SNAPSHOT](main)
76+
- [25.12](openwrt-25.12)
77+
- [24.10](openwrt-24.10)
78+
- [23.05](openwrt-23.05)
79+
- [22.03](openwrt-22.03)

‎.github/openwrt-repo/hintro.html‎

Lines changed: 2 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -7,116 +7,7 @@
77
<title>Meshtastic OpenWrt packages (%%WRT_VERSION%%)</title>
88
<meta name="description" content="APK and OPKG package feed for running Meshtastic on OpenWrt routers, built from the %%WRT_VERSION%% branch of meshtastic/openwrt.">
99
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -22.5 100 100'%3E%3Cg fill='rgb(103,234,148)' transform='matrix(0.802386,0,0,0.460028,-421.748,-122.127)'%3E%3Cpath transform='matrix(0.579082,0,0,1.01004,460.975,-39.6867)' d='M250.908,330.267L193.126,415.005L180.938,406.694L244.802,313.037C246.174,311.024 248.453,309.819 250.889,309.816C253.326,309.814 255.606,311.015 256.982,313.026L320.994,406.536L308.821,414.869L250.908,330.267Z'/%3E%3Cpath transform='matrix(0.582378,0,0,1.01579,485.019,-211.182)' d='M87.642,581.398L154.757,482.977L142.638,474.713L75.523,573.134L87.642,581.398Z'/%3E%3C/g%3E%3C/svg%3E">
10-
<style>
11-
:root {
12-
--bg: #ffffff;
13-
--panel: #fbfbfc;
14-
--fg: #2c2d3c;
15-
--muted: #6b6d80;
16-
--rule: #e3e4ea;
17-
--accent: #0f9d58;
18-
--logo: #2c2d3c;
19-
--notice-bg: #fff9e8;
20-
--notice-rule: #e8b931;
21-
}
22-
@media (prefers-color-scheme: dark) {
23-
:root {
24-
--bg: #1b1c26;
25-
--panel: #23242f;
26-
--fg: #e7e8ee;
27-
--muted: #9a9cb0;
28-
--rule: #32343f;
29-
--accent: #67ea94;
30-
--logo: #ffffff;
31-
--notice-bg: #2b2618;
32-
--notice-rule: #b9902a;
33-
}
34-
}
35-
* { box-sizing: border-box; }
36-
body {
37-
margin: 0;
38-
padding: 2.5rem 1.25rem 4rem;
39-
background: var(--bg);
40-
color: var(--fg);
41-
font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
42-
}
43-
main { max-width: 62rem; margin: 0 auto; }
44-
a { color: var(--accent); }
45-
header { display: flex; align-items: center; gap: 0.85rem; }
46-
header svg { width: 46px; height: auto; fill: var(--logo); flex: none; }
47-
h1 {
48-
margin: 0;
49-
font-size: 1.6rem;
50-
font-weight: 600;
51-
letter-spacing: -0.015em;
52-
line-height: 1.15;
53-
}
54-
h1 .sub {
55-
display: block;
56-
font-size: 0.82rem;
57-
font-weight: 500;
58-
letter-spacing: 0.12em;
59-
text-transform: uppercase;
60-
color: var(--accent);
61-
}
62-
.lede { margin: 1.5rem 0 0; max-width: 46rem; color: var(--muted); }
63-
code {
64-
padding: 0.1em 0.35em;
65-
background: var(--panel);
66-
border: 1px solid var(--rule);
67-
border-radius: 3px;
68-
font: 0.88em ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
69-
color: var(--fg);
70-
}
71-
dl.meta {
72-
display: grid;
73-
grid-template-columns: auto 1fr;
74-
gap: 0.3rem 1.25rem;
75-
margin: 1.5rem 0 0;
76-
font-size: 0.86rem;
77-
}
78-
dl.meta dt { color: var(--muted); }
79-
dl.meta dd {
80-
margin: 0;
81-
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
82-
}
83-
.notice {
84-
margin: 1.75rem 0 0;
85-
padding: 0.8rem 1rem;
86-
background: var(--notice-bg);
87-
border-left: 3px solid var(--notice-rule);
88-
border-radius: 0 4px 4px 0;
89-
font-size: 0.9rem;
90-
}
91-
h2 {
92-
margin: 2.5rem 0 0.75rem;
93-
font-size: 0.82rem;
94-
font-weight: 600;
95-
letter-spacing: 0.12em;
96-
text-transform: uppercase;
97-
color: var(--muted);
98-
}
99-
.tree {
100-
padding: 1rem 1.15rem;
101-
background: var(--panel);
102-
border: 1px solid var(--rule);
103-
border-radius: 6px;
104-
overflow-x: auto;
105-
white-space: nowrap;
106-
font: 12.5px/1.75 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
107-
color: var(--muted);
108-
}
109-
.tree a { color: var(--fg); text-decoration: none; }
110-
.tree a:hover { color: var(--accent); text-decoration: underline; }
111-
footer {
112-
margin: 2.5rem 0 0;
113-
padding-top: 1.25rem;
114-
border-top: 1px solid var(--rule);
115-
font-size: 0.85rem;
116-
color: var(--muted);
117-
}
118-
footer a { margin-right: 1.25rem; white-space: nowrap; }
119-
</style>
10+
<link rel="stylesheet" href="/style.css">
12011
</head>
12112
<body>
12213
<main>
@@ -149,5 +40,5 @@ <h1>Meshtastic<span class="sub">OpenWrt Package Feed</span></h1>
14940
<code>libustream-*</code> packages &mdash; before it can be reached.
15041
</p>
15142

152-
<h2>Files</h2>
43+
<h2 class="eyebrow">Files</h2>
15344
<div class="tree">

‎.github/openwrt-repo/style.css‎

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/* Shared styling for the Meshtastic OpenWrt package repository: the
2+
pandoc-rendered homepage and the tree-rendered directory indexes both link
3+
this file from the bucket root as /style.css. */
4+
5+
:root {
6+
--bg: #ffffff;
7+
--panel: #fbfbfc;
8+
--fg: #2c2d3c;
9+
--muted: #6b6d80;
10+
--rule: #e3e4ea;
11+
--accent: #0f9d58;
12+
--logo: #2c2d3c;
13+
--notice-bg: #fff9e8;
14+
--notice-rule: #e8b931;
15+
}
16+
@media (prefers-color-scheme: dark) {
17+
:root {
18+
--bg: #1b1c26;
19+
--panel: #23242f;
20+
--fg: #e7e8ee;
21+
--muted: #9a9cb0;
22+
--rule: #32343f;
23+
--accent: #67ea94;
24+
--logo: #ffffff;
25+
--notice-bg: #2b2618;
26+
--notice-rule: #b9902a;
27+
}
28+
}
29+
30+
* { box-sizing: border-box; }
31+
32+
body {
33+
margin: 0 auto;
34+
max-width: 62rem;
35+
padding: 2.5rem 1.25rem 4rem;
36+
background: var(--bg);
37+
color: var(--fg);
38+
font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
39+
}
40+
41+
a { color: var(--accent); }
42+
43+
/* Document elements: the homepage is a rendered README, so everything
44+
markdown can produce needs a rule here. */
45+
h1 {
46+
margin: 0 0 0.25rem;
47+
font-size: 1.6rem;
48+
font-weight: 600;
49+
letter-spacing: -0.015em;
50+
line-height: 1.15;
51+
}
52+
h2 {
53+
margin: 2.5rem 0 0.75rem;
54+
font-size: 1.15rem;
55+
font-weight: 600;
56+
letter-spacing: -0.01em;
57+
}
58+
h3 { margin: 2rem 0 0.5rem; font-size: 1rem; font-weight: 600; }
59+
h4, h5, h6 { margin: 1.5rem 0 0.5rem; font-size: 0.95rem; font-weight: 600; color: var(--muted); }
60+
p { margin: 0.9rem 0; }
61+
ul, ol { margin: 0.9rem 0; padding-left: 1.4rem; }
62+
li { margin: 0.2rem 0; }
63+
hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--rule); }
64+
blockquote {
65+
margin: 1rem 0;
66+
padding-left: 1rem;
67+
border-left: 3px solid var(--rule);
68+
color: var(--muted);
69+
}
70+
table { border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
71+
th, td { padding: 0.35rem 0.8rem; border-bottom: 1px solid var(--rule); text-align: left; }
72+
code {
73+
padding: 0.1em 0.35em;
74+
background: var(--panel);
75+
border: 1px solid var(--rule);
76+
border-radius: 3px;
77+
font: 0.88em ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
78+
color: var(--fg);
79+
}
80+
pre {
81+
margin: 1rem 0;
82+
padding: 1rem 1.15rem;
83+
background: var(--panel);
84+
border: 1px solid var(--rule);
85+
border-radius: 6px;
86+
overflow-x: auto;
87+
font: 12.5px/1.75 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
88+
color: var(--fg);
89+
}
90+
pre code { padding: 0; background: none; border: 0; font: inherit; }
91+
92+
/* Masthead: the logo row on the directory indexes. */
93+
header { display: flex; align-items: center; gap: 0.85rem; }
94+
header svg { width: 46px; height: auto; fill: var(--logo); flex: none; }
95+
header h1 { margin: 0; }
96+
h1 .sub {
97+
display: block;
98+
font-size: 0.82rem;
99+
font-weight: 500;
100+
letter-spacing: 0.12em;
101+
text-transform: uppercase;
102+
color: var(--accent);
103+
}
104+
105+
/* Directory index pieces. */
106+
.lede { margin: 1.5rem 0 0; max-width: 46rem; color: var(--muted); }
107+
dl.meta {
108+
display: grid;
109+
grid-template-columns: auto 1fr;
110+
gap: 0.3rem 1.25rem;
111+
margin: 1.5rem 0 0;
112+
font-size: 0.86rem;
113+
}
114+
dl.meta dt { color: var(--muted); }
115+
dl.meta dd {
116+
margin: 0;
117+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
118+
}
119+
.notice {
120+
margin: 1.75rem 0 0;
121+
padding: 0.8rem 1rem;
122+
background: var(--notice-bg);
123+
border-left: 3px solid var(--notice-rule);
124+
border-radius: 0 4px 4px 0;
125+
font-size: 0.9rem;
126+
}
127+
.eyebrow {
128+
margin: 2.5rem 0 0.75rem;
129+
font-size: 0.82rem;
130+
font-weight: 600;
131+
letter-spacing: 0.12em;
132+
text-transform: uppercase;
133+
color: var(--muted);
134+
}
135+
.tree {
136+
padding: 1rem 1.15rem;
137+
background: var(--panel);
138+
border: 1px solid var(--rule);
139+
border-radius: 6px;
140+
overflow-x: auto;
141+
white-space: nowrap;
142+
font: 12.5px/1.75 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
143+
color: var(--muted);
144+
}
145+
.tree a { color: var(--fg); text-decoration: none; }
146+
.tree a:hover { color: var(--accent); text-decoration: underline; }
147+
148+
footer {
149+
margin: 2.5rem 0 0;
150+
padding-top: 1.25rem;
151+
border-top: 1px solid var(--rule);
152+
font-size: 0.85rem;
153+
color: var(--muted);
154+
}
155+
footer a { margin-right: 1.25rem; white-space: nowrap; }

‎.github/workflows/repo-page.yml‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Generate R2 Homepage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- .github/openwrt-repo/README.md
9+
- .github/openwrt-repo/*.css
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
generate-homepage:
17+
runs-on: ubuntu-26.04
18+
concurrency:
19+
# Only run one deploy at a time
20+
group: publish-r2-homepage
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v7
24+
with:
25+
sparse-checkout: |
26+
.github/openwrt-repo
27+
28+
- name: Install pandoc
29+
uses: pandoc/actions/setup@v1
30+
31+
# The homepage and the package indexes share style.css, so pandoc's own
32+
# stylesheet is switched off (document-css) and ours is linked instead.
33+
# pagetitle sets <title> without pandoc adding a title block above the
34+
# README's own heading.
35+
- name: Generate homepage
36+
working-directory: .github/openwrt-repo
37+
run: >
38+
pandoc README.md
39+
-t html5
40+
--standalone
41+
--syntax-highlighting=none
42+
--metadata pagetitle="Meshtastic OpenWrt Repo"
43+
--css /style.css
44+
-o index.html
45+
46+
- name: Upload packages to Cloudflare R2
47+
env:
48+
r2_bucket: meshtastic-openwrt-repo
49+
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
50+
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
51+
# R2 is single-region; the S3 API still requires a region to be set.
52+
AWS_DEFAULT_REGION: auto
53+
# Cloudflare's documented aws-cli settings for R2. Left at the AWS
54+
# default, CLI >= 2.23 attaches CRC32 request checksums that R2 can
55+
# reject, so both of these must stay at when_required.
56+
AWS_REQUEST_CHECKSUM_CALCULATION: when_required
57+
AWS_RESPONSE_CHECKSUM_VALIDATION: when_required
58+
R2_ENDPOINT: https://${{ secrets.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com
59+
working-directory: .github/openwrt-repo
60+
run: |
61+
set -euo pipefail
62+
aws --version
63+
r2_sync() {
64+
aws s3 sync "./" "s3://${r2_bucket}/" \
65+
--endpoint-url "$R2_ENDPOINT" \
66+
--no-progress \
67+
--metadata "commit=${{ github.sha }},run=${{ github.run_id }}" \
68+
"$@"
69+
}
70+
# Homepage doesn't change often, cache for 1 day in browser and 1 week on the CDN.
71+
r2_sync --cache-control 'public, max-age=86400, s-maxage=604800' \
72+
--exclude 'hintro.html' --exclude 'houtro.html' --exclude 'README.md'

0 commit comments

Comments
 (0)