diff --git a/Makefile b/Makefile index 21a1bc3..6085a74 100644 --- a/Makefile +++ b/Makefile @@ -28,11 +28,13 @@ clean: install: pageburger mkdir -p $(DESTDIR) - cp pageburger $(DESTDIR) + mkdir -p $(SHAREDIR)/pageburger + cp pageburger $(SHAREDIR)/pageburger/ + ln -sf $(SHAREDIR)/pageburger/pageburger $(DESTDIR)/pageburger mkdir -p $(SHAREDIR)/icons/hicolor/scalable/apps/ mkdir -p $(SHAREDIR)/applications/ mkdir -p $(SHAREDIR)/metainfo/ cp org.hectabit.PageBurger.svg $(SHAREDIR)/icons/hicolor/scalable/apps/ cp org.hectabit.PageBurger.desktop $(SHAREDIR)/applications/ cp org.hectabit.PageBurger.metainfo.xml $(SHAREDIR)/metainfo/ - cp -r website $(SHAREDIR)/pageburger + cp -r website $(SHAREDIR)/pageburger/website diff --git a/createwebsite.sh b/createwebsite.sh new file mode 100755 index 0000000..646930d --- /dev/null +++ b/createwebsite.sh @@ -0,0 +1,14 @@ +#!/bin/sh +cd $(dirname "$(readlink -f "$0")") +git clone https://centrifuge.hectabit.org/hectabit/burgernotes --depth=1 +cd burgernotes +mkdir -p ../website/static ../website/app ../website/error ../website/login ../website/logout ../website/privacy ../website/signup +cp -r static/* ../website/static +cp templates/app.html ../website/app/index.html +cp templates/error.html ../website/error/index.html +cp templates/login.html ../website/login/index.html +cp ../logout.html ../website/logout/index.html +cp templates/privacy.html ../website/privacy/index.html +cp templates/signup.html ../website/signup/index.html +cd .. +rm -rf burgernotes diff --git a/logout.html b/logout.html new file mode 100644 index 0000000..4d84463 --- /dev/null +++ b/logout.html @@ -0,0 +1,15 @@ + + + + + Burgernotes + + + +Logging out.. + diff --git a/org.hectabit.PageBurger.metainfo.xml b/org.hectabit.PageBurger.metainfo.xml index 3a38218..e9acf0f 100644 --- a/org.hectabit.PageBurger.metainfo.xml +++ b/org.hectabit.PageBurger.metainfo.xml @@ -2,9 +2,9 @@ org.hectabit.PageBurger - PageBurger + Burgernotes Simple, private notes app - Arzumify + Hectabit MIT GPL-3.0-or-later @@ -50,6 +50,18 @@ + + https://centrifuge.hectabit.org/HectaBit/PageBurger-App/releases/tag/1.1 + +

Release 1.1

+
    +
  • Make website local to prevent MITMs
  • +
  • Make icon smaller
  • +
  • Changed name
  • +
  • Fixed developer name
  • +
+
+
https://centrifuge.hectabit.org/HectaBit/PageBurger-App/releases/tag/1.0-3 diff --git a/org.hectabit.PageBurger.svg b/org.hectabit.PageBurger.svg index 2fa1b22..f985d62 100644 --- a/org.hectabit.PageBurger.svg +++ b/org.hectabit.PageBurger.svg @@ -1,55 +1,238 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pageburger.c b/pageburger.c index 38bb3ea..c5ecaff 100644 --- a/pageburger.c +++ b/pageburger.c @@ -1,5 +1,7 @@ #include #include +#include +#include static void cookie_changed_cb(WebKitCookieManager *cookie_manager, GParamSpec *pspec, gpointer user_data) { // Handle cookie changes here @@ -18,16 +20,24 @@ int main(int argc, char *argv[]) { // Create a web view widget WebKitWebView *webview = WEBKIT_WEB_VIEW(webkit_web_view_new()); - // Load a web page - const char *filename = "/app/"; - - if (access(filename, F_OK) != -1) { - printf("Flatpak found!\n"); - webkit_web_view_load_uri(webview, "file:/\/\/app/share/pageburger/index.html"); - } else { - printf("Flatpak not found, loading regular\n"); - webkit_web_view_load_uri(webview, "file:/\/\/usr/share/pageburger/index.html"); + // Get the path of the executable + char exe_path[1024]; + ssize_t len = readlink("/proc/self/exe", exe_path, sizeof(exe_path)-1); + if (len == -1) { + perror("readlink"); + return EXIT_FAILURE; } + exe_path[len] = '\0'; + + // Get the directory containing the executable + char *exe_dir = dirname(exe_path); + + // Construct the path to the website directory + char website_path[1024]; + snprintf(website_path, sizeof(website_path), "file:/\/%s/website/app/index.html", exe_dir); + + // Load the URI + webkit_web_view_load_uri(webview, website_path); // Add the web view to the window gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(webview)); diff --git a/website/index.html b/website/index.html deleted file mode 100644 index 1a33583..0000000 --- a/website/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Burgernotes - - - - - - - - - -
-
-

Burgernotes

-

A simple note-taking service!

-
- Open in your browser - - Download for iOS - - - - -
-
-
- 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. -
-
- - - - diff --git a/website/login/index.html b/website/login/index.html index ed3e4a9..8d75c11 100644 --- a/website/login/index.html +++ b/website/login/index.html @@ -20,6 +20,7 @@

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

