The app links to its source, from an admin setting (#6228)
CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 2s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Android / Core and FFI clippy and tests (push) Skipped
Android / Kotlin + Rust (APK) (push) Skipped
Android / Build the server image (push) Skipped
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Web typecheck and unit tests (push) Successful in 9s
CI & Build / Python tests (push) Successful in 14s
CI & Build / integration (push) Successful in 1m45s
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 2m17s
CI & Build / Build & push image (push) Successful in 42s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 2m25s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 3m10s
Desktop (Tauri) / Update manifest (push) Successful in 3s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Build now, or wait for Android? (push) Successful in 2s
Android / Build, or is the channel already serving this? (push) Successful in 3s
Android / Core and FFI clippy and tests (push) Skipped
Android / Kotlin + Rust (APK) (push) Skipped
Android / Build the server image (push) Skipped
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Web typecheck and unit tests (push) Successful in 9s
CI & Build / Python tests (push) Successful in 14s
CI & Build / integration (push) Successful in 1m45s
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 2m17s
CI & Build / Build & push image (push) Successful in 42s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 2m25s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 3m10s
Desktop (Tauri) / Update manifest (push) Successful in 3s
#6228 "The app offers its source: a Source link from an admin setting (AGPL §13)". The AGPL requires a modified copy run for others over a network to offer them its source; Forge's #2282 is the shape followed. - Settings → General gains "Source code" (`source_url`), defaulting to the public repo so a stock install makes the offer. Empty hides it. - It is an http(s)-only URL setting, refused otherwise on save, and `safe_link` refuses anything else again when it is published, because the web renders it as an href. - /api/config carries it; the web shows "Source" beside the build number at the foot of the sidebar. The offline desktop's config has no such field, so the link stays hidden there. - ci.yml's client-bake comments no longer call the forge private; the repo has been public since #2091. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+18
-1
@@ -1,4 +1,4 @@
|
||||
from inkwell.settings import MAX_BODY_MB, REGISTRY, validate_updates
|
||||
from inkwell.settings import MAX_BODY_MB, REGISTRY, safe_link, validate_updates
|
||||
|
||||
|
||||
def test_registry_has_expected_keys():
|
||||
@@ -70,6 +70,23 @@ def test_the_public_address_is_an_http_url_without_a_trailing_slash():
|
||||
assert clean == {} and error
|
||||
|
||||
|
||||
def test_the_source_link_takes_only_an_http_url():
|
||||
assert validate_updates({"source_url": "https://git.example.test/me/inkwell/"}) == (
|
||||
{"source_url": "https://git.example.test/me/inkwell"},
|
||||
None,
|
||||
)
|
||||
assert validate_updates({"source_url": ""}) == ({"source_url": ""}, None)
|
||||
clean, error = validate_updates({"source_url": "javascript:alert(1)"})
|
||||
assert clean == {} and error
|
||||
|
||||
|
||||
def test_a_link_that_is_not_http_is_never_published():
|
||||
"""A stored value reaches an href; one that bypassed validation must still not."""
|
||||
assert safe_link("https://git.example.test/me/inkwell") == "https://git.example.test/me/inkwell"
|
||||
assert safe_link("javascript:alert(1)") == ""
|
||||
assert safe_link("") == ""
|
||||
|
||||
|
||||
def test_choice_labels_name_every_choice():
|
||||
"""The UI pairs labels with choices by position, so a label list of another length
|
||||
would put one choice's name on another."""
|
||||
|
||||
Reference in New Issue
Block a user