meow
This commit is contained in:
parent
9d0dbafdba
commit
2242a377b9
5
main
5
main
|
@ -11,6 +11,9 @@ from werkzeug.security import generate_password_hash, check_password_hash
|
|||
from quart import Quart, render_template, request, url_for, flash, redirect, session, make_response, send_from_directory, stream_with_context, Response, request
|
||||
|
||||
# Parse configuration file, and check if anything is wrong with it
|
||||
if not os.path.exists("config.ini"):
|
||||
print("config.ini does not exist")
|
||||
|
||||
config = configparser.ConfigParser()
|
||||
config.read("config.ini")
|
||||
|
||||
|
@ -19,7 +22,7 @@ PORT = config["config"]["PORT"]
|
|||
SECRET_KEY = config["config"]["SECRET_KEY"]
|
||||
MAX_STORAGE = config["config"]["MAX_STORAGE"]
|
||||
|
||||
if SECRET_KEY == "placeholder":
|
||||
if SECRET_KEY == "supersecretkey" or "placeholder":
|
||||
print("[WARNING] Secret key not set")
|
||||
|
||||
# Define Quart
|
||||
|
|
|
@ -9,7 +9,7 @@ if (localStorage.getItem("DONOTSHARE-password") !== null) {
|
|||
throw new Error();
|
||||
}
|
||||
|
||||
let remote = ""
|
||||
let remote = "https://notes.hectabit.org"
|
||||
|
||||
let usernameBox = document.getElementById("usernameBox")
|
||||
let passwordBox = document.getElementById("passwordBox")
|
||||
|
@ -111,7 +111,7 @@ signupButton.addEventListener("click", (event) => {
|
|||
return key
|
||||
};
|
||||
|
||||
fetch(remote + "https://notes.hectabit.org/api/login", {
|
||||
fetch(remote + "/api/login", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
|
@ -135,7 +135,7 @@ signupButton.addEventListener("click", (event) => {
|
|||
}
|
||||
else if (response.status == 401) {
|
||||
console.log("Trying oldhash")
|
||||
fetch(remote + "https://notes.hectabit.org/api/login", {
|
||||
fetch(remote + "/api/login", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
|
|
|
@ -13,7 +13,7 @@ if (localStorage.getItem("CACHE-username") !== null) {
|
|||
document.getElementById("usernameBox").innerText = localStorage.getItem("CACHE-username")
|
||||
}
|
||||
|
||||
let remote = ""
|
||||
let remote = "https://notes.hectabit.org"
|
||||
|
||||
function formatBytes(a, b = 2) { if (!+a) return "0 Bytes"; const c = 0 > b ? 0 : b, d = Math.floor(Math.log(a) / Math.log(1000)); return `${parseFloat((a / Math.pow(1000, d)).toFixed(c))} ${["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][d]}` }
|
||||
|
||||
|
@ -208,7 +208,7 @@ function truncateString(str, num) {
|
|||
|
||||
|
||||
function updateUserInfo() {
|
||||
fetch(remote + "https://notes.hectabit.org/api/userinfo", {
|
||||
fetch(remote + "/api/userinfo", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -259,7 +259,7 @@ exitThing.addEventListener("click", (event) => {
|
|||
});
|
||||
deleteMyAccountButton.addEventListener("click", (event) => {
|
||||
if (confirm("Are you REALLY sure that you want to delete your account? There's no going back!") == true) {
|
||||
fetch(remote + "https://notes.hectabit.org/api/deleteaccount", {
|
||||
fetch(remote + "/api/deleteaccount", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -281,7 +281,7 @@ sessionManagerButton.addEventListener("click", (event) => {
|
|||
optionsDiv.classList.add("hidden")
|
||||
sessionManagerDiv.classList.remove("hidden")
|
||||
|
||||
fetch(remote + "https://notes.hectabit.org/api/sessions/list", {
|
||||
fetch(remote + "/api/sessions/list", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -320,7 +320,7 @@ sessionManagerButton.addEventListener("click", (event) => {
|
|||
}
|
||||
|
||||
sessionRemoveButton.addEventListener("click", (event) => {
|
||||
fetch(remote + "https://notes.hectabit.org/api/sessions/remove", {
|
||||
fetch(remote + "/api/sessions/remove", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -370,7 +370,7 @@ function selectNote(nameithink) {
|
|||
let thingArray = Array.from(document.querySelectorAll(".noteButton")).find(el => el.id == nameithink);
|
||||
thingArray.classList.add("selected")
|
||||
|
||||
fetch(remote + "https://notes.hectabit.org/api/readnote", {
|
||||
fetch(remote + "/api/readnote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -414,7 +414,7 @@ function selectNote(nameithink) {
|
|||
let encryptedText = CryptoJS.AES.encrypt(noteBox.value, password).toString();
|
||||
|
||||
if (selectedNote == nameithink) {
|
||||
fetch(remote + "https://notes.hectabit.org/api/editnote", {
|
||||
fetch(remote + "/api/editnote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -443,7 +443,7 @@ function selectNote(nameithink) {
|
|||
}
|
||||
|
||||
function updateNotes() {
|
||||
fetch(remote + "https://notes.hectabit.org/api/listnotes", {
|
||||
fetch(remote + "/api/listnotes", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -476,7 +476,7 @@ function updateNotes() {
|
|||
|
||||
noteButton.addEventListener("click", (event) => {
|
||||
if (event.ctrlKey) {
|
||||
fetch(remote + "https://notes.hectabit.org/api/removenote", {
|
||||
fetch(remote + "/api/removenote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -508,7 +508,7 @@ updateNotes()
|
|||
newNote.addEventListener("click", (event) => {
|
||||
let noteName = "New note"
|
||||
let encryptedName = CryptoJS.AES.encrypt(noteName, password).toString();
|
||||
fetch(remote + "https://notes.hectabit.org/api/newnote", {
|
||||
fetch(remote + "/api/newnote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
@ -542,7 +542,7 @@ function downloadObjectAsJson(exportObj, exportName) {
|
|||
|
||||
function exportNotes() {
|
||||
let noteExport = []
|
||||
fetch(remote + "https://notes.hectabit.org/api/exportnotes", {
|
||||
fetch(remote + "/api/exportnotes", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey
|
||||
|
@ -610,7 +610,7 @@ removeBox.addEventListener("click", (event) => {
|
|||
if (selectedNote == 0) {
|
||||
displayError("You need to select a note first!")
|
||||
} else {
|
||||
fetch(remote + "https://notes.hectabit.org/api/removenote", {
|
||||
fetch(remote + "/api/removenote", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
secretKey: secretkey,
|
||||
|
|
|
@ -9,7 +9,7 @@ if (localStorage.getItem("DONOTSHARE-password") !== null) {
|
|||
throw new Error();
|
||||
}
|
||||
|
||||
let remote = ""
|
||||
let remote = "https://notes.hectabit.org"
|
||||
|
||||
let usernameBox = document.getElementById("usernameBox")
|
||||
let passwordBox = document.getElementById("passwordBox")
|
||||
|
@ -63,7 +63,7 @@ signupButton.addEventListener("click", (event) => {
|
|||
};
|
||||
|
||||
|
||||
fetch(remote + "https://notes.hectabit.org/api/signup", {
|
||||
fetch(remote + "/api/signup", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
|
|
Loading…
Reference in New Issue