From: Nishi Date: Wed, 2 Oct 2024 07:31:01 +0000 (+0000) Subject: fix stuff X-Git-Url: https://git.chaotic.ninja/gitweb/nishi/?a=commitdiff_plain;h=efba158abbdeed198788005dfc7536441d5d4eeb;p=koakuma.git fix stuff git-svn-id: file:///raid/svn-personal/koakuma/trunk@17 219d0f9c-2d94-d447-890a-813e76b88fe9 --- diff --git a/Makefile b/Makefile index 3cff58a..6b9efa4 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ install: Component/* Tool/* Utility/* Static/* koakuma.cgi.in apache.conf.in $(REPLACE) Tool/launch-job.in > $(PREFIX)/bin/launch-job cp -rf Static/* $(PREFIX)/lib/koakuma/htdocs/static/ $(REPLACE) koakuma.cgi.in > $(PREFIX)/lib/koakuma/cgi-bin/koakuma.cgi - $(REPLACE) apache.conf.in > $(PREFIX)/etc/koakuma/apache.conf - cp cgi.conf $(PREFIX)/etc/koakuma/ + if [ ! -e "$(PREFIX)/etc/koakuma/apache.conf" ] ; then $(REPLACE) apache.conf.in > $(PREFIX)/etc/koakuma/apache.conf ; fi + if [ ! -e "$(PREFIX)/etc/koakuma/cgi.conf" ] ; then cp cgi.conf $(PREFIX)/etc/koakuma/ ; fi chmod +x $(PREFIX)/lib/koakuma/cgi-bin/koakuma.cgi chmod +x $(PREFIX)/bin/create-project chmod +x $(PREFIX)/bin/launch-job diff --git a/Tool/launch-job.in b/Tool/launch-job.in index 70d5bca..32ed542 100644 --- a/Tool/launch-job.in +++ b/Tool/launch-job.in @@ -23,9 +23,9 @@ foreach arg $argv { } } else { if { "$dothis" == "set-username" } { - set ::rpc::useranme "$arg" + ::rpc::set-username "$arg" } elseif { "$dothis" == "set-password" } { - set ::rpc::password "$arg" + ::rpc::set-password "$arg" } elseif { "$dothis" == "set-rpc" } { set RPC_URL "$arg" } elseif { "$name" == "" } { diff --git a/Utility/rpc.tcl b/Utility/rpc.tcl index 7fff1b8..7080f74 100644 --- a/Utility/rpc.tcl +++ b/Utility/rpc.tcl @@ -16,6 +16,8 @@ if { [info exists "env(KOAKUMA_RPC)"] } { set RPC_URL "[regsub {/+$} "$RPC_URL" ""]" namespace eval rpc { + set username "" + set password "" proc require-auth {} { global RPC_URL set tok [::http::geturl "$RPC_URL"] @@ -29,8 +31,14 @@ namespace eval rpc { return 0 } } - set username "" - set password "" + proc set-username {us} { + global username + set ::rpc::username "$us" + } + proc set-password {pw} { + global password + set ::rpc::password "$pw" + } proc ask-auth {} { global username global password