Skip to content

Commit

Permalink
update docs, workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
MotorTruck1221 committed Mar 9, 2024
1 parent 92d5b59 commit 6517d39
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 67 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,18 @@ jobs:
run: npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
- name: Publish
run: cd packages/sdk/node && npm publish --access public
browser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Dependencies
run: cd packages/sdk/browser && npm install
- name: Setup User
run: npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
- name: Publish
run: cd packages/sdk/browser && npm publish --access public
28 changes: 5 additions & 23 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: EndBug/add-and-commit@v9
with:
push: origin HEAD:main
add: bin/corlink-server --force
add: ./licensing/bin/corlink-server --force
author_name: motortruck1221
author_email: [email protected]
aur-binary:
Expand Down Expand Up @@ -131,8 +131,8 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: binaries
path: bin/
retention-days: 1
path: ./licensing/bin/
retention-days: 2
download-upload-release:
name: Download & Upload Binaries to Release
runs-on: ubuntu-latest
Expand All @@ -145,7 +145,7 @@ jobs:
with:
#download the binaries from the binaries job
name: binaries
path: bin/
path: ./licensing/bin/
# binaries worflow run id
- name: Make binaries executable
run: cd licensing/ && chmod +x bin/*
Expand All @@ -170,22 +170,4 @@ jobs:
gh release upload $release bin/corlink-server-386-compressed --clobber
gh release upload $release bin/corlink-server-compressed.exe --clobber
gh release upload $release bin/corlink-server-mac-compressed --clobber
gh release upload $release bin/corlink-server-mac-arm64-compressed --clobber
npm:
name: Publish packages to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Build binaries
run: |
cd licensing/
make npm
- name: Setup User
run: npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
- name: Publish
run: cd licensing/ && make npm-publish
gh release upload $release bin/corlink-server-mac-arm64-compressed --clobber
44 changes: 0 additions & 44 deletions docs/content/1.setup/7.selfhosting/3.server.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ There are 6 ways of setting up the Corlink API server:

- [Docker](#docker)
- [Docker Compose](#docker-compose-recommended)
- [NPM/NPX](#npmnpx)
- [AUR](#aur)
- [Go Install](#go-install)
- [Manual](#manual)
Expand Down Expand Up @@ -96,49 +95,6 @@ docker-compose up -d
5. You should now have a Corlink API server running.
---

## NPM/NPX

This is one of the easier ways to get the Corlink API server up and running.

### Prerequisites
- [Node.js](https://nodejs.org/en/)
- [NPM](https://www.npmjs.com/get-npm)
- A PostgreSQL database. (NOT REQUIRED IN SOME CASES) (See setup [here](./5.database.md))

### Steps

1. Install the package.

```bash
npm install -g corlink-server
```

2. Create a `.env` file in the directory you would like to run the server in.

```env
ADMIN_KEY=your_admin_key
DB_HOST=your_db_host
DB_USER=your_db_user
DB_PASS=your_db_password
DB_NAME=your_db_name
DB_PORT=your_db_port
```

3. Run the package.

```bash
corlink-server start
```

::alert{type="info"}
You can also use a SQLite database (not recommended for prod) by adding the `-s` or `--sqlite` flag to the `corlink-server start` command.
::

4. You should now have a Corlink API server running.

- For more information on the CLI see [here](/cli/).
---

## AUR

This is another easy way to get the Corlink API server up and running.
Expand Down
9 changes: 9 additions & 0 deletions packages/sdk/browser/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
try {
if (!localStorage["auth"] && new URL(document.all.rcheck.href).password) {
window.location.reload();
localStorage["auth"] = true;
}
}
catch (e) {
console.log(e);
}
24 changes: 24 additions & 0 deletions packages/sdk/browser/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@rubynetwork/corlink-client",
"version": "0.0.1",
"description": "A simple helper for a client using corlink",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/ruby-network/corlink.git"
},
"keywords": [
"javascript",
"corlink"
],
"bugs": {
"url": "https://github.com/ruby-network/corlink/issues"
},
"homepage": "https://github.com/ruby-network/corlink#readme",
"author": "Ruby Network",
"license": "AGPL-3.0",
"dependencies": {
},
"devDependencies": {
}
}

0 comments on commit 6517d39

Please sign in to comment.