设置

CubicWeb设置

立体金字塔 not 利用CubicWeb配置中的配置条目(A.K.A. all-in-one.conf )对于任何与金字塔相关的配置值。

金字塔设置文件

向后兼容性 模式,金字塔设置将在 pyramid.ini 实例主目录中的文件(其中 all-in-one.conf 文件是),其 [main] 节将被读取并用作 settings 金字塔的构造者。

此配置文件与 pserve 允许轻松添加和配置任何金字塔扩展。

典型 pyramid.ini 文件是:

[main]
pyramid.includes =
    pyramid_redis_sessions

cubicweb.defaults = no
cubicweb.includes =
    cubicweb.pyramid.auth
    cubicweb.pyramid.login

cubicweb.profile = no

redis.sessions.secret = your_cookie_signing_secret
redis.sessions.timeout = 1200

redis.sessions.host = mywheezy

没有 向后兼容性 标准 development.ini 文件可以与添加的任何有用的CubicWeb特定设置一起使用。

金字塔立方体Web配置条目

金字塔CubicWeb特定配置条目为:

cubicweb.instance (string)

CubicWeb实例名称。当应用程序不由运行时很有用 “金字塔”命令 .

cubicweb.debug (bool)

启用CubicWeb调试模式。仅当实例由设置时有效 cubicweb.instance .

与调试模式由 cubicweb-ctl pyramid --debug-mode 命令,金字塔调试选项不会被触动。

cubicweb.includes (list)

等同于 pyramid.includes 但include是在初始化CubicWeb特定的注册表项之后完成的。

用于包含需要这些条目的扩展。

cubicweb.bwcompat (bool)

(正确)启用/禁用向后兼容性。这仅适用于“一体式”配置类型。

cubicweb.pyramid.bwcompat .

cubicweb.bwcompat.errorhandler (bool)

(true)启用/禁用向后兼容错误处理程序。如果需要定义自己的错误处理程序,请设置为“否”。

cubicweb.defaults (bool)

(真)启用/禁用默认值。参见 cubicweb.pyramid.defaults .

cubicweb.profile (bool)

(false)启用/禁用分析。参见 分析 .

cubicweb.auth.update_login_time (bool)

(正确)添加 cubicweb.pyramid.auth.UpdateLoginTimeAuthenticationPolicy 策略,在用户登录时更新cwuser.login_time属性。

cubicweb.auth.authtkt (bool)

(true)启用2个基于cookie的身份验证策略,该策略根据 persistent 参数传递给 remember .

默认登录视图将persistent设置为true,如果 __setauthcookie 参数传递给它们,并在 pyramid.settings.asbool() .

策略的配置值是的参数 pyramid.authentication.AuthTktAuthenticationPolicy .

第一个策略处理会话身份验证。如果 remember() 被调用 persistent=False

cubicweb.auth.authtkt.session.cookie_name (str)

(‘auth’tkt’)cookie名称。必须与持久身份验证cookie名称不同。

cubicweb.auth.authtkt.session.timeout (int)
  1. cookie超时。

cubicweb.auth.authtkt.session.reissue_time (int)
  1. 重新发行时间。

第二个策略处理持久身份验证。如果 remember() 被调用 persistent=True

cubicweb.auth.authtkt.persistent.cookie_name (str)

(‘auth’tkt’)cookie名称。必须与会话身份验证cookie名称不同。

cubicweb.auth.authtkt.persistent.max_age (int)

(30天)最大年龄(秒)。

cubicweb.auth.authtkt.persistent.reissue_time (int)

(1天)重新发行时间(秒)。

两个策略都设置了 secure 旗到 True 默认情况下,这意味着只能通过安全连接发送cookie(请参见 Authentication Policies documentation 详细信息)。可以通过以下方式配置 cubicweb.auth.authtkt.persistent.securecubicweb.auth.authtkt.session.secure 配置选项。

cubicweb.auth.groups_principals (bool)

(true)在将用户组插入主体的身份验证堆栈上设置回调。