From 5c42aaa023cddd49c7df606b082a55e29fbb4aa8 Mon Sep 17 00:00:00 2001 From: Vladan Popovic Date: Mon, 7 Sep 2020 13:31:19 +0200 Subject: [PATCH] Update documentation, include readme in index --- README.rst | 70 ++++------------------------------ docs/source/.index.rst.swp | Bin 0 -> 12288 bytes docs/source/architecture.rst | 1 + docs/source/configuration.rst | 3 ++ docs/source/environment.rst | 1 + docs/source/index.rst | 10 ++--- 6 files changed, 16 insertions(+), 69 deletions(-) create mode 100644 docs/source/.index.rst.swp diff --git a/README.rst b/README.rst index 80b0673..56fd823 100644 --- a/README.rst +++ b/README.rst @@ -20,18 +20,8 @@ platform, using their `kafka `_ and `postgresql `_ services. -Quickstart -========== - -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 --------------------- +Quickstart with docker-compose +============================== 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 @@ -45,9 +35,15 @@ saving it to ``pgcert.pem``. After all this is done, simply run:: 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 ----- +.. highlight:: yaml + 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 ``url`` and ``check_interval`` as mandatory fields, and regex as an optional @@ -66,8 +62,6 @@ regex expression:: Logging configuration --------------------- -.. highlight:: yaml - The ``logging`` section must be present. A simple example of a console logger 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 kafka service is ready. * ``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 %(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 diff --git a/docs/source/.index.rst.swp b/docs/source/.index.rst.swp new file mode 100644 index 0000000000000000000000000000000000000000..cdc6ccb1683b4d5e4719d05e97e330b2bb6e3d55 GIT binary patch literal 12288 zcmeI2KX21O6u_^nP(WotVtJGWs>Dgdzt&QRsD6iezSY3m;peblv72^H% zjjfd_CtlwW0<%ooWUo9kc3{$bIM=%OAZh!t*F7HwY)HL_X7FCmwa2>ZqS`^%h^@*S zxh5cjhy3MHoykh02^QfY=8~0 z0XDz}{&xdDn-DLk$P2?lr-$2#Guz>mH*A0numLu}2G{@_U;}J`4X^<=zy{dBKWIS4 zLL6KYqCQE<)Bpd+zyFV}2ysZP6L*N)#6{xQWg(7;uf#{<1M!YHB;F7OQ6naZpA_>4 z@tycad?7v)pNO}_E8>87Nfbnzki-*WfhcpT5j@xc8(;%$fDNz#Hoykh02^Qff8D?g zgbq7ll%sU28;Rq2YU8R~`Si#(n&A<#aBhfI6KjPzNE3sX?F4fn06=ECY=EwIDLyqu zD_=M)=VX@sW9GXd%!(iYZM@?R&7)1faS+Z$bCY@-5fIU>jAbsdq2fm9iY~&tPR?cm; z+BLF#H-UXeHMy`%Nap?OB5i!3J@tdb=HlApv&o&v6Duf77bJ>`(?%slOvOPEH0ZUy zy!dEsdC)6<&i2RwQ56bxSStI?fr>7>&vVGV^muZwkp(Bam18Q#OKqw`owXjKq2&l- z?MNM!Q3{1kTY!=VWGpjJm+KrlIw@_WS%MyuK0P1kQ=dDT+|g#c2JOOw_Kb5_KM|ffc9WDP{ooV0J#dKNmLVq19|PgHq3+O8O|#bEAyQ V&j_Rx4PBK+4U{9B7(=@+eghP~BUk_c literal 0 HcmV?d00001 diff --git a/docs/source/architecture.rst b/docs/source/architecture.rst index 53aa268..3b3c0f6 100644 --- a/docs/source/architecture.rst +++ b/docs/source/architecture.rst @@ -1,3 +1,4 @@ +==================== Overall architecture ==================== diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index e7a6db1..74e4993 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -1,3 +1,4 @@ +==================== Running the services ==================== @@ -20,6 +21,8 @@ Both of them need a configuration file to start, e.g.:: Configuration ------------- +.. highlight:: yaml + 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. diff --git a/docs/source/environment.rst b/docs/source/environment.rst index e8a5df2..224ab7c 100644 --- a/docs/source/environment.rst +++ b/docs/source/environment.rst @@ -1,3 +1,4 @@ +================== Environment config ================== diff --git a/docs/source/index.rst b/docs/source/index.rst index ce0fe2b..953753d 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,18 +3,14 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. +============================ chweb - Check websites state ============================ -CHWEB is a website checking tool. - -ATM in its very early stages meant to demo -`aiven `_'s platform, using their `kafka -`_ and `postgresql `_ -services. +.. include:: ../../README.rst Features --------- +======== * Easy and intuitive YAML configuration. * Command line executables for the checker and the consumer/psql writer: