From a8a15cae64a9d3b64aa1a11294b0fc96ec4170a8 Mon Sep 17 00:00:00 2001 From: Tracker-Friendly Date: Fri, 3 Nov 2023 20:24:40 +0000 Subject: [PATCH] We are soo back! --- README.md | 10 ++++--- config.ini | 6 ++--- main | 6 +---- static/css/style.css | 25 +++++++++++++----- static/js/login.js | 28 ++++++++++---------- static/js/main.js | 59 +++++++++++++++--------------------------- static/js/signup.js | 22 ++++++++-------- templates/app.html | 44 ++++++++++--------------------- templates/down.html | 8 +++--- templates/error.html | 6 ++--- templates/login.html | 16 +++++------- templates/logout.html | 4 +-- templates/main.html | 28 ++++++++++---------- templates/privacy.html | 24 ++++++++--------- templates/signup.html | 19 +++++--------- 15 files changed, 134 insertions(+), 171 deletions(-) diff --git a/README.md b/README.md index bc0b604..3232683 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ -## burgernotes -burgernotes is a simple note-taking app with end-to-end encryption +## PageBurger +PageBurger is a simple note-taking app with end-to-end encryption. + +PageBurger is a community fork of the discontinued [BurgerNotes](https://codeberg.org/burger-software/burgernotes). Most of the credits go to BurgerSoftware. ### links -[go to the burgernotes website](https://notes.ctaposter.xyz/) +[Go to the PageBurger website](https://notes.hectabit.org) -[API documentation](APIDOCS.md) \ No newline at end of file +[API documentation](APIDOCS.md) diff --git a/config.ini b/config.ini index 7d420cd..76fae6a 100644 --- a/config.ini +++ b/config.ini @@ -1,5 +1,5 @@ [config] HOST = 0.0.0.0 -PORT = 8080 -SECRET_KEY = placeholder -MAX_STORAGE = 25000000 \ No newline at end of file +PORT = 8070 +SECRET_KEY = oligogoaihegokjdugielaguilUGLAGULUGELGouegalfgusl +MAX_STORAGE = 25000000 diff --git a/main b/main index 6cd2096..009953e 100644 --- a/main +++ b/main @@ -118,10 +118,6 @@ def login(): def privacy(): return render_template("privacy.html") -@app.route("/shutdownfaq") -def shutdown(): - return send_from_directory("templates", "shutdown.html") - # API @app.route("/api/signup", methods=("GET", "POST")) def apisignup(): @@ -475,4 +471,4 @@ def burger(e): if __name__ == "__main__": print("[INFO] Server started") serve(app, host=HOST, port=PORT) - print("[INFO] Server stopped") \ No newline at end of file + print("[INFO] Server stopped") diff --git a/static/css/style.css b/static/css/style.css index 714a526..a4c0f2a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1,6 +1,7 @@ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap"); :root { + --invertdm: 0%; --bar: #f4f4f4; --editor: #ffffff; --text-color: #000000; @@ -21,6 +22,7 @@ @media (prefers-color-scheme: dark) { :root { + --invertdm: 100%; --bar: #2d2f31; --editor: #202124; --text-color: #ffffff; @@ -65,11 +67,6 @@ filter: invert(100%) !important } - .feature h3, - p { - color: black !important; - } - .links a { color: white !important; } @@ -89,6 +86,7 @@ } p, +li, h1, h2, h3, @@ -98,6 +96,15 @@ h6 { color: var(--text-color); } +h7 { + display: block; + font-size: 20px; + margin-top: 0.67em; + margin-bottom: 0.67em; + margin-left: 0; + margin-right: 0; +} + body { margin: 0; background-color: var(--editor); @@ -143,6 +150,7 @@ body { } .bottomBar .removeButton { + filter: invert(var(--invertdm)); padding-left: 17.5px; padding-right: 17.5px; transform: translateY(-5px); @@ -343,6 +351,7 @@ body { .optionsDiv button { width: 100%; padding: 10px; + padding-bottom: 13px; margin-right: 5px; margin-bottom: 7px; padding-left: 15px; @@ -429,7 +438,8 @@ body { .optionsDiv img { height: 18px; padding-right: 5px; - filter: invert(var(--invert)) + filter: invert(var(--invert)); + transform: translateY(3.25px); } .optionsDiv .section { @@ -604,6 +614,7 @@ body { padding-top: 15px; padding-bottom: 15px; font-size: 17px; + padding-bottom: 30px; } .mainDiv .green { @@ -633,4 +644,4 @@ body { .links a:hover { text-decoration: dashed; -} \ No newline at end of file +} diff --git a/static/js/login.js b/static/js/login.js index a25704d..412c5b2 100644 --- a/static/js/login.js +++ b/static/js/login.js @@ -1,11 +1,11 @@ if (localStorage.getItem("DONOTSHARE-secretkey") !== null) { window.location.replace("/app") - document.body.innerHTML = "Redirecting.." + document.body.innerHTML = "Redirecting..." throw new Error(); } if (localStorage.getItem("DONOTSHARE-password") !== null) { window.location.replace("/app") - document.body.innerHTML = "Redirecting.." + document.body.innerHTML = "Redirecting..." throw new Error(); } @@ -17,7 +17,7 @@ let inputNameBox = document.getElementById("inputNameBox") let backButton = document.getElementById("backButton") usernameBox.classList.remove("hidden") -inputNameBox.innerText = "username:" +inputNameBox.innerText = "Username:" let currentInputType = 0 @@ -26,14 +26,14 @@ function showInput(inputType) { usernameBox.classList.remove("hidden") passwordBox.classList.add("hidden") backButton.classList.add("hidden") - inputNameBox.innerText = "username:" - statusBox.innerText = "log in to your burgernotes account!" + inputNameBox.innerText = "Username:" + statusBox.innerText = "Login to your PageBurger account!" currentInputType = 0 } else if (inputType == 1) { usernameBox.classList.add("hidden") passwordBox.classList.remove("hidden") backButton.classList.remove("hidden") - inputNameBox.innerText = "password:" + inputNameBox.innerText = "Password:" currentInputType = 1 } else if (inputType == 2) { usernameBox.classList.add("hidden") @@ -41,7 +41,7 @@ function showInput(inputType) { signupButton.classList.add("hidden") backButton.classList.add("hidden") inputNameBox.classList.add("hidden") - inputNameBox.innerText = "password:" + inputNameBox.innerText = "Password:" currentInputType = 2 } } @@ -68,10 +68,10 @@ function showElements(yesorno) { signupButton.addEventListener("click", (event) => { if (passwordBox.classList.contains("hidden")) { if (usernameBox.value == "") { - statusBox.innerText = "username required" + statusBox.innerText = "A username is required!" return } else { - statusBox.innerText = "welcome back, " + usernameBox.value + "!" + statusBox.innerText = "Welcome back, " + usernameBox.value + "!" } showInput(1) } else { @@ -80,13 +80,13 @@ signupButton.addEventListener("click", (event) => { let password = passwordBox.value if (password == "") { - statusBox.innerText = "password required" + statusBox.innerText = "A password is required!" return } showInput(2) showElements(true) - statusBox.innerText = "signing in.." + statusBox.innerText = "Signing in..." async function hashpass(pass) { const key = await hashwasm.argon2id({ @@ -122,12 +122,12 @@ signupButton.addEventListener("click", (event) => { window.location.href = "/app" } else if (response.status == 401) { - statusBox.innerText = "wrong username or password :(" + statusBox.innerText = "Wrong username or password..." showInput(1) showElements(true) } else { - statusBox.innerText = "something went wrong! (error code: " + response.status + ")" + statusBox.innerText = "Something went wrong! (error code: " + response.status + ")" showInput(1) showElements(true) } @@ -143,4 +143,4 @@ backButton.addEventListener("click", (event) => { showInput(0) }); -showInput(0) \ No newline at end of file +showInput(0) diff --git a/static/js/main.js b/static/js/main.js index c0ade6d..4117e17 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1,11 +1,11 @@ if (localStorage.getItem("DONOTSHARE-secretkey") === null) { window.location.replace("/login") - document.body.innerHTML = "Redirecting.." + document.body.innerHTML = "Redirecting..." throw new Error(); } if (localStorage.getItem("DONOTSHARE-password") === null) { window.location.replace("/login") - document.body.innerHTML = "Redirecting.." + document.body.innerHTML = "Redirecting..." throw new Error(); } @@ -36,17 +36,14 @@ let cancelErrorButton = document.getElementById("cancelErrorButton") let errorInput = document.getElementById("errorInput") let exitThing = document.getElementById("exitThing") let exitSessionsThing = document.getElementById("exitSessionsThing") -let exitMfaThing = document.getElementById("exitMfaThing") let sessionManagerButton = document.getElementById("sessionManagerButton") let sessionManagerDiv = document.getElementById("sessionManagerDiv") let sessionDiv = document.getElementById("sessionDiv") let mfaDiv = document.getElementById("mfaDiv") -let mfaCheckbox = document.getElementById("mfaCheckbox") let deleteMyAccountButton = document.getElementById("deleteMyAccountButton") let storageThing = document.getElementById("storageThing") let storageProgressThing = document.getElementById("storageProgressThing") let usernameThing = document.getElementById("usernameThing") -let passwordThing = document.getElementById("passwordThing") let logOutButton = document.getElementById("logOutButton") let notesBar = document.getElementById("notesBar") let notesDiv = document.getElementById("notesDiv") @@ -213,7 +210,7 @@ function updateUserInfo() { .then((response) => { async function doStuff() { if (response.status == 500) { - displayError("Something went wrong. Signing you out..") + displayError("Something went wrong! Signing you out..") closeErrorButton.classList.add("hidden") usernameBox.innerText = "" setTimeout(function () { @@ -222,9 +219,8 @@ function updateUserInfo() { } else { let responseData = await response.json() usernameBox.innerText = responseData["username"] - usernameThing.innerText = "username: " + responseData["username"] - passwordThing.innerText = "password: *************" - storageThing.innerText = "you've used " + formatBytes(responseData["storageused"]) + " out of " + formatBytes(responseData["storagemax"]) + usernameThing.innerText = "Username: " + responseData["username"] + storageThing.innerText = "You've used " + formatBytes(responseData["storageused"]) + " out of " + formatBytes(responseData["storagemax"]) storageProgressThing.value = responseData["storageused"] storageProgressThing.max = responseData["storagemax"] noteCount = responseData["notecount"] @@ -247,7 +243,7 @@ exitThing.addEventListener("click", (event) => { optionsCoverDiv.classList.add("hidden") }); deleteMyAccountButton.addEventListener("click", (event) => { - if (confirm("are you REALLY sure that you want to delete your account? there's no going back.") == true) { + if (confirm("Are you REALLY sure that you want to delete your account? There's no going back!") == true) { fetch("/api/deleteaccount", { method: "POST", body: JSON.stringify({ @@ -262,7 +258,7 @@ deleteMyAccountButton.addEventListener("click", (event) => { if (response.status == 200) { window.location.href = "/api/logout" } else { - displayError("failed to delete account (HTTP error code " + response.status + ")") + displayError("Failed to delete account (HTTP error code " + response.status + ")") } }) } @@ -346,17 +342,6 @@ exitSessionsThing.addEventListener("click", (event) => { optionsDiv.classList.remove("hidden") sessionManagerDiv.classList.add("hidden") }); -mfaCheckbox.addEventListener("change", (event) => { - if (mfaCheckbox.checked === true) { - mfaCheckbox.checked = false - optionsDiv.classList.add("hidden") - mfaDiv.classList.remove("hidden") - } -}) -exitMfaThing.addEventListener("click", (event) => { - optionsDiv.classList.remove("hidden") - mfaDiv.classList.add("hidden") -}); updateUserInfo() @@ -387,13 +372,13 @@ function selectNote(nameithink) { noteBox.readOnly = true noteBox.value = "" noteBox.placeholder = "" - displayError("something went wrong, please try again later") + displayError("Something went wrong... Please try again later!") }) .then((response) => response) .then((response) => { selectedNote = nameithink noteBox.readOnly = false - noteBox.placeholder = "type something.." + noteBox.placeholder = "Type something!" async function doStuff() { let responseData = await response.json() @@ -425,11 +410,11 @@ function selectNote(nameithink) { .then((response) => response) .then((response) => { if (response.status == 418) { - displayError("you've ran out of storage :3 changes will not be saved until you free up storage!!! owo") + displayError("You've ran out of storage... Changes will not be saved until you free up storage!") } }) .catch((error) => { - displayError("failed to save changes, please try again later") + displayError("Failed to save changes, please try again later...") }) } }, waitTime); @@ -489,7 +474,7 @@ function updateNotes() { updateNotes() }) .catch((error) => { - displayError("something went wrong! please try again later") + displayError("Something went wrong! Please try again later...") }) } else { selectNote(responseData[i]["id"]) @@ -505,7 +490,7 @@ function updateNotes() { updateNotes() newNote.addEventListener("click", (event) => { - let noteName = displayPrompt("note name? :3", "e.g. shopping list", burgerFunction) + let noteName = displayPrompt("Note name?", "E.G Shopping list", burgerFunction) function burgerFunction(noteName) { if (noteName != null) { let encryptedName = CryptoJS.AES.encrypt(noteName, password).toString(); @@ -520,12 +505,12 @@ newNote.addEventListener("click", (event) => { } }) .catch((error) => { - displayError("failed to create new note, please try again later") + displayError("Failed to create new note, please try again later...") }) .then((response) => { if (response.status !== 200) { updateNotes() - displayError("failed to create new note (HTTP error code " + response.status + ")") + displayError("Failed to create new note (HTTP error code " + response.status + ")") } else { updateNotes() } @@ -559,7 +544,7 @@ function exportNotes() { async function doStuff() { let responseData = await response.json() for (let i in responseData) { - exportNotes.innerText = "decrypting " + i + "/" + noteCount + exportNotes.innerText = "Decrypting " + i + "/" + noteCount let bytes = CryptoJS.AES.decrypt(responseData[i]["title"], password); let originalTitle = bytes.toString(CryptoJS.enc.Utf8); @@ -573,10 +558,10 @@ function exportNotes() { } let jsonString = JSON.parse(JSON.stringify(responseData)) - exportNotesButton.innerText = "export notes" + exportNotesButton.innerText = "Export notes" downloadObjectAsJson(jsonString, "data") optionsDiv.classList.add("hidden") - displayError("exported notes!") + displayError("Exported notes!") } doStuff() @@ -584,13 +569,13 @@ function exportNotes() { } exportNotesButton.addEventListener("click", (event) => { - exportNotesButton.innerText = "downloading.." + exportNotesButton.innerText = "Downloading..." exportNotes() }); removeBox.addEventListener("click", (event) => { if (selectedNote == 0) { - displayError("you need to select a note first!") + displayError("You need to select a note first!") } else { fetch("/api/removenote", { method: "POST", @@ -607,9 +592,7 @@ removeBox.addEventListener("click", (event) => { updateNotes() }) .catch((error) => { - displayError("something went wrong! please try again later") + displayError("Something went wrong! Please try again later...") }) } }); - -displayError("Burgernotes is shutting down on November 12th, please refer to this FAQ for more info.") \ No newline at end of file diff --git a/static/js/signup.js b/static/js/signup.js index 7bbcab5..7f0049e 100644 --- a/static/js/signup.js +++ b/static/js/signup.js @@ -1,11 +1,11 @@ if (localStorage.getItem("DONOTSHARE-secretkey") !== null) { window.location.replace("/app") - document.body.innerHTML = "Redirecting.." + document.body.innerHTML = "Redirecting..." throw new Error(); } if (localStorage.getItem("DONOTSHARE-password") !== null) { window.location.replace("/app") - document.body.innerHTML = "Redirecting.." + document.body.innerHTML = "Redirecting..." throw new Error(); } @@ -33,24 +33,24 @@ signupButton.addEventListener("click", (event) => { let password = passwordBox.value if (username == "") { - statusBox.innerText = "username required" + statusBox.innerText = "A username is required!" return } if ((username).length > 20) { - statusBox.innerText = "username cannot be more than 20 characters" + statusBox.innerText = "Username cannot be more than 20 characters!" return } if (password == "") { - statusBox.innerText = "password required" + statusBox.innerText = "A password is required!" return } - if ((password).length < 14) { - statusBox.innerText = "14 characters required" + if ((password).length < 8) { + statusBox.innerText = "8 or more characters are required!" return } showElements(false) - statusBox.innerText = "creating account, please hold on.." + statusBox.innerText = "Creating account, please hold on..." async function hashpass(pass) { const key = await hashwasm.argon2id({ @@ -88,11 +88,11 @@ signupButton.addEventListener("click", (event) => { window.location.href = "/app" } else if (response.status == 409) { - statusBox.innerText = "username already taken!" + statusBox.innerText = "Username already taken!" showElements(true) } else { - statusBox.innerText = "something went wrong! (error code: " + respStatus + ")" + statusBox.innerText = "Something went wrong! (error code: " + respStatus + ")" showElements(true) } } @@ -100,4 +100,4 @@ signupButton.addEventListener("click", (event) => { }); } doStuff() -}); \ No newline at end of file +}); diff --git a/templates/app.html b/templates/app.html index 1674b8e..06f22c7 100644 --- a/templates/app.html +++ b/templates/app.html @@ -2,7 +2,7 @@ - burgernotes + PageBurger @@ -14,7 +14,7 @@
- +

