plain bluebream server basically working

This commit is contained in:
Helmut Merz 2024-09-29 09:48:37 +02:00
parent ffa5c8701e
commit 6169a2d728
9 changed files with 44 additions and 64 deletions

1
.gitignore vendored
View file

@ -2,6 +2,7 @@
*.pyo
*.swp
dist/
var/
*.egg-info
*.project
*.pydevproject

View file

@ -12,8 +12,7 @@
<include package="zope.app.publication" file="meta.zcml" />
<include package="zope.app.form.browser" file="meta.zcml" />
<include package="zope.app.container.browser" file="meta.zcml" />
<include package="zope.app.pagetemplate" file="meta.zcml" />
<include package="zope.app.publisher.xmlrpc" file="meta.zcml" />
<include package="zope.browserresource" />
<include package="zope.copypastemove" />
<include package="zope.publisher" />
@ -42,13 +41,15 @@
<include package="zope.app.authentication" />
<include package="zope.app.security.browser" />
<include package="zope.traversing.browser" />
<include package="zope.app.pagetemplate" />
<include package="zope.browserpage" />
<include package="zope.app.schema" />
<include package="zope.app.http" />
<include package="zope.keyreference" />
<include package="zope.intid" />
<include package="zope.contentprovider" />
<include package="zope.i18n" />
<include package="zope.catalog" />
<include package="zope.dublincore.browser" />
<!-- enable the apidoc -->
<!-- enable this when apidoc works

View file

@ -1,63 +1,23 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="main">
i18n_domain="bluebream">
<!-- default bluebream libraries -->
<include file="bluebream.zcml" />
<include file="../bluebream.zcml" />
<include package="zope.app.zcmlfiles" />
<include package="zope.app.catalog" />
<include package="zope.app.i18n" />
<include package="zope.app.intid" />
<include package="zope.app.renderer" />
<include package="zope.app.session" />
<include package="zope.dublincore.browser" />
<include package="zope.intid" />
<include package="zope.sendmail" file="meta.zcml" />
<!-- Security Policy -->
<include package="main" file="securitypolicy.zcml" />
<!-- The following registration (defaultView) register 'index' as
the default view for a container. The name of default view
can be changed to a different value, for example, 'index.html'.
More details about defaultView registration is available here:
http://bluebream.zope.org/doc/1.0/howto/defaultview.html
-->
<browser:defaultView
for="zope.container.interfaces.IContainer"
name="index.html" />
<!-- To remove the sample application delete the following line
and remove the `welcome` folder from this directory.
-->
<!--<include package=".welcome" />-->
<include package="cybertools" />
<include package="cybertools.ajax.dojo" />
<include package="cybertools.catalog" />
<include package="cybertools.composer.layout" />
<include package="cybertools.container" />
<!--<include package="cybertools.pyscript" />-->
<include package="cybertools.xedit" />
<include package="loops" />
<!--<include package="loops.browser.flash" />-->
<include package="cco.schema" />
<include package="cco.skin.r2" />
<include package="cco.webapi" />
<include package="ccq.cqportal" />
<include package="ccq.misc" />
<include package="custom.bwp" />
<include package="custom.brunold" />
<include package="custom.bwpsites" />
<include package="custom.cyberconcepts" />
<include package="custom.omk" />
<include package="cyberapps.ccmkg" />
<include package="cyberapps.knowledge" />
<!-- Override registrations -->
<includeOverrides package="main" file="overrides.zcml" />
</configure>

View file

@ -2,14 +2,11 @@
from dotenv import load_dotenv
from os import getenv
from scopes.server.app import zope_app_factory
load_dotenv()
server_port = getenv('SERVER_PORT', '8099')
app_factory = zope_app_factory
# storage settings
from scopes.storage.db.postgres import StorageFactory
dbengine = 'postgresql+psycopg'

View file

@ -1,20 +1,15 @@
# loops/inst/bluebream/main.py
from wsgiref.simple_server import make_server
import waitress
from zope.app.wsgi import config, getWSGIApplication
def run(app, config):
port = int(config.server_port)
with make_server('', port, app) as httpd:
waitress.serve(app, port=port)
print(f'Serving on port {port}.')
try:
httpd.serve_forever()
except KeyboardInterrupt:
print('Shutting down.')
if __name__ == '__main__':
import config
#run(config.app, config)
app = config.app_factory(config)
app = getWSGIApplication('zope.conf')
run(app, config)
# see zope.app.wsgi.getWSGIApplication

View file

@ -0,0 +1,18 @@
<html
i18n:domain="zope">
<body>
<h3 i18n:translate="">
The page that you are trying to access is not available
</h3>
<br/>
<b i18n:translate="">Please note the following:</b>
<br/>
<ol>
<li i18n:translate=""> You might have misspelled the url </li>
<li i18n:translate="">
You might be trying to access a non-existing page
</li>
</ol>
</body>
</html>

View file

@ -4,8 +4,6 @@
<!-- ZCML declarations to override the default definitions -->
<browser:defaultSkin name="Loops" />
<browser:containerViews
for="zope.app.folder.interfaces.IFolder"
contents="zope.ManageContent"
@ -43,6 +41,4 @@
class="zope.app.exception.browser.notfound.NotFound"
/>
<include package="cco.member" />
</configure>

View file

@ -36,7 +36,6 @@
<grant role="zope.Member" permission="zope.View" />
<grant role="zope.ContentManager" permission="zope.ManageContent" />
<grant role="zope.ContentManager" permission="zope.View" />
<grant role="zope.ContentManager" permission="loops.AssignAsParent" />
<principal
id="zope.manager"

View file

@ -25,13 +25,26 @@ dependencies = [
"zope.pluggableauth",
"zope.principalannotation",
"zope.principalregistry",
"zope.publisher",
"zope.securitypolicy",
"zope.site",
"zope.thread",
]
[project.optional-dependencies]
server = ["waitress", "ZConfig", "zope.app.wsgi"]
server = [
"waitress",
"ZConfig",
"zope.app.form",
"zope.app.intid",
"zope.app.publication",
"zope.app.session",
"zope.app.wsgi",
"zope.app.zcmlfiles",
"zope.contentprovider",
]
test = ["zope.testrunner"]
[tool.setuptools]