Skip to content

Commit

Permalink
v1.1.10 Revert Update
Browse files Browse the repository at this point in the history
v1.2.0/v1.1.10 Revertion
  • Loading branch information
Axton authored Jun 24, 2022
2 parents f496b88 + e88ed42 commit 036fe6a
Show file tree
Hide file tree
Showing 29 changed files with 6,340 additions and 893 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Quickblaze Files
.gitattributes
.dccache
Public\assets\img\Thumbs.db

# QuickBlaze Security
local-storage
Expand Down
2 changes: 1 addition & 1 deletion .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ErrorDocument 403 /403
ErrorDocument 500 /500

# File security
<FilesMatch "\.(json|sarif|md|gitignore|version|LICENSE|htaccess|env|security-scan|config|dccache|)$">
<FilesMatch "\.(json|sarif|md|gitignore|version|LICENSE|htaccess|env)$">
Order allow,deny
Deny from all
</FilesMatch>
1,309 changes: 556 additions & 753 deletions .security-scan

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "BRANCH": "main", "VERSION":"1.2.0" }
{ "BRANCH": "main", "VERSION":"1.1.9" }
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 axtonprice, QuickBlaze
Copyright (c) 2022 Axtonprice, QuickBlaze

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
37 changes: 14 additions & 23 deletions Modules/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,35 +93,26 @@ function setupStorageMethod()
} else{
$TEMP_LANGUAGE = $configuration["LANGUAGE"];
}
if($configuration["DEBUG_MODE"] == ""){
$TEMP_DEBUGMODE = "false"; // Reset configuration to default value
} else{
$TEMP_DEBUGMODE = $configuration["DEBUG_MODE"];
}
file_put_contents("./.config", json_encode(array("STORAGE_METHOD" => "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$path", "DEBUG_MODE" => $TEMP_DEBUGMODE))); // Set contents of new config file
file_put_contents("./.config", json_encode(array("STORAGE_METHOD" => "$TEMP_STORAGE_METHOD", "LANGUAGE" => "$TEMP_LANGUAGE", "INSTALLATION_PATH" => "$path"))); // Set contents of new config file
}
if (strtolower($configuration["LANGUAGE"]) == "") {
require "./Public/error/ServerConfiguration.php"; // throw error page if no language is provided
die();
}
if (strtolower($configuration["DEBUG_MODE"]) == "") {
require "./Public/error/ServerConfiguration.php"; // throw error page if no language is provided
require "./Public/Error/ServerConfiguration.php"; // throw error page if no language is provided
die();
}
if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") {
if (!file_exists("./Modules/Database.env")) {
touch("./Modules/Database.env"); // Create file
require "./Public/error/DatabaseConfig.php";
require "./Public/Error/DatabaseConfig.php";
die();
} else {
$json = json_decode(file_get_contents("./Modules/Database.env", true), true);
if ($json["DATABASE"] == "" || $json["HOSTNAME"] == "") {
require "./Public/error/DatabaseConfig.php";
require "./Public/Error/DatabaseConfig.php";
die();
} else { // Test database connection
$conn = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]);
if ($conn->connect_error) {
require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials
require "./Public/Error/DatabaseCredentials.php"; // throw error page if invalid credentials
die();
} else {
if (!is_dir("./local-storage/")) mkdir("./local-storage/");
Expand All @@ -135,13 +126,13 @@ function setupStorageMethod()
file_put_contents("./local-storage/.cache", '{"DO-NOT-TOUCH:database_installation_status": "true"}');
}
} else {
require "./Public/error/DatabaseCredentials.php"; // throw error page if invalid credentials
require "./Public/Error/DatabaseCredentials.php"; // throw error page if invalid credentials
die();
}
}
// Always reset auto-increment
if (!$conn->query("ALTER TABLE `quickblaze_records` MODIFY `record_id` int(11) NOT NULL AUTO_INCREMENT;")) {
require "./Public/error/DatabaseConfig.php"; // throw error page if invalid credentials
require "./Public/Error/DatabaseConfig.php"; // throw error page if invalid credentials
die();
}
}
Expand All @@ -153,7 +144,7 @@ function setupStorageMethod()
if (!is_dir("$baseStorageFolder/")) mkdir("$baseStorageFolder/");
if (!is_dir("$baseStorageFolder/encryptions/")) mkdir("$baseStorageFolder/encryptions/");
} else { // Server storage method not set
require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration
require "./Public/Error/ServerConfiguration.php"; // throw error page if invalid configuration
die();
}
error_reporting(E_ALL); // enable error reporting
Expand All @@ -167,7 +158,7 @@ function insertRecord($encrypted_contents, $encryption_token)
if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") {
$mysqli = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]);
if ($mysqli->connect_errno) {
require "./Public/error/DatabaseCredentials.php";
require "./Public/Error/DatabaseCredentials.php";
die();
}
$source_ip = filter_var($_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP) ?? filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
Expand All @@ -186,7 +177,7 @@ function insertRecord($encrypted_contents, $encryption_token)
$source_ip = filter_var($_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP) ?? filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP);
$record_date = date("Y-m-d H:i:s");
file_put_contents("$baseStorageFolder/encryptions/$uniqueIdentifier/data.json", '{"filestore_id": "' . $uniqueIdentifier . '", "encrypted_contents": "' . $encrypted_contents . '", "encryption_token": "' . $encryption_token . '", "source_ip": "' . $source_ip . '", "record_date": "' . $record_date . '"}'); // Set data file encryption data
require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration
require "./Public/Error/ServerConfiguration.php"; // throw error page if invalid configuration
die();
}
}
Expand All @@ -197,7 +188,7 @@ function destroyRecord($token)
if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") {
$mysqli = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]);
if ($mysqli->connect_errno) {
require "./Public/error/DatabaseCredentials.php";
require "./Public/Error/DatabaseCredentials.php";
die();
}
$token = filter_var($token, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
Expand Down Expand Up @@ -228,7 +219,7 @@ function rmdir_recursive($dir)
}
}
} else { // Server storage method not set
require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration
require "./Public/Error/ServerConfiguration.php"; // throw error page if invalid configuration
die();
}
}
Expand All @@ -239,7 +230,7 @@ function getRecord($dataToFetch, $encryption_token)
if (strtolower($configuration["STORAGE_METHOD"]) == "mysql") {
$mysqli = new mysqli($json["HOSTNAME"], $json["USERNAME"], $json["PASSWORD"], $json["DATABASE"]);
if ($mysqli->connect_errno) {
require "./Public/error/DatabaseCredentials.php";
require "./Public/Error/DatabaseCredentials.php";
die();
}
$encryption_token = filter_var($encryption_token, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
Expand All @@ -264,7 +255,7 @@ function getRecord($dataToFetch, $encryption_token)
}
}
} else { // Server storage method not set
require "./Public/error/ServerConfiguration.php"; // throw error page if invalid configuration
require "./Public/Error/ServerConfiguration.php"; // throw error page if invalid configuration
die();
}
}
Expand Down
2 changes: 1 addition & 1 deletion Public/Error/403.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon-100x100.png">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon.png">
<meta name="description" content="<?= translate("An extremely simple, one-time view encryption message system. Send anybody passwords, or secret messages on a one-time view basis.") ?>">
<title>QuickBlaze</title>

