gpt web app for teams, sass or self hosting
cd chat; cd api
go install github.com/cosmtrek/air@latest
go mod tidy
# export env var, change base on your env
export PG_HOST=192.168.0.135
export PG_DB=hwu
export PG_USER=hwu
export PG_PASS=pass
export PG_PORT=5432
# export DATABASE_URL= postgres://user:[email protected]:5432/db?sslmode=disable
# export OPENAI_API_KEY=sk-xxx, not required if you use `debug` model
# export OPENAI_RATELIMIT=100
#
make serve
cd ..; cd web
npm install
npm run dev
cd ..; cd e2e
# export env var, change base on your env
export PG_HOST=192.168.0.135
export PG_DB=hwu
export PG_USER=hwu
export PG_PASS=pass
export PG_PORT=5432
npm install
npx playwright test # --ui
The instruction might not be accurate, ask in issue or discussion if unclear.
参考 docker-compose.yaml
然后配置环境变量就可以了.
PORT=8080
OPENAI_RATELIMIT=0
别的两个 api key 有就填.
部署之后, 注册用户, 第一个用户是管理员, 然后到 https://$hostname/static/#/admin/user, 设置 ratelimit, 公网部署, 只对信任的email 增加 ratelimit, 这样即使有人注册, 也是不能用的.
Refer to docker-compose.yaml
Then configure the environment variables.
PORT=8080
OPENAI_RATELIMIT=0
Fill in the other two keys if you have them.
After deployment, registering users, the first user is an administrator, then go to https://$hostname/static/#/admin/user to set rate limiting. Public deployment, only adds rate limiting to trusted emails, so even if someone registers, it will not be available.
This helps ensure only authorized users can access the deployed system by limiting registration to trusted emails and enabling rate limiting controls.