Skip to content

New asset commands - #36

Merged
sergey-borovkov merged 10 commits into
masterfrom
new-asset-commands
Dec 29, 2022
Merged

New asset commands#36
sergey-borovkov merged 10 commits into
masterfrom
new-asset-commands

Conversation

@sergey-borovkov

@sergey-borovkov sergey-borovkov commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

What does this PR do?

Supports inject-js and set-headers commands for web assets.
Inject-js allows setting JS injection code for web assets. Injected code will be executed during playback on the device once the asset is loaded.

set-headers similarly works on web assets setting values of custom HTTP headers.
Usage is a bit awkward but I did not come up with better syntax:
screenly asset set-headers 01FJVFP0QVD1E5TA70SA66AJPF --header k=v --header k2=v2

Also adds basic-auth command that allows setting the basic auth header by accepting username and password.

GitHub issue or Phabricator ticket number?

T6482

How has this been tested?

New unit tests + manual use.

Checklist before merging

  • If have added tests.
  • Is this a new feature? If yes, please write one phrase about this update.
  • I've attached relevant screenshots (if relevant).

@vpetersson

vpetersson commented Dec 28, 2022

Copy link
Copy Markdown
Contributor

screenly asset set-headers 01FJVFP0QVD1E5TA70SA66AJPF "{"header1": "value1", "header2": "value2"}"

There's no reason why we need to have JSON style input. It would make more sense to set these like you would with say environment variables in Docker (e.g. -h header1=value) and then just repeat that multiple times.

@sergey-borovkov

Copy link
Copy Markdown
Contributor Author

screenly asset set-headers 01FJVFP0QVD1E5TA70SA66AJPF "{"header1": "value1", "header2": "value2"}"

There's no reason why we need to have JSON style input. It would make more sense to set these like you would with say environment variables in Docker (e.g. -h header1=value) and then just repeat that multiple times.

Done though without short -h - it's used for help already.

Comment thread src/commands.rs Outdated
Comment thread src/commands.rs
Comment thread src/commands.rs
@sergey-borovkov
sergey-borovkov merged commit 57d88d4 into master Dec 29, 2022
@sergey-borovkov
sergey-borovkov deleted the new-asset-commands branch September 1, 2023 08:00
514sid pushed a commit to 514sid/cli that referenced this pull request Jul 23, 2026
Resolve Dependabot alert Screenly#36 (GHSA-7gcf-g7xr-8hxj). Lockfile-only bump
within the existing ^3.8.3 range; the advisory panic is in KeyValueMap,
which this crate does not use, but the alert requires >= 3.21.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants