forked from MapComplete/MapComplete
Drop goatcounter
This commit is contained in:
parent
673cf95119
commit
5851fecffd
12 changed files with 5 additions and 36 deletions
3
404.html
3
404.html
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self'; script-src 'self' https://gc.zgo.at/; img-src *; connect-src 'self' https://www.openstreetmap.org/ https://api.openstreetmap.org/;">
|
||||
content="default-src 'self'; script-src 'self' ; img-src *; connect-src 'self' https://www.openstreetmap.org/ https://api.openstreetmap.org/;">
|
||||
<link href="./css/mobile.css" rel="stylesheet" />
|
||||
<link href="./css/tagrendering.css" rel="stylesheet" />
|
||||
<link href="./css/index-tailwind-output.css" rel="stylesheet" />
|
||||
|
@ -41,7 +41,6 @@
|
|||
<body>
|
||||
<div id="maindiv" class="h-screen"></div>
|
||||
<script type="module" src="./src/notfound.ts"></script>
|
||||
<script src="./src/loadGoatcounter.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
2
android
2
android
|
@ -1 +1 @@
|
|||
Subproject commit 8a3b8f5ed934c4ab5b15454907ccaa35a4ba552e
|
||||
Subproject commit 1a0e2abf276f356d1c68e828608a4d5342589499
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<meta http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' https://gc.zgo.at/; img-src * data: ; connect-src 'self' https://www.openstreetmap.org/ https://api.openstreetmap.org/ https://pietervdvn.goatcounter.com/;">
|
||||
content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self'; img-src * data: ; connect-src 'self' https://www.openstreetmap.org/ https://api.openstreetmap.org/;">
|
||||
<link href="./css/mobile.css" rel="stylesheet" />
|
||||
<link href="./css/openinghourstable.css" rel="stylesheet" />
|
||||
<link href="./css/tagrendering.css" rel="stylesheet" />
|
||||
|
@ -42,7 +42,6 @@
|
|||
<div id="main"></div>
|
||||
<script src="./src/Logic/Web/AndroidPolyfill.ts" type="module"></script>
|
||||
<script type="module" src="./src/all_themes_index.ts"></script>
|
||||
<script src="./src/loadGoatcounter.js"></script>
|
||||
|
||||
<script async src="./src/InstallServiceWorker.ts" type="module"></script>
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
<body>
|
||||
<div id="main">Loading inspector...</div>
|
||||
<script src="./src/UI/InspectorGUI.ts" type="module"></script>
|
||||
<script src="./src/loadGoatcounter.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' https://gc.zgo.at/; img-src *; connect-src 'self' https://www.openstreetmap.org/ https://api.openstreetmap.org/ https://pietervdvn.goatcounter.com/;">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' ; img-src *; connect-src 'self' https://www.openstreetmap.org/ https://api.openstreetmap.org/ ;">
|
||||
<link href="./css/mobile.css" rel="stylesheet"/>
|
||||
<link href="./css/openinghourstable.css" rel="stylesheet"/>
|
||||
<link href="./css/tagrendering.css" rel="stylesheet"/>
|
||||
|
@ -38,7 +38,5 @@
|
|||
<div id="main"></div>
|
||||
<script type="module" src="./src/privacy_index.ts"></script>
|
||||
|
||||
<script src="./src/loadGoatcounter.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -439,7 +439,6 @@ class GenerateLayouts extends Script {
|
|||
"style-src": "'self' 'unsafe-inline'", // unsafe-inline is needed to change the default background pin colours
|
||||
"script-src": [
|
||||
"'self'",
|
||||
"https://gc.zgo.at/count.js",
|
||||
...(options?.scriptSrcs?.map((s) => "'" + s + "'") ?? []),
|
||||
].join(" "),
|
||||
"connect-src": "'self' " + connectSrc.join(" "),
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
const script = document.createElement("script")
|
||||
script.async = true
|
||||
script.dataset.goatcounter = "https://pietervdvn.goatcounter.com/count"
|
||||
script.src = "https://gc.zgo.at/count.js"
|
||||
script.crossOrigin = "anonymous"
|
||||
script.integrity = "sha384-atnOLvQb9t+jTSipvd75X2yginT4PjVbqDdlJAmxMm+wYElFmeR6EmLP5bYeoRVQ"
|
||||
document.head.appendChild(script)
|
|
@ -12,7 +12,6 @@
|
|||
<body>
|
||||
<div id="main">Loading statistics...</div>
|
||||
<script src="./src/UI/StatisticsGUI.ts" type="module"></script>
|
||||
<script src="./src/loadGoatcounter.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
<body>
|
||||
<div id="main"></div>
|
||||
<script src="./src/UI/StatusGui.ts" type="module"></script>
|
||||
<script src="./src/loadGoatcounter.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<body>
|
||||
<div id="main" class="h-full"></div>
|
||||
<script src="./src/UI/StudioGui.ts" type="module"></script>
|
||||
<script src="./src/loadGoatcounter.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -154,20 +154,7 @@ describe("Code quality", () => {
|
|||
)
|
||||
)
|
||||
|
||||
test("scripts with external sources should have an integrity hash", async () => {
|
||||
const htmlFiles = ScriptUtils.readDirRecSync(".", 1).filter((f) => f.endsWith(".html"))
|
||||
for (const htmlFile of htmlFiles) {
|
||||
await validateScriptIntegrityOf(htmlFile)
|
||||
}
|
||||
const goatCounter = "https://gc.zgo.at/count.js"
|
||||
const data: string = (await ScriptUtils.Download(goatCounter))["content"]
|
||||
const hashed = await webcrypto.subtle.digest("SHA-384", new TextEncoder().encode(data))
|
||||
const hashedB64 = _arrayBufferToBase64(hashed)
|
||||
const goatCounterScript = readFileSync("./src/loadGoatcounter.js", "utf-8")
|
||||
if (goatCounterScript.indexOf(hashedB64) < 0) {
|
||||
throw "Hash sha-384" + hashedB64 + " not found in 'loadGoatcounter.js'"
|
||||
}
|
||||
})
|
||||
|
||||
/*
|
||||
itAsync(
|
||||
"should not contain 'import * as name from \"xyz.json\"'",
|
||||
|
|
|
@ -92,8 +92,6 @@
|
|||
<script src="./src/Logic/Web/AndroidPolyfill.ts" type="module"></script>
|
||||
<script async src="./src/InstallServiceWorker.ts" type="module"></script>
|
||||
<script defer src="./src/index.ts" type="module"></script>
|
||||
<script src="./src/loadGoatcounter.js"></script>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue