parsav  Check-in [7af9e0961e]

Overview
Comment:defuckulate bytestream_trusted
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7af9e0961eabde0dff916b241ce4397dd568d7ac41d5b4e2d3f96d0323078ba7
User & Date: lexi on 2021-01-22 17:18:52
Other Links: manifest | tags
Context
2021-01-22
17:22
improve compose icon check-in: db0e155b9d user: lexi tags: trunk
17:18
defuckulate bytestream_trusted check-in: 7af9e0961e user: lexi tags: trunk
16:48
somewhat defuckulate build system check-in: 251b382f5c user: lexi tags: trunk
Changes

Modified render/conf/users.t from [2f981259f7] to [8a313a02c7].

   301    301   			end
   302    302   
   303    303   			if co.who.id ~= uid and co.who.rights.powers.purge() then
   304    304   				var purgeconf = co:stra(48)
   305    305   				var purgestrs = array(
   306    306   					'alpha', 'beta', 'gamma', 'delta', 'epsilon', 'eta', 'nu', 'kappa',
   307    307   					'emerald', 'carnelian', 'sapphire', 'ruby', 'amethyst', 'glory',
   308         -					'hope', 'grace', 'pearl', 'carnation', 'rose', 'peony', 'poppy'
          308  +					'hope', 'grace', 'pearl', 'carnation', 'rose', 'peony', 'poppy',
          309  +					'perihelion', 'aphelion'
   309    310   				)
   310    311   				for i=0,3 do
   311    312   					purgeconf:push(purgestrs[lib.crypt.random(intptr,0,[purgestrs.type.N])],0)
   312    313   					if i ~= 2 then purgeconf:lpush('-') end
   313    314   				end
   314    315   				cinp:lpush('<details><summary>purge account</summary><p>you have the authority to destroy this account and all its associated content irreversibly and irretrievably. if you really wish to apply such an extreme sanction, enter the confirmation string <strong style="user-select:none">'):push(purgeconf.buf,purgeconf.sz):lpush('</strong> below and press the “alter” button to begin the process.</p><div class="elem"><label for="purge">purge confirmation string</label><input type="text" id="purge" name="purgekey"></div><input type="hidden" name="purgestr" value="'):push(purgeconf.buf,purgeconf.sz):lpush('"></details>')
   315    316   				--purgeconf:free()

Modified srv.t from [113b729c73] to [c8974a3f52].

   308    308   end
   309    309   
   310    310   terra convo:stdpage(pg: convo.page) self:statpage(200, pg) end
   311    311   
   312    312   terra convo:bytestream_trusted(lockdown: bool, mime: pstring, data: lib.mem.ptr(uint8))
   313    313   	var lockhdr = "Content-Security-Policy: sandbox; default-src 'none'; form-action 'none'; navigate-to 'none';\r\n"
   314    314   	if not lockdown then lockhdr = "" end
   315         -	lib.net.mg_printf(self.con, "HTTP/1.1 200 OK\r\nContent-Type: %.*s\r\nContent-Length: %llu\r\n%sX-Content-Options: nosniff\r\n\r\n", mime.ct, mime.ptr, data.ct + 2, lockdown)
          315  +	lib.net.mg_printf(self.con, "HTTP/1.1 200 OK\r\nContent-Type: %.*s\r\nContent-Length: %llu\r\n%sX-Content-Options: nosniff\r\n\r\n", mime.ct, mime.ptr, data.ct + 2, lockhdr)
   316    316   	lib.net.mg_send(self.con, data.ptr, data.ct)
   317    317   	lib.net.mg_send(self.con, '\r\n', 2)
   318    318   end
   319    319   
   320    320   terra convo:json(data: pstring)
   321    321   	self:bytestream_trusted(false, 'application/ld+json', data:blob())
   322    322   end

