This file is indexed.

/usr/lib/python2.7/dist-packages/sagenb/notebook/server_conf.py is in python-sagenb 1.0.1+ds1-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# -*- coding: utf-8 -*-
"""nodoctest
"""
#from   template import language
import copy

from . import conf
from .conf import (POS, DESC, GROUP, TYPE, CHOICES, T_BOOL, T_INTEGER,
                   T_CHOICE, T_REAL, T_COLOR, T_STRING, T_LIST, T_INFO)
from sagenb.misc.misc import get_languages, N_
from flask_babel import gettext, lazy_gettext
_ = lazy_gettext

defaults = {'word_wrap_cols':72,
            'max_history_length':250,

            'idle_timeout': 0,        # timeout in seconds for worksheets
            'doc_timeout': 600,         # timeout in seconds for live docs
            'idle_check_interval':360,

            'save_interval':360,        # seconds

            'doc_pool_size':128,

            'pub_interact':False,

            'server_pool':[],

            'system':'sage',

            'pretty_print':False,

            'ulimit':'',

            'notification_recipients': None,

            'email':False,

            'accounts':False,

            'openid':False,

            'challenge':False,
            'challenge_type':'simple',
            'recaptcha_public_key':'',
            'recaptcha_private_key':'',
            'default_language': 'en_US',
            'model_version': 0,

            'auth_ldap':False,
            'ldap_uri':'ldap://example.net:389/',
            'ldap_basedn':'ou=users,dc=example,dc=net',
            'ldap_binddn':'cn=manager,dc=example,dc=net',
            'ldap_bindpw': 'secret',
            'ldap_gssapi': False,
            'ldap_username_attrib': 'cn',
            'ldap_timeout': 5,
            }

G_APPEARANCE = _('Appearance')
G_AUTH = _('Authentication')
G_SERVER = _('Server')
G_LDAP = _('LDAP')

defaults_descriptions = {

    'max_history_length': {
        DESC : _('Maximum history length'),
        GROUP : G_SERVER,
        TYPE : T_INTEGER,
        },

    'idle_timeout': {
        POS : 1,
        DESC : _('Idle timeout for normal worksheets (seconds)'),
        GROUP : G_SERVER,
        TYPE : T_INTEGER,
        },

    'doc_timeout': {
        POS : 3,
        DESC : _('Idle timeout for live documentation (seconds)'),
        GROUP : G_SERVER,
        TYPE : T_INTEGER,
        },

    'idle_check_interval': {
        DESC : _('Idle check interval (seconds)'),
        GROUP : G_SERVER,
        TYPE : T_INTEGER,
        },

    'save_interval': {
        DESC : _('Save interval (seconds)'),
        GROUP : G_SERVER,
        TYPE : T_INTEGER,
        },

    'doc_pool_size': {
        DESC : _('Doc worksheet pool size'),
        GROUP : G_SERVER,
        TYPE : T_INTEGER,
        },

    'pub_interact': {
        DESC : _('Enable published interacts (EXPERIMENTAL; USE AT YOUR OWN RISK)'),
        GROUP : G_SERVER,
        TYPE : T_BOOL,
        },

    'server_pool': {
        DESC : _('Worksheet process users (comma-separated list)'),
        GROUP : G_SERVER,
        TYPE : T_LIST,
        },

    'system': {
        DESC : _('Default system'),
        GROUP : G_SERVER,
        TYPE : T_STRING,
        },

    'ulimit': {
        DESC : _('Worksheet process limits'),
        GROUP : G_SERVER,
        TYPE : T_STRING,
        },

    'model_version': {
        DESC : _('Model Version'),
        GROUP : G_SERVER,
        TYPE : T_INFO,
        },

    'notification_recipients': {
        DESC : _('Send notification e-mails to (comma-separated list)'),
        GROUP : G_SERVER,
        TYPE : T_LIST,
        },

    'word_wrap_cols': {
        DESC : _('Number of word-wrap columns'),
        GROUP : G_APPEARANCE,
        TYPE : T_INTEGER,
        },

    'pretty_print': {
        DESC : _('Pretty print (typeset) output'),
        GROUP : G_APPEARANCE,
        TYPE : T_BOOL,
        },

    'default_language': {
        DESC : _('Default Language'),
        GROUP : G_APPEARANCE,
        TYPE : T_CHOICE,
        CHOICES : get_languages(),
        },


    'openid': {
        POS: 1,
        DESC : _('Allow OpenID authentication (requires python ssl module)'),
        GROUP : G_AUTH,
        TYPE : T_BOOL,
        },

    'accounts': {
        POS : 2,
        DESC : _('Enable user registration'),
        GROUP : G_AUTH,
        TYPE : T_BOOL,
        },

    'email': {
        POS : 3,
        DESC : _('Require e-mail for account registration'),
        GROUP : G_AUTH,
        TYPE : T_BOOL,
        },

    'challenge': {
        POS : 4,
        DESC : _('Use a challenge for account registration'),
        GROUP : G_AUTH,
        TYPE : T_BOOL,
        },

    'challenge_type': {
        POS : 4,
        DESC : _('Type of challenge'),
        GROUP : G_AUTH,
        TYPE : T_CHOICE,
        CHOICES : [N_('simple'), N_('recaptcha')],
        },

    'recaptcha_public_key': {
        DESC : _('reCAPTCHA public key'),
        GROUP : G_AUTH,
        TYPE : T_STRING,
        },

    'recaptcha_private_key': {
        DESC : _('reCAPTCHA private key'),
        GROUP : G_AUTH,
        TYPE : T_STRING,
        },


    'auth_ldap': {
        POS : 1,
        DESC : _('Enable LDAP Authentication'),
        GROUP : G_LDAP,
        TYPE : T_BOOL,
        },

    'ldap_uri': {
        POS : 2,
        DESC : _('LDAP URI'),
        GROUP : G_LDAP,
        TYPE : T_STRING,
        },

    'ldap_binddn': {
        POS : 3,
        DESC : _('Bind DN'),
        GROUP : G_LDAP,
        TYPE : T_STRING,
        },

    'ldap_bindpw': {
        POS : 4,
        DESC : _('Bind Password'),
        GROUP : G_LDAP,
        TYPE : T_STRING,
        },

    'ldap_gssapi': {
        POS : 5,
        DESC : _('Use GSSAPI instead of Bind DN/Password'),
        GROUP : G_LDAP,
        TYPE : T_BOOL,
        },

    'ldap_basedn': {
        POS : 6,
        DESC : _('Base DN'),
        GROUP : G_LDAP,
        TYPE : T_STRING,
        },

    'ldap_username_attrib': {
        POS : 7,
        DESC: _('Username Attribute (i.e. cn, uid or userPrincipalName)'),
        GROUP : G_LDAP,
        TYPE : T_STRING,
        },

    'ldap_timeout': {
        POS : 8,
        DESC: _('Query timeout (seconds)'),
        GROUP : G_LDAP,
        TYPE : T_INTEGER,
        },
}


def ServerConfiguration_from_basic(basic):
    c = ServerConfiguration()
    c.confs = copy.copy(basic)
    return c

class ServerConfiguration(conf.Configuration):
    def defaults(self):
        return defaults

    def defaults_descriptions(self):
        return defaults_descriptions