parsav  Check-in [45a6e815b1]

Overview
Comment:various bug fixes, minor additions, more silliness
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 45a6e815b118e61e7f50ef7b2daac0efc5d9c42a59bf2dc408d0596a4437d4f0
User & Date: lexi on 2021-06-22 15:18:18
Other Links: manifest | tags
Context
2021-08-13
03:27
add svgcleaner hook check-in: c73063a9ac user: lexi tags: trunk
2021-06-22
15:18
various bug fixes, minor additions, more silliness check-in: 45a6e815b1 user: lexi tags: trunk
2021-01-29
21:14
rip out json-c, replace with mjson check-in: afae276b2f user: lexi tags: trunk
Changes

Modified makefile from [5b41282a82] to [85135e69dd].

69
70
71
72
73
74
75

76
77
78
79
80
81
82
		-DMG_ENABLE_HTTP_WEBDAV=1 \
		-DMG_ENABLE_HTTP_WEBSOCKET=0

lib/mjson/mjson.o: lib/mjson/src/mjson.c lib/mjson/src/mjson.h lib/mjson
	$(CC) -c $< -o lib/mjson/mjson.o \
		-DMJSON_MAX_DEPTH=16 \
		-DMJSON_ENABLE_BASE64=0 \

		-DMJSON_ENABLE_RPC=0

lib/mbedtls/library/%.a: lib/mbedtls 
	$(MAKE) -C lib/mbedtls/library $*.a

ifeq ($(dl), git)
clone = git clone --depth 1 # save time







>







69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
		-DMG_ENABLE_HTTP_WEBDAV=1 \
		-DMG_ENABLE_HTTP_WEBSOCKET=0

lib/mjson/mjson.o: lib/mjson/src/mjson.c lib/mjson/src/mjson.h lib/mjson
	$(CC) -c $< -o lib/mjson/mjson.o \
		-DMJSON_MAX_DEPTH=16 \
		-DMJSON_ENABLE_BASE64=0 \
		-DMJSON_ENABLE_NEXT=1 \
		-DMJSON_ENABLE_RPC=0

lib/mbedtls/library/%.a: lib/mbedtls 
	$(MAKE) -C lib/mbedtls/library $*.a

ifeq ($(dl), git)
clone = git clone --depth 1 # save time

Modified mgtool.t from [f2643e6a8b] to [36fb1b8ec6].

337
338
339
340
341
342
343

344
345
346
347
348
349
350
...
365
366
367
368
369
370
371









