Skip to content

Commit eb998e1

Browse files
committed
Apply the cookiecutter to h
1 parent f5c52f8 commit eb998e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+2317
-1415
lines changed

.cookiecutter/cookiecutter.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"template": "https://github.com/hypothesis/cookiecutters",
3+
"checkout": null,
4+
"directory": "pyramid-app",
5+
"ignore": [
6+
".docker.env",
7+
"Dockerfile",
8+
"LICENSE",
9+
"bin/make_devdata",
10+
"h/db.py",
11+
"h/migrations/env.py",
12+
"h/templates/.gitkeep",
13+
"tests/functional/app_test.py"
14+
],
15+
"extra_context": {
16+
"name": "h",
17+
"package_name": "h",
18+
"slug": "h",
19+
"short_description": "h is the web app that serves most of the https://hypothes.is/ website, including the web annotations API at https://hypothes.is/api/. The [Hypothesis client](https://github.com/hypothesis/client) is a browser-based annotator that is a client for h's API.",
20+
"python_version": "3.11.7",
21+
"port": "5000",
22+
"github_owner": "hypothesis",
23+
"visibility": "public",
24+
"copyright_holder": "Hypothesis",
25+
"dependabot_pip_interval": "monthly",
26+
"dependabot_npm_interval": "monthly",
27+
"dependabot_docker_interval": "monthly",
28+
"devdata": "yes",
29+
"frontend": "yes",
30+
"__frontend_typechecking": "yes",
31+
"postgres": "yes",
32+
"docker": "yes",
33+
"linter": "pylint",
34+
"__postgres_version": "15.6-alpine",
35+
"__postgres_port": "5432",
36+
"__docker_namespace": "hypothesis",
37+
"__docker_network": "h_default",
38+
"__github_url": "https://github.com/hypothesis/h",
39+
"__copyright_year": "2022",
40+
"__parallel_unit_tests": true,
41+
"__format_runner_type": "ubuntu-latest",
42+
"__lint_runner_type": "ubuntu-latest-32-cores",
43+
"__typecheck_runner_type": "ubuntu-latest",
44+
"__tests_runner_type": "ubuntu-latest-32-cores",
45+
"__coverage_runner_type": "ubuntu-latest",
46+
"__functests_runner_type": "ubuntu-latest",
47+
"__gunicorn_bind": "unix:/tmp/gunicorn-web.sock",
48+
"__scheduled_workflows": ",Report refresh",
49+
"__slack_notifications_workflows": "",
50+
"__docker_hub_application_name": "hypothesis",
51+
"_checkout": null
52+
}
53+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
elasticsearch:
2+
image: hypothesis/elasticsearch:elasticsearch7.10
3+
ports:
4+
- 9200:9200
5+
env:
6+
discovery.type: single-node
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
rabbitmq:
2+
image: rabbitmq:3.12-management-alpine
3+
ports:
4+
- 5672:5672
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Community
2+
3+
Join us on Slack ([request an invite](https://slack.hypothes.is) or [log in once you've created an account](https://hypothesis-open.slack.com/)).
4+
5+
If you'd like to contribute to the project, you should also [subscribe](mailto:[email protected])
6+
to the [development mailing list](https://groups.google.com/a/list.hypothes.is/forum/#!forum/dev)
7+
and read our [Contributor's guide](https://h.readthedocs.io/en/latest/developing/).
8+
Then consider getting started on one of the issues that are ready for work.
9+
10+
Please note that this project is released with a [Contributor Code of Conduct](https://github.com/hypothesis/.github/blob/main/CODE_OF_CONDUCT.md).
11+
By participating in this project you agree to abide by its terms.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
3+
from os import environ
4+
5+
max_requests = 100
6+
max_requests_jitter = 10
7+
8+
9+
if "GUNICORN_CERTFILE" in environ:
10+
certfile = environ["GUNICORN_CERTFILE"]
11+
12+
if "GUNICORN_KEYFILE" in environ:
13+
keyfile = environ["GUNICORN_KEYFILE"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
from os import environ
4+
5+
workers = environ["WEB_NUM_WORKERS"]
6+
7+
max_requests = environ.get("GUNICORN_MAX_REQUESTS", 500_000)
8+
max_requests_jitter = environ.get("GUNICORN_MAX_REQUESTS_JITTER", 100_000)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"programs": {
3+
"init_db": {
4+
"command": "python3 -m h.scripts.init_db --create --stamp",
5+
"startsecs": 0
6+
},
7+
"init_elasticsearch": {
8+
"command": "python3 -m h.scripts.init_elasticsearch conf/development.ini",
9+
"startsecs": 0
10+
},
11+
"web": {
12+
"command": "newrelic-admin run-program gunicorn --paste conf/development.ini --config conf/gunicorn-dev.conf.py",
13+
"autostart": "%(ENV_ENABLE_WEB)s"
14+
},
15+
"websocket": {
16+
"command": "gunicorn --paste conf/websocket-dev.ini --config conf/gunicorn-websocket-dev.conf.py",
17+
"autostart": "%(ENV_ENABLE_WEBSOCKET)s"
18+
},
19+
"worker": {
20+
"command": "newrelic-admin run-program bin/hypothesis --dev celery worker --loglevel=INFO",
21+
"autostart": "%(ENV_ENABLE_WORKER)s"
22+
},
23+
"assets": {
24+
"command": "node_modules/.bin/gulp watch"
25+
}
26+
}
27+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"programs": {
3+
"nginx": {
4+
"command": "nginx",
5+
"autostart": "%(ENV_ENABLE_NGINX)s"
6+
7+
},
8+
"web": {
9+
"command": "newrelic-admin run-program gunicorn --paste conf/production.ini --config conf/gunicorn.conf.py",
10+
"autostart": "%(ENV_ENABLE_WEB)s"
11+
},
12+
"websocket": {
13+
"command": "gunicorn --paste conf/websocket.ini --config conf/gunicorn-websocket.conf.py",
14+
"autostart": "%(ENV_ENABLE_WEBSOCKET)s"
15+
},
16+
"websocket-monolithic": {
17+
"command": "gunicorn --paste conf/websocket-monolithic.ini --config conf/gunicorn-websocket-monolithic.conf.py",
18+
"autostart": "%(ENV_ENABLE_WEBSOCKET_MONOLITHIC)s",
19+
"process_name": "websocket"
20+
},
21+
"worker": {
22+
"command": "newrelic-admin run-program hypothesis celery worker --loglevel=INFO",
23+
"autostart": "%(ENV_ENABLE_WORKER)s"
24+
}
25+
}
26+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"h/cli/*",
2+
"h/pshell.py",
3+
"h/scripts/init_elasticsearch.py",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
pyramid.debug_all: True
2+
pyramid.reload_templates: True
3+
4+
h.bouncer_url: http://localhost:8000
5+
h.client_rpc_allowed_origins: http://localhost:8001 https://localhost:48001
6+
h.client_url: {current_scheme}://{current_host}:3001/hypothesis
7+
h.websocket_url: ws://localhost:5001/ws
8+
9+
h.debug: True
10+
h.reload_assets: True
11+
12+
es.url: http://localhost:9200
13+
14+
secret_key: notverysecretafterall

0 commit comments

Comments
 (0)