@@ -28,7 +28,7 @@
+ src="/static/svg/add.svg">New note
@@ -37,49 +37,33 @@ @@ -95,4 +79,4 @@ - \ No newline at end of file + diff --git a/templates/down.html b/templates/down.html index 1ddcd14..dff09a7 100644 --- a/templates/down.html +++ b/templates/down.html @@ -2,7 +2,7 @@ - burgernotes + PageBurger @@ -10,8 +10,8 @@
-

burgernotes is down

-

we're down for maintenance, please try again later!

+

PageBurger is down

+

We're down for maintenance, please try again later!

@@ -122,4 +122,4 @@ } - \ No newline at end of file + diff --git a/templates/error.html b/templates/error.html index 67b8567..75e6b75 100644 --- a/templates/error.html +++ b/templates/error.html @@ -2,15 +2,13 @@ - burgernotes + PageBurger -

Burgernotes is shutting down on November 12th, read this FAQ for more info

-

{{ errorMessage }}

{{ errorCode }} | {{ errorMessage }} @@ -22,4 +20,4 @@ } - \ No newline at end of file + diff --git a/templates/login.html b/templates/login.html index 56fbec3..58032f4 100644 --- a/templates/login.html +++ b/templates/login.html @@ -2,7 +2,7 @@ - log in - burgernotes + Login - PageBurger @@ -11,18 +11,16 @@ -

