-
Notifications
You must be signed in to change notification settings - Fork 256
/
conf.py
462 lines (396 loc) · 14.2 KB
/
conf.py
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
#!/usr/bin/env python3
# BAREOS - Backup Archiving REcovery Open Sourced
#
# Copyright (C) 2018-2022 Bareos GmbH & Co. KG
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of version three of the GNU Affero General Public
# License as published by the Free Software Foundation and included
# in the file LICENSE.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# -*- coding: utf-8 -*-
#
# Bareos Main Reference documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 21 16:41:30 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath("../../../python-bareos/"))
sys.path.insert(0, os.path.abspath("./_extensions"))
import datetime
# -- General configuration ------------------------------------------------
# Substitutions have been CamelCase in the past.
# Now they are all lowercase.
# CamelCase version can be removed,
# when they are no longer required.
# about <isonum.txt>, see
# http://docutils.sourceforge.net/docs/ref/rst/definitions.html#substitution-definitions
# http://docutils.sourceforge.net/docutils/parsers/rst/include/isonum.txt
rst_epilog = """
.. include:: <isonum.txt>
.. |checkmark| unicode:: U+2713
.. |configCharsToQuote| replace:: ``&<>()@^|``
.. |bareosFd| replace:: Bareos File Daemon
.. |fd| replace:: Bareos File Daemon
.. |bareosSd| replace:: Bareos Storage Daemon
.. |sd| replace:: Bareos Storage Daemon
.. |bareosDir| replace:: Bareos Director
.. |dir| replace:: Bareos Director
.. |bconsole| replace:: Bareos Console
.. |bareosTraymonitor| replace:: Bareos Traymonitor
.. |traymonitor| replace:: Bareos Traymonitor
.. |bareosWebui| replace:: Bareos Webui
.. |webui| replace:: Bareos WebUI
.. |mariadb| replace:: MariaDB
.. |mysql| replace:: MySQL
.. |postgresql| replace:: PostgreSQL
.. |vmware| replace:: VMware
.. |vsphere| replace:: VMware vSphere
.. |ndmpbareos| replace:: :ref:`section-NdmpBareos`
.. |ndmpnative| replace:: :ref:`section-NdmpNative`
"""
# If your documentation needs a minimal Sphinx version, state it here.
#
# autosummary :recursive: requires Sphinx >= 3.1.
# For now, we use a workaround to use autosummary without :recursive:.
# needs_sphinx = '3.1'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"bareos-ext",
"limitation",
"sphinx_issues",
"sphinx.ext.autodoc", # Core Sphinx library for auto html doc generation from docstrings
"sphinx.ext.autosummary", # Create neat summary tables for modules/classes/methods etc
"sphinx.ext.coverage",
"sphinx.ext.intersphinx", # Link to other project's documentation (see mapping below)
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.viewcode", # Add a link to the Python source code for classes, functions etc.
"sphinxcontrib.actdiag",
"sphinxcontrib.blockdiag",
"sphinxcontrib.nwdiag",
"sphinxcontrib.plantuml",
"sphinxcontrib.seqdiag",
"crate.sphinx.csv",
"m2r2",
"sphinx_copybutton",
]
# 'limitation',
# extensions.append('limitation')
#
# sphinx_issues
#
issues_github_path = "bareos/bareos"
# issues_uri = 'https://bugs.bareos.org/view.php?id={issue}'
# issues_pr_uri = 'https://github.com/bareos/bareos/pull/{pr}'
#
# sphinx.ext.autodoc
#
# python:
# Both the class and the __init__ method’s docstring are concatenated and inserted.
autoclass_content = "both"
#
# sphinx.ext.autosectionlabel
#
# True to prefix each section label with the name of the document it is in, followed by a colon.
# For example, index:Introduction for a section called Introduction that appears in document index.rst.
# Useful for avoiding ambiguity when the same section heading appears in different documents.
autosectionlabel_prefix_document = True
#
# sphinx.ext.autosummary
#
autosummary_generate = True # Turn on sphinx.ext.autosummary
# autosummary_imported_members = True
# autosummary_generate_overwrite = True
#
# sphinx.ext.intersphinx
#
# Mappings for sphinx.ext.intersphinx. Projects have to have Sphinx-generated doc! (.inv file)
intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
}
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ".rst"
# The master toctree document.
master_doc = "index"
# General information about the project.
project = "Bareos Documentation"
copyright = str(datetime.datetime.now().year) + " Bareos GmbH & Co. KG and others."
author = "Bareos GmbH & Co. KG"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = "en"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
#
# sphinx.ext.todo
#
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# html_theme_options = {
# 'canonical_url': '',
# 'analytics_id': '',
# 'logo_only': False,
# 'display_version': True,
# 'prev_next_buttons_location': 'bottom',
# 'style_external_links': False,
# 'vcs_pageview_mode': '',
# # Toc options
# 'collapse_navigation': False,
# 'sticky_navigation': True,
# 'navigation_depth': 4,
# 'includehidden': True,
# 'titles_only': False
# }
# Enable link of 'View page source'
# html_show_sourcelink = False
# Add 'Edit on Github' link instead of 'View page source'
# reference:https://docs.readthedocs.io/en/latest/vcs.html
html_context = {
# Enable the "Edit in GitHub link within the header of each page.
"display_github": True,
# Set the following variables to generate the resulting github URL for each page.
# Format Template: https://{{ github_host|default("github.com") }}/{{ github_user }}
# /{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}
# https://github.com/runawayhorse001/SphinxGithub/blob/master/doc/index.rst
"github_user": "bareos",
"github_repo": "bareos",
"conf_py_path": "/docs/manuals/source/",
"READTHEDOCS": True,
"commit": datetime.date.today().strftime("%B %d, %Y"),
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
"**": [
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
]
}
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = "BareosDocumentation"
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc,
"BareosMainReference.tex",
"Bareos Main Reference Documentation",
"Bareos GmbH & Co. KG",
"manual",
)
]
# -- Options for the linkcheck builder ------------------------------------
linkcheck_allowed_redirects = {
# All HTTP redirections from the source URI to the canonical URI will be treated as "working".
r"https://bareos\.org/.*": r"https://bareos\.com/.*",
r"http://www\.bareos\.org": r"https://www\.bareos\.com/.*",
r"http://www\.bareos\.org/.*": r"https://www\.bareos\.com/.*",
r"https://www\.bareos\.org/.*": r"https://www\.bareos\.com/.*",
r"https://www\.bareos\.com/whitepapers/.*": r"https://www\.bareos\.com/.*",
r"https://bugs\.bareos\.org/.*": r"https://bugs\.bareos\.org/my_view_page\.php",
r"https://download\.bareos\.org": r"https://download\.bareos\.org/bareos",
r"https://download\.bareos\.com": r"https://download\.bareos\.com/bareos",
r"https://github.com/markh794/mhvtl.git": r"https://github.com/markh794/mhvtl",
}
linkcheck_request_headers = {
# "https://www.sphinx-doc.org/": {
# "Accept": "text/html",
# "Accept-Encoding": "utf-8",
# },
"*": {
"Accept": "text/html,application/xhtml+xml",
}
}
linkcheck_retries = 2 # default 1
linkcheck_timeout = 10 # default 300
linkcheck_workers = 2 # default 5
linkcheck_anchors = True
linkcheck_ignore = [
r"\.\./*",
r"http://localhost:*/",
r"https://\w+:\d+/bareos-webui/",
"https://UCS_SERVER/bareos-webui/",
"http://HOSTNAME/bareos-webui",
"http://localhost:9100",
"http://bareos:9100",
"http://bucket.s3_server/object",
"http://127.0.0.1:8000/docs",
"http://127.0.0.1:8000/redoc",
"https://pubs.vmware.com/vsphere-55/topic/com.vmware.vsphere.security.doc/*",
r"https://github\.com/bareos/bareos/pull/\d+",
"https://www.glusterfs.org", # failing too often
"https://www.sphinx-doc.org/en/1.7/intro.html#",
]
# linkcheck_auth = [
# ('https://foo\.yourcompany\.com/.+', ('johndoe', 'secret')),
# ('https://.+\.yourcompany\.com/.+', HTTPDigestAuth(...)),
# ]
linkcheck_rate_limit_timeout = 300.00
# ignore all links in documents located in a subfolder named 'legacy'
# linkcheck_exclude_documents = [r'.*/legacy/.*']
# -- Options for manual page output ---------------------------------------
man_bareos_dbcopy = "man/bareos-dbcopy"
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(
man_bareos_dbcopy,
"bareos-dbcopy",
"Copy the Bareos catalog database between catalog backends",
[author],
8,
)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc,
"BareosDocumentation",
"Bareos Documentation",
author,
"BareosDocumenation",
"One line description of project.",
"Miscellaneous",
)
]
import re
# settings for sphinxcontrib-versioning
scv_whitelist_branches = (
re.compile(r"^master$"),
re.compile(r"^bareos-19.2$"),
re.compile(r"^bareos-2.$"),
)
scv_whitelist_tags = (re.compile(r"^not-exisiting-tag$"),)
scv_show_banner = True
scv_priority = "branches"
scv_root_ref = "bareos-22"
scv_banner_main_ref = "bareos-22"
plantuml_output_format = "svg_img"
#
# code-block highlighting
#
from sphinx.highlighting import lexers
from bareos_lexers import *
lexers["bareosconfig"] = BareosConfigLexer()
lexers["bconsole"] = BareosConsoleLexer()
lexers["bareoslog"] = BareosLogLexer()
lexers["bareosmessage"] = BareosMessageLexer()
lexers["sh"] = BareosShellLexer()
lexers["shell-session"] = BareosShellSessionLexer()
# generate rst.inc files from json files
import subprocess
import os
os.chdir("..")
subprocess.call(["pwd"])
subprocess.check_call(
[
"scripts/generate-resource-descriptions.py",
"--sphinx",
"source/include/autogenerated/bareos-dir-config-schema.json",
]
)
subprocess.check_call(
[
"scripts/generate-resource-descriptions.py",
"--sphinx",
"source/include/autogenerated/bareos-sd-config-schema.json",
]
)
subprocess.check_call(
[
"scripts/generate-resource-descriptions.py",
"--sphinx",
"source/include/autogenerated/bareos-fd-config-schema.json",
]
)
subprocess.check_call(
[
"scripts/generate-resource-descriptions.py",
"--sphinx",
"source/include/autogenerated/bconsole-config-schema.json",
]
)
subprocess.check_call(
[
"scripts/generate-resource-descriptions.py",
"--sphinx",
"source/include/autogenerated/bareos-tray-monitor-config-schema.json",
]
)
subprocess.check_call(
"scripts/generate-bareos-package-info.py --out source/include/autogenerated/ source/data/bareos-*-packages.json",
shell=True,
)