372
373
374
375
376
377
378
			srv:setup(cnf) 
		elseif lib.str.cmp(mode.arglist(0),'conf') == 0 then
			srv:setup(cnf) 
			srv:conprep(lib.store.prepmode.conf)
			var cfmode: lib.cmdparse {
				help = {'h','display this list'};
				no_notify = {'n', "don't instruct the server to refresh its configuration cache after making changes; useful for \"transactional\" configuration changes."};

			}
			cfmode:parse(mode.arglist.ct, &mode.arglist(0))
			if cfmode.help then
				[ lib.emit(false, 1, 'usage: ', `argv[0], ' conf ', cfmode.type.helptxt.flags, ' <cmd> [<args>…]', cfmode.type.helptxt.opts, cmdhelp {
					{ 'conf set <setting> <value>', 'add or a change a server configuration parameter to the database' };
					{ 'conf get <setting>', 'report the value of a server setting' };
					{ 'conf reset <setting>', 'reset a server setting to its default value' };
................................................................................
				else goto cmderr end
			elseif cfmode.arglist.ct == 2 and
				lib.str.cmp(cfmode.arglist(0),'reset') == 0 or
				lib.str.cmp(cfmode.arglist(0),'clear') == 0 or
				lib.str.cmp(cfmode.arglist(0),'unset') == 0 then
				dlg:conf_reset(cfmode.arglist(1))
				lib.report('parameter cleared')









			elseif cfmode.arglist.ct == 3 and
				lib.str.cmp(cfmode.arglist(0),'set') == 0 then
				dlg:conf_set(cfmode.arglist(1),cfmode.arglist(2))
				lib.report('parameter set')
			else goto cmderr end

			-- successful commands fall through







>







 







>
>
>
>
>
>
>
>
>







337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
...
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
			srv:setup(cnf) 
		elseif lib.str.cmp(mode.arglist(0),'conf') == 0 then
			srv:setup(cnf) 
			srv:conprep(lib.store.prepmode.conf)
			var cfmode: lib.cmdparse {
				help = {'h','display this list'};
				no_notify = {'n', "don't instruct the server to refresh its configuration cache after making changes; useful for \"transactional\" configuration changes."};
				raw = {'r', 'print output suitable for use in scripting rather than human consumption'};
			}
			cfmode:parse(mode.arglist.ct, &mode.arglist(0))
			if cfmode.help then
				[ lib.emit(false, 1, 'usage: ', `argv[0], ' conf ', cfmode.type.helptxt.flags, ' <cmd> [<args>…]', cfmode.type.helptxt.opts, cmdhelp {
					{ 'conf set <setting> <value>', 'add or a change a server configuration parameter to the database' };
					{ 'conf get <setting>', 'report the value of a server setting' };
					{ 'conf reset <setting>', 'reset a server setting to its default value' };
................................................................................
				else goto cmderr end
			elseif cfmode.arglist.ct == 2 and
				lib.str.cmp(cfmode.arglist(0),'reset') == 0 or
				lib.str.cmp(cfmode.arglist(0),'clear') == 0 or
				lib.str.cmp(cfmode.arglist(0),'unset') == 0 then
				dlg:conf_reset(cfmode.arglist(1))
				lib.report('parameter cleared')
			elseif cfmode.arglist.ct == 2 and
				lib.str.cmp(cfmode.arglist(0),'get') == 0 then
				var val = dlg:conf(cfmode.arglist(1))
				if val:ref() then
					lib.report('parameter read')
					[ lib.emit(true, 1, `cfmode.arglist(1), ' = "', `{val.ptr,val.ct}, '"') ]
				else
					lib.warn('no such parameter present in configuration store')
				end
			elseif cfmode.arglist.ct == 3 and
				lib.str.cmp(cfmode.arglist(0),'set') == 0 then
				dlg:conf_set(cfmode.arglist(1),cfmode.arglist(2))
				lib.report('parameter set')
			else goto cmderr end

			-- successful commands fall through

Modified render/conf/users.t from [989226adbe] to [f3cbea2a5d].

49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
64
65
66
67
68



69
70
71
72
73
74
75
		hacker god master mistress slave rage freeze flayer
		pirate ninja shadow fog mist misery glory bear
		king queen empress emperor majesty space martian
		winter fall monk katana 420 warrior banana demon
		devil ghost wraith cuck legend hero heroine goblin
		gremlin troll dragon evil overlord radiance slop
		operator rage hog bog roach wizard steel madness
		reign

	]]
	var adjs = splitwords [[
		dark super supreme ultra ultimate total infinite
		omnipotent crazy final deathless immortal elite
		leet 1337 bloody fearless headless screaming insane
		brutal legendary space frozen flaming burning lazy
		mighty flayed hidden secret lost mystery glorious
		nude naked bare first radiant martian fallen bog
		wandering dank demonic satanic invisible based woke
		deadly lethal heroic evil majestic luminous ethereal
		perfect first fantastic special great steel insane
		royal imperial celestial cosmic mystic sublime



	]]

	if xXx then a:lpush('xXx_') end

	if useadj then
		var len = rnd(uint8,1,3) 
		for i = 0, len do







|
>











|
>
>
>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
		hacker god master mistress slave rage freeze flayer
		pirate ninja shadow fog mist misery glory bear
		king queen empress emperor majesty space martian
		winter fall monk katana 420 warrior banana demon
		devil ghost wraith cuck legend hero heroine goblin
		gremlin troll dragon evil overlord radiance slop
		operator rage hog bog roach wizard steel madness
		reign cosmos fantasy night day terra luna sin
		grandpa grampa gramps mom dad daddy aunt uncle
	]]
	var adjs = splitwords [[
		dark super supreme ultra ultimate total infinite
		omnipotent crazy final deathless immortal elite
		leet 1337 bloody fearless headless screaming insane
		brutal legendary space frozen flaming burning lazy
		mighty flayed hidden secret lost mystery glorious
		nude naked bare first radiant martian fallen bog
		wandering dank demonic satanic invisible based woke
		deadly lethal heroic evil majestic luminous ethereal
		perfect first fantastic special great steel insane
		royal imperial celestial cosmic mystic sublime lonely
		lonesome stellar reigning powerful russian spinning
		revolving rotating enlarged enormous gigantic huge
		nightly daily earthly lunar global
	]]

	if xXx then a:lpush('xXx_') end

	if useadj then
		var len = rnd(uint8,1,3) 
		for i = 0, len do

