An open API service indexing awesome lists of open source software.

https://github.com/edosrecki/oopsiee-server

An HTTP API service that simplifies daily operations and on-call duty by letting you run repeated and cumbersome tasks in no time!
https://github.com/edosrecki/oopsiee-server

cli devops on-call operations

Last synced: 3 months ago
JSON representation

An HTTP API service that simplifies daily operations and on-call duty by letting you run repeated and cumbersome tasks in no time!

Awesome Lists containing this project

README

        

:toc: macro
:toc-title:
:toclevels: 10

= oopsiee-server

image:https://img.shields.io/github/package-json/v/edosrecki/oopsiee-server/release?color=blue&label=oopsiee-server["oOPSiee Server Version", link="https://oopsiee.herokuapp.com"]
image:https://img.shields.io/github/workflow/status/edosrecki/oopsiee-server/Continuous Integration["Build Status", link="https://github.com/edosrecki/oopsiee-server/actions"]
image:https://img.shields.io/codecov/c/github/edosrecki/oopsiee-server["Code Coverage", link="https://codecov.io/gh/edosrecki/oopsiee-server"]
image:https://img.shields.io/david/edosrecki/oopsiee-server["Dependencies Status"]

An HTTP API service that simplifies **daily operations** and **on-call** duty by letting you run repeated and cumbersome
tasks in no time!

Can be accessed with link:https://github.com/edosrecki/oopsiee-cli[**oOPSiee CLI**] tool, Postman, Paw, httpie, or any
other client of your choosing which speaks HTTP.

* Supports **synchronous** commands
* Supports **asynchronous** jobs
* Easily **extensible**
* One command **startup**
* Ready for **Docker**
* Uses **private/public key** authentication
* Written in **TypeScript**
* 100% **test** coverage
* Has proper **dependency injection**
* Semi-automatic **dependency updates** with Dependabot
* Contains **examples**

---

toc::[]

== Procedures
Each oOPSiee CLI command must have a corresponding procedure in
`oopsiee-server`. CLI command is mapped to a procedure via config
file. oOPSiee CLI tool simply reads the config file to know which
procedure to call. Procedures are called through HTTP API.

=== Adding a new procedure
See example:

* Procedure implementation: link:src/procedures/example[`src/procedures/example`]
* Command definition: link:src/commands/commands.yml[`src/commands/commands.yml`]

== Authentication
oOPSiee CLI uses your private key to sign a JWT token containing your username,
and sends it over to oopsiee-server in the `Authorization` header. To use the CLI
add your public key to the server.

=== Adding your public key
Add your public key in `PEM` format to link:keys/[`keys/`] directory.
File name must only contain your username without any file extensions.

**Hint**: To convert your RSA public key to `PEM` format, run:
`ssh-keygen -f id_rsa.pub -m 'PEM' -e > `

== Run
=== Development mode
==== Docker
```shell
make up
make down
make restart
```

**Note**: Containers will reload automatically on code changes. However, if changes
were made to `package.json`, it is necessary to run `make restart`.

==== Manual
```shell
nvm use
npm install

# Start Redis manually
npm run start:job-processor:dev
npm run start:web:dev
```

=== Production mode
==== Docker
```shell
make prod-up
make prod-down
make prod-restart
```

==== Manual
```shell
nvm use
npm install
npm run clean
npm run build

# Start Redis manually
npm run start:job-processor:prod
npm run start:web:prod
```

== Test
```shell
npm test
npm run test:watch
```

== Deploy
To deploy a new version of `oopsiee-server`, merge `master` branch into `release` branch.
New version will automatically get released by CI system.