2023-01-08 09:24:34 +05:30
# PublAPI
2023-05-28 19:12:21 +05:30
[![Go Version ](https://img.shields.io/github/go-mod/go-version/projectsegfault/publapi?logo=Go&style=for-the-badge )](https://go.dev/doc/devel/release)
2023-05-28 19:11:05 +05:30
[![License ](https://img.shields.io/github/license/projectsegfault/publapi?style=for-the-badge )](./LICENSE)
[![Matrix ](https://img.shields.io/matrix/pubnix:projectsegfau.lt?logo=matrix&style=for-the-badge )](https://matrix.to/#/#pubnix:projectsegfau.lt)
2023-01-08 09:24:34 +05:30
2023-01-08 10:07:50 +05:30
PublAPI is a simple API for Project Segfault's upcoming public shared system (pubnix).
2023-01-08 09:24:34 +05:30
## Install
An installation of Go 1.19 or higher is required.
```
git clone https://github.com/ProjectSegfault/publapi
go mod download
go build
./publapi
```
2023-01-08 14:50:40 +05:30
By default publapi listens on 127.0.0.1:3000. You can change the port with the environment variable PUBLAPI_PORT.
2023-02-05 19:00:47 +05:30
Additionally, you need to set the variable PUBLAPI_EMAIL_SHOUTRRRURL and PUBLAPI_NOTIFY_SHOUTRRRURL in order for signup notifications to work. URL Format can be found at https://containrrr.dev/shoutrrr/v0.5.
2023-01-08 09:24:34 +05:30
2023-02-18 15:20:24 +05:30
You can also set PUBLAPI_SIGNUP_IP to make sure signup requests can only be made from one IP.
2023-01-08 09:24:34 +05:30
## Usage
2023-01-18 21:16:44 +05:30
Currently, PublAPI has only two routes, /users and /signup.
2023-01-08 09:24:34 +05:30
2023-01-18 21:16:44 +05:30
| ROUTE | TYPE | EXTRA ARGS | DESCRIPTION |
|---------|------|----------------------|---------------------------------|
| /users | GET | N/A | Return information about users. |
2023-01-17 20:39:46 +05:30
| /signup | POST | username, email, ssh | Creates a register script and notifies admins that a new registration request was sent.|