Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/rt-cef/src/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ use crate::shell;

const TEMPLATE: &str = include_str!("../ui/editor.html");
const BUNDLE: &str = include_str!("../ui/editor.bundle.js");
/// The bundle's license notices, served at `riptide://licenses/`.
pub const LICENSES: &str = include_str!("../ui/editor.bundle.LICENSES.txt");

/// The page around its data: built once, since the bundle is large.
static PARTS: LazyLock<(String, String)> = LazyLock::new(|| {
Expand Down
1 change: 1 addition & 0 deletions crates/rt-cef/src/scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ fn page(host: &str, path: &str, private: bool) -> Option<(Arc<[u8]>, &'static st
("settings", "/") => Some((themed(crate::settings_page::page()), html)),
("process", "/") => Some((crate::spawn::output_page(), html)),
("edit", path) => Some((themed(crate::edit::page(path)), html)),
("licenses", "/") => Some((Arc::from(crate::edit::LICENSES.as_bytes()), "text/plain")),
_ => None,
}
}
Expand Down
5 changes: 5 additions & 0 deletions crates/rt-e2e/tests/internal_pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ fn changelog_history_and_downloads_pages_open() {
b.run(command);
b.wait_until(&format!(":{command} opens"), |s| s.tab().title == title);
}
b.run("open riptide://licenses/");
b.wait_eval(
"String(document.body.innerText.includes('@replit/codemirror-vim'))",
"true",
);
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/dev/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Commits follow [Conventional Commits](https://www.conventionalcommits.org), whic

- `./task check` runs everything CI does: the [linters](testing.md#linters), unit tests, the e2e tests and the smoke test.
- Generated files must be current: `UPDATE_LUA_TYPES=1 cargo test -p rt-config` rewrites `docs/lua/rt.meta.lua`, `docs/settings.md` and the generated reference pages after you add or change a command, setting or default binding.
- The editor page's bundle, `crates/rt-cef/ui/editor.bundle.js`, and its license notices are built from `crates/rt-cef/editor/` by `scripts/update-editor-bundle.sh`. Run it after changing `editor/main.js` or its packages (`--latest` updates them), and commit the result.
- The editor page's bundle, `crates/rt-cef/ui/editor.bundle.js`, and its license notices are built from `crates/rt-cef/editor/` by `scripts/update-editor-bundle.sh`. Run it after changing `editor/main.js` or its packages (`--latest` updates them), and commit the result. The notices, `ui/editor.bundle.LICENSES.txt`, are served at `riptide://licenses/` and shipped in every package as `THIRD-PARTY-LICENSES.txt`.
- User-visible changes need documentation in the same change; see [Writing documentation](docs.md).
1 change: 1 addition & 0 deletions docs/book/src/guide/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ The header shows the path, a dot when there are unwritten changes, and the resul
- Files must be UTF-8 text and at most 8 MB.
- Windows line endings (`\r\n`) are kept as they are.
- Syntax highlighting covers Rust, JavaScript and TypeScript, Python, Go, C and C++, Java, HTML, CSS, JSON, YAML, TOML, Markdown, SQL, XML, Lua, shell scripts, Dockerfiles and INI-style config files. Anything else is plain text.
- The editor is built on [CodeMirror](https://codemirror.net/) and its vim mode. Their licenses are at `riptide://licenses/`, and in `THIRD-PARTY-LICENSES.txt` next to the `riptide` binary in release packages.
- `:open-editor` and `:config-edit` are separate: they still open `editor.command`, your own editor program, in its own window.
2 changes: 1 addition & 1 deletion docs/book/src/guide/terminal.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ The browser listens on a Unix socket in `$XDG_RUNTIME_DIR/riptide/` (or the data

The tab bar, status bar and overlay are HTML pages served from the browser itself at `riptide://ui/…`. Web pages can't link to, frame or redirect to `riptide://` addresses, and only riptide's own pages get the `rt.send()` channel to Rust. The browser accepts only the messages each page is allowed to send.

Pages you can open: `riptide://help/` (`:help`), `riptide://history/` (`:history`), `riptide://downloads/` (`:downloads`), `riptide://settings/` (`:settings`), `riptide://changelog/` (`:changelog`) and `riptide://edit/<path>` ([`:edit`](editor.md)). The first start after an update opens the changelog in a background tab when the version's minor or major number changed; `changelog_after_upgrade` (`major`, `minor`, `patch` or `never`) sets how big a step that takes.
Pages you can open: `riptide://help/` (`:help`), `riptide://history/` (`:history`), `riptide://downloads/` (`:downloads`), `riptide://settings/` (`:settings`), `riptide://changelog/` (`:changelog`), `riptide://edit/<path>` ([`:edit`](editor.md)) and `riptide://licenses/`. The first start after an update opens the changelog in a background tab when the version's minor or major number changed; `changelog_after_upgrade` (`major`, `minor`, `patch` or `never`) sets how big a step that takes.
1 change: 1 addition & 0 deletions packaging/aur/riptide-browser-bin/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ package() {
install -Dm644 riptide.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/riptide.svg"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 LICENSE-EXCEPTION "$pkgdir/usr/share/licenses/$pkgname/LICENSE-EXCEPTION"
install -Dm644 THIRD-PARTY-LICENSES.txt "$pkgdir/usr/share/licenses/$pkgname/THIRD-PARTY-LICENSES.txt"
}
1 change: 1 addition & 0 deletions packaging/aur/riptide-browser/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ package() {
install -Dm644 riptide.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/riptide.svg"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 LICENSE-EXCEPTION "$pkgdir/usr/share/licenses/$pkgname/LICENSE-EXCEPTION"
install -Dm644 THIRD-PARTY-LICENSES.txt "$pkgdir/usr/share/licenses/$pkgname/THIRD-PARTY-LICENSES.txt"
}
1 change: 1 addition & 0 deletions packaging/nix/source.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ rustPlatform.buildRustPackage {
cp -rL "$release/$f" $out/lib/riptide/
done
chmod -R u+w $out/lib/riptide
install -Dm644 crates/rt-cef/ui/editor.bundle.LICENSES.txt $out/lib/riptide/THIRD-PARTY-LICENSES.txt
# The Nix store can't hold a setuid sandbox helper, so there is none; the
# sandbox uses user namespaces instead, which NixOS allows by default.
makeWrapper $out/lib/riptide/riptide $out/bin/riptide \
Expand Down
3 changes: 2 additions & 1 deletion packaging/obs/debian.copyright
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ License: GPL-3.0-or-later
On Debian systems, the full text is in /usr/share/common-licenses/GPL-3.
With an additional permission under section 7 for loading a content
decryption module such as Widevine: /opt/riptide/LICENSE-EXCEPTION.
Chromium's and CEF's licenses are in /opt/riptide/CREDITS.html.
Chromium's and CEF's licenses are in /opt/riptide/CREDITS.html, and those
of the editor page's JavaScript in /opt/riptide/THIRD-PARTY-LICENSES.txt.
3 changes: 2 additions & 1 deletion packaging/obs/riptide.spec
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Framework (CEF) and controlled from Rust: modes, hints, a command
line, and configuration in TOML or Lua. Its license has an additional
permission for loading a content decryption module such as Widevine
(/opt/riptide/LICENSE-EXCEPTION); Chromium's and CEF's licenses are in
/opt/riptide/CREDITS.html.
/opt/riptide/CREDITS.html, and those of the editor page's JavaScript in
/opt/riptide/THIRD-PARTY-LICENSES.txt.

%prep
%setup -q -T -c
Expand Down
7 changes: 5 additions & 2 deletions scripts/package-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ for f in "${files[@]}"; do
done
cp -a "$build/locales" "$stage/"
cp LICENSE LICENSE-EXCEPTION README.md CHANGELOG.md packaging/riptide.desktop packaging/riptide.svg "$stage/"
cp crates/rt-cef/ui/editor.bundle.LICENSES.txt "$stage/THIRD-PARTY-LICENSES.txt"
crash_config > "$stage/crash_reporter.cfg"
# CEF ships libcef.so with debug info (1.4 GB); stripped it is ~260 MB.
strip "$stage/riptide" "$stage/libcef.so" "$stage/libvk_swiftshader.so"
Expand Down Expand Up @@ -131,7 +132,8 @@ License: GPL-3.0-or-later
On Debian systems, the full text is in /usr/share/common-licenses/GPL-3.
With an additional permission under section 7 for loading a content
decryption module such as Widevine: /opt/riptide/LICENSE-EXCEPTION.
Chromium's and CEF's licenses are in /opt/riptide/CREDITS.html.
Chromium's and CEF's licenses are in /opt/riptide/CREDITS.html, and those
of the editor page's JavaScript in /opt/riptide/THIRD-PARTY-LICENSES.txt.
EOF
# Packaged files must not be group- or world-writable, whatever the umask.
chmod -R go-w "$tree"
Expand Down Expand Up @@ -224,7 +226,8 @@ Framework (CEF) and controlled from Rust: modes, hints, a command
line, and configuration in TOML or Lua. Its license has an additional
permission for loading a content decryption module such as Widevine
(/opt/riptide/LICENSE-EXCEPTION); Chromium's and CEF's licenses are in
/opt/riptide/CREDITS.html.
/opt/riptide/CREDITS.html, and those of the editor page's JavaScript in
/opt/riptide/THIRD-PARTY-LICENSES.txt.

%install
cp -a "$tree/." %{buildroot}/
Expand Down
1 change: 1 addition & 0 deletions scripts/package-macos-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ else
cp -R "$cef/locales" "$stage/"
fi
cp LICENSE LICENSE-EXCEPTION README.md CHANGELOG.md "$stage/"
cp crates/rt-cef/ui/editor.bundle.LICENSES.txt "$stage/THIRD-PARTY-LICENSES.txt"
if [[ $os-$arch != macos-aarch64 ]]; then
cat >"$stage/EXPERIMENTAL.txt" <<EOF
This $os $arch build of riptide $version is experimental: it starts, but is untested by hand.
Expand Down
Loading