Expand Down
2 changes: 1 addition & 1 deletion Public/Error/404.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon-100x100.png">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon.png">
<meta name="description" content="<?= translate("An extremely simple, one-time view encryption message system. Send anybody passwords, or secret messages on a one-time view basis.") ?>">
<title>QuickBlaze</title>

Expand Down
2 changes: 1 addition & 1 deletion Public/Error/500.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon-100x100.png">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon.png">
<meta name="description" content="<?= translate("An extremely simple, one-time view encryption message system. Send anybody passwords, or secret messages on a one-time view basis.") ?>">
<title>QuickBlaze</title>

Expand Down
2 changes: 1 addition & 1 deletion Public/Error/DatabaseConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon-100x100.png">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon.png">
<meta name="description" content="<?= translate("An extremely simple, one-time view encryption message system. Send anybody passwords, or secret messages on a one-time view basis.") ?>">
<title>QuickBlaze</title>

Expand Down
2 changes: 1 addition & 1 deletion Public/Error/DatabaseCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="<?=getInstallationPath()?>/Public/assets/img/favicon-100x100.png">
<link rel="icon" type="image/x-icon" href="<?=getInstallationPath()?>/Public/assets/img/favicon.png">
<meta name="description" content="<?= translate("An extremely simple, one-time view encryption message system. Send anybody passwords, or secret messages on a one-time view basis.") ?>">
<title>QuickBlaze</title>

