about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2020-05-05 23:11:53 -0400
committerBen Morrison <ben@gbmor.dev>2020-05-05 23:16:54 -0400
commitee0618b156d872d7536c7ad0423ad5f53d380f0d (patch)
tree0f3160678d6aaeffc763fc7d420725fa85b3ad75
downloadapi-ee0618b156d872d7536c7ad0423ad5f53d380f0d.tar.gz
init
-rw-r--r--LICENSE20
-rw-r--r--README32
-rw-r--r--go.mod3
-rw-r--r--go.sum1
4 files changed, 56 insertions, 0 deletions
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..8c97065
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+Copyright 2020 Ben Morrison (ben@gbmor.dev)
+
+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 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.
+
diff --git a/README b/README
new file mode 100644
index 0000000..e255a62
--- /dev/null
+++ b/README
@@ -0,0 +1,32 @@
+:: Informational API for tilde.institute ::
+
+This allows one to request information and stats via HTTP requests. The GET and
+HEAD methods are allowed. All others will receive a 405 response.
+
+Not finished. Currently planning:
+
+    FMT = /{plain|json}
+        - Plaintext or JSON formatted responses
+
+    $FMT/pkgs
+        - Installed packages
+
+    $FMT/query
+        ?pkg=[a-zA-Z0-9+]
+            - Check if a package is installed.
+
+    $FMT/users
+        - List of users (maybe CSV for plaintext?) and ancillary information
+
+    $FMT/usercount
+        - Number of registered user accounts
+
+    $FMT/uptime
+        - Uptime and Load
+
+    $FMT/version
+        - OpenBSD version
+
+I'll use some kind of fast hash as an etag.
+
+Probably going to add more endpoints.
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..5dfc268
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,3 @@
+module git.tilde.institute/tilde/api
+
+go 1.13
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..8d1c8b6
--- /dev/null
+++ b/go.sum
@@ -0,0 +1 @@
+