diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index 89e387c..74fe9f1 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -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 diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index 9c120fc..6e88c1b 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -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: motortruck1221@protonmail.com aur-binary: @@ -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 @@ -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/* @@ -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 diff --git a/docs/content/1.setup/7.selfhosting/3.server.md b/docs/content/1.setup/7.selfhosting/3.server.md index a88f877..6d4d6e3 100644 --- a/docs/content/1.setup/7.selfhosting/3.server.md +++ b/docs/content/1.setup/7.selfhosting/3.server.md @@ -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) @@ -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. diff --git a/packages/sdk/browser/index.js b/packages/sdk/browser/index.js new file mode 100644 index 0000000..5ebd21e --- /dev/null +++ b/packages/sdk/browser/index.js @@ -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); +} diff --git a/packages/sdk/browser/package.json b/packages/sdk/browser/package.json new file mode 100644 index 0000000..536e04a --- /dev/null +++ b/packages/sdk/browser/package.json @@ -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": { + } +}