Modified srv.t from [d3489f68a4] to [3858e9328c].

675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
...
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
terra srv:start(iname: rawstring)
	self:conprep(lib.store.prepmode.full)
	self.cfg:init(self)
	self.pool:init(self.cfg.poolinitsz)
	var dbbind = self:conf_get(&self.pool, 'bind')
	if iname == nil then iname = lib.proc.getenv('parsav_instance') end
	if iname == nil then
		self.id = self.cfg.instance.ptr;
		-- let this leak -- it'll be needed for the lifetime of the process anyway
	else self.id = iname end 

	if iname ~= nil then
		lib.report('parsav instance "',iname,'" starting')
	end

................................................................................
	self.pol_reg = self:cfbool('policy-self-register', false)
	self.pol_autoherald = self:cfbool('policy-self-herald', true)

	do self.credmgd = false
	var fr = self._pool:frame()
	var sreg = self:cfstr('credential-store')
	if sreg:ref() then
		if lib.str.cmp(sreg.ptr, 'managed') == 0
			then self.credmgd = true
			else self.credmgd = false
		end
		self._pool:reset(fr)
	end end

	self.maxupsz = self:cffsz('maximum-artifact-size', [1024 * 100]) -- 100 kilobyte default







|







 







|







675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
...
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
terra srv:start(iname: rawstring)
	self:conprep(lib.store.prepmode.full)
	self.cfg:init(self)
	self.pool:init(self.cfg.poolinitsz)
	var dbbind = self:conf_get(&self.pool, 'bind')
	if iname == nil then iname = lib.proc.getenv('parsav_instance') end
	if iname == nil then
		self.id = self.cfg.instance:cdup()
		-- let this leak -- it'll be needed for the lifetime of the process anyway
	else self.id = iname end 

	if iname ~= nil then
		lib.report('parsav instance "',iname,'" starting')
	end

................................................................................
	self.pol_reg = self:cfbool('policy-self-register', false)
	self.pol_autoherald = self:cfbool('policy-self-herald', true)

	do self.credmgd = false
	var fr = self._pool:frame()
	var sreg = self:cfstr('credential-store')
	if sreg:ref() then
		if sreg:cmp('managed')
			then self.credmgd = true
			else self.credmgd = false
		end
		self._pool:reset(fr)
	end end

	self.maxupsz = self:cffsz('maximum-artifact-size', [1024 * 100]) -- 100 kilobyte default

Modified str.t from [bff3416286] to [37b9ad8a8d].

48
49
50
51
52
53
54
















55
56
57
58
59
60
61
		end
		terra ty:pdup(p: &lib.mem.pool): strptr
			if not @self then return strptr.null() end
			if self.ct == 0 then self.ct = m.sz(self.ptr) end
			var newstr = p:alloc(int8, self.ct)
			lib.mem.cpy(newstr.ptr, self.ptr, self.ct)
			return newstr
















		end
		terra ty:cmp(other: ty)
			if self.ptr == nil and other.ptr == nil then return true end
			if self.ptr == nil or other.ptr == nil then return false end

			var sz = lib.math.biggest(self.ct, other.ct)
			for i = 0, sz do







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
		end
		terra ty:pdup(p: &lib.mem.pool): strptr
			if not @self then return strptr.null() end
			if self.ct == 0 then self.ct = m.sz(self.ptr) end
			var newstr = p:alloc(int8, self.ct)
			lib.mem.cpy(newstr.ptr, self.ptr, self.ct)
			return newstr
		end
		terra ty:pcdup(p: &lib.mem.pool): rawstring
			if not @self then return nil end
			if self.ct == 0 then self.ct = m.sz(self.ptr) end
			var newstr = p:alloc(int8, self.ct + 1)
			lib.mem.cpy(newstr.ptr, self.ptr, self.ct)
			newstr.ptr[self.ct] = 0
			return newstr.ptr
		end
		terra ty:cdup(): rawstring
			if not @self then return nil end
			if self.ct == 0 then self.ct = m.sz(self.ptr) end
			var newstr = lib.mem.heapa(int8, self.ct + 1)
			lib.mem.cpy(newstr.ptr, self.ptr, self.ct)
			newstr.ptr[self.ct] = 0
			return newstr.ptr
		end
		terra ty:cmp(other: ty)
			if self.ptr == nil and other.ptr == nil then return true end
			if self.ptr == nil or other.ptr == nil then return false end

			var sz = lib.math.biggest(self.ct, other.ct)
			for i = 0, sz do