Skip to content

Commit

Permalink
Add uuidgen to generate component script (#154)
Browse files Browse the repository at this point in the history
* Add uuidgen to generate component script
* Fix: README
  • Loading branch information
ShivanKaul authored Feb 29, 2024
1 parent 50830ae commit 5ae5729
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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

0 comments on commit 5ae5729

Please sign in to comment.