safely-serve 0.0.22 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/libsafely-serve/fs-worker.js +1 -1
- package/dist/libsafely-serve/libsafely-serve.js +1 -1
- package/dist/safely-serve/fs-worker.js +1 -1
- package/dist/safely-serve/safely-serve.js +1 -1
- package/eslint.config.mjs +4 -2
- package/libsafely-serve +69 -7
- package/libsafely-serve.webpack.config.cjs +2 -0
- package/package.json +14 -4
- package/safely-serve +236 -82
- package/webpack.config.cjs +29 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={314(e,t,r){r.a(e,async(e,t)=>{try{(0,(await r.e(10).then(()=>r(10))).startSyncAgent)(),t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,s,c)=>{let a;c&&((a=[]).d=-1);const i=new Set,l=r.exports;let u,p,f;const d=new Promise((e,t)=>{f=t,p=e});d[t]=l,d[e]=e=>(a&&e(a),i.forEach(e),d.catch(e=>{})),r.exports=d,s(r=>{let s;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const s=[];s.d=0,r.then(e=>{c[t]=e,n(s)},e=>{c[o]=e,n(s)});const c={};return c[e]=e=>e(s),c}}const s={};return s[e]=e=>{},s[t]=r,s}))(r);const c=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{s=()=>t(c),s.r=0;const r=e=>e!==a&&!i.has(e)&&(i.add(e),e&&!e.d&&(s.r++,e.push(s)));u.forEach(t=>t[e](r))});return s.r?l:c()},e=>(e?f(d[o]=e):p(l),n(a))),a?.d<0&&(a.d=0)}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],s=t[o++],c=0===s?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:s};r.o(e,n)||Object.defineProperty(e,n,c)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>
|
|
1
|
+
(()=>{"use strict";var e={314(e,t,r){r.a(e,async(e,t)=>{try{(0,(await r.e(10).then(()=>r(10))).startSyncAgent)(),t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,s,c)=>{let a;c&&((a=[]).d=-1);const i=new Set,l=r.exports;let u,p,f;const d=new Promise((e,t)=>{f=t,p=e});d[t]=l,d[e]=e=>(a&&e(a),i.forEach(e),d.catch(e=>{})),r.exports=d,s(r=>{let s;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const s=[];s.d=0,r.then(e=>{c[t]=e,n(s)},e=>{c[o]=e,n(s)});const c={};return c[e]=e=>e(s),c}}const s={};return s[e]=e=>{},s[t]=r,s}))(r);const c=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{s=()=>t(c),s.r=0;const r=e=>e!==a&&!i.has(e)&&(i.add(e),e&&!e.d&&(s.r++,e.push(s)));u.forEach(t=>t[e](r))});return s.r?l:c()},e=>(e?f(d[o]=e):p(l),n(a))),a?.d<0&&(a.d=0)}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],s=t[o++],c=0===s?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:s};r.o(e,n)||Object.defineProperty(e,n,c)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>{const t=[];return r.f.j(e,t),Promise.all(t)},r.u=e=>e+".fs-worker.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="safely-serve:";r.l=(o,n,s,c)=>{if(e[o])return void e[o].push(n);let a,i;if(void 0!==s){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const r=e[l];if(r.getAttribute("src")==o||r.getAttribute("data-webpack")==t+s){a=r;break}}}a||(i=!0,a=document.createElement("script"),a.charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",t+s),a.src=o),e[o]=[n];const u=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);const n=e[o];if(delete e[o],a.parentNode?.removeChild(a),n?.forEach(e=>e(r)),t)return t(r)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),i&&document.head.appendChild(a)}})(),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;r.g.importScripts&&(e=r.g.location+"");const t=r.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const r=t.getElementsByTagName("script");if(r.length){let t=r.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=r[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),r.p=e})(),(()=>{const e={792:0};r.f.j=(t,o)=>{let n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{const s=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=s);const c=new Error,a=o=>{if(r.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){const e=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;c.message="Loading chunk "+t+" failed.\n("+e+": "+r+")",c.name="ChunkLoadError",c.type=e,c.request=r,c.event=o,n[1](c)}};r.l(r.p+r.u(t),a,"chunk-"+t,t)}};const t=(t,o)=>{let[n,s,c]=o;var a,i,l=0;if(n.some(t=>0!==e[t])){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);c&&c(r)}for(t&&t(o);l<n.length;l++)i=n[l],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0},o=self.webpackChunksafely_serve=self.webpackChunksafely_serve||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r(314)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={95(e,t,r){r.a(e,async(e,t)=>{try{const e=await r.e(35).then(()=>r(35)),o=(e._dirname,e._file_exists,e._mkdir,e._msg_info,e._require),{spawn:n}=await o("node:child_process");(await o("cert-tools"))._cert_gen,(await o("js-sha256")).sha256,t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,s,c)=>{let
|
|
1
|
+
(()=>{"use strict";var e={95(e,t,r){r.a(e,async(e,t)=>{try{const e=await r.e(35).then(()=>r(35)),o=(e._dirname,e._echo,e._echo2,e._file_exists,e._global_get,e._mkdir,e._msg_error,e._msg_info,e._require),{spawn:n}=await o("node:child_process");(await o("cert-tools"))._cert_gen,(await o("js-sha256")).sha256,t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,s,c)=>{let a;c&&((a=[]).d=-1);const i=new Set,l=r.exports;let u,f,p;const d=new Promise((e,t)=>{p=t,f=e});d[t]=l,d[e]=e=>(a&&e(a),i.forEach(e),d.catch(e=>{})),r.exports=d,s(r=>{let s;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const s=[];s.d=0,r.then(e=>{c[t]=e,n(s)},e=>{c[o]=e,n(s)});const c={};return c[e]=e=>e(s),c}}const s={};return s[e]=e=>{},s[t]=r,s}))(r);const c=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{s=()=>t(c),s.r=0;const r=e=>e!==a&&!i.has(e)&&(i.add(e),e&&!e.d&&(s.r++,e.push(s)));u.forEach(t=>t[e](r))});return s.r?l:c()},e=>(e?p(d[o]=e):f(l),n(a))),a?.d<0&&(a.d=0)}})(),(()=>{const e=Object.getPrototypeOf;let t;r.t=function(o,n){if(1&n&&(o=this(o)),8&n)return o;if("object"==typeof o&&o){if(4&n&&o.__esModule)return o;if(16&n&&"function"==typeof o.then)return o}const s=Object.create(null);r.r(s);const c={};t=t||[null,e({}),e([]),e(e)];for(var a=2&n&&o;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(e=>c[e]=()=>o[e]);return c.default=()=>o,r.d(s,c),s}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],s=t[o++],c=0===s?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:s};r.o(e,n)||Object.defineProperty(e,n,c)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>{const t=[];return r.f.j(e,t),Promise.all(t)},r.u=e=>e+".libsafely-serve.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="safely-serve:";r.l=(o,n,s,c)=>{if(e[o])return void e[o].push(n);let a,i;if(void 0!==s){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const r=e[l];if(r.getAttribute("src")==o||r.getAttribute("data-webpack")==t+s){a=r;break}}}a||(i=!0,a=document.createElement("script"),a.charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",t+s),a.src=o),e[o]=[n];const u=(t,r)=>{a.onerror=a.onload=null,clearTimeout(f);const n=e[o];if(delete e[o],a.parentNode?.removeChild(a),n?.forEach(e=>e(r)),t)return t(r)},f=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),i&&document.head.appendChild(a)}})(),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;r.g.importScripts&&(e=r.g.location+"");const t=r.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const r=t.getElementsByTagName("script");if(r.length){let t=r.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=r[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),r.p=e})(),(()=>{const e={792:0};r.f.j=(t,o)=>{let n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{const s=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=s);const c=new Error,a=o=>{if(r.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){const e=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;c.message="Loading chunk "+t+" failed.\n("+e+": "+r+")",c.name="ChunkLoadError",c.type=e,c.request=r,c.event=o,n[1](c)}};r.l(r.p+r.u(t),a,"chunk-"+t,t)}};const t=(t,o)=>{let[n,s,c]=o;var a,i,l=0;if(n.some(t=>0!==e[t])){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);c&&c(r)}for(t&&t(o);l<n.length;l++)i=n[l],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0},o=self.webpackChunksafely_serve=self.webpackChunksafely_serve||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r(95)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={314(e,t,r){r.a(e,async(e,t)=>{try{(0,(await r.e(10).then(()=>r(10))).startSyncAgent)(),t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,s,c)=>{let a;c&&((a=[]).d=-1);const i=new Set,l=r.exports;let u,p,f;const d=new Promise((e,t)=>{f=t,p=e});d[t]=l,d[e]=e=>(a&&e(a),i.forEach(e),d.catch(e=>{})),r.exports=d,s(r=>{let s;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const s=[];s.d=0,r.then(e=>{c[t]=e,n(s)},e=>{c[o]=e,n(s)});const c={};return c[e]=e=>e(s),c}}const s={};return s[e]=e=>{},s[t]=r,s}))(r);const c=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{s=()=>t(c),s.r=0;const r=e=>e!==a&&!i.has(e)&&(i.add(e),e&&!e.d&&(s.r++,e.push(s)));u.forEach(t=>t[e](r))});return s.r?l:c()},e=>(e?f(d[o]=e):p(l),n(a))),a?.d<0&&(a.d=0)}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],s=t[o++],c=0===s?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:s};r.o(e,n)||Object.defineProperty(e,n,c)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>
|
|
1
|
+
(()=>{"use strict";var e={314(e,t,r){r.a(e,async(e,t)=>{try{(0,(await r.e(10).then(()=>r(10))).startSyncAgent)(),t()}catch(e){t(e)}},1)}};const t={};function r(o){const n=t[o];if(void 0!==n)return n.exports;const s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}r.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),o=Symbol("webpack error"),n=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(r,s,c)=>{let a;c&&((a=[]).d=-1);const i=new Set,l=r.exports;let u,p,f;const d=new Promise((e,t)=>{f=t,p=e});d[t]=l,d[e]=e=>(a&&e(a),i.forEach(e),d.catch(e=>{})),r.exports=d,s(r=>{let s;u=(r=>r.map(r=>{if(null!==r&&"object"==typeof r){if(r[e])return r;if(r.then){const s=[];s.d=0,r.then(e=>{c[t]=e,n(s)},e=>{c[o]=e,n(s)});const c={};return c[e]=e=>e(s),c}}const s={};return s[e]=e=>{},s[t]=r,s}))(r);const c=()=>u.map(e=>{if(e[o])throw e[o];return e[t]}),l=new Promise(t=>{s=()=>t(c),s.r=0;const r=e=>e!==a&&!i.has(e)&&(i.add(e),e&&!e.d&&(s.r++,e.push(s)));u.forEach(t=>t[e](r))});return s.r?l:c()},e=>(e?f(d[o]=e):p(l),n(a))),a?.d<0&&(a.d=0)}})(),r.d=(e,t)=>{if(Array.isArray(t))for(var o=0;o<t.length;){var n=t[o++],s=t[o++],c=0===s?{enumerable:!0,value:t[o++]}:{enumerable:!0,get:s};r.o(e,n)||Object.defineProperty(e,n,c)}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>{const t=[];return r.f.j(e,t),Promise.all(t)},r.u=e=>e+".fs-worker.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="safely-serve:";r.l=(o,n,s,c)=>{if(e[o])return void e[o].push(n);let a,i;if(void 0!==s){const e=document.getElementsByTagName("script");for(var l=0;l<e.length;l++){const r=e[l];if(r.getAttribute("src")==o||r.getAttribute("data-webpack")==t+s){a=r;break}}}a||(i=!0,a=document.createElement("script"),a.charset="utf-8",r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",t+s),a.src=o),e[o]=[n];const u=(t,r)=>{a.onerror=a.onload=null,clearTimeout(p);const n=e[o];if(delete e[o],a.parentNode?.removeChild(a),n?.forEach(e=>e(r)),t)return t(r)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),i&&document.head.appendChild(a)}})(),r.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;r.g.importScripts&&(e=r.g.location+"");const t=r.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const r=t.getElementsByTagName("script");if(r.length){let t=r.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=r[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),r.p=e})(),(()=>{const e={792:0};r.f.j=(t,o)=>{let n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{const s=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=s);const c=new Error,a=o=>{if(r.o(e,t)&&(n=e[t],0!==n&&(e[t]=void 0),n)){const e=o&&("load"===o.type?"missing":o.type),r=o&&o.target&&o.target.src;c.message="Loading chunk "+t+" failed.\n("+e+": "+r+")",c.name="ChunkLoadError",c.type=e,c.request=r,c.event=o,n[1](c)}};r.l(r.p+r.u(t),a,"chunk-"+t,t)}};const t=(t,o)=>{let[n,s,c]=o;var a,i,l=0;if(n.some(t=>0!==e[t])){for(a in s)r.o(s,a)&&(r.m[a]=s[a]);c&&c(r)}for(t&&t(o);l<n.length;l++)i=n[l],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0},o=self.webpackChunksafely_serve=self.webpackChunksafely_serve||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r(314)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={122(e,t,n){n.a(e,async(e,t)=>{try{const i=await n.e(35).then(()=>n(35)),a=i._argv_url_get,o=i._cmdline_check,r=i._echo,s=i._exit,l=i._global_get,c=i._homedir_get,d=i._msg_info,_=i._msg_error,u=i._override_set,p=i._path_join,g=i._pwd,m=i._set,f=i._yargv_get,y=await n.e(95).then(()=>n(95)),b=y._path_encode,h=y._safely_serve;function v(){m("app","name","safely-serve"),m("app","opts",[]),m("runtime","environment",""),m("target","directory",""),m("listen","uris",[]),m("target","port",""),m("index","redirect",""),m("debug","enabled",""),m("config","file",""),m("logging","disabled",""),m("cors","enabled",""),m("clipboard","disabled",""),m("compression","disabled",""),m("etag","disabled",""),m("symlinks","enabled",""),m("ssl","cert",""),m("ssl","key",""),m("ssl","pass",""),m("cert","gen",""),m("port_switching","disabled",""),m("keys","length",""),m("serial","number",""),m("validity","min",""),m("validity","max",""),m("domain","name",""),m("country","name",""),m("state","name",""),m("locality","name",""),m("organization","name",""),m("organization","unit",""),m("cache","dir",""),l().quiet=""}function $(){const e=c();return p([e,".cache",app_name])}const S=$;function k(e){const t=b(e);return p([cache_dir,t])}function w(){const e=k(target_directory);""==ssl_cert?(ssl_cert=`${e}/cert.pem`,""==cert_gen&&(cert_gen="y")):cert_gen="n",""==ssl_cert&&(ssl_cert=`${e}/cert.pem`),""==ssl_key&&(ssl_key=`${e}/key.pem`)}function D(){const e=new Date,t=e;t.setFullYear(e.getFullYear()+1),u("validity","min",e),u("validity","max",t)}function T(){cache_dir=S(),u("target","directory",g()),u("target","port","3000"),u("index","redirect","y"),u("logging","disabled","n"),u("cors","enabled","n"),u("clipboard","disabled","n"),u("compression","disabled","n"),u("etag","disabled","n"),u("symlink","enabled","n"),w(),u("port_switching","disabled","n"),u("keys","length","4096"),D(),u("serial","number","01"),u("domain","name","localhost"),u("country","name","LP"),u("state","name","Nananapoli"),u("locality","name","Pollena Trocchia"),u("organization","name","The Martian Company"),u("organization","name","Index Development Team")}function x(){let e;const t=[`${app_name} configuration:`,` Runtime environment: ${runtime_environment}`,` Target directory: ${target_directory}`," Serve options:",` Listen URIs: ${listen_uris}`,` Target port: ${target_port}`,` Index redirect: ${index_redirect}`,` Configuration file: ${config_file}`,` Quiet stdout log: ${logging_disabled}`,` Cors: ${cors_enabled}`,` No clipboard: ${clipboard_disabled}`,` No compression: ${compression_disabled}`,` Disable ETag: ${etag_disabled}`,` Symlinks: ${symlinks_enabled}`,` No port switching: ${port_switching_disabled}`," SSL options:",` Generate certificate: ${cert_gen}`,` SSL Certificate: ${ssl_cert}`,` SSL private key: ${ssl_key}`,` Key password: ${ssl_pass}`," Certificate options:",` Key length: ${keys_length}`,` Serial number: ${serial_number}`,` Valid after: ${validity_min}`,` Expires on: ${validity_max}`,` Domain name: ${domain_name}`,` Country: ${country_name}`,` State: ${state_name}`,` Locality: ${locality_name}`,` Organization: ${organization_name}`,` Organization unit: ${organization_unit}`];for(e of t)d(e)}function O(e){let t;const n=["","Serve extension which generates a self-signed SSL certificate at runtime.","","Usage:",""," safely-serve"," [options]"," <target-directory>",""," serve options:"," -l, --listen=URI Specify a URI endpoint on"," which to listen (see below);"," more than one may be specified to"," listen in multiple places.",` Default: '${listen_uris}'`," -p, --port=PORT Specify custom port",` Default: '${target_port}'`," -s, --single Rewrite all not-found requests"," to 'index.html'.",` Default: '${index_redirect}'`," -d, --debug Show debugging information.",` Default: '${debug_enabled}'`," -c, --config=PATH Specify custom path to 'serve.json'.",` Default: '${config_file}'`," -L, --no-request-logging Do not log any request information"," to the console.",` Default: '${logging_disabled}'`," -C, --cors Enable CORS, sets"," 'Access-Control-Allow-Origin'"," to '*'.",` Default: '${cors_enabled}'`," -n, --no-clipboard Do not copy the local address"," to the clipboard.",` Default: '${clipboard_disabled}'`," -u, --no-compression Do not compress files.",` Default: '${compression_disabled}'`," -e, --no-etag Send 'Last-Modified' header"," instead of `ETag`.",` Default: '${etag_disabled}'`," -S, --symlinks Resolve symlinks instead of"," showing 404 errors.",` Default: '${symlinks_enabled}'`," --no-port-switching Do not open a port other than"," the one specified when it's taken.",` Default: '${port_switching_disabled}'`," ssl options:"," -g, --gen-cert If enabled, generate self-signed certificate"," at the specified path.",` Default: '${cert_gen}'`," -I, --ssl-cert=PATH Optional path to an SSL/TLS"," certificate to serve with HTTPS."," Supported formats: PEM (default)"," and PKCS12 (PFX)",` Default: '${ssl_cert}'`," -i, --ssl-key=PATH Optional path to the SSL/TLS"," certificate's private key."," Applicable only for PEM certificates.",` Default: '${ssl_key}'`," -k --ssl-pass=PATH Optional path to the SSL/TLS"," certificate's passphrase.",` Default: '${ssl_pass}'`,""," certificate options:"," -N, --keys-length=N Generated keys pair length.",` Default: '${keys_length}'`," -B, --validity-min=DATE Set activation date.",` Default: '${validity_min}'`," -E, --validity-max=DATE Set expiration date.",` Default: '${validity_max}'`," -D, --domain-name=DOMAIN Set domain name.",` Default: '${domain_name}'`," -C, --country-name=COUNTRY Set country name.",` Default: '${country_name}'`," -S, --state-name=STATE Set state name.",` Default: '${state_name}'`," --locality-name=LOCALITY Set locality name.",` Default: '${locality_name}'`," -O, --organization-name=ORG Set organization name.",` Default: '${organization_name}'`," -U, --organization-unit=UNIT Set organization unit.",` Default: '${organization_unit}'`," -X, --serial-number=SERIAL Set serial number.",` Default: '${serial_number}'`,""," application options:"," -N, --keys-length=N Generated keys pair length."," -W, --cache-dir Work directory.",` Default: '${cache_dir}'`," -v, --version Displays the current version of"," Safely Serve."," -h, --help Shows this help message.",""];for(t of n)r(t);s(e)}function E(e){(e.help||e.h)&&(quiet="n",T(),O(0))}function P(e){debug_enabled=C(e,"d","debug"),debug_enabled&&(quiet="n")}function z(e){let t;return t=e._[0],void 0===t?(t=g(),t):(d(`Target directory value '${t}'.`),t)}function C(e,t,n,i){let a;return t in e&&n in e&&_(`You can only use '${t}' or '--${n}'`,1),t in e&&(a=e[t]),n in e&&(a=e[n]),void 0===a&&(a="","list"===i&&(a=[])),a}async function L(){const e=await f();quiet="y",runtime_environment="node",P(e),E(e),target_directory=z(e),listen_uris=C(e,"l","listen","list"),target_port=C(e,"p","port"),target_port=C(e,"p","port"),index_redirect=C(e,"s","single"),config_file=C(e,"c","config"),logging_disabled=C(e,"L","no-request-logging"),cors_enabled=C(e,"C","cors"),clipboard_disabled=C(e,"n","no-clipboard"),compression_disabled=C(e,"u","no-compression"),etag_disabled=C(e,"e","no-etag"),symlinks_enabled=C(e,"S","symlinks"),ssl_cert=C(e,"I","ssl-cert"),ssl_key=C(e,"i","ssl-key"),ssl_pass=C(e,"k","ssl-pass"),keys_length=C(e,"l","keys-length"),validity_min=C(e,"B","validity-min"),validity_max=C(e,"E","validity-max"),domain_name=C(e,"D","domain-name"),country_name=C(e,"C","country-name"),state_name=C(e,"S","state-name"),locality_name=C(e,"L","locality-name"),organization_name=C(e,"O","organization-name"),organization_unit=C(e,"U","organization-unit"),serial_number=C(e,"X","serial-number"),cache_dir=C(e,"W","cache-dir")}function A(){runtime_environment="browser";const e=a();target_directory=e.target_directory[0],listen_uris=e.listen,target_port=e.port[0],index_redirect=e.single[0],config_file=e.config_file[0],compression_disabled=e.no_compression[0],etag_disabled=e.no_etag[0],logging_disabled=e.no_request_logging[0],cors_enabled=e.cors[0],clipboard_disabled=e.no_clipboard[0],ssl_cert=e.ssl_cert[0],port_switching_disabled=e.no_compression[0],symlinks_enabled=e.symlinks[0],ssl_key=e.ssl_key[0],keys_length=e.keys_length[0],validity_min=e.validity_min[0],validity_max=e.validity_max[0],country_name=e.country_name[0],state_name=e.state_name[0],locality_name=e.locality_name[0],organization_name=e.organization_name[0],organization_unit=e.organization_unit[0],serial_number=e.serial_number[0],cache_dir=e.cache_dir[0],quiet=e.quiet,0===quiet.length&&(quiet="n")}v(),1==await o(app_name)?await L():A(),await T(),x(),app_opts=[target_directory,listen_uris,target_port,index_redirect,debug_enabled,config_file,logging_disabled,cors_enabled,clipboard_disabled,compression_disabled,etag_disabled,symlinks_enabled,cert_gen,ssl_cert,ssl_key,ssl_pass,port_switching_disabled,keys_length,serial_number,validity_min,validity_max,domain_name,country_name,state_name,locality_name,organization_name,organization_unit],h.apply(null,app_opts),t()}catch(j){t(j)}},1)}};const t={};function n(i){const a=t[i];if(void 0!==a)return a.exports;const o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),i=Symbol("webpack error"),a=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(n,o,r)=>{let s;r&&((s=[]).d=-1);const l=new Set,c=n.exports;let d,_,u;const p=new Promise((e,t)=>{u=t,_=e});p[t]=c,p[e]=e=>(s&&e(s),l.forEach(e),p.catch(e=>{})),n.exports=p,o(n=>{let o;d=(n=>n.map(n=>{if(null!==n&&"object"==typeof n){if(n[e])return n;if(n.then){const o=[];o.d=0,n.then(e=>{r[t]=e,a(o)},e=>{r[i]=e,a(o)});const r={};return r[e]=e=>e(o),r}}const o={};return o[e]=e=>{},o[t]=n,o}))(n);const r=()=>d.map(e=>{if(e[i])throw e[i];return e[t]}),c=new Promise(t=>{o=()=>t(r),o.r=0;const n=e=>e!==s&&!l.has(e)&&(l.add(e),e&&!e.d&&(o.r++,e.push(o)));d.forEach(t=>t[e](n))});return o.r?c:r()},e=>(e?u(p[i]=e):_(c),a(s))),s?.d<0&&(s.d=0)}})(),(()=>{const e=Object.getPrototypeOf;let t;n.t=function(i,a){if(1&a&&(i=this(i)),8&a)return i;if("object"==typeof i&&i){if(4&a&&i.__esModule)return i;if(16&a&&"function"==typeof i.then)return i}const o=Object.create(null);n.r(o);const r={};t=t||[null,e({}),e([]),e(e)];for(var s=2&a&&i;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>r[e]=()=>i[e]);return r.default=()=>i,n.d(o,r),o}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var a=t[i++],o=t[i++],r=0===o?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:o};n.o(e,a)||Object.defineProperty(e,a,r)}else for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((t,i)=>(n.f[i](e,t),t),[])),n.u=e=>e+".safely-serve.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="safely-serve:";n.l=(i,a,o,r)=>{if(e[i])return void e[i].push(a);let s,l;if(void 0!==o){const e=document.getElementsByTagName("script");for(var c=0;c<e.length;c++){const n=e[c];if(n.getAttribute("src")==i||n.getAttribute("data-webpack")==t+o){s=n;break}}}s||(l=!0,s=document.createElement("script"),s.charset="utf-8",n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+o),s.src=i),e[i]=[a];const d=(t,n)=>{s.onerror=s.onload=null,clearTimeout(_);const a=e[i];if(delete e[i],s.parentNode?.removeChild(s),a?.forEach(e=>e(n)),t)return t(n)},_=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),l&&document.head.appendChild(s)}})(),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;n.g.importScripts&&(e=n.g.location+"");const t=n.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const n=t.getElementsByTagName("script");if(n.length){let t=n.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=n[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),n.p=e})(),(()=>{const e={792:0};n.f.j=(t,i)=>{let a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)i.push(a[2]);else{const o=new Promise((n,i)=>a=e[t]=[n,i]);i.push(a[2]=o);const r=new Error,s=i=>{if(n.o(e,t)&&(a=e[t],0!==a&&(e[t]=void 0),a)){const e=i&&("load"===i.type?"missing":i.type),n=i&&i.target&&i.target.src;r.message="Loading chunk "+t+" failed.\n("+e+": "+n+")",r.name="ChunkLoadError",r.type=e,r.request=n,r.event=i,a[1](r)}};n.l(n.p+n.u(t),s,"chunk-"+t,t)}};const t=(t,i)=>{let[a,o,r]=i;var s,l,c=0;if(a.some(t=>0!==e[t])){for(s in o)n.o(o,s)&&(n.m[s]=o[s]);r&&r(n)}for(t&&t(i);c<a.length;c++)l=a[c],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0},i=self.webpackChunksafely_serve=self.webpackChunksafely_serve||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),n(122)})();
|
|
1
|
+
(()=>{"use strict";var e={122(e,t,n){n.a(e,async(e,t)=>{try{const i=await n.e(35).then(()=>n(35)),a=i._argv_get,o=i._argv_url_get,r=i._cmdline_check,s=i._echo,l=i._echo2,c=i._exit,d=i._global_get,u=i._homedir_get,m=i._msg_info,p=i._msg_error,g=i._override_set,_=i._path_join,f=i._pwd,y=i._set,b=await n.e(95).then(()=>n(95)),h=b._path_encode,v=b._safely_serve;function $(){y("app","name","safely-serve"),y("app","opts",[]),y("runtime","environment",""),y("target","directory",""),y("listen","uris",[]),y("target","port",""),y("index","redirect",""),y("debug","enabled",""),y("config","file",""),y("logging","disabled",""),y("cors","enabled",""),y("clipboard","disabled",""),y("compression","disabled",""),y("etag","disabled",""),y("symlinks","enabled",""),y("ssl","cert",""),y("ssl","key",""),y("ssl","pass",""),y("cert","gen",""),y("port_switching","disabled",""),y("keys","length",""),y("serial","number",""),y("validity","min",""),y("validity","max",""),y("domain","name",""),y("country","name",""),y("state","name",""),y("locality","name",""),y("organization","name",""),y("organization","unit",""),y("cache","dir",""),y("run","mode",""),d().quiet=""}function S(){const e=u();return _([e,".cache",app_name])}const k=S;function w(e){const t=h(e);return _([cache_dir,t])}function D(){const e=w(target_directory);""==ssl_cert?(ssl_cert=`${e}/cert.pem`,""==cert_gen&&(cert_gen="y")):cert_gen="n",""==ssl_cert&&(ssl_cert=`${e}/cert.pem`),""==ssl_key&&(ssl_key=`${e}/key.pem`)}function T(){const e=new Date,t=e;t.setFullYear(e.getFullYear()+1),g("validity","min",e),g("validity","max",t)}function x(){cache_dir=k(),g("target","directory",f()),g("target","port","3000"),g("index","redirect","y"),g("logging","disabled","n"),g("cors","enabled","n"),g("clipboard","disabled","n"),g("compression","disabled","n"),g("etag","disabled","n"),g("symlink","enabled","n"),D(),g("port_switching","disabled","n"),g("keys","length","4096"),T(),g("serial","number","01"),g("domain","name","localhost"),g("country","name","LP"),g("state","name","Nananapoli"),g("locality","name","Pollena Trocchia"),g("organization","name","The Martian Company"),g("organization","name","Index Development Team"),g("run","mode","native")}function E(){let e;const t=[`${app_name} configuration:`,` Runtime environment: ${runtime_environment}`,` Target directory: ${target_directory}`,` Run mode: ${run_mode}`," Serve options:",` Listen URIs: ${listen_uris}`,` Target port: ${target_port}`,` Index redirect: ${index_redirect}`,` Configuration file: ${config_file}`,` Quiet stdout log: ${logging_disabled}`,` Cors: ${cors_enabled}`,` No clipboard: ${clipboard_disabled}`,` No compression: ${compression_disabled}`,` Disable ETag: ${etag_disabled}`,` Symlinks: ${symlinks_enabled}`,` No port switching: ${port_switching_disabled}`," SSL options:",` Generate certificate: ${cert_gen}`,` SSL Certificate: ${ssl_cert}`,` SSL private key: ${ssl_key}`,` Key password: ${ssl_pass}`," Certificate options:",` Key length: ${keys_length}`,` Serial number: ${serial_number}`,` Valid after: ${validity_min}`,` Expires on: ${validity_max}`,` Domain name: ${domain_name}`,` Country: ${country_name}`,` State: ${state_name}`,` Locality: ${locality_name}`,` Organization: ${organization_name}`,` Organization unit: ${organization_unit}`];for(e of t)m(e)}function O(e){let t;const n=["","Serve extension which generates a self-signed SSL certificate at runtime.","","Usage:",""," safely-serve"," [options]"," <target-directory>",""," options:",""," -r, --run-mode=MODE It can be 'native' or 'spawn'.",` Default: '${run_mode}'`,""," serve options:"," -l, --listen=URI Specify a URI endpoint on"," which to listen (see below);"," more than one may be specified to"," listen in multiple places.",` Default: '${listen_uris}'`," -p, --port=PORT Specify custom port",` Default: '${target_port}'`," -s, --single Rewrite all not-found requests"," to 'index.html'.",` Default: '${index_redirect}'`," -d, --debug Show debugging information.",` Default: '${debug_enabled}'`," -c, --config=PATH Specify custom path to 'serve.json'.",` Default: '${config_file}'`," -L, --no-request-logging Do not log any request information"," to the console.",` Default: '${logging_disabled}'`," -C, --cors Enable CORS, sets"," 'Access-Control-Allow-Origin'"," to '*'.",` Default: '${cors_enabled}'`," -n, --no-clipboard Do not copy the local address"," to the clipboard.",` Default: '${clipboard_disabled}'`," -u, --no-compression Do not compress files.",` Default: '${compression_disabled}'`," -e, --no-etag Send 'Last-Modified' header"," instead of `ETag`.",` Default: '${etag_disabled}'`," -S, --symlinks Resolve symlinks instead of"," showing 404 errors.",` Default: '${symlinks_enabled}'`," --no-port-switching Do not open a port other than"," the one specified when it's taken.",` Default: '${port_switching_disabled}'`," ssl options:"," -g, --gen-cert If enabled, generate self-signed certificate"," at the specified path.",` Default: '${cert_gen}'`," -I, --ssl-cert=PATH Optional path to an SSL/TLS"," certificate to serve with HTTPS."," Supported formats: PEM (default)"," and PKCS12 (PFX)",` Default: '${ssl_cert}'`," -i, --ssl-key=PATH Optional path to the SSL/TLS"," certificate's private key."," Applicable only for PEM certificates.",` Default: '${ssl_key}'`," -k --ssl-pass=PATH Optional path to the SSL/TLS"," certificate's passphrase.",` Default: '${ssl_pass}'`,""," certificate options:"," -N, --keys-length=N Generated keys pair length.",` Default: '${keys_length}'`," -B, --validity-min=DATE Set activation date.",` Default: '${validity_min}'`," -E, --validity-max=DATE Set expiration date.",` Default: '${validity_max}'`," -D, --domain-name=DOMAIN Set domain name.",` Default: '${domain_name}'`," -C, --country-name=COUNTRY Set country name.",` Default: '${country_name}'`," -S, --state-name=STATE Set state name.",` Default: '${state_name}'`," --locality-name=LOCALITY Set locality name.",` Default: '${locality_name}'`," -O, --organization-name=ORG Set organization name.",` Default: '${organization_name}'`," -U, --organization-unit=UNIT Set organization unit.",` Default: '${organization_unit}'`," -X, --serial-number=SERIAL Set serial number.",` Default: '${serial_number}'`,""," application options:"," -N, --keys-length=N Generated keys pair length."," -W, --cache-dir Work directory.",` Default: '${cache_dir}'`," -v, --version Displays the current version of"," Safely Serve."," -h, --help Shows this help message.",""];for(t of n)s(t);c(e)}function P(e){(e.help||e.h)&&(d().quiet="n",x(),O(0))}function z(e){L(e,"d","debug")&&(d().quiet="n")}function C(e){let t;return t=e._[0],void 0===t?(t=f(),t):(m(`Target directory value '${t}'.`),t)}function L(e,t,n,i){let a;return t in e&&n in e&&p(`You can only use '${t}' or '--${n}'`,1),t in e&&(a=e[t]),n in e&&(a=e[n]),void 0===a&&(a="","list"===i&&(a=[])),a}async function A(){let e;const t=await a({booleans:["h","help","v","verbose"],string:!0}),n=d();n.quiet="y",y("runtime","environment","node"),z(t),P(t),y("target","directory",C(t)),t.v&&(e=t.v),t.verbose&&(e=t.verbose),e&&(n.quiet="n"),y("run","mode",L(t,"r","run-mode")),y("listen","uris",L(t,"l","listen","list")),y("target","port",L(t,"p","port")),y("target","port",L(t,"p","port")),y("index","redirect",L(t,"s","single")),y("config","file",L(t,"c","config")),y("logging","disabled",L(t,"L","no-request-logging")),y("cors","enabled",L(t,"C","cors")),y("clipboard","disabled",L(t,"n","no-clipboard")),y("compression","disabled",L(t,"u","no-compression")),y("etag","disabled",L(t,"e","no-etag")),y("symlinks","enabled",L(t,"S","symlinks")),y("ssl","cert",L(t,"I","ssl-cert")),y("ssl","key",L(t,"i","ssl-key")),y("ssl","pass",L(t,"k","ssl-pass")),y("keys","length",L(t,"l","keys-length")),y("validity","min",L(t,"B","validity-min")),y("validity","max",L(t,"E","validity-max")),y("domain","name",L(t,"D","domain-name")),y("country","name",L(t,"C","country-name")),y("state","name",L(t,"S","state-name")),y("locality","name",L(t,"L","locality-name")),y("organization","name",L(t,"O","organization-name")),y("organization","unit",L(t,"U","organization-unit")),y("serial","number",L(t,"X","serial-number")),y("cache","dir",L(t,"W","cache-dir"))}function j(){runtime_environment="browser";const e=o();y("target","directory",e.target_directory[0]),y("listen","uris",e.listen),y("target","port",e.port[0]),y("index","redirect",e.single[0]),y("config","file",e.config_file[0]),compression_disabled=e.no_compression[0],etag_disabled=e.no_etag[0],logging_disabled=e.no_request_logging[0],cors_enabled=e.cors[0],clipboard_disabled=e.no_clipboard[0],ssl_cert=e.ssl_cert[0],port_switching_disabled=e.no_compression[0],symlinks_enabled=e.symlinks[0],ssl_key=e.ssl_key[0],keys_length=e.keys_length[0],validity_min=e.validity_min[0],validity_max=e.validity_max[0],country_name=e.country_name[0],state_name=e.state_name[0],locality_name=e.locality_name[0],organization_name=e.organization_name[0],organization_unit=e.organization_unit[0],serial_number=e.serial_number[0],cache_dir=e.cache_dir[0],quiet=e.quiet,0===quiet.length&&(quiet="n")}$(),1==await r(app_name)?await A():j(),await x(),E(),app_opts=[target_directory,listen_uris,target_port,index_redirect,debug_enabled,config_file,logging_disabled,cors_enabled,clipboard_disabled,compression_disabled,etag_disabled,symlinks_enabled,cert_gen,ssl_cert,ssl_key,ssl_pass,port_switching_disabled,keys_length,serial_number,validity_min,validity_max,domain_name,country_name,state_name,locality_name,organization_name,organization_unit];try{v.apply(null,app_opts)}catch(q){p("Error running '_safely_serve' with arguments:",0),l(app_opts),l(q),c(1)}t()}catch(N){t(N)}},1)}};const t={};function n(i){const a=t[i];if(void 0!==a)return a.exports;const o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.m=e,(()=>{const e=Symbol("webpack queues"),t=Symbol("webpack exports"),i=Symbol("webpack error"),a=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(n,o,r)=>{let s;r&&((s=[]).d=-1);const l=new Set,c=n.exports;let d,u,m;const p=new Promise((e,t)=>{m=t,u=e});p[t]=c,p[e]=e=>(s&&e(s),l.forEach(e),p.catch(e=>{})),n.exports=p,o(n=>{let o;d=(n=>n.map(n=>{if(null!==n&&"object"==typeof n){if(n[e])return n;if(n.then){const o=[];o.d=0,n.then(e=>{r[t]=e,a(o)},e=>{r[i]=e,a(o)});const r={};return r[e]=e=>e(o),r}}const o={};return o[e]=e=>{},o[t]=n,o}))(n);const r=()=>d.map(e=>{if(e[i])throw e[i];return e[t]}),c=new Promise(t=>{o=()=>t(r),o.r=0;const n=e=>e!==s&&!l.has(e)&&(l.add(e),e&&!e.d&&(o.r++,e.push(o)));d.forEach(t=>t[e](n))});return o.r?c:r()},e=>(e?m(p[i]=e):u(c),a(s))),s?.d<0&&(s.d=0)}})(),(()=>{const e=Object.getPrototypeOf;let t;n.t=function(i,a){if(1&a&&(i=this(i)),8&a)return i;if("object"==typeof i&&i){if(4&a&&i.__esModule)return i;if(16&a&&"function"==typeof i.then)return i}const o=Object.create(null);n.r(o);const r={};t=t||[null,e({}),e([]),e(e)];for(var s=2&a&&i;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>r[e]=()=>i[e]);return r.default=()=>i,n.d(o,r),o}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var i=0;i<t.length;){var a=t[i++],o=t[i++],r=0===o?{enumerable:!0,value:t[i++]}:{enumerable:!0,get:o};n.o(e,a)||Object.defineProperty(e,a,r)}else for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.f={},n.e=e=>{const t=[];return n.f.j(e,t),Promise.all(t)},n.u=e=>e+".safely-serve.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e={},t="safely-serve:";n.l=(i,a,o,r)=>{if(e[i])return void e[i].push(a);let s,l;if(void 0!==o){const e=document.getElementsByTagName("script");for(var c=0;c<e.length;c++){const n=e[c];if(n.getAttribute("src")==i||n.getAttribute("data-webpack")==t+o){s=n;break}}}s||(l=!0,s=document.createElement("script"),s.charset="utf-8",n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",t+o),s.src=i),e[i]=[a];const d=(t,n)=>{s.onerror=s.onload=null,clearTimeout(u);const a=e[i];if(delete e[i],s.parentNode?.removeChild(s),a?.forEach(e=>e(n)),t)return t(n)},u=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),l&&document.head.appendChild(s)}})(),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{let e;n.g.importScripts&&(e=n.g.location+"");const t=n.g.document;if(!e&&t&&("SCRIPT"===t.currentScript?.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){const n=t.getElementsByTagName("script");if(n.length){let t=n.length-1;for(;t>-1&&(!e||!/^https?:/.test(e));)e=n[t--].src}}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),n.p=e})(),(()=>{const e={792:0};n.f.j=(t,i)=>{let a=n.o(e,t)?e[t]:void 0;if(0!==a)if(a)i.push(a[2]);else{const o=new Promise((n,i)=>a=e[t]=[n,i]);i.push(a[2]=o);const r=new Error,s=i=>{if(n.o(e,t)&&(a=e[t],0!==a&&(e[t]=void 0),a)){const e=i&&("load"===i.type?"missing":i.type),n=i&&i.target&&i.target.src;r.message="Loading chunk "+t+" failed.\n("+e+": "+n+")",r.name="ChunkLoadError",r.type=e,r.request=n,r.event=i,a[1](r)}};n.l(n.p+n.u(t),s,"chunk-"+t,t)}};const t=(t,i)=>{let[a,o,r]=i;var s,l,c=0;if(a.some(t=>0!==e[t])){for(s in o)n.o(o,s)&&(n.m[s]=o[s]);r&&r(n)}for(t&&t(i);c<a.length;c++)l=a[c],n.o(e,l)&&e[l]&&e[l][0](),e[l]=0},i=self.webpackChunksafely_serve=self.webpackChunksafely_serve||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),n(122)})();
|
package/eslint.config.mjs
CHANGED
|
@@ -55,7 +55,8 @@ export default defineConfig([
|
|
|
55
55
|
files:
|
|
56
56
|
[ "**/*.{js,mjs,cjs}",
|
|
57
57
|
`**/${_project}*`,
|
|
58
|
-
`**/lib${_project}`
|
|
58
|
+
`**/lib${_project}`
|
|
59
|
+
],
|
|
59
60
|
plugins:
|
|
60
61
|
{ js },
|
|
61
62
|
extends:
|
|
@@ -72,7 +73,8 @@ export default defineConfig([
|
|
|
72
73
|
"prefer-const":
|
|
73
74
|
"error" },
|
|
74
75
|
files:
|
|
75
|
-
[ "**/*.{js,cjs}"
|
|
76
|
+
[ "**/*.{js,cjs}",
|
|
77
|
+
],
|
|
76
78
|
languageOptions:
|
|
77
79
|
{ sourceType:
|
|
78
80
|
"commonjs" } },
|
package/libsafely-serve
CHANGED
|
@@ -46,16 +46,36 @@ const
|
|
|
46
46
|
const
|
|
47
47
|
_dirname =
|
|
48
48
|
_libcrash._dirname;
|
|
49
|
+
/* global
|
|
50
|
+
_echo */
|
|
51
|
+
const
|
|
52
|
+
_echo =
|
|
53
|
+
_libcrash._echo;
|
|
54
|
+
/* global
|
|
55
|
+
_echo2 */
|
|
56
|
+
const
|
|
57
|
+
_echo2 =
|
|
58
|
+
_libcrash._echo2;
|
|
49
59
|
/* global
|
|
50
60
|
_file_exists */
|
|
51
61
|
const
|
|
52
62
|
_file_exists =
|
|
53
63
|
_libcrash._file_exists;
|
|
64
|
+
/* global
|
|
65
|
+
_global_get */
|
|
66
|
+
const
|
|
67
|
+
_global_get =
|
|
68
|
+
_libcrash._global_get;
|
|
54
69
|
/* global
|
|
55
70
|
_mkdir */
|
|
56
71
|
const
|
|
57
72
|
_mkdir =
|
|
58
73
|
_libcrash._mkdir;
|
|
74
|
+
/* global
|
|
75
|
+
_msg_error */
|
|
76
|
+
const
|
|
77
|
+
_msg_error =
|
|
78
|
+
_libcrash._msg_error;
|
|
59
79
|
/* global
|
|
60
80
|
_msg_info */
|
|
61
81
|
const
|
|
@@ -134,7 +154,7 @@ function
|
|
|
134
154
|
_data) {
|
|
135
155
|
_data =
|
|
136
156
|
_data.toString();
|
|
137
|
-
|
|
157
|
+
_echo(
|
|
138
158
|
_data);
|
|
139
159
|
/* global
|
|
140
160
|
_output */
|
|
@@ -238,6 +258,7 @@ function
|
|
|
238
258
|
"--ssl-pass",
|
|
239
259
|
ssl_pass);
|
|
240
260
|
}
|
|
261
|
+
return _cmd_args;
|
|
241
262
|
}
|
|
242
263
|
|
|
243
264
|
function
|
|
@@ -282,6 +303,16 @@ function
|
|
|
282
303
|
_ssl_key,
|
|
283
304
|
_ssl_pass,
|
|
284
305
|
_port_switching_disabled);
|
|
306
|
+
const
|
|
307
|
+
_cmd_args_string =
|
|
308
|
+
_cmd_args.join(
|
|
309
|
+
" ");
|
|
310
|
+
const
|
|
311
|
+
_msg =
|
|
312
|
+
"Running 'serve' using a complicated " +
|
|
313
|
+
`spawn, '${_cmd} ${_cmd_args_string}'.`;
|
|
314
|
+
_msg_info(
|
|
315
|
+
_msg);
|
|
285
316
|
const
|
|
286
317
|
_serve_process =
|
|
287
318
|
_spawn(
|
|
@@ -369,8 +400,8 @@ async function
|
|
|
369
400
|
_ssl_cert
|
|
370
401
|
];
|
|
371
402
|
_cert_gen_opts_str =
|
|
372
|
-
|
|
373
|
-
|
|
403
|
+
_cert_gen_opts.join(
|
|
404
|
+
" ");
|
|
374
405
|
_msg =
|
|
375
406
|
`Running 'cert-gen' ` +
|
|
376
407
|
`options '${_cert_gen_opts_str}'.`;
|
|
@@ -381,7 +412,7 @@ async function
|
|
|
381
412
|
_cert_gen_opts);
|
|
382
413
|
}
|
|
383
414
|
const
|
|
384
|
-
|
|
415
|
+
_serve_args = [
|
|
385
416
|
_target_directory,
|
|
386
417
|
_listen_uris,
|
|
387
418
|
_target_port,
|
|
@@ -399,9 +430,40 @@ async function
|
|
|
399
430
|
_ssl_pass,
|
|
400
431
|
_port_switching_disabled
|
|
401
432
|
];
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
433
|
+
_msg =
|
|
434
|
+
"Running '_serve' function with arguments:";
|
|
435
|
+
_msg_info(
|
|
436
|
+
_msg);
|
|
437
|
+
const
|
|
438
|
+
_global =
|
|
439
|
+
_global_get();
|
|
440
|
+
const
|
|
441
|
+
_quiet =
|
|
442
|
+
_global[
|
|
443
|
+
"quiet"];
|
|
444
|
+
if ( _quiet == "n" ) {
|
|
445
|
+
_echo(
|
|
446
|
+
_serve_args);
|
|
447
|
+
}
|
|
448
|
+
try {
|
|
449
|
+
_serve.apply(
|
|
450
|
+
null,
|
|
451
|
+
_serve_args);
|
|
452
|
+
}
|
|
453
|
+
catch(
|
|
454
|
+
_error) {
|
|
455
|
+
_msg =
|
|
456
|
+
"Error running '_serve' " +
|
|
457
|
+
"with arguments:";
|
|
458
|
+
_msg_error(
|
|
459
|
+
_msg,
|
|
460
|
+
0);
|
|
461
|
+
_echo2(
|
|
462
|
+
_serve_args);
|
|
463
|
+
_echo2(
|
|
464
|
+
_error);
|
|
465
|
+
throw _error;
|
|
466
|
+
}
|
|
405
467
|
}
|
|
406
468
|
|
|
407
469
|
export {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name":
|
|
3
3
|
"safely-serve",
|
|
4
4
|
"version":
|
|
5
|
-
"0.0.
|
|
5
|
+
"0.0.25",
|
|
6
6
|
"description":
|
|
7
7
|
"Serve extension which auto-generates self-signed OpenSSL certificates' at runtime",
|
|
8
8
|
"funding": {
|
|
@@ -58,13 +58,15 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"crash-js-webpack":
|
|
61
|
-
"^0.0.
|
|
61
|
+
"^0.0.82",
|
|
62
62
|
"eslint":
|
|
63
|
-
"^10.
|
|
63
|
+
"^10.14.0",
|
|
64
64
|
"@eslint/js":
|
|
65
65
|
"^10.0.1",
|
|
66
66
|
"globals":
|
|
67
67
|
"^17.3.0",
|
|
68
|
+
"minimatch":
|
|
69
|
+
"^11.0.4",
|
|
68
70
|
"webpack":
|
|
69
71
|
"^5.109.2",
|
|
70
72
|
"webpack-cli":
|
|
@@ -72,9 +74,11 @@
|
|
|
72
74
|
},
|
|
73
75
|
"dependencies": {
|
|
74
76
|
"libcrash-js":
|
|
75
|
-
"npm:crash-js@^
|
|
77
|
+
"npm:crash-js@^1000000000000018.1000000000000001.1000000000000001",
|
|
76
78
|
"cert-tools":
|
|
77
79
|
"^0.0.25",
|
|
80
|
+
"compression":
|
|
81
|
+
"^1.8.2",
|
|
78
82
|
"js-sha256":
|
|
79
83
|
"^0.11.1",
|
|
80
84
|
"os":
|
|
@@ -90,6 +94,12 @@
|
|
|
90
94
|
{ "safely-serve":
|
|
91
95
|
"safely-serve" },
|
|
92
96
|
"overrides": {
|
|
97
|
+
"compression":
|
|
98
|
+
"^1.8.2",
|
|
99
|
+
"eslint":
|
|
100
|
+
"^10.14.0",
|
|
101
|
+
"minimatch":
|
|
102
|
+
"^11.0.4",
|
|
93
103
|
"safely-serve":
|
|
94
104
|
"./libsafely-serve"
|
|
95
105
|
},
|
package/safely-serve
CHANGED
|
@@ -41,6 +41,11 @@ const
|
|
|
41
41
|
_libcrash =
|
|
42
42
|
await import(
|
|
43
43
|
"libcrash-js");
|
|
44
|
+
/* global
|
|
45
|
+
_argv_get */
|
|
46
|
+
const
|
|
47
|
+
_argv_get =
|
|
48
|
+
_libcrash._argv_get;
|
|
44
49
|
/* global
|
|
45
50
|
_argv_url_get */
|
|
46
51
|
const
|
|
@@ -56,6 +61,11 @@ const
|
|
|
56
61
|
const
|
|
57
62
|
_echo =
|
|
58
63
|
_libcrash._echo;
|
|
64
|
+
/* global
|
|
65
|
+
_echo2 */
|
|
66
|
+
const
|
|
67
|
+
_echo2 =
|
|
68
|
+
_libcrash._echo2;
|
|
59
69
|
/* global
|
|
60
70
|
_exit */
|
|
61
71
|
const
|
|
@@ -101,11 +111,6 @@ const
|
|
|
101
111
|
const
|
|
102
112
|
_set =
|
|
103
113
|
_libcrash._set;
|
|
104
|
-
/* global
|
|
105
|
-
_yargv_get */
|
|
106
|
-
const
|
|
107
|
-
_yargv_get =
|
|
108
|
-
_libcrash._yargv_get;
|
|
109
114
|
|
|
110
115
|
const
|
|
111
116
|
_libsafely_serve_module =
|
|
@@ -341,6 +346,13 @@ function
|
|
|
341
346
|
"cache",
|
|
342
347
|
"dir",
|
|
343
348
|
"");
|
|
349
|
+
/* global
|
|
350
|
+
run_mode:
|
|
351
|
+
writable */
|
|
352
|
+
_set(
|
|
353
|
+
"run",
|
|
354
|
+
"mode",
|
|
355
|
+
"");
|
|
344
356
|
/* global
|
|
345
357
|
quiet:
|
|
346
358
|
writable */
|
|
@@ -514,6 +526,10 @@ function
|
|
|
514
526
|
"organization",
|
|
515
527
|
"name",
|
|
516
528
|
"Index Development Team");
|
|
529
|
+
_override_set(
|
|
530
|
+
"run",
|
|
531
|
+
"mode",
|
|
532
|
+
"native");
|
|
517
533
|
}
|
|
518
534
|
|
|
519
535
|
function
|
|
@@ -525,6 +541,7 @@ function
|
|
|
525
541
|
`${app_name} configuration:`,
|
|
526
542
|
` Runtime environment: ${runtime_environment}`,
|
|
527
543
|
` Target directory: ${target_directory}`,
|
|
544
|
+
` Run mode: ${run_mode}`,
|
|
528
545
|
` Serve options:`,
|
|
529
546
|
` Listen URIs: ${listen_uris}`,
|
|
530
547
|
` Target port: ${target_port}`,
|
|
@@ -576,6 +593,11 @@ function
|
|
|
576
593
|
" [options]",
|
|
577
594
|
" <target-directory>",
|
|
578
595
|
"",
|
|
596
|
+
" options:",
|
|
597
|
+
"",
|
|
598
|
+
" -r, --run-mode=MODE It can be 'native' or 'spawn'.",
|
|
599
|
+
` Default: '${run_mode}'`,
|
|
600
|
+
"",
|
|
579
601
|
" serve options:",
|
|
580
602
|
" -l, --listen=URI Specify a URI endpoint on",
|
|
581
603
|
" which to listen (see below);",
|
|
@@ -678,7 +700,11 @@ function
|
|
|
678
700
|
_argv[
|
|
679
701
|
"h"];
|
|
680
702
|
if ( _help_display ) {
|
|
681
|
-
|
|
703
|
+
const
|
|
704
|
+
_global =
|
|
705
|
+
_global_get();
|
|
706
|
+
_global[
|
|
707
|
+
"quiet"] =
|
|
682
708
|
"n";
|
|
683
709
|
_overrides_set();
|
|
684
710
|
_usage(
|
|
@@ -689,13 +715,18 @@ function
|
|
|
689
715
|
function
|
|
690
716
|
_cmdline_parse_debug(
|
|
691
717
|
_argv) {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
718
|
+
const
|
|
719
|
+
_debug_enabled =
|
|
720
|
+
_opt_read(
|
|
721
|
+
_argv,
|
|
722
|
+
"d",
|
|
723
|
+
"debug");
|
|
724
|
+
if ( _debug_enabled ) {
|
|
725
|
+
const
|
|
726
|
+
_global =
|
|
727
|
+
_global_get();
|
|
728
|
+
_global[
|
|
729
|
+
"quiet"] =
|
|
699
730
|
"n";
|
|
700
731
|
}
|
|
701
732
|
}
|
|
@@ -782,146 +813,242 @@ function
|
|
|
782
813
|
|
|
783
814
|
async function
|
|
784
815
|
_cmdline_parse() {
|
|
816
|
+
let
|
|
817
|
+
_verbose;
|
|
818
|
+
const
|
|
819
|
+
_argv_args = {
|
|
820
|
+
"booleans": [
|
|
821
|
+
"h",
|
|
822
|
+
"help",
|
|
823
|
+
"v",
|
|
824
|
+
"verbose"
|
|
825
|
+
],
|
|
826
|
+
"string":
|
|
827
|
+
true
|
|
828
|
+
};
|
|
785
829
|
const
|
|
786
830
|
_argv =
|
|
787
|
-
await
|
|
788
|
-
|
|
831
|
+
await _argv_get(
|
|
832
|
+
_argv_args);
|
|
833
|
+
const
|
|
834
|
+
_global =
|
|
835
|
+
_global_get();
|
|
836
|
+
_global[
|
|
837
|
+
"quiet"] =
|
|
789
838
|
"y";
|
|
790
|
-
|
|
791
|
-
"
|
|
839
|
+
_set(
|
|
840
|
+
"runtime",
|
|
841
|
+
"environment",
|
|
842
|
+
"node");
|
|
792
843
|
_cmdline_parse_debug(
|
|
793
844
|
_argv);
|
|
794
845
|
_cmdline_parse_help(
|
|
795
846
|
_argv);
|
|
796
|
-
|
|
847
|
+
_set(
|
|
848
|
+
"target",
|
|
849
|
+
"directory",
|
|
797
850
|
_target_directory_auto_detect(
|
|
798
|
-
_argv);
|
|
799
|
-
|
|
851
|
+
_argv));
|
|
852
|
+
if ( _argv[
|
|
853
|
+
"v"] ) {
|
|
854
|
+
_verbose =
|
|
855
|
+
_argv[
|
|
856
|
+
"v"];
|
|
857
|
+
}
|
|
858
|
+
if ( _argv[
|
|
859
|
+
"verbose"] ) {
|
|
860
|
+
_verbose =
|
|
861
|
+
_argv[
|
|
862
|
+
"verbose"];
|
|
863
|
+
}
|
|
864
|
+
if ( _verbose ) {
|
|
865
|
+
_global[
|
|
866
|
+
"quiet"] =
|
|
867
|
+
"n";
|
|
868
|
+
}
|
|
869
|
+
_set(
|
|
870
|
+
"run",
|
|
871
|
+
"mode",
|
|
872
|
+
_opt_read(
|
|
873
|
+
_argv,
|
|
874
|
+
"r",
|
|
875
|
+
"run-mode"));
|
|
876
|
+
_set(
|
|
877
|
+
"listen",
|
|
878
|
+
"uris",
|
|
800
879
|
_opt_read(
|
|
801
880
|
_argv,
|
|
802
881
|
"l",
|
|
803
882
|
"listen",
|
|
804
|
-
"list");
|
|
805
|
-
|
|
883
|
+
"list"));
|
|
884
|
+
_set(
|
|
885
|
+
"target",
|
|
886
|
+
"port",
|
|
806
887
|
_opt_read(
|
|
807
888
|
_argv,
|
|
808
889
|
"p",
|
|
809
|
-
"port");
|
|
810
|
-
|
|
890
|
+
"port"));
|
|
891
|
+
_set(
|
|
892
|
+
"target",
|
|
893
|
+
"port",
|
|
811
894
|
_opt_read(
|
|
812
895
|
_argv,
|
|
813
896
|
"p",
|
|
814
|
-
"port");
|
|
815
|
-
|
|
897
|
+
"port"));
|
|
898
|
+
_set(
|
|
899
|
+
"index",
|
|
900
|
+
"redirect",
|
|
816
901
|
_opt_read(
|
|
817
902
|
_argv,
|
|
818
903
|
"s",
|
|
819
|
-
"single");
|
|
820
|
-
|
|
904
|
+
"single"));
|
|
905
|
+
_set(
|
|
906
|
+
"config",
|
|
907
|
+
"file",
|
|
821
908
|
_opt_read(
|
|
822
909
|
_argv,
|
|
823
910
|
"c",
|
|
824
|
-
"config");
|
|
825
|
-
|
|
911
|
+
"config"));
|
|
912
|
+
_set(
|
|
913
|
+
"logging",
|
|
914
|
+
"disabled",
|
|
826
915
|
_opt_read(
|
|
827
916
|
_argv,
|
|
828
917
|
"L",
|
|
829
|
-
"no-request-logging");
|
|
830
|
-
|
|
918
|
+
"no-request-logging"));
|
|
919
|
+
_set(
|
|
920
|
+
"cors",
|
|
921
|
+
"enabled",
|
|
831
922
|
_opt_read(
|
|
832
923
|
_argv,
|
|
833
924
|
"C",
|
|
834
|
-
"cors");
|
|
835
|
-
|
|
925
|
+
"cors"));
|
|
926
|
+
_set(
|
|
927
|
+
"clipboard",
|
|
928
|
+
"disabled",
|
|
836
929
|
_opt_read(
|
|
837
930
|
_argv,
|
|
838
931
|
"n",
|
|
839
|
-
"no-clipboard");
|
|
840
|
-
|
|
932
|
+
"no-clipboard"));
|
|
933
|
+
_set(
|
|
934
|
+
"compression",
|
|
935
|
+
"disabled",
|
|
841
936
|
_opt_read(
|
|
842
937
|
_argv,
|
|
843
938
|
"u",
|
|
844
|
-
"no-compression");
|
|
845
|
-
|
|
939
|
+
"no-compression"));
|
|
940
|
+
_set(
|
|
941
|
+
"etag",
|
|
942
|
+
"disabled",
|
|
846
943
|
_opt_read(
|
|
847
944
|
_argv,
|
|
848
945
|
"e",
|
|
849
|
-
"no-etag");
|
|
850
|
-
|
|
946
|
+
"no-etag"));
|
|
947
|
+
_set(
|
|
948
|
+
"symlinks",
|
|
949
|
+
"enabled",
|
|
851
950
|
_opt_read(
|
|
852
951
|
_argv,
|
|
853
952
|
"S",
|
|
854
|
-
"symlinks");
|
|
855
|
-
|
|
953
|
+
"symlinks"));
|
|
954
|
+
_set(
|
|
955
|
+
"ssl",
|
|
956
|
+
"cert",
|
|
856
957
|
_opt_read(
|
|
857
958
|
_argv,
|
|
858
959
|
"I",
|
|
859
|
-
"ssl-cert");
|
|
860
|
-
|
|
960
|
+
"ssl-cert"));
|
|
961
|
+
_set(
|
|
962
|
+
"ssl",
|
|
963
|
+
"key",
|
|
861
964
|
_opt_read(
|
|
862
965
|
_argv,
|
|
863
966
|
"i",
|
|
864
|
-
"ssl-key");
|
|
865
|
-
|
|
967
|
+
"ssl-key"));
|
|
968
|
+
_set(
|
|
969
|
+
"ssl",
|
|
970
|
+
"pass",
|
|
866
971
|
_opt_read(
|
|
867
972
|
_argv,
|
|
868
973
|
"k",
|
|
869
|
-
"ssl-pass");
|
|
870
|
-
|
|
974
|
+
"ssl-pass"));
|
|
975
|
+
_set(
|
|
976
|
+
"keys",
|
|
977
|
+
"length",
|
|
871
978
|
_opt_read(
|
|
872
979
|
_argv,
|
|
873
980
|
"l",
|
|
874
|
-
"keys-length");
|
|
875
|
-
|
|
981
|
+
"keys-length"));
|
|
982
|
+
_set(
|
|
983
|
+
"validity",
|
|
984
|
+
"min",
|
|
876
985
|
_opt_read(
|
|
877
986
|
_argv,
|
|
878
987
|
"B",
|
|
879
|
-
"validity-min");
|
|
880
|
-
|
|
988
|
+
"validity-min"));
|
|
989
|
+
_set(
|
|
990
|
+
"validity",
|
|
991
|
+
"max",
|
|
881
992
|
_opt_read(
|
|
882
993
|
_argv,
|
|
883
994
|
"E",
|
|
884
|
-
"validity-max");
|
|
885
|
-
|
|
995
|
+
"validity-max"));
|
|
996
|
+
_set(
|
|
997
|
+
"domain",
|
|
998
|
+
"name",
|
|
886
999
|
_opt_read(
|
|
887
1000
|
_argv,
|
|
888
1001
|
"D",
|
|
889
|
-
"domain-name");
|
|
890
|
-
|
|
1002
|
+
"domain-name"));
|
|
1003
|
+
_set(
|
|
1004
|
+
"country",
|
|
1005
|
+
"name",
|
|
891
1006
|
_opt_read(
|
|
892
1007
|
_argv,
|
|
893
1008
|
"C",
|
|
894
|
-
"country-name");
|
|
895
|
-
|
|
1009
|
+
"country-name"));
|
|
1010
|
+
_set(
|
|
1011
|
+
"state",
|
|
1012
|
+
"name",
|
|
896
1013
|
_opt_read(
|
|
897
1014
|
_argv,
|
|
898
1015
|
"S",
|
|
899
|
-
"state-name");
|
|
900
|
-
|
|
1016
|
+
"state-name"));
|
|
1017
|
+
_set(
|
|
1018
|
+
"locality",
|
|
1019
|
+
"name",
|
|
901
1020
|
_opt_read(
|
|
902
1021
|
_argv,
|
|
903
1022
|
"L",
|
|
904
|
-
"locality-name");
|
|
905
|
-
|
|
1023
|
+
"locality-name"));
|
|
1024
|
+
_set(
|
|
1025
|
+
"organization",
|
|
1026
|
+
"name",
|
|
906
1027
|
_opt_read(
|
|
907
1028
|
_argv,
|
|
908
1029
|
"O",
|
|
909
|
-
"organization-name");
|
|
910
|
-
|
|
1030
|
+
"organization-name"));
|
|
1031
|
+
_set(
|
|
1032
|
+
"organization",
|
|
1033
|
+
"unit",
|
|
911
1034
|
_opt_read(
|
|
912
1035
|
_argv,
|
|
913
1036
|
"U",
|
|
914
|
-
"organization-unit");
|
|
915
|
-
|
|
1037
|
+
"organization-unit"));
|
|
1038
|
+
_set(
|
|
1039
|
+
"serial",
|
|
1040
|
+
"number",
|
|
916
1041
|
_opt_read(
|
|
917
1042
|
_argv,
|
|
918
1043
|
"X",
|
|
919
|
-
"serial-number");
|
|
920
|
-
|
|
1044
|
+
"serial-number"));
|
|
1045
|
+
_set(
|
|
1046
|
+
"cache",
|
|
1047
|
+
"dir",
|
|
921
1048
|
_opt_read(
|
|
922
1049
|
_argv,
|
|
923
1050
|
"W",
|
|
924
|
-
"cache-dir");
|
|
1051
|
+
"cache-dir"));
|
|
925
1052
|
}
|
|
926
1053
|
|
|
927
1054
|
function
|
|
@@ -931,25 +1058,35 @@ function
|
|
|
931
1058
|
const
|
|
932
1059
|
_argv =
|
|
933
1060
|
_argv_url_get();
|
|
934
|
-
|
|
1061
|
+
_set(
|
|
1062
|
+
"target",
|
|
1063
|
+
"directory",
|
|
935
1064
|
_argv[
|
|
936
1065
|
"target_directory"][
|
|
937
|
-
0];
|
|
938
|
-
|
|
1066
|
+
0]);
|
|
1067
|
+
_set(
|
|
1068
|
+
"listen",
|
|
1069
|
+
"uris",
|
|
939
1070
|
_argv[
|
|
940
|
-
"listen"];
|
|
941
|
-
|
|
1071
|
+
"listen"]);
|
|
1072
|
+
_set(
|
|
1073
|
+
"target",
|
|
1074
|
+
"port",
|
|
942
1075
|
_argv[
|
|
943
1076
|
"port"][
|
|
944
|
-
0];
|
|
945
|
-
|
|
1077
|
+
0]);
|
|
1078
|
+
_set(
|
|
1079
|
+
"index",
|
|
1080
|
+
"redirect",
|
|
946
1081
|
_argv[
|
|
947
1082
|
"single"][
|
|
948
|
-
0];
|
|
949
|
-
|
|
1083
|
+
0]);
|
|
1084
|
+
_set(
|
|
1085
|
+
"config",
|
|
1086
|
+
"file",
|
|
950
1087
|
_argv[
|
|
951
1088
|
"config_file"][
|
|
952
|
-
0];
|
|
1089
|
+
0]);
|
|
953
1090
|
compression_disabled =
|
|
954
1091
|
_argv[
|
|
955
1092
|
"no_compression"][
|
|
@@ -1074,6 +1211,23 @@ app_opts = [
|
|
|
1074
1211
|
organization_name,
|
|
1075
1212
|
organization_unit
|
|
1076
1213
|
];
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1214
|
+
try {
|
|
1215
|
+
_safely_serve.apply(
|
|
1216
|
+
null,
|
|
1217
|
+
app_opts);
|
|
1218
|
+
}
|
|
1219
|
+
catch(
|
|
1220
|
+
_error) {
|
|
1221
|
+
const
|
|
1222
|
+
_msg =
|
|
1223
|
+
"Error running '_safely_serve' with arguments:";
|
|
1224
|
+
_msg_error(
|
|
1225
|
+
_msg,
|
|
1226
|
+
0);
|
|
1227
|
+
_echo2(
|
|
1228
|
+
app_opts);
|
|
1229
|
+
_echo2(
|
|
1230
|
+
_error);
|
|
1231
|
+
_exit(
|
|
1232
|
+
1);
|
|
1233
|
+
}
|
package/webpack.config.cjs
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
|
|
3
|
+
/** ---------------------------------------------------------
|
|
4
|
+
* webpack.config.cjs
|
|
5
|
+
* ---------------------------------------------------------
|
|
6
|
+
* Copyright ©
|
|
7
|
+
* Pellegrino Prevete
|
|
8
|
+
* 2024, 2025, 2026
|
|
9
|
+
*
|
|
10
|
+
* All rights reserved
|
|
11
|
+
* ---------------------------------------------------------
|
|
12
|
+
*
|
|
13
|
+
* This program is free software: you can redistribute it and/or
|
|
14
|
+
* modify it under the terms of the GNU General Public License
|
|
15
|
+
* as published by the Free Software Foundation, either
|
|
16
|
+
* version 3 of the License, or (at your option) any later
|
|
17
|
+
* version.
|
|
18
|
+
*
|
|
19
|
+
* This program is distributed in the hope that it will be
|
|
20
|
+
* useful, but WITHOUT ANY WARRANTY; without even the implied
|
|
21
|
+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
22
|
+
* PURPOSE.
|
|
23
|
+
* See the GNU General Public License for more details.
|
|
24
|
+
*
|
|
25
|
+
* You should have received a copy of the
|
|
26
|
+
* GNU General Public License along with this program.
|
|
27
|
+
* If not, see <https://www.gnu.org/licenses/>.
|
|
28
|
+
*/
|
|
29
|
+
|
|
1
30
|
const
|
|
2
31
|
_path =
|
|
3
32
|
require(
|