{"id":27396878,"url":"https://github.com/kristapsdz/minci","last_synced_at":"2025-10-08T08:33:40.163Z","repository":{"id":86151404,"uuid":"245178780","full_name":"kristapsdz/minci","owner":"kristapsdz","description":"Minimal CI for BSD.lv","archived":false,"fork":false,"pushed_at":"2020-05-28T16:42:17.000Z","size":54,"stargazers_count":26,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-27T21:19:20.382Z","etag":null,"topics":["bchs","ci"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kristapsdz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-03-05T14:04:52.000Z","updated_at":"2024-05-14T06:30:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"e32378ef-5b1c-49d6-9aa2-a1c23a96d92b","html_url":"https://github.com/kristapsdz/minci","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristapsdz%2Fminci","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristapsdz%2Fminci/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristapsdz%2Fminci/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kristapsdz%2Fminci/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kristapsdz","download_url":"https://codeload.github.com/kristapsdz/minci/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804770,"owners_count":21164131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bchs","ci"],"created_at":"2025-04-14T00:48:34.708Z","updated_at":"2025-10-08T08:33:35.140Z","avatar_url":"https://github.com/kristapsdz.png","language":"C","funding_links":[],"categories":["List of Continuous Integration services"],"sub_categories":["Introduction"],"readme":"# Introduction\n\nThis is a minimal CI (\"continuous integration\") system used by BSD.lv\nprojects.\nIt uses a shell script as the test runner and a\n[BCHS](https://learnbchs.org) back-end server for recording and\ndisplaying results.\nThe server is assumed to run on a [OpenBSD](https://www.openbsd.org)\nsystem, although it's trivially portable.\n\nThe CI test runner performs the following:\n\n1. clone or freshen a project's git repository\n2. configure the software (all use\n   [oconfigure](https://github.com/kristapsdz/oconfigure))\n3. build\n4. run tests\n5. fake install\n6. distribution check (runs build, tests, install on distributed\n   archive)\n\nThe results of this sequence (failure is implied if the last step isn't\nreached) are sent to the CI report server.\nCI reports may also be viewed on the server over a web interface.\n\nTested projects are simply identified by name.  There is currently no\nway to verify that project results are actually from a project.\n\nCI testers are identified by authentication tokens.  (These are\ninternally associated with an e-mail.)  These tokens are used to sign\nsubmitted reports.\n\n# Repositories\n\nRepositories are identified only by name.  The test runner uses the name\ncomponent of the repository URL as its reported repository.  So with a\nrepository of `https://github.com/you/yourproj.git`, the name is\n`yourproj`.\n\nAdd repositories to the database as follows:\n\n```sh\nname=\"foobar\" ; \\\necho \"INSERT INTO project (name) VALUES (\\\"$name\\\")\" | \\\n\tsqlite3 path/to/minci.db\n```\n\nThe unique name must be less than 32 bytes.  Adjust the database\nfilename as appropriate.\n\nThe repository so identified must conform to the following:\n\n1. Accessible by git, with the name being the URL filename.\n2. `./configure PREFIX=install_prefix`\n3. make\n4. make regress\n5. make install\n6. make distcheck\n\nThe `make` must be BSD make.\n\n# CI testers\n\nTo generate a CI tester, add a row to the `user` table of the database.\nSet the e-mail to anything you'd like.\n\nThe API key and secret are used to authenticate messages and should be\nrandom.  Assuming your operating system has a good random number\ngenerator, you can use:\n\n```sh\nemail=\"foo@bar.com\" ; \\\napikey=\"$RANDOM\" ; \\\napisecret=\"`jot -r -c 32 'A' '{' | sed 's!\\\\$!-!g' | rs -g0`\" ; \\\nctime=\"`date +%s`\" ; \\\necho \"INSERT INTO user (email,apikey,apisecret,ctime) \\\n\tVALUES (\\\"$email\\\",\\\"$apikey\\\",\\\"$apisecret\\\",\\\"$date\\\")\" | \\\n\tsqlite3 path/to/minci.db\n```\n\n(The `sed` makes sure that the final character isn't an escape.)\n\nSet `foo@bar.com` to be the user's email address and adjust the database\nfilename.\n\n# Test Runner\n\nThe test runner is just a shell script.\nIf you'd like to participate in a **minci** CI community, the shell\nscript, server URL, and credentials are all you need.\n\n**The test runner should be run as an ordinary user**.  Do not run it\nwith super user privileges.  Ideally it should have its own user, as a\nrepository might accidentally try to overwrite files it shouldn't.\n\nFirst, download or otherwise acquire the test runner,\n[minci.sh](minci.sh).  It should probably be in your *bin* directory\nwith execute permission.\n\nNext, create *~/.minci*.  (If this isn't found, */etc/minci* is used.)\nYou can start with the [minci.example](minci.example) example.\n\n```\napikey = 12345\napisecret = abcdefghijklmnopqrstuvwxyz123456\n#bsdmake = bmake\nserver = https://yourdomain/cgi-bin/minci.cgi\nrepo = https://github.com/somename/yourrepo1.git\nrepo = https://github.com/somename/yourrepo2.git\n```\n\nThere can be arbitrary space around the equal signs.  `bsdmake` is\nuseful for Linux machines, since repositories are assumed to use BSD\nmake and not GNU make, which is the default `make` on some machines.\n\nIn this example, there are two repositories, `yourrepo1` and\n`yourrepo2`, which must be represented in the database.\n\nIdeally, the runner should be executed daily by `cron`:\n\n```\n@daily $HOME/bin/minci \u003e/dev/null 2\u003e\u00261\n```\n\nThe `PATH` variable may need to be set to include */usr/local/bin* or as\nrequired by the operating system.\n\nAlternatively, the script may be run manually for instant gratification.\n\n# Security\n\nFirst, the server only runs on OpenBSD and makes significant use of pledging,\nunveiling, and separation using\n[openradtool](https://kristaps.bsd.lv/openradtool)'s underlying\n[kcgi](https://kristaps.bsd.lv/kcgi) and\n[sqlbox](https://kristaps.bsd.lv/sqlbox) features.\n\nMessages between the runner and server are authenticated by hashing the entire\nmessage (in a well-defined order) with the user's secret API key.  The server,\nwhich also has the secret key, hashes the message contents as well and compares\nthe signature.  If the signature matches, the report is authentic.\n\nTo further prevent tampering, **minci** uses the role-based access\ncontrol of [openradtool](https://kristaps.bsd.lv/openradtool) to wall\noff producers (those generating reports) with consumers (those viewing\nthem).\n\n# Report viewing\n\n**minci** has a built-in web interface at the same address used for\nposting reports.\n\nIt features a dashboard \"index\" view showing the most recent reports\ngrouped by project and generating machine.  This gives a quick look at\nwhat systems currently work and don't work.\n\nIt also allows for browsing by project, date, or seeing the individaul\nreport log, including full failure logs.\n\nThe interface supports HTTP caching, compression, and the styling is\nresponsive and includes a night mode.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristapsdz%2Fminci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkristapsdz%2Fminci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkristapsdz%2Fminci/lists"}