Burgernotes is shutting down on November 12th, read this FAQ for more info

-
-

log in

+

Login

- + - -

-

don't have an account? if so, create one here!

+ +

+

Don't have an account? If so, Create one here!

- \ No newline at end of file + diff --git a/templates/logout.html b/templates/logout.html index 8487b41..7ce7891 100644 --- a/templates/logout.html +++ b/templates/logout.html @@ -2,7 +2,7 @@ - burgernotes + PageBurger @@ -12,4 +12,4 @@ Logging out.. localStorage.removeItem("DONOTSHARE-password") localStorage.removeItem("CACHE-username") window.location.replace("/") - \ No newline at end of file + diff --git a/templates/main.html b/templates/main.html index 4a468d7..a5b55cc 100644 --- a/templates/main.html +++ b/templates/main.html @@ -2,40 +2,38 @@ - burgernotes + PageBurger - - + + -

Burgernotes is shutting down on November 12th, read this FAQ for more info

-
-

burgernotes

-

simple note-taking app

+

PageBurger

+

A simple note-taking app!


- open in your browser + Open in your browser



-

secure

-

all your notes are fully end-to-end encrypted. only you can read your notes, not anyone else.

+ Secure + All your notes are fully end-to-end encrypted. Only you can read your notes, not anyone else.
-

