From f2fdd55c873af61ac23527c424f33d0d76749854 Mon Sep 17 00:00:00 2001 From: Francisco Bischoff Date: Sat, 23 Dec 2023 00:03:06 +0000 Subject: [PATCH] fix sandbox --- .devcontainer/devcontainer.json | 58 +++--------------------- collector/processLink/convert/generic.js | 1 - 2 files changed, 7 insertions(+), 52 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 45a7a3bfa3..dad7e12323 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -15,17 +15,9 @@ "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bookworm", // Features to add to the dev container. More info: https://containers.dev/features. "features": { - // "ghcr.io/devcontainers/features/python:1": { - // "installTools": true, - // "version": "3.11" // PEP 664 - https://www.python.org/dev/peps/pep-0664/ - // }, - "ghcr.io/devcontainers-contrib/features/tailscale:1": {}, "ghcr.io/dhoeric/features/hadolint:1": { "version": "latest" }, - // "ghcr.io/devcontainers-contrib/features/pandoc:1": { - // "version": "3.1.3" - // }, "ghcr.io/devcontainers/features/terraform:1": {}, "ghcr.io/rocker-org/devcontainer-features/apt-packages:1": { // Dependencies copied from ../docker/Dockerfile // something is needed to make web collector to work @@ -78,10 +70,8 @@ "build-essential", "ffmpeg" ] - }, - "capAdd": "SYS_ADMIN" + } }, - // "onCreateCommand": "cd collector && virtualenv v-env", "updateContentCommand": "yarn setup && yarn setup:envs && yarn prisma:setup", // Use 'postCreateCommand' to run commands after the container is created. "postCreateCommand": "if [ \"${CODESPACES}\" = \"true\" ]; then echo 'VITE_API_BASE=\"https://$CODESPACE_NAME-3001.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN/api\"' > ./frontend/.env; fi", @@ -95,24 +85,22 @@ "onAutoForward": "openPreview" } }, + "capAdd": [ + "SYS_ADMIN" // needed for puppeteer using headless chrome in sandbox + ], "remoteEnv": { "NODE_ENV": "development", "ESLINT_USE_FLAT_CONFIG": "true" }, + // "initializeCommand": "echo Initialize....", "shutdownAction": "stopContainer", // Configure tool-specific properties. "customizations": { "codespaces": { - "openFiles": [ - "README.md", - ".devcontainer/README.md" - ] + "openFiles": ["README.md", ".devcontainer/README.md"] }, "vscode": { - "openFiles": [ - "README.md", - ".devcontainer/README.md" - ], + "openFiles": ["README.md", ".devcontainer/README.md"], "extensions": [ "bierner.github-markdown-preview", "bradlc.vscode-tailwindcss", @@ -125,15 +113,10 @@ "hashicorp.terraform", "mariusschulz.yarn-lock-syntax", "ms-azuretools.vscode-docker", - // "ms-python.python", "streetsidesoftware.code-spell-checker", "actboy168.tasks", "tombonnike.vscode-status-bar-format-toggle", "ms-vscode.js-debug" - // "ms-python.vscode-pylance", - // "ms-python.black-formatter", - // "ms-python.debugpy", - // "ms-python.pylint" ], "settings": { "[css]": { @@ -169,33 +152,6 @@ "[toml]": { "editor.defaultFormatter": "tamasfe.even-better-toml" }, - // "[python]": { - // "editor.defaultFormatter": "ms-python.black-formatter" - // }, - // "black-formatter.args": [ - // "--config", - // "${workspaceFolder}/collector/pyproject.toml" - // ], - // "python.envFile": "${workspaceFolder}/collector/.env", - // "python.defaultInterpreterPath": "${workspaceFolder}/collector/v-env/bin/python", - // "python.languageServer": "Pylance", - // "python.missingPackage.severity": "Hint", - // "python.createEnvironment.trigger": "prompt", - // "python.createEnvironment.contentButton": "show", - // "python.analysis.diagnosticMode": "openFilesOnly", - // "python.analysis.enablePytestExtra": false, - // "python.analysis.enableSyncServer": false, - // "python.analysis.inlayHints.functionReturnTypes": true, - // "python.analysis.inlayHints.variableTypes": true, - // "python.analysis.typeCheckingMode": "basic", - // "python.analysis.useLibraryCodeForTypes": true, - // "python.analysis.autoFormatStrings": true, - // "python.analysis.inlayHints.callArgumentNames": "partial", - // "pylint.args": [ - // "--rcfile", - // "${workspaceFolder}/collector/.pylintrc" - // ], - // "pylint.importStrategy": "useBundled", "eslint.debug": true, "eslint.enable": true, "eslint.experimental.useFlatConfig": true, diff --git a/collector/processLink/convert/generic.js b/collector/processLink/convert/generic.js index c66c81d567..f42dcd171d 100644 --- a/collector/processLink/convert/generic.js +++ b/collector/processLink/convert/generic.js @@ -43,7 +43,6 @@ async function getPageContent(link) { const loader = new PuppeteerWebBaseLoader(link, { launchOptions: { headless: "new", - // args: ["--disable-sandbox", "--disable-setuid-sandbox"], }, gotoOptions: { waitUntil: "domcontentloaded",