Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add uuidgen to generate component script #154

Merged
merged 2 commits into from
Feb 29, 2024
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The `filter_lists/*.json` files are lists of elements, each describing a filter
}
```

- `uuid` is currently only used by iOS, along with versions of the Desktop/Android browser prior to [brave/brave-core#15077](https://github.com/brave/brave-core/pull/15077). It's a UUID generated with, for example, the CLI tool `uuidgen`.
- `uuid` is a UUID generated with, for example, the CLI tool `uuidgen`.

- `title` is a human-readable title for the filter list component. Each source also has a title, which is a human-readable title for each individual list making up the full component.

Expand Down Expand Up @@ -98,6 +98,7 @@ The following 4 fields are all optional and default to `false` or `0` if omitted

The `generate_component.sh` script can be used to help create a new filter list component.
It will generate:
- A UUID (for the top-level `uuid` field)
- A public key (corresponding to the `list_text_component.base64_public_key` field)
- A component ID (corresponding to the `list_text_component.component_id` field)
- The component's private key (in a new PEM file)
Expand Down
8 changes: 6 additions & 2 deletions generate_component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ COMPONENTID=$(openssl rsa -in $TEMPFILE -pubout -outform DER 2>/dev/null | shasu

PEMFILE="ad-block-updater-$COMPONENTID.pem"

echo "$PUBKEY"
echo "Generating values to use in new component defined in list_catalog.json"
echo
echo "$COMPONENTID"
echo "uuid: $(uuidgen)"
echo
echo "base64 public key: $PUBKEY"
echo
echo "component ID: $COMPONENTID"
echo

mv "$TEMPFILE" "$PEMFILE"
Expand Down
Loading