107 lines
2.6 KiB
Markdown
107 lines
2.6 KiB
Markdown
# PolyculeConnect
|
|
|
|
[![status-badge](https://ci-polycule-connect.chapoline.me/api/badges/1/status.svg)](https://ci-polycule-connect.chapoline.me/repos/1)
|
|
[![status-badge](https://ci-server.internal.faercol.me/api/badges/2/status.svg)](https://ci-server.internal.faercol.me/repos/2)
|
|
|
|
![Project logo](./polyculeconnect/static/img/logo-text.png)
|
|
|
|
## Description
|
|
|
|
TODO
|
|
|
|
## Configuration
|
|
|
|
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.
|
|
|
|
```json
|
|
{
|
|
"openconnect": {
|
|
"issuer": "https://polyculeconnect.domain",
|
|
"clients": [
|
|
{
|
|
"name": "<name>",
|
|
"id": "<client_id>",
|
|
"secret": "<client_secret>",
|
|
"redirectURIs": [
|
|
"<redirect_uri>"
|
|
]
|
|
}
|
|
],
|
|
"backends": [
|
|
{
|
|
"id": "<unique_id>",
|
|
"name": "<human_readable_name>",
|
|
"local": true,
|
|
"type": "oidc",
|
|
"config": {
|
|
"issuer": "https://polyculeconnect.domain",
|
|
"clientID": "<client_id>",
|
|
"clientSecret": "<client_secret>",
|
|
"redirectURI": "<redirect_uri>"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
The rest of the configuration is handled through environment variables
|
|
|
|
```ini
|
|
# Can be debug,info,warning,error
|
|
LOG_LEVEL = "info"
|
|
|
|
ISSUER = "http://localhost"
|
|
|
|
# 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 = ""
|
|
```
|
|
|
|
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`
|