Modified static/style.scss from [cb730b53e2] to [70dd348543].

   969    969   	margin: 0.3em 0;
   970    970   	details & { border: none; background: none; }
   971    971   	> input[type="radio"], > input[type="checkbox"] {
   972    972   		display: none;
   973    973   		&+label {
   974    974   			display: block;
   975    975   			flex-grow: 1;
   976         -			padding: 0.08in 0.05in;
          976  +			padding: 0.06in 0.05in;
   977    977   			margin: 0.03in;
   978         -			flex-basis: 15%;
   979    978   			cursor: pointer;
   980    979   			transition: 0.3s;
   981    980   			text-align: center;
   982    981   			border: 1px solid transparent;
   983         -			text-shadow: 1px 1px black;
          982  +			border-radius: 4px;
   984    983   			color: otone(15%);
   985         -			border-radius: 4px;
          984  +			text-shadow: 1px 1px black,
          985  +			// transition hints
          986  +				-0.04ex 0 transparent, 0.04ex 0 transparent,
          987  +				calc(-0.04ex + 1px) 1px transparent,
          988  +				calc(0.04ex + 1px) 1px transparent;
          989  +
   986    990   			&:nth-child(7n+1) { --co: -10 } //silly hack
   987    991   			&:nth-child(7n+2) { --co: -35 }
   988    992   			&:nth-child(7n+3) { --co: -20 }
   989    993   			&:nth-child(7n+4) { --co: -50 }
   990    994   			&:nth-child(7n+5) { --co: -40 }
   991    995   			&:nth-child(7n+6) { --co: -5  }
   992    996   			&:nth-child(7n+7) { --co: -25 }
................................................................................
  1000   1004   			border-bottom: 1px solid otone(-50%);
  1001   1005   			background: linear-gradient(to bottom, otone(-25%,-0.2), otone(-28%,-0.3) 35%, otone(-30%,-0.5));
  1002   1006   			color: white;
  1003   1007   			box-shadow: 0 0 0 1px tone(-60%);
  1004   1008   			&:hover {
  1005   1009   				border-top: 1px solid otone(10%);
  1006   1010   				border-bottom: 1px solid otone(-60%);
  1007         -				font-weight: bold;
         1011  +				text-shadow: -0.04ex 0 white, 0.04ex 0 white,
         1012  +					calc(-0.04ex + 1px) 1px black,
         1013  +					calc(0.04ex + 1px) 1px black; // fake bold
         1014  +				//font-weight: bold;
  1008   1015   			}
  1009   1016   		}
  1010   1017   	}
  1011   1018   }
  1012   1019   
  1013   1020   details {
  1014   1021   	//border: 1px solid tone(-60%);

Modified store.t from [0871cb7e85] to [c7ef550a1d].

    25     25   	privset = lib.set {
    26     26   		'post', 'edit', 'account', 'upload', 'artifact', 'moderate', 'admin', 'invite'
    27     27   	};
    28     28   	powerset = lib.set {
    29     29   		-- user powers -- default on
    30     30   		'login', -- not locked out
    31     31   		'visible', -- account & posts can be seen by others
           32  +		'edit'; -- edit own poasts
    32     33   		'post', -- can do poasts
    33     34   		'shout', -- posts show up on local timeline
    34     35   		'propagate', -- posts are sent to other instances
    35     36   		'artifact', -- upload, claim, and manage artifacts
    36     37   		'account', -- configure own account
    37         -		'edit'; -- edit own poasts
    38     38   		'snitch'; -- can issue badthink reports
    39     39   
    40     40   		-- admin powers -- default off
    41         -		'purge', -- permanently delete users
    42         -		'config', -- change daemon policy & config UI
    43     41   		'censor', -- dispose of badthink
           42  +		'herald', -- grant serverwide epithets and badges
           43  +		'crier', -- can promote content to the instance page
           44  +		'invite', -- *unlimited* invites
    44     45   		'discipline', -- enforced timeouts, stripping badges and epithets, punitive actions that do not permanently deprive of powers; can remove own injunctions but not others'
    45     46   		'vacate', -- can remove others' injunctions, but not apply them
    46     47   		'cred', -- alter credentials
    47     48   		'elevate', 'demote', -- change user rank, give and take powers, including the ability to log in
           49  +		'config', -- change daemon policy & config UI
    48     50   		'rebrand', -- modify site's brand identity
    49         -		'herald', -- grant serverwide epithets and badges
    50         -		'crier', -- can promote content to the instance page
    51         -		'invite' -- *unlimited* invites
           51  +		'purge' -- permanently delete users
    52     52   	};
    53     53   	prepmode = lib.enum {
    54     54   		'full','conf','admin'
    55     55   	}
    56     56   }
    57     57   
    58     58   local function setmap(set)
    59     59   	local map = {}
    60     60   	local struct pt { name:lib.mem.ptr(int8), val:set }
    61         -	for k,v in pairs(set.members) do
           61  +	for i,v in ipairs(set.members) do
    62     62   		map[#map + 1] = quote
    63     63   			var ps: set ps:clear()
    64     64   			(ps.[v] << true)
    65     65   		in pt {name = [v], val = ps} end
    66     66   	end
    67     67   	return map
    68     68   end