mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Merge branch 'master' into sslcontext
This commit is contained in:
commit
6d70be2d1c
29
.github/workflows/lint.yml
vendored
Normal file
29
.github/workflows/lint.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
name: lint
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
tox-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
- run: pip install --upgrade pip
|
||||||
|
- run: pip install tox
|
||||||
|
- run: tox -e lint
|
||||||
|
|
||||||
|
tox-docs-lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
- run: pip install --upgrade pip
|
||||||
|
- run: pip install tox
|
||||||
|
- run: tox -e docs-lint
|
||||||
|
|
||||||
|
tox-pycodestyle:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
- run: pip install --upgrade pip
|
||||||
|
- run: pip install tox
|
||||||
|
- run: tox -e pycodestyle
|
||||||
18
.github/workflows/tox.yml
vendored
Normal file
18
.github/workflows/tox.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
name: tox
|
||||||
|
on: [push, pull_request]
|
||||||
|
jobs:
|
||||||
|
tox:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix: # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc.
|
||||||
|
os: [ubuntu-latest] # [macos-latest, ubuntu-latest, windows-latest]
|
||||||
|
python: ['3.10'] # ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
- run: pip install --upgrade pip
|
||||||
|
- run: pip install tox
|
||||||
|
- run: tox -e py
|
||||||
2
NOTICE
2
NOTICE
@ -86,4 +86,4 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
util/unlink.py
|
util/unlink.py
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
backport frop python3 Lib/test/support.py
|
backport from python3 Lib/test/support.py
|
||||||
|
|||||||
@ -9,9 +9,13 @@ Gunicorn
|
|||||||
:alt: Supported Python versions
|
:alt: Supported Python versions
|
||||||
:target: https://pypi.python.org/pypi/gunicorn
|
:target: https://pypi.python.org/pypi/gunicorn
|
||||||
|
|
||||||
.. image:: https://travis-ci.org/benoitc/gunicorn.svg?branch=master
|
.. image:: https://github.com/benoitc/gunicorn/actions/workflows/tox.yml/badge.svg
|
||||||
:alt: Build Status
|
:alt: Build Status
|
||||||
:target: https://travis-ci.org/benoitc/gunicorn
|
:target: https://github.com/benoitc/gunicorn/actions/workflows/tox.yml
|
||||||
|
|
||||||
|
.. image:: https://github.com/benoitc/gunicorn/actions/workflows/lint.yml/badge.svg
|
||||||
|
:alt: Lint Status
|
||||||
|
:target: https://github.com/benoitc/gunicorn/actions/workflows/lint.yml
|
||||||
|
|
||||||
Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork
|
Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork
|
||||||
worker model ported from Ruby's Unicorn_ project. The Gunicorn server is broadly
|
worker model ported from Ruby's Unicorn_ project. The Gunicorn server is broadly
|
||||||
|
|||||||
3
THANKS
3
THANKS
@ -39,6 +39,7 @@ Chris Adams <chris@improbable.org>
|
|||||||
Chris Forbes <chrisf@ijw.co.nz>
|
Chris Forbes <chrisf@ijw.co.nz>
|
||||||
Chris Lamb <lamby@debian.org>
|
Chris Lamb <lamby@debian.org>
|
||||||
Chris Streeter <chris@chrisstreeter.com>
|
Chris Streeter <chris@chrisstreeter.com>
|
||||||
|
Christian Clauss <cclauss@me.com>
|
||||||
Christoph Heer <Christoph.Heer@gmail.com>
|
Christoph Heer <Christoph.Heer@gmail.com>
|
||||||
Christos Stavrakakis <cstavr@grnet.gr>
|
Christos Stavrakakis <cstavr@grnet.gr>
|
||||||
CMGS <ilskdw@mspil.edu.cn>
|
CMGS <ilskdw@mspil.edu.cn>
|
||||||
@ -103,12 +104,14 @@ Konstantin Kapustin <sirkonst@gmail.com>
|
|||||||
kracekumar <kracethekingmaker@gmail.com>
|
kracekumar <kracethekingmaker@gmail.com>
|
||||||
Kristian Glass <git@doismellburning.co.uk>
|
Kristian Glass <git@doismellburning.co.uk>
|
||||||
Kristian Øllegaard <kristian.ollegaard@divio.ch>
|
Kristian Øllegaard <kristian.ollegaard@divio.ch>
|
||||||
|
Krystian <chrisjozwik@outlook.com>
|
||||||
Krzysztof Urbaniak <urban@fail.pl>
|
Krzysztof Urbaniak <urban@fail.pl>
|
||||||
Kyle Kelley <rgbkrk@gmail.com>
|
Kyle Kelley <rgbkrk@gmail.com>
|
||||||
Kyle Mulka <repalviglator@yahoo.com>
|
Kyle Mulka <repalviglator@yahoo.com>
|
||||||
Lars Hansson <romabysen@gmail.com>
|
Lars Hansson <romabysen@gmail.com>
|
||||||
Leonardo Santagada <santagada@gmail.com>
|
Leonardo Santagada <santagada@gmail.com>
|
||||||
Levi Gross <levi@levigross.com>
|
Levi Gross <levi@levigross.com>
|
||||||
|
licunlong <shenxiaogll@163.com>
|
||||||
Łukasz Kucharski <lkucharski@leon.pl>
|
Łukasz Kucharski <lkucharski@leon.pl>
|
||||||
Mahmoud Hashemi <mahmoudrhashemi@gmail.com>
|
Mahmoud Hashemi <mahmoudrhashemi@gmail.com>
|
||||||
Malthe Borch <mborch@gmail.com>
|
Malthe Borch <mborch@gmail.com>
|
||||||
|
|||||||
34
appveyor.yml
34
appveyor.yml
@ -2,17 +2,23 @@ version: '{branch}.{build}'
|
|||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- TOXENV: lint
|
- TOXENV: lint
|
||||||
PYTHON: "C:\\Python37-x64"
|
|
||||||
- TOXENV: py35
|
|
||||||
PYTHON: "C:\\Python35-x64"
|
|
||||||
- TOXENV: py36
|
|
||||||
PYTHON: "C:\\Python36-x64"
|
|
||||||
- TOXENV: py37
|
|
||||||
PYTHON: "C:\\Python37-x64"
|
|
||||||
- TOXENV: py38
|
|
||||||
PYTHON: "C:\\Python38-x64"
|
PYTHON: "C:\\Python38-x64"
|
||||||
- TOXENV: py39
|
- TOXENV: docs-lint
|
||||||
PYTHON: "C:\\Python39-x64"
|
PYTHON: "C:\\Python38-x64"
|
||||||
|
- TOXENV: pycodestyle
|
||||||
|
PYTHON: "C:\\Python38-x64"
|
||||||
|
# Windows is not ready for testing!!!
|
||||||
|
# Python's fcntl, grp, pwd, os.geteuid(), and socket.AF_UNIX are all Unix-only.
|
||||||
|
#- TOXENV: py35
|
||||||
|
# PYTHON: "C:\\Python35-x64"
|
||||||
|
#- TOXENV: py36
|
||||||
|
# PYTHON: "C:\\Python36-x64"
|
||||||
|
#- TOXENV: py37
|
||||||
|
# PYTHON: "C:\\Python37-x64"
|
||||||
|
#- TOXENV: py38
|
||||||
|
# PYTHON: "C:\\Python38-x64"
|
||||||
|
#- TOXENV: py39
|
||||||
|
# PYTHON: "C:\\Python39-x64"
|
||||||
matrix:
|
matrix:
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- TOXENV: py35
|
- TOXENV: py35
|
||||||
@ -20,11 +26,13 @@ matrix:
|
|||||||
- TOXENV: py37
|
- TOXENV: py37
|
||||||
- TOXENV: py38
|
- TOXENV: py38
|
||||||
- TOXENV: py39
|
- TOXENV: py39
|
||||||
init: SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
|
init:
|
||||||
|
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
|
||||||
install:
|
install:
|
||||||
- pip install tox
|
- pip install tox
|
||||||
build: off
|
build: false
|
||||||
test_script: tox
|
test_script:
|
||||||
|
- tox
|
||||||
cache:
|
cache:
|
||||||
# Not including the .tox directory since it takes longer to download/extract
|
# Not including the .tox directory since it takes longer to download/extract
|
||||||
# the cache archive than for tox to clean install from the pip cache.
|
# the cache archive than for tox to clean install from the pip cache.
|
||||||
|
|||||||
@ -118,7 +118,7 @@
|
|||||||
<li><a href="https://github.com/benoitc/gunicorn/projects/4">Forum</a></li>
|
<li><a href="https://github.com/benoitc/gunicorn/projects/4">Forum</a></li>
|
||||||
<li><a href="https://github.com/benoitc/gunicorn/projects/3">Mailing list</a>
|
<li><a href="https://github.com/benoitc/gunicorn/projects/3">Mailing list</a>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Project maintenance guidelines are avaible on the <a href="https://github.com/benoitc/gunicorn/wiki/Project-management">wiki</a></p>
|
<p>Project maintenance guidelines are available on the <a href="https://github.com/benoitc/gunicorn/wiki/Project-management">wiki</a></p>
|
||||||
|
|
||||||
<h1>Irc</h1>
|
<h1>Irc</h1>
|
||||||
<p>The Gunicorn channel is on the <a href="http://freenode.net/">Freenode</a> IRC
|
<p>The Gunicorn channel is on the <a href="http://freenode.net/">Freenode</a> IRC
|
||||||
|
|||||||
@ -75,7 +75,7 @@ Changelog - 2012
|
|||||||
- fix tornado.wsgi.WSGIApplication calling error
|
- fix tornado.wsgi.WSGIApplication calling error
|
||||||
|
|
||||||
- **breaking change**: take the control on graceful reload back.
|
- **breaking change**: take the control on graceful reload back.
|
||||||
graceful can't be overrided anymore using the on_reload function.
|
graceful can't be overridden anymore using the on_reload function.
|
||||||
|
|
||||||
0.14.3 / 2012-05-15
|
0.14.3 / 2012-05-15
|
||||||
-------------------
|
-------------------
|
||||||
|
|||||||
@ -38,10 +38,10 @@ Changelog - 2013
|
|||||||
- fix: give the initial global_conf to paster application
|
- fix: give the initial global_conf to paster application
|
||||||
- fix: fix 'Expect: 100-continue' support on Python 3
|
- fix: fix 'Expect: 100-continue' support on Python 3
|
||||||
|
|
||||||
New versionning:
|
New versioning:
|
||||||
++++++++++++++++
|
++++++++++++++++
|
||||||
|
|
||||||
With this release, the versionning of Gunicorn is changing. Gunicorn is
|
With this release, the versioning of Gunicorn is changing. Gunicorn is
|
||||||
stable since a long time and there is no point to release a "1.0" now.
|
stable since a long time and there is no point to release a "1.0" now.
|
||||||
It should have been done since a long time. 0.17 really meant it was the
|
It should have been done since a long time. 0.17 really meant it was the
|
||||||
17th stable version. From the beginning we have only 2 kind of
|
17th stable version. From the beginning we have only 2 kind of
|
||||||
@ -49,7 +49,7 @@ releases:
|
|||||||
|
|
||||||
major release: releases with major changes or huge features added
|
major release: releases with major changes or huge features added
|
||||||
services releases: fixes and minor features added So from now we will
|
services releases: fixes and minor features added So from now we will
|
||||||
apply the following versionning ``<major>.<service>``. For example ``17.5`` is a
|
apply the following versioning ``<major>.<service>``. For example ``17.5`` is a
|
||||||
service release.
|
service release.
|
||||||
|
|
||||||
0.17.4 / 2013-04-24
|
0.17.4 / 2013-04-24
|
||||||
|
|||||||
@ -71,7 +71,7 @@ AioHttp worker
|
|||||||
Async worker
|
Async worker
|
||||||
++++++++++++
|
++++++++++++
|
||||||
|
|
||||||
- fix :issue:`790`: StopIteration shouldn't be catched at this level.
|
- fix :issue:`790`: StopIteration shouldn't be caught at this level.
|
||||||
|
|
||||||
|
|
||||||
Logging
|
Logging
|
||||||
@ -180,7 +180,7 @@ core
|
|||||||
- add: syslog logging can now be done to a unix socket
|
- add: syslog logging can now be done to a unix socket
|
||||||
- fix logging: don't try to redirect stdout/stderr to the logfile.
|
- fix logging: don't try to redirect stdout/stderr to the logfile.
|
||||||
- fix logging: don't propagate log
|
- fix logging: don't propagate log
|
||||||
- improve logging: file option can be overriden by the gunicorn options
|
- improve logging: file option can be overridden by the gunicorn options
|
||||||
`--error-logfile` and `--access-logfile` if they are given.
|
`--error-logfile` and `--access-logfile` if they are given.
|
||||||
- fix: don't override SERVER_* by the Host header
|
- fix: don't override SERVER_* by the Host header
|
||||||
- fix: handle_error
|
- fix: handle_error
|
||||||
|
|||||||
@ -90,7 +90,7 @@ Changelog - 2019
|
|||||||
- Simplify Paste Deployment documentation
|
- Simplify Paste Deployment documentation
|
||||||
- Fix root logging: root and logger are same level.
|
- Fix root logging: root and logger are same level.
|
||||||
- Fixed typo in ssl_version documentation
|
- Fixed typo in ssl_version documentation
|
||||||
- Documented systemd deployement unit examples
|
- Documented systemd deployment unit examples
|
||||||
- Added systemd sd_notify support
|
- Added systemd sd_notify support
|
||||||
- Fixed typo in gthread.py
|
- Fixed typo in gthread.py
|
||||||
- Added `tornado <https://www.tornadoweb.org/>`_ 5 and 6 support
|
- Added `tornado <https://www.tornadoweb.org/>`_ 5 and 6 support
|
||||||
|
|||||||
@ -15,7 +15,7 @@ for 3 different purposes:
|
|||||||
* `Mailing list <https://github.com/benoitc/gunicorn/projects/3>`_ : Discussion of Gunicorn development, new features
|
* `Mailing list <https://github.com/benoitc/gunicorn/projects/3>`_ : Discussion of Gunicorn development, new features
|
||||||
and project management.
|
and project management.
|
||||||
|
|
||||||
Project maintenance guidelines are avaible on the `wiki <https://github.com/benoitc/gunicorn/wiki/Project-management>`_
|
Project maintenance guidelines are available on the `wiki <https://github.com/benoitc/gunicorn/wiki/Project-management>`_
|
||||||
.
|
.
|
||||||
|
|
||||||
IRC
|
IRC
|
||||||
|
|||||||
@ -216,7 +216,7 @@ A tool that is starting to be common on linux systems is Systemd_. It is a
|
|||||||
system services manager that allows for strict process management, resources
|
system services manager that allows for strict process management, resources
|
||||||
and permissions control.
|
and permissions control.
|
||||||
|
|
||||||
Below are configurations files and instructions for using systemd to create
|
Below are configuration files and instructions for using systemd to create
|
||||||
a unix socket for incoming Gunicorn requests. Systemd will listen on this
|
a unix socket for incoming Gunicorn requests. Systemd will listen on this
|
||||||
socket and start gunicorn automatically in response to traffic. Later in
|
socket and start gunicorn automatically in response to traffic. Later in
|
||||||
this section are instructions for configuring Nginx to forward web traffic
|
this section are instructions for configuring Nginx to forward web traffic
|
||||||
|
|||||||
@ -996,10 +996,12 @@ Set the ``SO_REUSEPORT`` flag on the listening socket.
|
|||||||
|
|
||||||
**Command line:** ``--chdir``
|
**Command line:** ``--chdir``
|
||||||
|
|
||||||
**Default:** ``'/Users/chainz/Documents/Projects/gunicorn/docs'``
|
**Default:** ``'.'``
|
||||||
|
|
||||||
Change directory to specified directory before loading apps.
|
Change directory to specified directory before loading apps.
|
||||||
|
|
||||||
|
Default is the current directory.
|
||||||
|
|
||||||
.. _daemon:
|
.. _daemon:
|
||||||
|
|
||||||
``daemon``
|
``daemon``
|
||||||
|
|||||||
@ -526,12 +526,6 @@ class Arbiter(object):
|
|||||||
if exitcode == self.APP_LOAD_ERROR:
|
if exitcode == self.APP_LOAD_ERROR:
|
||||||
reason = "App failed to load."
|
reason = "App failed to load."
|
||||||
raise HaltServer(reason, self.APP_LOAD_ERROR)
|
raise HaltServer(reason, self.APP_LOAD_ERROR)
|
||||||
if os.WIFSIGNALED(status):
|
|
||||||
self.log.warning(
|
|
||||||
"Worker with pid %s was terminated due to signal %s",
|
|
||||||
wpid,
|
|
||||||
os.WTERMSIG(status)
|
|
||||||
)
|
|
||||||
|
|
||||||
worker = self.WORKERS.pop(wpid, None)
|
worker = self.WORKERS.pop(wpid, None)
|
||||||
if not worker:
|
if not worker:
|
||||||
|
|||||||
@ -275,7 +275,7 @@ class Logger(object):
|
|||||||
self.error_log.log(lvl, msg, *args, **kwargs)
|
self.error_log.log(lvl, msg, *args, **kwargs)
|
||||||
|
|
||||||
def atoms(self, resp, req, environ, request_time):
|
def atoms(self, resp, req, environ, request_time):
|
||||||
""" Gets atoms for log formating.
|
""" Gets atoms for log formatting.
|
||||||
"""
|
"""
|
||||||
status = resp.status
|
status = resp.status
|
||||||
if isinstance(status, str):
|
if isinstance(status, str):
|
||||||
|
|||||||
@ -145,7 +145,7 @@ def set_owner_process(uid, gid, initgroups=False):
|
|||||||
elif gid != os.getgid():
|
elif gid != os.getgid():
|
||||||
os.setgid(gid)
|
os.setgid(gid)
|
||||||
|
|
||||||
if uid:
|
if uid and uid != os.getuid():
|
||||||
os.setuid(uid)
|
os.setuid(uid)
|
||||||
|
|
||||||
|
|
||||||
@ -486,7 +486,10 @@ def daemonize(enable_stdio_inheritance=False):
|
|||||||
closerange(0, 3)
|
closerange(0, 3)
|
||||||
|
|
||||||
fd_null = os.open(REDIRECT_TO, os.O_RDWR)
|
fd_null = os.open(REDIRECT_TO, os.O_RDWR)
|
||||||
|
# PEP 446, make fd for /dev/null inheritable
|
||||||
|
os.set_inheritable(fd_null, True)
|
||||||
|
|
||||||
|
# expect fd_null to be always 0 here, but in-case not ...
|
||||||
if fd_null != 0:
|
if fd_null != 0:
|
||||||
os.dup2(fd_null, 0)
|
os.dup2(fd_null, 0)
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class WorkerTmp(object):
|
|||||||
if cfg.uid != os.geteuid() or cfg.gid != os.getegid():
|
if cfg.uid != os.geteuid() or cfg.gid != os.getegid():
|
||||||
util.chown(name, cfg.uid, cfg.gid)
|
util.chown(name, cfg.uid, cfg.gid)
|
||||||
|
|
||||||
# unlink the file so we don't leak tempory files
|
# unlink the file so we don't leak temporary files
|
||||||
try:
|
try:
|
||||||
if not IS_CYGWIN:
|
if not IS_CYGWIN:
|
||||||
util.unlink(name)
|
util.unlink(name)
|
||||||
|
|||||||
4
tox.ini
4
tox.ini
@ -1,10 +1,10 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py35, py36, py37, py38, py39, pypy3, lint
|
envlist = py35, py36, py37, py38, py39, py310, pypy3, lint, docs-lint, pycodestyle
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
commands = py.test --cov=gunicorn {posargs}
|
commands = pytest --cov=gunicorn {posargs}
|
||||||
deps =
|
deps =
|
||||||
-rrequirements_test.txt
|
-rrequirements_test.txt
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user