From 409b610db41ce275e037a76219cdb00633067805 Mon Sep 17 00:00:00 2001 From: wervice Date: Sat, 29 Jul 2023 20:19:00 +0200 Subject: [PATCH] Add files via upload --- asset/adminscreen.css | 286 ++--- asset/chat.css | 318 +++--- asset/chat.js | 40 +- asset/emojis/dont_care.svg | 69 ++ asset/emojis/smile.svg | 84 ++ asset/emojis/unhappy.svg | 87 ++ asset/emojis/warning.svg | 84 ++ asset/filebox.css | 416 +++---- asset/homescreen.css | 913 ++++++++------- asset/homescreen.js | 634 +++++----- asset/login.js | 54 +- asset/lui.css | 328 +++--- asset/manifest.json | 16 +- asset/musicplayer.css | 272 ++--- asset/rawedit.css | 492 ++++---- asset/securityadvisor.css | 320 +++--- asset/securityadvisor.js | 10 +- asset/themeoverride.css | 62 +- asset/themes/default.css | 62 +- asset/themes/green_dark.css | 62 +- asset/themes/green_dark_lines.css | 90 +- asset/themes/green_light.css | 146 +-- asset/themes/light.css | 146 +-- asset/welcome.css | 266 ++--- libs/__main__.py | 1205 ++++++++++++++++++++ libs/__pycache__/__main__.cpython-311.pyc | Bin 0 -> 83431 bytes libs/__pycache__/gethashes.cpython-310.pyc | Bin 0 -> 2412 bytes libs/__pycache__/gethashes.cpython-311.pyc | Bin 5822 -> 5844 bytes libs/autotag.py | 19 + libs/gethashes.py | 200 ++-- run.py | 13 + 31 files changed, 4143 insertions(+), 2551 deletions(-) create mode 100644 asset/emojis/dont_care.svg create mode 100644 asset/emojis/smile.svg create mode 100644 asset/emojis/unhappy.svg create mode 100644 asset/emojis/warning.svg create mode 100644 libs/__main__.py create mode 100644 libs/__pycache__/__main__.cpython-311.pyc create mode 100644 libs/__pycache__/gethashes.cpython-310.pyc create mode 100644 libs/autotag.py create mode 100644 run.py diff --git a/asset/adminscreen.css b/asset/adminscreen.css index 824ed84..b8258aa 100644 --- a/asset/adminscreen.css +++ b/asset/adminscreen.css @@ -1,144 +1,144 @@ -::-webkit-scrollbar { - background-color: #1C1C1C; - border-radius: 10px; -} - -::-webkit-scrollbar-button { - background-color: #1C1C1C; - height: 0px; -} - -::-webkit-scrollbar-thumb { - background-color: var(--accent-color); - margin: 5px; - border-radius: 5px; -} - -::-webkit-scrollbar-track { - background-color: #1C1C1C; - padding: 10px; -} - -@keyframes turn { - 100% { - transform: rotate(2turn); - } -} - -::selection { - background-color: transparent; -} - -* { - cursor: default; -} - -@font-face { - font-family: "Instrument Sans"; - src: url("InstrumentSans-Regular.ttf"); -} - -@font-face { - font-family: "Instrument Sans Bold"; - src: url("InstrumentSans-Bold.ttf"); -} - -@font-face { - font-family: "Instrument Sans Italic"; - src: url("InstrumentSans-Italic.ttf"); -} - -*:focus { - outline: none; -} - -body { - background-color: var(--background-color); - color: var(--foreground-color); - font-family: "Instrument Sans", sans-serif; - margin: 0px; -} - -nav { - padding: 15px; - color: var(--foreground-color); - font-size: 18px; - background-color: var(--accent-color); -} - -nav a#exit { - color: var(--nav-exit); - text-decoration: none; - padding-right: 10px; - cursor: pointer; -} - -nav b { - padding-right: 10px; -} - -div.infocard { - padding: 10px; - display: inline-table; - border-radius: 10px; - width: 30vw; - height: 330px; - text-align: left; - margin-left: 10px; - margin-bottom: 10px; - border-style: solid; - border-width: 1px; - border-color: var(--grey-3); -} - -div.infocard h3 { - color: var(--foreground-color); - padding: 10px; - margin: 0px; -} - -div.infocard table { - padding: 10px; - font-size: 18px; -} - -div.infocard table td { - padding-bottom: 7px; - width: 160px; -} - -div.wide { - padding: 10px; - width: calc(60vw + 40px); - height: 30vh !important; - max-height: 50vh !important; - overflow-y: scroll; - display: block; -} - -div.userdiv { - padding: 10px; - border-radius: 5px; - padding-top: 0px; - padding-bottom: 0px; -} - -div.userdiv button { - background-color: transparent; - color: red; - border-width: 0px; - box-shadow: none; -} - -div.userdiv button { - filter: brightness(1); -} - -select { - border-width: 0px; - background-color: var(--accent-color); - padding: 10px; - border-radius: 5px; - font-family: "Instrumental", sans-serif; - color: var(--background-color); +::-webkit-scrollbar { + background-color: #1C1C1C; + border-radius: 10px; +} + +::-webkit-scrollbar-button { + background-color: #1C1C1C; + height: 0px; +} + +::-webkit-scrollbar-thumb { + background-color: var(--accent-color); + margin: 5px; + border-radius: 5px; +} + +::-webkit-scrollbar-track { + background-color: #1C1C1C; + padding: 10px; +} + +@keyframes turn { + 100% { + transform: rotate(2turn); + } +} + +::selection { + background-color: transparent; +} + +* { + cursor: default; +} + +@font-face { + font-family: "Instrument Sans"; + src: url("InstrumentSans-Regular.ttf"); +} + +@font-face { + font-family: "Instrument Sans Bold"; + src: url("InstrumentSans-Bold.ttf"); +} + +@font-face { + font-family: "Instrument Sans Italic"; + src: url("InstrumentSans-Italic.ttf"); +} + +*:focus { + outline: none; +} + +body { + background-color: var(--background-color); + color: var(--foreground-color); + font-family: "Instrument Sans", sans-serif; + margin: 0px; +} + +nav { + padding: 15px; + color: var(--foreground-color); + font-size: 18px; + background-color: var(--accent-color); +} + +nav a#exit { + color: var(--nav-exit); + text-decoration: none; + padding-right: 10px; + cursor: pointer; +} + +nav b { + padding-right: 10px; +} + +div.infocard { + padding: 10px; + display: inline-table; + border-radius: 10px; + width: 30vw; + height: 330px; + text-align: left; + margin-left: 10px; + margin-bottom: 10px; + border-style: solid; + border-width: 1px; + border-color: var(--grey-3); +} + +div.infocard h3 { + color: var(--foreground-color); + padding: 10px; + margin: 0px; +} + +div.infocard table { + padding: 10px; + font-size: 18px; +} + +div.infocard table td { + padding-bottom: 7px; + width: 160px; +} + +div.wide { + padding: 10px; + width: calc(60vw + 40px); + height: 30vh !important; + max-height: 50vh !important; + overflow-y: scroll; + display: block; +} + +div.userdiv { + padding: 10px; + border-radius: 5px; + padding-top: 0px; + padding-bottom: 0px; +} + +div.userdiv button { + background-color: transparent; + color: red; + border-width: 0px; + box-shadow: none; +} + +div.userdiv button { + filter: brightness(1); +} + +select { + border-width: 0px; + background-color: var(--accent-color); + padding: 10px; + border-radius: 5px; + font-family: "Instrumental", sans-serif; + color: var(--background-color); } \ No newline at end of file diff --git a/asset/chat.css b/asset/chat.css index 274266f..27867fb 100644 --- a/asset/chat.css +++ b/asset/chat.css @@ -1,160 +1,160 @@ -::selection { - background-color: transparent; -} - -::placeholder { - color: var(--foreground-color); - font-family: "Instrument Sans"; -} - -::-webkit-scrollbar { - display: none; -} - -* { - cursor: default; -} - -@font-face { - font-family: "Instrument Sans"; - src: url("InstrumentSans-Regular.ttf"); -} - -@font-face { - font-family: "Instrument Sans Bold"; - src: url("InstrumentSans-Bold.ttf"); -} - -@font-face { - font-family: "Instrument Sans Italic"; - src: url("InstrumentSans-Italic.ttf"); -} - -body { - background-color: var(--background-color); - color: var(--foreground-color); - font-family: "Instrument Sans", sans-serif; - margin: 0px; - height: 100vh; -} - -table, -table tr { - height: 100%; -} - -table tr #userlist { - width: 200px; - background-color: var(--light-grey-2); - vertical-align: top; - padding: 20px; -} - -table tr #userlist button { - width: 100%; - transition: all ease-in-out 200ms; -} - -table tr #userlist button:hover { - width: 100%; - filter: brightness(1.1); -} - -table tr #userlist button.user { - background-color: transparent; - color: var(--foreground-color); - text-align: left; - margin-top: 5px; - font-size: 16px; - transition: ease-in-out 100ms; - box-shadow: none; -} - -table tr #userlist button.user:hover { - background-color: var(--highlight-middle); -} - -table tr #messages { - width: calc(100vw - 200px); - vertical-align: top; - padding: 20px; -} - -table tr #messages #container { - overflow: scroll; - padding-top: 60px; - height: calc(100% - 130px); -} - -table tr #messages #container b { - font-size: x-large; - color: var(--foreground-color); - font-weight: 100; - position: absolute; - top: 20px; - background-color: var(--background-color); - width: 100vw; - padding: 10px; -} - -table tr #messages #input { - padding: 10px; -} - -table tr #messages #input input { - background-color: var(--light-grey-input); - border-radius: 5px; - border-width: 1px; - border-style: solid; - border-color: var(--accent-color); - width: 250px; - max-width: 20vw; - margin-right: 5px; - color: var(--foreground-color); - font-size: 18px; - letter-spacing: 1px; - height: 40px; -} - -table tr #messages button { - width: 50px; -} - -button.circle { - border-radius: 50%; - width: 40px !important; - height: 40px; - text-align: center; - padding-left: 5px; -} - -table tr #messages #input input:focus { - outline: none; -} - -.msg_you { - margin-top: 20px; - padding: 10px; - width: 200px; - min-width: 200px; - background-color: var(--msg-1); - border-radius: 5px; - overflow-wrap: break-word; -} - -.msg_oth { - margin-top: 20px; - padding: 10px; - width: 200px; - min-width: 200px; - background-color: var(--msg-2); - border-radius: 5px; - display: block; - margin-left: auto; - overflow-wrap: break-word; -} - -#upload_button { - box-shadow: none; - margin-left: 7.5px !important; +::selection { + background-color: transparent; +} + +::placeholder { + color: var(--foreground-color); + font-family: "Instrument Sans"; +} + +::-webkit-scrollbar { + display: none; +} + +* { + cursor: default; +} + +@font-face { + font-family: "Instrument Sans"; + src: url("InstrumentSans-Regular.ttf"); +} + +@font-face { + font-family: "Instrument Sans Bold"; + src: url("InstrumentSans-Bold.ttf"); +} + +@font-face { + font-family: "Instrument Sans Italic"; + src: url("InstrumentSans-Italic.ttf"); +} + +body { + background-color: var(--background-color); + color: var(--foreground-color); + font-family: "Instrument Sans", sans-serif; + margin: 0px; + height: 100vh; +} + +table, +table tr { + height: 100%; +} + +table tr #userlist { + width: 200px; + background-color: var(--light-grey-2); + vertical-align: top; + padding: 20px; +} + +table tr #userlist button { + width: 100%; + transition: all ease-in-out 200ms; +} + +table tr #userlist button:hover { + width: 100%; + filter: brightness(1.1); +} + +table tr #userlist button.user { + background-color: transparent; + color: var(--foreground-color); + text-align: left; + margin-top: 5px; + font-size: 16px; + transition: ease-in-out 100ms; + box-shadow: none; +} + +table tr #userlist button.user:hover { + background-color: var(--highlight-middle); +} + +table tr #messages { + width: calc(100vw - 200px); + vertical-align: top; + padding: 20px; +} + +table tr #messages #container { + overflow: scroll; + padding-top: 60px; + height: calc(100% - 130px); +} + +table tr #messages #container b { + font-size: x-large; + color: var(--foreground-color); + font-weight: 100; + position: absolute; + top: 20px; + background-color: var(--background-color); + width: 100vw; + padding: 10px; +} + +table tr #messages #input { + padding: 10px; +} + +table tr #messages #input input { + background-color: var(--light-grey-input); + border-radius: 5px; + border-width: 1px; + border-style: solid; + border-color: var(--accent-color); + width: 250px; + max-width: 20vw; + margin-right: 5px; + color: var(--foreground-color); + font-size: 18px; + letter-spacing: 1px; + height: 40px; +} + +table tr #messages button { + width: 50px; +} + +button.circle { + border-radius: 50%; + width: 40px !important; + height: 40px; + text-align: center; + padding-left: 5px; +} + +table tr #messages #input input:focus { + outline: none; +} + +.msg_you { + margin-top: 20px; + padding: 10px; + width: 200px; + min-width: 200px; + background-color: var(--msg-1); + border-radius: 5px; + overflow-wrap: break-word; +} + +.msg_oth { + margin-top: 20px; + padding: 10px; + width: 200px; + min-width: 200px; + background-color: var(--msg-2); + border-radius: 5px; + display: block; + margin-left: auto; + overflow-wrap: break-word; +} + +#upload_button { + box-shadow: none; + margin-left: 7.5px !important; } \ No newline at end of file diff --git a/asset/chat.js b/asset/chat.js index b9d0516..44f0de8 100644 --- a/asset/chat.js +++ b/asset/chat.js @@ -1,20 +1,20 @@ -function chat(username) { - document.getElementById("loader_form_username").value = username - document.getElementById("loader_form").submit() -} - -window.onload = function () { - document.body.innerHTML = document.body.innerHTML.replaceAll(":smile:", "😀") - elem = document.getElementById("container") - elem.scrollTop = elem.scrollHeight; - if (document.getElementById('username').value != '') { document.getElementById('input').hidden = false } - document.getElementById("file-upload").onchange = function () { - document.getElementById("message").value = "New file: "+document.getElementById("file-upload").value.split("\\")[document.getElementById("file-upload").value.split("\\").length - 1] - document.getElementById("filename").value = document.getElementById("file-upload").value.split("\\")[document.getElementById("file-upload").value.split("\\").length - 1] - } -} - -function file_upload() { - document.getElementById("file-upload").click() -} - +function chat(username) { + document.getElementById("loader_form_username").value = username + document.getElementById("loader_form").submit() +} + +window.onload = function () { + document.body.innerHTML = document.body.innerHTML.replaceAll(":smile:", "😀") + elem = document.getElementById("container") + elem.scrollTop = elem.scrollHeight; + if (document.getElementById('username').value != '') { document.getElementById('input').hidden = false } + document.getElementById("file-upload").onchange = function () { + document.getElementById("message").value = "New file: "+document.getElementById("file-upload").value.split("\\")[document.getElementById("file-upload").value.split("\\").length - 1] + document.getElementById("filename").value = document.getElementById("file-upload").value.split("\\")[document.getElementById("file-upload").value.split("\\").length - 1] + } +} + +function file_upload() { + document.getElementById("file-upload").click() +} + diff --git a/asset/emojis/dont_care.svg b/asset/emojis/dont_care.svg new file mode 100644 index 0000000..431636b --- /dev/null +++ b/asset/emojis/dont_care.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + diff --git a/asset/emojis/smile.svg b/asset/emojis/smile.svg new file mode 100644 index 0000000..d4ed4af --- /dev/null +++ b/asset/emojis/smile.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + diff --git a/asset/emojis/unhappy.svg b/asset/emojis/unhappy.svg new file mode 100644 index 0000000..e12a336 --- /dev/null +++ b/asset/emojis/unhappy.svg @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + diff --git a/asset/emojis/warning.svg b/asset/emojis/warning.svg new file mode 100644 index 0000000..77c5c2e --- /dev/null +++ b/asset/emojis/warning.svg @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/asset/filebox.css b/asset/filebox.css index f91dd43..db711aa 100644 --- a/asset/filebox.css +++ b/asset/filebox.css @@ -1,209 +1,209 @@ -::-webkit-scrollbar { - display: none; -} - -@font-face { - font-family: "Instrument Sans"; - src: url("InstrumentSans-Regular.ttf"); -} - -@font-face { - font-family: "Instrument Sans Bold"; - src: url("InstrumentSans-Bold.ttf"); -} - -@font-face { - font-family: "Instrument Sans Italic"; - src: url("InstrumentSans-Italic.ttf"); -} - -@keyframes fall-down { - 0% { - opacity: 0%; - height: 0px; - } -} - -::selection { - background-color: transparent; -} - -*:focus { - outline: none; -} - -* { - cursor: default; -} - -a, -button, -label, -button img { - cursor: pointer; -} - -body { - background-color: var(--background-color); - color: var(--foreground-color); - font-family: "Instrument Sans", sans-serif; - margin: 0px; - padding: 10px; - max-height: 100vh; -} - -button { - background-color: var(--accent-color); - color: var(--foreground-color); - border-width: 0px; - border-color: 0px; - border-style: solid; - border-radius: 5px; - font-family: "Instrument Sans"; - padding: 10px; - padding-left: 10px; - font-size: 18px; - width: 125px; - margin-top: 7.5px; - margin-bottom: 7.5px; - transition: ease-in-out 0.25s; -} - -input[type="text"], -input[type="password"] { - background-color: var(--transparent-heavy); - color: var(--foreground-color); - border-width: 0px; - border-color: 0px; - border-style: solid; - border-radius: 5px; - font-family: "Instrument Sans"; - padding: 7.5px; - font-size: 18px; - width: 250px; - margin-top: 7.5px; - margin-bottom: 7.5px; - transition: ease-in-out 0.25s; -} - -button:hover, -input[type="text"]:focus, -input[type="password"]:focus { - filter: brightness(110%); -} - -button:focus { - filter: brightness(120%); -} - -button:active { - filter: brightness(130%); -} - -b { - font-family: "Instrument Sans Bold"; -} - -i { - font-family: "Instrument Sans Italic"; -} - -a, -a::after, -a:hover, -a:active { - color: var(--link-color); -} - -/* --- Login Box -- -Width: 33vw -Padding: 40px; -Height: 100vh - 80 -Margin-Top: 40px; -*/ - -div#login_box { - width: 33vw; - min-width: 450px; - padding: 40px; - height: calc(100vh - 160px); - margin-top: 40px; - background-color: var(--transparent-low); - border-radius: 25px; - box-shadow: var(--box-shadow-ten-ten); -} - -h1, -h2, -h3, -h4 { - margin: 0px; - padding: 0px; - letter-spacing: 1px; - font-weight: 100; -} - -h1 { - font-size: 15px; - font-family: "Instrument Sans", sans-serif; - margin-bottom: 5px; - opacity: 80%; -} - -h2 { - font-size: 18px; -} - -nav#menu_bar { - padding: 10px; - width: calc(100% - 20px); - background-color: var(--accent-color); - height: 27px; -} - -nav#menu_bar img { - top: 14px; - left: 15px; - position: absolute; - transition: ease-in-out 0.25s; -} - -nav#menu_bar img.l1 { - left: 42px; -} - -nav#menu_bar img.l2 { - left: 69px; -} - -nav#menu_bar img:hover { - filter: brightness(125%); -} - -nav#menu_bar h1 { - font-size: 20px; - margin-left: 30px; -} - -button.circle { - width: auto; - border-radius: 50%; - width: 50px; - height: 50px; - text-align: center; - padding-left: 7.5px; -} - -span.sender { - color: var(--light-grey-1); - width: 100px; - text-overflow: ellipsis; - display: inline-block; -} - -div.filelist { - padding: 10px; - background-color: var(--light-grey-2); - border-radius: 5px; +::-webkit-scrollbar { + display: none; +} + +@font-face { + font-family: "Instrument Sans"; + src: url("InstrumentSans-Regular.ttf"); +} + +@font-face { + font-family: "Instrument Sans Bold"; + src: url("InstrumentSans-Bold.ttf"); +} + +@font-face { + font-family: "Instrument Sans Italic"; + src: url("InstrumentSans-Italic.ttf"); +} + +@keyframes fall-down { + 0% { + opacity: 0%; + height: 0px; + } +} + +::selection { + background-color: transparent; +} + +*:focus { + outline: none; +} + +* { + cursor: default; +} + +a, +button, +label, +button img { + cursor: pointer; +} + +body { + background-color: var(--background-color); + color: var(--foreground-color); + font-family: "Instrument Sans", sans-serif; + margin: 0px; + padding: 10px; + max-height: 100vh; +} + +button { + background-color: var(--accent-color); + color: var(--foreground-color); + border-width: 0px; + border-color: 0px; + border-style: solid; + border-radius: 5px; + font-family: "Instrument Sans"; + padding: 10px; + padding-left: 10px; + font-size: 18px; + width: 125px; + margin-top: 7.5px; + margin-bottom: 7.5px; + transition: ease-in-out 0.25s; +} + +input[type="text"], +input[type="password"] { + background-color: var(--transparent-heavy); + color: var(--foreground-color); + border-width: 0px; + border-color: 0px; + border-style: solid; + border-radius: 5px; + font-family: "Instrument Sans"; + padding: 7.5px; + font-size: 18px; + width: 250px; + margin-top: 7.5px; + margin-bottom: 7.5px; + transition: ease-in-out 0.25s; +} + +button:hover, +input[type="text"]:focus, +input[type="password"]:focus { + filter: brightness(110%); +} + +button:focus { + filter: brightness(120%); +} + +button:active { + filter: brightness(130%); +} + +b { + font-family: "Instrument Sans Bold"; +} + +i { + font-family: "Instrument Sans Italic"; +} + +a, +a::after, +a:hover, +a:active { + color: var(--link-color); +} + +/* +-- Login Box -- +Width: 33vw +Padding: 40px; +Height: 100vh - 80 +Margin-Top: 40px; +*/ + +div#login_box { + width: 33vw; + min-width: 450px; + padding: 40px; + height: calc(100vh - 160px); + margin-top: 40px; + background-color: var(--transparent-low); + border-radius: 25px; + box-shadow: var(--box-shadow-ten-ten); +} + +h1, +h2, +h3, +h4 { + margin: 0px; + padding: 0px; + letter-spacing: 1px; + font-weight: 100; +} + +h1 { + font-size: 15px; + font-family: "Instrument Sans", sans-serif; + margin-bottom: 5px; + opacity: 80%; +} + +h2 { + font-size: 18px; +} + +nav#menu_bar { + padding: 10px; + width: calc(100% - 20px); + background-color: var(--accent-color); + height: 27px; +} + +nav#menu_bar img { + top: 14px; + left: 15px; + position: absolute; + transition: ease-in-out 0.25s; +} + +nav#menu_bar img.l1 { + left: 42px; +} + +nav#menu_bar img.l2 { + left: 69px; +} + +nav#menu_bar img:hover { + filter: brightness(125%); +} + +nav#menu_bar h1 { + font-size: 20px; + margin-left: 30px; +} + +button.circle { + width: auto; + border-radius: 50%; + width: 50px; + height: 50px; + text-align: center; + padding-left: 7.5px; +} + +span.sender { + color: var(--light-grey-1); + width: 100px; + text-overflow: ellipsis; + display: inline-block; +} + +div.filelist { + padding: 10px; + background-color: var(--light-grey-2); + border-radius: 5px; } \ No newline at end of file diff --git a/asset/homescreen.css b/asset/homescreen.css index 0ecbc3b..cade1c4 100644 --- a/asset/homescreen.css +++ b/asset/homescreen.css @@ -1,444 +1,471 @@ -::placeholder { - color: var(--foreground-color); -} - -::-webkit-scrollbar { - display: none; -} - -@font-face { - font-family: "Instrument Sans"; - src: url("InstrumentSans-Regular.ttf"); -} - -@font-face { - font-family: "Instrument Sans Bold"; - src: url("InstrumentSans-Bold.ttf"); -} - -@font-face { - font-family: "Instrument Sans Italic"; - src: url("InstrumentSans-Italic.ttf"); -} - -@keyframes fall-down { - 0% { - opacity: 0%; - height: 0px; - } -} - -::selection { - background-color: transparent; -} - -*.selectable::selection { - background-color: var(--accent-color); -} - -*:focus { - outline: none; -} - -* { - cursor: default; -} - -/* --- Login Box -- -Width: 33vw -Padding: 40px; -Height: 100vh - 80 -Margin-Top: 40px; -*/ - -html { - height: 100%; -} - -body { - background-color: var(--background-color); - color: var(--foreground-color); - font-family: "Instrument Sans", sans-serif; - margin: 0px; - height: 100%; -} - -nav { - background-color: var(--background-color); -} - -div#login_box { - width: 33vw; - min-width: 450px; - padding: 40px; - height: calc(100vh - 160px); - margin-top: 40px; - background-color: var(--transparent-low); - border-radius: 25px; - box-shadow: var(--box-shadow-ten-ten); -} - -div#menu { - background-color: var(--grey-1); - position: absolute; - left: 10px; - top: 60px; - border-radius: 5px; - animation-name: fall-down; - animation-duration: 0.25s; - animation-fill-mode: forwards; - z-index: 100; - box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -div#menu a { - font-size: large; - text-decoration: none; - display: inline-block; - padding: 10px; - color: var(--foreground-color); - transition: all ease-in-out 200ms; - text-decoration: underline; - text-decoration-color: transparent; -} - -div#info { - padding: 10px; - background-color: var(--grey-3); - color: var(--foreground-color); - position: absolute; - left: calc(50vw - 30vw); - top: calc(50vh - 40vh + 40px); - width: 60vw; - height: 60vh; - border-radius: 10px; - padding: 20px; - box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -div#info h1 { - font-size: xx-large; -} - -div#info h2 { - font-size: x-large; -} - -div#info h3 { - font-size: large; -} - -div#info #body { - height: 50vh; - overflow-x: scroll; -} - -div#info #nav { - height: 10vh; -} - -div#info #nav * { - margin-top: 5vh; -} - -div#info #nav button#bf { - margin-left: 10px; - width: 50px; -} - -div#main_box table { - width: 100%; - height: calc(100vh - 50px); -} - -div#main_box { - width: 100%; - vertical-align: top; -} - -div#main_box #file_box { - padding-left: 10px; - background-color: var(--transparent-low); - overflow-y: scroll; - height: 100%; - padding-top: 50px; -} - -div#main_box #file_box a { - color: var(--foreground-color); - text-decoration: none; -} - -div.file_button { - padding: 15px; - width: calc(100% - 40px); - margin-top: 10px; - border-bottom: var(--grey-1) 1px solid; - border-radius: 5px; - transition: ease-in-out 100ms; - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; -} - -div.file_button:hover { - border-bottom: transparent 1px solid; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; -} - -div.file_button img { - margin-bottom: -5px; - margin-right: 10px; -} - -div#file_menu { - background-color: var(--grey-3); - border-radius: 2.5px; - position: absolute; - width: 200px; - overflow-x: hidden; - z-index: 100; - padding-top: 10px; - padding-bottom: 10px; - box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -div#file_menu button { - width: 100%; - background-color: var(--grey-3) !important; - height: auto; - font-size: 12pt; - border-radius: 0px; - margin-bottom: 0px; - margin-top: 0px; - padding: 10px; - text-align: left; - transition: ease-in-out 100ms; - box-shadow: none; - border-width: 0px; -} - -div#file_menu button:hover { - filter: brightness(150%); -} - -div#file_menu #file_menu_title { - color: var(--foreground-color); - font-weight: 100; - font-size: small; - margin-bottom: 10px; -} - -button.dangerous { - background-color: var(--accent-color-red) !important; -} - -img#empty_icon { - margin-top: calc(50vh - 200px); - -webkit-user-drag: none; - user-select: none; - -moz-user-select: none; - -webkit-user-select: none; - -ms-user-select: none; -} - -@keyframes flow_down { - 0% {top: 0px;} - 100% { - top: 20px; - } -} - -#password_request { - position: absolute; - top: 70px; - left: calc(50vw - 150px); - width: 300px; - padding: 20px; - border-radius: 10px; - background-color: var(--background-color-2); - animation: flow_down 0.25s; -} - -*.margin-left-small { - margin-left: 10px; -} - -@keyframes fade-in { - 0%{opacity: 0%;} -} - -#chat_inframe, #editor_popup, #security_advisor { - position: absolute; - top: calc(10vh); - left: calc(10vw); - height: 80vh; - width: 80vw; - border-radius: 10px; - border-style: solid; - border-width: 0px; - z-index: 100; - box-shadow: 0px 5px 25px 0px rgba(0, 0, 0, 0.50); - animation-name: fade-in; - animation-duration: 200ms; - background-color: var(--background-color); -} - -#security_advisor { - width: 25vw; - height: 25vw; - left: 37.5vw; - top: 12.5vw; - border-color: var(--grey-3); - border-width: 1px; -} - -div#file_info_menu { - height: calc(100% - 70px); - position: fixed; - top: 52px; - right: 0px; - padding: 10px; - background-color: var(--grey-2); - width: 25vw; - min-width: 250px; - z-index: 100; -} - -div#file_info_menu #img_wrapper img { - object-fit: cover; - width: 90px; -} - -div#file_info_menu span#file_info_menu_filename { - width: calc(100% - 20px); - text-align: center; - display: inline-block; - font-size: x-large; - padding: 5px; -} -div#file_info_menu span#file_info_menu_filetype { - display: inline-block; - text-align: center; - width: calc(100% - 20px); - opacity: 50%; - padding: 10px; - padding-bottom: 10px; -} - -div#file_info_menu span#file_info_menu_filesize, span#file_info_menu_fmd, span#file_info_menu_fcd { - padding: 10px; - font-size: medium; -} - -iframe#file_preview { - position: absolute; - width: 75vw; - height: 75vh; - top: 12.5vh; - left: 12.5vw; - border-radius: 5px; - border-width: 1px; - border-style: solid; - border-color: var(--grey-3); - z-index: 100; -} - - -div#encryption_popup { - position: absolute; - width: 50vh; - height: 50vh; - top: 25vh; - left: 37.5vw; - background-color: var(--grey-2); - color: var(--foreground-color); - border-radius: 5px; - overflow: hidden; -} - -div#encryption_popup .modal_title { - background-color: var(--accent-color); - padding: 10px; -} - -div#encryption_popup input { - margin: 10px; -} - -@keyframes flow_down_b { - 0% { - top: 0px; - } -} - -div#confirm_popup { - color: white; - position: absolute; - top: 60px; - left: calc(50vw - 160px); - width: 300px; - padding: 10px; - padding-bottom: 5px; - background-color: #282828; - border-radius: 5px; - animation-name: flow_down_b; - animation-duration: 0.25s; - border-style: solid; - border-width: 0px; - box-shadow: 0px 1px 0px 0px #717171 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); - z-index: 1000; -} - -div#confirm_popup button { - margin-top: 15px; - border-width: 0px !important; - padding: 10px; - font-size: 15px; - color: white !important; - margin-bottom: 7.5px; - box-shadow: none; -} - -div#confirm_popup b { - letter-spacing: 0.75px; -} - -#new_name_input { - border-width: 0px; - border-radius: 5px; - padding: 10px; - background-color: #ffffff39; - color: var(--foreground-color); - font-family: "Instrumental", sans-serif; - border-width: 1px; - border-style: solid; - border-color: #ffffff39; -} - -#new_name_input::selection { - background-color: #02050f; -} - -#info_msg { - position: absolute; - top: 50px; - left: calc(50vw - (300px + 20px)); - width: 300px; - padding: 20px; - border-radius: 10px; - background-color: #565656; - color: white; - animation: flow_down 0.25s; - z-index: 100; - box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -#search_input { - height: 20px; -} - -#search_input::placeholder { - color: white; +::placeholder { + color: var(--foreground-color); +} + +::-webkit-scrollbar { + display: none; +} + +@font-face { + font-family: "Instrument Sans"; + src: url("InstrumentSans-Regular.ttf"); +} + +@font-face { + font-family: "Instrument Sans Bold"; + src: url("InstrumentSans-Bold.ttf"); +} + +@font-face { + font-family: "Instrument Sans Italic"; + src: url("InstrumentSans-Italic.ttf"); +} + +@keyframes fall-down { + 0% { + opacity: 0%; + height: 0px; + } +} + +::selection { + background-color: transparent; +} + +*.selectable::selection { + background-color: var(--accent-color); +} + +*:focus { + outline: none; +} + +* { + cursor: default; +} + +/* +-- Login Box -- +Width: 33vw +Padding: 40px; +Height: 100vh - 80 +Margin-Top: 40px; +*/ + +html { + height: 100%; +} + +body { + background-color: var(--background-color); + color: var(--foreground-color); + font-family: "Instrument Sans", sans-serif; + margin: 0px; + height: 100%; +} + +nav { + background-color: var(--background-color); +} + +div#login_box { + width: 33vw; + min-width: 450px; + padding: 40px; + height: calc(100vh - 160px); + margin-top: 40px; + background-color: var(--transparent-low); + border-radius: 25px; + box-shadow: var(--box-shadow-ten-ten); +} + +div#menu { + background-color: var(--grey-1); + position: absolute; + left: 10px; + top: 60px; + border-radius: 5px; + animation-name: fall-down; + animation-duration: 0.25s; + animation-fill-mode: forwards; + z-index: 100; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +div#menu a { + font-size: large; + text-decoration: none; + display: inline-block; + padding: 10px; + color: var(--foreground-color); + transition: all ease-in-out 200ms; + text-decoration: underline; + text-decoration-color: transparent; +} + +div#info { + padding: 10px; + background-color: var(--grey-3); + color: var(--foreground-color); + position: absolute; + left: calc(50vw - 30vw); + top: calc(50vh - 40vh + 40px); + width: 60vw; + height: 60vh; + border-radius: 10px; + padding: 20px; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +div#info h1 { + font-size: xx-large; +} + +div#info h2 { + font-size: x-large; +} + +div#info h3 { + font-size: large; +} + +div#info #body { + height: 50vh; + overflow-x: scroll; +} + +div#info #nav { + height: 10vh; +} + +div#info #nav * { + margin-top: 5vh; +} + +div#info #nav button#bf { + margin-left: 10px; + width: 50px; +} + +div#main_box table { + width: 100%; + height: calc(100vh - 50px); +} + +div#main_box { + width: 100%; + vertical-align: top; +} + +div#main_box #file_box { + padding-left: 10px; + background-color: var(--transparent-low); + overflow-y: scroll; + height: 100%; + padding-top: 50px; +} + +div#main_box #file_box a { + color: var(--foreground-color); + text-decoration: none; +} + +div.file_button { + padding: 15px; + width: calc(100% - 40px); + margin-top: 10px; + border-bottom: var(--grey-1) 1px solid; + border-radius: 5px; + transition: ease-in-out 100ms; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; +} + +div.file_button:hover { + border-bottom: transparent 1px solid; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; +} + +div.file_button img { + margin-bottom: -5px; + margin-right: 10px; +} + +div#file_menu { + background-color: var(--grey-3); + border-radius: 2.5px; + position: absolute; + width: 200px; + overflow-x: hidden; + z-index: 100; + padding-top: 10px; + padding-bottom: 10px; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +div#file_menu button { + width: 100%; + background-color: var(--grey-3) !important; + height: auto; + font-size: 12pt; + border-radius: 0px; + margin-bottom: 0px; + margin-top: 0px; + padding: 10px; + text-align: left; + transition: ease-in-out 100ms; + box-shadow: none; + border-width: 0px; +} + +div#file_menu button:hover { + filter: brightness(150%); +} + +div#file_menu #file_menu_title { + color: var(--foreground-color); + font-weight: 100; + font-size: small; + margin-bottom: 10px; +} + +button.dangerous { + background-color: var(--accent-color-red) !important; +} + +img#empty_icon { + margin-top: calc(50vh - 200px); + -webkit-user-drag: none; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; +} + +@keyframes flow_down { + 0% {top: 0px;} + 100% { + top: 20px; + } +} + +#password_request { + position: absolute; + top: 70px; + left: calc(50vw - 150px); + width: 300px; + padding: 20px; + border-radius: 10px; + background-color: var(--background-color-2); + animation: flow_down 0.25s; +} + +*.margin-left-small { + margin-left: 10px; +} + +@keyframes fade-in { + 0%{opacity: 0%;} +} + +#chat_inframe, #editor_popup, #security_advisor { + position: absolute; + top: calc(10vh); + left: calc(10vw); + height: 80vh; + width: 80vw; + border-radius: 10px; + border-style: solid; + border-width: 0px; + z-index: 100; + box-shadow: 0px 5px 25px 0px rgba(0, 0, 0, 0.50); + animation-name: fade-in; + animation-duration: 200ms; + background-color: var(--background-color); +} + +#security_advisor { + width: 25vw; + height: 25vw; + left: 37.5vw; + top: 12.5vw; + border-color: var(--grey-3); + border-width: 1px; +} + +div#file_info_menu { + height: calc(100% - 70px); + position: fixed; + top: 52px; + right: 0px; + padding: 10px; + background-color: var(--grey-2); + width: 25vw; + min-width: 250px; + z-index: 100; +} + +div#file_info_menu #img_wrapper img { + object-fit: cover; + width: 90px; +} + +div#file_info_menu span#file_info_menu_filename { + width: calc(100% - 20px); + text-align: center; + display: inline-block; + font-size: x-large; + padding: 5px; +} +div#file_info_menu span#file_info_menu_filetype { + display: inline-block; + text-align: center; + width: calc(100% - 20px); + opacity: 50%; + padding: 10px; + padding-bottom: 10px; +} + +div#file_info_menu span#file_info_menu_filesize, span#file_info_menu_fmd, span#file_info_menu_fcd { + padding: 10px; + font-size: medium; +} + +iframe#file_preview { + position: absolute; + width: 75vw; + height: 75vh; + top: 12.5vh; + left: 12.5vw; + border-radius: 5px; + border-width: 1px; + border-style: solid; + border-color: var(--grey-3); + z-index: 100; +} + + +div#encryption_popup { + position: absolute; + width: 50vh; + height: 50vh; + top: 25vh; + left: 37.5vw; + background-color: var(--grey-2); + color: var(--foreground-color); + border-radius: 5px; + overflow: hidden; +} + +div#encryption_popup .modal_title { + background-color: var(--accent-color); + padding: 10px; +} + +div#encryption_popup input { + margin: 10px; +} + +@keyframes flow_down_b { + 0% { + top: 0px; + } +} + +div#confirm_popup { + color: white; + position: absolute; + top: 60px; + left: calc(50vw - 160px); + width: 300px; + padding: 10px; + padding-bottom: 5px; + background-color: #282828; + border-radius: 5px; + animation-name: flow_down_b; + animation-duration: 0.25s; + border-style: solid; + border-width: 0px; + box-shadow: 0px 1px 0px 0px #717171 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); + z-index: 1000; +} + +div#confirm_popup button { + margin-top: 15px; + border-width: 0px !important; + padding: 10px; + font-size: 15px; + color: white !important; + margin-bottom: 7.5px; + box-shadow: none; +} + +div#confirm_popup b { + letter-spacing: 0.75px; +} + +#new_name_input { + border-width: 0px; + border-radius: 5px; + padding: 10px; + background-color: #ffffff39; + color: var(--foreground-color); + font-family: "Instrumental", sans-serif; + border-width: 1px; + border-style: solid; + border-color: #ffffff39; +} + +#new_name_input::selection { + background-color: #02050f; +} + +#info_msg { + position: absolute; + top: 50px; + left: calc(50vw - (300px + 20px)); + width: 300px; + padding: 20px; + border-radius: 10px; + background-color: #565656; + color: white; + animation: flow_down 0.25s; + z-index: 100; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +#search_input { + height: 20px; +} + +#search_input::placeholder { + color: white; +} + +@keyframes slider { + 50% { + width: 0px; + rotate: 2turn; + filter: hue-rotate(1turn); + } +} + +#upload_loading_indicator #slider { + height: 7.5px; + background-color: var(--accent-color); + border-radius: 5px; + width: 100px; + animation-name: slider; + animation-duration: 2s; + animation-iteration-count: infinite; + display: inline-block; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 20px 0px rgba(0, 0, 0, 0.50); +} + +#upload_loading_indicator { + position: absolute; + top: calc(50vh - 3.75px); + left: calc(50vw - 50px); + width: 100px; } \ No newline at end of file diff --git a/asset/homescreen.js b/asset/homescreen.js index 90f9aef..7bd0ddc 100644 --- a/asset/homescreen.js +++ b/asset/homescreen.js @@ -1,316 +1,320 @@ -function simple_post_fetch(url, data) { - const formData = new FormData(); - for (const key in data) { - if (data.hasOwnProperty(key)) { - formData.append(key, data[key]); - } - } - - fetch(url, { - method: "POST", - body: formData - }) - .then(response => response.text()) - .then( - function (response) { - console.log(response) - } - ) - -} - -function hide_menu() { - setTimeout(function () { - document.getElementById("menu").hidden = true; - }, 200) -} - -function open_menu() { - document.getElementById("menu").style.top = "60px" - document.getElementById("menu").style.opacity = "100%" - document.getElementById("menu").hidden = !document.getElementById("menu").hidden -} - -function open_info() { - document.getElementById("info").hidden = !document.getElementById("info").hidden -} - -function l_confirm(message, function_if_confirmed) { - document.getElementById("confirm_popup").hidden = false; - document.getElementById("confirm_popup_message").innerHTML = message; - document.getElementById("confirm_popup_confirm").onclick = function_if_confirmed; -} - -function show_file_menu(file, event) { - document.getElementById("file_menu").hidden = false - document.getElementById("file_menu_delete_button").onclick = function () { - filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") - l_confirm("Do you want to delete \"" + filename + "\"?", function () { - fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/delete-file/" + filename) - event.srcElement.remove() - document.getElementById("confirm_popup").hidden = true; - }) - } - document.getElementById("file_menu_encryption_button").onclick = function () { - filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") - document.getElementById("encryption_popup").hidden = false; - document.getElementById("filename_encpop").value = filename - setTimeout(function () { - window.onclick = function (event) { - var divElement = document.getElementById("encryption_popup") - var targetElement = event.target; - - if (!divElement.contains(targetElement) && divElement != targetElement) { - console.log(targetElement) - document.getElementById("encryption_popup").hidden = true; - setTimeout(function () { - window.onclick = function () { } - }, 100) - } - } - - }, 100) - } - document.getElementById("file_menu_rawedit_button").onclick = function () { - filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") - document.getElementById("editor_popup").hidden = false - document.getElementById("editor_popup").src = "/rawedit/" + filename - setTimeout(function () { - window.onclick = function (event) { - var divElement = document.getElementById("editor_popup") - var targetElement = event.target; - - if (!divElement.contains(targetElement) && divElement != targetElement) { - console.log(targetElement) - document.getElementById("editor_popup").hidden = true; - } - } - - }, 100) - } - - document.getElementById("file_menu_download_button").onclick = function () { - filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") - window.open("/load-file/" + filename) - } - document.getElementById("file_menu_rename_button").onclick = function () { - l_confirm("Rename
")[1] + "\">", function () { - new_name = document.getElementById("new_name_input").value - if (new_name != "") { - event.srcElement.innerHTML = event.srcElement.innerHTML.split(">")[0] + "> " + event.srcElement.innerHTML.split(">")[1].replaceAll(event.srcElement.innerHTML.split(">")[1], new_name.replaceAll("_", " ")) - fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/rename-file/" + file + "/" + new_name) - document.getElementById("confirm_popup").hidden = true; - } - }) - } - document.getElementById("file_menu_share_button").onclick = async function () { - filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") - console.log("/share/info/" + btoa(filename)) - fetch("/share/info/" + btoa(filename)) - .then((response) => { - if (response.ok) { - return response.text() - } - else { - return "Error" - } - }) - .then( - function (response) { - if (response == "not_shared") { - l_confirm("Do you want to create a sharing link for " + filename + "?", function () { - fetch("/share/reglink/" + btoa(filename)).then( - (response) => { - if (response.ok) { - return response.text() - } - else { - return "Failed to get" - } - } - ) - .then( - function (response) { - document.getElementById("confirm_popup").hidden = true; - code = "https://"+location.host+response - l_confirm("Copy this code with CTRL+C.
"+code+"
", function () { - document.getElementById("confirm_popup").hidden = true; - }) - } - ) - }) - } - else { - l_confirm("Do you want to remove the sharing link for this file?", function () { - fetch("/share/unreg/"+btoa(filename)) - l_confirm("The share link is removed for this file.", function () { - document.getElementById("confirm_popup").hidden = true; - }) - }) - } - } - ) - } - - var x = event.clientX; - var y = event.clientY; - document.getElementById("file_menu").style.left = (x - document.getElementById("file_menu").offsetWidth / 2 + 90) + 'px'; - document.getElementById("file_menu").style.top = (y - document.getElementById("file_menu").offsetHeight / 2 + 90) + 'px'; - document.body.onclick = function () { - document.getElementById("file_menu").hidden = true - } - return false; -} - -help_page = 0 -sites = ["upload_file", "file_options"] - -function next_topic() { - help_page = help_page + 1 - location.href = "#" + sites[help_page] - if (help_page > sites.length - 1) { - help_page = sites.length - 1 - location.href = "#" + sites[help_page] - } -} - -function last_topic() { - help_page = help_page - 1 - location.href = "#" + sites[help_page] - if (help_page < 0) { - help_page = 0 - location.href = "#" + sites[help_page] - } -} - -window.onload = function () { - if (sessionStorage.getItem("last_screen_info") == "password_load_file") { - document.getElementById("password_request").hidden = false; - sessionStorage.removeItem("last_screen_info") - } - else if (sessionStorage.getItem('last_screen_info') == "upload_fail_virus") { - document.getElementById("info_msg").hidden = false; - document.getElementById("info_message").innerHTML = "The file is a virus
" + sessionStorage.getItem("virus_name+"); - sessionStorage.removeItem("last_screen_info") - sessionStorage.removeItem("virus_name") - setTimeout(hide_info, 6500) - } - if (sessionStorage.getItem("filename") != undefined) { - document.getElementById("filename").value = sessionStorage.getItem("filename") - sessionStorage.removeItem("filename") - } - if (localStorage.getItem("intro_homescreen") != "true") { - document.getElementById("info").hidden = false; - localStorage.setItem("intro_homescreen", "true") - } - -} -function show_file_info(filename, filesize, filetype, filemday, filecday, mimeicon) { - filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") - document.getElementById("file_info_menu").hidden = false; - document.getElementById("file_info_menu_icon").src = "/asset/" + mimeicon - document.getElementById("file_info_menu_filename").innerHTML = filename.replaceAll("_", " "); - document.getElementById("file_info_menu_filesize").innerHTML = filesize + "MB"; - document.getElementById("file_info_menu_filetype").innerHTML = filetype; - document.getElementById("file_info_menu_fmd").innerHTML = "Edited: " + filemday; - document.getElementById("file_info_menu_fcd").innerHTML = "Created: " + filecday - if (filename.includes(".jpg") || filename.includes(".png") || filename.includes(".jpeg") || filename.includes(".tiff") || filename.includes(".webp") || filename.includes(".heic") || filename.includes(".ico")) { - document.getElementById("file_info_menu_icon").src = "/thumbnail-load-file/" + filename.replaceAll(" ", "_") - document.getElementById("file_info_menu_icon").style.borderRadius = "5px" - } - else { - document.getElementById("file_info_menu_icon").style.borderRadius = "0px" - } - -} - -function show_file(file) { - filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") - var elbgb = event.srcElement.style.backgroundColor - event.srcElement.style.backgroundColor = "dodgerblue" - var evl = event - fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/load-file/" + filename).then( - function (response) { - if (response.status == "901") { - sessionStorage.setItem('last_screen_info', 'password_load_file'); sessionStorage.setItem('filename', filename - ); location.reload() - } - else { - evl.srcElement.style.backgroundColor = elbgb - evl.srcElement.blur() - location.assign("/load-file/" + filename) - } - } - ) -} -function search_for_file(filename) { - if (filename != "") { - fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/search/q/" + filename) - .then(function (response) { - return response.text(); - }) - .then(function (data) { - document.getElementById("file_box").innerHTML = data; - }) - .catch(function () { - location.reload(); - }); - } else { - location.reload(); - } -} - -function upload_new_file() { - function hide_info() { - document.getElementById("info_msg").hidden = true; - } - document.getElementById("file_upload_button").click() - document.getElementById("file_upload_button").onchange = function () { - const upload_form_data = new FormData(); - upload_form_data.append("file_upload", document.getElementById("file_upload_button").files[0]); - upload_form_data.append("filename", document.getElementById("file_upload_button").value.split("\\")[document.getElementById("file_upload_button").value.split("\\").length - 1]); - const requestOptions = { - method: "POST", - body: upload_form_data, - }; - fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/upload/web", requestOptions).then( - function (response) { - if (response.status == 903) { - document.getElementById("info_msg").hidden = false; - document.getElementById("info_message").innerHTML = "The file type is blocked"; - sessionStorage.removeItem("last_screen_info") - setTimeout(hide_info, 2000) - } - else if (response.status == 904) { - document.getElementById("info_msg").hidden = false; - document.getElementById("info_message").innerHTML = "This file already exists"; - sessionStorage.removeItem("last_screen_info") - setTimeout(hide_info, 6500) - } - else if (response.status == 905) { - document.getElementById("info_msg").hidden = false; - document.getElementById("info_message").innerHTML = "This file is malicious"; - sessionStorage.removeItem("last_screen_info") - setTimeout(hide_info, 6500) - } - else { - location.reload() - } - } - ) - - } - -} - -function security_advisor() { - var advisorElement = document.getElementById("security_advisor"); - advisorElement.hidden = false; - - setTimeout(function () { - window.addEventListener("click", function hideAdvisor() { - advisorElement.hidden = true; - window.removeEventListener("click", hideAdvisor); - }); - }, 100); +function simple_post_fetch(url, data) { + const formData = new FormData(); + for (const key in data) { + if (data.hasOwnProperty(key)) { + formData.append(key, data[key]); + } + } + + fetch(url, { + method: "POST", + body: formData + }) + .then(response => response.text()) + .then( + function (response) { + console.log(response) + } + ) + +} + +function hide_menu() { + setTimeout(function () { + document.getElementById("menu").hidden = true; + }, 200) +} + +function open_menu() { + document.getElementById("menu").style.top = "60px" + document.getElementById("menu").style.opacity = "100%" + document.getElementById("menu").hidden = !document.getElementById("menu").hidden +} + +function open_info() { + document.getElementById("info").hidden = !document.getElementById("info").hidden +} + +function l_confirm(message, function_if_confirmed) { + document.getElementById("confirm_popup").hidden = false; + document.getElementById("confirm_popup_message").innerHTML = message; + document.getElementById("confirm_popup_confirm").onclick = function_if_confirmed; +} + +function show_file_menu(file, event) { + document.getElementById("file_menu").hidden = false + document.getElementById("file_menu_delete_button").onclick = function () { + filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") + l_confirm("Do you want to delete \"" + filename + "\"?", function () { + fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/delete-file/" + filename) + event.srcElement.remove() + document.getElementById("confirm_popup").hidden = true; + }) + } + document.getElementById("file_menu_encryption_button").onclick = function () { + filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") + document.getElementById("encryption_popup").hidden = false; + document.getElementById("filename_encpop").value = filename + setTimeout(function () { + window.onclick = function (event) { + var divElement = document.getElementById("encryption_popup") + var targetElement = event.target; + + if (!divElement.contains(targetElement) && divElement != targetElement) { + console.log(targetElement) + document.getElementById("encryption_popup").hidden = true; + setTimeout(function () { + window.onclick = function () { } + }, 100) + } + } + + }, 100) + } + document.getElementById("file_menu_rawedit_button").onclick = function () { + filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") + document.getElementById("editor_popup").hidden = false + document.getElementById("editor_popup").src = "/rawedit/" + filename + setTimeout(function () { + window.onclick = function (event) { + var divElement = document.getElementById("editor_popup") + var targetElement = event.target; + + if (!divElement.contains(targetElement) && divElement != targetElement) { + console.log(targetElement) + document.getElementById("editor_popup").hidden = true; + } + } + + }, 100) + } + + document.getElementById("file_menu_download_button").onclick = function () { + filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") + window.open("/load-file/" + filename) + } + document.getElementById("file_menu_rename_button").onclick = function () { + l_confirm("Rename
")[1] + "\">", function () { + new_name = document.getElementById("new_name_input").value + if (new_name != "") { + event.srcElement.innerHTML = event.srcElement.innerHTML.split(">")[0] + "> " + event.srcElement.innerHTML.split(">")[1].replaceAll(event.srcElement.innerHTML.split(">")[1], new_name.replaceAll("_", " ")) + fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/rename-file/" + file + "/" + new_name) + document.getElementById("confirm_popup").hidden = true; + } + }) + } + document.getElementById("file_menu_share_button").onclick = async function () { + filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") + console.log("/share/info/" + btoa(filename)) + fetch("/share/info/" + btoa(filename)) + .then((response) => { + if (response.ok) { + return response.text() + } + else { + return "Error" + } + }) + .then( + function (response) { + if (response == "not_shared") { + l_confirm("Do you want to create a sharing link for " + filename + "?", function () { + fetch("/share/reglink/" + btoa(filename)).then( + (response) => { + if (response.ok) { + return response.text() + } + else { + return "Failed to get" + } + } + ) + .then( + function (response) { + document.getElementById("confirm_popup").hidden = true; + code = "https://"+location.host+response + l_confirm("Copy this code with CTRL+C.
"+code+"
", function () { + document.getElementById("confirm_popup").hidden = true; + }) + } + ) + }) + } + else { + l_confirm("Do you want to remove the sharing link for this file?", function () { + fetch("/share/unreg/"+btoa(filename)) + l_confirm("The share link is removed for this file.", function () { + document.getElementById("confirm_popup").hidden = true; + }) + }) + } + } + ) + } + + var x = event.clientX; + var y = event.clientY; + document.getElementById("file_menu").style.left = (x - document.getElementById("file_menu").offsetWidth / 2 + 90) + 'px'; + document.getElementById("file_menu").style.top = (y - document.getElementById("file_menu").offsetHeight / 2 + 90) + 'px'; + document.body.onclick = function () { + document.getElementById("file_menu").hidden = true + } + return false; +} + +help_page = 0 +sites = ["upload_file", "file_options"] + +function next_topic() { + help_page = help_page + 1 + location.href = "#" + sites[help_page] + if (help_page > sites.length - 1) { + help_page = sites.length - 1 + location.href = "#" + sites[help_page] + } +} + +function last_topic() { + help_page = help_page - 1 + location.href = "#" + sites[help_page] + if (help_page < 0) { + help_page = 0 + location.href = "#" + sites[help_page] + } +} + +window.onload = function () { + if (sessionStorage.getItem("last_screen_info") == "password_load_file") { + document.getElementById("password_request").hidden = false; + sessionStorage.removeItem("last_screen_info") + } + else if (sessionStorage.getItem('last_screen_info') == "upload_fail_virus") { + document.getElementById("info_msg").hidden = false; + document.getElementById("info_message").innerHTML = "The file is a virus
" + sessionStorage.getItem("virus_name+"); + sessionStorage.removeItem("last_screen_info") + sessionStorage.removeItem("virus_name") + setTimeout(hide_info, 6500) + } + if (sessionStorage.getItem("filename") != undefined) { + document.getElementById("filename").value = sessionStorage.getItem("filename") + sessionStorage.removeItem("filename") + } + if (localStorage.getItem("intro_homescreen") != "true") { + document.getElementById("info").hidden = false; + localStorage.setItem("intro_homescreen", "true") + } + +} +function show_file_info(filename, filesize, filetype, filemday, filecday, mimeicon) { + filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") + document.getElementById("file_info_menu").hidden = false; + document.getElementById("file_info_menu_icon").src = "/asset/" + mimeicon + document.getElementById("file_info_menu_filename").innerHTML = filename.replaceAll("_", " "); + document.getElementById("file_info_menu_filesize").innerHTML = filesize + "MB"; + document.getElementById("file_info_menu_filetype").innerHTML = filetype; + document.getElementById("file_info_menu_fmd").innerHTML = "Edited: " + filemday; + document.getElementById("file_info_menu_fcd").innerHTML = "Created: " + filecday + if (filename.includes(".jpg") || filename.includes(".png") || filename.includes(".jpeg") || filename.includes(".tiff") || filename.includes(".webp") || filename.includes(".heic") || filename.includes(".ico")) { + document.getElementById("file_info_menu_icon").src = "/thumbnail-load-file/" + filename.replaceAll(" ", "_") + document.getElementById("file_info_menu_icon").style.borderRadius = "5px" + } + else { + document.getElementById("file_info_menu_icon").style.borderRadius = "0px" + } + +} + +function show_file(file) { + filename = event.srcElement.innerHTML.split("> ")[1].replaceAll(" ", "_") + var elbgb = event.srcElement.style.backgroundColor + event.srcElement.style.backgroundColor = "dodgerblue" + var evl = event + fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/load-file/" + filename).then( + function (response) { + if (response.status == "901") { + sessionStorage.setItem('last_screen_info', 'password_load_file'); sessionStorage.setItem('filename', filename + ); location.reload() + } + else { + evl.srcElement.style.backgroundColor = elbgb + evl.srcElement.blur() + location.assign("/load-file/" + filename) + } + } + ) +} +function search_for_file(filename) { + if (filename != "") { + fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/search/q/" + filename) + .then(function (response) { + return response.text(); + }) + .then(function (data) { + document.getElementById("file_box").innerHTML = data; + }) + .catch(function () { + location.reload(); + }); + } else { + location.reload(); + } +} + +function upload_new_file() { + function hide_info() { + document.getElementById("info_msg").hidden = true; + } + document.getElementById("file_upload_button").click() + document.getElementById("file_upload_button").onchange = function () { + const upload_form_data = new FormData(); + upload_form_data.append("file_upload", document.getElementById("file_upload_button").files[0]); + upload_form_data.append("filename", document.getElementById("file_upload_button").value.split("\\")[document.getElementById("file_upload_button").value.split("\\").length - 1]); + const requestOptions = { + method: "POST", + body: upload_form_data, + }; + document.getElementById("upload_loading_indicator").hidden = false; + fetch(location.protocol + "//" + location.hostname + ":" + location.port + "/upload/web", requestOptions).then( + function (response) { + if (response.status == 903) { + document.getElementById("info_msg").hidden = false; + document.getElementById("info_message").innerHTML = "The file type is blocked"; + sessionStorage.removeItem("last_screen_info") + setTimeout(hide_info, 2000) + document.getElementById("upload_loading_indicator").hidden = true; + } + else if (response.status == 904) { + document.getElementById("info_msg").hidden = false; + document.getElementById("info_message").innerHTML = "This file already exists"; + sessionStorage.removeItem("last_screen_info") + setTimeout(hide_info, 6500) + document.getElementById("upload_loading_indicator").hidden = true; + } + else if (response.status == 905) { + document.getElementById("info_msg").hidden = false; + document.getElementById("info_message").innerHTML = "This file is malicious"; + sessionStorage.removeItem("last_screen_info") + setTimeout(hide_info, 6500) + document.getElementById("upload_loading_indicator").hidden = true; + } + else { + location.reload() + } + } + ) + + } + +} + +function security_advisor() { + var advisorElement = document.getElementById("security_advisor"); + advisorElement.hidden = false; + + setTimeout(function () { + window.addEventListener("click", function hideAdvisor() { + advisorElement.hidden = true; + window.removeEventListener("click", hideAdvisor); + }); + }, 100); } \ No newline at end of file diff --git a/asset/login.js b/asset/login.js index 89267b7..df5c0f4 100644 --- a/asset/login.js +++ b/asset/login.js @@ -1,28 +1,28 @@ -window.onload = function () { - function hide_info() { - document.getElementById("info").hidden = true; - } - function popup(info) { - document.getElementById("info").hidden = false; - document.getElementById("info_message").innerHTML = info; - } - document.getElementById("login_formular").onsubmit = function () { - document.getElementById("loading_wheel").hidden = false; - document.getElementById("submit_button").disabled = "true"; - } - if (sessionStorage.getItem("last_screen_info") == "login_auth_fail_password") { - popup("Wrong password") - sessionStorage.removeItem("last_screen_info"); - setTimeout(hide_info, 3400); - } - else if (sessionStorage.getItem("last_screen_info") == "logged_of") { - popup("You're logged out") - sessionStorage.removeItem("last_screen_info"); - setTimeout(hide_info, 3400); - } - else if (sessionStorage.getItem("last_screen_info") == "register_success") { - popup("Registration worked.
You can now login") - sessionStorage.removeItem("last_screen_info"); - setTimeout(hide_info, 3400); - } +window.onload = function () { + function hide_info() { + document.getElementById("info").hidden = true; + } + function popup(info) { + document.getElementById("info").hidden = false; + document.getElementById("info_message").innerHTML = info; + } + document.getElementById("login_formular").onsubmit = function () { + document.getElementById("loading_wheel").hidden = false; + document.getElementById("submit_button").disabled = "true"; + } + if (sessionStorage.getItem("last_screen_info") == "login_auth_fail_password") { + popup("Wrong password") + sessionStorage.removeItem("last_screen_info"); + setTimeout(hide_info, 3400); + } + else if (sessionStorage.getItem("last_screen_info") == "logged_of") { + popup("You're logged out") + sessionStorage.removeItem("last_screen_info"); + setTimeout(hide_info, 3400); + } + else if (sessionStorage.getItem("last_screen_info") == "register_success") { + popup("Registration worked.
You can now login") + sessionStorage.removeItem("last_screen_info"); + setTimeout(hide_info, 3400); + } } \ No newline at end of file diff --git a/asset/lui.css b/asset/lui.css index 30493f9..cee0685 100644 --- a/asset/lui.css +++ b/asset/lui.css @@ -1,165 +1,165 @@ -a, -button, -label, -button img { - cursor: pointer; -} - -body { - background-color: var(--background-color); - color: var(--foreground-color); - font-family: "Instrument Sans", sans-serif; - margin: 0px; -} - -button { - background-color: var(--accent-color); - color: var(--background-color); - width: 120px; - height: 40px; - font-size: 18px; - border-width: 0px; - border-style: solid; - border-radius: 5px; - font-family: "Instrument Sans", sans-serif; - margin-top: 10px; - box-shadow: 0px 1px 0px 0px #ffffff87 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); - transition: ease-in-out 0.25s; -} - -button.second { - background-color: transparent; - border: 2px solid var(--accent-color) !important; - color: var(--accent-color) !important; -} - -button:focus { - filter: brightness(120%); -} - -button:active { - filter: brightness(130%); -} - -input[type="text"], -input[type="password"] { - background-color: var(--transparent-heavy); - color: var(--foreground-color); - font-family: "Instrument Sans", sans-serif !important; - font-size: 18px; - border-width: 0px; - border-color: 0px; - border-style: solid; - border-radius: 5px; - height: 40px; - width: 240px; - padding-left: 10px; - margin-top: 7.5px; - margin-bottom: 7.5px; -} - -button:hover, -input[type="text"]:focus, -input[type="password"]:focus { - filter: brightness(120%); -} - -b { - font-family: "Instrument Sans Bold"; -} - -i { - font-family: "Instrument Sans Italic"; -} - -a, -a::after, -a:hover, -a:active { - color: var(--link-color); -} - -h1, -h2, -h3, -h4 { - margin: 0px; - padding: 0px; - letter-spacing: 1px; - font-weight: 100; -} - -h1 { - font-size: 15px; - font-family: "Instrument Sans", sans-serif; - margin-bottom: 5px; - opacity: 80%; -} - -h2 { - font-size: 18px; -} - -nav#menu_bar img { - top: 18px; - left: 55px; - position: absolute; - transition: ease-in-out 0.25s; -} - -nav#menu_bar img.l1 { - left: 82px; -} - -nav#menu_bar img.l2 { - left: 109px; -} - -nav#menu_bar img.l3 { - left: 136px; -} - -nav#menu_bar img:hover { - filter: brightness(125%); -} - -nav#menu_bar h1 { - font-size: 20px; - margin-left: 30px; -} - -nav#menu_bar { - padding: 10px; - width: calc(100% - 20px); - height: 32px; - position: fixed; -} - -#logo_button { - padding: 5px; - font-size: 20px; - position: fixed; - background-color: var(--accent-color); - width: 25px; - border-radius: 5px; - transition: all ease-in-out 0.25s; -} - -#logo_button:hover { - filter: brightness(1.1); -} - -nav#menu_bar input[type="text"] { - position: absolute; - right: 10px; - border-radius: 2.5px; - padding: 5px; - border-width: 0px; - font-family: "Instrumental", sans-serif; - background-color: var(--input-background); - margin: 0px; - font-size: 12px; - top: 12px; - z-index: 100; - width: 200px; +a, +button, +label, +button img { + cursor: pointer; +} + +body { + background-color: var(--background-color); + color: var(--foreground-color); + font-family: "Instrument Sans", sans-serif; + margin: 0px; +} + +button { + background-color: var(--accent-color); + color: var(--background-color); + width: 120px; + height: 40px; + font-size: 18px; + border-width: 0px; + border-style: solid; + border-radius: 5px; + font-family: "Instrument Sans", sans-serif; + margin-top: 10px; + box-shadow: 0px 1px 0px 0px #ffffff87 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); + transition: ease-in-out 0.25s; +} + +button.second { + background-color: transparent; + border: 2px solid var(--accent-color) !important; + color: var(--accent-color) !important; +} + +button:focus { + filter: brightness(120%); +} + +button:active { + filter: brightness(130%); +} + +input[type="text"], +input[type="password"] { + background-color: var(--transparent-heavy); + color: var(--foreground-color); + font-family: "Instrument Sans", sans-serif !important; + font-size: 18px; + border-width: 0px; + border-color: 0px; + border-style: solid; + border-radius: 5px; + height: 40px; + width: 240px; + padding-left: 10px; + margin-top: 7.5px; + margin-bottom: 7.5px; +} + +button:hover, +input[type="text"]:focus, +input[type="password"]:focus { + filter: brightness(120%); +} + +b { + font-family: "Instrument Sans Bold"; +} + +i { + font-family: "Instrument Sans Italic"; +} + +a, +a::after, +a:hover, +a:active { + color: var(--link-color); +} + +h1, +h2, +h3, +h4 { + margin: 0px; + padding: 0px; + letter-spacing: 1px; + font-weight: 100; +} + +h1 { + font-size: 15px; + font-family: "Instrument Sans", sans-serif; + margin-bottom: 5px; + opacity: 80%; +} + +h2 { + font-size: 18px; +} + +nav#menu_bar img { + top: 18px; + left: 55px; + position: absolute; + transition: ease-in-out 0.25s; +} + +nav#menu_bar img.l1 { + left: 82px; +} + +nav#menu_bar img.l2 { + left: 109px; +} + +nav#menu_bar img.l3 { + left: 136px; +} + +nav#menu_bar img:hover { + filter: brightness(125%); +} + +nav#menu_bar h1 { + font-size: 20px; + margin-left: 30px; +} + +nav#menu_bar { + padding: 10px; + width: calc(100% - 20px); + height: 32px; + position: fixed; +} + +#logo_button { + padding: 5px; + font-size: 20px; + position: fixed; + background-color: var(--accent-color); + width: 25px; + border-radius: 5px; + transition: all ease-in-out 0.25s; +} + +#logo_button:hover { + filter: brightness(1.1); +} + +nav#menu_bar input[type="text"] { + position: absolute; + right: 10px; + border-radius: 2.5px; + padding: 5px; + border-width: 0px; + font-family: "Instrumental", sans-serif; + background-color: var(--input-background); + margin: 0px; + font-size: 12px; + top: 12px; + z-index: 100; + width: 200px; } \ No newline at end of file diff --git a/asset/manifest.json b/asset/manifest.json index 1ba2942..2c71d03 100644 --- a/asset/manifest.json +++ b/asset/manifest.json @@ -1,9 +1,9 @@ -{ - "name": "Lumos", - "short_name": "Lumos", - "theme_color": "#161616", - "background_color": "#161616", - "display": "standalone", - "scope": "/", - "start_url": "/" +{ + "name": "Lumos", + "short_name": "Lumos", + "theme_color": "#161616", + "background_color": "#161616", + "display": "standalone", + "scope": "/", + "start_url": "/" } \ No newline at end of file diff --git a/asset/musicplayer.css b/asset/musicplayer.css index 9b8eee9..82fec6e 100644 --- a/asset/musicplayer.css +++ b/asset/musicplayer.css @@ -1,137 +1,137 @@ -::placeholder { - color: var(--foreground-color); -} - -::-webkit-scrollbar { - display: none; -} - -@font-face { - font-family: "Instrument Sans"; - src: url("InstrumentSans-Regular.ttf"); -} - -@font-face { - font-family: "Instrument Sans Bold"; - src: url("InstrumentSans-Bold.ttf"); -} - -@font-face { - font-family: "Instrument Sans Italic"; - src: url("InstrumentSans-Italic.ttf"); -} - -@keyframes fall-down { - 0% { - opacity: 0%; - height: 0px; - } -} - -::selection { - background-color: transparent; -} - -*.selectable::selection { - background-color: var(--accent-color); -} - -*:focus { - outline: none; -} - -* { - cursor: default; -} - -/* --- Login Box -- -Width: 33vw -Padding: 40px; -Height: 100vh - 80 -Margin-Top: 40px; -*/ - -html { - height: 100%; -} - -body { - background-color: var(--background-color); - color: var(--foreground-color); - font-family: "Instrument Sans", sans-serif; - margin: 0px; - height: 100%; -} - -#lumos_title { - position: fixed; - top: 10px; - left: 10px; - opacity: 0.3; -} - -#player_box { - --width: 320px; - --height: 400px; - --pading: 20px; - width: var(--width); - height: var(--height); - padding: var(--pading); - position: fixed; - top: calc(50vh - (var(--height) + var(--pading)) / 2); - left: calc(50vw - (var(--width) + var(--pading)) / 2); - background-color: var(--grey-1); - border-radius: 15px; - box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -#player_box img { - filter: 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -#song_title { - font-size: large; - max-width: 200px; - margin: 10px; -} - -#play_button { - width: 60px; - height: 60px; - border-radius: 50%; - font-size: 16px; - margin-top: calc(25% - 10px); -} - -#play_button img { - width: 20px; - padding-top: 2.5px; -} - -@keyframes pulse { - 0% {} - 50% {filter: brightness(1.4);} - 100% {} -} - -.pulse { - animation-name: pulse; - animation-duration: 0.5s; - animation-iteration-count: infinite; -} - -#scale_bg { - border-radius: 2px; - background-color: #efefef; - width: 200px; - height: 10px; - box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -#scale_fg { - border-radius: 2px; - background-color: var(--accent-color); - height: 10px; - width: 0px; +::placeholder { + color: var(--foreground-color); +} + +::-webkit-scrollbar { + display: none; +} + +@font-face { + font-family: "Instrument Sans"; + src: url("InstrumentSans-Regular.ttf"); +} + +@font-face { + font-family: "Instrument Sans Bold"; + src: url("InstrumentSans-Bold.ttf"); +} + +@font-face { + font-family: "Instrument Sans Italic"; + src: url("InstrumentSans-Italic.ttf"); +} + +@keyframes fall-down { + 0% { + opacity: 0%; + height: 0px; + } +} + +::selection { + background-color: transparent; +} + +*.selectable::selection { + background-color: var(--accent-color); +} + +*:focus { + outline: none; +} + +* { + cursor: default; +} + +/* +-- Login Box -- +Width: 33vw +Padding: 40px; +Height: 100vh - 80 +Margin-Top: 40px; +*/ + +html { + height: 100%; +} + +body { + background-color: var(--background-color); + color: var(--foreground-color); + font-family: "Instrument Sans", sans-serif; + margin: 0px; + height: 100%; +} + +#lumos_title { + position: fixed; + top: 10px; + left: 10px; + opacity: 0.3; +} + +#player_box { + --width: 320px; + --height: 400px; + --pading: 20px; + width: var(--width); + height: var(--height); + padding: var(--pading); + position: fixed; + top: calc(50vh - (var(--height) + var(--pading)) / 2); + left: calc(50vw - (var(--width) + var(--pading)) / 2); + background-color: var(--grey-1); + border-radius: 15px; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +#player_box img { + filter: 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +#song_title { + font-size: large; + max-width: 200px; + margin: 10px; +} + +#play_button { + width: 60px; + height: 60px; + border-radius: 50%; + font-size: 16px; + margin-top: calc(25% - 10px); +} + +#play_button img { + width: 20px; + padding-top: 2.5px; +} + +@keyframes pulse { + 0% {} + 50% {filter: brightness(1.4);} + 100% {} +} + +.pulse { + animation-name: pulse; + animation-duration: 0.5s; + animation-iteration-count: infinite; +} + +#scale_bg { + border-radius: 2px; + background-color: #efefef; + width: 200px; + height: 10px; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +#scale_fg { + border-radius: 2px; + background-color: var(--accent-color); + height: 10px; + width: 0px; } \ No newline at end of file diff --git a/asset/rawedit.css b/asset/rawedit.css index d8db4aa..a3b0be4 100644 --- a/asset/rawedit.css +++ b/asset/rawedit.css @@ -1,247 +1,247 @@ -::placeholder { - color: var(--foreground-color); -} - -::-webkit-scrollbar { - display: none; -} - -@font-face { - font-family: "Instrument Sans"; - src: url("InstrumentSans-Regular.ttf"); -} - -@font-face { - font-family: "Instrument Sans Bold"; - src: url("InstrumentSans-Bold.ttf"); -} - -@font-face { - font-family: "Instrument Sans Italic"; - src: url("InstrumentSans-Italic.ttf"); -} - -@keyframes fall-down { - 0% { - opacity: 0%; - height: 0px; - } -} - -::selection { - background-color: transparent; -} - -*:focus { - outline: none; -} - -* { - cursor: default; -} - -/* --- Login Box -- -Width: 33vw -Padding: 40px; -Height: 100vh - 80 -Margin-Top: 40px; -*/ - -body, html { - height: 100%; - max-height: 100vh; - overflow: hidden; -} - -div#login_box { - width: 33vw; - min-width: 450px; - padding: 40px; - height: calc(100vh - 160px); - margin-top: 40px; - background-color: var(--transparent-low); - border-radius: 25px; - box-shadow: var(--box-shadow-ten-ten); -} - -nav#menu_bar { - padding: 10px; - width: calc(100% - 20px); - height: 32px; - position: fixed; -} - -#logo_button { - padding: 5px; - font-size: 20px; - position: fixed; - background-color: var(--accent-color); - width: 25px; - border-radius: 5px; - transition: all ease-in-out 0.25s; -} - -#logo_button:hover { - filter: brightness(1.1); -} - -nav { - padding: 11px; - font-size: 16px; - padding-left: 20px; -} - -nav button { - background-color: transparent; - color: var(--foreground-color); - padding: 0px; - text-align: left; - transition: none; - box-shadow: none; -} - -div#info { - padding: 10px; - background-color: var(--background-color-2); - color: var(--foreground-color); - position: absolute; - left: calc(50vw - 30vw); - top: calc(50vh - 40vh + 40px); - width: 60vw; - height: 60vh; - border-radius: 10px; - padding: 20px; -} - -div#info h1 { - font-size: xx-large; -} - -div#info h2 { - font-size: x-large; -} - -div#info h3 { - font-size: large; -} - -div#info #body { - height: 50vh; - overflow-x: scroll; -} - -div#info #nav { - height: 10vh; -} - -div#info #nav * { - margin-top: 5vh; -} - -div#info #nav button#bf { - margin-left: 10px; - width: 50px; -} - -div#main_box table { - width: 100%; - height: calc(100vh - 50px); -} - -div#main_box { - width: 100%; - vertical-align: top; -} - -div#main_box #file_box { - padding-left: 10px; - background-color: var(--transparent-low); - overflow-y: scroll; - height: 100%; - padding-top: 50px; -} - -div#main_box #file_box a { - color: var(--foreground-color); - text-decoration: none; -} - -div.file_button { - padding: 15px; - width: calc(100% - 40px); - margin-top: 10px; - border-bottom: var(--grey-1) 1px solid; - border-radius: 5px; - transition: ease-in-out 100ms; - border-bottom-left-radius: 0px; - border-bottom-right-radius: 0px; -} - -div.file_button:hover { - border-bottom: transparent 1px solid; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; -} - -div.file_button img { - margin-bottom: -5px; - margin-right: 10px; -} - -div#file_menu { - background-color: var(--grey-3); - border-radius: 5px; - position: absolute; - width: 200px; - overflow-x: hidden; - z-index: 100; - padding-top: 10px; - padding-bottom: 10px; -} - -div#file_menu button { - width: 100%; - background-color: var(--grey-3) !important; - height: auto; - font-size: 12pt; - border-radius: 0px; - margin-bottom: 0px; - margin-top: 0px; - padding: 10px; - text-align: left; - transition: ease-in-out 100ms; -} - -div#file_menu button:hover { - filter: brightness(150%); -} - -div#file_menu #file_menu_title { - color: var(--foreground-color); - font-weight: 100; - font-size: small; - margin-bottom: 10px; -} - -button.dangerous { - background-color: var(--accent-color-red) !important; -} - -textarea { - background-color: var(--grey-1); - border-width: 0px; - width: calc(100% - 60px); - height: calc(100% - 120px); - color: var(--foreground-color); - padding: 10px; - margin: 20px; - border-radius: 5px; - margin-top: 0px; - resize: none; -} - -textarea::selection { - background-color: var(--foreground-color); - color: var(--background-color); +::placeholder { + color: var(--foreground-color); +} + +::-webkit-scrollbar { + display: none; +} + +@font-face { + font-family: "Instrument Sans"; + src: url("InstrumentSans-Regular.ttf"); +} + +@font-face { + font-family: "Instrument Sans Bold"; + src: url("InstrumentSans-Bold.ttf"); +} + +@font-face { + font-family: "Instrument Sans Italic"; + src: url("InstrumentSans-Italic.ttf"); +} + +@keyframes fall-down { + 0% { + opacity: 0%; + height: 0px; + } +} + +::selection { + background-color: transparent; +} + +*:focus { + outline: none; +} + +* { + cursor: default; +} + +/* +-- Login Box -- +Width: 33vw +Padding: 40px; +Height: 100vh - 80 +Margin-Top: 40px; +*/ + +body, html { + height: 100%; + max-height: 100vh; + overflow: hidden; +} + +div#login_box { + width: 33vw; + min-width: 450px; + padding: 40px; + height: calc(100vh - 160px); + margin-top: 40px; + background-color: var(--transparent-low); + border-radius: 25px; + box-shadow: var(--box-shadow-ten-ten); +} + +nav#menu_bar { + padding: 10px; + width: calc(100% - 20px); + height: 32px; + position: fixed; +} + +#logo_button { + padding: 5px; + font-size: 20px; + position: fixed; + background-color: var(--accent-color); + width: 25px; + border-radius: 5px; + transition: all ease-in-out 0.25s; +} + +#logo_button:hover { + filter: brightness(1.1); +} + +nav { + padding: 11px; + font-size: 16px; + padding-left: 20px; +} + +nav button { + background-color: transparent; + color: var(--foreground-color); + padding: 0px; + text-align: left; + transition: none; + box-shadow: none; +} + +div#info { + padding: 10px; + background-color: var(--background-color-2); + color: var(--foreground-color); + position: absolute; + left: calc(50vw - 30vw); + top: calc(50vh - 40vh + 40px); + width: 60vw; + height: 60vh; + border-radius: 10px; + padding: 20px; +} + +div#info h1 { + font-size: xx-large; +} + +div#info h2 { + font-size: x-large; +} + +div#info h3 { + font-size: large; +} + +div#info #body { + height: 50vh; + overflow-x: scroll; +} + +div#info #nav { + height: 10vh; +} + +div#info #nav * { + margin-top: 5vh; +} + +div#info #nav button#bf { + margin-left: 10px; + width: 50px; +} + +div#main_box table { + width: 100%; + height: calc(100vh - 50px); +} + +div#main_box { + width: 100%; + vertical-align: top; +} + +div#main_box #file_box { + padding-left: 10px; + background-color: var(--transparent-low); + overflow-y: scroll; + height: 100%; + padding-top: 50px; +} + +div#main_box #file_box a { + color: var(--foreground-color); + text-decoration: none; +} + +div.file_button { + padding: 15px; + width: calc(100% - 40px); + margin-top: 10px; + border-bottom: var(--grey-1) 1px solid; + border-radius: 5px; + transition: ease-in-out 100ms; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; +} + +div.file_button:hover { + border-bottom: transparent 1px solid; + border-bottom-left-radius: 5px; + border-bottom-right-radius: 5px; +} + +div.file_button img { + margin-bottom: -5px; + margin-right: 10px; +} + +div#file_menu { + background-color: var(--grey-3); + border-radius: 5px; + position: absolute; + width: 200px; + overflow-x: hidden; + z-index: 100; + padding-top: 10px; + padding-bottom: 10px; +} + +div#file_menu button { + width: 100%; + background-color: var(--grey-3) !important; + height: auto; + font-size: 12pt; + border-radius: 0px; + margin-bottom: 0px; + margin-top: 0px; + padding: 10px; + text-align: left; + transition: ease-in-out 100ms; +} + +div#file_menu button:hover { + filter: brightness(150%); +} + +div#file_menu #file_menu_title { + color: var(--foreground-color); + font-weight: 100; + font-size: small; + margin-bottom: 10px; +} + +button.dangerous { + background-color: var(--accent-color-red) !important; +} + +textarea { + background-color: var(--grey-1); + border-width: 0px; + width: calc(100% - 60px); + height: calc(100% - 120px); + color: var(--foreground-color); + padding: 10px; + margin: 20px; + border-radius: 5px; + margin-top: 0px; + resize: none; +} + +textarea::selection { + background-color: var(--foreground-color); + color: var(--background-color); } \ No newline at end of file diff --git a/asset/securityadvisor.css b/asset/securityadvisor.css index 853d230..e41ac3e 100644 --- a/asset/securityadvisor.css +++ b/asset/securityadvisor.css @@ -1,161 +1,161 @@ -::placeholder { - color: var(--foreground-color); -} - -::-webkit-scrollbar { - display: none; -} - -@font-face { - font-family: "Instrument Sans"; - src: url("InstrumentSans-Regular.ttf"); -} - -@font-face { - font-family: "Instrument Sans Bold"; - src: url("InstrumentSans-Bold.ttf"); -} - -@font-face { - font-family: "Instrument Sans Italic"; - src: url("InstrumentSans-Italic.ttf"); -} - -@keyframes fall-down { - 0% { - opacity: 0%; - height: 0px; - } -} - -::selection { - background-color: transparent; -} - -*:focus { - outline: none; -} - -* { - cursor: default; -} - -h1 { - font-size: xx-large; - font-family: "Instrument Sans Bold", sans-serif; - margin-bottom: 10px; -} - -h2 { - font-size: large; - margin-bottom: 10px; -} - -/* --- Login Box -- -Width: 33vw -Padding: 40px; -Height: 100vh - 80 -Margin-Top: 40px; -*/ - -html { - height: 100%; -} - -body { - background-color: var(--background-color); - color: var(--foreground-color); - font-family: "Instrument Sans", sans-serif; - margin: 20px; - height: 100%; - overflow: hidden; -} - - -@keyframes flow_down_b { - 0% { - top: 0px; - } -} - -div#confirm_popup { - color: white; - position: absolute; - top: 60px; - left: calc(50vw - 160px); - width: 300px; - padding: 10px; - padding-bottom: 5px; - background-color: #282828; - border-radius: 5px; - animation-name: flow_down_b; - animation-duration: 0.25s; - border-style: solid; - border-width: 0px; - box-shadow: 0px 1px 0px 0px #717171 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); - z-index: 1000; -} - -div#confirm_popup button { - margin-top: 15px; - border-width: 0px !important; - padding: 10px; - font-size: 15px; - color: white !important; - margin-bottom: 7.5px; - box-shadow: none; -} - -div#confirm_popup b { - letter-spacing: 0.75px; -} - -#info_msg { - position: absolute; - top: 50px; - left: calc(50vw - (300px + 20px)); - width: 300px; - padding: 20px; - border-radius: 10px; - background-color: #565656; - color: white; - animation: flow_down 0.25s; - z-index: 100; - box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -@keyframes fill-up { - 0% {width: 0px;} -} - -#bar_cropper { - border-radius: 5px; - overflow: hidden; - height: 14px; - width: 300px; - animation-name: fill-up; - animation-duration: 1s; - animation-fill-mode: forwards; -} - -#level_bar { - background-image: linear-gradient(270deg, #ADFF00 0%, #FF000F 100%); - box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.50), 0px 2px 0px 0px rgba(255, 255, 255, 0.53) inset; - height: 14px; - width: 300px; - border-radius: 5px; -} - -.missing_file { - padding: 10px; - margin-top: 10px; - border-radius: 5px; - background-color: var(--grey-3); - box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.50), 0px 1px 0px 0px rgba(255, 255, 255, 0.53) inset; -} - -#mflistscroll { - height: 140px; - overflow: scroll; +::placeholder { + color: var(--foreground-color); +} + +::-webkit-scrollbar { + display: none; +} + +@font-face { + font-family: "Instrument Sans"; + src: url("InstrumentSans-Regular.ttf"); +} + +@font-face { + font-family: "Instrument Sans Bold"; + src: url("InstrumentSans-Bold.ttf"); +} + +@font-face { + font-family: "Instrument Sans Italic"; + src: url("InstrumentSans-Italic.ttf"); +} + +@keyframes fall-down { + 0% { + opacity: 0%; + height: 0px; + } +} + +::selection { + background-color: transparent; +} + +*:focus { + outline: none; +} + +* { + cursor: default; +} + +h1 { + font-size: xx-large; + font-family: "Instrument Sans Bold", sans-serif; + margin-bottom: 10px; +} + +h2 { + font-size: large; + margin-bottom: 10px; +} + +/* +-- Login Box -- +Width: 33vw +Padding: 40px; +Height: 100vh - 80 +Margin-Top: 40px; +*/ + +html { + height: 100%; +} + +body { + background-color: var(--background-color); + color: var(--foreground-color); + font-family: "Instrument Sans", sans-serif; + margin: 20px; + height: 100%; + overflow: hidden; +} + + +@keyframes flow_down_b { + 0% { + top: 0px; + } +} + +div#confirm_popup { + color: white; + position: absolute; + top: 60px; + left: calc(50vw - 160px); + width: 300px; + padding: 10px; + padding-bottom: 5px; + background-color: #282828; + border-radius: 5px; + animation-name: flow_down_b; + animation-duration: 0.25s; + border-style: solid; + border-width: 0px; + box-shadow: 0px 1px 0px 0px #717171 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); + z-index: 1000; +} + +div#confirm_popup button { + margin-top: 15px; + border-width: 0px !important; + padding: 10px; + font-size: 15px; + color: white !important; + margin-bottom: 7.5px; + box-shadow: none; +} + +div#confirm_popup b { + letter-spacing: 0.75px; +} + +#info_msg { + position: absolute; + top: 50px; + left: calc(50vw - (300px + 20px)); + width: 300px; + padding: 20px; + border-radius: 10px; + background-color: #565656; + color: white; + animation: flow_down 0.25s; + z-index: 100; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +@keyframes fill-up { + 0% {width: 0px;} +} + +#bar_cropper { + border-radius: 5px; + overflow: hidden; + height: 14px; + width: 300px; + animation-name: fill-up; + animation-duration: 1s; + animation-fill-mode: forwards; +} + +#level_bar { + background-image: linear-gradient(270deg, #ADFF00 0%, #FF000F 100%); + box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.50), 0px 2px 0px 0px rgba(255, 255, 255, 0.53) inset; + height: 14px; + width: 300px; + border-radius: 5px; +} + +.missing_file { + padding: 10px; + margin-top: 10px; + border-radius: 5px; + background-color: var(--grey-3); + box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.50), 0px 1px 0px 0px rgba(255, 255, 255, 0.53) inset; +} + +#mflistscroll { + height: 140px; + overflow: scroll; } \ No newline at end of file diff --git a/asset/securityadvisor.js b/asset/securityadvisor.js index 2bab28a..87bb6ec 100644 --- a/asset/securityadvisor.js +++ b/asset/securityadvisor.js @@ -1,6 +1,6 @@ -window.onload = function () { - if (localStorage.getItem("intro_security_advisor") != "true") { - document.getElementById("intro").hidden = false; - } - localStorage.setItem("intro_security_advisor", "true") +window.onload = function () { + if (localStorage.getItem("intro_security_advisor") != "true") { + document.getElementById("intro").hidden = false; + } + localStorage.setItem("intro_security_advisor", "true") } \ No newline at end of file diff --git a/asset/themeoverride.css b/asset/themeoverride.css index b32844b..60478fe 100644 --- a/asset/themeoverride.css +++ b/asset/themeoverride.css @@ -1,32 +1,32 @@ -:root { - --background-color: #161616; - --foreground-color: #ffffff; - --accent-color: #1F75FE; - --accent-color-red: #FF0800; - --transparent-heavy: rgba(255, 255, 255, 0.15); - --transparent-low: transparent; - --link-color: #599CE9; - --box-shadow-ten-ten: 0px 10px 10px black; - --background-color-2: #171b29; - --box-shadow-color: black; - --filter-gradient: #1d202999; - --box-shadow-color-light: #00000042; - --grey-1: #313131; - --grey-2: #0e0e0e; - --grey-3: #363636; - --grey-4: #474747; - --input-background: #ffffff20; - --light-grey-1: #ffffffd1; - --light-grey-2: #ffffff13; - --msg-1: dodgerblue; - --msg-2: forestgreen; - --nav-exit: #ffffffbe; -} - -div#file_menu button { - color: white !important; -} - -div.file_button:hover { - background-color: #2e2e2e; +:root { + --background-color: #161616; + --foreground-color: #ffffff; + --accent-color: #1F75FE; + --accent-color-red: #FF0800; + --transparent-heavy: rgba(255, 255, 255, 0.15); + --transparent-low: transparent; + --link-color: #599CE9; + --box-shadow-ten-ten: 0px 10px 10px black; + --background-color-2: #171b29; + --box-shadow-color: black; + --filter-gradient: #1d202999; + --box-shadow-color-light: #00000042; + --grey-1: #313131; + --grey-2: #0e0e0e; + --grey-3: #363636; + --grey-4: #474747; + --input-background: #ffffff20; + --light-grey-1: #ffffffd1; + --light-grey-2: #ffffff13; + --msg-1: dodgerblue; + --msg-2: forestgreen; + --nav-exit: #ffffffbe; +} + +div#file_menu button { + color: white !important; +} + +div.file_button:hover { + background-color: #2e2e2e; } \ No newline at end of file diff --git a/asset/themes/default.css b/asset/themes/default.css index b32844b..60478fe 100644 --- a/asset/themes/default.css +++ b/asset/themes/default.css @@ -1,32 +1,32 @@ -:root { - --background-color: #161616; - --foreground-color: #ffffff; - --accent-color: #1F75FE; - --accent-color-red: #FF0800; - --transparent-heavy: rgba(255, 255, 255, 0.15); - --transparent-low: transparent; - --link-color: #599CE9; - --box-shadow-ten-ten: 0px 10px 10px black; - --background-color-2: #171b29; - --box-shadow-color: black; - --filter-gradient: #1d202999; - --box-shadow-color-light: #00000042; - --grey-1: #313131; - --grey-2: #0e0e0e; - --grey-3: #363636; - --grey-4: #474747; - --input-background: #ffffff20; - --light-grey-1: #ffffffd1; - --light-grey-2: #ffffff13; - --msg-1: dodgerblue; - --msg-2: forestgreen; - --nav-exit: #ffffffbe; -} - -div#file_menu button { - color: white !important; -} - -div.file_button:hover { - background-color: #2e2e2e; +:root { + --background-color: #161616; + --foreground-color: #ffffff; + --accent-color: #1F75FE; + --accent-color-red: #FF0800; + --transparent-heavy: rgba(255, 255, 255, 0.15); + --transparent-low: transparent; + --link-color: #599CE9; + --box-shadow-ten-ten: 0px 10px 10px black; + --background-color-2: #171b29; + --box-shadow-color: black; + --filter-gradient: #1d202999; + --box-shadow-color-light: #00000042; + --grey-1: #313131; + --grey-2: #0e0e0e; + --grey-3: #363636; + --grey-4: #474747; + --input-background: #ffffff20; + --light-grey-1: #ffffffd1; + --light-grey-2: #ffffff13; + --msg-1: dodgerblue; + --msg-2: forestgreen; + --nav-exit: #ffffffbe; +} + +div#file_menu button { + color: white !important; +} + +div.file_button:hover { + background-color: #2e2e2e; } \ No newline at end of file diff --git a/asset/themes/green_dark.css b/asset/themes/green_dark.css index 6298598..e96ac35 100644 --- a/asset/themes/green_dark.css +++ b/asset/themes/green_dark.css @@ -1,32 +1,32 @@ -:root { - --background-color: #161616; - --foreground-color: #ffffff; - --accent-color: #0BDA51; - --accent-color-red: #FF0800; - --transparent-heavy: rgba(255, 255, 255, 0.15); - --transparent-low: transparent; - --link-color: #599CE9; - --box-shadow-ten-ten: 0px 10px 10px black; - --background-color-2: #171b29; - --box-shadow-color: black; - --filter-gradient: #1d202999; - --box-shadow-color-light: #00000042; - --grey-1: #313131; - --grey-2: #0e0e0e; - --grey-3: #252525; - --grey-4: #474747; - --input-background: #ffffff20; - --light-grey-1: #ffffffd1; - --light-grey-2: #ffffff13; - --msg-1: dodgerblue; - --msg-2: forestgreen; - --nav-exit: #ffffffbe; -} - -div#file_menu button { - color: white !important; -} - -div.file_button:hover { - background-color: #2e2e2e; +:root { + --background-color: #161616; + --foreground-color: #ffffff; + --accent-color: #0BDA51; + --accent-color-red: #FF0800; + --transparent-heavy: rgba(255, 255, 255, 0.15); + --transparent-low: transparent; + --link-color: #599CE9; + --box-shadow-ten-ten: 0px 10px 10px black; + --background-color-2: #171b29; + --box-shadow-color: black; + --filter-gradient: #1d202999; + --box-shadow-color-light: #00000042; + --grey-1: #313131; + --grey-2: #0e0e0e; + --grey-3: #252525; + --grey-4: #474747; + --input-background: #ffffff20; + --light-grey-1: #ffffffd1; + --light-grey-2: #ffffff13; + --msg-1: dodgerblue; + --msg-2: forestgreen; + --nav-exit: #ffffffbe; +} + +div#file_menu button { + color: white !important; +} + +div.file_button:hover { + background-color: #2e2e2e; } \ No newline at end of file diff --git a/asset/themes/green_dark_lines.css b/asset/themes/green_dark_lines.css index b3f9757..b3211ea 100644 --- a/asset/themes/green_dark_lines.css +++ b/asset/themes/green_dark_lines.css @@ -1,46 +1,46 @@ -:root { - --background-color: #161616; - --foreground-color: #ffffff; - --accent-color: #0BDA51; - --accent-color-red: #FF0800; - --transparent-heavy: rgba(255, 255, 255, 0.15); - --transparent-low: transparent; - --link-color: #599CE9; - --box-shadow-ten-ten: 0px 10px 10px black; - --background-color-2: #171b29; - --box-shadow-color: black; - --filter-gradient: #1d202999; - --box-shadow-color-light: #00000042; - --grey-1: #313131; - --grey-2: #2e2e2e; - --grey-3: #252525; - --grey-4: #474747; - --input-background: #ffffff20; - --light-grey-1: #ffffffd1; - --light-grey-2: #ffffff13; - --msg-1: dodgerblue; - --msg-2: forestgreen; - --nav-exit: #ffffffbe; -} - -div#file_menu button { - color: white !important; -} - -div.file_button:hover { - background-color: #01270e; -} - -nav { - background-color: #011b0a !important; - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: #043e18; -} - -div#file_info_menu { - background-color: #000e05; - border-left-width: 1px; - border-left-style: solid; - border-left-color: #022a10; +:root { + --background-color: #161616; + --foreground-color: #ffffff; + --accent-color: #0BDA51; + --accent-color-red: #FF0800; + --transparent-heavy: rgba(255, 255, 255, 0.15); + --transparent-low: transparent; + --link-color: #599CE9; + --box-shadow-ten-ten: 0px 10px 10px black; + --background-color-2: #171b29; + --box-shadow-color: black; + --filter-gradient: #1d202999; + --box-shadow-color-light: #00000042; + --grey-1: #313131; + --grey-2: #2e2e2e; + --grey-3: #252525; + --grey-4: #474747; + --input-background: #ffffff20; + --light-grey-1: #ffffffd1; + --light-grey-2: #ffffff13; + --msg-1: dodgerblue; + --msg-2: forestgreen; + --nav-exit: #ffffffbe; +} + +div#file_menu button { + color: white !important; +} + +div.file_button:hover { + background-color: #01270e; +} + +nav { + background-color: #011b0a !important; + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: #043e18; +} + +div#file_info_menu { + background-color: #000e05; + border-left-width: 1px; + border-left-style: solid; + border-left-color: #022a10; } \ No newline at end of file diff --git a/asset/themes/green_light.css b/asset/themes/green_light.css index cd40b4f..059f213 100644 --- a/asset/themes/green_light.css +++ b/asset/themes/green_light.css @@ -1,74 +1,74 @@ -:root { - --background-color: #ffffff; - --foreground-color: #000000; - --accent-color: #0BDA51; - --accent-color-red: #FF0800; - --transparent-heavy: #00000026; - --transparent-low: transparent; - --link-color: #001c3c; - --box-shadow-ten-ten: 0px 10px 10px #b3b3b3; - --background-color-2: #ececec; - --box-shadow-color: #9e9e9e; - --filter-gradient: #e9e9e999; - --box-shadow-color-light: #b4b4b442; - --grey-1: #b3b3b3; - --grey-2: #bbbbbb; - --grey-3: #252525; - --grey-4: #474747; - --input-background: #aeaeae36; - --light-grey-1: #ffffffd1; - --light-grey-2: #abababcf; - --msg-1: dodgerblue; - --msg-2: forestgreen; - --nav-exit: #ffffffbe; -} - -button { - color: white; -} - -div#file_menu { - background-color: #d6d6d6; -} - -div#file_menu button { - background-color: #d6d6d6 !important; - color: #000000; -} - -div#file_menu button:hover { - background-color: #474747 !important; - color: white !important; -} - -div.file_button { - border-bottom-color: #999999; -} - -table tr #userlist { - background-color: transparent; - border-right-color: var(--accent-color); - border-right-style: solid; - border-right-width: 1px; -} - -nav#menu_bar input[type="text"] { - background-color: #ffffff; -} - -nav#menu_bar { - background-color: black; -} - -#file_info_menu { - backdrop-filter: none; - background-color: white !important; - border-left-color: #000000 !important; - border-left-style: solid; - border-left-width: 1px; - z-index: 100; -} - -div.file_button:hover { - backdrop-filter: brightness(0.9); +:root { + --background-color: #ffffff; + --foreground-color: #000000; + --accent-color: #0BDA51; + --accent-color-red: #FF0800; + --transparent-heavy: #00000026; + --transparent-low: transparent; + --link-color: #001c3c; + --box-shadow-ten-ten: 0px 10px 10px #b3b3b3; + --background-color-2: #ececec; + --box-shadow-color: #9e9e9e; + --filter-gradient: #e9e9e999; + --box-shadow-color-light: #b4b4b442; + --grey-1: #b3b3b3; + --grey-2: #bbbbbb; + --grey-3: #252525; + --grey-4: #474747; + --input-background: #aeaeae36; + --light-grey-1: #ffffffd1; + --light-grey-2: #abababcf; + --msg-1: dodgerblue; + --msg-2: forestgreen; + --nav-exit: #ffffffbe; +} + +button { + color: white; +} + +div#file_menu { + background-color: #d6d6d6; +} + +div#file_menu button { + background-color: #d6d6d6 !important; + color: #000000; +} + +div#file_menu button:hover { + background-color: #474747 !important; + color: white !important; +} + +div.file_button { + border-bottom-color: #999999; +} + +table tr #userlist { + background-color: transparent; + border-right-color: var(--accent-color); + border-right-style: solid; + border-right-width: 1px; +} + +nav#menu_bar input[type="text"] { + background-color: #ffffff; +} + +nav#menu_bar { + background-color: black; +} + +#file_info_menu { + backdrop-filter: none; + background-color: white !important; + border-left-color: #000000 !important; + border-left-style: solid; + border-left-width: 1px; + z-index: 100; +} + +div.file_button:hover { + backdrop-filter: brightness(0.9); } \ No newline at end of file diff --git a/asset/themes/light.css b/asset/themes/light.css index 33279de..3724c54 100644 --- a/asset/themes/light.css +++ b/asset/themes/light.css @@ -1,74 +1,74 @@ -:root { - --background-color: #ffffff; - --foreground-color: #000000; - --accent-color: #3074e1; - --accent-color-red: #FF0800; - --transparent-heavy: #00000026; - --transparent-low: transparent; - --link-color: #001c3c; - --box-shadow-ten-ten: 0px 10px 10px #b3b3b3; - --background-color-2: #ececec; - --box-shadow-color: #9e9e9e; - --filter-gradient: #e9e9e999; - --box-shadow-color-light: #b4b4b442; - --grey-1: #b3b3b3; - --grey-2: #bbbbbb; - --grey-3: #252525; - --grey-4: #474747; - --input-background: #aeaeae36; - --light-grey-1: #ffffffd1; - --light-grey-2: #abababcf; - --msg-1: dodgerblue; - --msg-2: forestgreen; - --nav-exit: #ffffffbe; -} - -button { - color: white; -} - -div#file_menu { - background-color: #d6d6d6; -} - -div#file_menu button { - background-color: #d6d6d6 !important; - color: #000000; -} - -div#file_menu button:hover { - background-color: #474747 !important; - color: white !important; -} - -div.file_button { - border-bottom-color: #999999; -} - -table tr #userlist { - background-color: transparent; - border-right-color: var(--accent-color); - border-right-style: solid; - border-right-width: 1px; -} - -nav#menu_bar input[type="text"] { - background-color: #ffffff; -} - -nav#menu_bar { - background-color: black; -} - -#file_info_menu { - backdrop-filter: none; - background-color: white !important; - border-left-color: #000000 !important; - border-left-style: solid; - border-left-width: 1px; - z-index: 100; -} - -div.file_button:hover { - backdrop-filter: brightness(0.9); +:root { + --background-color: #ffffff; + --foreground-color: #000000; + --accent-color: #3074e1; + --accent-color-red: #FF0800; + --transparent-heavy: #00000026; + --transparent-low: transparent; + --link-color: #001c3c; + --box-shadow-ten-ten: 0px 10px 10px #b3b3b3; + --background-color-2: #ececec; + --box-shadow-color: #9e9e9e; + --filter-gradient: #e9e9e999; + --box-shadow-color-light: #b4b4b442; + --grey-1: #b3b3b3; + --grey-2: #bbbbbb; + --grey-3: #252525; + --grey-4: #474747; + --input-background: #aeaeae36; + --light-grey-1: #ffffffd1; + --light-grey-2: #abababcf; + --msg-1: dodgerblue; + --msg-2: forestgreen; + --nav-exit: #ffffffbe; +} + +button { + color: white; +} + +div#file_menu { + background-color: #d6d6d6; +} + +div#file_menu button { + background-color: #d6d6d6 !important; + color: #000000; +} + +div#file_menu button:hover { + background-color: #474747 !important; + color: white !important; +} + +div.file_button { + border-bottom-color: #999999; +} + +table tr #userlist { + background-color: transparent; + border-right-color: var(--accent-color); + border-right-style: solid; + border-right-width: 1px; +} + +nav#menu_bar input[type="text"] { + background-color: #ffffff; +} + +nav#menu_bar { + background-color: black; +} + +#file_info_menu { + backdrop-filter: none; + background-color: white !important; + border-left-color: #000000 !important; + border-left-style: solid; + border-left-width: 1px; + z-index: 100; +} + +div.file_button:hover { + backdrop-filter: brightness(0.9); } \ No newline at end of file diff --git a/asset/welcome.css b/asset/welcome.css index 3298809..cb4169a 100644 --- a/asset/welcome.css +++ b/asset/welcome.css @@ -1,134 +1,134 @@ -@keyframes turn { - 50% { - transform: rotate(1turn); - } - 100% { - transform: rotate(2turn); - } -} - -@keyframes screen-transition { - 0% { - opacity: 0; - } - 100% { - opacity: 1; - } -} - -::selection { - background-color: transparent; -} - -* { - cursor: default; -} - -@font-face { - font-family: "Instrument Sans"; - src: url("InstrumentSans-Regular.ttf"); -} - -@font-face { - font-family: "Instrument Sans Bold"; - src: url("InstrumentSans-Bold.ttf"); -} - -@font-face { - font-family: "Instrument Sans Italic"; - src: url("InstrumentSans-Italic.ttf"); -} - -*:focus { - outline: none; -} - -button:hover { - filter: brightness(120%); -} - -button:hover:disabled { - filter: brightness(120%) grayscale() brightness(1.3); -} - -button:focus { - filter: brightness(130%); -} - -button:active { - filter: brightness(140%); -} - -button:disabled { - filter: grayscale() brightness(1.3); -} - -button img { - height: 15px; - margin-left: 20px; - animation-name: turn; - animation-duration: 2s; - animation-iteration-count: infinite; -} - -#register_link { - padding-left: 20px; - font-size: 20px; -} - -b { - font-family: "Instrument Sans Bold"; -} - -i { - font-family: "Instrument Sans Italic"; -} - -a, a::after, a:hover, a:active { - color: var(--link-color); -} - -div#login_box { - width: min-content; - height: 400px; - margin-top: calc(75vh - 400px); -} - -div#login_box h1 { - font-size: 3vw; - font-family: "Instrument Sans Bold"; - margin: 0px; - padding-bottom: 15px; - width: max-content; -} -div#login_box h2 { - font-size: 12pt; - font-family: "Instrument Sans"; - margin: 0px; - padding-bottom: 15px; -} - -@keyframes flow_down { - 0% {top: 0px;} - 100% { - top: 20px; - } -} - -#info { - position: absolute; - left: calc(50vw - 100px); - top: 40px; - width: 200px; - padding: 10px; - border-radius: 10px; - background-color: #565656; - animation: flow_down 0.25s; - z-index: 100; - color: white; - box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); -} - -*.margin-left-small { - margin-left: 10px; +@keyframes turn { + 50% { + transform: rotate(1turn); + } + 100% { + transform: rotate(2turn); + } +} + +@keyframes screen-transition { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +::selection { + background-color: transparent; +} + +* { + cursor: default; +} + +@font-face { + font-family: "Instrument Sans"; + src: url("InstrumentSans-Regular.ttf"); +} + +@font-face { + font-family: "Instrument Sans Bold"; + src: url("InstrumentSans-Bold.ttf"); +} + +@font-face { + font-family: "Instrument Sans Italic"; + src: url("InstrumentSans-Italic.ttf"); +} + +*:focus { + outline: none; +} + +button:hover { + filter: brightness(120%); +} + +button:hover:disabled { + filter: brightness(120%) grayscale() brightness(1.3); +} + +button:focus { + filter: brightness(130%); +} + +button:active { + filter: brightness(140%); +} + +button:disabled { + filter: grayscale() brightness(1.3); +} + +button img { + height: 15px; + margin-left: 20px; + animation-name: turn; + animation-duration: 2s; + animation-iteration-count: infinite; +} + +#register_link { + padding-left: 20px; + font-size: 20px; +} + +b { + font-family: "Instrument Sans Bold"; +} + +i { + font-family: "Instrument Sans Italic"; +} + +a, a::after, a:hover, a:active { + color: var(--link-color); +} + +div#login_box { + width: min-content; + height: 400px; + margin-top: calc(75vh - 400px); +} + +div#login_box h1 { + font-size: 3vw; + font-family: "Instrument Sans Bold"; + margin: 0px; + padding-bottom: 15px; + width: max-content; +} +div#login_box h2 { + font-size: 12pt; + font-family: "Instrument Sans"; + margin: 0px; + padding-bottom: 15px; +} + +@keyframes flow_down { + 0% {top: 0px;} + 100% { + top: 20px; + } +} + +#info { + position: absolute; + left: calc(50vw - 100px); + top: 40px; + width: 200px; + padding: 10px; + border-radius: 10px; + background-color: #565656; + animation: flow_down 0.25s; + z-index: 100; + color: white; + box-shadow: 0px 1px 0px 0px #A0A0A0 inset, 0px 5px 15px 0px rgba(0, 0, 0, 0.50); +} + +*.margin-left-small { + margin-left: 10px; } \ No newline at end of file diff --git a/libs/__main__.py b/libs/__main__.py new file mode 100644 index 0000000..f78c5a1 --- /dev/null +++ b/libs/__main__.py @@ -0,0 +1,1205 @@ +""" +Lumos Server Main File +** +by Constantin Volke (wervice@proton.me) +Please notice, that I'm using third party libraries. +Legal notes under https://www.github.com/Wervice/Lumos/legal.md +** +The files accid.cfg, admin_set.cfg, login_subtitle.cfg, no_binary.cfg, virus_scanner.cfg should be set to 0 at first launch. +""" + +import platform +try: + import libs.gethashes +except: + import gethashes +import time +import io +from PIL import Image +from flask import Flask, request, render_template, send_file +import base64 +from werkzeug.utils import secure_filename +import hashlib +import os +import json +from mimetypes import MimeTypes +import pyAesCrypt +import threading +import re +import psutil +import math +import datetime as dt +import random +mime = MimeTypes() + +open("asset/themeoverride.css", "w").write(open("asset/themes/"+open("theme.cfg", "r").read()+".css").read()) + +if not os.path.exists("users"): + os.mkdir("users/") + +def encode_as_base64(str): + if str != "": + message_bytes = str.encode('utf-8') + base64_bytes = base64.b64encode(message_bytes) + base64_message = base64_bytes.decode('utf-8') + return base64_message + else: + return "" + + +def decode_from_base64(str): + if str != "": + message_bytes = str.encode('utf-8') + base64_bytes = base64.b64decode(message_bytes) + base64_message = base64_bytes.decode('utf-8') + return base64_message + else: + return "" + + +if (open("admin_set.cfg").read() == "0"): + print("Welcome to Lumos") + print("----------------\n") + aduse = input("Admin username: ") + adpas = input("Admin password: ") + uservrs = input("Use virus scanner? [y/N]: ") == "y" + blockexe = input("Block executable files? [y/N]: ") == "y" + accid = input("AccID: ") + servername = input("Login Subtitle: ") + open("admin_set.cfg", "w").write("1") + os.mkdir("users/"+encode_as_base64(aduse)) + open("users/"+encode_as_base64(aduse)+"/userpassword.cfg", "w").write(hashlib.sha256(adpas.encode("utf-8")).hexdigest()) + open("users/"+encode_as_base64(aduse)+"/is_admin", "w").write("1yisadmin$") + open("users/"+encode_as_base64(aduse)+"/enoed_files", "w").write("\{\}") + open("virus_scanner.cfg", "w").write(str(int(uservrs))) + open("no_binary.cfg", "w").write(str(int(blockexe))) + open("login_subtitle.cfg", "w").write(servername) + open("accid.cfg", "w").write(accid) + os.mkdir("users/"+encode_as_base64(aduse)+"/chat_inbox") + print("Done. Please restart the application now.") + exit() +else: + pass + +def compress_image(image_bytes, username, filename): + try: + mime_type = mime.guess_type( + "users/"+username+"/"+secure_filename(filename)) + format = str(mime_type)[1].replace( + "image/", "").upper().replace("JPEG", "JPG") + with Image.open(io.BytesIO(image_bytes)) as img: + output_buffer = io.BytesIO() + img.thumbnail((300, 300)) + img.save(output_buffer, format="PNG", optimize=False, quality=10) + output_buffer.seek(0) + return output_buffer + except: + print("Image Compression Error: Maybe encrypted Image") + return None + +def file_html_gen(username): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + try: + if os.path.exists("users/"+json_array[request.remote_addr]+"/decryption_tempfile.tmp"): + os.remove("users/"+json_array[request.remote_addr]+"/decryption_tempfile.tmp") + except: + pass + files = os.listdir("users/"+username+"/") + html_code = "" + for file in files: + if file != "userpassword.cfg" and file != "enced_files" and file != "Thumbs.db" and file != "ckey.cfg" and not file.startswith("chat_log_file_") and file != "chat_inbox" and file != "shared_files": + # mime_image.svg + # mime_doc.svg + # mime_presentation.svg + # mime_spreadsheet.svg + # mime_pdf.svg + # mime_video.svg + mime_icon_dict = { + # Images + "png": "mime_image.svg", + "jpg": "mime_image.svg", + "heic": "mime_image.svg", + "gif": "mime_image.svg", + "heif": "mime_image.svg", + "bmp": "mime_image.svg", + "ico": "mime_image.svg", + # Text Document + "doc": "mime_doc.svg", + "docx": "mime_doc.svg", + "odt": "mime_doc.svg", + "md": "mime_doc.svg", + "txt": "mime_doc.svg", + # Presentation + "ppt": "mime_presentation.svg", + "pptx": "mime_presentation.svg", + "odp": "mime_presentation.svg", + "pptm": "mime_presentation.svg", + # Spreadsheet + "xls": "mime_spreadsheet.svg", + "xlsx": "mime_spreadsheet.svg", + "ods": "mime_spreadsheet.svg", + "csv": "mime_spreadsheet.svg", + # PDF + "pdf": "mime_pdf.svg", + # Videos + "mp4": "mime_video.svg", + "mov": "mime_video.svg", + "avi": "mime_video.svg", + "webm": "mime_video.svg", + # Archive + "zip": "mime_archive.svg", + "tar": "mime_archive.svg", + "xz": "mime_archive.svg", + "exe": "mime_archive.svg", + "iso": "mime_archive.svg", + } + try: + mimet = file.split(".")[1] + except IndexError: + mimet = "mime_none.svg" + print(mimet) + if mimet in mime_icon_dict: + mime_icon = mime_icon_dict[mimet] + else: + mime_icon = "mime_none.svg" + fileattrs = os.stat("users/"+username+"/"+file) + filesize = str(math.floor(fileattrs.st_size / 1024)) + filetypel = { + # Images + "png": "Image file", + "jpg": "Image file", + "heic": "Image file", + "gif": "Image file", + "heif": "Image file", + "bmp": "Image file", + "ico": "Icon file", + # Text Document + "doc": "Word Document", + "docx": "Word Document", + "odt": "LibreOffice Writer Document", + "md": "Markdown", + "txt": "Plain Text", + # Presentation + "ppt": "PowerPoint Presentation", + "pptx": "PowerPoint Presentation", + "odp": "LibreOffice Impress Document", + "pptm": "PowerPoint Macro File", + # Spreadsheet + "xls": "Excel Spreadsheet", + "xlsx": "Excel Spreadsheet", + "ods": "LibreOffice Spreadsheet", + "csv": "CSV Table Text Document", + # PDF + "pdf": "PDF Document", + # Videos + "mp4": "Video", + "mov": "Video", + "avi": "Video", + "webm": "Video", + # Archive + "zip": "Archive", + "tar": "Archive", + "xz": "Archive", + "exe": "Archive / Windows Executable", + "iso": "Archive / Disk Image", + # Plain + "html": "HTML Code Document", + "js": "JavaScript Code Document", + "css": "CSS Code Document", + "py": "Python Code Document", + "pyw": "Python Code Document", + "c": "C Code Document", + "csharp": "C# Code Document", + "cpp": "C++ Code Document", + "sh": "Shell Code Document", + "bat": "Batch Code Document", + } + if not mimet in filetypel: + filetype = "mime_none.svg" + else: + filetype = filetypel[mimet] + filecday = str(dt.datetime.fromtimestamp(os.path.getctime("users/"+username+"/"+file)).strftime("%Y/%m/%d %H:%M")) + filemday = str(dt.datetime.fromtimestamp(os.path.getmtime("users/"+username+"/"+file)).strftime("%Y/%m/%d %H:%M")) + + html_code += "
"+file.replace("_", " ")+"
" + if html_code == "": + html_code = "
" + return html_code + + +app = Flask(__name__, template_folder="..\\templates", static_folder="..\\asset") + + +@app.after_request +def add_header(response): + response.headers['Cache-Control'] = 'cache, no-store, must-revalidate' + response.headers['Pragma'] = 'no-cache' + response.headers['Expires'] = '0' + return response + + +@app.errorhandler(404) +def page_not_found(error): + return render_template("errors/404.html"), 404 + + +@app.errorhandler(500) +def internal_server_error(error): + return render_template("errors/500.html"), 500 + + +@app.errorhandler(405) +def forbiden(error): + return render_template("errors/405.html"), 405 + + +subtitle_reader = open("login_subtitle.cfg") +login_subtitle = subtitle_reader.read() +subtitle_reader.close() +version_reader = open("version.cfg", "r") +version = version_reader.read() +version_reader.close() + + +if open("no_binary.cfg").read() == "1": + blacklist_extensions = [ + "application/x-msdownload", "application/octet-stream"] + print("Block binaries") +else: + blacklist_extensions = [] +blacklist_filenames = ["is_admin", "userconfig.cfg", "enced_files", "Thumbs.db", "decryption_tempfile.tmp", "", "chat_inbox", "userpassword.cfg", "ckey.cfg", "shared_files"] + +def validate_access_permissions(filename): + if secure_filename(filename) in blacklist_filenames or filename.startswith('chat_log_file_'): + retval = True + else: + retval = False + return retval + +# * Lumos filemanager + +@app.route("/", methods=["GET"]) +def startscreen(): + if request.method == "GET": + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and "ckey" in request.cookies: + if request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + file_html = file_html_gen(json_array[request.remote_addr]) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + if open("virus_scanner.cfg", "r").read() == "1": + virscanner = "Enabled" + else: + virscanner = "Disabled" + if open("no_binary.cfg", "r").read() == "1": + enbin = "yes" + else: + enbin = "no" + userdirlisthtml = "" + userdirlist = os.listdir("users/") + for username_encoded in userdirlist: + if username_encoded != json_array[request.remote_addr]: + userdirlisthtml += "
"+decode_from_base64(username_encoded)+"
" + ram_value = psutil.virtual_memory()[2] + cpu_value = psutil.cpu_percent(2) + theme = open("theme.cfg", "r").read().split(".")[0] + return render_template("admin/admin_dashboard.html", version=version, + platform=platform.system(), virscanner=virscanner, last_vir_update=open("last_virus_update.txt", "r").read(), blockbinary=enbin, ram=ram_value, cpu=cpu_value, servername = login_subtitle, acttheme=theme).replace("[[ userlist ]]", userdirlisthtml) + else: + return render_template("homescreen.html", version=version).replace("[[ files ]]", file_html) + else: + open("users/"+json_array[request.remote_addr]+"/ckey.cfg", "w").write("") + if request.remote_addr in json_array: + del json_array[request.remote_addr] + loggedin_users_writer = open("loggedin_users", "w") + loggedin_users_writer.write(json.dumps(json_array)) + loggedin_users_writer.close() + return render_template("login.html", login_subtitle=login_subtitle) + else: + return render_template("login.html", login_subtitle=login_subtitle) + else: + return "Method not allowed" + +# * Login & Register + +@app.route("/login", methods=["GET", "POST"]) +def login(): + if request.method == "GET": + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if not request.remote_addr in json_array: + return render_template("login.html", login_subtitle=login_subtitle) + else: + return "" + elif request.method == "POST": + time.sleep(3) + print("users/"+encode_as_base64(secure_filename(request.form["username"]))+"/userpassword.cfg") + if os.path.exists("users/"+encode_as_base64(secure_filename(request.form["username"]))+"/userpassword.cfg"): + if hashlib.sha256(request.form["password"].encode("utf-8")).hexdigest() ==\ + open("users/"+encode_as_base64(secure_filename(request.form["username"]))+"/userpassword.cfg", "r").read(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + json_array[request.remote_addr] = encode_as_base64( + secure_filename(request.form["username"])) + json_array_json = json.dumps(json_array) + loggedin_users_writer = open("loggedin_users", "w") + loggedin_users_writer.write(json_array_json) + loggedin_users_writer.close() + i = 0 + cookiekeystr = "" + while i != 512: + cookiekeystr += chr(random.randint(1, 128)) + i = i+1 + cookiekey = hashlib.sha512(cookiekeystr.encode("utf-8")).hexdigest() + if os.path.exists("users/"+encode_as_base64(secure_filename(request.form["username"]))+"/is_admin"): + if open("virus_scanner.cfg", "r").read() == "1": + virscanner = "Enabled" + else: + virscanner = "Disabled" + if open("no_binary.cfg", "r").read() == "1": + enbin = "yes" + else: + enbin = "no" + userdirlisthtml = "" + userdirlist = os.listdir("users/") + for username_encoded in userdirlist: + if username_encoded != json_array[request.remote_addr]: + userdirlisthtml += "
"+decode_from_base64(username_encoded)+"
" + ram_value = psutil.virtual_memory()[2] + cpu_value = psutil.cpu_percent(2) + theme = open("theme.cfg", "r").read().split(".")[0] + open("users/"+json_array[request.remote_addr]+"/"+"ckey.cfg", "w").write(cookiekey) + return render_template("admin/admin_dashboard.html", version=version, + platform=platform.system(), virscanner=virscanner, last_vir_update=open("last_virus_update.txt", "r").read(), blockbinary=enbin, ram=ram_value, cpu=cpu_value, servername = login_subtitle, acttheme=theme).replace("[[ userlist ]]", userdirlisthtml).replace("[[ ckey ]]", cookiekey) + else: + open("users/"+json_array[request.remote_addr]+"/"+"ckey.cfg", "w").write(cookiekey) + return "" + else: + return "" + else: + return "" + + +@app.route("/register", methods=["GET", "POST"]) +# TODO Messages +def register(): + if request.method == "GET": + return render_template("welcome.html", login_subtitle=login_subtitle) + elif request.method == "POST": + time.sleep(3) + if request.form["accid"] == open("accid.cfg", "r").read(): + if not os.path.exists("users/"+encode_as_base64(secure_filename(request.form["username"]))+"/"+"userpassword.cfg"): + os.mkdir( + "users/"+encode_as_base64(secure_filename(request.form["username"]))+"/") + enced_file_writer = open("users/"+encode_as_base64( + secure_filename(request.form["username"]))+"/enced_files", "w") + enced_file_writer.write("{}") + enced_file_writer.close() + user_info_writer = open("users/"+encode_as_base64( + secure_filename(request.form["username"]))+"/"+"userpassword.cfg", "w") + user_info_writer.write(hashlib.sha256( + request.form["password"].encode("utf-8")).hexdigest()) + user_info_writer.close() + time.sleep(3) + return "" + else: + return "" + else: + return "" + + +@app.route("/logoff") +def logoff(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array: + open("users/"+json_array[request.remote_addr]+"/ckey.cfg", "w").write("") + del json_array[request.remote_addr] + loggedin_users_writer = open("loggedin_users", "w") + loggedin_users_writer.write(json.dumps(json_array)) + loggedin_users_writer.close() + return "" + else: + return "" + + +# * File upload + +@app.route("/upload/web", methods=["GET", "POST"]) +# ! Is it secure? +def upload(): + if request.method == "GET": + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + return render_template("upload.html") + else: + return "You're not logged in", 403 + elif request.method == "POST": + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + username = json_array[request.remote_addr] + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + if not os.path.exists("users/"+username+"/"+secure_filename(request.form["filename"])): + file = request.files["file_upload"] + username = json_array[request.remote_addr] + print(file.content_type) + if not file.content_type in blacklist_extensions and not validate_access_permissions(filename=request.form["filename"]): + file_contents = file.read() + if open("virus_scanner.cfg") == "1": + if not hashlib.md5(file_contents).hexdigest() in open("hashes_main.txt", "r").read().split("\n"): + file_writer = open( + "users/"+username+"/" + secure_filename(request.form["filename"]), "wb") + file_writer.write(file_contents) + file_writer.close() + file_html = file_html_gen(json_array[request.remote_addr]) + return render_template("homescreen.html", version=version).replace("[[ files ]]", file_html) + else: + return "", 905 + else: + file_writer = open( + "users/"+username+"/" + secure_filename(request.form["filename"]), "wb") + file_writer.write(file_contents) + file_writer.close() + file_html = file_html_gen(json_array[request.remote_addr]) + return render_template("homescreen.html", version=version).replace("[[ files ]]", file_html) + else: + # Execu or illegal filename detected + return "", 903 + else: + # The file already exists + return "", 904 + else: + return "You're not logged in" + + +@app.route("/load-file/") +def load_file(filename): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + enced_files = open('users/'+json_array[request.remote_addr]+"/enced_files") + enced_file_array = json.load(enced_files) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + username = json_array[request.remote_addr] + if not validate_access_permissions(filename=filename): + if not filename in enced_file_array: + music_extensions = ["mp3", "wav", "m4a"] + if not filename.split(".")[1] in music_extensions: + return send_file( + io.BytesIO(open("users/"+username+"/" + + secure_filename(filename), 'rb').read()), + mimetype=str(mime.guess_type( + "users/"+username+"/"+secure_filename(filename))), + as_attachment=True, + download_name=filename + ) + else: + b64_data = "data:audio/"+filename.split(".")[1]+";base64,"+str(base64.b64encode(open("users/"+json_array[request.remote_addr]+"/"+filename, "rb").read())).replace("b'", "").replace("'","") + return render_template("music_player.html", filename = filename, song_in_b64 = b64_data) + else: + return "", 901 + else: + return "You aren't allowed to access this file", 403 + else: + return "You're not logged in" + +@app.route("/load-file-password", methods=["POST"]) +def load_file_password(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + if not validate_access_permissions(filename=request.form["filename"]): + try: + pyAesCrypt.decryptFile("users/"+json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"]), outfile="users/"+json_array[request.remote_addr]+"/decryption_tempfile.tmp", passw=hashlib.sha256(request.form["password"].encode("utf-8")).hexdigest(), bufferSize=131072) + except ValueError: + return "" + temp_file_reader_dec = open("users/"+json_array[request.remote_addr]+"/decryption_tempfile.tmp", "rb") + return send_file(temp_file_reader_dec, mimetype=str(mime.guess_type( + "users/"+json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"]))), as_attachment=True, download_name=secure_filename(request.form["filename"])) + else: + return "You're not allowed to access this file" + +@app.route("/thumbnail-load-file/") +def thumbnail_load_file(filename): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + username = json_array[request.remote_addr] + if not validate_access_permissions(filename=filename): + file_reader = open("users/"+username+"/" + + secure_filename(filename), "rb").read() + cbytes = compress_image( + file_reader, username=username, filename=filename) + try: + return_data = send_file( + cbytes, + mimetype=str(mime.guess_type( + "users/"+username+"/"+secure_filename(filename)))) + except: + return_data = send_file("asset/no_access.png", "image/png") + return return_data + else: + return "You aren't allowed to access this file", 403 + else: + return "You're not logged in" + + +@app.route("/delete-file/") +def delete_file(filename): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + username = json_array[request.remote_addr] + if not validate_access_permissions(filename=filename): + os.remove("users/"+username+"/"+secure_filename(filename)) + input_file_enced = open('users/'+username+"/enced_files") + json_array_enced = json.load(input_file_enced) + if filename in json_array_enced: + del json_array_enced[filename] + loggedin_users_writer = open( + 'users/'+username+"/enced_files", "w") + loggedin_users_writer.write(json.dumps(json_array_enced)) + loggedin_users_writer.close() + filename = str(secure_filename(filename)) + username = json_array[request.remote_addr] + user_shared_list = open('users/'+username+"/shared_files") + user_shared_list_parsed = json.load(user_shared_list) + try: + del user_shared_list_parsed[filename] + except: + pass + open('users/'+username+"/shared_files", "w").write(json.dumps(user_shared_list_parsed)) + return "" + else: + return "You aren't allowed to access this file", 403 + else: + return "You're not logged in" + + +@app.route("/rename-file//") +def rename_file(filename, new_file_name): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + username = json_array[request.remote_addr] + if not validate_access_permissions(filename=filename) and not validate_access_permissions(filename=new_file_name): + os.rename("users/"+username+"/"+secure_filename(filename), + "users/"+username+"/"+secure_filename(new_file_name)) + return "" + else: + return "You aren't allowed to access this file", 403 + else: + return "You're not logged in" + +@app.route("/mng-encryption-file-formular-handler", methods=["POST"]) +def mng_encryption_file_formular_handler(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + filename = request.form["filename"] + if not validate_access_permissions(filename=filename): + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + input_file_enc = open( + 'users/'+json_array[request.remote_addr]+"/enced_files") + json_array_enc = json.load(input_file_enc) + if request.form["filename"] in json_array_enc: + if json_array_enc[request.form["filename"]] == "1": + is_encrypted = True + else: + is_encrypted = False + else: + is_encrypted = False + if not is_encrypted: + input_file_enced = open( + "users/"+json_array[request.remote_addr]+'/enced_files') + json_array_enced = json.load(input_file_enced) + json_array_enced[request.form["filename"]] = "1" + json_array_json_enced = json.dumps(json_array_enced) + enced_file_writer = open( + "users/"+json_array[request.remote_addr]+'/enced_files', "w") + enced_file_writer.write(json_array_json_enced) + enced_file_writer.close() + password = hashlib.sha256( + request.form["password"].encode("utf-8")).hexdigest() + pyAesCrypt.encryptFile("users/"+json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"]), "users/" + + json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"])+".aes.tmp", passw=password, bufferSize=131072) + os.remove("users/"+json_array[request.remote_addr] + + "/"+secure_filename(request.form["filename"])) + os.rename("users/"+json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"]) + + ".aes.tmp", "users/"+json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"])) + return "" # * There is a + else: + password = hashlib.sha256( + request.form["password"].encode("utf-8")).hexdigest() + try: + pyAesCrypt.decryptFile("users/"+json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"]), "users/" + + json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"])+".aes.tmp", passw=password, bufferSize=131072) + except ValueError: + return "" # * There is a script + os.remove("users/"+json_array[request.remote_addr] + + "/"+secure_filename(request.form["filename"])) + os.rename("users/"+json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"]) + + ".aes.tmp", "users/"+json_array[request.remote_addr]+"/"+secure_filename(request.form["filename"])) + input_file_enced = open( + "users/"+json_array[request.remote_addr]+'/enced_files') + json_array_enced = json.load(input_file_enced) + del json_array_enced[request.form["filename"]] + enced_file_writer = open( + 'users/'+json_array[request.remote_addr]+"/enced_files", "w") + enced_file_writer.write(json.dumps(json_array_enced)) + enced_file_writer.close() + return "" # * There is a script + else: + return "You are not allowed to edit this file", 403 + +@app.route("/search/q/") +def search(query): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + username = json_array[request.remote_addr] + results = [] + for e in os.listdir("users/"+username+"/"): + if query in e: + results += [e] + html_code = "" + for r in results: + if not validate_access_permissions(r): + try: + mimet = r.split(".")[1] + except IndexError: + mimet = "mime_none.svg" + filetypel = { + # Images + "png": "Image file", + "jpg": "Image file", + "heic": "Image file", + "gif": "Image file", + "heif": "Image file", + "bmp": "Image file", + "ico": "Icon file", + # Text Document + "doc": "Word Document", + "docx": "Word Document", + "odt": "LibreOffice Writer Document", + "md": "Markdown", + "txt": "Plain Text", + # Presentation + "ppt": "PowerPoint Presentation", + "pptx": "PowerPoint Presentation", + "odp": "LibreOffice Impress Document", + "pptm": "PowerPoint Macro File", + # Spreadsheet + "xls": "Excel Spreadsheet", + "xlsx": "Excel Spreadsheet", + "ods": "LibreOffice Spreadsheet", + "csv": "CSV Table Text Document", + # PDF + "pdf": "PDF Document", + # Videos + "mp4": "Video", + "mov": "Video", + "avi": "Video", + "webm": "Video", + # Archive + "zip": "Archive", + "tar": "Archive", + "xz": "Archive", + "exe": "Archive / Windows Executable", + "iso": "Archive / Disk Image", + # Plain + "html": "HTML Code Document", + "js": "JavaScript Code Document", + "css": "CSS Code Document", + "py": "Python Code Document", + "pyw": "Python Code Document", + "c": "C Code Document", + "csharp": "C# Code Document", + "cpp": "C++ Code Document", + "sh": "Shell Code Document", + "bat": "Batch Code Document", + } + if not mimet in filetypel: + filetype = "mime_none.svg" + else: + filetype = filetypel[mimet] + filesize = str(os.stat("users/"+username+"/"+r).st_size) + filetype = str(os.stat("users/"+username+"/"+r).st_size) + filecday = str(dt.datetime.fromtimestamp(os.path.getctime("users/"+username+"/"+r)).strftime("%Y/%m/%d %H:%M")) + filemday = str(dt.datetime.fromtimestamp(os.path.getmtime("users/"+username+"/"+r)).strftime("%Y/%m/%d %H:%M")) + mime_icon_dict = { + # Images + "png": "mime_image.svg", + "jpg": "mime_image.svg", + "heic": "mime_image.svg", + "gif": "mime_image.svg", + "heif": "mime_image.svg", + "bmp": "mime_image.svg", + "ico": "mime_image.svg", + # Text Document + "doc": "mime_doc.svg", + "docx": "mime_doc.svg", + "odt": "mime_doc.svg", + "md": "mime_doc.svg", + "txt": "mime_doc.svg", + # Presentation + "ppt": "mime_presentation.svg", + "pptx": "mime_presentation.svg", + "odp": "mime_presentation.svg", + "pptm": "mime_presentation.svg", + # Spreadsheet + "xls": "mime_spreadsheet.svg", + "xlsx": "mime_spreadsheet.svg", + "ods": "mime_spreadsheet.svg", + "csv": "mime_spreadsheet.svg", + # PDF + "pdf": "mime_pdf.svg", + # Videos + "mp4": "mime_video.svg", + "mov": "mime_video.svg", + "avi": "mime_video.svg", + "webm": "mime_video.svg", + # Archive + "zip": "mime_archive.svg", + "tar": "mime_archive.svg", + "xz": "mime_archive.svg", + "exe": "mime_archive.svg", + "iso": "mime_archive.svg", + } + try: + mimet = r.split(".")[1] + except IndexError: + mimet = "mime_none.svg" + print(mimet) + if mimet in mime_icon_dict: + mime_icon = mime_icon_dict[mimet] + else: + mime_icon = "mime_none.svg" + html_code += "
"+r.replace("_", " ")+"
" + if html_code == "": + html_code = "
No results
" + return html_code + else: + return "You are not logged in" + +# * Lumos Chat + + +def remove_emojis(data): + emoji_smile_k_l = ["😀", "😁", "😃", "🙂", "☺", ":smile:"] + for emoji_smile_k in emoji_smile_k_l: + data = data.replace(emoji_smile_k, ":smile:") + emoj = re.compile("[" + u"\U00002700-\U000027BF" + u"\U0001F600-\U0001F64F" + u"\U00002600-\U000026FF" + u"\U0001F300-\U0001F5FF" + u"\U0001F900-\U0001F9FF" + u"\U0001FA70-\U0001FAFF" + u"\U0001F680-\U0001F6FF" + "]+", re.UNICODE) + return re.sub(emoj, '', data) + +@app.route("/chat/web") +def chat_web(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + users_dir_array = os.listdir("users/") + userlist_parsed_to_html = "" + for found_user in users_dir_array: + if found_user != json_array[request.remote_addr]: + userlist_parsed_to_html += "" + return render_template("chat_main.html", username = "").replace("[[ userlist ]]", userlist_parsed_to_html).replace("[[ messages ]]", "") + else: + return "You are not allowed to access this chat" + +@app.route("/chat/web/s", methods=["POST", "GET"]) +def chat_web_send(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.method == "POST": + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + reciver_name = secure_filename(request.form["username"]) + sender_name = decode_from_base64(json_array[request.remote_addr]) + reciver_log_file = "users/"+encode_as_base64(reciver_name)+"/chat_log_file_"+sender_name+".txt" + sender_log_file = "users/"+encode_as_base64(sender_name)+"/chat_log_file_"+reciver_name+".txt" + message = remove_emojis(request.form["message"].replace("&", "&")).replace("<", "<").replace(">", ">") + if os.path.exists(sender_log_file): + open(sender_log_file, "a").write("\ny:"+message) + else: + open(sender_log_file, "w").write("y:"+message) + if os.path.exists(reciver_log_file): + open(reciver_log_file, "a").write("\no:"+message) + else: + open(reciver_log_file, "w").write("o:"+message) + users_dir_array = os.listdir("users/") + userlist_parsed_to_html = "" + for found_user in users_dir_array: + if found_user != json_array[request.remote_addr]: + userlist_parsed_to_html += "" + msg_html = "" + if os.path.exists(sender_log_file): + message_array = open(sender_log_file).read().split("\n") + for message in message_array: + if message.startswith("y:"): + msg_html += "
"+message.removeprefix("y:")+"

" + if message.startswith("o:"): + msg_html += "
"+message.removeprefix("o:")+"

" + if request.files["file-upload"] != "": + fileformchat = request.files["file-upload"] + filecontents = fileformchat.read() + if not os.path.exists("users/"+encode_as_base64(secure_filename(reciver_name))+"/chat_inbox"): + os.mkdir("users/"+encode_as_base64(secure_filename(reciver_name))+"/chat_inbox") + if open("virus_scanner.cfg", "r").read() == "1": + if not hashlib.md5(filecontents).hexdigest() in open("hashes_main.txt", "r").read().split("\n") and not validate_access_permissions(filename=request.form["filename"]): + open("users/"+encode_as_base64(reciver_name)+"/chat_inbox/by_"+secure_filename(sender_name)+"_"+secure_filename(request.form["file-name"])) + else: + if not validate_access_permissions(filename=request.form["filename"]): + open("users/"+encode_as_base64(reciver_name)+"/chat_inbox/by_"+secure_filename(sender_name)+"_"+secure_filename(request.form["filename"]), "wb").write(filecontents) + return "'" + else: + return "You are not allowed to access this chat" + else: + return "'" + + +@app.route("/chat/web/l", methods=["GET", "POST"]) +def chat_web_load(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.method == "POST": + reciver_name = secure_filename(request.form["username"]) + sender_name = decode_from_base64(json_array[request.remote_addr]) + sender_log_file = "users/"+encode_as_base64(sender_name)+"/chat_log_file_"+reciver_name+".txt" + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + users_dir_array = os.listdir("users/") + userlist_parsed_to_html = "" + for found_user in users_dir_array: + if found_user != json_array[request.remote_addr]: + userlist_parsed_to_html += "" + msg_html = "" + if os.path.exists(sender_log_file): + message_array = open(sender_log_file).read().split("\n") + for message in message_array: + if message.startswith("y:"): + msg_html += "
"+message.removeprefix("y:")+"

" + if message.startswith("o:"): + msg_html += "
"+message.removeprefix("o:")+"

" + else: + msg_html = "" + return render_template("chat_main.html", username = reciver_name).replace("[[ userlist ]]", userlist_parsed_to_html).replace("[[ messages ]]", msg_html) + else: + return "You are not allowed to access this chat" + else: + users_dir_array = os.listdir("users/") + userlist_parsed_to_html = "" + for found_user in users_dir_array: + if found_user != json_array[request.remote_addr]: + userlist_parsed_to_html += "" + return render_template("chat_main.html", username = "").replace("[[ userlist ]]", userlist_parsed_to_html).replace("[[ messages ]]", "") + +@app.route("/chat/web/fb") +def filebox(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + filelist_html = "" + if os.path.exists("users/"+json_array[request.remote_addr]+"/chat_inbox"): + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + for file in os.listdir("users/"+json_array[request.remote_addr]+"/chat_inbox"): + filelist_html += "
"+file.split("_")[1]+" "+file.split("_")[2]+"

" + else: + filelist_html = "Your filebox is empty" + return render_template("filebox.html").replace("[[ filelist ]]", filelist_html) + +@app.route("/chat/web/fb/l/") +def filebox_load(filename): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + return send_file( + "users/"+json_array[request.remote_addr]+"/chat_inbox/"+secure_filename(filename), + mimetype=str(mime.guess_type("users/"+json_array[request.remote_addr]+"/chat_inbox/"+secure_filename(filename))) + ) + else: + return "You're not allowed to access this location" + +# * Lumos Admin + +@app.route("/admin/update") +def admin_update(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + return render_template("admin/update.html") + else: + return "You are not allowed to access this site", 403 + +@app.route("/admin/system") +def admin_system(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + return render_template("admin/system.html") + else: + return "You are not allowed to access this site", 403 + +@app.route("/admin/vrscnr") +def admin_vrscnr(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + if open("virus_scanner.cfg", "r").read() == "0": + enabled = "false" + else: + enabled = "true" + return render_template("admin/virusscanner.html", virus_scanner_enabled=enabled) + else: + return "You are not allowed to access this site", 403 + +@app.route("/admin_virus_definitions", methods=["POST"]) +def upload_virus_definitions(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + main_file = request.files["main_upload"] + daily_file = request.files["daily_upload"] + main_file.save("main.cvd") + daily_file.save("daily.cvd") + if open("virus_scanner.cfg").read() == "1" and os.path.exists("main.cvd") and os.path.exists("daily.cvd"): + print("Updating virus definitions from local files\nPlease wait...") + t1 = threading.Thread(gethashes.get_hashes_names("main")) + t2 = threading.Thread(gethashes.get_hashes_names("daily")) + t1.start() + t2.start() + print("Virus Update Done") + return render_template("admin/upload_done.html") + else: + return "You are not allowed to access this site", 403 + +@app.route("/admin_virus_protection_settings", methods=["POST"]) +def apply_settings_av(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + if len(request.form) == 1: + open("virus_scanner.cfg", "w").write("1") + if os.path.exists("main.cvd") and os.path.exists("daily.cvd"): + return "" + else: + return "" + else: + open("virus_scanner.cfg", "w").write("0") + return "" + else: + return "You are not allowed to access this site", 403 + +@app.route("/admin/binary-block", methods=["POST"]) +def binaryblock(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + if "binary-block" in request.form: + if request.form["binary-block"] == "on": + open("no_binary.cfg", "w").write("1") + else: + open("no_binary.cfg", "w").write("0") + return "" + else: + return "You are not allowed to access this site", 403 + +@app.route("/admin/rmuser/") +def remover_user(username): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + if platform.system() == "Windows": + os.system("rmdir /q /s \"users/"+encode_as_base64(secure_filename(username))+"\"") + print("rmdir /q /s users/"+encode_as_base64(secure_filename(username))) + elif platform.system() == "Linux": + os.system("rm -r -f -d users/"+encode_as_base64(secure_filename(username))) + return "" + else: + return "You are not allowed to access this site", 403 + +@app.route("/admin/ciconupload", methods=["POST"]) +def ciupload(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + request.files["icon_upload"].save("asset/company_icon.png") + return "" + +@app.route("/admin/themechange/") +def theme_change(theme): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if os.path.exists("users/"+json_array[request.remote_addr]+"/is_admin"): + if os.path.exists("asset/themes/"+theme+".css"): + open("theme.cfg", "w").write(theme) + open("asset/themeoverride.css", "w").write(open("asset/themes/"+open("theme.cfg", "r").read()+".css").read()) + return "" + else: + return "doesnotexist" + + +@app.route("/favicon.ico") +def favicon(): + return send_file("asset/logo.png") + +@app.route("/info") +def info(): + return render_template("info.html", version=version, login_subtitle=login_subtitle) + +@app.route("/info/p") +def info_privacy(): + return render_template("privacy.html") + +@app.route("/rawedit/") +def rawedit(filename): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + try: + username = json_array[request.remote_addr] + load_filename = "users/"+username+"/"+secure_filename(filename) + file_content = open(load_filename, "r").read() + return render_template("rawedit.html", filename = filename).replace("[[ file_content ]]", file_content) + except UnicodeDecodeError: + return "" + else: + return "", 403 + +@app.route("/rawedits", methods=["POST"]) +def rawedit_s(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + filename = secure_filename(request.form["filename"]) + username = json_array[request.remote_addr] + open("users/"+json_array[request.remote_addr]+"/"+secure_filename(filename), "w").write(request.form["file_content"]) + load_filename = "users/"+username+"/"+secure_filename(filename) + file_content = open(load_filename, "r").read() + return render_template("rawedit.html", filename = filename).replace("[[ file_content ]]", file_content) + else: + return "" + +@app.route("/security_advisor") +def security_advisor(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + return render_template("security_advisor.html") + else: + return "You are not allowed to access this page", 403 + +@app.route("/security_advisor/start", methods=["POST"]) +def security_advisor_start(): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array and request.cookies["ckey"] == open("users/"+json_array[request.remote_addr]+"/ckey.cfg").read(): + password = request.form["password"] + p_score = 0 + if len(password) < 5: + p_score = 1 + elif len(password) < 10: + p_score = 40 + elif len(password) < 15: + p_score = 70 + elif len(password) < 20: + p_score = 100 + elif len(password) < 30: + p_score = 120 + else: + p_score = 180 + scs = 0 + special_chars = ["!", "\"", "§", "$", "%", "&", "/", "(", ")", "=", "?", "+", "*", "#", "'", "-", ".", ":", ",", ";", "[", "]", "{", "}", "\\", "^", "°", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"] + for c in password: + if c in special_chars: + scs = scs+1 + p_score = p_score - (10 - scs) + p_score = p_score / 2 + if p_score > 100: + p_score = 100 + if p_score < 20: + p_score = 20 + p_score = p_score * 4 + p_score = str(p_score)+"px" + user_encrypted_files = json.load(open("users/"+json_array[request.remote_addr]+"/enced_files")) + m_f_list_html = "" + for file in os.listdir("users/"+json_array[request.remote_addr]): + if not file in user_encrypted_files: + try: + if file.split(".")[1] in ["doc", "docx", "rtf", "pdf", "odt", "xls", "xlsx", "csv", "ods", "ppt", "pptx", "odp"]: + m_f_list_html += "
"+file+"
" + except IndexError: + pass + return render_template("security_advisor_overview.html", p_score = p_score).replace("[[ m_f_list_html ]]", m_f_list_html) + else: + return "You are not allowed to access this page", 403 + +@app.route("/share/link///") +def share_link(username, filename, code): + username = decode_from_base64(str(username)) + user_shared_list = open('users/'+encode_as_base64(secure_filename(username))+"/shared_files") + user_shared_list_parsed = json.load(user_shared_list) + if secure_filename(filename) in user_shared_list_parsed and user_shared_list_parsed[secure_filename(filename)] == code and not validate_access_permissions(filename): + return send_file( + "users/"+encode_as_base64(secure_filename(username))+"/"+secure_filename(filename), + mimetype=secure_filename(filename), + as_attachment=True, + download_name=filename + ) + else: + return render_template("share_wrong_code.html") + +@app.route("/share/info/") +def share_info(filename): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array: + username = json_array[request.remote_addr] + user_shared_list = open('users/'+username+"/shared_files") + user_shared_list_parsed = json.load(user_shared_list) + filename = decode_from_base64(str(filename)) + if filename in user_shared_list_parsed: + return "shared" + else: + return "not_shared" + else: + return "This part of the API is locked down for you" + +@app.route("/share/reglink/") +def share_reglink(filename): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array: + filename = secure_filename(decode_from_base64(str(filename))) + username = json_array[request.remote_addr] + user_shared_list = open('users/'+username+"/shared_files") + user_shared_list_parsed = json.load(user_shared_list) + share_code = str(hashlib.sha256(str(random.randint(1,1000000)).encode("utf-8")).hexdigest()) + user_shared_list_parsed[filename] = share_code + open('users/'+username+"/shared_files", "w").write(json.dumps(user_shared_list_parsed)) + return "/share/link/"+username+"/"+filename+"/"+share_code + else: + return "This part of the API is locked down for you" + +@app.route("/share/unreg/") +def share_unreg(filename): + login_user_input_file = open('loggedin_users') + json_array = json.load(login_user_input_file) + if request.remote_addr in json_array: + filename = secure_filename(decode_from_base64(str(filename))) + username = json_array[request.remote_addr] + user_shared_list = open('users/'+username+"/shared_files") + user_shared_list_parsed = json.load(user_shared_list) + del user_shared_list_parsed[filename] + open('users/'+username+"/shared_files", "w").write(json.dumps(user_shared_list_parsed)) + return "done" + else: + return "This part of the API is locked down for you" + + +app.run("0.0.0.0", 5000, ssl_context="adhoc") \ No newline at end of file diff --git a/libs/__pycache__/__main__.cpython-311.pyc b/libs/__pycache__/__main__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3823a6711601b6f1a0014e82fddecccc4eadc9f GIT binary patch literal 83431 zcmeFa2~=EJb|4rlL_k0U5D-AH1p7{aB($&!u_G2qNJ1hdp&)($!4~L8AOs4Oa@lTE zHE9=Bm3C2ORTop8$|7CLw$feMt#((A<*H0Or|p{gpZOZ%L?7Dfn$ek)Gww5yo#}R( zS?_&6mj7ds$hE7_@h7-%`EP&kzxVF)?)!04Qi24YzxlIwsUQ9y63PF9j=-b#TR!rn zNF?8tP?9kTC8cC@(lIG9Wn*$;D#jGVRE{aZl+VS@$B)HJF|1-vHLo61&nJu}%qNZ| z&TGar#9ua-G?oPKm2=7S+A*!)PdBC`>7OWR*2DiHTctRa=ehi)FaDG{R6Q?E z@jHJGB?rsFRueUL=>cO`M~Qu)5l@xH826=A*!Mx|b67muq>=@xT0&L8EOmsc1lR!m zptc>Qs;KG*HLuHIW`%$L89Qb>Hgi1SqH2FjB2H`UgzeZ?W8l5eq|D;lQFRefL+`&{*lxWzRr!c+u9G5 z&nXCZ@O+BJwK+%*R1QDm(>m%Xb!Mb;>CaQT#`k+O;wo|PUeb5s#g*K|0IyohaNTWR>joz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d>OMrU?pc>eR_1H6l;CQa0lj!L?l<8yVsq|RsR?o7BBCKxS0_?&1iy%}BA zIrtKgCmS!`kC{MShA*z={1&W3d%80x%3>1^l0ODu6PwiYr5A`v3h=XuLoNZd$)#tu z;gTv~?lZ?&2fhmnuKOI?1ZhhE literal 0 HcmV?d00001 diff --git a/libs/__pycache__/gethashes.cpython-311.pyc b/libs/__pycache__/gethashes.cpython-311.pyc index c437cfb1b3041d3607c4010a14b1936fb30c4358..b3e5129334a0ebfe0510fe66024690d872682c35 100644 GIT binary patch delta 36 rcmdm|dqsD`GD(AEtC-N@)S}{;vizLvRK3KQsQ8@x= 0 - end_data.append(bin_data[i]) # Changed += to append() - i += 1 - set_proccessbar(bar, 2) - open("clamav.tar.tmp", "wb").write(gzip.decompress(end_data)) - set_proccessbar(bar, 3) - tarfile_dat = tarfile.open("clamav.tar.tmp", "r") - tarfile_dat.extractall(".\\clamavdb\\") - tarfile_dat.close() - set_proccessbar(bar, 4) - if file == "main": - lines = open("clamavdb/main.hdb", "r").read().split("\n") - else: - lines = open("clamavdb/daily.hdb", "r").read().split("\n") - set_proccessbar(bar, 5) - hashes_hdb = [] - hashes_hdb_name = [] - i = 0 - for line in lines: - split_line = line.split(":") - if len(split_line) > 1: - hashes_hdb.append(split_line[0]) - hashes_hdb_name.append(split_line[2]) - set_proccessbar(bar, 6) - if file == "main": - lines = open("clamavdb/main.hsb", "r").read().split("\n") - else: - lines = open("clamavdb/daily.hdb", "r").read().split("\n") - hashes_hsb = [] - hashes_hsb_name = [] - set_proccessbar(bar, 7) - i = 0 - for line in lines: - split_line = line.split(":") - if len(split_line) > 1: - hashes_hsb.append(split_line[0]) - hashes_hsb_name.append(split_line[2]) - set_proccessbar(bar, 8) - hashes_final = [] - hashes_final.extend(hashes_hdb) - hashes_final.extend(hashes_hsb) - names_final = [] - names_final.extend(hashes_hdb_name) - names_final.extend(hashes_hsb_name) - set_proccessbar(bar, 9) - hashes_main_writer = open("hashes_main.txt", "a") - for hash in hashes_final: - hashes_main_writer.write(hash+"\n") - hashes_main_writer.close() - names_main_writer = open("names_main.txt", "a") - for name in names_final: - names_main_writer.write(name+"\n") - names_main_writer.close() - os.remove(os.getcwd()+"/clamav.tar.tmp") - if platform.system == "Windows": - os.system("rmdir /s "+os.getcwd()+"\clamavdb /q") - elif platform.system == "Linux": - os.system("rm -r -f -d "+os.getcwd()+"\clamavdb") - open("last_virus_update.txt", "w").write(time.strftime("%Y-%m-%d @ %H:%M")) +import gzip +import tarfile +import os +import platform +import time + +def init_processbar(name): +# print(name+" 0% ") +# return name + pass + +def set_proccessbar(name, value): +# time.sleep(0.1) +# if platform.system == "Windows": +# os.system("cls") +# elif platform.system == "Linux": +# os.system("clear") +# strc = "" +# for i in range(value): +# strc += "▮" +# print(name+" "+str(value * 10)+"% "+strc) + pass + +def get_hashes_names(file): + bar = init_processbar("Virus Scanner") + if file == "main": + bin_data = open("main.cvd", "rb").read() + elif file == "daily": + bin_data = open("daily.cvd", "rb").read() + else: + print("This file can't be parsed") + exit() + i = 0 + bin_data_clean = bytes() + end_data = bytearray() # Changed from bytes() to bytearray() + val = bin_data[i] + set_proccessbar(bar, 1) + while val != 139 and bin_data[i + 1] != 8 and bin_data[i + 2] != 0: + i += 1 + val = bin_data[i] + i -= 1 + while i != len(bin_data): # Changed the condition from val != None to i >= 0 + end_data.append(bin_data[i]) # Changed += to append() + i += 1 + set_proccessbar(bar, 2) + open("clamav.tar.tmp", "wb").write(gzip.decompress(end_data)) + set_proccessbar(bar, 3) + tarfile_dat = tarfile.open("clamav.tar.tmp", "r") + tarfile_dat.extractall(".\\clamavdb\\") + tarfile_dat.close() + set_proccessbar(bar, 4) + if file == "main": + lines = open("clamavdb/main.hdb", "r").read().split("\n") + else: + lines = open("clamavdb/daily.hdb", "r").read().split("\n") + set_proccessbar(bar, 5) + hashes_hdb = [] + hashes_hdb_name = [] + i = 0 + for line in lines: + split_line = line.split(":") + if len(split_line) > 1: + hashes_hdb.append(split_line[0]) + hashes_hdb_name.append(split_line[2]) + set_proccessbar(bar, 6) + if file == "main": + lines = open("clamavdb/main.hsb", "r").read().split("\n") + else: + lines = open("clamavdb/daily.hdb", "r").read().split("\n") + hashes_hsb = [] + hashes_hsb_name = [] + set_proccessbar(bar, 7) + i = 0 + for line in lines: + split_line = line.split(":") + if len(split_line) > 1: + hashes_hsb.append(split_line[0]) + hashes_hsb_name.append(split_line[2]) + set_proccessbar(bar, 8) + hashes_final = [] + hashes_final.extend(hashes_hdb) + hashes_final.extend(hashes_hsb) + names_final = [] + names_final.extend(hashes_hdb_name) + names_final.extend(hashes_hsb_name) + set_proccessbar(bar, 9) + hashes_main_writer = open("hashes_main.txt", "a") + for hash in hashes_final: + hashes_main_writer.write(hash+"\n") + hashes_main_writer.close() + names_main_writer = open("names_main.txt", "a") + for name in names_final: + names_main_writer.write(name+"\n") + names_main_writer.close() + os.remove(os.getcwd()+"/clamav.tar.tmp") + if platform.system == "Windows": + os.system("rmdir /s "+os.getcwd()+"\clamavdb /q") + elif platform.system == "Linux": + os.system("rm -r -f -d "+os.getcwd()+"\clamavdb") + open("last_virus_update.txt", "w").write(time.strftime("%Y-%m-%d @ %H:%M")) set_proccessbar(bar, 10) \ No newline at end of file diff --git a/run.py b/run.py new file mode 100644 index 0000000..f1bde9a --- /dev/null +++ b/run.py @@ -0,0 +1,13 @@ +import ssl +import os +import subprocess +from gevent.pywsgi import WSGIServer +from libs.__main__ import app + +if os.path.exists("private_key.pem") and os.path.exists("certificate.pem"): + print("Certificate found") +else: + print("Please upload a certificate and key file in the main folder. Names: private_key.pem, certificate.pem") + +http_server = WSGIServer(('0.0.0.0', 5000), app, keyfile='private_key.pem', certfile='certificate.pem', ssl_version=ssl.PROTOCOL_TLS) +http_server.serve_forever() \ No newline at end of file