Commit 7beaae8c authored by Edvard Rejthar's avatar Edvard Rejthar

migration to another server

parent bbc49e5e
/mnt/mdmaug/home/mdmaug/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/mdmaug@jetpack/resources/mdmaug/lib /mnt/mdmaug/home/mdmaug/.mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/mdmaug@jetpack/resources/mdmaug/
\ No newline at end of file \ No newline at end of file
...@@ -67,7 +67,7 @@ class Server (SimpleHTTPRequestHandler): ...@@ -67,7 +67,7 @@ class Server (SimpleHTTPRequestHandler):
rest = Rest(self.path) rest = Rest(self.path)
#poslat vsechna data vys, pokud jsme vlozeni v iframe (https-mdm nemuze nacitat z http stroje - mixed content) #poslat vsechna data vys, pokud jsme vlozeni v iframe (https-mdm nemuze nacitat z http stroje - mixed content)
self.render_template("templates/_message.html", contents = rest.run(cmd), cmd=cmd, url=self.path, destination="https://mdm.labs.nic.cz/") self.render_template("templates/_message.html", contents = rest.run(cmd), cmd=cmd, url=self.path, destination="https://mdm.nic.cz/")
elif path[1] == "export": # /export/{days} - csv za poslednich 7 dni elif path[1] == "export": # /export/{days} - csv za poslednich 7 dni
url = self.path.split("/", 2) url = self.path.split("/", 2)
self.output(Export.exportView(days = url[2])) self.output(Export.exportView(days = url[2]))
\ No newline at end of file
// ==UserScript== // ==UserScript==
// @name mdm // @name mdm
// @namespace mdm // @namespace mdm
// @include https://mdm.labs.nic.cz/detail/* // @include https://mdm.nic.cz/detail/*
// @version 1 // @version 1
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
/* /*
if (typeof jQuery !== "function") {var js = document.createElement("script");var he = document.getElementsByTagName('head')[0];js.type = "text/javascript";js.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";he.appendChild(js); if (typeof jQuery !== "function") {var js = document.createElement("script");var he = document.getElementsByTagName('head')[0];js.type = "text/javascript";js.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";he.appendChild(js);
js.addEventListener("load", function() {$(function() {go();});});}*/ js.addEventListener("load", function() {$(function() {go();});});}*/
if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { if (document.location.href.indexOf("https://mdm.nic.cz/detail/") === 0) {
$ = j; $ = j;
APP_HOST = "https://172.20.7.10:8000"; APP_HOST = "https://172.20.7.10:8000";
...@@ -46,7 +46,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -46,7 +46,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
ipVoted = "XXX"; ipVoted = "XXX";
//poslat volbu ostatnim tabum (skrz matersky tab) //poslat volbu ostatnim tabum (skrz matersky tab)
if (window.opener) { if (window.opener) {
window.opener.postMessage({"voted": $(thisRef).val(), "domain": domainVoted}, "https://mdm.labs.nic.cz"); window.opener.postMessage({"voted": $(thisRef).val(), "domain": domainVoted}, "https://mdm.nic.cz");
} }
//poslat volbu na server //poslat volbu na server
...@@ -184,7 +184,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -184,7 +184,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
$("#content").before("<iframe width='10px' height='10px' src='" + APP_HOST + "/rest/analyze=cached/" + url + "'></iframe>"); $("#content").before("<iframe width='10px' height='10px' src='" + APP_HOST + "/rest/analyze=cached/" + url + "'></iframe>");
} else {//pouzit starou analyzu } else {//pouzit starou analyzu
console.log("old analysis found"); console.log("old analysis found");
window.postMessage({"analyze": str, "url": "refresh"}, "https://mdm.labs.nic.cz"); window.postMessage({"analyze": str, "url": "refresh"}, "https://mdm.nic.cz");
reanalyzeButton.show(); reanalyzeButton.show();
} }
}; };
...@@ -461,13 +461,13 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -461,13 +461,13 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
if (keepTabOpen === false) {//nechci analyzovat a nemam na praci nic dalsiho, analyza probehla -> projdu si ji pak hromadne if (keepTabOpen === false) {//nechci analyzovat a nemam na praci nic dalsiho, analyza probehla -> projdu si ji pak hromadne
console.log("zaviram okno..."); console.log("zaviram okno...");
if (window.opener) { if (window.opener) {
window.opener.postMessage({"close": "close"}, "https://mdm.labs.nic.cz"); window.opener.postMessage({"close": "close"}, "https://mdm.nic.cz");
} }
window.close();//pro jistotu zkusime zavrit i zde, kdyby parent okno selhalo (ve FF musi byt povoleno about:config allow_scripts_to_close_windows) window.close();//pro jistotu zkusime zavrit i zde, kdyby parent okno selhalo (ve FF musi byt povoleno about:config allow_scripts_to_close_windows)
} else { } else {
console.log("nezaviram okno..."); console.log("nezaviram okno...");
if (window.opener) { if (window.opener) {
window.opener.postMessage({"open": "ok"}, "https://mdm.labs.nic.cz"); window.opener.postMessage({"open": "ok"}, "https://mdm.nic.cz");
} }
//prehazet dopisy - nejnovejsi reakce navrch //prehazet dopisy - nejnovejsi reakce navrch
...@@ -537,7 +537,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -537,7 +537,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
if (wellknown.indexOf(domain) !== -1) { if (wellknown.indexOf(domain) !== -1) {
console.log("znama domena..."); console.log("znama domena...");
if (window.opener) { if (window.opener) {
window.opener.postMessage({"close": "wellknown"}, "https://mdm.labs.nic.cz"); window.opener.postMessage({"close": "wellknown"}, "https://mdm.nic.cz");
} }
window.close(); window.close();
return; return;
......
// ==UserScript== // ==UserScript==
// @name mdm // @name mdm
// @namespace mdm // @namespace mdm
// @include https://mdm.labs.nic.cz/detail/* // @include https://mdm.nic.cz/detail/*
// @version 1 // @version 1
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
/* /*
if (typeof jQuery !== "function") {var js = document.createElement("script");var he = document.getElementsByTagName('head')[0];js.type = "text/javascript";js.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";he.appendChild(js); if (typeof jQuery !== "function") {var js = document.createElement("script");var he = document.getElementsByTagName('head')[0];js.type = "text/javascript";js.src = "https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";he.appendChild(js);
js.addEventListener("load", function() {$(function() {go();});});}*/ js.addEventListener("load", function() {$(function() {go();});});}*/
if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { if (document.location.href.indexOf("https://mdm.nic.cz/detail/") === 0) {
var KEY = {DOWN: 40, UP: 38, LEFT: 37, RIGHT: 39, ALT: 17, C: 67, L: 76, N: 78, W: 87, N1: 49, N2: 50, N3: 51, N4: 52, N5: 53, N6: 54, N7: 55, N8: 56, N9: 57, F: 70, S: 83}; var KEY = {DOWN: 40, UP: 38, LEFT: 37, RIGHT: 39, ALT: 17, C: 67, L: 76, N: 78, W: 87, N1: 49, N2: 50, N3: 51, N4: 52, N5: 53, N6: 54, N7: 55, N8: 56, N9: 57, F: 70, S: 83};
$ = j; $ = j;
APP_HOST = "https://172.20.7.10:8000"; APP_HOST = "https://172.20.7.10:8000";
...@@ -60,7 +60,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -60,7 +60,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
ipVoted = "XXX"; ipVoted = "XXX";
//poslat volbu ostatnim tabum (skrz matersky tab) //poslat volbu ostatnim tabum (skrz matersky tab)
if (window.opener) { if (window.opener) {
window.opener.postMessage({"voted": $(radioEl).val(), "domain": domainVoted}, "https://mdm.labs.nic.cz"); window.opener.postMessage({"voted": $(radioEl).val(), "domain": domainVoted}, "https://mdm.nic.cz");
} }
//poslat volbu na server //poslat volbu na server
...@@ -210,7 +210,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -210,7 +210,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
//refreshOutput(); //refreshOutput();
//rovnou zaciname hlasovat, analyza kompletni //rovnou zaciname hlasovat, analyza kompletni
$(".voting:eq(0) input:eq(0)").focus(); $(".voting:eq(0) input:eq(0)",sections.$undecided).focus();//focusujeme pouze z bloku undecided; nema smysl focusovat allowed web, jeste nekomu ujede ruka
} else if (e.data.voted) {//ve vedlejsim tabu se hlasovalo, zmen hodnotu i zde } else if (e.data.voted) {//ve vedlejsim tabu se hlasovalo, zmen hodnotu i zde
changeVote($("[type=radio][value='" + e.data.voted + "']", $(".web .domain:contains('" + e.data.domain + "'):eq(0)").siblings(".voting")).prop("checked", true), false);//hlasovat changeVote($("[type=radio][value='" + e.data.voted + "']", $(".web .domain:contains('" + e.data.domain + "'):eq(0)").siblings(".voting")).prop("checked", true), false);//hlasovat
} }
...@@ -231,7 +231,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -231,7 +231,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
$("#analysis-info").text("..."); $("#analysis-info").text("...");
$("#content").before("<iframe width='10px' height='10px' src='" + APP_HOST + "/rest/analyze" + (typeof forceServer === 'undefined' ? "=cached" : "") + "/" + url + "'></iframe>"); $("#content").before("<iframe width='10px' height='10px' src='" + APP_HOST + "/rest/analyze" + (typeof forceServer === 'undefined' ? "=cached" : "") + "/" + url + "'></iframe>");
} else {//pouzit starou analyzu } else {//pouzit starou analyzu
window.postMessage({"analyze": str, "url": "refresh"}, "https://mdm.labs.nic.cz"); window.postMessage({"analyze": str, "url": "refresh"}, "https://mdm.nic.cz");
//reanalyzeButton.show(); //reanalyzeButton.show();
} }
$reanalyzeButton.show(); $reanalyzeButton.show();
...@@ -469,13 +469,13 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -469,13 +469,13 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
if (keepTabOpen === false) {//nechci analyzovat a nemam na praci nic dalsiho, analyza probehla -> projdu si ji pak hromadne if (keepTabOpen === false) {//nechci analyzovat a nemam na praci nic dalsiho, analyza probehla -> projdu si ji pak hromadne
console.log("zaviram okno..."); console.log("zaviram okno...");
if (window.opener) { if (window.opener) {
window.opener.postMessage({"close": "close"}, "https://mdm.labs.nic.cz"); window.opener.postMessage({"close": "close"}, "https://mdm.nic.cz");
} }
window.close();//pro jistotu zkusime zavrit i zde, kdyby parent okno selhalo (ve FF musi byt povoleno about:config allow_scripts_to_close_windows) window.close();//pro jistotu zkusime zavrit i zde, kdyby parent okno selhalo (ve FF musi byt povoleno about:config allow_scripts_to_close_windows)
} else { } else {
console.log("nezaviram okno..."); console.log("nezaviram okno...");
if (window.opener) { if (window.opener) {
window.opener.postMessage({"open": "ok"}, "https://mdm.labs.nic.cz"); window.opener.postMessage({"open": "ok"}, "https://mdm.nic.cz");
} }
//prehazet dopisy - nejnovejsi reakce navrch //prehazet dopisy - nejnovejsi reakce navrch
...@@ -561,7 +561,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) { ...@@ -561,7 +561,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/detail/") === 0) {
if (wellknown.indexOf(domain) !== -1) { if (wellknown.indexOf(domain) !== -1) {
console.log("znama domena..."); console.log("znama domena...");
if (window.opener) { if (window.opener) {
window.opener.postMessage({"close": "wellknown"}, "https://mdm.labs.nic.cz"); window.opener.postMessage({"close": "wellknown"}, "https://mdm.nic.cz");
} }
window.close(); window.close();
return; return;
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
// @name mdm list hrozeb - autoopen // @name mdm list hrozeb - autoopen
// @namespace mdm // @namespace mdm
// @description Hromadne otevre napadené domény. Dá jim do hashe administrátorem zvolene příznaky, co s nimi dělat (poslat maily, analyzovat, telefonovat). // @description Hromadne otevre napadené domény. Dá jim do hashe administrátorem zvolene příznaky, co s nimi dělat (poslat maily, analyzovat, telefonovat).
// @include https://mdm.labs.nic.cz/list/open* // @include https://mdm.nic.cz/list/open*
// @include https://mdm.labs.nic.cz/list/new* // @include https://mdm.nic.cz/list/new*
// @version 1 // @version 1
// @grant none // @grant none
// ==/UserScript== // ==/UserScript==
if (document.location.href.indexOf("https://mdm.labs.nic.cz/list/") === 0) { if (document.location.href.indexOf("https://mdm.nic.cz/list/") === 0) {
$ = j; $ = j;
/** /**
...@@ -52,7 +52,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/list/") === 0) { ...@@ -52,7 +52,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/list/") === 0) {
window.addEventListener("message", function (e) { window.addEventListener("message", function (e) {
console.log(e); console.log(e);
//cross-site security //cross-site security
if (e.origin !== "https://mdm.labs.nic.cz") { if (e.origin !== "https://mdm.nic.cz") {
console.log("wrong origin"); console.log("wrong origin");
return; return;
} }
...@@ -104,7 +104,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/list/") === 0) { ...@@ -104,7 +104,7 @@ if (document.location.href.indexOf("https://mdm.labs.nic.cz/list/") === 0) {
window.addEventListener("message", function (e) { window.addEventListener("message", function (e) {
if (e.data.voted) {//v tabu se hlasovalo if (e.data.voted) {//v tabu se hlasovalo
for (i in popupList) {//preposlat hlasovani ostatnim tabum for (i in popupList) {//preposlat hlasovani ostatnim tabum
popupList[i].postMessage({"voted": e.data.voted, "domain": e.data.domain}, "https://mdm.labs.nic.cz"); popupList[i].postMessage({"voted": e.data.voted, "domain": e.data.domain}, "https://mdm.nic.cz");
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment