Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
54b8ee70
Commit
54b8ee70
authored
Feb 07, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zopewsgi: disable XML-RPC and provide an option to enable
parent
152bbdfb
Pipeline
#34490
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
product/ERP5/bin/zopewsgi.py
product/ERP5/bin/zopewsgi.py
+17
-0
No files found.
product/ERP5/bin/zopewsgi.py
View file @
54b8ee70
...
...
@@ -18,6 +18,10 @@ from waitress.server import create_server
import
ZConfig
import
Zope2
from
Zope2.Startup.run
import
make_wsgi_app
from
App.config
import
getConfiguration
from
zope.component
import
getGlobalSiteManager
import
zope.interface
import
ZPublisher.interfaces
try
:
from
ZPublisher.WSGIPublisher
import
_MODULES
...
...
@@ -86,6 +90,12 @@ class TransLogger(object):
self
.
logger
.
info
(
message
)
@
zope
.
interface
.
implementer
(
ZPublisher
.
interfaces
.
IXmlrpcChecker
)
class
XMLRPCDisabler
:
def
__call__
(
self
,
request
):
return
False
def
app_wrapper
(
large_file_threshold
,
webdav_ports
):
try
:
from
Products.DeadlockDebugger.dumper
import
dump_threads
,
dump_url
...
...
@@ -186,6 +196,7 @@ def runwsgi():
'--with-max-rlimit-nofile'
,
help
=
'Set soft limit of file descriptors erp5 can open to hard limit'
,
action
=
"store_true"
)
parser
.
add_argument
(
'--enable-xml-rpc'
,
help
=
'Enable XML-RPC interface'
,
action
=
'store_true'
)
args
=
parser
.
parse_args
()
if
not
sys
.
warnoptions
:
...
...
@@ -239,6 +250,12 @@ def runwsgi():
schema
=
ZConfig
.
loadSchema
(
os
.
path
.
join
(
startup
,
'zopeschema.xml'
))
conf
,
_
=
ZConfig
.
loadConfig
(
schema
,
args
.
zope_conf
)
if
not
args
.
enable_xml_rpc
:
getGlobalSiteManager
().
registerUtility
(
XMLRPCDisabler
(),
ZPublisher
.
interfaces
.
IXmlrpcChecker
,
)
if
conf
.
debug_mode
:
console_handler
=
logging
.
StreamHandler
(
sys
.
stderr
)
console_handler
.
setFormatter
(
logging
.
Formatter
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment