Build the web UI into the .deb
- Package discover/dist to /usr/share/playlistd/discover, and serve it from there in the default config. cargo deb refuses to package if the UI hasn't been built, rather than shipping without it. - Install a pinned Node.js (22.23.4, checksum-verified) in the Containerfile; Ubuntu 22.04's is too old for Vite. The README's build command now builds the UI first. - Recommend yt-dlp, for playing suggested songs from YouTube. - If discover.ui points to a missing directory, warn instead of letting Rocket panic at startup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018opPJMJjLWr4RqdG6vuK6p
This commit is contained in:
5 files changed
+41
-10
No files matched your search
@@ -26,19 +26,25 @@ Build the image:
|
||||
podman build -t playlistd-22 -f Containerfile .
|
||||
```
|
||||
|
||||
Then build the `.deb`. The `sqlx` query macros check queries against a live, migrated database at
|
||||
compile time, so the host's Postgres socket is mounted into the container. With rootless podman, the
|
||||
container's root maps to your host user, so local peer authentication works without a password:
|
||||
Then build the web UI and the `.deb`. The `sqlx` query macros check queries against a live,
|
||||
migrated database at compile time, so the host's Postgres socket is mounted into the container. With
|
||||
rootless podman, the container's root maps to your host user, so local peer authentication works
|
||||
without a password:
|
||||
|
||||
```sh
|
||||
podman run --rm \
|
||||
-v "$PWD":/mnt -w /mnt \
|
||||
-v /var/run/postgresql:/var/run/postgresql \
|
||||
-e DATABASE_URL='postgres://jude@%2Fvar%2Frun%2Fpostgresql/playlistd' \
|
||||
playlistd-22 cargo deb
|
||||
playlistd-22 sh -c 'npm --prefix discover ci && npm --prefix discover run build && cargo deb'
|
||||
```
|
||||
|
||||
The package is written to `target/debian/`.
|
||||
The package is written to `target/debian/`. It installs the web UI to `/usr/share/playlistd/discover`,
|
||||
which the default config serves at `/`. `cargo deb` refuses to build the package if the UI hasn't been
|
||||
built.
|
||||
|
||||
The package recommends `yt-dlp`, for playing suggested songs from YouTube. Distribution packages of
|
||||
yt-dlp are often too old to work with YouTube, so you may want a current one instead, e.g. from pip.
|
||||
|
||||
### Logging
|
||||
|
||||
@@ -149,11 +155,12 @@ like a new song to keep it in "Liked new songs", or hide it so it isn't suggeste
|
||||
mix you've played recently) mixed in evenly, so that `familiar_ratio` of what you hear is familiar.
|
||||
If a mix has too few known songs to keep that ratio, all of them are used.
|
||||
|
||||
Build it with:
|
||||
The `.deb` includes it (see [Container build](#container-build-ubuntu-2204)). To run it from a
|
||||
checkout, build it with:
|
||||
|
||||
```sh
|
||||
cd discover
|
||||
npm install
|
||||
npm ci
|
||||
npm run build
|
||||
```
|
||||
|
||||
|
||||
Reference in new issue
Block a user