Skip to content

Commit

Permalink
Merge pull request #19 from SkynetLabs/skynet-api-key
Browse files Browse the repository at this point in the history
add skynetApiKey option and readme, plus skynet-nodejs 2.5.1
  • Loading branch information
dghelm committed Mar 29, 2022
2 parents 4f9491c + bc3dc51 commit 89560e5
Show file tree
Hide file tree
Showing 591 changed files with 56,350 additions and 16,621 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: monthly
16 changes: 16 additions & 0 deletions .github/workflows/static-code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Static Code Analysis

on:
- pull_request

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x

- run: npx prettier --check .
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package.json
package-lock.json
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,20 @@ Default value: `https://siasky.net`

You can override default skynet portal url with any compatible community portal or self hosted one.

### `skynet-api-key`

**USE GITHUB SECRET - DO NOT COMMIT THIS IN PLAIN TEXT**

Portal account private API key used for associating uploads with a specific account. Also used to allow uploads larger than 1GB or access account-only portals.
[Creating an API key.](https://docs.skynetlabs.com/developer-guides/server-hosted-skynet-usage#obtaining-your-skynet-api-key)

### `skynet-jwt`

_(**Deprecated.** Use `skynet-api-key` instead.)_

**USE GITHUB SECRET - DO NOT COMMIT THIS IN PLAIN TEXT**

Portal account JWT used for associating uploads with a specific account. Also used to allow uploads larger than 1GB.
Portal account JWT used for associating uploads with a specific account. Also used to allow uploads larger than 1GB or access account-only portals.
[Obtaining your JWT.](https://docs.siasky.net/developer-guides/server-hosted-skynet-usage#obtaining-your-jwt)

## Outputs
Expand Down Expand Up @@ -123,5 +132,7 @@ jobs:
with:
upload-dir: public
github-token: ${{ secrets.GITHUB_TOKEN }}
portal-url: https://skynetfree.net
skynet-api-key: ${{ secrets.SKYNET_API_KEY }}
registry-seed: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && secrets.REGISTRY_SEED || '' }}
```
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ inputs:
description: "Skynet portal api url"
required: true
default: "https://siasky.net"
skynet-api-key:
description: "Portal account private API key used for association uploads with a specific account. Also used to allow uploads larger than 1GB or access account-only portals."
required: false
skynet-jwt:
description: "Portal account JWT used for associating uploads with a specific account. Also used to allow uploads larger than 1GB."
description: "Deprecated. Portal account JWT used for associating uploads with a specific account. Also used to allow uploads larger than 1GB."
required: false
outputs:
skylink:
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ function prepareClientOptions() {
options.customCookie = `skynet-jwt=${core.getInput("skynet-jwt")}`;
}

if (core.getInput("skynet-api-key")) {
// set Skynet Api Key
options.skynetApiKey = core.getInput("skynet-api-key");
}

return options;
}

Expand Down
Loading

0 comments on commit 89560e5

Please sign in to comment.