1
2
3
4
5
6
7
8
9
10
11
..
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
..
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
...
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
|
-- vim: ft=terra
local pstr = lib.mem.ptr(int8)
local pref = lib.mem.ref(int8)
local P = lib.str.plit
local terra cs(s: rawstring)
return pstr { ptr = s, ct = lib.str.sz(s) }
end
local terra
regalia(acc: &lib.str.acc, rank: uint16)
................................................................................
case [uint16](2) then acc:lpush('🔱') end
case [uint16](3) then acc:lpush('⚜️') end
case [uint16](4) then acc:lpush('🗡') end
case [uint16](5) then acc:lpush('🗝') end
else acc:lpush('🕴')
end
end
local rnd = lib.crypt.random
local terra
suggest_handle(a: &lib.str.acc)
var start = a.sz
var puncts = array('.','_','-')
var xXx = rnd(uint8, 0, 9) == 0
var leet = rnd(uint8, 0, 8) == 0
var caps = rnd(uint8, 0, 5)
var punct: rawstring = nil
var useadj = rnd(uint8, 0, 4) == 0
if rnd(uint8, 0, 4) == 0 then
punct = puncts[rnd(intptr,0,[puncts.type.N])]
end
var nouns = array(
'thunder','bride','blaze','doom','squad','gun','lord','blaster',
'fuck','hell','hound','piss','shit','killa','terror', 'horror',
'fear', 'slaughter','murder','general','commander', 'commissar',
'terrorist','infinity','slut','cunt','whore','bitch', 'bastard',
'cock','prince','princess','pimp','gay','cop','slayer', 'vampire',
'vampyre','blood','pain','brute','wolf','sword','star','sun','moon',
'killer','murderer','thief','arson','fire','ice','frost','hack',
'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'
)
var adjs = array(
'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',
'mighty','flayed','hidden','secret','lost','mystery','glorious',
'nude','naked','bare','first','radiant','martian','fallen',
'wandering','dank','demonic','satanic','invisible','based','woke',
'deadly','lethal','heroic','evil','majestic','luminous'
)
if xXx then a:lpush('xXx_') end
if useadj then
var len = rnd(uint8,1,3)
for i = 0, len do
var sz = a.sz
a:push(adjs[rnd(intptr,0,[adjs.type.N])], 0)
if punct ~= nil then a:push(punct, 1) end
if caps == 1 then
a.buf[sz] = lib.str.cupcase(a.buf[sz])
end
end
end
var nounct = rnd(uint8,1,3)
for i = 0, nounct do
var sz = a.sz
a:push(nouns[rnd(intptr,0,[nouns.type.N])], 0)
if punct ~= nil and i+1 ~= nounct then a:push(punct, 1) end
if caps == 1 then
a.buf[sz] = lib.str.cupcase(a.buf[sz])
end
end
if leet or caps == 2 then for i=start, a.sz do
if caps == 2 and rnd(uint8,0,5)==0 then
a.buf[i] = lib.str.cupcase(a.buf[i])
end
if leet then
switch lib.str.cdowncase(a.buf[i]) do
case [uint8]([string.byte('e')]) then a.buf[i] = @'3' end
case [uint8]([string.byte('i')]) then a.buf[i] = @'1' end
case [uint8]([string.byte('l')]) then a.buf[i] = @'1' end
................................................................................
case [uint8]([string.byte('b')]) then a.buf[i] = @'6' end
end
end
end end
if (nounct == 1 and not useadj) or rnd(uint8, 0, 5) == 0 then
if punct ~= nil then a:push(punct, 1) end
a:ipush(rnd(uint16,0,65535))
end
if xXx then a:lpush('_xXx') end
end
local terra
suggest_domain(a: &lib.str.acc)
var tlds = array('tld','club','town','space','xxx')
end
local push_num_field = macro(function(acc,name,lbl,min,max,value,disable)
name = name:asvalue()
lbl = lbl:asvalue()
local start = '<div class="elem small">'
local enabled = start .. string.format('<label for="%s">%s</label><input type="number" id="%s" name="%s" min="', name, lbl, name, name)
................................................................................
ctlbox:append(&pg)
--ctlbox.name:free()
--if ctlbox.btns.ct > 0 then ctlbox.btns:free() end
return pg:finalize()
end
else
var modes = array(P'local', P'remote', P'staff', P'titled', P'peons', P'all')
var idbuf: int8[lib.math.shorthand.maxlen]
var ulst = co:stra(256)
var mode: uint8 = mode_local
var modestr = co:pgetv('show')
ulst:lpush('<div style="text-align: right"><em>showing ')
for i=0,[modes.type.N] do
if modestr:ref() and modes[i]:cmp(modestr) then mode = i end
................................................................................
ulst:lpush('</ul>')
if co.who.rights.powers.invite() or co.who.rights.invites > 0 then
ulst:lpush('<details><summary>create new user</summary><form method="post"><div class="elem"><label for="handle">handle</label><input type="text" name="handle" id="handle" placeholder="')
suggest_handle(&ulst)
ulst:lpush('"></div><button name="act" value="create">create</button></form></details>')
end
ulst:lpush('<details><summary>instantiate remote actor</summary><form method="post"><div class="elem"><label for="xid">xid</label><input type="text" name="xid" id="xid" placeholder="tweetlord@website.tld"></div><button name="act" value="inst">instantiate</button></form></details>')
return ulst:finalize()
end
do return pstr.null() end
::e404:: co:complain(404, 'not found', 'there is no user or resource by that identifier on this server') goto quit
::e403:: co:complain(403, 'forbidden', 'you do not have sufficient authority to control that resource')
::quit:: return pstr.null()
end
return render_conf_users
|
<
>
>
>
>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
>
>
|
<
|
|
|
|
|
|
|
<
>
>
|
|
|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
>
>
|
1
2
3
4
5
6
7
8
9
10
..
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
...
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
...
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
|
-- vim: ft=terra
local pstr = lib.mem.ptr(int8)
local pref = lib.mem.ref(int8)
local terra cs(s: rawstring)
return pstr { ptr = s, ct = lib.str.sz(s) }
end
local terra
regalia(acc: &lib.str.acc, rank: uint16)
................................................................................
case [uint16](2) then acc:lpush('🔱') end
case [uint16](3) then acc:lpush('⚜️') end
case [uint16](4) then acc:lpush('🗡') end
case [uint16](5) then acc:lpush('🗝') end
else acc:lpush('🕴')
end
end
local splitwords = macro(function(str)
local words = {}
for w in str:asvalue():gmatch('(%g+)') do words[#words + 1] = w end
return `arrayof(pstr, [words])
end)
local rnd = lib.crypt.random
local terra
suggest_handle(a: &lib.str.acc)
var start = a.sz
var puncts = array('.','_','-')
var xXx = rnd(uint8, 0, 9) == 0
var leet = rnd(uint8, 0, 8) == 0
var caps = rnd(uint8, 0, 10)
var punct: rawstring = nil
var useadj = rnd(uint8, 0, 4) == 0
if rnd(uint8, 0, 4) == 0 then
punct = puncts[rnd(intptr,0,[puncts.type.N])]
end
var nouns = splitwords [[
thunder bride blaze doom squad gun lord blaster
fuck hell hound piss shit killa terror horror
fear slaughter murder general commander commissar
terrorist infinity slut cunt whore bitch bastard
cock prince princess pimp gay cop slayer vampire
vampyre blood pain brute wolf sword star sun moon
killer murderer thief arson fire ice frost hack
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
]]
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
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
]]
if xXx then a:lpush('xXx_') end
if useadj then
var len = rnd(uint8,1,3)
for i = 0, len do
var sz = a.sz
a:ppush(adjs[rnd(intptr,0,[adjs.type.N])])
if punct ~= nil then a:push(punct, 1) end
if caps == 1 then
a.buf[sz] = lib.str.cupcase(a.buf[sz])
end
end
end
var nounct = rnd(uint8,1,3)
for i = 0, nounct do
var sz = a.sz
a:ppush(nouns[rnd(intptr,0,[nouns.type.N])])
if punct ~= nil and i+1 ~= nounct then a:push(punct, 1) end
if caps == 1 then
a.buf[sz] = lib.str.cupcase(a.buf[sz])
end
end
if leet or caps == 9 then for i=start, a.sz do
if caps == 9 and rnd(uint8,0,5)==0 then
a.buf[i] = lib.str.cupcase(a.buf[i])
end
if leet then
switch lib.str.cdowncase(a.buf[i]) do
case [uint8]([string.byte('e')]) then a.buf[i] = @'3' end
case [uint8]([string.byte('i')]) then a.buf[i] = @'1' end
case [uint8]([string.byte('l')]) then a.buf[i] = @'1' end
................................................................................
case [uint8]([string.byte('b')]) then a.buf[i] = @'6' end
end
end
end end
if (nounct == 1 and not useadj) or rnd(uint8, 0, 5) == 0 then
if punct ~= nil then a:push(punct, 1) end
a:ipush(rnd(uint32,0,lib.math.pow(10,rnd(uint8,1,4))))
end
if xXx then a:lpush('_xXx') end
end
local terra
suggest_domain(a: &lib.str.acc)
var words = splitwords [[
flop slop hop wiggle wriggle bug snoot boop jorts horse rad
witch witches cum code spank grump grumps slap spoop spoopy
spook wobble flip jock nerd dope dork slab drug funk gay
hex node snack weed pot slug worm fur fuzz fuzzy game gamer
rock smack drank wack wild sexy hot sin cock fuck piss man
wank fae weird woke slurp spine skull fail elf elves mom
dad dog cat kitten snake troll top bottom chungus dong wang
420 hog lover lovers best worst love hate big bigger tiny
little teeny spunky jazz wrack rump kink kinky crack meth
whore cam live over under turbo pizza rat rats crotch crank
chunky funky butt grab grabber grabbers thief steal slave
slaves hug hugs hag hags hogs wimp thieves wizard wizards
pussy pansy dark doom stank spunk dumb rage
]]
var tlds = splitwords [[
tld club town space xxx house land ranch horse com io online
shop site vip ltd win men lgbt cat adult army analytics art
associates bar bible biz black blog broker cam camp careers
catering church city coop dad date dating direct diy dog
duck dot enterprises esq estate expert express fail farm foo
forsale fun fund forum foundation gay global golf gop guru
group hangout hot industries international info investments
jobs land law life limited live lol mom network now party
porn productions pub rehab rocks school sex sexy singles
social software solutions space spot store sucks supplies
systems university vacations ventures wang website work
wow wtf world xyz soy live gym park
]]
var sub = rnd(uint8,0,10) == 0
if sub then a:ppush(words[rnd(intptr,0,[words.type.N])]):lpush('.') end
a:ppush(words[rnd(intptr,0,[words.type.N])])
if rnd(uint8,0,3) == 0 or not sub then
a:ppush(words[rnd(intptr,0,[words.type.N])])
end
a:lpush('.'):ppush(tlds[rnd(intptr,0,[tlds.type.N])])
end
local push_num_field = macro(function(acc,name,lbl,min,max,value,disable)
name = name:asvalue()
lbl = lbl:asvalue()
local start = '<div class="elem small">'
local enabled = start .. string.format('<label for="%s">%s</label><input type="number" id="%s" name="%s" min="', name, lbl, name, name)
................................................................................
ctlbox:append(&pg)
--ctlbox.name:free()
--if ctlbox.btns.ct > 0 then ctlbox.btns:free() end
return pg:finalize()
end
else
var modes = arrayof(pstr,'local', 'remote', 'staff', 'titled', 'peons', 'all')
var idbuf: int8[lib.math.shorthand.maxlen]
var ulst = co:stra(256)
var mode: uint8 = mode_local
var modestr = co:pgetv('show')
ulst:lpush('<div style="text-align: right"><em>showing ')
for i=0,[modes.type.N] do
if modestr:ref() and modes[i]:cmp(modestr) then mode = i end
................................................................................
ulst:lpush('</ul>')
if co.who.rights.powers.invite() or co.who.rights.invites > 0 then
ulst:lpush('<details><summary>create new user</summary><form method="post"><div class="elem"><label for="handle">handle</label><input type="text" name="handle" id="handle" placeholder="')
suggest_handle(&ulst)
ulst:lpush('"></div><button name="act" value="create">create</button></form></details>')
end
ulst:lpush('<details><summary>instantiate remote actor</summary><form method="post"><div class="elem"><label for="xid">xid</label><input type="text" name="xid" id="xid" placeholder="')
suggest_handle(&ulst) ulst:lpush('@') suggest_domain(&ulst)
ulst:lpush('"></div><button name="act" value="inst">instantiate</button></form></details>')
return ulst:finalize()
end
do return pstr.null() end
::e404:: co:complain(404, 'not found', 'there is no user or resource by that identifier on this server') goto quit
::e403:: co:complain(403, 'forbidden', 'you do not have sufficient authority to control that resource')
::quit:: return pstr.null()
end
return render_conf_users
|