always up-to-date

-

your notes seamlessly sync across your devices.

+ Always up-to-date + Your notes seamlessly sync across your devices.
- \ No newline at end of file + diff --git a/templates/privacy.html b/templates/privacy.html index 8ed9421..3e02490 100644 --- a/templates/privacy.html +++ b/templates/privacy.html @@ -2,21 +2,19 @@ - burgernotes + PageBurger -

Burgernotes is shutting down on November 12th, read this FAQ for more info

- -

burgernotes privacy policy

+

PageBurger Privacy Policy

Preamble

-

please note that i am not a lawyer, please don't expect too much of this policy :3

-

Welcome to the Burgernotes privacy policy! burgernotes is free & open source software licensed under Please note that I am not a lawyer, please don't expect too much of this policy <3

+

Welcome to the PageBurger privacy policy! PageBurger is free & open source software licensed under GNU AGPL-3.0.

Information collected when signing up

When signing up for an account, we collect and store the following information:

@@ -54,14 +52,14 @@
  • Note last edited date
  • Note creator
  • - not note content or title. +

    Not note content or title.

    We don't sell your data

    We don't sell or share your data to advertisers or third-parties.

    Liability

    -

    We take no responsibility for the use of burgernotes, or any external instances provided by third-parties. We - refuse liability for any inappropriate or illegal use of burgernotes.

    +

    We take no responsibility for the use of PageBurger, or any external instances provided by third-parties. We + refuse liability for any inappropriate or illegal use of PageBurger.

    You may view the AGPL-3.0 license which this software is provided to you with. A copy of the section is below.

    - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +

    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE @@ -69,7 +67,7 @@ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF - SUCH DAMAGES. + SUCH DAMAGES.



    @@ -79,4 +77,4 @@ } - \ No newline at end of file + diff --git a/templates/signup.html b/templates/signup.html index 3e55171..cd2adcd 100644 --- a/templates/signup.html +++ b/templates/signup.html @@ -2,7 +2,7 @@ - sign up - burgernotes + Signup - PageBurger @@ -11,22 +11,17 @@ -

    Burgernotes is shutting down on November 12th, read this FAQ for more info

    -
    -

    sign up

    -

    You may no longer sign up, read this FAQ.

    -

    If you have an existing account, please sign in.

    - +

    +

    Please note that it's impossible to reset your password, do not forget it!

    +

    Already have an account? If so, Login instead!

    - \ No newline at end of file +