plain bluebream server basically working
This commit is contained in:
parent
ffa5c8701e
commit
6169a2d728
9 changed files with 44 additions and 64 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,6 +2,7 @@
|
||||||
*.pyo
|
*.pyo
|
||||||
*.swp
|
*.swp
|
||||||
dist/
|
dist/
|
||||||
|
var/
|
||||||
*.egg-info
|
*.egg-info
|
||||||
*.project
|
*.project
|
||||||
*.pydevproject
|
*.pydevproject
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
<include package="zope.app.publication" file="meta.zcml" />
|
<include package="zope.app.publication" file="meta.zcml" />
|
||||||
<include package="zope.app.form.browser" 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.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.browserresource" />
|
||||||
<include package="zope.copypastemove" />
|
<include package="zope.copypastemove" />
|
||||||
<include package="zope.publisher" />
|
<include package="zope.publisher" />
|
||||||
|
@ -42,13 +41,15 @@
|
||||||
<include package="zope.app.authentication" />
|
<include package="zope.app.authentication" />
|
||||||
<include package="zope.app.security.browser" />
|
<include package="zope.app.security.browser" />
|
||||||
<include package="zope.traversing.browser" />
|
<include package="zope.traversing.browser" />
|
||||||
<include package="zope.app.pagetemplate" />
|
<include package="zope.browserpage" />
|
||||||
<include package="zope.app.schema" />
|
<include package="zope.app.schema" />
|
||||||
<include package="zope.app.http" />
|
<include package="zope.app.http" />
|
||||||
<include package="zope.keyreference" />
|
<include package="zope.keyreference" />
|
||||||
<include package="zope.intid" />
|
<include package="zope.intid" />
|
||||||
<include package="zope.contentprovider" />
|
<include package="zope.contentprovider" />
|
||||||
<include package="zope.i18n" />
|
<include package="zope.i18n" />
|
||||||
|
<include package="zope.catalog" />
|
||||||
|
<include package="zope.dublincore.browser" />
|
||||||
|
|
||||||
<!-- enable the apidoc -->
|
<!-- enable the apidoc -->
|
||||||
<!-- enable this when apidoc works
|
<!-- enable this when apidoc works
|
||||||
|
|
|
@ -1,63 +1,23 @@
|
||||||
<configure
|
<configure
|
||||||
xmlns="http://namespaces.zope.org/zope"
|
xmlns="http://namespaces.zope.org/zope"
|
||||||
xmlns:browser="http://namespaces.zope.org/browser"
|
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.zcmlfiles" />
|
||||||
<include package="zope.app.catalog" />
|
|
||||||
<include package="zope.app.i18n" />
|
<include package="zope.app.i18n" />
|
||||||
<include package="zope.app.intid" />
|
<include package="zope.app.intid" />
|
||||||
<include package="zope.app.renderer" />
|
<include package="zope.app.renderer" />
|
||||||
<include package="zope.app.session" />
|
<include package="zope.app.session" />
|
||||||
<include package="zope.dublincore.browser" />
|
|
||||||
<include package="zope.intid" />
|
|
||||||
<include package="zope.sendmail" file="meta.zcml" />
|
<include package="zope.sendmail" file="meta.zcml" />
|
||||||
|
|
||||||
<!-- Security Policy -->
|
|
||||||
<include package="main" file="securitypolicy.zcml" />
|
<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
|
<browser:defaultView
|
||||||
for="zope.container.interfaces.IContainer"
|
for="zope.container.interfaces.IContainer"
|
||||||
name="index.html" />
|
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" />
|
<includeOverrides package="main" file="overrides.zcml" />
|
||||||
|
|
||||||
</configure>
|
</configure>
|
||||||
|
|
|
@ -2,14 +2,11 @@
|
||||||
|
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from os import getenv
|
from os import getenv
|
||||||
from scopes.server.app import zope_app_factory
|
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
server_port = getenv('SERVER_PORT', '8099')
|
server_port = getenv('SERVER_PORT', '8099')
|
||||||
|
|
||||||
app_factory = zope_app_factory
|
|
||||||
|
|
||||||
# storage settings
|
# storage settings
|
||||||
from scopes.storage.db.postgres import StorageFactory
|
from scopes.storage.db.postgres import StorageFactory
|
||||||
dbengine = 'postgresql+psycopg'
|
dbengine = 'postgresql+psycopg'
|
||||||
|
|
|
@ -1,20 +1,15 @@
|
||||||
# loops/inst/bluebream/main.py
|
# 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):
|
def run(app, config):
|
||||||
port = int(config.server_port)
|
port = int(config.server_port)
|
||||||
with make_server('', port, app) as httpd:
|
waitress.serve(app, port=port)
|
||||||
print(f'Serving on port {port}.')
|
print(f'Serving on port {port}.')
|
||||||
try:
|
|
||||||
httpd.serve_forever()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
print('Shutting down.')
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import config
|
import config
|
||||||
#run(config.app, config)
|
app = getWSGIApplication('zope.conf')
|
||||||
app = config.app_factory(config)
|
|
||||||
run(app, config)
|
run(app, config)
|
||||||
# see zope.app.wsgi.getWSGIApplication
|
|
||||||
|
|
18
inst/bluebream/notfound.pt
Normal file
18
inst/bluebream/notfound.pt
Normal 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>
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
<!-- ZCML declarations to override the default definitions -->
|
<!-- ZCML declarations to override the default definitions -->
|
||||||
|
|
||||||
<browser:defaultSkin name="Loops" />
|
|
||||||
|
|
||||||
<browser:containerViews
|
<browser:containerViews
|
||||||
for="zope.app.folder.interfaces.IFolder"
|
for="zope.app.folder.interfaces.IFolder"
|
||||||
contents="zope.ManageContent"
|
contents="zope.ManageContent"
|
||||||
|
@ -43,6 +41,4 @@
|
||||||
class="zope.app.exception.browser.notfound.NotFound"
|
class="zope.app.exception.browser.notfound.NotFound"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<include package="cco.member" />
|
|
||||||
|
|
||||||
</configure>
|
</configure>
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
<grant role="zope.Member" permission="zope.View" />
|
<grant role="zope.Member" permission="zope.View" />
|
||||||
<grant role="zope.ContentManager" permission="zope.ManageContent" />
|
<grant role="zope.ContentManager" permission="zope.ManageContent" />
|
||||||
<grant role="zope.ContentManager" permission="zope.View" />
|
<grant role="zope.ContentManager" permission="zope.View" />
|
||||||
<grant role="zope.ContentManager" permission="loops.AssignAsParent" />
|
|
||||||
|
|
||||||
<principal
|
<principal
|
||||||
id="zope.manager"
|
id="zope.manager"
|
||||||
|
|
|
@ -25,13 +25,26 @@ dependencies = [
|
||||||
"zope.pluggableauth",
|
"zope.pluggableauth",
|
||||||
"zope.principalannotation",
|
"zope.principalannotation",
|
||||||
"zope.principalregistry",
|
"zope.principalregistry",
|
||||||
|
"zope.publisher",
|
||||||
"zope.securitypolicy",
|
"zope.securitypolicy",
|
||||||
"zope.site",
|
"zope.site",
|
||||||
"zope.thread",
|
"zope.thread",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[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"]
|
test = ["zope.testrunner"]
|
||||||
|
|
||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
|
|
Loading…
Add table
Reference in a new issue