You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-10Lines changed: 20 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Upload files to [web3.storage](https://web3.storage) from a Github Action, and output the IPFS Content ID.
4
4
5
-
A lightweight wrapper around [w3cli](https://github.com/web3-storage/w3cli). As a [composite](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action) github action all it does is configure and call the cli for you. See the steps in [./action.yml](./action.yml).
5
+
A lightweight wrapper around [w3cli]. As a [composite](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action) github action all it does is configure and call the cli for you. See the steps in [./action.yml](./action.yml).
6
6
7
7
## Usage
8
8
@@ -22,31 +22,39 @@ with:
22
22
- run: echo ${{ steps.w3up.outputs.url }}
23
23
```
24
24
25
-
Use [w3cli] to generate a `secret_key` and `proof` to allow this action to upload to a space on.
25
+
### Generating a `secret_key` and `proof`
26
26
27
-
Install it from npm and login as described here https://web3.storage/docs/quickstart/ then:
27
+
On your dev machine, use [w3cli] to generate a `secret_key` and `proof` to allow this action to upload to a space on.
28
+
29
+
Install it from npm and login as described here https://web3.storage/docs/quickstart/ then create a key like this:
28
30
29
31
```shell
30
-
# create a signing key for CI.
31
32
# Use the `did` in the input to the next command.
32
33
# Use `key` as your `secret_key` for add_to_web3.
33
34
$ w3 key create --json
34
35
{
35
36
"did": "did:key:z6Mk...",
36
37
"key": "MgCaT7Se2QX9..."
37
38
}
39
+
```
40
+
41
+
Keep the `key` safe. Save it as a secret on your repo.
38
42
39
-
# create a base64 encoded UCAN `proof`
40
-
# It delegates store and upload permissions to the `did` we created above.
43
+
Copy the `did` for use in the next command. The output is a base64 encoded ucan `proof` that delegates capabilities to `store/add` and `upload/add` on your current space to the key generated above.
44
+
45
+
```shell
46
+
# Delegate capabilities to the `did` we created above.
- Use the `key` value from the output of `w3 key create --json` as the `secret_key` for this action.
46
-
- Use the `did value from that command as the audience for `w3 delegation create <audience>` shown above.
47
-
- Use the output of `w3 delegation create <audience>` as the `proof` for this action.
51
+
The capabilies `store/add` and `upload/add` are the minimum required to upload files to web3.storage. This proof will not allow that key to list uploads in this space for example.
52
+
53
+
To recap:
48
54
49
-
Keep the `secret_key` safe. Save it as a secret on your repo. The `proof` delegates permission from your account to that key to upload to your space. The `proof` can only be used by an agent that holds the `secret_key`.
55
+
- Use the `key` value from the output of `w3 key create --json` as the `secret_key` for this action.
56
+
- Use the `did value from that output as the audience for `w3 delegation create <audience>` shown above.
57
+
- Use the output of `w3 delegation create <audience> --base64` as the `proof` for this action.
50
58
51
59
## Inputs
52
60
@@ -109,3 +117,5 @@ e.g. `https://dweb.link/ipfs/bafkreicysg23kiwv34eg2d7qweipxwosdo2py4ldv42nbaugul
0 commit comments