Corlink API Server
This is the server that handles all the requests and responses. Want to see the docs for the API? Click here.
Setup
There are 6 ways of setting up the Corlink API server:
Docker
This is one of the easiest ways to get the Corlink API server up and running.
Prerequisites
Steps
- Pull the image.
docker pull ghcr.io/ruby-network/corlink-server:latest
- Run the image.
docker run -d -p 8080:8080 -e ADMIN_KEY=your_admin_key -e DB_HOST=your_db_host -e DB_USER=your_db_user -e DB_PASS=your_db_password -e DB_NAME=your_db_name -e DB_PORT=your_db_port ghcr.io/ruby-network/corlink-server:latest
Docker Compose (Recommended)
This is the recommended way of setting up the Corlink API server. It is the easiest and fastest way to get the Corlink API server up and running.
Prerequisites
Steps
- Acquire the
docker-compose.yml
file from the Corlink repository.- You can find the file here.
- Setup the folders for the database and other volumes where your
docker-compose.yml
file is located.
mkdir -p db/
- Edit the
docker-compose.yml
files environment variables.
When changing the
POSTGRES_USER
, POSTGRES_PASSWORD
, and POSTGRES_DB
variables, you will also need to change the DB_USER
, DB_PASSWORD
, and DB_NAME
variables in the corlink-server
service.Make sure to change the
ADMIN_KEY
to a secure key. Below is a command to generate a secure key.openssl rand -base64 32
Variable | Description | Service |
---|---|---|
POSTGRES_USER | The user of the database. (Default is fine) | postgres |
POSTGRES_PASSWORD | The password of the database. (Default is fine) | postgres |
POSTGRES_DB | The name of the database. (Default is fine) | postgres |
ADMIN_KEY | The admin key for the Corlink API. | corlink-server |
DB_HOST | The host of the database. LEAVE DEFAULT | corlink-server |
DB_USER | The user of the database. (default value is fine) | corlink-server |
DB_PASSWORD | The password of the database. (default value is fine) | corlink-server |
DB_NAME | The name of the database. (default value is fine) | corlink-server |
DB_PORT | The port of the database. (default value is fine) | corlink-server |
- Run the
docker-compose.yml
file.
docker-compose up -d
- You should now have a Corlink API server running.
AUR
This is another easy way to get the Corlink API server up and running.
Prerequisites
- Arch Linux
- Yay (or any other AUR helper, or manual installation (figure that out yourself nerd))
- A PostgreSQL database. (See setup here)
Steps
- Install the package.
yay -S corlink-server
- Create a
.env
file in the directory you would like to run the server in.
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
- Run the package.
corlink-server start
You can also use a SQLite database (not recommended for prod) by adding the
-s
or --sqlite
flag to the corlink-server start
command.- You should now have a Corlink API server running.
- For more information on the CLI see here
Go Install
This is another easy way to get the Corlink API server up and running.
Prerequisites
Steps
- Install the package.
go install github.com/ruby-network/corlink/licensing@latest
- Create a
.env
file in the directory you would like to run the server in.
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
- Run the package.
corlink-server start
You can also use a SQLite database (not recommended for prod) by adding the
-s
or --sqlite
flag to the corlink-server start
command.- You should now have a Corlink API server running.
- For more information on the CLI see here.
Manual
This is the hardest way to get the Corlink API server up and running.
Prerequisites
Steps
- Clone the repository.
git clone https://github.com/ruby-network/corlink.git
- Run the make command.
cd licensing/ && make
- Edit the
.env
file.
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
- Run the server.
./bin/corlink-server start
You can also use a SQLite database (not recommended for prod) by adding the
-s
or --sqlite
flag to the corlink-server start
command.- You should now have a Corlink API server running.
- For more information on the CLI see here.