Skip to content

Commit

Permalink
added docs with sphinx
Browse files Browse the repository at this point in the history
  • Loading branch information
Cielquan committed Jan 25, 2020
1 parent 64a9b7e commit 574469f
Show file tree
Hide file tree
Showing 12 changed files with 531 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
93 changes: 93 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
.. This file 'index.rst' created 2020-01-25 is part of the project/program 'DoTH-DNS'.
.. Copyright (c) 2019-2020 Christian Riedel, see LICENSE for more details
.. highlight:: console

.. _api:

API
===

The ``start_doth_dns.bash`` script has the following options and flag you can set when calling.

You can also call the script with the ``-h`` flag for the help page::

$ ./start_doth_dns.bash -h

Options
-------

* ``-f``:

If set then old configuration settings saved in ``.env`` file will not be loaded
and a new ``root.hints`` file will be downloaded.

* ``-F``:

Set to let the script fallback to next source for configuration variables.
Order: `flag -> environment -> .env file -> self gather`

* ``-a``:

Set Architecture of the processor ('arm' or 'x86') used by the server. Needed for
determining the right docker images. If not set script will determine it.

* ``-c``:

Set to force ``goofball222/dns-over-https`` docker image to be compiled. If not set
then the ``ARCHITECTURE`` determines if the image will be compiled
('arm' -> yes; 'x86' -> no). Will only be compiled if non existing.

* ``-I``:

Set the network interface used from the server. Needed for determining the right
IP address. If not set script will determine it.

* ``-i``:

Set the IP address used by the server. If not set script will determine it with
determined oder given ``INTERFACE`` (via e.g. ``-I`` option).

* ``-n``:

Set hostname of the host machine. If not set script will determine it.

* ``-t``:

Set timezone the server is in. Used for e.g. daily resets. Format is like 'Europe/London'.
If not set script will determine it.

* ``-d``:

Set domain the server is reachable under. If not set created by script: '``HOST_NAME``.dns'.

* ``-N``:

Set to deactivate ``traefik`` dashboard authorization when ``.htpasswd`` file is given.

* ``-h``:

Show help page and exit.


Flags
-----

* ``-R``:

Set to recreate all containers. Containers will load new config files if given.

* ``-U``:

Set to recreate and update all containers.

* ``-P``:

Set to start without reverse proxy ``traefik``.

* ``-D``:

Set to shut DoTH-DNS down. It will remove all DoTH-DNS containers and networks.


.. highlight:: default
52 changes: 52 additions & 0 deletions docs/source/badges.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. This file 'badges.rst' created 2020-01-24 is part of the project/program 'DoTH-DNS'.
.. Copyright (c) 2019-2020 Christian Riedel, see LICENSE for more details
| |license| |black|
|
| |docs|
|
| |release| |commits_since| |last_commit|
| |stars| |forks| |contributors|
|

.. info block
.. |license| image:: https://img.shields.io/github/license/Cielquan/DoTH-DNS.svg?style=for-the-badge
:alt: License
:target: https://github.com/Cielquan/DoTH-DNS/blob/master/LICENSE.rst

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge
:alt: Code Style: Black
:target: https://github.com/psf/black


.. tests block
.. |docs| image:: https://img.shields.io/readthedocs/doth-dns/latest.svg?style=for-the-badge&logo=read-the-docs&logoColor=white
:alt: Read the Docs (latest) - Status
:target: https://doth-dns.readthedocs.io/en/latest/?badge=latest


.. Github block
.. |release| image:: https://img.shields.io/github/v/release/Cielquan/DoTH-DNS.svg?style=for-the-badge&logo=github
:alt: Github Latest Release
:target: https://github.com/Cielquan/DoTH-DNS/releases/latest

.. |commits_since| image:: https://img.shields.io/github/commits-since/Cielquan/DoTH-DNS/latest.svg?style=for-the-badge&logo=github
:alt: GitHub commits since latest release
:target: https://github.com/Cielquan/DoTH-DNS/commits/master

.. |last_commit| image:: https://img.shields.io/github/last-commit/Cielquan/DoTH-DNS.svg?style=for-the-badge&logo=github
:alt: GitHub last commit
:target: https://github.com/Cielquan/DoTH-DNS/commits/master

.. |stars| image:: https://img.shields.io/github/stars/Cielquan/DoTH-DNS.svg?style=for-the-badge&logo=github
:alt: Github stars
:target: https://github.com/Cielquan/DoTH-DNS/stargazers

.. |forks| image:: https://img.shields.io/github/forks/Cielquan/DoTH-DNS.svg?style=for-the-badge&logo=github
:alt: Github forks
:target: https://github.com/Cielquan/DoTH-DNS/network/members

