mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Solved oauth2 bugs and deactivated health-csp role temporary
This commit is contained in:
@@ -31,7 +31,7 @@ Set the following variables to customize behavior:
|
||||
```yaml
|
||||
health_csp_crawler_folder: "{{ path_administrator_scripts }}health-csp/"
|
||||
on_calendar_health_csp_crawler: "daily"
|
||||
````
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
@@ -1,43 +0,0 @@
|
||||
const puppeteer = require('puppeteer');
|
||||
const domains = process.argv.slice(2);
|
||||
|
||||
(async () => {
|
||||
let errorCounter = 0;
|
||||
const browser = await puppeteer.launch({ headless: 'new' });
|
||||
|
||||
for (const domain of domains) {
|
||||
const page = await browser.newPage();
|
||||
const blockedResources = [];
|
||||
|
||||
page.on('requestfailed', request => {
|
||||
const reason = request.failure()?.errorText || '';
|
||||
if (reason.includes('blocked')) {
|
||||
blockedResources.push({ url: request.url(), reason });
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
const url = `https://${domain}`;
|
||||
await page.goto(url, { waitUntil: 'networkidle2', timeout: 20000 });
|
||||
} catch (e) {
|
||||
console.error(`${domain}: ERROR visiting site - ${e.message}`);
|
||||
errorCounter++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (blockedResources.length > 0) {
|
||||
console.warn(`${domain}: Blocked resources detected:`);
|
||||
blockedResources.forEach(r =>
|
||||
console.log(` BLOCKED by CSP: ${r.url} (${r.reason})`)
|
||||
);
|
||||
errorCounter++;
|
||||
} else {
|
||||
console.log(`${domain}: ✅ No CSP blocks detected.`);
|
||||
}
|
||||
|
||||
await page.close();
|
||||
}
|
||||
|
||||
await browser.close();
|
||||
process.exit(errorCounter);
|
||||
})();
|
@@ -32,7 +32,7 @@ def run_node_checker(script_path, domains):
|
||||
"""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["/usr/bin/node", script_path] + domains,
|
||||
["node", script_path] + domains,
|
||||
check=True
|
||||
)
|
||||
return result.returncode
|
@@ -17,9 +17,9 @@
|
||||
register: puppeteer_check
|
||||
failed_when: puppeteer_check.rc != 0
|
||||
|
||||
- name: copy health_csp.py
|
||||
- name: copy health-csp.py
|
||||
copy:
|
||||
src: health_csp.py
|
||||
src: health-csp.py
|
||||
dest: "{{ health_csp_crawler_script }}"
|
||||
mode: 0755
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
health_csp_crawler_folder: "{{ path_administrator_scripts }}health-csp/"
|
||||
health_csp_crawler_script: "{{ health_csp_crawler_folder }}health_csp.py"
|
||||
health_csp_crawler_script: "{{ health_csp_crawler_folder }}health-csp.py"
|
||||
health_csp_crawler_node: "{{ health_csp_crawler_folder }}health-csp.js"
|
Reference in New Issue
Block a user