summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwuhei <wuhei@users.noreply.github.com>2026-11-20 15:49:14 +0100
committerwuhei <wuhei@users.noreply.github.com>2026-11-20 15:49:14 +0100
commit07ac2567dab0041ced22fde8fafbd4c7ae90da0e (patch)
treeef4bdc29f7195a27931e7889424dec487c9784b9
parent6f9aaf04904a5b1d455fae358d3f88cc1e5384ee (diff)
downloadlilchinese-07ac2567dab0041ced22fde8fafbd4c7ae90da0e.tar.gz
prepare for publication: MIT licence, no bundled third-party photo, tighter ignores
- the intro picture was press photography from a news site; it is no longer tracked (web/intro.jpg is gitignored) and scripts/fetch-intro.sh installs your own. The page drops the <img> if it 404s, so a fresh clone is just the red field and the title. - .gitignore now covers recorder output (mp4/mkv/webm/mov/m4v), the media files that land in the working directory during a talk (*.png/*.jpg/*.wav/*.mp3), models and session logs, so 'git add -A' cannot sweep them into a commit. - LICENSE: MIT for the code.
-rw-r--r--.gitignore27
-rw-r--r--LICENSE21
-rw-r--r--README.md16
-rwxr-xr-xscripts/fetch-intro.sh25
-rw-r--r--web/index.html5
5 files changed, 86 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 47da57a..d78536d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,28 @@
-/models/
+# build output
/lilchinese
+
+# models (fetched by scripts/)
+/models/
+
+# session logs written by Enter
+/sessions/
+
+# recordings written by -record
*.mp4
*.mkv
-/sessions/
+*.webm
+*.mov
+*.m4v
+
+# the optional intro picture: third-party, never committed
+/web/intro.jpg
+
+# whatever gets dropped in the working directory while working
+/*.png
+/*.jpg
+/*.jpeg
+/*.gif
+/*.webp
+/*.mp3
+/*.wav
+/*.flac
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..aa6eb7f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2026 wuhei
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README.md b/README.md
index a601c57..c836415 100644
--- a/README.md
+++ b/README.md
@@ -82,11 +82,18 @@ recognition: while the intro is up nothing is published, so the noise of setting
| `-intro` | `true` | show the intro and wait for Enter |
| `-intro-zh` | `批斗大会` | headline |
| `-intro-en` | `STRUGGLE SESSION` | subtitle |
-| `-intro-image` | `/intro.jpg` | picture; overwrite `web/intro.jpg` (or pass a URL/local path) to change it |
+| `-intro-image` | `/intro.jpg` | picture; put one in `web/intro.jpg` (rebuild) or serve it from anywhere |
-> `web/intro.jpg` is third-party press photography from secretchina.com, bundled here for
-> convenience. It is not covered by this project's licence — swap it for something you
-> have the rights to if the repo ever stops being private.
+The picture is **not** part of the repo — no such specific photo should be redistributed
+with source. Drop your own in place and rebuild, and the intro picks it up:
+
+```sh
+./scripts/fetch-intro.sh ~/pictures/whatever.jpg # or a URL
+go build -o lilchinese .
+```
+
+Without it the page is just the red field and the title, which is fine. Whatever you use
+is your responsibility licence-wise (`web/intro.jpg` is gitignored so it never gets committed).
## Session log (Enter)
@@ -215,6 +222,7 @@ go test ./... # slide cutting, colour alternation, cut, keep, log format, wi
## Layout
```
+LICENSE MIT (the code only — images and models are yours to source)
main.go mic → ASR → slide splitting → SSE, recorder, browser launch
log.go session log written by Enter
translate.go optional local MT: llama-server supervision, debounce, sticky EN line
diff --git a/scripts/fetch-intro.sh b/scripts/fetch-intro.sh
new file mode 100755
index 0000000..54db7a9
--- /dev/null
+++ b/scripts/fetch-intro.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# Installs a picture for the intro page: web/intro.jpg
+#
+# Nothing so specific is shipped with the repo — the page works with the title alone.
+# Give this script a local image (best) or a URL:
+#
+# ./scripts/fetch-intro.sh ~/pictures/session.jpg
+# ./scripts/fetch-intro.sh https://example.org/strug.jpg
+#
+# Whatever you choose must be yours to use: web/intro.jpg is not covered by this
+# project's licence, and it is gitignored so it never ends up in a commit.
+set -eu
+[ $# -ge 1 ] || { sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'; exit 1; }
+src=$1
+dest=web/intro.jpg
+case "$src" in
+ http://*|https://*)
+ curl -L --fail -A "Mozilla/5.0" -o "$dest" "$src"
+ ;;
+ *)
+ [ -f "$src" ] || { echo "no such file: $src" >&2; exit 1; }
+ cp "$src" "$dest"
+ ;;
+esac
+echo "installed $dest ($(wc -c <"$dest") bytes) — rebuild the binary to embed it"
diff --git a/web/index.html b/web/index.html
index e02159c..d176c2a 100644
--- a/web/index.html
+++ b/web/index.html
@@ -103,7 +103,7 @@
</head>
<body>
<div id="intro">
- <img id="intro-img" src="/intro.jpg" alt="">
+ <img id="intro-img" src="/intro.jpg" alt="" onerror="this.remove()">
<h1 id="intro-zh">批斗大会</h1>
<h2 id="intro-en">STRUGGLE SESSION</h2>
<div class="hint"><span class="key">&#9166;</span> Press enter to start</div>
@@ -241,7 +241,8 @@
function showIntro(cfg) {
document.getElementById('intro-zh').textContent = cfg.introZH || '';
document.getElementById('intro-en').textContent = cfg.introEN || '';
- const img = document.getElementById('intro-img');
+ const img = document.getElementById('intro-img'); // may already be gone (no picture)
+ if (!img) return;
if (cfg.introImg) img.src = cfg.introImg; else img.remove();
introEl.hidden = false;
introVisible = true;