+ Privacy & Terms diff --git a/website/logout/index.html b/website/logout/index.html index 80edaf8..4d84463 100644 --- a/website/logout/index.html +++ b/website/logout/index.html @@ -11,5 +11,5 @@ Logging out.. localStorage.removeItem("DONOTSHARE-secretkey") localStorage.removeItem("DONOTSHARE-password") localStorage.removeItem("CACHE-username") - window.location.replace("../index.html") + window.location.replace("../login/index.html") diff --git a/website/privacy/index.html b/website/privacy/index.html index 61e1220..79c493d 100644 --- a/website/privacy/index.html +++ b/website/privacy/index.html @@ -2,7 +2,7 @@ - Burgernotes Privacy Policy + Burgernotes Privacy & Terms @@ -10,9 +10,9 @@ -

Burgernotes Privacy Policy

+

Burgernotes Privacy Policy & Terms & Conditions

Preamble

-

Please note that I am not a lawyer, please don't expect too much of this policy <3

+

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 GNU AGPL-3.0.

@@ -68,6 +68,8 @@ 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.

+
+

diff --git a/website/signup/index.html b/website/signup/index.html index 375f2cf..f2528eb 100644 --- a/website/signup/index.html +++ b/website/signup/index.html @@ -21,7 +21,8 @@

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

Already have an account? If so, Login instead!

+ Privacy & Terms - + diff --git a/website/static/css/style.css b/website/static/css/style.css index 5d40e2a..1eb19c1 100644 --- a/website/static/css/style.css +++ b/website/static/css/style.css @@ -170,7 +170,7 @@ body { filter: invert(var(--invertdm)); padding-left: 17.5px; padding-right: 17.5px; - background-image: url("/static/svg/delete.svg"); + background-image: url("../static/svg/delete.svg"); background-position: center; background-repeat: no-repeat; background-size: 55%; diff --git a/website/static/js/login.js b/website/static/js/login.js index 7800374..e20da4c 100644 --- a/website/static/js/login.js +++ b/website/static/js/login.js @@ -118,7 +118,7 @@ signupButton.addEventListener("click", (event) => { newpass: "null" }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) @@ -142,7 +142,7 @@ signupButton.addEventListener("click", (event) => { newpass: await hashpass(password) }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) diff --git a/website/static/js/main.js b/website/static/js/main.js index 3156b9e..2da1223 100644 --- a/website/static/js/main.js +++ b/website/static/js/main.js @@ -203,7 +203,7 @@ function updateUserInfo() { secretKey: secretkey }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) @@ -214,7 +214,7 @@ function updateUserInfo() { closeErrorButton.classList.add("hidden") usernameBox.innerText = "" setTimeout(function () { - window.location.replace("https://notes.hectabit.org/api/logout") + window.location.replace("../logout/index.html") }, 2500); } else { let responseData = await response.json() @@ -236,7 +236,7 @@ usernameBox.addEventListener("click", (event) => { updateUserInfo() }); logOutButton.addEventListener("click", (event) => { - window.location.replace("https://notes.hectabit.org/api/logout") + window.location.replace("../logout/index.html") }); exitThing.addEventListener("click", (event) => { optionsDiv.classList.add("hidden") @@ -250,13 +250,13 @@ deleteMyAccountButton.addEventListener("click", (event) => { secretKey: secretkey }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) .then((response) => { if (response.status == 200) { - window.location.href = "https://notes.hectabit.org/api/logout" + window.location.href = "../logout/index.html" } else { displayError("Failed to delete account (HTTP error code " + response.status + ")") } @@ -273,7 +273,7 @@ sessionManagerButton.addEventListener("click", (event) => { secretKey: secretkey }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) @@ -295,15 +295,15 @@ sessionManagerButton.addEventListener("click", (event) => { sessionText.title = responseData[i]["device"] sessionRemoveButton.innerText = "x" - sessionImage.src = "../static/svg/device_other.svg" + sessionImage.src = "/static/svg/device_other.svg" ua = responseData[i]["device"] if (ua.includes("NT") || ua.includes("Linux")) { - sessionImage.src = "../static/svg/device_computer.svg" + sessionImage.src = "/static/svg/device_computer.svg" } if (ua.includes("iPhone" || ua.includes("Android") || ua.include ("iPod"))) { - sessionImage.src = "../static/svg/device_smartphone.svg" + sessionImage.src = "/static/svg/device_smartphone.svg" } sessionRemoveButton.addEventListener("click", (event) => { @@ -314,13 +314,13 @@ sessionManagerButton.addEventListener("click", (event) => { sessionId: responseData[i]["id"] }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) .then((response) => { if (responseData[i]["thisSession"] == true) { - window.location.replace("https://notes.hectabit.org/api/logout") + window.location.replace("../logout/index.html") } }); sessionElement.remove() @@ -365,7 +365,7 @@ function selectNote(nameithink) { noteId: nameithink, }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .catch((error) => { @@ -404,7 +404,7 @@ function selectNote(nameithink) { content: encryptedText, }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) @@ -431,7 +431,7 @@ function updateNotes() { secretKey: secretkey }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) @@ -466,7 +466,7 @@ function updateNotes() { noteId: responseData[i]["id"] }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) @@ -506,7 +506,7 @@ newNote.addEventListener("click", (event) => { noteName: encryptedName, }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .catch((error) => { @@ -541,7 +541,7 @@ function exportNotes() { secretKey: secretkey }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) @@ -601,7 +601,7 @@ removeBox.addEventListener("click", (event) => { noteId: selectedNote }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response) diff --git a/website/static/js/signup.js b/website/static/js/signup.js index 4566a67..9452651 100644 --- a/website/static/js/signup.js +++ b/website/static/js/signup.js @@ -68,7 +68,7 @@ signupButton.addEventListener("click", (event) => { password: await hashpass(password) }), headers: { - "Content-type": "application/json; charset=UTF-8" + "Content-Type": "application/json; charset=UTF-8" } }) .then((response) => response)