Update documentation, include readme in index

This commit is contained in:
Vladan Popovic 2020-09-07 13:31:19 +02:00
parent d4de6e0b2d
commit 5c42aaa023
6 changed files with 16 additions and 69 deletions

View File

@ -20,18 +20,8 @@ platform, using their `kafka <https://aiven.io/kafka>`_ and `postgresql
<https://aiven.io/postgresql>`_ services. <https://aiven.io/postgresql>`_ services.
Quickstart Quickstart with docker-compose
========== ==============================
Easiest way to start the application is to clone it, install it and run the
console scripts via the command line::
pip install .
chweb_collect -c config.yaml &
chweb_consume -c config.yaml &
Using docker-compose
--------------------
The services can be run with docker-compose. You'd need to change the values of The services can be run with docker-compose. You'd need to change the values of
``KAFKA_SERVERS``, ``POSTGRES_HOST`` and ``POSTGRES_PASS`` in order for ``KAFKA_SERVERS``, ``POSTGRES_HOST`` and ``POSTGRES_PASS`` in order for
@ -45,9 +35,15 @@ saving it to ``pgcert.pem``. After all this is done, simply run::
Config file Config file
=========== ===========
There's an example config file in the top-level dir of the repository, named
``config.yaml`` that you can use as a reference. Some explanation on the main
sections are listed below.
Sites Sites
----- -----
.. highlight:: yaml
You can specify the sites you want checked in the yaml config file. They are You can specify the sites you want checked in the yaml config file. They are
stored in the ``sites`` key and are represented as a list of objects with stored in the ``sites`` key and are represented as a list of objects with
``url`` and ``check_interval`` as mandatory fields, and regex as an optional ``url`` and ``check_interval`` as mandatory fields, and regex as an optional
@ -66,8 +62,6 @@ regex expression::
Logging configuration Logging configuration
--------------------- ---------------------
.. highlight:: yaml
The ``logging`` section must be present. A simple example of a console logger The ``logging`` section must be present. A simple example of a console logger
as seen in ``config.yaml``:: as seen in ``config.yaml``::
@ -132,51 +126,3 @@ set up you get a config section similar to this one::
* ``cafile``, ``cert`` and ``key`` are the ssl certificates you get when aivens * ``cafile``, ``cert`` and ``key`` are the ssl certificates you get when aivens
kafka service is ready. kafka service is ready.
* ``password`` is not needed afaik, but you can give it a go. * ``password`` is not needed afaik, but you can give it a go.
Full config file
================
while reading about the config values might be good, here's a better
all-in-one config file, which ofc you'd need to update with your own values::
kafka:
servers:
- "kafka-f7ae38e-vladanovic-4654.aivencloud.com:23702"
topic: "sitestats"
cafile: "./certs/ca.pem"
cert: "./certs/service.cert"
key: "./certs/service.key"
passwd: ""
postgres:
dbhost: "pg-2e0f365c-vladanovic-4654.aivencloud.com"
dbport: 23700
dbname: "defaultdb"
dbuser: "avnadmin"
dbpass: ""
dbcert: "./certs/pg.pem"
sites:
- url: "https://dsadakjhkjsahkjh.com"
regex: "domain"
check_interval: 5
- url: "https://example.com"
regex: "aaaaaaaaaaaaa"
check_interval: 8
- url: "https://example.com/404"
check_interval: 13
logging:
version: 1
formatters:
standard:
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
error:
format: "%(levelname)s <PID %(process)d:%(processName)s> %(name)s.%(funcName)s(): %(message)s"
handlers:
console:
class: logging.StreamHandler
level: DEBUG
formatter: standard
stream: ext://sys.stdout
root:
level: DEBUG
handlers: [console]
propogate: yes

BIN
docs/source/.index.rst.swp Normal file

Binary file not shown.

View File

@ -1,3 +1,4 @@
====================
Overall architecture Overall architecture
==================== ====================

View File

@ -1,3 +1,4 @@
====================
Running the services Running the services
==================== ====================
@ -20,6 +21,8 @@ Both of them need a configuration file to start, e.g.::
Configuration Configuration
------------- -------------
.. highlight:: yaml
Both cli scripts use the same config file to simplify deployment. You only set Both cli scripts use the same config file to simplify deployment. You only set
it up once and supply it to the scripts on their locations. it up once and supply it to the scripts on their locations.

View File

@ -1,3 +1,4 @@
==================
Environment config Environment config
================== ==================

View File

@ -3,18 +3,14 @@
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.
============================
chweb - Check websites state chweb - Check websites state
============================ ============================
CHWEB is a website checking tool. .. include:: ../../README.rst
ATM in its very early stages meant to demo
`aiven <https://aiven.io>`_'s platform, using their `kafka
<https://aiven.io/kafka>`_ and `postgresql <https://aiven.io/postgresql>`_
services.
Features Features
-------- ========
* Easy and intuitive YAML configuration. * Easy and intuitive YAML configuration.
* Command line executables for the checker and the consumer/psql writer: * Command line executables for the checker and the consumer/psql writer: