api

command module
Version: v0.0.0-...-36cd75f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2019 License: GPL-3.0 Imports: 44 Imported by: 0

README

API
===

Requirements
------------

RAM: 256 Mb (130 Mb is used by Argon)


Get started
-----------

.. code-block:: bash

   make all

Go to http://localhost:9090

Docker images
-------------

:code:`https://registry.gitlab.com/pashinin.com/api:master` - rebuilds on each commit

:code:`https://registry.gitlab.com/pashinin.com/api:stable` - rebuilds on tags and stable branch changes


DEV username/password to login
------------------------------

Username: :code:`admin@localhost`

Password: :code:`password`

Argon2 of "password": :code:`$argon2id$v=19$m=1024,t=3,p=1$MTIzNDU2YXNk$6zQXmU2m3HdqXF1iof7GP+vOS+ae5o/PVtxOi8aooJE`

Flags
-----

Use :code:`./api -help` to see options.


Environment variables
---------------------

Following environment variables must be set:

:code:`AUTH_SECRET` - used to sign JWT (on login). Empty by default. API
will not start if it is empty. Automatically set to "123" while in
development mode (in Makefile).

:code:`TARANTOOL_USER_NAME`

:code:`TARANTOOL_USER_PASSWORD`


Messages
--------

Each tree can send an receive messages (using NATS) which are then
passed through a websocket connection to the browser.

Messages path:

:code:`Endpoint -> NATS -> subscription (websocket.go) -> websocket`

Subscription to NATS channel (inside API) exists only within established
websocket connection.



Health checks
-------------

You can view Health checks under :code:`/healthcheck`. Code is written
in router.go.

code 200 - everything is ok

code 500 - not ok

What is checked:

#. captchaStorage (created and connected)
#. JDI health

..
   Metrics
   -------

   Prometheus metrics ix exported at :code:`/metrics`.

Documentation

Overview

Provides an API server for my site

Directories

Path Synopsis
Usage: var s tree.PGStorage s.Conn = PG tree.Storage = &s
Usage: var s tree.PGStorage s.Conn = PG tree.Storage = &s
Uploading avatar from file.
Uploading avatar from file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL