2023-10-14 16:06:02 +00:00
|
|
|
# PolyculeConnect
|
2023-10-11 07:55:28 +00:00
|
|
|
|
2024-08-10 14:01:31 +00:00
|
|
|
[![status-badge](https://git.faercol.me/PolyculeConnect/polycule-connect/badges/workflows/go-test.yml/badge.svg?branch=main)](https://ci-polycule-connect.chapoline.me/repos/1)
|
2023-10-11 07:55:28 +00:00
|
|
|
|
2023-10-21 18:56:24 +00:00
|
|
|
![Project logo](./polyculeconnect/static/img/logo-text.png)
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
TODO
|
2023-10-19 16:57:14 +00:00
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2023-10-25 18:30:23 +00:00
|
|
|
As a temporary solution, the list of backends and applications, as well as the openconnect configuration
|
|
|
|
can only be handled through the JSON config file.
|
2023-10-19 16:57:14 +00:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"openconnect": {
|
2023-10-25 18:30:23 +00:00
|
|
|
"issuer": "https://polyculeconnect.domain",
|
2023-10-19 16:57:14 +00:00
|
|
|
"clients": [
|
|
|
|
{
|
|
|
|
"name": "<name>",
|
|
|
|
"id": "<client_id>",
|
|
|
|
"secret": "<client_secret>",
|
|
|
|
"redirectURIs": [
|
|
|
|
"<redirect_uri>"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"backends": [
|
|
|
|
{
|
|
|
|
"id": "<unique_id>",
|
|
|
|
"name": "<human_readable_name>",
|
|
|
|
"local": true,
|
2023-10-25 18:30:23 +00:00
|
|
|
"type": "oidc",
|
2023-10-19 16:57:14 +00:00
|
|
|
"config": {
|
2023-10-25 18:30:23 +00:00
|
|
|
"issuer": "https://polyculeconnect.domain",
|
2023-10-19 16:57:14 +00:00
|
|
|
"clientID": "<client_id>",
|
|
|
|
"clientSecret": "<client_secret>",
|
|
|
|
"redirectURI": "<redirect_uri>"
|
|
|
|
}
|
2023-10-25 18:30:23 +00:00
|
|
|
}
|
2023-10-19 16:57:14 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2023-10-25 18:30:23 +00:00
|
|
|
The rest of the configuration is handled through environment variables
|
|
|
|
|
|
|
|
```ini
|
|
|
|
# Can be debug,info,warning,error
|
|
|
|
LOG_LEVEL = "info"
|
|
|
|
|
2024-01-03 16:10:20 +00:00
|
|
|
ISSUER = "http://localhost"
|
|
|
|
|
2023-10-25 18:30:23 +00:00
|
|
|
# Can be net,unix
|
|
|
|
SERVER_MODE = "net"
|
|
|
|
SERVER_HOST = "0.0.0.0"
|
|
|
|
SERVER_PORT = "5000"
|
|
|
|
# SERVER_SOCK_PATH = ""
|
|
|
|
|
|
|
|
STORAGE_TYPE = "sqlite"
|
|
|
|
STORAGE_FILEPATH = "./build/polyculeconnect.db"
|
|
|
|
# STORAGE_HOST = "127.0.0.1"
|
|
|
|
# STORAGE_PORT = "5432"
|
|
|
|
# STORAGE_DB = "polyculeconnect"
|
|
|
|
# STORAGE_USER = "polyculeconnect"
|
|
|
|
# STORAGE_PASSWORD = "polyculeconnect"
|
|
|
|
# STORAGE_SSL_MODE = "disable"
|
|
|
|
# STORAGE_SSL_CA_FILE = ""
|
|
|
|
```
|
|
|
|
|
2023-10-19 16:57:14 +00:00
|
|
|
You can register multiple backend and multiple clients (applications)
|
|
|
|
|
|
|
|
## Running the server
|
|
|
|
|
|
|
|
### Running from sources
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# clone the directory
|
|
|
|
git clone https://git.faercol.me/PolyculeConnect/polycule-connect.git
|
|
|
|
|
|
|
|
cd polycule-connect
|
|
|
|
|
|
|
|
# build the sources
|
|
|
|
make -C polyculeconnect build
|
|
|
|
|
|
|
|
# edit the configuration file
|
|
|
|
vim config.json
|
|
|
|
|
|
|
|
# run the application
|
|
|
|
./polyculeconnect/build/polyculeconnect -config config.json
|
|
|
|
```
|
|
|
|
|
|
|
|
### Running from docker image
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# edit the configuration file
|
|
|
|
mkdir -p config
|
|
|
|
vim config/config.json
|
|
|
|
|
|
|
|
# run the docker container
|
|
|
|
docker run -v ./config/:/config -p 5000:5000 -it git.faercol.me/polyculeconnect/polyculeconnect:latest
|
|
|
|
```
|
|
|
|
|
|
|
|
Or using the example docker compose `docker compose up`
|