Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Set upload limits consistently#43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
QuLogic wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromQuLogic:limits
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletionstemplates/Caddyfile.j2
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,6 +33,10 @@ http://{{ caddy.addresses.webhook }} {

root * {{ caddy.site_dir }}

request_body {
max_size 25MB # Limit from GitHub.
}

# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#delivery-headers
@valid_webhook {
path /gh/*
Expand DownExpand Up@@ -85,6 +89,10 @@ http://{{ caddy.addresses.main }}, http://{{ ansible_fqdn }} {

root * {{ caddy.site_dir }}

request_body {
max_size 0
}

{% for site, path in repos.items() %}
import subproject {{ site }} {{ path | default(site, true) }}
{% endfor %}
Expand Down
6 changes: 1 addition & 5 deletionswebhook/webhook.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -88,10 +88,6 @@ async def github_webhook(request: web.Request):

We only handle ping and push events (this is enforced by the Caddyfile).
"""
# Verify some input parameters.
if request.content_length > 25_000_000: # Limit from GitHub.
raise web.HTTPBadRequest(reason='Request too large')

# This should be guarded against by Caddy, but check anyway.
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#delivery-headers
try:
Expand DownExpand Up@@ -183,7 +179,7 @@ def create_app():
site_dir = Path(os.environ.get('SITE_DIR', 'sites')).resolve()
assert site_dir.is_dir()

app = web.Application()
app = web.Application(client_max_size=25_000_000) # Limit from GitHub.
app['site_dir'] = site_dir
app.add_routes([
web.post('/gh/{repo}', github_webhook),
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp