From 272132325084fbe03658a70138bce2b3c529cc00 Mon Sep 17 00:00:00 2001 From: Cameron Reikes Date: Fri, 24 Mar 2023 17:06:09 +0000 Subject: [PATCH] Make work on linux --- .gitignore | 2 ++ server/install_service.sh | 5 +++-- server/main.go | 1 - server/rpgpt.service | 3 +-- 4 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 server/install_service.sh diff --git a/.gitignore b/.gitignore index fd33a70..f53e225 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# Server builds +server/rpgpt # sensitive API_KEY.bat diff --git a/server/install_service.sh b/server/install_service.sh old mode 100644 new mode 100755 index cb80164..20dfde0 --- a/server/install_service.sh +++ b/server/install_service.sh @@ -1,3 +1,4 @@ -#!/user/bin/env bash - +#!/usr/bin/env bash +systemctl stop rpgpt cp rpgpt.service /etc/systemd/system/ +echo "Installed. 'systemctl start rpgpt' to run it" diff --git a/server/main.go b/server/main.go index e31cb1a..08147b1 100644 --- a/server/main.go +++ b/server/main.go @@ -14,7 +14,6 @@ var c *gogpt.Client func index(w http.ResponseWriter, req *http.Request) { //time.Sleep(4 * time.Second) - (w).Header().Set("Access-Control-Allow-Origin", "*") req.Body = http.MaxBytesReader(w, req.Body, 1024 * 1024) // no sending huge files to crash the server promptBytes, err := io.ReadAll(req.Body) if err != nil { diff --git a/server/rpgpt.service b/server/rpgpt.service index 1712d84..053d4cf 100644 --- a/server/rpgpt.service +++ b/server/rpgpt.service @@ -9,10 +9,9 @@ User=root Group=root WorkingDirectory=/root/rpgpt/server ExecStart=/usr/bin/go run . +EnvironmentFile=/root/.high_security Restart=on-failure RestartSec=10 -StandardOutput=syslog -StandardError=syslog SyslogIdentifier=appgoservice [Install]