-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate dependency and script management to poetry add pre-commit hooks for linting and formatting remove celery, and associated code decouple scanning logic from database logic as much as possible
- Loading branch information
Showing
65 changed files
with
2,489 additions
and
2,088 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# .git-blame-ignore-revs | ||
# run pre-commit against all files | ||
376413493eca8298b8f2c17c8f02fc0d04285136 | ||
# format all files with black | ||
1583d515c0a767e2b69b3cdcd785008d2dd0cd0b | ||
# format all files with isort | ||
73b2a811edc4f366516c3a63da73fc5e769761e7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
default_language_version: | ||
python: python3.11 | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.12.1 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,23 @@ | ||
version: '2' | ||
services: | ||
website: | ||
build: ./httpobs | ||
command: uwsgi --http :57001 --wsgi-file /app/httpobs/website/main.py --processes 8 --callable app --master | ||
build: . | ||
command: uwsgi --http :57001 --wsgi-file /app/httpobs/website/main.py --processes 1 --callable app --master | ||
depends_on: | ||
- postgres | ||
environment: | ||
- HTTPOBS_BROKER_URL=redis://redis:6379/0 | ||
- HTTPOBS_DATABASE_HOST=postgres | ||
- HTTPOBS_DATABASE_PASS=httpobsapipassword | ||
- HTTPOBS_DATABASE_USER=httpobsapi | ||
links: | ||
- postgres | ||
ports: | ||
- "57001:57001" | ||
restart: always | ||
|
||
# celery task for scanner | ||
scanner: | ||
build: ./httpobs | ||
command: /app/httpobs/scripts/httpobs-scan-worker | ||
depends_on: | ||
- postgres | ||
- redis | ||
environment: | ||
- HTTPOBS_BROKER_URL=redis://redis:6379/0 | ||
- HTTPOBS_DATABASE_HOST=postgres | ||
- HTTPOBS_DATABASE_PASS=httpobsscannerpassword | ||
- HTTPOBS_DATABASE_USER=httpobsscanner | ||
- HTTPOBS_MAX_CONCURRENCY=16 | ||
links: | ||
- postgres | ||
- redis | ||
restart: unless-stopped | ||
|
||
postgres: | ||
build: ./httpobs/database | ||
environment: | ||
- POSTGRES_USER=httpobs | ||
- POSTGRES_PASSWORD=totallyfakepassword | ||
- POSTGRES_DB=http_observatory | ||
|
||
redis: | ||
image: redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
SOURCE_URL = 'https://github.com/mozilla/http-observatory' | ||
VERSION = '0.9.3' | ||
|
||
# The various statuses | ||
STATE_ABORTED = 'ABORTED' | ||
STATE_FAILED = 'FAILED' | ||
STATE_FINISHED = 'FINISHED' | ||
STATE_PENDING = 'PENDING' | ||
STATE_STARTING = 'STARTING' | ||
STATE_RUNNING = 'RUNNING' | ||
|
||
STATES = (STATE_ABORTED, STATE_FAILED, STATE_FINISHED, STATE_PENDING, STATE_RUNNING, STATE_STARTING) |
Oops, something went wrong.