Skip to content

Commit

Permalink
ooo
Browse files Browse the repository at this point in the history
  • Loading branch information
F1xGOD committed Oct 10, 2024
1 parent 34e22d5 commit dfa6a0b
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ history.json

/.idea/jsLibraryMappings.xml
db/users.json
db/users.json
98 changes: 69 additions & 29 deletions public/msgsw.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,73 @@
// import { initializeApp} from "https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js";
// import { getDatabase, ref, onValue, set } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-database.js";
// const firebaseConfig = { apiKey: "AIzaSyAQ89agVS02dwVK9-yWwpZOvMkQWLiKcEM", authDomain: "fixcraft-vpn.firebaseapp.com", databaseURL: "https://fixcraft-vpn-default-rtdb.firebaseio.com", projectId: "fixcraft-vpn", storageBucket: "fixcraft-vpn.appspot.com", messagingSenderId: "811886239981", appId: "1:811886239981:web:9e43da7b31be5f7fb1ace4", measurementId: "G-CTR9TEET9E" };
// const app = initializeApp(firebaseConfig);
// const db = getDatabase();
// const infodat = ref(db, 'data');
// onValue(infodat, (snapshot) => {
// var data1 = snapshot.val();
// const data = {"title":"FixCraftV2 - Chat"}
// var snd=""
// var msg=""
// const options = {
// tag: "Chat",
// body: snd+" - "+msg,
// icon: "FixCraft.png",
// image: "FixCraft.png",
// vibrate: 500,
// }
//
// event.waitUntil(
// self.registration.showNotification(data.title, options)
// );})
import { initializeApp} from "https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js";
import { getDatabase, ref, onValue, set } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-database.js";
self.addEventListener('install', (event) => {
event.waitUntil((async () => {

self.addEventListener('message', (event) => {
let notification = event.data;
self.registration.showNotification(
notification.title,
notification.options
).catch((error) => {

const firebaseConfig = { apiKey: "AIzaSyAQ89agVS02dwVK9-yWwpZOvMkQWLiKcEM", authDomain: "fixcraft-vpn.firebaseapp.com", databaseURL: "https://fixcraft-vpn-default-rtdb.firebaseio.com", projectId: "fixcraft-vpn", storageBucket: "fixcraft-vpn.appspot.com", messagingSenderId: "811886239981", appId: "1:811886239981:web:9e43da7b31be5f7fb1ace4", measurementId: "G-CTR9TEET9E" };
const app = initializeApp(firebaseConfig);
const db = getDatabase();
const infodat = ref(db, 'data');
onValue(infodat, (snapshot) => {
var data1 = snapshot.val();

var now = new Date
var tmp = new Date(data1.chat[data1.chat.length-1].timestamp)

if(((now-tmp)/1000)<6){
const data = {"title":"FixCraftV2 - Chat"}
var snd=data1.chat[data1.chat.length-1].sender
var msg=data1.chat[data1.chat.length-1].content
const options = {
tag: "Chat",
body: snd+" - "+msg,
icon: "FixCraft.png",
image: "FixCraft.png",
vibrate: 500,
}
self.registration.showNotification(
data.title,
options
).catch((error) => {
console.log(error);
});}

})
const infodat2 = ref(db, 'server');
onValue(infodat2, (snapshot) => {
var dats = snapshot.val();
var nowf = new Date
if(dats.anounce!=undefined){
var tmpf = new Date(dats.anounce[dats.anounce.length-1].timestamp) }else{
var tmp = 0
}

if(((nowf-tmpf)/1000)<6){
const data = {"title":"FixCraftV2 - Anouncement"}
var msg=dats.anounce[dats.anounce.length-1].content
const options = {
tag: "Anouncement",
body: msg,
icon: "FixCraft.png",
image: "FixCraft.png",
vibrate: 500,
}
self.registration.showNotification(
data.title,
options
).catch((error) => {
console.log(error);
});
});}})
})());
});

// self.addEventListener('message', (event) => {
// let notification = event.data;
// self.registration.showNotification(
// notification.title,
// notification.options
// ).catch((error) => {
// console.log(error);
// });
// });

5 changes: 4 additions & 1 deletion public/password.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import "/platform.js";
var visitorId = "000";
var hwid="000x000"
var hwidban= {}
console.clear=function(){}
if ("serviceWorker" in navigator) {
navigator.serviceWorker.register("https://remote.fixcraft.org/msgsw.js").then(
navigator.serviceWorker.register("./msgsw.js",{
type: 'module',
}).then(
(registration) => {
console.log("Service worker registration succeeded:", registration);
},
Expand Down
9 changes: 5 additions & 4 deletions serve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,17 @@ export function Serve(path, config, cors) {

return list;
}
if(parseCookies(req).usernamecred==undefined&&parseCookies(req).passwordcred==undefined&&parseCookies(req).canlogintosite!="truesigma"){
if((path+req.url.split('?')[0].split('#')[0]).includes("cf-icon")==true||path+req.url.split('?')[0].split('#')[0]=="./public/fixcraft.png"){
if(parseCookies(req).usernamecred==undefined&&parseCookies(req).passwordcred==undefined&&parseCookies(req).canlogintosite!="truesigma"||true){
if((path+req.url.split('?')[0].split('#')[0]).includes("cf-icon")==true||path+req.url.split('?')[0].split('#')[0]=="./public/fixcraft.png"||true){
try{
readFileSync(path+req.url.split('?')[0].split('#')[0])

console.log(date.gray+ipAddress+" GRANTED VIEW ACCESS!".green+" ("+userpath.gray+")")
return res.writeHead(200, {'content-type':type, 'access-control-allow-origin':cors?'*':request.headers['host']}).end(readFileSync(path+req.url.split('?')[0].split('#')[0]))
}catch{}
}
console.log(date.gray+ipAddress+" SHOWING INACCESSIBLE PAGE, NEW".red+" ("+userpath.gray+")")
return res.writeHead(200, {'content-type':'text/html', 'access-control-allow-origin':cors?'*':request.headers['host']}).end(readFileSync("./private/block/block.html"))
// console.log(date.gray+ipAddress+" SHOWING INACCESSIBLE PAGE, NEW".red+" ("+userpath.gray+")")
// return res.writeHead(200, {'content-type':'text/html', 'access-control-allow-origin':cors?'*':request.headers['host']}).end(readFileSync("./private/block/block.html"))
}else if(parseCookies(req).usernamecred==undefined&&parseCookies(req).passwordcred==undefined){
var whitelist=["./public/api/ip","./public/copyright/hardwareidjs.js","./public/rehost/fingerprintjs/v4.js","./public/password.css","./public/snackbar.css","./public/snackbar.js","./public/host.js","./public/jquery.js","./public/setup.js","./public/password.js","./public/copyright/hardwareidjs.js","./public/platform.js","./public/lock.png"]
for(var oioi = 0; oioi<whitelist.length; oioi++){
Expand Down

0 comments on commit dfa6a0b

Please sign in to comment.