Skip to content

Commit 6517d39

Browse files
update docs, workflows
1 parent 92d5b59 commit 6517d39

5 files changed

Lines changed: 53 additions & 67 deletions

File tree

.github/workflows/npm.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,18 @@ jobs:
5858
run: npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
5959
- name: Publish
6060
run: cd packages/sdk/node && npm publish --access public
61+
browser:
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v3
66+
- name: Set up Node.js
67+
uses: actions/setup-node@v2
68+
with:
69+
node-version: '18'
70+
- name: Install Dependencies
71+
run: cd packages/sdk/browser && npm install
72+
- name: Setup User
73+
run: npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
74+
- name: Publish
75+
run: cd packages/sdk/browser && npm publish --access public

.github/workflows/server.yml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: EndBug/add-and-commit@v9
2424
with:
2525
push: origin HEAD:main
26-
add: bin/corlink-server --force
26+
add: ./licensing/bin/corlink-server --force
2727
author_name: motortruck1221
2828
author_email: motortruck1221@protonmail.com
2929
aur-binary:
@@ -131,8 +131,8 @@ jobs:
131131
uses: actions/upload-artifact@v4
132132
with:
133133
name: binaries
134-
path: bin/
135-
retention-days: 1
134+
path: ./licensing/bin/
135+
retention-days: 2
136136
download-upload-release:
137137
name: Download & Upload Binaries to Release
138138
runs-on: ubuntu-latest
@@ -145,7 +145,7 @@ jobs:
145145
with:
146146
#download the binaries from the binaries job
147147
name: binaries
148-
path: bin/
148+
path: ./licensing/bin/
149149
# binaries worflow run id
150150
- name: Make binaries executable
151151
run: cd licensing/ && chmod +x bin/*
@@ -170,22 +170,4 @@ jobs:
170170
gh release upload $release bin/corlink-server-386-compressed --clobber
171171
gh release upload $release bin/corlink-server-compressed.exe --clobber
172172
gh release upload $release bin/corlink-server-mac-compressed --clobber
173-
gh release upload $release bin/corlink-server-mac-arm64-compressed --clobber
174-
npm:
175-
name: Publish packages to NPM
176-
runs-on: ubuntu-latest
177-
steps:
178-
- name: Checkout
179-
uses: actions/checkout@v3
180-
- name: Set up Node.js
181-
uses: actions/setup-node@v2
182-
with:
183-
node-version: '18'
184-
- name: Build binaries
185-
run: |
186-
cd licensing/
187-
make npm
188-
- name: Setup User
189-
run: npm config set //registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
190-
- name: Publish
191-
run: cd licensing/ && make npm-publish
173+
gh release upload $release bin/corlink-server-mac-arm64-compressed --clobber

docs/content/1.setup/7.selfhosting/3.server.md

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ There are 6 ways of setting up the Corlink API server:
1313

1414
- [Docker](#docker)
1515
- [Docker Compose](#docker-compose-recommended)
16-
- [NPM/NPX](#npmnpx)
1716
- [AUR](#aur)
1817
- [Go Install](#go-install)
1918
- [Manual](#manual)
@@ -96,49 +95,6 @@ docker-compose up -d
9695
5. You should now have a Corlink API server running.
9796
---
9897

99-
## NPM/NPX
100-
101-
This is one of the easier ways to get the Corlink API server up and running.
102-
103-
### Prerequisites
104-
- [Node.js](https://nodejs.org/en/)
105-
- [NPM](https://www.npmjs.com/get-npm)
106-
- A PostgreSQL database. (NOT REQUIRED IN SOME CASES) (See setup [here](./5.database.md))
107-
108-
### Steps
109-
110-
1. Install the package.
111-
112-
```bash
113-
npm install -g corlink-server
114-
```
115-
116-
2. Create a `.env` file in the directory you would like to run the server in.
117-
118-
```env
119-
ADMIN_KEY=your_admin_key
120-
DB_HOST=your_db_host
121-
DB_USER=your_db_user
122-
DB_PASS=your_db_password
123-
DB_NAME=your_db_name
124-
DB_PORT=your_db_port
125-
```
126-
127-
3. Run the package.
128-
129-
```bash
130-
corlink-server start
131-
```
132-
133-
::alert{type="info"}
134-
You can also use a SQLite database (not recommended for prod) by adding the `-s` or `--sqlite` flag to the `corlink-server start` command.
135-
::
136-
137-
4. You should now have a Corlink API server running.
138-
139-
- For more information on the CLI see [here](/cli/).
140-
---
141-
14298
## AUR
14399

144100
This is another easy way to get the Corlink API server up and running.

packages/sdk/browser/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
try {
2+
if (!localStorage["auth"] && new URL(document.all.rcheck.href).password) {
3+
window.location.reload();
4+
localStorage["auth"] = true;
5+
}
6+
}
7+
catch (e) {
8+
console.log(e);
9+
}

packages/sdk/browser/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "@rubynetwork/corlink-client",
3+
"version": "0.0.1",
4+
"description": "A simple helper for a client using corlink",
5+
"main": "index.js",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/ruby-network/corlink.git"
9+
},
10+
"keywords": [
11+
"javascript",
12+
"corlink"
13+
],
14+
"bugs": {
15+
"url": "https://github.com/ruby-network/corlink/issues"
16+
},
17+
"homepage": "https://github.com/ruby-network/corlink#readme",
18+
"author": "Ruby Network",
19+
"license": "AGPL-3.0",
20+
"dependencies": {
21+
},
22+
"devDependencies": {
23+
}
24+
}

0 commit comments

Comments
 (0)