Expand Down
2 changes: 1 addition & 1 deletion Public/Error/ServerConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon-100x100.png">
<link rel="icon" type="image/x-icon" href="<?= getInstallationPath() ?>/Public/assets/img/favicon.png">
<meta name="description" content="<?= translate("An extremely simple, one-time view encrypted message system. Send anybody passwords, or secret messages on a one-time view basis.") ?>">
<title>QuickBlaze</title>

Expand Down
5 changes: 0 additions & 5 deletions Public/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ textarea {
z-index: 2;
}

.main-form .form-icon{
padding-bottom: 15px;
--fa-animation-duration: 3.5s
}

.no-decoration {
text-decoration: none;
}
Expand Down
Binary file removed Public/assets/img/Thumbs.db
Binary file not shown.
Binary file removed Public/assets/img/favicon-1000x1000.png
Binary file not shown.
Binary file removed Public/assets/img/favicon-100x100.png
Binary file not shown.
Binary file removed Public/assets/img/favicon-255x255.png
Binary file not shown.
Binary file removed Public/assets/img/favicon-500x500.png
Binary file not shown.
Binary file removed Public/assets/img/favicon-50x50.png
Binary file not shown.
Binary file added Public/assets/img/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 8 additions & 9 deletions Public/assets/js/autoConfigurationChecks.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const autoRecheckConfig = (pageName) => {
function autoRecheckConfig(pageName) {
fetch(`dataProcessing?action=checkConfig`).then(response => response.json()).then(data => {
// log(`[RE-CHECK] Server responded with ${data.response}`);
if (data.response === 'true') {
window.location.replace('./');
};
log(`[RE-CHECK] Server responded with ${data.response}`);
if(data.response == "true"){
window.location.replace("./");
}
});
setTimeout(autoRecheckConfig, 3000);
};

let path = window.location.pathname,
page = path.split('/').pop();
}
var path = window.location.pathname;
var page = path.split("/").pop();
autoRecheckConfig(page);
22 changes: 12 additions & 10 deletions Public/assets/js/buttonCopyURL.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
const copyToClipboard = (element) => {
let $temp = $('<input>');
$('body').append($temp);
function copyToClipboard(element) {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).text()).select();
document.execCommand('copy');
document.execCommand("copy");
log(`Copied text to clipboard`);
$temp.remove();
showSnackBar('snackbar'); // show snackbar notification
};
}

