aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 1bfb139c702cc5e9aee95767f824e95e3fab7d91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Levitating

_A continuous integration system built in Fortran_

## About

Levitating is an overly simple continuous integration system designed entirely in Fortran to, basically, replace Python's buildbot package (circa version 0.8).  The system is comprised of a _captain_, which acts as the control server, and a collection of _players_, each of which can be assigned _jobs_ to perform.  Build results are generally captured and returned to the _captain_ after a task is complete.

The system is drastically simpler than the system it aims to replace.  The _captain_ has no knowledge of the details of jobs themselves.  The _players_ will report results from each _task_ in a _job_ back to the _captain_.  The _captain_ does store these results and display them when requested, but the tasks are only referred to numerically.

## Requirements

To build Levitating, you'll need:

* GNU Fortran or another compiler that supports a handful of extensions used
* libssl
* json-fortran (version 7 series, untested with 8)

## Instructions

_Instructions_ are the list of _tasks_ that a _player_ needs to perform to complete a _job_.  The instructions are entirely written in JSON, which the _players_ then interpret.  Currently, 5 types of actions are supported:

 * __shell__ - Execute a shell command on the host operating system's default shell
 * __git__ - Either clone or pull, whichever is appropriate, from a git repo
 * __download__ - Download a particular file from the _captain_
 * __upload__ - Upload a file or files (globbing supported) to the _captain_
 * __delete_tree__ - Delete a directory tree
 
The above steps encompass what I needed to replace in buildbot personally.  If someone has a suggestion, write in!

It should be noted that _players_ have absolutely no restrictions on functions like __download__ or __delete_tree__, and they will happily try to download system files or delete a root directory.
 
## Protocol

The _player_ processes will communicate with the _captain_ via the [Gemini protocol](https://gemini.circumlunar.space/), a quasi-standard that is meant as a simpler alternative to HTTP.  The _players_ will upload files to the server via the [Titan protocol](https://communitywiki.org/wiki/Titan), a system for uploading files meant to pair with the Gemini protocol.

Users can access the portal for starting _jobs_, adding _players_, or viewing results is also via the Gemini protocol.  You'll need to keep port 1965 open for the _captain_, which must be run via xinetd or inetd.

Levitating can also be accessed through a CGI gateway (that's not a typo) via a compatible HTTP server.  Apache and Lighttpd both have (optional) support for CGI.   The default theme is quite acceptable.

## Security

The current configuration has literally no security features.  Anyone who can connect to the _captain's_ interface can start jobs, download releases (the products of what the _players_ build, ostensibly), or manage _players_.  Additionally, _players_ are also not authenticated, so any process claiming to be an approved _player_ can just proceed with downloading/uploading files.

The plan is to change this complete lack of authentication at some point.  It's probably not a great idea to leave an instance of Levitating up in a public-facing manner.

## License

Levitating is subject to the following license:

Copyright (c) 2021 Approximatrix, LLC <support@approximatrix.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The Software shall be used for Good, not Evil.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.