Dawnline 0.16.0
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / ucode static checks (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 24.10) (push) Blocked by required conditions
CI / ucode compiles and tests pass (OpenWrt 25.12) (push) Blocked by required conditions

- The personal page loads faster and costs the router less: its script
  and styles come compressed, stay in the browser until the next update,
  and the icon comes with the page instead of a request of its own
- The page uses the system's own font (SF Pro on Apple devices, Segoe UI
  on Windows, Roboto on Android) instead of downloading one
- The top of the page shows the server's name alone, so it fits on a
  phone
- Text can be selected only where it is there to be copied (addresses,
  file names, the configuration), with the name field's own selection:
  a soft highlight with handles that glides after the pointer
- Sheets scroll without a scrollbar
- Red buttons (Remove) light up under the pointer, as the others do
- Demo: "Demo" and GitHub are one button; on a phone it floats at the
  bottom of the screen, and switching scenarios no longer makes the
  edge fades jump
This commit is contained in:
Aemeath committed 2026-10-24 21:33:48 +03:00
1 parent 750564ab7e
commit 2388603322
91 files changed
+2564 -1027

No files matched your search

@@ -1,3 +0,0 @@
Geist and Geist Mono are licensed under the SIL Open Font License, Version 1.1.
Copyright (c) 2023 Vercel, in collaboration with basement.studio.
https://github.com/vercel/geist-font/blob/main/OFL.txt
@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><style>.t{fill:#0a0a0a}.g{fill:#fff}@media (prefers-color-scheme:dark){.t{fill:#fff}.g{fill:#0a0a0a}}</style><rect class="t" width="64" height="64" rx="16"/><path class="g" d="M14 38a18 18 0 0 1 36 0z"/><rect class="g" x="12" y="43" width="40" height="4" rx="2" opacity=".5"/></svg>

Before

Width:  |  Height:  |  Size: 343 B

@@ -1 +0,0 @@
@font-face{font-family:Geist;src:url(geist-latin-wght-normal.woff2) format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2190-21FF,U+2212,U+2215}@font-face{font-family:Geist;src:url(geist-cyrillic-wght-normal.woff2) format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}@font-face{font-family:Geist Mono;src:url(geist-mono-latin-wght-normal.woff2) format("woff2");font-weight:100 900;font-display:swap}:root{color-scheme:dark;--bg: #080808;--raised: #121212;--field: #161616;--knob: #232323;--seg: rgba(237, 237, 237, .05);--seg-shadow: none;--line: rgba(255, 255, 255, .06);--text: #ededed;--text-2: #8c8c8a;--text-3: #4f4f4e;--accent: #4eafff;--accent-ink: #ffffff;--accent-soft: rgba(78, 175, 255, .13);--ok: #30d158;--ok-soft: rgba(48, 209, 88, .14);--warn: #ff8d28;--bad: #ff383c;--bad-soft: rgba(255, 56, 60, .13);--sel-bg: rgba(131, 209, 255, .25);--sel-fg: #64c6ff;--scrim: rgba(8, 8, 8, .8);--glass-bg: linear-gradient(rgba(255, 255, 255, .04), rgba(255, 255, 255, .04)), rgba(0, 0, 0, .4);--glass-edge: rgba(255, 255, 255, .05);--glass-sep: rgba(255, 255, 255, .04);--glass-text: #f5f5f5;--glass-sub: #8a8a8a;--glass-bad: var(--bad);--glass-hl: color-mix(in srgb, var(--raised), var(--text) 8%);--glass-hover: color-mix(in srgb, var(--raised), var(--text) 5%);--glass-shadow: 0 0 0 transparent;--line-glass: rgba(255, 255, 255, .07);--pop-shadow: 0 18px 48px -14px rgba(0, 0, 0, .75);--sheet-shadow: 0 24px 64px -16px rgba(0, 0, 0, .6);--bar: rgba(237, 237, 237, .13);--toast: #232323;--toast-fg: #ededed;--qr-bg: #0a0a0a;--gi-a: rgba(255, 255, 255, .58);--gi-b: rgba(255, 255, 255, .14);--gi-rim: rgba(255, 255, 255, .5);--gi-edge: rgba(0, 0, 0, 0);--gi-detail: #ffffff;--t-grey-a: #cfcfcd;--t-grey-b: #5a5a59;--t-blue-a: #a6d9ff;--t-blue-b: #1d84e6;--t-green-a: #a8f29c;--t-green-b: #30d158;--t-red-a: #ffadad;--t-red-b: #ff383c;--t-orange-a: #ffc08f;--t-orange-b: #ff8d28;--font: Geist, -apple-system, system-ui, "Segoe UI", sans-serif;--mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;--r-sheet: 36px;--r-card: 28px;--r-row: 20px;--r-field: 16px;--r-tile: 12px;--ease-out: cubic-bezier(.23, 1, .32, 1);--gutter-l: max(16px, env(safe-area-inset-left, 0px));--gutter-r: max(16px, env(safe-area-inset-right, 0px))}@media(prefers-color-scheme:light){:root{color-scheme:light;--bg: #f2f2f1;--raised: #ffffff;--field: #f3f3f2;--knob: #e8e8e7;--seg: #ffffff;--seg-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 .5px rgba(0, 0, 0, .05);--line: rgba(0, 0, 0, .07);--text: #0b0b0b;--text-2: #6d6d6b;--text-3: #a6a6a4;--accent: #2b9dff;--accent-soft: rgba(43, 157, 255, .12);--ok: #30d158;--ok-soft: rgba(48, 209, 88, .12);--warn: #ff8d28;--bad: #ff383c;--bad-soft: rgba(255, 56, 60, .1);--sel-bg: rgba(78, 175, 255, .22);--sel-fg: #0a76cf;--scrim: rgba(236, 236, 235, .62);--glass-bg: rgba(245, 245, 245, .6);--glass-edge: rgba(0, 0, 0, .04);--glass-sep: rgba(0, 0, 0, .03);--glass-text: #1a1a1a;--glass-sub: #727272;--glass-hl: color-mix(in srgb, var(--raised), var(--text) 11%);--glass-hover: color-mix(in srgb, var(--raised), var(--text) 4%);--glass-shadow: 0 8px 32px rgba(0, 0, 0, .12);--line-glass: rgba(0, 0, 0, .07);--pop-shadow: 0 18px 44px -14px rgba(0, 0, 0, .2);--sheet-shadow: 0 24px 64px -18px rgba(0, 0, 0, .22);--bar: rgba(11, 11, 11, .11);--toast: #0b0b0b;--toast-fg: #f2f2f1;--qr-bg: #ffffff;--gi-a: rgba(250, 250, 249, .72);--gi-b: rgba(206, 206, 204, .5);--gi-rim: rgba(255, 255, 255, .9);--gi-edge: rgba(0, 0, 0, .11);--gi-detail: rgba(28, 28, 28, .72);--t-grey-a: #a9a9a7;--t-grey-b: #3d3d3c;--t-blue-a: #7cc4ff;--t-blue-b: #0a6fd6;--t-green-a: #82e070;--t-green-b: #30d158;--t-red-a: #ff9090;--t-red-b: #ff383c}}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;scrollbar-gutter:stable;overflow-anchor:none;touch-action:manipulation}body{margin:0;background:var(--bg);color:var(--text);font:400 15px/22px var(--font);letter-spacing:-.011em;-webkit-font-smoothing:antialiased;min-height:100vh;min-height:100dvh;cursor:default}body.locked{overflow:hidden}input,textarea,.linkrow .mono,.conf{cursor:text}::selection{background:var(--sel-bg);color:var(--sel-fg)}button{font:inherit;color:inherit;letter-spacing:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default}a{color:inherit;text-decoration:none}:focus{outline:none}.kbd :focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 65%,transparent);outline-offset:2px}[hidden]{display:none!important}.offscreen{position:fixed;left:-9999px;top:0;opacity:0}.mono{font-family:var(--mono);letter-spacing:0}.num{font-variant-numeric:tabular-nums}.ok-t{color:var(--ok)}.warn-t{color:var(--warn)}.bad-t{color:var(--bad)}.here-t{color:var(--accent)}.i{width:18px;height:18px;flex:none}.gi{width:24px;height:24px;flex:none;overflow:visible;--ta: var(Line truncated
@@ -1,6 +0,0 @@
"use strict";(()=>{var Xi=Object.create;var Xo=Object.defineProperty;var Ji=Object.getOwnPropertyDescriptor;var Zi=Object.getOwnPropertyNames;var ea=Object.getPrototypeOf,ta=Object.prototype.hasOwnProperty;var na=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var oa=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Zi(t))!ta.call(e,r)&&r!==n&&Xo(e,r,{get:()=>t[r],enumerable:!(o=Ji(t,r))||o.enumerable});return e};var ra=(e,t,n)=>(n=e!=null?Xi(ea(e)):{},oa(t||!e||!e.__esModule?Xo(n,"default",{value:e,enumerable:!0}):n,e));var qr=na((Fr,Wr)=>{"use strict";var Gr=(function(){var e=function(g,v){var u=236,d=17,l=g,b=n[v],y=null,p=0,L=null,E=[],A={},F=function(S,H){p=l*4+17,y=(function(k){for(var D=new Array(k),$=0;$<k;$+=1){D[$]=new Array(k);for(var I=0;I<k;I+=1)D[$][I]=null}return D})(p),B(0,0),B(p-7,0),B(0,p-7),Y(),q(),te(S,H),l>=7&&Z(S),L==null&&(L=Be(l,b,E)),le(L,H)},B=function(S,H){for(var k=-1;k<=7;k+=1)if(!(S+k<=-1||p<=S+k))for(var D=-1;D<=7;D+=1)H+D<=-1||p<=H+D||(0<=k&&k<=6&&(D==0||D==6)||0<=D&&D<=6&&(k==0||k==6)||2<=k&&k<=4&&2<=D&&D<=4?y[S+k][H+D]=!0:y[S+k][H+D]=!1)},N=function(){for(var S=0,H=0,k=0;k<8;k+=1){F(!0,k);var D=r.getLostPoint(A);(k==0||S>D)&&(S=D,H=k)}return H},q=function(){for(var S=8;S<p-8;S+=1)y[S][6]==null&&(y[S][6]=S%2==0);for(var H=8;H<p-8;H+=1)y[6][H]==null&&(y[6][H]=H%2==0)},Y=function(){for(var S=r.getPatternPosition(l),H=0;H<S.length;H+=1)for(var k=0;k<S.length;k+=1){var D=S[H],$=S[k];if(y[D][$]==null)for(var I=-2;I<=2;I+=1)for(var G=-2;G<=2;G+=1)I==-2||I==2||G==-2||G==2||I==0&&G==0?y[D+I][$+G]=!0:y[D+I][$+G]=!1}},Z=function(S){for(var H=r.getBCHTypeNumber(l),k=0;k<18;k+=1){var D=!S&&(H>>k&1)==1;y[Math.floor(k/3)][k%3+p-8-3]=D}for(var k=0;k<18;k+=1){var D=!S&&(H>>k&1)==1;y[k%3+p-8-3][Math.floor(k/3)]=D}},te=function(S,H){for(var k=b<<3|H,D=r.getBCHTypeInfo(k),$=0;$<15;$+=1){var I=!S&&(D>>$&1)==1;$<6?y[$][8]=I:$<8?y[$+1][8]=I:y[p-15+$][8]=I}for(var $=0;$<15;$+=1){var I=!S&&(D>>$&1)==1;$<8?y[8][p-$-1]=I:$<9?y[8][15-$-1+1]=I:y[8][15-$-1]=I}y[p-8][8]=!S},le=function(S,H){for(var k=-1,D=p-1,$=7,I=0,G=r.getMaskFunction(H),W=p-1;W>0;W-=2)for(W==6&&(W-=1);;){for(var X=0;X<2;X+=1)if(y[D][W-X]==null){var oe=!1;I<S.length&&(oe=(S[I]>>>$&1)==1);var U=G(D,W-X);U&&(oe=!oe),y[D][W-X]=oe,$-=1,$==-1&&(I+=1,$=7)}if(D+=k,D<0||p<=D){D-=k,k=-k;break}}},me=function(S,H){for(var k=0,D=0,$=0,I=new Array(H.length),G=new Array(H.length),W=0;W<H.length;W+=1){var X=H[W].dataCount,oe=H[W].totalCount-X;D=Math.max(D,X),$=Math.max($,oe),I[W]=new Array(X);for(var U=0;U<I[W].length;U+=1)I[W][U]=255&S.getBuffer()[U+k];k+=X;var we=r.getErrorCorrectPolynomial(oe),ue=i(I[W],we.getLength()-1),Yo=ue.mod(we);G[W]=new Array(we.getLength()-1);for(var U=0;U<G[W].length;U+=1){var jo=U+Yo.getLength()-G[W].length;G[W][U]=jo>=0?Yo.getAt(jo):0}}for(var Qo=0,U=0;U<H.length;U+=1)Qo+=H[U].totalCount;for(var ao=new Array(Qo),fn=0,U=0;U<D;U+=1)for(var W=0;W<H.length;W+=1)U<I[W].length&&(ao[fn]=I[W][U],fn+=1);for(var U=0;U<$;U+=1)for(var W=0;W<H.length;W+=1)U<G[W].length&&(ao[fn]=G[W][U],fn+=1);return ao},Be=function(S,H,k){for(var D=c.getRSBlocks(S,H),$=f(),I=0;I<k.length;I+=1){var G=k[I];$.put(G.getMode(),4),$.put(G.getLength(),r.getLengthInBits(G.getMode(),S)),G.write($)}for(var W=0,I=0;I<D.length;I+=1)W+=D[I].dataCount;if($.getLengthInBits()>W*8)throw"code length overflow. ("+$.getLengthInBits()+">"+W*8+")";for($.getLengthInBits()+4<=W*8&&$.put(0,4);$.getLengthInBits()%8!=0;)$.putBit(!1);for(;!($.getLengthInBits()>=W*8||($.put(u,8),$.getLengthInBits()>=W*8));)$.put(d,8);return me($,D)};A.addData=function(S,H){H=H||"Byte";var k=null;switch(H){case"Numeric":k=m(S);break;case"Alphanumeric":k=M(S);break;case"Byte":k=h(S);break;case"Kanji":k=x(S);break;default:throw"mode:"+H}E.push(k),L=null},A.isDark=function(S,H){if(S<0||p<=S||H<0||p<=H)throw S+","+H;return y[S][H]},A.getModuleCount=function(){return p},A.make=function(){if(l<1){for(var S=1;S<40;S++){for(var H=c.getRSBlocks(S,b),k=f(),D=0;D<E.length;D++){var $=E[D];k.put($.getMode(),4),k.put($.getLength(),r.getLengthInBits($.getMode(),S)),$.write(k)}for(var I=0,D=0;D<H.length;D++)I+=H[D].dataCount;if(k.getLengthInBits()<=I*8)break}l=S}F(!1,N())},A.createTableTag=function(S,H){S=S||2,H=typeof H=="undefined"?S*4:H;var k="";k+='<table style="',k+=" border-width: 0px; border-style: none;",k+=" border-collapse: collapse;",k+=" padding: 0px; margin: "+H+"px;",k+='">',k+="<tbody>";for(var D=0;D<A.getModuleCount();D+=1){k+="<tr>";for(var $=0;$<A.getModuleCount();$+=1)k+='<td style="',k+=" border-width: 0px; border-style: none;",k+=" border-collapse: collapse;",k+=" padding: 0px; margin: 0px;",k+=" width: "+S+"px;",k+=" height: "+S+"px;",k+=" background-color: ",k+=A.isDark(D,$)?"#000000":"#ffffff",k+=";",k+='"/>';k+="</tr>"}return k+="</tbody>",k+="</table>",k},A.createSvgTag=function(S,H,k,D){var $={};typeof arguments[0]=="object"&&($=arguments[0],S=$.cellSize,H=$.margin,k=$.alt,D=$.title),S=S||2,H=typeof H=="undefined"?S*4:H,k=typeof k=="string"?{text:k}:k||{Line truncated
`}return k%2&&S>0?ue.substring(0,ue.length-k-1)+Array(k+1).join("▀"):ue.substring(0,ue.length-1)};return A.createASCII=function(S,H){if(S=S||1,S<2)return Ie(H);S-=1,H=typeof H=="undefined"?S*2:H;var k=A.getModuleCount()*S+H*2,D=H,$=k-H,I,G,W,X,oe=Array(S+1).join("██"),U=Array(S+1).join(" "),we="",ue="";for(I=0;I<k;I+=1){for(W=Math.floor((I-D)/S),ue="",G=0;G<k;G+=1)X=1,D<=G&&G<$&&D<=I&&I<$&&A.isDark(W,Math.floor((G-D)/S))&&(X=0),ue+=X?oe:U;for(W=0;W<S;W+=1)we+=ue+`
`}return we.substring(0,we.length-1)},A.renderTo2dContext=function(S,H){H=H||2;for(var k=A.getModuleCount(),D=0;D<k;D++)for(var $=0;$<k;$++)S.fillStyle=A.isDark(D,$)?"black":"white",S.fillRect(D*H,$*H,H,H)},A};e.stringToBytesFuncs={default:function(g){for(var v=[],u=0;u<g.length;u+=1){var d=g.charCodeAt(u);v.push(d&255)}return v}},e.stringToBytes=e.stringToBytesFuncs.default,e.createStringToBytes=function(g,v){var u=(function(){for(var l=R(g),b=function(){var q=l.read();if(q==-1)throw"eof";return q},y=0,p={};;){var L=l.read();if(L==-1)break;var E=b(),A=b(),F=b(),B=String.fromCharCode(L<<8|E),N=A<<8|F;p[B]=N,y+=1}if(y!=v)throw y+" != "+v;return p})(),d=63;return function(l){for(var b=[],y=0;y<l.length;y+=1){var p=l.charCodeAt(y);if(p<128)b.push(p);else{var L=u[l.charAt(y)];typeof L=="number"?(L&255)==L?b.push(L):(b.push(L>>>8),b.push(L&255)):b.push(d)}}return b}};var t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},n={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},r=(function(){var g=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],v=1335,u=7973,d=21522,l={},b=function(y){for(var p=0;y!=0;)p+=1,y>>>=1;return p};return l.getBCHTypeInfo=function(y){for(var p=y<<10;b(p)-b(v)>=0;)p^=v<<b(p)-b(v);return(y<<10|p)^d},l.getBCHTypeNumber=function(y){for(var p=y<<12;b(p)-b(u)>=0;)p^=u<<b(p)-b(u);return y<<12|p},l.getPatternPosition=function(y){return g[y-1]},l.getMaskFunction=function(y){switch(y){case o.PATTERN000:return function(p,L){return(p+L)%2==0};case o.PATTERN001:return function(p,L){return p%2==0};case o.PATTERN010:return function(p,L){return L%3==0};case o.PATTERN011:return function(p,L){return(p+L)%3==0};case o.PATTERN100:return function(p,L){return(Math.floor(p/2)+Math.floor(L/3))%2==0};case o.PATTERN101:return function(p,L){return p*L%2+p*L%3==0};case o.PATTERN110:return function(p,L){return(p*L%2+p*L%3)%2==0};case o.PATTERN111:return function(p,L){return(p*L%3+(p+L)%2)%2==0};default:throw"bad maskPattern:"+y}},l.getErrorCorrectPolynomial=function(y){for(var p=i([1],0),L=0;L<y;L+=1)p=p.multiply(i([1,s.gexp(L)],0));return p},l.getLengthInBits=function(y,p){if(1<=p&&p<10)switch(y){case t.MODE_NUMBER:return 10;case t.MODE_ALPHA_NUM:return 9;case t.MODE_8BIT_BYTE:return 8;case t.MODE_KANJI:return 8;default:throw"mode:"+y}else if(p<27)switch(y){case t.MODE_NUMBER:return 12;case t.MODE_ALPHA_NUM:return 11;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 10;default:throw"mode:"+y}else if(p<41)switch(y){case t.MODE_NUMBER:return 14;case t.MODE_ALPHA_NUM:return 13;case t.MODE_8BIT_BYTE:return 16;case t.MODE_KANJI:return 12;default:throw"mode:"+y}else throw"type:"+p},l.getLostPoint=function(y){for(var p=y.getModuleCount(),L=0,E=0;E<p;E+=1)for(var A=0;A<p;A+=1){for(var F=0,B=y.isDark(E,A),N=-1;N<=1;N+=1)if(!(E+N<0||p<=E+N))for(var q=-1;q<=1;q+=1)A+q<0||p<=A+q||N==0&&q==0||B==y.isDark(E+N,A+q)&&(F+=1);F>5&&(L+=3+F-5)}for(var E=0;E<p-1;E+=1)for(var A=0;A<p-1;A+=1){var Y=0;y.isDark(E,A)&&(Y+=1),y.isDark(E+1,A)&&(Y+=1),y.isDark(E,A+1)&&(Y+=1),y.isDark(E+1,A+1)&&(Y+=1),(Y==0||Y==4)&&(L+=3)}for(var E=0;E<p;E+=1)for(var A=0;A<p-6;A+=1)y.isDark(E,A)&&!y.isDark(E,A+1)&&y.isDark(E,A+2)&&y.isDark(E,A+3)&&y.isDark(E,A+4)&&!y.isDark(E,A+5)&&y.isDark(E,A+6)&&(L+=40);for(var A=0;A<p;A+=1)for(var E=0;E<p-6;E+=1)y.isDark(E,A)&&!y.isDark(E+1,A)&&y.isDark(E+2,A)&&y.isDark(E+3,A)&&y.isDark(E+4,A)&&!y.isDark(E+5,A)&&y.isDark(E+6,A)&&(L+=40);for(var Z=0,A=0;A<p;A+=1)for(var E=0;E<p;E+=1)y.isDark(E,A)&&(Z+=1);var te=Math.abs(100*Z/p/p-50)/5;return L+=te*10,L},l})(),s=(function(){for(var g=new Array(256),v=new Array(256),u=0;u<8;u+=1)g[u]=1<<u;for(var u=8;u<256;u+=1)g[u]=g[u-4]^g[u-5]^g[u-6]^g[u-8];for(var u=0;u<255;u+=1)v[g[u]]=u;var d={};return d.glog=function(l){if(l<1)throw"glog("+l+")";return v[l]},d.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return g[l]},d})();function i(g,v){if(typeof g.length=="undefined")throw g.length+"/"+v;var u=(function(){for(var l=0;l<g.length&&g[l]==0;)l+=1;for(var b=new Array(g.length-l+v),y=0;y<g.length-l;y+=1)b[y]=g[y+l];return b})(),d={};return d.getAt=function(l){return u[l]},d.getLength=function(){return u.length},d.multiply=function(l){for(var b=new Array(d.getLength()+l.getLength()-1),y=0;y<d.getLength();y+=1)for(var p=0;p<l.getLength();p+=1)b[y+p]^=s.gexp(s.glog(d.getAt(y))+s.glog(l.getAt(p)));return i(b,0)},d.mod=function(l){if(d.ge Line truncated
`),hostName:s,mtu:n.mtu,persistent_keep_alive:n.persistent_keep_alive,port:Number(n.port),psk_key:n.psk_key,server_pub_key:n.server_pub_key},c={containers:[{container:"amnezia-awg",awg:{isThirdPartyConfig:!0,last_config:JSON.stringify(i),port:String(n.port),protocol_version:o.header_protection_key?"3.1":"2",transport_proto:"udp"}}],defaultContainer:"amnezia-awg",description:t,hostName:s};return n.dns[0]&&(c.dns1=n.dns[0],c.dns2=n.dns[1]||n.dns[0]),c}function bc(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function xc(e){let t=globalThis;if(typeof t.CompressionStream=="undefined")return null;try{let n=new t.Blob([e]).stream().pipeThrough(new t.CompressionStream("deflate")),o=new Uint8Array(await new t.Response(n).arrayBuffer()),r=new Uint8Array(4+o.length);return new DataView(r.buffer).setUint32(0,e.length,!1),r.set(o,4),r}catch{return null}}async function Oo(e,t,n=!0){let o=new TextEncoder().encode(JSON.stringify(vc(e,t))),r=n?await xc(o):null;return`vpn://${bc(r!=null?r:o)}`}var Us=e=>e.replace(/^vpn:\/\//,"");var Ys=["height","marginTop","marginBottom","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],wc={opacity:0,filter:"blur(2px)"};function js(e,t,n){let o=e.getAnimations();O(e,t,n),o.forEach(r=>r.cancel())}var Mc=new Set(["offset","computedOffset","easing","composite"]),Ec=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);function Gt(...e){let t=[],n=[],o=new Set;for(let s of e)for(let i=s;i&&!o.has(i);i=i.parentElement)if(o.add(i),!(!(i instanceof HTMLElement)||i.classList.contains("closing")))for(let c of i.getAnimations()){let f=c.playState==="running"&&c.effect instanceof KeyframeEffect?c.effect.getKeyframes():[],m=f[f.length-1];if(m&&("width"in m||"maxWidth"in m)&&n.push({a:c,t:c.currentTime}),!(m!=null&&m.height)||m.height==="0px")continue;let M=getComputedStyle(i),h={},x={};for(let w of Object.keys(m))Mc.has(w)||(h[w]=M.getPropertyValue(Ec(w)),x[w]=m[w]);t.push({el:i,a:c,t:c.currentTime,cur:h,to:x})}if(!t.length)return;[...t,...n].forEach(s=>s.a.cancel());let r=t.map(s=>getComputedStyle(s.el).height);for(let s of n)s.a.play(),s.a.currentTime=s.t;t.forEach((s,i)=>{s.a.play(),Math.abs(parseFloat(r[i])-parseFloat(String(s.to.height)))<.5?s.a.currentTime=s.t:s.a.effect.setKeyframes([s.cur,{...s.to,height:r[i]}])})}function ut(e,t={}){let n=a("div",{class:`acc${t.inset?" inset":""}`}),o=e.map((h,x)=>{var v;let w=h.body.filter(u=>!!u),C=!w.length,R=[h.icon,a("span",{class:"acc-title"},a("span",{class:"t"},h.title),(v=h.tag)!=null?v:null),h.val?a("span",{class:`acc-val${h.valHide?" hide-open":""}`},h.val):null],P=x===t.open&&!C,T=C?a("div",{class:"acc-head"},...R):a("button",{type:"button",class:"acc-head","aria-expanded":String(P),onclick:()=>M(g)},...R,V("chevron","i acc-chev")),g=a("div",{class:`acc-row${C?" still":""}${P?" open":""}${h.aside?" has-aside":""}`},T,h.aside?a("div",{class:"acc-aside"},h.aside):null,a("div",{class:"acc-body"},...w));return n.appendChild(g),g}),r=h=>h.querySelector(".acc-body"),s=()=>{let h=o.filter(x=>!x.hidden);h.forEach((x,w)=>{let C=x.classList.contains("open");x.classList.toggle("rt",w===0||C||h[w-1].classList.contains("open")),x.classList.toggle("rb",w===h.length-1||C||h[w+1].classList.contains("open"))}),o.forEach(x=>{x.classList.toggle("first",x===h[0]),x.classList.toggle("last",x===h[h.length-1])})},i=h=>{let x=getComputedStyle(h),w={};for(let C of Ys)w[C]=C==="height"?`${h.getBoundingClientRect().height}px`:x[C];return w},c=()=>o.forEach(h=>{var x;return(x=h.querySelector("button.acc-head"))==null?void 0:x.setAttribute("aria-expanded",String(h.classList.contains("open")))}),f=h=>h.classList.contains("open")||h.classList.contains("closing"),m=h=>{if(!f(h))return wc;let x=getComputedStyle(r(h));return{opacity:x.opacity,filter:x.filter==="none"?"blur(0px)":x.filter}};function M(h){var v,u;let x=o.map(i),w=o.map(m),C=(v=t.hold)==null?void 0:v.call(t);o.forEach(d=>d.getAnimations().forEach(l=>l.cancel()));let R=!h.classList.contains("open"),P=o.filter(d=>f(d)&&!(d===h&&R));o.forEach(d=>{d.classList.remove("closing"),d!==h&&d.classList.remove("open")}),h.classList.toggle("open",R),R&&h.classList.add("opened"),s();let T=Ot(),g=o.map(i);if(C==null||C(),Gt(n.parentElement),o.forEach((d,l)=>{let b=()=>{d.classList.remove("closing"),d.classList.contains("open")||d.classList.remove("opened")};if(!Ys.some(y=>x[l][y]!==g[l][y]))return b();P.includes(d)&&d.classList.add("closing"),O(d,[x[l],g[l]],{duration:he.duration,easing:he.easing}).onfinish=b}),P.forEach(d=>{let l=w[o.indexOf(d)];js(r(d),[l,{opacity:0,filter:"blur(2px)"}],{duration:160*Number(l.opacity),easing:J,fill:"forwards"})}),R){let d=w[o.indexOf(h)];js(r(h),[d,{opacity:1,filter:"blur(0px)"}],{duration:300*(1-Number(d.opacity)),easing:"cubic-bezier(0,0,.58,1)"})}Rt(T),c(),(u=t.onToggle)==null||u.call(t,o.indexOf(h),R,!1)}return s(),{el:n,openInde Line truncated
`).flatMap((h,x)=>x?[`
`,ei(h)]:[ei(h)])),o=!!at(e.filename,e.conf),r=V("key"),s=V("x"),i=a("span",{},_("Show key")),c=a("button",{type:"button",class:"btn soft sm",onclick:()=>{t=!t,ee(i,t?_("Hide key"):_("Show key")),n.querySelectorAll(".secret").forEach(h=>Xn(h,t,Js)),n.querySelectorAll(".mask").forEach(h=>Xn(h,!t,Js)),Xn(r,!t,Zs),Xn(s,t,Zs)}},ci(r,s),i),f=a("button",{type:"button",class:"btn soft sm",onclick:h=>ve(e.conf,_("Configuration copied"),h.currentTarget)},V("copy"),a("span",{class:"lbl"},_("Copy"))),m=a("div",{class:"filecard"},a("div",{class:"fc-row"},a("span",{class:"filecard-ic"},".conf"),a("span",{class:"t"},a("span",{class:"mono"},e.filename),a("span",{},_("For computers and routers")))),a("button",{type:"button",class:"btn accent sm block",onclick:()=>Xt(e.filename,e.conf)},V(o?"open":"download"),a("span",{},o?_("Share file"):_("Download")))),M=ut([{icon:ne("file"),title:_("Configuration"),body:[a("div",{class:"confbar"},c,f),n]}],{inset:!0});return a("div",{class:"step-box"},m,M.el)}function di(e){let t=a("span",{class:"osm-p"},Ee[e]),n=ds(Kt(e,"ios"),Kt(e,"android"));return{el:a("span",{class:"scanline"},a("span",{},...ht(_("In %s:"),t)),n.el),set(o){ee(t,Ee[o],void 0,{whole:!0}),n.set(Kt(o,"ios"),Kt(o,"android"))}}}function ui(e){let t=a("span",{class:"tt"}),n=a("span",{class:"tt-m"}),o=a("span",{class:"hp-tip","aria-hidden":"true"},t,n),r=a("button",{type:"button",class:"hp-b",onclick:()=>Xt(e().file,e().text)},V("download")),s=a("button",{type:"button",class:"hp-b"},V("copy")),i=a("div",{class:"hpill",role:"group","aria-label":_("The connection"),"data-key":"conn"},r,s,o),c=null,f=0,m=0,M=l=>{var b;return l===s&&s.classList.contains("done")?_("Copied"):(b=l.getAttribute("aria-label"))!=null?b:""},h=(l,b)=>{n.textContent=b;let y=n.offsetWidth+20;return Math.min(l.offsetLeft+l.offsetWidth/2,i.offsetWidth+30-y/2)},x=l=>`translateX(${l}px) translateX(-50%)`,w=()=>{let l=getComputedStyle(o);return{opacity:l.opacity,filter:l.filter==="none"?"blur(0px)":l.filter,transform:l.transform}},C=(l,b)=>{let y=o.getAnimations();O(o,l,b),y.forEach(p=>p.cancel())},R=l=>{let b=w();o.style.transform=x(l),C([b,{opacity:1,filter:"blur(0px)",transform:x(l)}],{duration:K.duration,easing:K.easing})},P=l=>ee(t,l),T=l=>{if(clearTimeout(f),c===l&&o.classList.contains("on"))return;if(c=l,o.classList.contains("on")||+getComputedStyle(o).opacity>0){let y=M(l);return o.classList.add("on"),R(h(l,y)),P(y)}let b=()=>{let y=M(l);se(t,y);let p=h(l,y);o.style.transform=x(p),o.classList.add("on"),C([{opacity:0,transform:`${x(p)} translateY(-3px) scale(.96)`,filter:"blur(3px)"},{opacity:1,transform:x(p),filter:"blur(0px)"}],{duration:220,easing:Q})};performance.now()<m?b():f=window.setTimeout(b,420)},g=()=>{if(clearTimeout(f),c=null,!o.classList.contains("on"))return;m=performance.now()+500;let l=w();o.classList.remove("on"),C([l,{...l,opacity:0}],{duration:120,easing:"ease-out"})};for(let l of[r,s])l.addEventListener("pointerenter",b=>{b.pointerType==="mouse"&&T(l)}),l.addEventListener("focus",()=>{l.matches(":focus-visible")&&T(l)}),l.addEventListener("blur",b=>{i.contains(b.relatedTarget)||g()});i.addEventListener("pointerleave",g);let v=l=>{let b=V(l);s.querySelector("svg").replaceWith(b),O(b,[{opacity:0,transform:"scale(.6)",filter:"blur(3px)"},{opacity:1,transform:"none",filter:"none"}],{duration:Fe.duration,easing:Fe.easing})},u=()=>{if(c!==s||!o.classList.contains("on"))return;let l=M(s);R(h(s,l)),P(l)},d=0;return s.addEventListener("click",()=>{let l=e();ve(l.text,l.msg),clearTimeout(d),s.classList.contains("done")||(s.classList.add("done"),v("check"),u()),d=window.setTimeout(()=>{s.classList.remove("done"),v("copy"),u()},1600)}),{el:i,sync(){let l=e().app;r.setAttribute("aria-label",z(_("Download %s config"),l)),s.setAttribute("aria-label",z(_("Copy %s config"),l))}}}function pi(e,t){var n,o,r;return e?((n=e.setup)==null?void 0:n.state)==="trying"?"trying":e.handshake<=t?"waiting":((o=e.setup)==null?void 0:o.state)==="flowing"?"connected":((r=e.setup)==null?void 0:r.state)==="nodata"?"nodata":"waiting":"waiting"}function Tc(e,t){switch(e){case"trying":return[_("Unable to complete the handshake"),_("Your network may be blocking the connection.")];case"connected":return[z(_("%s connected"),t.name),""];case"nodata":return[_("Handshake complete, but no data"),_("The router drops its traffic: the address does not match.")];case"waiting":return[_("Waiting for the connection"),""]}}var fi={waiting:"",trying:"trying",connected:"done",nodata:"nodata"};function hi(e){let t=a("b",{},_("Waiting for the connection")),n=a("span",{class:"ws",hidden:!0}),o=a("span",{class:"t"},t,n),r=a("div",{class:"way-text"},o),s=a("span",{class:"way-track"},a("span",{class:"way-glow"},a("span",{class:"run"},a("i")),a("span",{class:"knock"},a("i"))),a("span",{class:"way-fill"}),a("span",{class:"way-break"},a("i"))),i=a("div",{class:"way",role:"status","aria-live":"polite"},a("div",{class:"way-row"},a("span",{class:"way-end"},V(e.kind)),s,a("span",{class:"way-end ho Line truncated
@@ -9,7 +9,7 @@ import { serve } from 'dawnline.portal';
let env = {};
for (let k in [ 'REQUEST_METHOD', 'REQUEST_URI', 'REMOTE_ADDR', 'HTTPS', 'CONTENT_LENGTH', 'CONTENT_TYPE',
'HTTP_HOST', 'HTTP_ORIGIN', 'HTTP_USER_AGENT', 'HTTP_ACCEPT', 'HTTP_ACCEPT_LANGUAGE',
'HTTP_HOST', 'HTTP_ORIGIN', 'HTTP_USER_AGENT', 'HTTP_ACCEPT', 'HTTP_ACCEPT_LANGUAGE', 'HTTP_ACCEPT_ENCODING',
// The visitor behind Cloudflare (believed only when REMOTE_ADDR is Cloudflare's).
'HTTP_CF_CONNECTING_IP' ])
env[k] = getenv(k);
@@ -1,7 +1,7 @@
// Dawnline — the personal portal.
//
// GET /<code> the app shell
// GET /<code>/assets/<file> its script, styles and fonts
// GET /<code>/assets/<file> its script and styles (gzipped when the browser takes it)
// GET /<code>/api/state
// POST /<code>/api/devices { name, kind, public_key?, lan_bypass? }
// GET /<code>/api/devices/<id>/config
@@ -45,7 +45,7 @@ import { _ } from 'dawnline.i18n';
const RATE = `${RUN_DIR}/portal-rate.json`;
const ASSETS = '/usr/share/dawnline/portal/assets';
const TYPES = { js: 'text/javascript', css: 'text/css', svg: 'image/svg+xml', woff2: 'font/woff2', png: 'image/png' };
const TYPES = { js: 'text/javascript', css: 'text/css', png: 'image/png' };
const FAIL_LIMIT = 8;
const FAIL_WINDOW = 900;
// All Cloudflare visitors together (three-word codes can't be guessed anyway).
@@ -263,12 +263,15 @@ function place(r) {
/** The app shell; it reads the code from its own URL and sends it along. */
function shell(r) {
// The build's time joins the version so every update busts the hour-long asset cache.
// The build's time joins the version: every update gives the assets new URLs, so they are cached for good.
let v = `?v=${VERSION}.${stat(`${ASSETS}/portal.js`)?.mtime ?? 0}`;
let base = r.base, title = place(r);
// The icon goes in the page: a request of its own would start another CGI process.
let icon = readfile(`${ASSETS}/icon.svg`);
let favicon = icon ? `<link rel="icon" href="data:image/svg+xml;base64,${b64enc(icon)}" type="image/svg+xml">\n` : '';
headers(r, '200 OK', {
'Content-Type': 'text/html; charset=utf-8',
'Content-Security-Policy': "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data: blob:; font-src 'self'; " +
'Content-Security-Policy': "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data: blob:; " +
"connect-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'",
});
r.io.write(`<!doctype html>
@@ -279,8 +282,7 @@ function shell(r) {
<meta name="color-scheme" content="light dark">
<meta name="robots" content="noindex, nofollow">
<title>${html_escape(title)}</title>
<link rel="icon" href="${base}/assets/icon.svg${v}" type="image/svg+xml">
<link rel="stylesheet" href="${base}/assets/portal.css${v}">
${favicon}<link rel="stylesheet" href="${base}/assets/portal.css${v}">
</head>
<body>
<div id="app" data-base="${html_escape(base)}" data-title="${html_escape(title)}"></div>
@@ -291,13 +293,18 @@ function shell(r) {
finish();
}
/** Script, styles, icon and fonts (kept outside the web root). */
/** Script and styles (kept outside the web root); the shell's ?v= changes with every build, so they never go stale. */
function asset(r, name) {
let ext = match(name, /^[a-z0-9-]+\.(js|css|svg|woff2|png)$/)?.[1];
let data = ext ? readfile(`${ASSETS}/${name}`) : null;
let ext = match(name, /^[a-z0-9-]+\.(js|css|png)$/)?.[1];
// The build keeps a gzipped copy beside each: a third of the bytes for a browser that takes it.
let gz = ext && r.gzip ? readfile(`${ASSETS}/${name}.gz`) : null;
let data = gz ?? (ext ? readfile(`${ASSETS}/${name}`) : null);
if (data == null)
not_found(r);
headers(r, '200 OK', { 'Content-Type': TYPES[ext], 'Cache-Control': 'private, max-age=3600' });
let h = { 'Content-Type': TYPES[ext], 'Cache-Control': 'private, max-age=31536000, immutable', 'Vary': 'Accept-Encoding' };
if (gz != null)
h['Content-Encoding'] = 'gzip';
headers(r, '200 OK', h);
r.io.write(data);
finish();
}
@@ -519,6 +526,7 @@ export function handle(io) {
hsts: https && (match(host, /:([0-9]+)$/)?.[1] ?? '443') == '443',
person: null,
base: '',
gzip: match(lc(header('accept-encoding') ?? ''), /(^|[ ,])gzip([ ;,]|$)/) != null,
};
let segs = filter(split(path, '/'), (s) => s != '');
@@ -5,7 +5,7 @@
import { open, readfile, writefile, rename, mkdir, stat, unlink, popen, lsdir } from 'fs';
import { _ } from 'dawnline.i18n';
export const VERSION = '0.15.1';
export const VERSION = '0.16.0';
/** GitHub repository with Dawnline releases (updates and the installer). */
export const REPO = 'tickcount/luci-app-dawnline';
export const RUN_DIR = '/var/run/dawnline';