const showSnackBar = (snackbarId) => {
let x = document.getElementById(snackbarId);
x.className = 'show';
function showSnackBar(snackbarId) {
var x = document.getElementById(snackbarId);
x.className = "show";
var time = 3000;
log(`Displaying snackbar for ${time}ms`);
setTimeout(x.className = x.className.replace('show', ''), time);
};
setTimeout(function () {
x.className = x.className.replace("show", "");
}, time);
}
66 changes: 23 additions & 43 deletions Public/assets/js/formContentUpdate.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,34 @@
const updateFormDisplay = () => {
const formvalue = document.getElementById('inputtextbot').value; // Assign variable to the current value of the textbox

$('#form_input').fadeOut('fast'); // fade out previous content
log(`No longer showing 'form_input' element`);

function updateFormDisplay() {
const formvalue = document.getElementById("inputtextbot").value; // Assign variable to the current value of the textbox
$('#form_input').fadeOut('fast'); log(`No longer showing 'form_input' element`); // fade out previous content
fetch(`dataProcessing?data=${formvalue}`).then(response => response.json()).then(data => {
log(`Server responsed with '${data.response}'`);

document.getElementById('submissiontextbox').value = `${window.location}view?key=${data.response}`; // Set text box to view message URL
log(`Updated 'submissiontextbox.value'`);

document.getElementById('submissiontextbox').innerHTML = `${window.location}view?key=${data.response}`; // Set text box to view message URL
log(`Updated 'submissiontextbox.innerHTML'`);
document.getElementById("submissiontextbox").value = `${window.location}view?key=${data.response}`; log(`Updated 'submissiontextbox.value'`); // Set text box to view message URL
document.getElementById("submissiontextbox").innerHTML = `${window.location}view?key=${data.response}`; log(`Updated 'submissiontextbox.innerHTML'`); // Set text box to view message URL
});
setTimeout(() => {
$('#form_submission').fadeIn('fast'); // fade in new content
log(`Now showing 'form_submission' element`);
setTimeout(function () {
$('#form_submission').fadeIn('fast'); log(`Now showing 'form_submission' element`); // fade in new content
}, 200);
};

const updateViewDisplay = () => {
$('#form_confirmation').fadeOut('fast'); // fade out previous content
log(`No longer showing 'form_confirmation' element`);

let key = new URL(window.location).searchParams.get('key'); // Get key variable from URL; replacing PHP usage
log(`Got key variable from url -> ${key}`);
}

function updateViewDisplay() {
$('#form_confirmation').fadeOut('fast'); log(`No longer showing 'form_confirmation' element`); // fade out previous content
var key = new URL(window.location).searchParams.get("key"); log(`Got key variable from url -> ${key}`); // Get key variable from URL; replacing PHP usage
fetch(`dataProcessing?action=decrypt&key=${key}`).then(response => response.json()).then(data => {
if (!data.response) {
if (data.response == "") {
showSnackBar('snackbarError');

$('#form_error').fadeIn('fast'); // fade in new content
log(`Now showing 'form_error' element`);

log(`Encryption not found; redirecting in 2s`);
setTimeout(() => {
window.location.replace('./'); // Redirect to home page
$('#form_error').fadeIn('fast'); log(`Now showing 'form_error' element`); // fade in new content
log(`Encryption not found; redirecting in 2s`)
setTimeout(function () {
window.location.replace("./"); // Redirect to home page
}, 2000);
} else {
document.getElementById('valuetextbox').value = data.response; // Set text box to decrypted message
log(`Updated 'valuetextbox.value'`);

document.getElementById('valuetextbox').innerHTML = data.response; // Set text box to decrypted message
log(`Updated 'valuetextbox.innerHTML'`);

setTimeout(() => {
$('#form_content').fadeIn('fast'); // fade in new content
log(`Now showing 'form_content' element`);
}, 200);
log(`Server responded with '${data.response}'`);
};
document.getElementById("valuetextbox").value = data.response; log(`Updated 'valuetextbox.value'`); // Set text box to decrypted message
document.getElementById("valuetextbox").innerHTML = data.response; log(`Updated 'valuetextbox.innerHTML'`); // Set text box to decrypted message
setTimeout(function () {
$('#form_content').fadeIn('fast'); log(`Now showing 'form_content' element`); // fade in new content
}, 200);
}
});
};
}
Loading

0 comments on commit 036fe6a

Please sign in to comment.