tracking-exposed / trex

youtube & tiktok analysis + youchoose recommendation custmizer. backend, extensions, and tooling
https://docs.tracking.exposed
GNU Affero General Public License v3.0
55 stars 15 forks source link

while testing guardoni app, development files are ignored #615

Open vecna opened 2 years ago

vecna commented 2 years ago

from platforms/guardoni

yarn watch:app correctly build an application with localhost as endpoint.

but when i test it with npm run dev or yarn dev from the same folder, the connections are going to the production server

vecna commented 2 years ago

even by ensuring development config the default isn't override

v :~/D/trex/platforms/guardoni daily $ NODE_ENV=development DOT_ENV_CONFIG=.env.development DEBUG=* $(npm bin)/electron . 
14:28:30.711 › Guardoni start /home/v/D/trex/platforms/guardoni
14:28:30.714 › Loaded env {
  VERSION: '2.6.1',
  NODE_ENV: 'development',
  DEBUG: '@trex:*,guardoni:*',
  YT_BACKEND: 'http://localhost:9000/api',
  TK_BACKEND: 'http://localhost:14000/api'
}

DevTools listening on ws://127.0.0.1:45315/devtools/browser/be932678-bea0-4923-a10c-153336c27a90
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[315316:0811/142830.846172:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
14:28:31.126 › Unregister all events [
  'PICK_CSV_FILE_EVENT',
  'GET_GUARDONI_CONFIG_EVENT',
  'SET_GUARDONI_CONFIG_EVENT',
  'GET_GUARDONI_ENV_EVENT',
  'OPEN_GUARDONI_DIR',
  'CREATE_EXPERIMENT_EVENT',
  'GET_PUBLIC_DIRECTIVES',
  'GET_PUBLIC_DIRECTIVE',
  'RUN_GUARDONI_EVENT',
  'RUN_AUTO_GUARDONI_EVENT',
  'GUARDONI_ERROR_EVENT',
  'GUARDONI_OUTPUT_EVENT',
  'GLOBAL_ERROR_EVENT',
  'CHANGE_PLATFORM_EVENT'
]
14:28:31.127 › Register events on ipcMain
14:28:31.128 › Get config with defaults {} for platform youtube
14:28:31.128 › Research Tag 'no-tag-14349'
14:28:31.129 › Reading config from path /home/v/.guardoni/guardoni.config.json
14:28:31.129 › Override conf sanitized { researchTag: 'no-tag-14349', basePath: '/home/v/.guardoni' }
14:28:31.129 › Config file path [/home/v/.guardoni/guardoni.config.json] exists ? (true)
  guardoni:utils:debug Chrome possible paths ["/usr/bin/google-chrome","/Program Files (x86)/Google/Chrome/Application/chrome.exe","/Program Files/Google/Chrome/Application/chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","/Applications/Chromium.app/Contents/MacOS/Chromium","/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"] +0ms
  guardoni:utils:debug Chrome path /usr/bin/google-chrome +1ms
14:28:31.131 › Config {
  chromePath: '/usr/bin/google-chrome',
  headless: true,
  verbose: false,
  loadFor: 3000,
  basePath: '/home/v/.guardoni',
  profileName: 'default',
  researchTag: 'no-tag-14349',
  tosAccepted: true,
  yt: {
    name: 'youtube',
    backend: 'https://youtube.tracking.exposed/api',
    frontend: 'https://youtube.tracking.exposed',
    extensionDir: '/home/v/.guardoni/extension/yt'
  },
  tk: {
    name: 'tiktok',
    backend: 'https://tiktok.tracking.exposed/api',
    frontend: 'https://tiktok.tracking.exposed',
    extensionDir: '/home/v/.guardoni/extension/tk'
  }
}
  guardoni:events:info Init guardoni with config {
  guardoni:events:info   chromePath: '/usr/bin/google-chrome',
  guardoni:events:info   headless: true,
  guardoni:events:info   verbose: false,
  guardoni:events:info   loadFor: 3000,
  guardoni:events:info   basePath: '/home/v/.guardoni',
  guardoni:events:info   profileName: 'default',
  guardoni:events:info   researchTag: 'no-tag-14349',
  guardoni:events:info   tosAccepted: true,
  guardoni:events:info   yt: {
  guardoni:events:info     name: 'youtube',
  guardoni:events:info     backend: 'https://youtube.tracking.exposed/api',
  guardoni:events:info     frontend: 'https://youtube.tracking.exposed',
  guardoni:events:info     extensionDir: '/home/v/.guardoni/extension/yt',
  guardoni:events:info     proxy: undefined
  guardoni:events:info   },
  guardoni:events:info   tk: {
  guardoni:events:info     name: 'tiktok',
  guardoni:events:info     backend: 'https://tiktok.tracking.exposed/api',
  guardoni:events:info     frontend: 'https://tiktok.tracking.exposed',
  guardoni:events:info     extensionDir: '/home/v/.guardoni/extension/tk',
  guardoni:events:info     proxy: undefined
  guardoni:events:info   },
  guardoni:events:info   advScreenshotDir: undefined,
  guardoni:events:info   excludeURLTag: undefined,
  guardoni:events:info   publicKey: undefined,
  guardoni:events:info   secretKey: undefined
  guardoni:events:info } for platform youtube +0ms
vecna commented 2 years ago

also, npm run dev calls a non existent ../../.env.development and if you use the current one, it gives a format error

v :~/D/trex/platforms/guardoni daily $ DOTENV_CONFIG_PATH=.env.development DEBUG=* $(npm bin)/electron . -v
12:47:20.132 › Guardoni start /home/v/D/trex/platforms/guardoni
12:47:20.135 › An error occurred {
  name: 'EnvError',
  message: 'process.env is malformed',
  details: [
    'Invalid value undefined supplied to : AppEnv/NODE_ENV: ("development" | "production")/0: "development"',
    'Invalid value undefined supplied to : AppEnv/NODE_ENV: ("development" | "production")/1: "production"',
    'Invalid value undefined supplied to : AppEnv/YT_BACKEND: string',
    'Invalid value undefined supplied to : AppEnv/TK_BACKEND: string'
  ]
}
AppError {
  name: 'EnvError',
  message: 'process.env is malformed',
  details: [
    'Invalid value undefined supplied to : AppEnv/NODE_ENV: ("development" | "production")/0: "development"',
    'Invalid value undefined supplied to : AppEnv/NODE_ENV: ("development" | "production")/1: "production"',
    'Invalid value undefined supplied to : AppEnv/YT_BACKEND: string',
    'Invalid value undefined supplied to : AppEnv/TK_BACKEND: string'
  ]
}
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[354971:0812/124720.254974:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
^C/home/v/D/trex/node_modules/electron/dist/electron exited with signal SIGINT
v :~/D/trex/platforms/guardoni daily $