API for our pubnix
Go to file
Odyssey 4321c7230b remove password gen lib completely
Signed-off-by: Odyssey <odyssey346@disroot.org>
2023-01-08 18:24:24 +01:00
pages remove password gen lib completely 2023-01-08 18:24:24 +01:00
.gitignore remove binary wtf 2023-01-07 19:16:48 +01:00
LICENSE Arya fix it 2023-01-07 16:33:51 +01:00
README.md add SHOUTRRRURL docs 2023-01-08 14:50:40 +05:30
go.mod generate password when reg script is run 2023-01-08 15:48:58 +05:30
go.sum Switch logger 2023-01-07 17:54:04 +01:00
main.go Fix newline escape character on /online 2023-01-07 19:43:20 +01:00

README.md

PublAPI

PublAPI is a simple API for Project Segfault's upcoming public shared system (pubnix).

Install

An installation of Go 1.19 or higher is required.

git clone https://github.com/ProjectSegfault/publapi
go mod download 
go build 
./publapi

By default publapi listens on 127.0.0.1:3000. You can change the port with the environment variable PUBLAPI_PORT.

Additionally, you need to set the variable PUBLAPI_SHOUTRRRURL in order for notifications to work. Url Format can be found at https://containrrr.dev/shoutrrr/v0.5/services/matrix/

Usage

Currently, PublAPI has only two routes, /online and /signup.

ROUTE TYPE EXTRA ARGS DESCRIPTION
/online GET N/A Returns the number of online users
/signup POST username, email Creates a register script and notifies admins that a new registration request was sent