将“金字塔”命令添加到cubicweb ctl
cubicweb-pyramid的Python项目详细描述
将“金字塔”命令添加到cubicweb ctl”。
此多维数据集还添加CWSession实体类型,以便会话可以 存储在数据库中,允许运行cubicweb实例 无需设置会话存储(如redis或memcache) 解决方案。
但是,对于生产系统,建议使用 会话的存储解决方案。
会话的处理是通过金字塔来完成的(参见 pyramid’s documentation on sessions了解更多详细信息)。
例如,要设置基于redis的会话存储,您需要 pyramid-redis-session包,则必须将棱锥体配置为 通过在实例的 配置目录(靠近all-in-one.conf文件):
[main]cubicweb.defaults=no # we do not want to load the default cw session handlingcubicweb.auth.authtkt.session.secret=<secret1>cubicweb.auth.authtkt.persistent.secret=<secret2>cubicweb.auth.authtkt.session.secure=yescubicweb.auth.authtkt.persistent.secure=yesredis.sessions.secret=<secret3>redis.sessions.prefix=<my-app>:redis.sessions.url=redis://localhost:6379/0pyramid.includes= pyramid_redis_sessions pyramid_cubicweb.auth pyramid_cubicweb.login
有关详细信息,请参阅Pyramid Cubicweb的文档。
警告
如果您想登录cubicweb应用程序 在不安全的流上由金字塔服务(通常在 使用一个简单的 cubicweb-ctl pyramid -D-linfo myinstance,您 必须将cubicweb.auth.authtkt.session.secure设置为 no。
秘密
在pyramid.ini中有许多机密要配置。他们 应该彼此不同,如Pyramid’s documentation中所述。
记录在案:
cubicweb.session.secret: | |
---|---|
This secret is used to encrypt the session’s data ID (data themselved are stored in the backend, database or redis) when using the integrated (^{tt1}$ based) session data storage. | |
redis.session.secret: | |
This secret is used to encrypt the session’s data ID (data themselved are stored in the backend, database or redis) when using redis as backend. | |
cubicweb.auth.authtkt.session.secret: | |
This secret is used to encrypt the authentication cookie. | |
cubicweb.auth.authtkt.persistent.secret: | |
This secret is used to encrypt the persistent authentication cookie. |