work in progress: loops / bluebream instances (app installations)
This commit is contained in:
parent
48a51c54b1
commit
ffa5c8701e
13 changed files with 480 additions and 0 deletions
62
inst/bluebream.zcml
Normal file
62
inst/bluebream.zcml
Normal file
|
@ -0,0 +1,62 @@
|
|||
<configure xmlns="http://namespaces.zope.org/zope">
|
||||
|
||||
<include package="zope.component" file="meta.zcml" />
|
||||
<include package="zope.security" file="meta.zcml" />
|
||||
<include package="zope.publisher" file="meta.zcml" />
|
||||
<include package="zope.i18n" file="meta.zcml" />
|
||||
<include package="zope.browserresource" file="meta.zcml" />
|
||||
<include package="zope.browsermenu" file="meta.zcml" />
|
||||
<include package="zope.browserpage" file="meta.zcml" />
|
||||
<include package="zope.securitypolicy" file="meta.zcml" />
|
||||
<include package="zope.principalregistry" file="meta.zcml" />
|
||||
<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" />
|
||||
<include package="zope.component" />
|
||||
<include package="zope.traversing" />
|
||||
<include package="zope.location" />
|
||||
<include package="zope.site" />
|
||||
<include package="zope.annotation" />
|
||||
<include package="zope.principalregistry" />
|
||||
<include package="zope.container" />
|
||||
<include package="zope.componentvocabulary" />
|
||||
<include package="zope.formlib" />
|
||||
<include package="zope.app.appsetup" />
|
||||
<include package="zope.app.security" />
|
||||
<include package="zope.app.publication" />
|
||||
<include package="zope.app.form.browser" />
|
||||
<include package="zope.app.basicskin" />
|
||||
<include package="zope.browsermenu" />
|
||||
<include package="zope.principalregistry" />
|
||||
<include package="zope.authentication" />
|
||||
<include package="zope.securitypolicy" />
|
||||
<include package="zope.login" />
|
||||
<include package="zope.session" />
|
||||
<include package="zope.error" />
|
||||
<include package="zope.app.zcmlfiles" file="menus.zcml" />
|
||||
<include package="zope.app.authentication" />
|
||||
<include package="zope.app.security.browser" />
|
||||
<include package="zope.traversing.browser" />
|
||||
<include package="zope.app.pagetemplate" />
|
||||
<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" />
|
||||
|
||||
<!-- enable the apidoc -->
|
||||
<!-- enable this when apidoc works
|
||||
<include zcml:condition="have devmode"
|
||||
package="zope.app.apidoc" file="meta.zcml" />
|
||||
<include zcml:condition="have devmode"
|
||||
package="zope.app.apidoc" />
|
||||
-->
|
||||
|
||||
</configure>
|
||||
|
8
inst/bluebream/.env
Normal file
8
inst/bluebream/.env
Normal file
|
@ -0,0 +1,8 @@
|
|||
# loops/inst/bluebream/.env
|
||||
|
||||
SERVER_PORT=8800
|
||||
|
||||
DBNAME=ccotest
|
||||
DBUSER=ccotest
|
||||
DBPASSWORD=cco
|
||||
DBSCHEMA=testing
|
63
inst/bluebream/application.zcml
Normal file
63
inst/bluebream/application.zcml
Normal file
|
@ -0,0 +1,63 @@
|
|||
<configure
|
||||
xmlns="http://namespaces.zope.org/zope"
|
||||
xmlns:browser="http://namespaces.zope.org/browser"
|
||||
i18n_domain="main">
|
||||
|
||||
<!-- default bluebream libraries -->
|
||||
<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>
|
19
inst/bluebream/config.py
Normal file
19
inst/bluebream/config.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# loops/inst/bluebream/config.py
|
||||
|
||||
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'
|
||||
dbname = getenv('DBNAME', 'demo')
|
||||
dbuser = getenv('DBUSER', 'demo')
|
||||
dbpassword = getenv('DBPASSWORD', 'secret')
|
||||
dbschema = getenv('DBSCHEMA', 'demo')
|
20
inst/bluebream/main.py
Normal file
20
inst/bluebream/main.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# loops/inst/bluebream/main.py
|
||||
|
||||
from wsgiref.simple_server import make_server
|
||||
|
||||
def run(app, config):
|
||||
port = int(config.server_port)
|
||||
with make_server('', port, app) as httpd:
|
||||
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)
|
||||
run(app, config)
|
||||
# see zope.app.wsgi.getWSGIApplication
|
48
inst/bluebream/overrides.zcml
Normal file
48
inst/bluebream/overrides.zcml
Normal file
|
@ -0,0 +1,48 @@
|
|||
<configure
|
||||
xmlns="http://namespaces.zope.org/zope"
|
||||
xmlns:browser="http://namespaces.zope.org/browser">
|
||||
|
||||
<!-- ZCML declarations to override the default definitions -->
|
||||
|
||||
<browser:defaultSkin name="Loops" />
|
||||
|
||||
<browser:containerViews
|
||||
for="zope.app.folder.interfaces.IFolder"
|
||||
contents="zope.ManageContent"
|
||||
index="zope.ManageContent"
|
||||
add="zope.ManageContent"
|
||||
/>
|
||||
|
||||
<browser:page
|
||||
name="singleBranchTree.xml"
|
||||
for="zope.interface.interface.Interface"
|
||||
permission="zope.ManageContent"
|
||||
class="zope.app.rotterdam.xmlobject.XmlObjectView"
|
||||
attribute="singleBranchTree"
|
||||
/>
|
||||
|
||||
<browser:pages
|
||||
for="zope.container.interfaces.IReadContainer"
|
||||
permission="zope.ManageContent"
|
||||
class="zope.app.rotterdam.xmlobject.ReadContainerXmlObjectView">
|
||||
<browser:page
|
||||
name="children.xml"
|
||||
attribute="children"
|
||||
/>
|
||||
<browser:page
|
||||
name="singleBranchTree.xml"
|
||||
attribute="singleBranchTree"
|
||||
/>
|
||||
</browser:pages>
|
||||
|
||||
<browser:page
|
||||
for="zope.publisher.interfaces.INotFound"
|
||||
name="index.html"
|
||||
permission="zope.Public"
|
||||
template="notfound.pt"
|
||||
class="zope.app.exception.browser.notfound.NotFound"
|
||||
/>
|
||||
|
||||
<include package="cco.member" />
|
||||
|
||||
</configure>
|
52
inst/bluebream/securitypolicy.zcml
Normal file
52
inst/bluebream/securitypolicy.zcml
Normal file
|
@ -0,0 +1,52 @@
|
|||
<configure
|
||||
xmlns="http://namespaces.zope.org/zope"
|
||||
i18n_domain="main">
|
||||
|
||||
<!-- This file contains sample security policy definition -->
|
||||
|
||||
<securityPolicy
|
||||
component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
|
||||
|
||||
<unauthenticatedPrincipal
|
||||
id="zope.anybody"
|
||||
title="Unauthenticated User" />
|
||||
|
||||
<unauthenticatedGroup
|
||||
id="zope.Anybody"
|
||||
title="Unauthenticated Users" />
|
||||
|
||||
<authenticatedGroup
|
||||
id="zope.Authenticated"
|
||||
title="Authenticated Users" />
|
||||
|
||||
<everybodyGroup
|
||||
id="zope.Everybody"
|
||||
title="All Users" />
|
||||
|
||||
<role id="zope.Anonymous" title="Everybody"
|
||||
description="All users have this role implicitly" />
|
||||
<grant permission="zope.View" role="zope.Anonymous" />
|
||||
|
||||
<role id="zope.Manager" title="Site Manager" />
|
||||
<grantAll role="zope.Manager" />
|
||||
|
||||
<role id="zope.Member" title="Site Member" />
|
||||
<role id="zope.ContentManager" title="Content Manager" />
|
||||
|
||||
<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"
|
||||
title="Manager"
|
||||
login="admin"
|
||||
password="admin"
|
||||
password_manager="Plain Text" />
|
||||
|
||||
<grant
|
||||
role="zope.Manager"
|
||||
principal="zope.manager" />
|
||||
|
||||
</configure>
|
39
inst/bluebream/zope.conf
Normal file
39
inst/bluebream/zope.conf
Normal file
|
@ -0,0 +1,39 @@
|
|||
# loops/inst/bluebream/zope.conf
|
||||
# main zope configuration file for deployment
|
||||
|
||||
# Identify the component configuration used to define the site:
|
||||
site-definition application.zcml
|
||||
|
||||
<zodb>
|
||||
|
||||
<filestorage>
|
||||
path var/filestorage/Data.fs
|
||||
blob-dir var/blob
|
||||
</filestorage>
|
||||
|
||||
# Uncomment this if you want to connect to a ZEO server instead:
|
||||
# <zeoclient>
|
||||
# server localhost:8100
|
||||
# storage 1
|
||||
# # ZEO client cache, in bytes
|
||||
# cache-size 20MB
|
||||
# # Uncomment to have a persistent disk cache
|
||||
# #client zeo1
|
||||
# </zeoclient>
|
||||
</zodb>
|
||||
|
||||
<eventlog>
|
||||
# This sets up logging to both a file and to standard output (STDOUT).
|
||||
# The "path" setting can be a relative or absolute filesystem path or
|
||||
# the tokens STDOUT or STDERR.
|
||||
|
||||
<logfile>
|
||||
path var/log/z3-deploy.log
|
||||
formatter zope.exceptions.log.Formatter
|
||||
</logfile>
|
||||
|
||||
<logfile>
|
||||
path STDOUT
|
||||
formatter zope.exceptions.log.Formatter
|
||||
</logfile>
|
||||
</eventlog>
|
63
inst/loops/application.zcml
Normal file
63
inst/loops/application.zcml
Normal file
|
@ -0,0 +1,63 @@
|
|||
<configure
|
||||
xmlns="http://namespaces.zope.org/zope"
|
||||
xmlns:browser="http://namespaces.zope.org/browser"
|
||||
i18n_domain="main">
|
||||
|
||||
<!-- default bluebream libraries -->
|
||||
<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>
|
48
inst/loops/overrides.zcml
Normal file
48
inst/loops/overrides.zcml
Normal file
|
@ -0,0 +1,48 @@
|
|||
<configure
|
||||
xmlns="http://namespaces.zope.org/zope"
|
||||
xmlns:browser="http://namespaces.zope.org/browser">
|
||||
|
||||
<!-- ZCML declarations to override the default definitions -->
|
||||
|
||||
<browser:defaultSkin name="Loops" />
|
||||
|
||||
<browser:containerViews
|
||||
for="zope.app.folder.interfaces.IFolder"
|
||||
contents="zope.ManageContent"
|
||||
index="zope.ManageContent"
|
||||
add="zope.ManageContent"
|
||||
/>
|
||||
|
||||
<browser:page
|
||||
name="singleBranchTree.xml"
|
||||
for="zope.interface.interface.Interface"
|
||||
permission="zope.ManageContent"
|
||||
class="zope.app.rotterdam.xmlobject.XmlObjectView"
|
||||
attribute="singleBranchTree"
|
||||
/>
|
||||
|
||||
<browser:pages
|
||||
for="zope.container.interfaces.IReadContainer"
|
||||
permission="zope.ManageContent"
|
||||
class="zope.app.rotterdam.xmlobject.ReadContainerXmlObjectView">
|
||||
<browser:page
|
||||
name="children.xml"
|
||||
attribute="children"
|
||||
/>
|
||||
<browser:page
|
||||
name="singleBranchTree.xml"
|
||||
attribute="singleBranchTree"
|
||||
/>
|
||||
</browser:pages>
|
||||
|
||||
<browser:page
|
||||
for="zope.publisher.interfaces.INotFound"
|
||||
name="index.html"
|
||||
permission="zope.Public"
|
||||
template="notfound.pt"
|
||||
class="zope.app.exception.browser.notfound.NotFound"
|
||||
/>
|
||||
|
||||
<include package="cco.member" />
|
||||
|
||||
</configure>
|
52
inst/loops/securitypolicy.zcml
Normal file
52
inst/loops/securitypolicy.zcml
Normal file
|
@ -0,0 +1,52 @@
|
|||
<configure
|
||||
xmlns="http://namespaces.zope.org/zope"
|
||||
i18n_domain="main">
|
||||
|
||||
<!-- This file contains sample security policy definition -->
|
||||
|
||||
<securityPolicy
|
||||
component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
|
||||
|
||||
<unauthenticatedPrincipal
|
||||
id="zope.anybody"
|
||||
title="Unauthenticated User" />
|
||||
|
||||
<unauthenticatedGroup
|
||||
id="zope.Anybody"
|
||||
title="Unauthenticated Users" />
|
||||
|
||||
<authenticatedGroup
|
||||
id="zope.Authenticated"
|
||||
title="Authenticated Users" />
|
||||
|
||||
<everybodyGroup
|
||||
id="zope.Everybody"
|
||||
title="All Users" />
|
||||
|
||||
<role id="zope.Anonymous" title="Everybody"
|
||||
description="All users have this role implicitly" />
|
||||
<grant permission="zope.View" role="zope.Anonymous" />
|
||||
|
||||
<role id="zope.Manager" title="Site Manager" />
|
||||
<grantAll role="zope.Manager" />
|
||||
|
||||
<role id="zope.Member" title="Site Member" />
|
||||
<role id="zope.ContentManager" title="Content Manager" />
|
||||
|
||||
<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"
|
||||
title="Manager"
|
||||
login="admin"
|
||||
password="admin"
|
||||
password_manager="Plain Text" />
|
||||
|
||||
<grant
|
||||
role="zope.Manager"
|
||||
principal="zope.manager" />
|
||||
|
||||
</configure>
|
|
@ -31,6 +31,7 @@ dependencies = [
|
|||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
server = ["waitress", "ZConfig", "zope.app.wsgi"]
|
||||
test = ["zope.testrunner"]
|
||||
|
||||
[tool.setuptools]
|
||||
|
|
5
runtests.sh
Executable file
5
runtests.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
# runtests.sh
|
||||
# run all unit / doc tests
|
||||
|
||||
zope-testrunner --test-path=. $*
|
||||
|
Loading…
Add table
Reference in a new issue