summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-04-30 12:53:57 +0800
committerruki <[email protected]>2022-04-30 12:53:57 +0800
commit43339a13dfdd9ba6c3f1aeefe8f783a08173dd2f (patch)
tree9f4521ec124ad11feed1dfae86997724d578628f
parent1546206045844f3b78244a55fa0771c30d10387d (diff)
init auth
-rw-r--r--xmake/modules/private/service/config.lua12
1 files changed, 9 insertions, 3 deletions
diff --git a/xmake/modules/private/service/config.lua b/xmake/modules/private/service/config.lua
index b944a1801..73b203c05 100644
--- a/xmake/modules/private/service/config.lua
+++ b/xmake/modules/private/service/config.lua
@@ -20,12 +20,16 @@
-- imports
import("core.base.global")
+import("core.base.base64")
+import("core.base.bytes")
-- generate a default config file
function _generate_configfile()
local filepath = configfile()
assert(not _g.configs and not os.isfile(filepath))
local servicedir = path.join(global.directory(), "service")
+ local initauth = base64.encode("root:000000")
+ initauth = hash.sha256(bytes(initauth))
local configs = {
logfile = path.join(servicedir, "logs.txt"),
server = {
@@ -33,7 +37,8 @@ function _generate_configfile()
-- "127.0.0.1"
},
auths = {
- -- "a7b198c3ddf355c59e9221d13305314b4b05130a2967dc76f66a59759bcc3250"
+ -- initialized user and password, root:000000
+ initauth
}
},
remote_build = {
@@ -42,8 +47,9 @@ function _generate_configfile()
workdir = path.join(servicedir, "remote_build"),
},
client = {
- -- with authorization: "[email protected]:9691"
- connect = "127.0.0.1:9691"
+ -- without authorization: "127.0.0.1:9691"
+ -- with authorization: "[email protected]:9691"
+ connect = "[email protected]:9691"
}
}
}