diff --git a/config/cloudflare.ini.sample b/config/cloudflare.ini.sample deleted file mode 100644 index 257bccd..0000000 --- a/config/cloudflare.ini.sample +++ /dev/null @@ -1,3 +0,0 @@ -# --- Let's Encrypt DNS challenge, not needed for self-hosting - -dns_cloudflare_api_token = xxx diff --git a/init-server.py b/init-server.py index 1e5d5a8..e9c6965 100755 --- a/init-server.py +++ b/init-server.py @@ -9,8 +9,6 @@ from ssh_lib.tasks import ( prepare_shared, prepare_tile_gen, run_http_host_sync, - setup_loadbalancer, - setup_roundrobin_writer, ) from ssh_lib.utils import ( put, @@ -113,29 +111,6 @@ def tile_gen( prepare_tile_gen(c, enable_cron=cron) -@cli.command() -@common_options -def roundrobin_dns_writer(hostname, user, port, noninteractive): - if not noninteractive and not click.confirm(f'Run script on {hostname}?'): - return - - c = get_connection(hostname, user, port) - - setup_roundrobin_writer(c) - - -@cli.command() -@common_options -def loadbalancer(hostname, user, port, noninteractive): - if not noninteractive and not click.confirm(f'Run script on {hostname}?'): - return - - c = get_connection(hostname, user, port) - prepare_shared(c) - - setup_loadbalancer(c) - - @cli.command() @common_options def http_host_sync(hostname, user, port, noninteractive): diff --git a/modules/debug_proxy/.gitignore b/modules/debug_proxy/.gitignore deleted file mode 100644 index 3b0fe33..0000000 --- a/modules/debug_proxy/.gitignore +++ /dev/null @@ -1,172 +0,0 @@ -# Logs - -logs -_.log -npm-debug.log_ -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) - -report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json - -# Runtime data - -pids -_.pid -_.seed -\*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover - -lib-cov - -# Coverage directory used by tools like istanbul - -coverage -\*.lcov - -# nyc test coverage - -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) - -.grunt - -# Bower dependency directory (https://bower.io/) - -bower_components - -# node-waf configuration - -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) - -build/Release - -# Dependency directories - -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) - -web_modules/ - -# TypeScript cache - -\*.tsbuildinfo - -# Optional npm cache directory - -.npm - -# Optional eslint cache - -.eslintcache - -# Optional stylelint cache - -.stylelintcache - -# Microbundle cache - -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history - -.node_repl_history - -# Output of 'npm pack' - -\*.tgz - -# Yarn Integrity file - -.yarn-integrity - -# dotenv environment variable files - -.env -.env.development.local -.env.test.local -.env.production.local -.env.local - -# parcel-bundler cache (https://parceljs.org/) - -.cache -.parcel-cache - -# Next.js build output - -.next -out - -# Nuxt.js build / generate output - -.nuxt -dist - -# Gatsby files - -.cache/ - -# Comment in the public line in if your project uses Gatsby and not Next.js - -# https://nextjs.org/blog/next-9-1#public-directory-support - -# public - -# vuepress build output - -.vuepress/dist - -# vuepress v2.x temp and cache directory - -.temp -.cache - -# Docusaurus cache and generated files - -.docusaurus - -# Serverless directories - -.serverless/ - -# FuseBox cache - -.fusebox/ - -# DynamoDB Local files - -.dynamodb/ - -# TernJS port file - -.tern-port - -# Stores VSCode versions used for testing VSCode extensions - -.vscode-test - -# yarn v2 - -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.\* - -# wrangler project - -.dev.vars -.wrangler/ diff --git a/modules/debug_proxy/package.json b/modules/debug_proxy/package.json deleted file mode 100644 index 6456bb7..0000000 --- a/modules/debug_proxy/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "cf-debug-proxy", - "version": "0.0.0", - "private": true, - "scripts": { - "deploy": "wrangler deploy", - "dev": "wrangler dev", - "start": "wrangler dev" - }, - "devDependencies": { - "itty-router": "^3.0.12", - "wrangler": "^3.60.3" - } -} diff --git a/modules/debug_proxy/pnpm-lock.yaml b/modules/debug_proxy/pnpm-lock.yaml deleted file mode 100644 index 5978d42..0000000 --- a/modules/debug_proxy/pnpm-lock.yaml +++ /dev/null @@ -1,1142 +0,0 @@ -lockfileVersion: '6.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -devDependencies: - itty-router: - specifier: ^3.0.12 - version: 3.0.12 - wrangler: - specifier: ^3.60.3 - version: 3.62.0 - -packages: - /@cloudflare/kv-asset-handler@0.3.4: - resolution: - { - integrity: sha512-YLPHc8yASwjNkmcDMQMY35yiWjoKAKnhUbPRszBRS0YgH+IXtsMp61j+yTcnCE3oO2DgP0U3iejLC8FTtKDC8Q==, - } - engines: { node: '>=16.13' } - dependencies: - mime: 3.0.0 - dev: true - - /@cloudflare/workerd-darwin-64@1.20240620.1: - resolution: - { - integrity: sha512-YWeS2aE8jAzDefuus/3GmZcFGu3Ef94uCAoxsQuaEXNsiGM9NeAhPpKC1BJAlcv168U/Q1J+6hckcGtipf6ZcQ==, - } - engines: { node: '>=16' } - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@cloudflare/workerd-darwin-arm64@1.20240620.1: - resolution: - { - integrity: sha512-3rdND+EHpmCrwYX6hvxIBSBJ0f40tRNxond1Vfw7GiR1MJVi3gragiBx75UDFHCxfRw3J0GZ1qVlkRce2/Xbsg==, - } - engines: { node: '>=16' } - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@cloudflare/workerd-linux-64@1.20240620.1: - resolution: - { - integrity: sha512-tURcTrXGeSbYqeM5ISVcofY20StKbVIcdxjJvNYNZ+qmSV9Fvn+zr7rRE+q64pEloVZfhsEPAlUCnFso5VV4XQ==, - } - engines: { node: '>=16' } - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@cloudflare/workerd-linux-arm64@1.20240620.1: - resolution: - { - integrity: sha512-TThvkwNxaZFKhHZnNjOGqIYCOk05DDWgO+wYMuXg15ymN/KZPnCicRAkuyqiM+R1Fgc4kwe/pehjP8pbmcf6sg==, - } - engines: { node: '>=16' } - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@cloudflare/workerd-windows-64@1.20240620.1: - resolution: - { - integrity: sha512-Y/BA9Yj0r7Al1HK3nDHcfISgFllw6NR3XMMPChev57vrVT9C9D4erBL3sUBfofHU+2U9L+ShLsl6obBpe3vvUw==, - } - engines: { node: '>=16' } - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@cspotcode/source-map-support@0.8.1: - resolution: - { - integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==, - } - engines: { node: '>=12' } - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - dev: true - - /@esbuild-plugins/node-globals-polyfill@0.2.3(esbuild@0.17.19): - resolution: - { - integrity: sha512-r3MIryXDeXDOZh7ih1l/yE9ZLORCd5e8vWg02azWRGj5SPTuoh69A2AIyn0Z31V/kHBfZ4HgWJ+OK3GTTwLmnw==, - } - peerDependencies: - esbuild: '*' - dependencies: - esbuild: 0.17.19 - dev: true - - /@esbuild-plugins/node-modules-polyfill@0.2.2(esbuild@0.17.19): - resolution: - { - integrity: sha512-LXV7QsWJxRuMYvKbiznh+U1ilIop3g2TeKRzUxOG5X3YITc8JyyTa90BmLwqqv0YnX4v32CSlG+vsziZp9dMvA==, - } - peerDependencies: - esbuild: '*' - dependencies: - esbuild: 0.17.19 - escape-string-regexp: 4.0.0 - rollup-plugin-node-polyfills: 0.2.1 - dev: true - - /@esbuild/android-arm64@0.17.19: - resolution: - { - integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/android-arm@0.17.19: - resolution: - { - integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==, - } - engines: { node: '>=12' } - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/android-x64@0.17.19: - resolution: - { - integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /@esbuild/darwin-arm64@0.17.19: - resolution: - { - integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@esbuild/darwin-x64@0.17.19: - resolution: - { - integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@esbuild/freebsd-arm64@0.17.19: - resolution: - { - integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/freebsd-x64@0.17.19: - resolution: - { - integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-arm64@0.17.19: - resolution: - { - integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-arm@0.17.19: - resolution: - { - integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==, - } - engines: { node: '>=12' } - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-ia32@0.17.19: - resolution: - { - integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==, - } - engines: { node: '>=12' } - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-loong64@0.17.19: - resolution: - { - integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==, - } - engines: { node: '>=12' } - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-mips64el@0.17.19: - resolution: - { - integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==, - } - engines: { node: '>=12' } - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-ppc64@0.17.19: - resolution: - { - integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==, - } - engines: { node: '>=12' } - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-riscv64@0.17.19: - resolution: - { - integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==, - } - engines: { node: '>=12' } - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-s390x@0.17.19: - resolution: - { - integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==, - } - engines: { node: '>=12' } - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/linux-x64@0.17.19: - resolution: - { - integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@esbuild/netbsd-x64@0.17.19: - resolution: - { - integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/openbsd-x64@0.17.19: - resolution: - { - integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /@esbuild/sunos-x64@0.17.19: - resolution: - { - integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-arm64@0.17.19: - resolution: - { - integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==, - } - engines: { node: '>=12' } - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-ia32@0.17.19: - resolution: - { - integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==, - } - engines: { node: '>=12' } - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@esbuild/win32-x64@0.17.19: - resolution: - { - integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==, - } - engines: { node: '>=12' } - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@fastify/busboy@2.1.1: - resolution: - { - integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==, - } - engines: { node: '>=14' } - dev: true - - /@jridgewell/resolve-uri@3.1.2: - resolution: - { - integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==, - } - engines: { node: '>=6.0.0' } - dev: true - - /@jridgewell/sourcemap-codec@1.4.15: - resolution: - { - integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==, - } - dev: true - - /@jridgewell/trace-mapping@0.3.9: - resolution: - { - integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==, - } - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - dev: true - - /@types/node-forge@1.3.11: - resolution: - { - integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==, - } - dependencies: - '@types/node': 20.14.9 - dev: true - - /@types/node@20.14.9: - resolution: - { - integrity: sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg==, - } - dependencies: - undici-types: 5.26.5 - dev: true - - /acorn-walk@8.3.3: - resolution: - { - integrity: sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==, - } - engines: { node: '>=0.4.0' } - dependencies: - acorn: 8.12.0 - dev: true - - /acorn@8.12.0: - resolution: - { - integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==, - } - engines: { node: '>=0.4.0' } - hasBin: true - dev: true - - /anymatch@3.1.3: - resolution: - { - integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==, - } - engines: { node: '>= 8' } - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - dev: true - - /as-table@1.0.55: - resolution: - { - integrity: sha512-xvsWESUJn0JN421Xb9MQw6AsMHRCUknCe0Wjlxvjud80mU4E6hQf1A6NzQKcYNmYw62MfzEtXc+badstZP3JpQ==, - } - dependencies: - printable-characters: 1.0.42 - dev: true - - /binary-extensions@2.3.0: - resolution: - { - integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==, - } - engines: { node: '>=8' } - dev: true - - /blake3-wasm@2.1.5: - resolution: - { - integrity: sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==, - } - dev: true - - /braces@3.0.3: - resolution: - { - integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==, - } - engines: { node: '>=8' } - dependencies: - fill-range: 7.1.1 - dev: true - - /capnp-ts@0.7.0: - resolution: - { - integrity: sha512-XKxXAC3HVPv7r674zP0VC3RTXz+/JKhfyw94ljvF80yynK6VkTnqE3jMuN8b3dUVmmc43TjyxjW4KTsmB3c86g==, - } - dependencies: - debug: 4.3.5 - tslib: 2.6.3 - transitivePeerDependencies: - - supports-color - dev: true - - /chokidar@3.6.0: - resolution: - { - integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==, - } - engines: { node: '>= 8.10.0' } - dependencies: - anymatch: 3.1.3 - braces: 3.0.3 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 - dev: true - - /consola@3.2.3: - resolution: - { - integrity: sha512-I5qxpzLv+sJhTVEoLYNcTW+bThDCPsit0vLNKShZx6rLtpilNpmmeTPaeqJb9ZE9dV3DGaeby6Vuhrw38WjeyQ==, - } - engines: { node: ^14.18.0 || >=16.10.0 } - dev: true - - /cookie@0.5.0: - resolution: - { - integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==, - } - engines: { node: '>= 0.6' } - dev: true - - /data-uri-to-buffer@2.0.2: - resolution: - { - integrity: sha512-ND9qDTLc6diwj+Xe5cdAgVTbLVdXbtxTJRXRhli8Mowuaan+0EJOtdqJ0QCHNSSPyoXGx9HX2/VMnKeC34AChA==, - } - dev: true - - /date-fns@3.6.0: - resolution: - { - integrity: sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==, - } - dev: true - - /debug@4.3.5: - resolution: - { - integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==, - } - engines: { node: '>=6.0' } - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - - /defu@6.1.4: - resolution: - { - integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==, - } - dev: true - - /esbuild@0.17.19: - resolution: - { - integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==, - } - engines: { node: '>=12' } - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/android-arm': 0.17.19 - '@esbuild/android-arm64': 0.17.19 - '@esbuild/android-x64': 0.17.19 - '@esbuild/darwin-arm64': 0.17.19 - '@esbuild/darwin-x64': 0.17.19 - '@esbuild/freebsd-arm64': 0.17.19 - '@esbuild/freebsd-x64': 0.17.19 - '@esbuild/linux-arm': 0.17.19 - '@esbuild/linux-arm64': 0.17.19 - '@esbuild/linux-ia32': 0.17.19 - '@esbuild/linux-loong64': 0.17.19 - '@esbuild/linux-mips64el': 0.17.19 - '@esbuild/linux-ppc64': 0.17.19 - '@esbuild/linux-riscv64': 0.17.19 - '@esbuild/linux-s390x': 0.17.19 - '@esbuild/linux-x64': 0.17.19 - '@esbuild/netbsd-x64': 0.17.19 - '@esbuild/openbsd-x64': 0.17.19 - '@esbuild/sunos-x64': 0.17.19 - '@esbuild/win32-arm64': 0.17.19 - '@esbuild/win32-ia32': 0.17.19 - '@esbuild/win32-x64': 0.17.19 - dev: true - - /escape-string-regexp@4.0.0: - resolution: - { - integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==, - } - engines: { node: '>=10' } - dev: true - - /estree-walker@0.6.1: - resolution: - { - integrity: sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==, - } - dev: true - - /exit-hook@2.2.1: - resolution: - { - integrity: sha512-eNTPlAD67BmP31LDINZ3U7HSF8l57TxOY2PmBJ1shpCvpnxBF93mWCE8YHBnXs8qiUZJc9WDcWIeC3a2HIAMfw==, - } - engines: { node: '>=6' } - dev: true - - /fill-range@7.1.1: - resolution: - { - integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==, - } - engines: { node: '>=8' } - dependencies: - to-regex-range: 5.0.1 - dev: true - - /fsevents@2.3.3: - resolution: - { - integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==, - } - engines: { node: ^8.16.0 || ^10.6.0 || >=11.0.0 } - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /function-bind@1.1.2: - resolution: - { - integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==, - } - dev: true - - /get-source@2.0.12: - resolution: - { - integrity: sha512-X5+4+iD+HoSeEED+uwrQ07BOQr0kEDFMVqqpBuI+RaZBpBpHCuXxo70bjar6f0b0u/DQJsJ7ssurpP0V60Az+w==, - } - dependencies: - data-uri-to-buffer: 2.0.2 - source-map: 0.6.1 - dev: true - - /glob-parent@5.1.2: - resolution: - { - integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==, - } - engines: { node: '>= 6' } - dependencies: - is-glob: 4.0.3 - dev: true - - /glob-to-regexp@0.4.1: - resolution: - { - integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==, - } - dev: true - - /hasown@2.0.2: - resolution: - { - integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==, - } - engines: { node: '>= 0.4' } - dependencies: - function-bind: 1.1.2 - dev: true - - /is-binary-path@2.1.0: - resolution: - { - integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==, - } - engines: { node: '>=8' } - dependencies: - binary-extensions: 2.3.0 - dev: true - - /is-core-module@2.14.0: - resolution: - { - integrity: sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==, - } - engines: { node: '>= 0.4' } - dependencies: - hasown: 2.0.2 - dev: true - - /is-extglob@2.1.1: - resolution: - { - integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==, - } - engines: { node: '>=0.10.0' } - dev: true - - /is-glob@4.0.3: - resolution: - { - integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==, - } - engines: { node: '>=0.10.0' } - dependencies: - is-extglob: 2.1.1 - dev: true - - /is-number@7.0.0: - resolution: - { - integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==, - } - engines: { node: '>=0.12.0' } - dev: true - - /itty-router@3.0.12: - resolution: - { - integrity: sha512-s98XTPhle6GGbaFf0kYrOD3Q8gyhnqvOqkwYijC3AmkceNKqWUp13YHg6dWmqmVv4pP7l7c94XI92I0EXVGO0w==, - } - dev: true - - /magic-string@0.25.9: - resolution: - { - integrity: sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==, - } - dependencies: - sourcemap-codec: 1.4.8 - dev: true - - /mime@3.0.0: - resolution: - { - integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==, - } - engines: { node: '>=10.0.0' } - hasBin: true - dev: true - - /miniflare@3.20240620.0: - resolution: - { - integrity: sha512-NBMzqUE2mMlh/hIdt6U5MP+aFhEjKDq3l8CAajXAQa1WkndJdciWvzB2mfLETwoVFhMl/lphaVzyEN2AgwJpbQ==, - } - engines: { node: '>=16.13' } - hasBin: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - acorn: 8.12.0 - acorn-walk: 8.3.3 - capnp-ts: 0.7.0 - exit-hook: 2.2.1 - glob-to-regexp: 0.4.1 - stoppable: 1.1.0 - undici: 5.28.4 - workerd: 1.20240620.1 - ws: 8.17.1 - youch: 3.3.3 - zod: 3.23.8 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: true - - /ms@2.1.2: - resolution: - { - integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==, - } - dev: true - - /mustache@4.2.0: - resolution: - { - integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==, - } - hasBin: true - dev: true - - /nanoid@3.3.7: - resolution: - { - integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==, - } - engines: { node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1 } - hasBin: true - dev: true - - /node-fetch-native@1.6.4: - resolution: - { - integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==, - } - dev: true - - /node-forge@1.3.1: - resolution: - { - integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==, - } - engines: { node: '>= 6.13.0' } - dev: true - - /normalize-path@3.0.0: - resolution: - { - integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==, - } - engines: { node: '>=0.10.0' } - dev: true - - /path-parse@1.0.7: - resolution: - { - integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==, - } - dev: true - - /path-to-regexp@6.2.2: - resolution: - { - integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==, - } - dev: true - - /pathe@1.1.2: - resolution: - { - integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==, - } - dev: true - - /picomatch@2.3.1: - resolution: - { - integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==, - } - engines: { node: '>=8.6' } - dev: true - - /printable-characters@1.0.42: - resolution: - { - integrity: sha512-dKp+C4iXWK4vVYZmYSd0KBH5F/h1HoZRsbJ82AVKRO3PEo8L4lBS/vLwhVtpwwuYcoIsVY+1JYKR268yn480uQ==, - } - dev: true - - /readdirp@3.6.0: - resolution: - { - integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==, - } - engines: { node: '>=8.10.0' } - dependencies: - picomatch: 2.3.1 - dev: true - - /resolve.exports@2.0.2: - resolution: - { - integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==, - } - engines: { node: '>=10' } - dev: true - - /resolve@1.22.8: - resolution: - { - integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==, - } - hasBin: true - dependencies: - is-core-module: 2.14.0 - path-parse: 1.0.7 - supports-preserve-symlinks-flag: 1.0.0 - dev: true - - /rollup-plugin-inject@3.0.2: - resolution: - { - integrity: sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==, - } - deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject. - dependencies: - estree-walker: 0.6.1 - magic-string: 0.25.9 - rollup-pluginutils: 2.8.2 - dev: true - - /rollup-plugin-node-polyfills@0.2.1: - resolution: - { - integrity: sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==, - } - dependencies: - rollup-plugin-inject: 3.0.2 - dev: true - - /rollup-pluginutils@2.8.2: - resolution: - { - integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==, - } - dependencies: - estree-walker: 0.6.1 - dev: true - - /selfsigned@2.4.1: - resolution: - { - integrity: sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==, - } - engines: { node: '>=10' } - dependencies: - '@types/node-forge': 1.3.11 - node-forge: 1.3.1 - dev: true - - /source-map@0.6.1: - resolution: - { - integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==, - } - engines: { node: '>=0.10.0' } - dev: true - - /sourcemap-codec@1.4.8: - resolution: - { - integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==, - } - deprecated: Please use @jridgewell/sourcemap-codec instead - dev: true - - /stacktracey@2.1.8: - resolution: - { - integrity: sha512-Kpij9riA+UNg7TnphqjH7/CzctQ/owJGNbFkfEeve4Z4uxT5+JapVLFXcsurIfN34gnTWZNJ/f7NMG0E8JDzTw==, - } - dependencies: - as-table: 1.0.55 - get-source: 2.0.12 - dev: true - - /stoppable@1.1.0: - resolution: - { - integrity: sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==, - } - engines: { node: '>=4', npm: '>=6' } - dev: true - - /supports-preserve-symlinks-flag@1.0.0: - resolution: - { - integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==, - } - engines: { node: '>= 0.4' } - dev: true - - /to-regex-range@5.0.1: - resolution: - { - integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==, - } - engines: { node: '>=8.0' } - dependencies: - is-number: 7.0.0 - dev: true - - /tslib@2.6.3: - resolution: - { - integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==, - } - dev: true - - /ufo@1.5.3: - resolution: - { - integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==, - } - dev: true - - /undici-types@5.26.5: - resolution: - { - integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==, - } - dev: true - - /undici@5.28.4: - resolution: - { - integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==, - } - engines: { node: '>=14.0' } - dependencies: - '@fastify/busboy': 2.1.1 - dev: true - - /unenv-nightly@1.10.0-1717606461.a117952: - resolution: - { - integrity: sha512-u3TfBX02WzbHTpaEfWEKwDijDSFAHcgXkayUZ+MVDrjhLFvgAJzFGTSTmwlEhwWi2exyRQey23ah9wELMM6etg==, - } - dependencies: - consola: 3.2.3 - defu: 6.1.4 - mime: 3.0.0 - node-fetch-native: 1.6.4 - pathe: 1.1.2 - ufo: 1.5.3 - dev: true - - /workerd@1.20240620.1: - resolution: - { - integrity: sha512-Qoq+RrFNk4pvEO+kpJVn8uJ5TRE9YJx5jX5pC5LjdKlw1XeD8EdXt5k0TbByvWunZ4qgYIcF9lnVxhcDFo203g==, - } - engines: { node: '>=16' } - hasBin: true - requiresBuild: true - optionalDependencies: - '@cloudflare/workerd-darwin-64': 1.20240620.1 - '@cloudflare/workerd-darwin-arm64': 1.20240620.1 - '@cloudflare/workerd-linux-64': 1.20240620.1 - '@cloudflare/workerd-linux-arm64': 1.20240620.1 - '@cloudflare/workerd-windows-64': 1.20240620.1 - dev: true - - /wrangler@3.62.0: - resolution: - { - integrity: sha512-TM1Bd8+GzxFw/JzwsC3i/Oss4LTWvIEWXXo1vZhx+7PHcsxdbnQGBBwPurHNJDSu2Pw22+2pCZiUGKexmgJksw==, - } - engines: { node: '>=16.17.0' } - hasBin: true - peerDependencies: - '@cloudflare/workers-types': ^4.20240620.0 - peerDependenciesMeta: - '@cloudflare/workers-types': - optional: true - dependencies: - '@cloudflare/kv-asset-handler': 0.3.4 - '@esbuild-plugins/node-globals-polyfill': 0.2.3(esbuild@0.17.19) - '@esbuild-plugins/node-modules-polyfill': 0.2.2(esbuild@0.17.19) - blake3-wasm: 2.1.5 - chokidar: 3.6.0 - date-fns: 3.6.0 - esbuild: 0.17.19 - miniflare: 3.20240620.0 - nanoid: 3.3.7 - path-to-regexp: 6.2.2 - resolve: 1.22.8 - resolve.exports: 2.0.2 - selfsigned: 2.4.1 - source-map: 0.6.1 - unenv: /unenv-nightly@1.10.0-1717606461.a117952 - xxhash-wasm: 1.0.2 - optionalDependencies: - fsevents: 2.3.3 - transitivePeerDependencies: - - bufferutil - - supports-color - - utf-8-validate - dev: true - - /ws@8.17.1: - resolution: - { - integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==, - } - engines: { node: '>=10.0.0' } - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - dev: true - - /xxhash-wasm@1.0.2: - resolution: - { - integrity: sha512-ibF0Or+FivM9lNrg+HGJfVX8WJqgo+kCLDc4vx6xMeTce7Aj+DLttKbxxRR/gNLSAelRc1omAPlJ77N/Jem07A==, - } - dev: true - - /youch@3.3.3: - resolution: - { - integrity: sha512-qSFXUk3UZBLfggAW3dJKg0BMblG5biqSF8M34E06o5CSsZtH92u9Hqmj2RzGiHDi64fhe83+4tENFP2DB6t6ZA==, - } - dependencies: - cookie: 0.5.0 - mustache: 4.2.0 - stacktracey: 2.1.8 - dev: true - - /zod@3.23.8: - resolution: - { - integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==, - } - dev: true diff --git a/modules/debug_proxy/src/index.js b/modules/debug_proxy/src/index.js deleted file mode 100644 index 591b1e8..0000000 --- a/modules/debug_proxy/src/index.js +++ /dev/null @@ -1,66 +0,0 @@ -async function sendTelegramMessage(message, botToken, chatId) { - const url = `https://api.telegram.org/bot${botToken}/sendMessage` - const payload = { - chat_id: chatId, - text: message, - } - - try { - const response = await fetch(url, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify(payload), - }) - - if (!response.ok) { - console.error('Failed to send message:', await response.text()) - } - } catch (error) { - console.error('Error sending Telegram message:', error) - } -} - -export default { - async fetch(request, env, ctx) { - const url = new URL(request.url) - const userIP = request.headers.get('CF-Connecting-IP') - - if (url.pathname === '/b') { - url.pathname = '/styles/bright' - } - - // // no failure, just warning - // if (request.method !== 'GET') { - // const warningMessage = `Non-GET request ${request.method} ${url.pathname} ${userIP}` - // console.error(warningMessage) - // await sendTelegramMessage(warningMessage, env.TELEGRAM_TOKEN, env.TELEGRAM_CHAT_ID) - // } - - if (!url.pathname.startsWith('/styles')) { - const errorMessage = 'Bad path' - return new Response(errorMessage, { status: 500 }) - } - - const proxyUrl = new URL(url.pathname, 'https://tiles.openfreemap.org') - - try { - const response = await fetch(proxyUrl) - - if (response.status !== 200) { - const errorMessage = `Proxy error: Bad status ${response.status} ${url.pathname} ${userIP}` - console.error(errorMessage) - await sendTelegramMessage(errorMessage, env.TELEGRAM_TOKEN, env.TELEGRAM_CHAT_ID) - return new Response('Proxy error: Bad status', { status: 500 }) - } - - return response - } catch (error) { - const errorMessage = `Proxy error: ${error.message} ${url.pathname} ${userIP}` - console.error(errorMessage) - await sendTelegramMessage(errorMessage, env.TELEGRAM_TOKEN, env.TELEGRAM_CHAT_ID) - return new Response('Proxy error: Fetch failed', { status: 500 }) - } - }, -} diff --git a/modules/debug_proxy/wrangler.toml b/modules/debug_proxy/wrangler.toml deleted file mode 100644 index 60f7e7a..0000000 --- a/modules/debug_proxy/wrangler.toml +++ /dev/null @@ -1,107 +0,0 @@ -#:schema node_modules/wrangler/config-schema.json -name = "cf-debug-proxy" -main = "src/index.js" -compatibility_date = "2024-06-20" - -# Automatically place your workloads in an optimal location to minimize latency. -# If you are running back-end logic in a Worker, running it closer to your back-end infrastructure -# rather than the end user may result in better performance. -# Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement -# [placement] -# mode = "smart" - -# Variable bindings. These are arbitrary, plaintext strings (similar to environment variables) -# Docs: -# - https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables -# Note: Use secrets to store sensitive data. -# - https://developers.cloudflare.com/workers/configuration/secrets/ -# [vars] -# MY_VARIABLE = "production_value" - -# Bind the Workers AI model catalog. Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai -# [ai] -# binding = "AI" - -# Bind an Analytics Engine dataset. Use Analytics Engine to write analytics within your Pages Function. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets -# [[analytics_engine_datasets]] -# binding = "MY_DATASET" - -# Bind a headless browser instance running on Cloudflare's global network. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering -# [browser] -# binding = "MY_BROWSER" - -# Bind a D1 database. D1 is Cloudflare’s native serverless SQL database. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases -# [[d1_databases]] -# binding = "MY_DB" -# database_name = "my-database" -# database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - -# Bind a dispatch namespace. Use Workers for Platforms to deploy serverless functions programmatically on behalf of your customers. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms -# [[dispatch_namespaces]] -# binding = "MY_DISPATCHER" -# namespace = "my-namespace" - -# Bind a Durable Object. Durable objects are a scale-to-zero compute primitive based on the actor model. -# Durable Objects can live for as long as needed. Use these when you need a long-running "server", such as in realtime apps. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects -# [[durable_objects.bindings]] -# name = "MY_DURABLE_OBJECT" -# class_name = "MyDurableObject" - -# Durable Object migrations. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#migrations -# [[migrations]] -# tag = "v1" -# new_classes = ["MyDurableObject"] - -# Bind a Hyperdrive configuration. Use to accelerate access to your existing databases from Cloudflare Workers. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive -# [[hyperdrive]] -# binding = "MY_HYPERDRIVE" -# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - -# Bind a KV Namespace. Use KV as persistent storage for small key-value pairs. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces -# [[kv_namespaces]] -# binding = "MY_KV_NAMESPACE" -# id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" - -# Bind an mTLS certificate. Use to present a client certificate when communicating with another service. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates -# [[mtls_certificates]] -# binding = "MY_CERTIFICATE" -# certificate_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - -# Bind a Queue producer. Use this binding to schedule an arbitrary task that may be processed later by a Queue consumer. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues -# [[queues.producers]] -# binding = "MY_QUEUE" -# queue = "my-queue" - -# Bind a Queue consumer. Queue Consumers can retrieve tasks scheduled by Producers to act on them. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#queues -# [[queues.consumers]] -# queue = "my-queue" - -# Bind an R2 Bucket. Use R2 to store arbitrarily large blobs of data, such as files. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets -# [[r2_buckets]] -# binding = "MY_BUCKET" -# bucket_name = "my-bucket" - -# Bind another Worker service. Use this binding to call another Worker without network overhead. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings -# [[services]] -# binding = "MY_SERVICE" -# service = "my-service" - -# Bind a Vectorize index. Use to store and query vector embeddings for semantic search, classification and other vector search use-cases. -# Docs: https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes -# [[vectorize]] -# binding = "MY_INDEX" -# index_name = "my-index" diff --git a/modules/loadbalancer/cron.d/ofm_loadbalancer b/modules/loadbalancer/cron.d/ofm_loadbalancer deleted file mode 100644 index 24353b0..0000000 --- a/modules/loadbalancer/cron.d/ofm_loadbalancer +++ /dev/null @@ -1,8 +0,0 @@ -# every minute - -# fix -#* * * * * ofm sudo /data/ofm/venv/bin/python -u /data/ofm/loadbalancer/loadbalancer.py fix >> /data/ofm/loadbalancer/logs/run.log 2>&1 - - -# check -* * * * * ofm sudo /data/ofm/venv/bin/python -u /data/ofm/loadbalancer/loadbalancer.py check >> /data/ofm/loadbalancer/logs/run.log 2>&1 diff --git a/modules/loadbalancer/loadbalancer.py b/modules/loadbalancer/loadbalancer.py deleted file mode 100755 index 3a851d1..0000000 --- a/modules/loadbalancer/loadbalancer.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 - -from datetime import datetime, timezone - -import click -from loadbalancer_lib.loadbalance import check_or_fix - - -now = datetime.now(timezone.utc) - - -@click.group() -def cli(): - """ - Manages load-balancing of Round-Robin DNS records - """ - - -@cli.command() -def check(): - """ - Runs load-balancing check - """ - - print(f'---\n{now}\nStarting check') - check_or_fix(fix=False) - - -@cli.command() -def fix(): - """ - Runs check and fixes records based on check results - """ - - print(f'---\n{now}\nStarting fix') - check_or_fix(fix=True) - - -if __name__ == '__main__': - cli() diff --git a/modules/loadbalancer/loadbalancer_lib/__init__.py b/modules/loadbalancer/loadbalancer_lib/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/modules/loadbalancer/loadbalancer_lib/cloudflare.py b/modules/loadbalancer/loadbalancer_lib/cloudflare.py deleted file mode 100644 index 8dd688b..0000000 --- a/modules/loadbalancer/loadbalancer_lib/cloudflare.py +++ /dev/null @@ -1,108 +0,0 @@ -import requests - - -# docs: https://api.cloudflare.com/ - - -def cloudflare_get(path: str, params: dict, cloudflare_api_token: str): - headers = {'Authorization': f'Bearer {cloudflare_api_token}'} - res = requests.get( - f'https://api.cloudflare.com/client/v4{path}', headers=headers, params=params - ) - res.raise_for_status() - data = res.json() - assert data['success'] is True - return data - - -def get_zone_id(domain, cloudflare_api_token: str): - data = cloudflare_get( - '/zones', params=dict(name=domain), cloudflare_api_token=cloudflare_api_token - ) - assert len(data['result']) == 1 - zone_info = data['result'][0] - return zone_info['id'] - - -def get_dns_records_round_robin(zone_id, cloudflare_api_token: str) -> dict: - data = cloudflare_get( - f'/zones/{zone_id}/dns_records', - params=dict(per_page=5000), - cloudflare_api_token=cloudflare_api_token, - ) - records = data['result'] - - data = {} - - for r in records: - if r['type'] != 'A': - continue - - data.setdefault(r['name'], []) - data[r['name']].append(dict(content=r['content'], id=r['id'])) - - return data - - -def set_records_round_robin( - zone_id, - *, - name: str, - host_ip_set: set, - ttl: int = 1, - proxied: bool, - comment: str = None, - cloudflare_api_token: str, -) -> bool: - headers = {'Authorization': f'Bearer {cloudflare_api_token}'} - - dns_records = get_dns_records_round_robin(zone_id, cloudflare_api_token=cloudflare_api_token) - current_records = dns_records.get(name, []) - - current_ips = {r['content'] for r in current_records} - - if current_ips == host_ip_set: - print(f'No need to update records: {name} currently set: {sorted(current_ips)}') - return False - - # changing records - - # delete all current records first - for r in current_records: - delete_record(zone_id, id_=r['id'], cloudflare_api_token=cloudflare_api_token) - - # create new records - for ip in host_ip_set: - print(f'Creating record: {name} {ip}') - json_data = dict( - type='A', - name=name, - content=ip, - ttl=ttl, - proxied=proxied, - comment=comment, - ) - res = requests.post( - f'https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records', - headers=headers, - json=json_data, - ) - res.raise_for_status() - data = res.json() - assert data['success'] is True - - return True - - -def delete_record(zone_id, *, id_: str, cloudflare_api_token: str): - headers = {'Authorization': f'Bearer {cloudflare_api_token}'} - - print(f'Deleting record: {id_}') - res = requests.delete( - f'https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records/{id_}', - headers=headers, - json={}, - ) - res.raise_for_status() - data = res.json() - assert data['success'] is True diff --git a/modules/loadbalancer/loadbalancer_lib/config.py b/modules/loadbalancer/loadbalancer_lib/config.py deleted file mode 100644 index 5bd1a22..0000000 --- a/modules/loadbalancer/loadbalancer_lib/config.py +++ /dev/null @@ -1,29 +0,0 @@ -import json -from pathlib import Path - -from dotenv import dotenv_values - - -class Configuration: - areas = ['planet', 'monaco'] - - if Path('/data/ofm').exists(): - ofm_config_dir = Path('/data/ofm/config') - else: - repo_root = Path(__file__).parent.parent.parent.parent - ofm_config_dir = repo_root / 'config' - - ofm_config = json.loads((ofm_config_dir / 'config.json').read_text()) - - http_host_list = ofm_config['http_host_list'] - telegram_token = ofm_config['telegram_token'] - telegram_chat_id = ofm_config['telegram_chat_id'] - - domain_roundrobin = ofm_config['domain_roundrobin'] - domain_root = '.'.join(domain_roundrobin.split('.')[-2:]) - - cloudflare_ini = dotenv_values(ofm_config_dir / 'cloudflare.ini') - cloudflare_api_token = cloudflare_ini['dns_cloudflare_api_token'] - - -config = Configuration() diff --git a/modules/loadbalancer/loadbalancer_lib/loadbalance.py b/modules/loadbalancer/loadbalancer_lib/loadbalance.py deleted file mode 100644 index 2ce9ce4..0000000 --- a/modules/loadbalancer/loadbalancer_lib/loadbalance.py +++ /dev/null @@ -1,106 +0,0 @@ -from datetime import datetime, timedelta, timezone - -from loadbalancer_lib.cloudflare import get_zone_id, set_records_round_robin -from loadbalancer_lib.config import config -from loadbalancer_lib.shared import check_host_latest, check_host_version, get_deployed_version -from loadbalancer_lib.telegram_ import telegram_send_message - - -def check_or_fix(fix=False): - if not config.http_host_list: - telegram_quick( - 'OFM loadbalancer no hosts found on list, terminating', - ) - return - - try: - results_by_ip = {} - working_hosts = set() - - for area in config.areas: - results = run_area(area) - for host_ip, host_is_ok in results.items(): - results_by_ip.setdefault(host_ip, True) - results_by_ip[host_ip] &= host_is_ok - - for host_ip, host_is_ok in results_by_ip.items(): - if not host_is_ok: - telegram_quick(f'OFM loadbalancer ERROR with host: {host_ip}') - else: - working_hosts.add(host_ip) - - except Exception as e: - telegram_quick(f'OFM loadbalancer ERROR with loadbalancer: {e}') - return - - print(f'working hosts: {sorted(working_hosts)}') - - if fix: - # if no hosts are detected working, probably a bug in this script - # fail-safe to include all hosts - if not working_hosts: - working_hosts = set(config.http_host_list) - telegram_quick('OFM loadbalancer FIX found no working hosts, reverting to full list!') - - updated = update_records(working_hosts) - if updated: - telegram_quick(f'OFM loadbalancer FIX modified records, new records: {working_hosts}') - - -def run_area(area): - deployed_data = get_deployed_version(area) - version = deployed_data['version'] - last_modified = deployed_data['last_modified'] - - if not version: - print(f' deployed version not found: {area}') - return - - print(f' deployed version {area}: {version}') - - # using relaxed mode for while the servers are still deploying - now = datetime.now(timezone.utc) - delta = now - last_modified - relaxed_mode = delta < timedelta(minutes=3) - - if relaxed_mode: - print(' using relaxed mode') - - results = {} - - for host_ip in config.http_host_list: - try: - # don't check latest - if relaxed_mode: - check_host_version(config.domain_roundrobin, host_ip, area, version) - else: - check_host_latest(config.domain_roundrobin, host_ip, area, version) - - results[host_ip] = True - except Exception as e: - results[host_ip] = False - print(e) - - return results - - -def update_records(working_hosts) -> bool: - zone_id = get_zone_id(config.domain_root, cloudflare_api_token=config.cloudflare_api_token) - - updated = False - - updated |= set_records_round_robin( - zone_id=zone_id, - name=config.domain_roundrobin, - host_ip_set=working_hosts, - proxied=False, - ttl=300, - comment='domain_roundrobin', - cloudflare_api_token=config.cloudflare_api_token, - ) - - return updated - - -def telegram_quick(message): - telegram_send_message(message, config.telegram_token, config.telegram_chat_id) diff --git a/modules/loadbalancer/loadbalancer_lib/shared.py b/modules/loadbalancer/loadbalancer_lib/shared.py deleted file mode 120000 index 37f60fb..0000000 --- a/modules/loadbalancer/loadbalancer_lib/shared.py +++ /dev/null @@ -1 +0,0 @@ -../../tile_gen/tile_gen_lib/shared.py \ No newline at end of file diff --git a/modules/loadbalancer/loadbalancer_lib/telegram_.py b/modules/loadbalancer/loadbalancer_lib/telegram_.py deleted file mode 100644 index 8b5f427..0000000 --- a/modules/loadbalancer/loadbalancer_lib/telegram_.py +++ /dev/null @@ -1,16 +0,0 @@ -import requests - - -def telegram_send_message(message, bot_token, chat_id): - print(message) - - url = f'https://api.telegram.org/bot{bot_token}/sendMessage' - - payload = {'chat_id': chat_id, 'text': message} - - response = requests.post(url, data=payload) - - if response.status_code == 200: - print(' Message sent successfully!') - else: - print(' Failed to send message:', response.text) diff --git a/modules/loadbalancer/setup.py b/modules/loadbalancer/setup.py deleted file mode 100644 index 84f9323..0000000 --- a/modules/loadbalancer/setup.py +++ /dev/null @@ -1,16 +0,0 @@ -from setuptools import find_packages, setup - - -requirements = [ - 'click', - 'requests', - 'pycurl', - 'python-dotenv', -] - - -setup( - python_requires='>=3.10', - install_requires=requirements, - packages=find_packages(), -) diff --git a/modules/roundrobin/rclone_write.sh b/modules/roundrobin/rclone_write.sh deleted file mode 100644 index 2791779..0000000 --- a/modules/roundrobin/rclone_write.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# these are not needed as certbot generates these -#env > /data/ofm/roundrobin/env.txt -#RENEWED_DOMAINS=tiles.openfreemap.org -#RENEWED_LINEAGE=/etc/letsencrypt/live/ofm_roundrobin - -export RCLONE_CONFIG=/data/ofm/config/rclone.conf - -rclone copyto -v --copy-links "$RENEWED_LINEAGE/fullchain.pem" "remote:ofm-private/roundrobin/$RENEWED_DOMAINS/ofm_roundrobin.cert" -rclone copyto -v --copy-links "$RENEWED_LINEAGE/privkey.pem" "remote:ofm-private/roundrobin/$RENEWED_DOMAINS/ofm_roundrobin.key" - diff --git a/ssh_lib/tasks.py b/ssh_lib/tasks.py index c8f7048..e50fb6c 100644 --- a/ssh_lib/tasks.py +++ b/ssh_lib/tasks.py @@ -143,62 +143,6 @@ def install_benchmark(c): wrk(c) -def setup_roundrobin_writer(c): - letsencrypt_email = dotenv_val('LETSENCRYPT_EMAIL').lower() - domain_roundrobin = dotenv_val('DOMAIN_ROUNDROBIN').lower() - assert letsencrypt_email - assert domain_roundrobin - assert (CONFIG_DIR / 'rclone.conf').exists() - assert (CONFIG_DIR / 'cloudflare.ini').exists() - - rclone(c) - certbot(c) - - c.sudo(f'mkdir -p {REMOTE_CONFIG}') - - put( - c, - CONFIG_DIR / 'rclone.conf', - f'{REMOTE_CONFIG}/rclone.conf', - permissions=400, - ) - - put( - c, - CONFIG_DIR / 'cloudflare.ini', - f'{REMOTE_CONFIG}/cloudflare.ini', - permissions=400, - ) - - c.sudo('rm -rf /data/ofm/roundrobin') - - put( - c, - MODULES_DIR / 'roundrobin' / 'rclone_write.sh', - '/data/ofm/roundrobin/rclone_write.sh', - create_parent_dir=True, - permissions=500, - ) - - # only use with --staging - # c.sudo('certbot delete --noninteractive --cert-name ofm_roundrobin', warn=True) - - sudo_cmd( - c, - 'certbot certonly ' - '--dns-cloudflare ' - f'--dns-cloudflare-credentials {REMOTE_CONFIG}/cloudflare.ini ' - '--dns-cloudflare-propagation-seconds 20 ' - f'--noninteractive ' - f'-m {letsencrypt_email} ' - f'--agree-tos ' - f'--cert-name=ofm_roundrobin ' - f'--deploy-hook /data/ofm/roundrobin/rclone_write.sh ' - f'-d {domain_roundrobin}', - # f'-d {domain2_roundrobin}', - ) - - def upload_config_json(c): domain_direct = dotenv_val('DOMAIN_DIRECT').lower() domain_roundrobin = dotenv_val('DOMAIN_ROUNDROBIN').lower() @@ -233,13 +177,6 @@ def upload_config_json(c): def setup_loadbalancer(c): c.sudo('rm -f /etc/cron.d/ofm_loadbalancer') - put( - c, - CONFIG_DIR / 'cloudflare.ini', - f'{REMOTE_CONFIG}/cloudflare.ini', - permissions=400, - ) - c.sudo('rm -rf /data/ofm/loadbalancer') put_dir(c, MODULES_DIR / 'loadbalancer', '/data/ofm/loadbalancer') put_dir(