.. |contributors| image:: https://img.shields.io/github/contributors/Cielquan/DoTH-DNS.svg?style=for-the-badge&logo=github
:alt: Github Contributors
:target: https://github.com/Cielquan/DoTH-DNS/graphs/contributors
4 changes: 4 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. This file 'changelog.rst' created 2020-01-24 is part of the project/program 'DoTH-DNS'.
.. Copyright (c) 2019-2020 Christian Riedel, see LICENSE for more details
.. include:: ../../CHANGELOG.rst
98 changes: 98 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# -*- coding: utf-8 -*-

# ======================================================================================
# Copyright (c) 2019-2020 Christian Riedel
#
# This file 'conf.py' created 2020-01-24 is part of the project/program 'DoTH-DNS'.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the MIT License as published by
# the Massachusetts Institute of Technology.
#
# 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
# MIT License for more details.
#
# You should have received a copy of the MIT License
# along with this program. If not, see <https://opensource.org/licenses/MIT>.
#
# Github: https://github.com/Cielquan/
# ======================================================================================
"""
docs.source.conf
~~~~~~~~~~~~~~~~
Configuration file for the Sphinx documentation builder.
:copyright: 2019-2020 (c) Christian Riedel
:license: MIT, see LICENSE.rst for more details
"""
import os
import sys

from pathlib import Path


# Paths
sys.path.insert(0, os.path.abspath("../.."))
conf_dir = Path(__file__)


# -- PROJECT INFORMATION ---------------------------------------------------------------

project = "DoTH-DNS"
author = "Christian Riedel"
copyright = "2019-2020, Christian Riedel" #: CHANGEME
# The full version, including alpha/beta/rc tags
release = "5.4.0" #: CHANGEME
# Major version like (X.Y)
version = "5.4" #: CHANGEME
# Release date
release_date = "2020" #: CHANGEME


# -- SPHINX CONFIG ---------------------------------------------------------------------

# Add any Sphinx extension module names here, as strings.
extensions = []

# intersphinx_mapping = {}


# -- FILES -----------------------------------------------------------------------------

# Index source file
master_doc = "index"

# Files to exclude for source of doc
exclude_patterns = []

# Folder for static files, if folder exists
html_static_path = []
if Path(conf_dir, "_static").exists():
html_static_path = ["_static"]

# Folder for template files, if folder exists
templates_path = []
if Path(conf_dir, "_templates").exists():
templates_path = ["_templates"]


# -- HTML OUTPUT -----------------------------------------------------------------------

# Add links to *.rst source files on HTML pages
html_show_sourcelink = True

# Pygments syntax highlighting style
pygments_style = "sphinx"

# Use RTD Theme if installed
try:
import sphinx_rtd_theme
except ImportError:
html_theme = "alabaster"
else:
extensions.append("sphinx_rtd_theme")
html_theme = "sphinx_rtd_theme"

# rst_epilog = """""".format()
22 changes: 22 additions & 0 deletions docs/source/external_help.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. This file 'external_help.rst' created 2020-01-25 is part of the project/program 'DoTH-DNS'.
.. Copyright (c) 2019-2020 Christian Riedel, see LICENSE for more details
.. _get_help:

Get Help
========

Here are some external links for further help:

* Pi-hole `documentation <https://docs.pi-hole.net/>`__
* Pi-hole image `documentation <https://github.com/pi-hole/docker-pi-hole/blob/master/README.md>`__
* Unbound `documentation <https://www.nlnetlabs.nl/documentation/unbound/>`__
* Unbound image `documentation <https://github.com/MatthewVance/unbound-docker-rpi/blob/master/README.md>`__
* traefik `documentation <https://docs.traefik.io/v2.0/>`__
* dns-over-https `documentation <https://github.com/m13253/dns-over-https/blob/master/Readme.md>`__
* dns-over-https image `documentation <https://github.com/goofball222/dns-over-https/blob/master/README.md>`__
* Docker `documentation <https://docs.docker.com/>`__
* Docker-compose `documentation <https://docs.docker.com/compose/>`__
* Similar project - `link <https://github.com/chriscrowe/docker-pihole-unbound>`__
* Pi-hole blog post about slow loading sides and blocking QUIC protocol - `link <https://pi-hole.net/2018/02/02/why-some-pages-load-slow-when-using-pi-hole-and-how-to-fix-it/>`__
* Pi-hole guide about pi-hole+unbound - `link <https://docs.pi-hole.net/guides/unbound/>`__
Loading

0 comments on commit 574469f

Please sign in to comment.