hfs 0.52.2 → 0.52.4
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/admin/assets/{index-SdT-xAgy.js → index-LkaBe_Fp.js} +69 -69
- package/admin/assets/{sha512-wLBxKmAg.js → sha512-a95yq7Nq.js} +1 -1
- package/admin/index.html +3 -2
- package/frontend/assets/{index-f_a4EAov.js → index-c8LVGHJd.js} +9 -9
- package/frontend/assets/{index-_JmRmWgy.css → index-oekM6dN8.css} +1 -1
- package/frontend/assets/{sha512-eHY6kymX.js → sha512-PGV0A--c.js} +1 -1
- package/frontend/index.html +3 -2
- package/package.json +1 -1
- package/src/api.accounts.js +2 -2
- package/src/api.vfs.js +8 -3
- package/src/const.js +1 -1
- package/src/cross.js +5 -1
- package/src/perm.js +5 -6
- package/src/serveFile.js +2 -0
- package/src/serveGuiAndSharedFiles.js +2 -1
- package/src/vfs.js +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.ariaOnly{position:absolute;clip-path:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}:root{height:100dvh;--bg: #fff;--text: #555;--text-high-contrast: #111;--ghost-contrast: #8882;--ghost-contrast-alt: #eee;--faint-contrast: #ddd;--mild-contrast: #aaa;--good-contrast: #444;--button-bg: #6080aa;--button-text: #eaeaea;--focus-color: #468;--separator: " – ";--success: #8c8;--warning: #cc8;--error: #c88}@supports (content: ""/""){:root{--separator: " – " / ""}}:root .highlightedText,:root .file-menu a:hover{color:#0006;text-shadow:0 0 3px rgba(0,0,0,.4)}:root .theme-dark{--bg: #000;--text: #999;--text-high-contrast: #eee;--ghost-contrast-alt: #181818;--faint-contrast: #2d2d2d;--good-contrast: #aaa;--button-bg: #345;--button-text: #999;--success: #383;--warning: #883;--error: #a33;color-scheme:dark}:root .theme-dark .highlightedText,:root .theme-dark .file-menu a:hover,:root .file-menu .theme-dark a:hover{color:#fff;text-shadow:0 0 3px #fff}:root .theme-dark a{color:#8ac}:root .theme-dark .dialog-closer{background:#633}:root .theme-dark .dialog-icon{color:#ccc}:root .theme-dark .dialog-icon .icon{color:#aaa}:root .theme-dark .dialog-backdrop{background:#333b}:root .theme-dark .error-msg{color:#b88;background-color:#623}:root .theme-dark button.toggled,:root .theme-dark a.toggled{color:#eee;text-shadow:0 0 3px #fff}body{background-color:var(--bg);margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,button,select,input{font-size:12pt}.list-wrapper{max-width:54em;margin:auto;min-height:100vh;display:flex;flex-direction:column}body,input{color:var(--text)}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}input:not([type=checkbox],[type=range]),select,textarea{padding:.3em .4em;border-radius:.5em;background:var(--bg);border-color:var(--mild-contrast);color:var(--good-contrast);max-width:100%;box-sizing:border-box;width:100%}input[type=range]{width:calc(100% - 1px)}input[type=checkbox]{transform:scale(1.7);accent-color:var(--button-bg)}textarea{font-size:14pt}label input[type=checkbox]{margin-right:.8em}select{text-align:center}.hidden{display:none!important}[class^=fa-]:before,[class*=" fa-"]:before{margin:0}.icon{font-size:1.2em;height:1.2em;width:1.4em;display:inline-block;text-align:center}img.file-icon{height:1em}.file-icon{background-size:contain;background-repeat:no-repeat;background-position:center;vertical-align:text-bottom}.icon.mirror:before{transform:scaleX(-1)}a{text-decoration:none;color:var(--button-bg)}button{background-color:var(--button-bg);color:var(--button-text);padding:.5em;border:transparent;text-decoration:none;border-radius:.3em;vertical-align:middle;cursor:pointer;transition:background-color .5s}button:not(.before-sliding){min-width:min-content}button.small{padding:0 .4em;height:30px}button .icon{position:relative;top:.05em}button:hover{outline:1px solid var(--mild-contrast)}button[disabled]{background-color:var(--faint-contrast)}button.toggled{color:#fff;text-shadow:0 0 3px #fff}a.toggled{color:#223;text-shadow:0 0 5px #223}button:focus-visible,.breadcrumb:focus-visible{outline:3px solid var(--focus-color)}a>button{width:100%;height:100%}input:focus-visible,select:focus-visible,ul a:focus-visible{border-radius:.3em;border-color:transparent;outline:2px solid var(--focus-color)}.icon-button{padding:.1em;font-size:104%;height:1.8em;width:2em}.error-msg{background-color:#faa;color:#833;padding:.5em 1em}.hide-back,.upload-toolbar,header{background-color:var(--bg)}header{position:sticky;top:0;padding:.2em .1em;z-index:3}kbd{background-color:#eee;border-radius:3px;border:1px solid #b4b4b4;box-shadow:0 1px 1px #0003,0 2px #ffffffb3 inset;color:#333;display:inline-block;font-size:.85em;font-weight:700;line-height:1;padding:2px 4px;white-space:nowrap;margin-right:.5em}.before-sliding{width:0!important;flex:0!important;margin:0!important;height:0!important;padding:0!important;overflow:hidden!important;transition:flex .5s}.show-sliding{transition:flex .5s;overflow:clip;flex:1;white-space:nowrap}.ani-working{animation:1s blink infinite}@keyframes blink{0%{opacity:1}50%{opacity:.2}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.spinner,.icon.spinner:before{animation:1.5s spin infinite linear;display:inline-flex;justify-content:center;align-items:center;width:min-content}.breadcrumb{padding:.1em .6em .2em;line-height:1.8em;border-radius:.7em;background-color:var(--button-bg);color:var(--button-text);border-top:1px solid #666;margin-right:-.1em}.breadcrumb:nth-child(-n+3) .icon{padding:0 .2em}#folder-stats,#filter-bar>span{font-size:90%}#folder-stats{margin-left:.5em;line-height:2em;float:right}#folder-stats .icon{margin-right:.3em}#filter{flex:1;box-sizing:border-box}#filter-bar{display:flex;align-items:center;gap:.8em;margin:.2em 0 0;padding:2px 0 1px 3px;height:1.8em}#filter-bar input[type=checkbox]{margin-top:.3em}#filter-bar span:empty{display:none}ul.dir{flex:1;padding:0;margin:0;clear:both}ul.dir>p{text-align:center}ul.dir li{display:block;list-style-type:none;padding:.3em .3em .4em;border-bottom:1px solid var(--faint-contrast)}ul.dir li:nth-of-type(odd){background-color:var(--ghost-contrast)}ul.dir li input[type=checkbox]{margin-right:1em}@media (hover: none){ul.dir li .link-wrapper .popup-menu-button{display:none}}@media (hover: hover){ul.dir li .link-wrapper:not(:hover):not(:focus,:focus-within) .popup-menu-button{opacity:.001}ul.dir li .link-wrapper:hover{padding:1em;margin:-1em}ul.dir li .link-wrapper:hover .popup-menu-button{z-index:1}}ul.dir li .link-wrapper a:last-of-type{word-break:break-word;padding-right:.5em}ul.dir li .link-wrapper a .icon{margin-right:.5em;display:inline-block;text-align:center}ul.dir li .link-wrapper a img.icon,ul.dir li .link-wrapper a video.icon{vertical-align:bottom;position:relative;top:1px}ul.dir li .link-wrapper a:hover{text-decoration:underline}ul.dir li .entry-panel{float:right;padding-top:.3em;display:flex;align-items:center}ul.dir li .entry-panel .icon-button{margin:-3px 0 -3px .4em;font-size:.7em;width:2.4em}ul.dir li .entry-panel .entry-details{font-size:90%;margin-left:4px;font-variant-numeric:tabular-nums}ul.dir li .entry-panel .entry-details .entry-size-unit{margin-left:.3em}ul.dir li>div:last-of-type{clear:both}ul.dir li.page-separator{margin-top:.7em;position:relative}ul.dir li.page-separator:before{content:attr(label);position:absolute;top:-1.5em;font-size:smaller;margin-left:calc(50% - 1em);opacity:.9}.entry-comment{display:inline;white-space:pre-wrap;word-break:break-word;margin-bottom:.5em}.entry-comment:before,.entry-comment:after{font-size:1.5em;font-family:serif;line-height:1px;position:relative}.entry-comment:before{content:"“";margin-right:.1em;top:.2em}.entry-comment:after{content:"„";top:-.1em;margin-left:.1em}#menu-bar{display:flex;justify-content:space-evenly;flex-wrap:wrap}#menu-bar>*{flex:1;margin:.1em}#menu-bar>*:first-child{margin-left:0}#menu-bar>*:last-child{margin-right:0}#menu-bar button{padding:min(1vh,.5em) 0}#searched{margin:.2em}#user-panel{display:flex;flex-direction:column;gap:1em}#user-panel a>button{width:100%}button .icon+.label{cursor:inherit;margin-left:.4em}.dialog-backdrop.working{font-size:5em;animation:1s fade-in}.dialog-content{padding:.2em}.dialog-alert .dialog-content{text-align:center}.dialog-alert .dialog-content p{text-align:left;display:inline-block}.dialog{min-width:11em;--color: var(--button-bg)}.dialog-icon .icon{margin-left:-1px;font-size:95%;margin-top:.4em;border-radius:.6em 0}#paging{position:sticky;bottom:0;display:flex;gap:.1em;background-color:var(--bg);padding:0 .2em .2em}#paging>button{z-index:1}#paging button{box-shadow:0 0 .3em .3em #0003}#paging #paging-middle{padding:0 .5em;margin:0 -.3em;display:flex;gap:.5em;flex:1;overflow-x:auto}#paging #paging-middle>button{flex:1;min-width:unset;padding-top:0;padding-bottom:0}#paging button{background:var(--button-bg);text-align:center;white-space:nowrap;padding:.5em}.upload-toolbar{position:sticky;top:-4px;padding-top:1px;z-index:3;box-shadow:0 0 .3em .3em var(--bg)}.upload-progress:before{content:var(--separator)}.entry-size:after{content:var(--separator)}.upload-progress{min-width:4em;display:inline-block;margin-left:.5em}.upload-progress-bar{display:block;width:100%}.upload-list{margin-top:.5em}.upload-list td:nth-child(1){width:0}.upload-list td:nth-child(2){text-align:right;width:0;white-space:nowrap;padding-left:.5em}.upload-list td:nth-child(3){padding:.2em .5em;word-break:break-word}.nowrap{white-space:nowrap}.login-dialog form{display:flex;flex-direction:column;gap:1.2em}.login-dialog label{display:block;margin-bottom:.5em;margin-left:.1em}.miss-perm{margin:0 .3em}.popup-menu-button{font-size:.8em;padding:.2em .3em;position:absolute;opacity:.8;white-space:nowrap}.popup-menu-button:hover{opacity:1}.file-dialog .dialog{min-width:13em}.file-dialog-properties{word-break:break-word;line-height:1.5em;margin:0}.file-dialog-properties dt{font-weight:700}.file-dialog-properties dd{margin-left:1.5em}.file-menu{margin-top:1em;padding-top:1em;border-top:1px solid var(--faint-contrast);display:flex;flex-direction:column;gap:.7em 1em}.file-menu a{display:flex;align-items:flex-start}.file-menu a label{cursor:pointer;margin-top:.1em}.file-menu a label small{display:block}.file-menu a .icon{margin-right:.5em}.unauthorized{text-align:center}#clipBar{position:sticky;bottom:0;background:var(--bg);box-shadow:0 0 .3em .3em var(--bg);display:flex;align-items:center;gap:.5em}.tiles-mode{max-width:none;--tile-size: 5;--name-lines: 3;--name-height: calc(4.7em + var(--tile-size) * .4em + 1.2em * var(--name-lines));--tile-width: calc(5em + 1em * var(--tile-size))}@media (min-width: 42em){.tiles-mode{margin:0 1em}}.tiles-mode ul.dir{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--tile-width),1fr));grid-auto-rows:calc(var(--name-height) + 1.3em);gap:0 20px}.tiles-mode ul.dir li{text-align:center;position:relative;display:flex;flex-direction:column;border-bottom:none;overflow-x:clip;padding:.5em 0 0}.tiles-mode ul.dir li .link-wrapper:not(:hover){max-height:var(--name-height);display:block;display:-webkit-box;overflow:hidden;-webkit-line-clamp:calc(var(--name-lines) + 1);-webkit-box-orient:vertical}.tiles-mode ul.dir li .link-wrapper a:last-of-type{padding:0}.tiles-mode ul.dir li .link-wrapper a span{display:block}.tiles-mode ul.dir li .link-wrapper a .icon.icon{font-size:calc(1.2rem + .6rem * var(--tile-size))}.tiles-mode ul.dir li .link-wrapper a img.icon,.tiles-mode ul.dir li .link-wrapper a video.icon{width:auto;height:1em;padding:.1em 0}.tiles-mode ul.dir li .link-wrapper a .icon{font-size:4rem;display:block;margin:auto}.tiles-mode ul.dir li .link-wrapper:hover{overflow:visible;display:block;z-index:1}.tiles-mode ul.dir li .link-wrapper:hover .icon:before{text-decoration:none}.tiles-mode ul.dir li .link-wrapper:hover{padding:0;margin:0}.tiles-mode ul.dir li:nth-of-type(odd){background-color:inherit}.tiles-mode ul.dir li .entry-panel{justify-content:center;font-size:10pt}.tiles-mode ul.dir li .entry-details{font-size:80%}.tiles-mode ul.dir li.page-separator:before{content:""}.tiles-mode ul.dir li input[type=checkbox]{margin:0;position:absolute;top:.3em;right:1em}.tiles-mode ul.dir li .link-wrapper a{display:inline}.tiles-mode ul.dir li:hover{--bg: var(--ghost-contrast-alt);background:var(--bg)}.tiles-mode ul.dir li:hover .link-wrapper,.tiles-mode ul.dir li:hover .entry-panel{z-index:1;background:var(--bg)}.tiles-mode ul.dir li:hover input[type=checkbox]{z-index:2}.tiles-mode ul.dir li:hover .entry-panel{padding-bottom:.3em}.tiles-mode ul.dir li .entry-comment{max-height:1.2em;overflow:hidden;margin:0}.tiles-mode ul.dir li .entry-comment:hover{max-height:none;overflow:auto}.tiles-mode .entry-size:after{content:none}.tiles-mode .entry-ts{display:none}.tiles-mode .popup-menu-button{position:absolute;top:0;left:0}.tiles-mode #filter-bar{margin-bottom:1em}.tiles-mode #paging{z-index:1}#root .file-show{--nav-size: min(25vh, 25vw)}#root .file-show>div{height:100%;width:100%}@media (max-width: 30em){#root .file-show>div{flex-direction:column-reverse!important}}#root .file-show .showing-container{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;position:relative}#root .file-show .meta-tags{position:relative;width:100%;text-align:center;display:flex;justify-content:center}#root .file-show .meta-tags>div{position:absolute;margin:1em}#root .file-show .showing{max-width:calc(100% - (min(4vw,var(--nav-size))*2));max-height:100%}#root .file-show .cover{position:absolute;width:100%;height:100%;background-repeat:no-repeat;background-size:contain;background-position:center;z-index:-1;opacity:.3;transition:opacity 1s}#root .file-show .cover.none{opacity:0}#root .file-show audio.showing{min-width:60%}#root .file-show audio.showing,#root .file-show img.showing{max-width:100%}#root .file-show .main{flex:1;position:relative;max-height:100%;overflow:hidden}#root .file-show .freeY .main,#root .file-show .fullWidth .main{overflow-y:auto}#root .file-show .freeY .showing,#root .file-show .fullWidth .showing{max-height:initial;margin:auto}#root .file-show .freeY .showing-container,#root .file-show .fullWidth .showing-container{overflow:auto;align-items:flex-start}#root .file-show .fullWidth .showing-container,#root .file-show .fullWidth .showing{width:100%}#root .file-show .nav{position:absolute;width:.5em;font-size:var(--nav-size);cursor:pointer;opacity:.3;-webkit-text-stroke:2px black;user-select:none;transition:opacity .3s}#root .file-show .nav:hover{opacity:.7}#root .file-show .nav.nav-hidden:not(:hover){opacity:0}#root .file-show .bar{padding:.5em min(2vw,1em);background:var(--bg);opacity:.8;flex-wrap:wrap}#root .file-show .bar,#root .file-show .bar>.controls{display:flex;align-items:center;justify-content:flex-end;gap:.5em}#root .file-show .bar .entry-details{font-size:smaller;margin-left:1em}#root .file-show .bar .entry-ts{display:inherit;font-size:smaller}#root .file-show .bar .entry-size:after{display:none}.file-show-help kbd{margin:.5em}.file-show-help kbd:first-of-type{margin-top:1em}@media (min-width: 42em){body{scrollbar-width:thin;scrollbar-color:var(--button-bg) var(--ghost-contrast)}body::-webkit-scrollbar{width:12px}body::-webkit-scrollbar-track{background:var(--ghost-contrast)}body::-webkit-scrollbar-thumb{background-color:var(--button-bg);border-radius:20px;border:1px solid var(--ghost-contrast)}button{padding:.5em 1em}}@media (max-width: 42em){:root{--ghost-contrast: #8883}body,button,select{font-size:14pt}#menu-bar button .label,#filter-bar button .label,#clipBar button .label{display:none}#filter-bar{margin-top:.4em}#filter-bar button{width:17.6vw;height:2.3em}.breadcrumb{word-break:break-all}.breadcrumb .icon{font-size:24px}#root>.tiles-mode{margin:0}}@media (max-height: 600px){.file-dialog .dialog-content{display:flex;gap:3em;margin:1em}.file-dialog .dialog-content .file-menu{margin-top:0;padding-top:0;border-top:none;margin-left:2em;padding-left:2em;border-left:1px solid var(--faint-contrast)}}@media (pointer: coarse){#root>.tiles-mode .file-menu-button{font-size:1em;margin-top:.3em}}.dialog-backdrop{position:fixed;top:0;bottom:0;left:0;right:0;background:#8886;backdrop-filter:blur(2px);display:flex;justify-content:center;align-items:center;z-index:1000}.dialog{background:#fff;background:var(--bg);padding:.5em;padding:max(.5em,1vw,2vh);padding-top:0;border-radius:1em;position:relative;margin:0 3vw;overflow:hidden;max-height:calc(100vh - 2em);display:flex;flex-direction:column;justify-content:center}.dialog-icon{color:#fff;background-color:var(--color);position:absolute;top:0;width:2em;height:1.8em;text-align:center;border-radius:.8em 0}.dialog-icon-text{display:flex;align-items:center;justify-content:center}.dialog-title{font-size:120%;font-weight:400;margin:.3em 0;padding:0 .5em;min-height:1.2em}.dialog-closer~.dialog-title{margin-right:2em}.dialog-type~.dialog-title{margin-left:2em}.dialog-icon~.dialog-title{text-align:center}.dialog-closer{border-radius:0 .8em;right:0;padding:0;background-color:#c88}.dialog-icon~.dialog-content{margin-top:1em}.dialog-type{left:0;top:0;overflow:hidden;opacity:.7}.dialog-content{overflow:auto;max-height:calc(100vh - 4.5em)}.dialog-content p{white-space:pre-wrap;margin:.5em 0}.dialog-confirm .dialog-content button{margin-top:1em}.dialog-alert-info{--color: #282 }.dialog-alert-warning{--color: #c91 }.dialog-alert-error{--color: #822}@media (max-width: 42em){.dialog-icon{font-size:120%}.dialog-icon~.dialog-content{margin-top:1.5em}}.dialog-prompt label{display:block;margin:.5em .1em}.toasts{position:fixed;right:0;display:flex;flex-direction:column;margin-top:.5em;gap:.5em;z-index:1001}.toast{background:var(--faint-contrast);color:var(--text-high-contrast);transition:all .5s ease-in;position:relative;left:-.5em;overflow:hidden;display:flex;align-items:center;padding:.3em .6em;border-radius:.5em;box-shadow:0 0 .3em .3em #8883;box-sizing:border-box}.toast .toast-icon{margin-right:.3em;animation:zoomRotating 1.5s}.toast.toast-success{background-color:var(--success)}.toast.toast-warning{background-color:var(--warning)}.toast.toast-error{background-color:var(--error)}.toast.before{left:100%;transform:scale(.1);padding-top:0;padding-bottom:0}.toast.after{height:0!important;padding-top:0;padding-bottom:0;transition-duration:.2s;transform:scale(0)}@keyframes zoomRotating{0%{transform:scale(0)}to{transform:scale(1) rotate(360deg)}}
|
|
1
|
+
@charset "UTF-8";.ariaOnly{position:absolute;clip-path:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}:root{height:100dvh;--bg: #fff;--text: #555;--text-high-contrast: #111;--ghost-contrast: #8882;--ghost-contrast-alt: #eee;--faint-contrast: #ddd;--mild-contrast: #aaa;--good-contrast: #444;--button-bg: #6080aa;--button-text: #eaeaea;--focus-color: #468;--separator: " – ";--success: #8c8;--warning: #cc8;--error: #c88}@supports (content: ""/""){:root{--separator: " – " / ""}}:root .highlightedText,:root .file-menu a:hover{color:#0006;text-shadow:0 0 3px rgba(0,0,0,.4)}:root .theme-dark{--bg: #000;--text: #999;--text-high-contrast: #eee;--ghost-contrast-alt: #181818;--faint-contrast: #2d2d2d;--good-contrast: #aaa;--button-bg: #345;--button-text: #999;--success: #383;--warning: #883;--error: #a33;color-scheme:dark}:root .theme-dark .highlightedText,:root .theme-dark .file-menu a:hover,:root .file-menu .theme-dark a:hover{color:#fff;text-shadow:0 0 3px #fff}:root .theme-dark a{color:#8ac}:root .theme-dark .dialog-closer{background:#633}:root .theme-dark .dialog-icon{color:#ccc}:root .theme-dark .dialog-icon .icon{color:#aaa}:root .theme-dark .dialog-backdrop{background:#333b}:root .theme-dark .error-msg{color:#b88;background-color:#623}:root .theme-dark button.toggled,:root .theme-dark a.toggled{color:#eee;text-shadow:0 0 3px #fff}body{background-color:var(--bg);margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,button,select,input{font-size:12pt}.list-wrapper{max-width:54em;margin:auto;min-height:100vh;display:flex;flex-direction:column}body,input{color:var(--text)}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}input:not([type=checkbox],[type=range]),select,textarea{padding:.3em .4em;border-radius:.5em;background:var(--bg);border-color:var(--mild-contrast);color:var(--good-contrast);max-width:100%;box-sizing:border-box;width:100%}input[type=range]{width:calc(100% - 1px)}input[type=checkbox]{transform:scale(1.7);accent-color:var(--button-bg)}textarea{font-size:14pt}label input[type=checkbox]{margin-right:.8em}select{text-align:center}.hidden{display:none!important}[class^=fa-]:before,[class*=" fa-"]:before{margin:0}.icon{font-size:1.2em;height:1.2em;width:1.4em;display:inline-block;text-align:center}img.file-icon{height:1em}.file-icon{background-size:contain;background-repeat:no-repeat;background-position:center;vertical-align:text-bottom}.icon.mirror:before{transform:scaleX(-1)}a{text-decoration:none;color:var(--button-bg)}button{background-color:var(--button-bg);color:var(--button-text);padding:.5em;border:transparent;text-decoration:none;border-radius:.3em;vertical-align:middle;cursor:pointer;transition:background-color .5s}button:not(.before-sliding){min-width:min-content}button.small{padding:0 .4em;height:30px}button .icon{position:relative;top:.05em}button:hover{outline:1px solid var(--mild-contrast)}button[disabled]{background-color:var(--faint-contrast)}button.toggled{color:#fff;text-shadow:0 0 3px #fff}a.toggled{color:#223;text-shadow:0 0 5px #223}button:focus-visible,.breadcrumb:focus-visible{outline:3px solid var(--focus-color)}a>button{width:100%;height:100%}input:focus-visible,select:focus-visible,ul a:focus-visible{border-radius:.3em;border-color:transparent;outline:2px solid var(--focus-color)}.icon-button{padding:.1em;font-size:104%;height:1.8em;width:2em}.error-msg{background-color:#faa;color:#833;padding:.5em 1em}.hide-back,.upload-toolbar,header{background-color:var(--bg)}header{position:sticky;top:0;padding:.2em .1em;z-index:3}kbd{background-color:#eee;border-radius:3px;border:1px solid #b4b4b4;box-shadow:0 1px 1px #0003,0 2px #ffffffb3 inset;color:#333;display:inline-block;font-size:.85em;font-weight:700;line-height:1;padding:2px 4px;white-space:nowrap;margin-right:.5em}.before-sliding{width:0!important;flex:0!important;margin:0!important;height:0!important;padding:0!important;overflow:hidden!important;transition:flex .5s}.show-sliding{transition:flex .5s;overflow:clip;flex:1;white-space:nowrap}.ani-working{animation:1s blink infinite}@keyframes blink{0%{opacity:1}50%{opacity:.2}}@keyframes spin{to{transform:rotate(360deg)}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.spinner,.icon.spinner:before{animation:1.5s spin infinite linear;display:inline-flex;justify-content:center;align-items:center;width:min-content}.breadcrumb{padding:.1em .6em .2em;line-height:1.8em;border-radius:.7em;background-color:var(--button-bg);color:var(--button-text);border-top:1px solid #666;margin-right:-.1em}.breadcrumb:nth-child(-n+3) .icon{padding:0 .2em}#folder-stats,#filter-bar>span{font-size:90%}#folder-stats{margin-left:.5em;line-height:2em;float:right}#folder-stats .icon{margin-right:.3em}#filter{flex:1;box-sizing:border-box}#filter-bar{display:flex;align-items:center;gap:.8em;margin:.2em 0 0;padding:2px 0 1px 3px;height:1.8em}#filter-bar input[type=checkbox]{margin-top:.3em}#filter-bar span:empty{display:none}ul.dir{flex:1;padding:0;margin:0;clear:both}ul.dir>p{text-align:center}ul.dir li{display:block;list-style-type:none;padding:.3em .3em .4em;border-bottom:1px solid var(--faint-contrast)}ul.dir li:nth-of-type(odd){background-color:var(--ghost-contrast)}ul.dir li input[type=checkbox]{margin-right:1em}@media (hover: none){ul.dir li .link-wrapper .popup-menu-button{display:none}}@media (hover: hover){ul.dir li .link-wrapper:not(:hover):not(:focus,:focus-within) .popup-menu-button{opacity:.001}ul.dir li .link-wrapper:hover{padding:1em;margin:-1em}ul.dir li .link-wrapper:hover .popup-menu-button{z-index:1}}ul.dir li .link-wrapper a:last-of-type{word-break:break-word;padding-right:.5em}ul.dir li .link-wrapper a .icon{margin-right:.5em;display:inline-block;text-align:center}ul.dir li .link-wrapper a img.icon,ul.dir li .link-wrapper a video.icon{vertical-align:bottom;position:relative;top:1px}ul.dir li .link-wrapper a:hover{text-decoration:underline}ul.dir li .entry-panel{float:right;padding-top:.3em;display:flex;align-items:center}ul.dir li .entry-panel .icon-button{margin:-3px 0 -3px .4em;font-size:.7em;width:2.4em}ul.dir li .entry-panel .entry-details{font-size:90%;margin-left:4px;font-variant-numeric:tabular-nums}ul.dir li .entry-panel .entry-details .entry-size-unit{margin-left:.3em}ul.dir li>div:last-of-type{clear:both}ul.dir li.page-separator{margin-top:.7em;position:relative}ul.dir li.page-separator:before{content:attr(label);position:absolute;top:-1.5em;font-size:smaller;margin-left:calc(50% - 1em);opacity:.9}.entry-comment{display:inline;white-space:pre-wrap;word-break:break-word;margin-bottom:.5em}.entry-comment:before,.entry-comment:after{font-size:1.5em;font-family:serif;line-height:1px;position:relative}.entry-comment:before{content:"“";margin-right:.1em;top:.2em}.entry-comment:after{content:"„";top:-.1em;margin-left:.1em}#menu-bar{display:flex;justify-content:space-evenly;flex-wrap:wrap}#menu-bar>*{flex:1;margin:.1em}#menu-bar>*:first-child{margin-left:0}#menu-bar>*:last-child{margin-right:0}#menu-bar button{padding:min(1vh,.5em) 0}#searched{margin:.2em}#user-panel{display:flex;flex-direction:column;gap:1em}#user-panel a>button{width:100%}button .icon+.label{cursor:inherit;margin-left:.4em}.dialog-backdrop.working{font-size:5em;animation:1s fade-in}.dialog-content{padding:.2em}.dialog-alert .dialog-content{text-align:center}.dialog-alert .dialog-content p{text-align:left;display:inline-block}.dialog{min-width:11em;--color: var(--button-bg)}.dialog-icon .icon{margin-left:-1px;font-size:95%;margin-top:.4em;border-radius:.6em 0}#paging{position:sticky;bottom:0;display:flex;gap:.1em;background-color:var(--bg);padding:0 .2em .2em}#paging>button{z-index:1}#paging button{box-shadow:0 0 .3em .3em #0003}#paging #paging-middle{padding:0 .5em;margin:0 -.3em;display:flex;gap:.5em;flex:1;overflow-x:auto}#paging #paging-middle>button{flex:1;min-width:unset;padding-top:0;padding-bottom:0}#paging button{background:var(--button-bg);text-align:center;white-space:nowrap;padding:.5em}.upload-toolbar{position:sticky;top:-4px;padding-top:1px;z-index:3;box-shadow:0 0 .3em .3em var(--bg)}.upload-progress:before{content:var(--separator)}.entry-size:after{content:var(--separator)}.upload-progress{min-width:4em;display:inline-block;margin-left:.5em}.upload-progress-bar{display:block;width:100%}.upload-list{margin-top:.5em}.upload-list td:nth-child(1){width:0}.upload-list td:nth-child(2){text-align:right;width:0;white-space:nowrap;padding-left:.5em}.upload-list td:nth-child(3){padding:.2em .5em;word-break:break-word}.nowrap{white-space:nowrap}.login-dialog form{display:flex;flex-direction:column;gap:1.2em}.login-dialog label{display:block;margin-bottom:.5em;margin-left:.1em}.miss-perm{margin:0 .3em}.popup-menu-button{font-size:.8em;padding:.2em .3em;position:absolute;opacity:.8;white-space:nowrap}.popup-menu-button:hover,.popup-menu-button:focus{opacity:1}.file-dialog .dialog{min-width:13em}.file-dialog-properties{word-break:break-word;line-height:1.5em;margin:0}.file-dialog-properties dt{font-weight:700}.file-dialog-properties dd{margin-left:1.5em}.file-menu{margin-top:1em;padding-top:1em;border-top:1px solid var(--faint-contrast);display:flex;flex-direction:column;gap:.7em 1em}.file-menu a{display:flex;align-items:flex-start}.file-menu a label{cursor:pointer;margin-top:.1em}.file-menu a label small{display:block}.file-menu a .icon{margin-right:.5em}.unauthorized{text-align:center}#clipBar{position:sticky;bottom:0;background:var(--bg);box-shadow:0 0 .3em .3em var(--bg);display:flex;align-items:center;gap:.5em}.tiles-mode{max-width:none;--tile-size: 5;--name-lines: 3;--name-height: calc(4.7em + var(--tile-size) * .4em + 1.2em * var(--name-lines));--tile-width: calc(5em + 1em * var(--tile-size))}@media (min-width: 42em){.tiles-mode{margin:0 1em}}.tiles-mode ul.dir{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--tile-width),1fr));grid-auto-rows:calc(var(--name-height) + 1.3em);gap:0 20px}.tiles-mode ul.dir li{text-align:center;position:relative;display:flex;flex-direction:column;border-bottom:none;overflow-x:clip;padding:.5em 0 0}.tiles-mode ul.dir li .link-wrapper:not(:hover){max-height:var(--name-height);display:block;display:-webkit-box;overflow:hidden;-webkit-line-clamp:calc(var(--name-lines) + 1);-webkit-box-orient:vertical}.tiles-mode ul.dir li .link-wrapper a:last-of-type{padding:0}.tiles-mode ul.dir li .link-wrapper a span{display:block}.tiles-mode ul.dir li .link-wrapper a .icon.icon{font-size:calc(1.2rem + .6rem * var(--tile-size))}.tiles-mode ul.dir li .link-wrapper a img.icon,.tiles-mode ul.dir li .link-wrapper a video.icon{width:auto;height:1em;padding:.1em 0}.tiles-mode ul.dir li .link-wrapper a .icon{font-size:4rem;display:block;margin:auto}.tiles-mode ul.dir li .link-wrapper:hover{overflow:visible;display:block;z-index:1}.tiles-mode ul.dir li .link-wrapper:hover .icon:before{text-decoration:none}.tiles-mode ul.dir li .link-wrapper:hover{padding:0;margin:0}.tiles-mode ul.dir li:nth-of-type(odd){background-color:inherit}.tiles-mode ul.dir li .entry-panel{justify-content:center;font-size:10pt}.tiles-mode ul.dir li .entry-details{font-size:80%}.tiles-mode ul.dir li.page-separator:before{content:""}.tiles-mode ul.dir li input[type=checkbox]{margin:0;position:absolute;top:.3em;right:1em}.tiles-mode ul.dir li .link-wrapper a{display:inline}.tiles-mode ul.dir li:hover{--bg: var(--ghost-contrast-alt);background:var(--bg)}.tiles-mode ul.dir li:hover .link-wrapper,.tiles-mode ul.dir li:hover .entry-panel{z-index:1;background:var(--bg)}.tiles-mode ul.dir li:hover input[type=checkbox]{z-index:2}.tiles-mode ul.dir li:hover .entry-panel{padding-bottom:.3em}.tiles-mode ul.dir li .entry-comment{max-height:1.2em;overflow:hidden;margin:0}.tiles-mode ul.dir li .entry-comment:hover{max-height:none;overflow:auto}.tiles-mode .entry-size:after{content:none}.tiles-mode .entry-ts{display:none}.tiles-mode .popup-menu-button{position:absolute;top:0;left:0}.tiles-mode #filter-bar{margin-bottom:1em}.tiles-mode #paging{z-index:1}#root .file-show{--nav-size: min(25vh, 25vw)}#root .file-show>div{height:100%;width:100%}@media (max-width: 30em){#root .file-show>div{flex-direction:column-reverse!important}}#root .file-show .showing-container{width:100%;height:100%;display:flex;flex-direction:column;justify-content:space-evenly;align-items:center;position:relative}#root .file-show .meta-tags{position:relative;width:100%;text-align:center;display:flex;justify-content:center}#root .file-show .meta-tags>div{position:absolute;margin:1em}#root .file-show .showing{max-width:calc(100% - (min(4vw,var(--nav-size))*2));max-height:100%}#root .file-show .cover{position:absolute;width:100%;height:100%;background-repeat:no-repeat;background-size:contain;background-position:center;z-index:-1;opacity:.3;transition:opacity 1s}#root .file-show .cover.none{opacity:0}#root .file-show audio.showing{min-width:60%}#root .file-show audio.showing,#root .file-show img.showing{max-width:100%}#root .file-show .main{flex:1;position:relative;max-height:100%;overflow:hidden}#root .file-show .freeY .main,#root .file-show .fullWidth .main{overflow-y:auto}#root .file-show .freeY .showing,#root .file-show .fullWidth .showing{max-height:initial;margin:auto}#root .file-show .freeY .showing-container,#root .file-show .fullWidth .showing-container{overflow:auto;align-items:flex-start}#root .file-show .fullWidth .showing-container,#root .file-show .fullWidth .showing{width:100%}#root .file-show .nav{position:absolute;width:.5em;font-size:var(--nav-size);cursor:pointer;opacity:.3;-webkit-text-stroke:2px black;user-select:none;transition:opacity .3s}#root .file-show .nav:hover{opacity:.7}#root .file-show .nav.nav-hidden:not(:hover){opacity:0}#root .file-show .bar{padding:.5em min(2vw,1em);background:var(--bg);opacity:.8;flex-wrap:wrap}#root .file-show .bar,#root .file-show .bar>.controls{display:flex;align-items:center;justify-content:flex-end;gap:.5em}#root .file-show .bar .entry-details{font-size:smaller;margin-left:1em}#root .file-show .bar .entry-ts{display:inherit;font-size:smaller}#root .file-show .bar .entry-size:after{display:none}.file-show-help kbd{margin:.5em}.file-show-help kbd:first-of-type{margin-top:1em}@media (min-width: 42em){body{scrollbar-width:thin;scrollbar-color:var(--button-bg) var(--ghost-contrast)}body::-webkit-scrollbar{width:12px}body::-webkit-scrollbar-track{background:var(--ghost-contrast)}body::-webkit-scrollbar-thumb{background-color:var(--button-bg);border-radius:20px;border:1px solid var(--ghost-contrast)}button{padding:.5em 1em}}@media (max-width: 42em){:root{--ghost-contrast: #8883}body,button,select{font-size:14pt}#menu-bar button .label,#filter-bar button .label,#clipBar button .label{display:none}#filter-bar{margin-top:.4em}#filter-bar button{width:17.6vw;height:2.3em}.breadcrumb{word-break:break-all}.breadcrumb .icon{font-size:24px}#root>.tiles-mode{margin:0}}@media (max-height: 600px){.file-dialog .dialog-content{display:flex;gap:3em;margin:1em}.file-dialog .dialog-content .file-menu{margin-top:0;padding-top:0;border-top:none;margin-left:2em;padding-left:2em;border-left:1px solid var(--faint-contrast)}}@media (pointer: coarse){#root>.tiles-mode .file-menu-button{font-size:1em;margin-top:.3em}}.dialog-backdrop{position:fixed;top:0;bottom:0;left:0;right:0;background:#8886;backdrop-filter:blur(2px);display:flex;justify-content:center;align-items:center;z-index:1000}.dialog{background:#fff;background:var(--bg);padding:.5em;padding:max(.5em,1vw,2vh);padding-top:0;border-radius:1em;position:relative;margin:0 3vw;overflow:hidden;max-height:calc(100vh - 2em);display:flex;flex-direction:column;justify-content:center}.dialog-icon{color:#fff;background-color:var(--color);position:absolute;top:0;width:2em;height:1.8em;text-align:center;border-radius:.8em 0}.dialog-icon-text{display:flex;align-items:center;justify-content:center}.dialog-title{font-size:120%;font-weight:400;margin:.3em 0;padding:0 .5em;min-height:1.2em}.dialog-closer~.dialog-title{margin-right:2em}.dialog-type~.dialog-title{margin-left:2em}.dialog-icon~.dialog-title{text-align:center}.dialog-closer{border-radius:0 .8em;right:0;padding:0;background-color:#c88}.dialog-icon~.dialog-content{margin-top:1em}.dialog-type{left:0;top:0;overflow:hidden;opacity:.7}.dialog-content{overflow:auto;max-height:calc(100vh - 4.5em)}.dialog-content p{white-space:pre-wrap;margin:.5em 0}.dialog-confirm .dialog-content button{margin-top:1em}.dialog-alert-info{--color: #282 }.dialog-alert-warning{--color: #c91 }.dialog-alert-error{--color: #822}@media (max-width: 42em){.dialog-icon{font-size:120%}.dialog-icon~.dialog-content{margin-top:1.5em}}.dialog-prompt label{display:block;margin:.5em .1em}.toasts{position:fixed;right:0;display:flex;flex-direction:column;margin-top:.5em;gap:.5em;z-index:1001}.toast{background:var(--faint-contrast);color:var(--text-high-contrast);transition:all .5s ease-in;position:relative;left:-.5em;overflow:hidden;display:flex;align-items:center;padding:.3em .6em;border-radius:.5em;box-shadow:0 0 .3em .3em #8883;box-sizing:border-box}.toast .toast-icon{margin-right:.3em;animation:zoomRotating 1.5s}.toast.toast-success{background-color:var(--success)}.toast.toast-warning{background-color:var(--warning)}.toast.toast-error{background-color:var(--error)}.toast.before{left:100%;transform:scale(.1);padding-top:0;padding-bottom:0}.toast.after{height:0!important;padding-top:0;padding-bottom:0;transition-duration:.2s;transform:scale(0)}@keyframes zoomRotating{0%{transform:scale(0)}to{transform:scale(1) rotate(360deg)}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as OF,c as UF}from"./index-
|
|
1
|
+
import{g as OF,c as UF}from"./index-c8LVGHJd.js";function gF(sF,hF){for(var eF=0;eF<hF.length;eF++){const tF=hF[eF];if(typeof tF!="string"&&!Array.isArray(tF)){for(const w in tF)if(w!=="default"&&!(w in sF)){const lF=Object.getOwnPropertyDescriptor(tF,w);lF&&Object.defineProperty(sF,w,lF.get?lF:{enumerable:!0,get:()=>tF[w]})}}}return Object.freeze(Object.defineProperty(sF,Symbol.toStringTag,{value:"Module"}))}var dF={exports:{}};/*
|
|
2
2
|
* [js-sha512]{@link https://github.com/emn178/js-sha512}
|
|
3
3
|
*
|
|
4
4
|
* @version 0.8.0
|
package/frontend/index.html
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=0" />
|
|
6
6
|
<link href="/fontello.css" rel="stylesheet" />
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-c8LVGHJd.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-oekM6dN8.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
12
12
|
<div id="root"></div>
|
|
13
|
+
<script nomodule>document.getElementById('root').innerText = "Please use a newer browser"</script>
|
|
13
14
|
</body>
|
|
14
15
|
</html>
|
package/package.json
CHANGED
package/src/api.accounts.js
CHANGED
|
@@ -53,8 +53,8 @@ exports.default = {
|
|
|
53
53
|
await (0, perm_1.updateAccount)(existing, rest);
|
|
54
54
|
return lodash_1.default.pick(existing, 'username');
|
|
55
55
|
}
|
|
56
|
-
const acc = (0, perm_1.addAccount)(username, rest);
|
|
57
|
-
return acc ? lodash_1.default.pick(acc, 'username') : new apiMiddleware_1.ApiError(const_1.HTTP_BAD_REQUEST);
|
|
56
|
+
const acc = await (0, perm_1.addAccount)(username, rest);
|
|
57
|
+
return acc ? lodash_1.default.pick(acc, 'username') : new apiMiddleware_1.ApiError(const_1.HTTP_BAD_REQUEST); // return username because it is normalized
|
|
58
58
|
},
|
|
59
59
|
del_account({ username }) {
|
|
60
60
|
(0, misc_1.apiAssertTypes)({ string: { username } });
|
package/src/api.vfs.js
CHANGED
|
@@ -224,9 +224,14 @@ const apis = {
|
|
|
224
224
|
for (const k of ['*', 'Directory']) {
|
|
225
225
|
await reg('add', WINDOWS_REG_KEY.replace('*', k), '/ve', '/f', '/d', 'Add to HFS (new)');
|
|
226
226
|
await reg('add', WINDOWS_REG_KEY.replace('*', k) + '\\command', '/ve', '/f', '/d', `powershell -Command "
|
|
227
|
-
$
|
|
228
|
-
|
|
229
|
-
$
|
|
227
|
+
$wsh = New-Object -ComObject Wscript.Shell;
|
|
228
|
+
$j = @{parent=@'\n${parent}\n'@; source=@'\n%1\n'@} | ConvertTo-Json -Compress
|
|
229
|
+
$j = [System.Text.Encoding]::UTF8.GetBytes($j);
|
|
230
|
+
try {
|
|
231
|
+
$res = Invoke-WebRequest -Uri '${url}/~/api/add_vfs' -Method POST -Headers @{ 'x-hfs-anti-csrf' = '1' } -ContentType 'application/json' -TimeoutSec 1 -Body $j;
|
|
232
|
+
$json = $res.Content | ConvertFrom-Json; $link = $json.link; $link | Set-Clipboard;
|
|
233
|
+
$wsh.Popup('The link is ready to be pasted');
|
|
234
|
+
} catch { $wsh.Popup('Server is down', 0, 'Error', 16); }"`);
|
|
230
235
|
}
|
|
231
236
|
return {};
|
|
232
237
|
},
|
package/src/const.js
CHANGED
|
@@ -45,7 +45,7 @@ exports.DEV = process.env.DEV || exports.argv.dev ? 'DEV' : '';
|
|
|
45
45
|
exports.ORIGINAL_CWD = process.cwd();
|
|
46
46
|
exports.HFS_STARTED = new Date();
|
|
47
47
|
const PKG_PATH = (0, path_1.join)(__dirname, '..', 'package.json');
|
|
48
|
-
exports.BUILD_TIMESTAMP = "2024-04-
|
|
48
|
+
exports.BUILD_TIMESTAMP = "2024-04-29T20:42:43.065Z";
|
|
49
49
|
const pkg = JSON.parse(fs.readFileSync(PKG_PATH, 'utf8'));
|
|
50
50
|
exports.VERSION = pkg.version;
|
|
51
51
|
exports.RUNNING_BETA = exports.VERSION.includes('-');
|
package/src/cross.js
CHANGED
|
@@ -18,7 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.typedEntries = exports.typedKeys = exports.objRenameKey = exports.randomId = exports.getOrSet = exports.waitFor = exports.newObj = exports.findDefined = exports.isOrderedEqual = exports.swap = exports.tryJson = exports.dirname = exports.basename = exports.pendingPromise = exports._dbg = exports._log = exports.wantArray = exports.formatPerc = exports.with_ = exports.try_ = exports.setHidden = exports.onlyTruthy = exports.truthy = exports.splitAt = exports.strinsert = exports.removeStarting = exports.enforceFinal = exports.objSameKeys = exports.haveTimeout = exports.wait = exports.prefix = exports.formatSpeed = exports.formatBytes = exports.isWhoObject = exports.PERM_KEYS = exports.defaultPerms = exports.WHO_ANY_ACCOUNT = exports.WHO_NO_ONE = exports.WHO_ANYONE = exports.LIST = exports.CFG = exports.THEME_OPTIONS = exports.SORT_BY_OPTIONS = exports.FRONTEND_OPTIONS = exports.MAX_TILE_SIZE = exports.DAY = exports.HOUR = exports.MINUTE = exports.WIKI_URL = exports.REPO_URL = void 0;
|
|
21
|
-
exports.shortenAgent = exports.mapFilter = exports.inCommon = exports.replace = exports.matches = exports.makeMatcher = exports.runAt = exports.pathEncode = exports.promiseBestEffort = exports.escapeHTML = exports.ipForUrl = exports.isIpLan = exports.isIpLocalHost = exports.xlate = exports.isEqualLax = exports.isWindowsDrive = exports.isIP = exports.isPrimitive = exports.formatTimestamp = exports.repeat = exports.asyncGeneratorToArray = exports.filterMapGenerator = exports.throw_ = exports.hasProp = void 0;
|
|
21
|
+
exports.shortenAgent = exports.mapFilter = exports.inCommon = exports.replace = exports.matches = exports.makeMatcher = exports.runAt = exports.pathEncode = exports.promiseBestEffort = exports.escapeHTML = exports.ipForUrl = exports.isIpLan = exports.isIpLocalHost = exports.xlate = exports.isEqualLax = exports.isTimestampString = exports.isWindowsDrive = exports.isIP = exports.isPrimitive = exports.formatTimestamp = exports.repeat = exports.asyncGeneratorToArray = exports.filterMapGenerator = exports.throw_ = exports.hasProp = void 0;
|
|
22
22
|
// This file is part of HFS - Copyright 2021-2023, Massimo Melina <a@rejetto.com> - License https://www.gnu.org/licenses/gpl-3.0.txt
|
|
23
23
|
// all content here is shared between client and server
|
|
24
24
|
const lodash_1 = __importDefault(require("lodash"));
|
|
@@ -330,6 +330,10 @@ function isWindowsDrive(s) {
|
|
|
330
330
|
return s && /^[a-zA-Z]:$/.test(s);
|
|
331
331
|
}
|
|
332
332
|
exports.isWindowsDrive = isWindowsDrive;
|
|
333
|
+
function isTimestampString(v) {
|
|
334
|
+
return typeof v === 'string' && /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?Z*$/.test(v);
|
|
335
|
+
}
|
|
336
|
+
exports.isTimestampString = isTimestampString;
|
|
333
337
|
function isEqualLax(a, b) {
|
|
334
338
|
return a == b //eslint-disable-line
|
|
335
339
|
|| (a && b && typeof a === 'object' && typeof b === 'object'
|
package/src/perm.js
CHANGED
|
@@ -44,11 +44,10 @@ createAdminConfig.sub(v => {
|
|
|
44
44
|
createAdmin(v);
|
|
45
45
|
createAdminConfig.set('');
|
|
46
46
|
});
|
|
47
|
-
function createAdmin(password, username = 'admin') {
|
|
48
|
-
const acc = addAccount(username, { admin: true });
|
|
47
|
+
async function createAdmin(password, username = 'admin') {
|
|
48
|
+
const acc = await addAccount(username, { admin: true, password });
|
|
49
49
|
if (!acc)
|
|
50
50
|
return console.log("cannot create, already exists");
|
|
51
|
-
updateAccount(acc, { password });
|
|
52
51
|
console.log("account admin created");
|
|
53
52
|
}
|
|
54
53
|
exports.createAdmin = createAdmin;
|
|
@@ -79,7 +78,7 @@ async function updateAccount(account, change) {
|
|
|
79
78
|
account.expire && (account.expire = new Date(account.expire));
|
|
80
79
|
if (username !== usernameWas)
|
|
81
80
|
renameAccount(usernameWas, username);
|
|
82
|
-
if (jsonWas !== JSON.stringify(account))
|
|
81
|
+
if (jsonWas !== JSON.stringify(account)) // this test will miss the 'username' field, because hidden, but renameAccount is already calling saveAccountsASAP
|
|
83
82
|
saveAccountsAsap();
|
|
84
83
|
}
|
|
85
84
|
exports.updateAccount = updateAccount;
|
|
@@ -126,13 +125,13 @@ function renameAccount(from, to) {
|
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
127
|
exports.renameAccount = renameAccount;
|
|
129
|
-
function addAccount(username, props) {
|
|
128
|
+
async function addAccount(username, props) {
|
|
130
129
|
username = normalizeUsername(username);
|
|
131
130
|
if (!username || getAccount(username, false))
|
|
132
131
|
return;
|
|
133
132
|
const copy = (0, misc_1.setHidden)(lodash_1.default.pickBy(props, Boolean), { username }); // have the field in the object but hidden so that stringification won't include it
|
|
134
133
|
exports.accountsConfig.set(accounts => Object.assign(accounts, { [username]: copy }));
|
|
135
|
-
|
|
134
|
+
await updateAccount(copy, copy);
|
|
136
135
|
return copy;
|
|
137
136
|
}
|
|
138
137
|
exports.addAccount = addAccount;
|
package/src/serveFile.js
CHANGED
|
@@ -70,6 +70,8 @@ async function serveFile(ctx, source, mime, content) {
|
|
|
70
70
|
return ctx.status = const_1.HTTP_METHOD_NOT_ALLOWED;
|
|
71
71
|
try {
|
|
72
72
|
const stats = await (0, util_1.promisify)(fs_1.stat)(source); // using fs's function instead of fs/promises, because only the former is supported by pkg
|
|
73
|
+
if (!stats.isFile())
|
|
74
|
+
return ctx.status = const_1.HTTP_METHOD_NOT_ALLOWED;
|
|
73
75
|
ctx.set('Last-Modified', stats.mtime.toUTCString());
|
|
74
76
|
ctx.fileSource = // legacy pre-0.51
|
|
75
77
|
ctx.state.fileSource = source;
|
|
@@ -72,7 +72,8 @@ const serveGuiAndSharedFiles = async (ctx, next) => {
|
|
|
72
72
|
const fn = f.originalFilename;
|
|
73
73
|
ctx.state.uploadPath = decodeURI(ctx.path) + fn;
|
|
74
74
|
ctx.state.uploads.push(fn);
|
|
75
|
-
return (0, upload_1.uploadWriter)(node, fn, ctx)
|
|
75
|
+
return (0, upload_1.uploadWriter)(node, fn, ctx)
|
|
76
|
+
|| new stream_1.Writable({ write(data, enc, cb) { cb(); } }); // just discard data
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
79
|
return new Promise(res => form.parse(ctx.req, err => {
|
package/src/vfs.js
CHANGED
|
@@ -175,8 +175,10 @@ function hasPermission(node, perm, ctx) {
|
|
|
175
175
|
exports.hasPermission = hasPermission;
|
|
176
176
|
function statusCodeForMissingPerm(node, perm, ctx, assign = true) {
|
|
177
177
|
const ret = getCode();
|
|
178
|
-
if (ret && assign)
|
|
178
|
+
if (ret && assign) {
|
|
179
179
|
ctx.status = ret;
|
|
180
|
+
ctx.body = ret === const_1.HTTP_UNAUTHORIZED ? "Unauthorized" : "Forbidden";
|
|
181
|
+
}
|
|
180
182
|
return ret;
|
|
181
183
|
function getCode() {
|
|
182
184
|
if (!node.source && perm === 'can_upload') // Upload possible only if we know where to store. First check node.source because is supposedly faster.
|