From: Johannes Keßler Date: Mon, 20 Feb 2023 09:20:42 +0000 (+0100) Subject: working go cli client X-Git-Tag: 1.1~13 X-Git-Url: http://91.132.146.200/gitweb/?a=commitdiff_plain;h=d6b2fd401255e75ae7f9c9bd725143c722a0dc56;p=scientia.git working go cli client --- diff --git a/CHANGELOG b/CHANGELOG index bdea360..d92bdd5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,7 @@ + PHP 8.1 stuff + Search + Updated clients. A cli and tui client written in Go. - + + API fixes 1.0 Lykos - 2022-11-12 + Initial release diff --git a/client/go-cli/Makefile b/client/go-cli/Makefile index 7d554b6..c1205f4 100644 --- a/client/go-cli/Makefile +++ b/client/go-cli/Makefile @@ -1,7 +1,3 @@ -# Determine this makefile's path. -# Be sure to place this BEFORE `include` directives, if any. -THIS_FILE := $(lastword $(MAKEFILE_LIST)) - all: @echo "Options are: build and buildall" diff --git a/client/go-cli/README b/client/go-cli/README index 306ab15..a8b2fc3 100644 --- a/client/go-cli/README +++ b/client/go-cli/README @@ -6,7 +6,7 @@ This is a very simple, with limited experience written, go program. Use at own risk and feel free to improve. # Howto build -Nothing special, just "go build -o scientia-cli" to use your own arch settings. +Nothing special, just use the provide Makefile or directly "go build -o scientia-cli" to use your current os/arch settings. # Usage At first usage you need to create the config and the individual secret. @@ -14,13 +14,12 @@ Run $scientia-cli -create-config-file to create the default config file. The path to the config file is printed. Change the host address and update your server it with the secret, which is randomly created. - Read from a file $ scientia-cli file.txt or piped $ cat file.txt | scientia-cli -Commandline arguments: +Commandline arguments (optional): -create-config-file Create default config file -debug diff --git a/client/go-cli/scientia-cli.go b/client/go-cli/scientia-cli.go index 44864a9..837bd78 100644 --- a/client/go-cli/scientia-cli.go +++ b/client/go-cli/scientia-cli.go @@ -8,7 +8,6 @@ import ( "fmt" "gopkg.in/yaml.v2" "io" - "io/ioutil" "log" "math/rand" "net/http" @@ -18,7 +17,7 @@ import ( /** * scientia * - * Copyright 2022 Johannes Keßler + * Copyright 2023 Johannes Keßler * * https://www.bananas-playground.net/projekt/scientia/ * @@ -254,7 +253,7 @@ func getInput() string { log.Println("data is being piped") } - bytes, _ := ioutil.ReadAll(os.Stdin) + bytes, _ := io.ReadAll(os.Stdin) inputString = string(bytes) } } diff --git a/webroot/api.php b/webroot/api.php index 3f5583b..2791c29 100644 --- a/webroot/api.php +++ b/webroot/api.php @@ -49,8 +49,6 @@ require_once('lib/summoner.class.php'); if(DEBUG) error_log("Dump SERVER ".var_export($_SERVER,true)); -if(DEBUG) error_log("Dump SERVER ".var_export($_SERVER['REQUEST_METHOD'],true)); -if(DEBUG) error_log("Dump SERVER ".var_export($_SERVER['CONTENT_TYPE'],true)); ## check if request is valid $_create = false; $filteredData = '';