diff options
| -rw-r--r-- | doc/guix.texi | 9 | ||||
| -rw-r--r-- | gnu/services/web.scm | 16 |
2 files changed, 22 insertions, 3 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index d228d26b0cc..4ba4b650de7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -36232,6 +36232,15 @@ Launch the app as this group (it must be an existing group). | |||
| 36232 | A list of sockets (as path strings) which gunicorn will be listening | 36232 | A list of sockets (as path strings) which gunicorn will be listening |
| 36233 | on. This list must contain at least one socket. | 36233 | on. This list must contain at least one socket. |
| 36234 | 36234 | ||
| 36235 | @item @code{socket-user} (default: @code{user}) (type: string) | ||
| 36236 | Owner of the directory containing the socket (must be an existing user). | ||
| 36237 | |||
| 36238 | @item @code{socket-group} (default: @code{group}) (type: string) | ||
| 36239 | Group owner of the directory containing the socket (must be an existing group). | ||
| 36240 | |||
| 36241 | @item @code{socket-mode} (default: @code{#o750}) (type: integer) | ||
| 36242 | File mode to use for the directory containing the socket. | ||
| 36243 | |||
| 36235 | @item @code{workers} (default: @code{1}) (type: integer) | 36244 | @item @code{workers} (default: @code{1}) (type: integer) |
| 36236 | The number of workers for the gunicorn app. | 36245 | The number of workers for the gunicorn app. |
| 36237 | 36246 | ||
diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 9acf9b0f5be..b17ccd59fc7 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm | |||
| @@ -1061,6 +1061,14 @@ renewed TLS certificates, or @code{include}d files.") | |||
| 1061 | (wsgi-app-module gunicorn-app-wsgi-app-module) | 1061 | (wsgi-app-module gunicorn-app-wsgi-app-module) |
| 1062 | (user gunicorn-app-user) | 1062 | (user gunicorn-app-user) |
| 1063 | (group gunicorn-app-group) | 1063 | (group gunicorn-app-group) |
| 1064 | (socket-user gunicorn-app-socket-user | ||
| 1065 | (default (gunicorn-app-user this-gunicorn-app)) | ||
| 1066 | (thunked)) | ||
| 1067 | (socket-group gunicorn-app-socket-group | ||
| 1068 | (default (gunicorn-app-group this-gunicorn-app)) | ||
| 1069 | (thunked)) | ||
| 1070 | (socket-mode gunicorn-app-socket-mode | ||
| 1071 | (default #o750)) | ||
| 1064 | (sockets gunicorn-app-sockets | 1072 | (sockets gunicorn-app-sockets |
| 1065 | (default (list (string-append "unix:/var/run/gunicorn/" | 1073 | (default (list (string-append "unix:/var/run/gunicorn/" |
| 1066 | (gunicorn-app-name this-gunicorn-app) | 1074 | (gunicorn-app-name this-gunicorn-app) |
| @@ -1094,16 +1102,18 @@ renewed TLS certificates, or @code{include}d files.") | |||
| 1094 | 1102 | ||
| 1095 | ;; Create socket directories and set ownership. | 1103 | ;; Create socket directories and set ownership. |
| 1096 | (for-each (match-lambda | 1104 | (for-each (match-lambda |
| 1097 | ((user group socket-directories ...) | 1105 | ((user group mode socket-directories ...) |
| 1098 | (for-each (lambda (socket-directory) | 1106 | (for-each (lambda (socket-directory) |
| 1099 | (mkdir-p socket-directory) | 1107 | (mkdir-p socket-directory) |
| 1108 | (chmod socket-directory mode) | ||
| 1100 | (chown socket-directory | 1109 | (chown socket-directory |
| 1101 | (passwd:uid (getpw user)) | 1110 | (passwd:uid (getpw user)) |
| 1102 | (group:gid (getgrnam group)))) | 1111 | (group:gid (getgrnam group)))) |
| 1103 | socket-directories))) | 1112 | socket-directories))) |
| 1104 | '#$(map (lambda (app) | 1113 | '#$(map (lambda (app) |
| 1105 | (cons* (gunicorn-app-user app) | 1114 | (cons* (gunicorn-app-socket-user app) |
| 1106 | (gunicorn-app-group app) | 1115 | (gunicorn-app-socket-group app) |
| 1116 | (gunicorn-app-socket-mode app) | ||
| 1107 | (filter-map (lambda (socket) | 1117 | (filter-map (lambda (socket) |
| 1108 | (and | 1118 | (and |
| 1109 | (unix-socket? socket) | 1119 | (unix-socket? socket) |
