Bunch of little fixes for beta release

main
parent 616cceb49c
commit 6bfe5d73ae

@ -370,8 +370,8 @@
"rotation":0,
"visible":true,
"width":32,
"x":520.833333333333,
"y":577.5
"x":564.833333333333,
"y":457
},
{
"class":"",
@ -493,17 +493,6 @@
"width":32,
"x":482.666666666667,
"y":433.333333333333
},
{
"class":"",
"height":32,
"id":15,
"name":"OldMan",
"rotation":0,
"visible":true,
"width":32,
"x":581,
"y":584
}],
"opacity":1,
"type":"objectgroup",

@ -9,11 +9,12 @@ call run_codegen.bat || goto :error
set FLAGS=-s TOTAL_STACK=5242880
copy marketing_page\favicon.ico build_web_release\favicon.ico
copy marketing_page\eye_closed.svg build_web_release\eye_closed.svg
copy marketing_page\eye_open.svg build_web_release\eye_open.svg
echo Building release
@echo on
emcc -sEXPORTED_FUNCTIONS=_main,_end_text_input,_stop_controlling_input,_start_controlling_input,_read_from_save_data,_dump_save_data,_in_dialog -sEXPORTED_RUNTIME_METHODS=ccall,cwrap -DNDEBUG -O2 -s ALLOW_MEMORY_GROWTH %FLAGS% -Ithirdparty -Igen main.c -o build_web_release\index.html --preload-file assets --shell-file web_template.html || goto :error
@echo off
echo Built
goto :EOF

@ -133,7 +133,7 @@ typedef struct AnimatedSprite
#ifdef DEVTOOLS
#define SERVER_URL "http://localhost:8090"
#else
#define SERVER_URL "https://rpgpt.duckdns.org/completion"
#define SERVER_URL "https://rpgpt.duckdns.org"
#endif
#include "makeprompt.h"
@ -2751,9 +2751,11 @@ void frame(void)
#ifdef WEB
// fire off generation request, save id
BUFF(char, 512) completion_server_url = {0};
printf_buff(&completion_server_url, "%s/completion", SERVER_URL);
int req_id = EM_ASM_INT({
return make_generation_request(UTF8ToString($1), UTF8ToString($0));
}, SERVER_URL, prompt.data);
}, completion_server_url, prompt.data);
it->gen_request_id = req_id;
#endif

@ -38,7 +38,7 @@ const (
type User struct {
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
DeletedAt gorm.DeletedAt `gorm:"completion"`
Code codes.UserCode `gorm:"primaryKey"` // of maximum value max codes, incremented one by one. These are converted to 4 digit alphanumeric code users can remember/use
BoughtTime int64 // unix time. Used to figure out if the pass is still valid
@ -240,7 +240,7 @@ func checkout(w http.ResponseWriter, req *http.Request) {
}
}
func index(w http.ResponseWriter, req *http.Request) {
func completion(w http.ResponseWriter, req *http.Request) {
req.Body = http.MaxBytesReader(w, req.Body, 1024 * 1024) // no sending huge files to crash the server
if doCors {
w.Header().Set("Access-Control-Allow-Origin", "*")
@ -256,6 +256,8 @@ func index(w http.ResponseWriter, req *http.Request) {
if len(splitBody) != 2 {
w.WriteHeader(http.StatusBadRequest)
log.Println("Weird body length %d not 2\n", len(splitBody))
return
}
var promptString string = splitBody[1]
var userToken string = splitBody[0]
@ -405,7 +407,7 @@ func main() {
doCors = os.Getenv("CORS") != ""
c = gogpt.NewClient(api_key)
http.HandleFunc("/", index)
http.HandleFunc("/completion", completion)
http.HandleFunc("/webhook", webhookResponse)
http.HandleFunc("/checkout", checkout)

@ -9,7 +9,7 @@ User=root
Group=root
WorkingDirectory=/root/rpgpt/server
ExecStart=/usr/bin/go run .
EnvironmentFile=/root/.high_security
EnvironmentFile=/root/.high_security_vars
Restart=on-failure
RestartSec=10
SyslogIdentifier=appgoservice

Loading…
Cancel
Save