Skip to content
Open
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
9 changes: 6 additions & 3 deletions .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ serve-extension:
upgrade-version:
docker compose up upgrade-version

get-field FIELD:
op item get "Firefox Extension Signing Credentials" --fields {{FIELD}}
get-field FIELD *args='':
op item get "Firefox Extension Signing Credentials" --fields {{FIELD}} {{args}}

sign-extension:
cd extension/dist && web-ext sign --api-key=$(just get-field username) --api-secret=$(just get-field credential)
#!/bin/bash
API_KEY=$(just get-field username)
API_SECRET=$(just get-field credential --reveal)
docker compose run --rm -e API_KEY="$API_KEY" -e API_SECRET="$API_SECRET" web-ext
14 changes: 14 additions & 0 deletions Dockerfile.utils
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Use a lightweight Node.js image as the base
FROM node:18-alpine

# Set the working directory
WORKDIR /app

# Use a volume for the built extension
VOLUME /app

# Install Mozilla's web-ext tool
RUN npm install -g web-ext@8.7.1

# Default command to serve the extension
CMD ["sh", "-c", "yarn run serve"]
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ To build the extension locally you need to have the following tools installed:

* [Docker](https://www.docker.com/)
* [Just](https://github.com/casey/just)
* [1Password CLI](https://developer.1password.com/docs/cli/)

### Building the extension

Expand Down Expand Up @@ -59,6 +60,22 @@ If you want to sign the operation, you simply need to select a wallet from your
add the resulting PSBT to the correspondent text area in your browser. If you are using the Signer with NodeGuard, then it will automatically complete the sign operation as well.


## 🔏 Signing the Extension
To sign the extension for Google Chrome, go to the [Dev Console](https://chrome.google.com/webstore/devconsole) and upload it to the chrome web store.

To sign the extension for Firefox, follow these steps:

1. Ensure you have the necessary API credentials stored in 1Password for signing the extension. These credentials should be stored securely under the item named "Firefox Extension Signing Credentials".
- **Fields:**
- `username`: Your API username.
- `credential`: Your API secret key.
2. Use the `sign-extension` recipe in the `justfile` to sign the extension:
```sh
just sign-extension
```
This will retrieve credentials and sign the extension.
4. Verify that the extension has been signed successfully by checking the output logs or the signed artifacts.


# 🤝 Contributing

Expand Down
34 changes: 28 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.8'

services:
build-ext:
image: nodeguards-companion-build
Expand All @@ -15,7 +13,7 @@ services:
context: .
dockerfile: Dockerfile.serve
depends_on:
build:
build-ext:
condition: service_completed_successfully
volumes:
- ./extension:/app
Expand All @@ -26,10 +24,34 @@ services:
image: nodeguards-companion-upgrade
build:
context: .
dockerfile: Dockerfile.serve
dockerfile: Dockerfile.utils
depends_on:
build:
build-ext:
condition: service_completed_successfully
volumes:
- ./extension:/app
command: ["node", "scripts/upgradeVersion.js", "patch"]
command: ["node", "scripts/upgradeVersion.js", "patch"]

web-ext:
image: nodeguards-companion-web-ext
build:
context: .
dockerfile: Dockerfile.utils
depends_on:
build-ext:
condition: service_completed_successfully
upgrade-version:
condition: service_completed_successfully
volumes:
- ./extension:/app
command: >
sh -c 'web-ext sign \
--verbose \
--api-key="$$API_KEY" \
--api-secret="$$API_SECRET" \
--channel unlisted \
--source-dir /app/dist \
--artifacts-dir /app/signed'

environment:
- NODE_ENV=production
2 changes: 1 addition & 1 deletion extension/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "extension"
version = "0.2.8"
version = "0.2.9"
authors = [ "The elenpay Developers" ]
description = "A chrome extension/firefox add on for importing keys and signing PSBTs"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion extension/static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "NodeGuard Companion",
"description": "Import or generate your Bitcoin mnemonics, export your xpubs and sign your PSBTs. Your private keys never leave your browser.",
"version": "0.2.8",
"version": "0.2.9",
"action": {
"default_popup": "popup.html"
},
Expand Down
2 changes: 1 addition & 1 deletion extension/versions/manifest_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "NodeGuard Companion",
"description": "Import or generate your Bitcoin mnemonics, export your xpubs and sign your PSBTs. Your private keys never leave your browser.",
"version": "0.2.8",
"version": "0.2.9",
"browser_action": {
"default_popup": "popup.html"
},
Expand Down