summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-10-25 15:13:33 -0400
committerAndrew Cady <d@cryptonomic.net>2021-10-25 15:13:33 -0400
commitbd461f529aa5dd0615a628cc158615c22caac0a1 (patch)
tree88dae00b6705bcda0bb49b01da1fed92771e7664
parent7cbe854c63dc698e7bf9bb65d01f5f097ff08ea6 (diff)
readme
-rw-r--r--EndoForge/README.md130
1 files changed, 95 insertions, 35 deletions
diff --git a/EndoForge/README.md b/EndoForge/README.md
index 0a1f644..795441c 100644
--- a/EndoForge/README.md
+++ b/EndoForge/README.md
@@ -1,74 +1,132 @@
1EndoForge 1EndoForge
2--------- 2===================
3A Self-Forge. 3### A `Self-Forge`
4 4
5Convert any Git repository into a Self-Forge by merging this repository. 5Convert any Git repository into a `Self-Forge` with a simple setting change.
6 6
7Synopsis:
7 8
9```
10 git config core.self-forge true
11```
8 12
13Install `EndoForge`:
9 14
15```
16 make install
17```
10 18
19## WHAT IS A `Self-Forge`
11 20
12WHAT IT DOES 21A `Self-Forge` is a `Git` repository that allows anonymous contribution directly
13------------ 22through the `Git-Over-SSH` protocol. Each contributor is directly validated with
23`OpenSSH` cryptography.
14 24
15This repository contains the code to share itself (the repository) through 25A `Self-Forge` relieves the owner of the repository and the repository's other
16Git-over-SSH. It can be merged into other repositories, turning them 26contributors from all needing to share a common "hub" `Forge` before the owner
17self-sharing. 27can accept a contribution. Instead, users need only `IP` connectivity to the
28machine containing the repository.
18 29
19It also contains the code to listen for changes sent to itself through 30The contributions are stored in namespaces according to the public keys of the
20Git-over-SSH. 31contributors. This prevents collisions.
21 32
33(It is also possible to do _without_ `IP` connectivity using DHT connectivity;
34see `tuntox.git`.)
22 35
36## WHAT IS A `Forge`
23 37
38A `Forge` is a "place" where programmers share source code. (Anyone could share
39any content, in principle. The point is to track past changes.) The largest
40`Forge`, for example, is Microsoft's `GitHub`.
24 41
42Note that a `Forge` is different from a web site. A `Git`-based `Forge` must
43accept contributions in the `Git-Over-SSH` protocol. That is the convenient and
44standard way to use `Git`.
25 45
46Nevertheless, the typical `Forge` requires users to go sign up for some web
47service before they can connect using `Git`'s native language of `SSH`.
48`EndoForge` uses the key provided by the `SSH` client.
26 49
27HOW IT WORKS 50Using a `Self-Forge` relieves users of dependency on any troublesome
28------------ 51intermediary `Forge`. You get your own `Forge`. You are your own `Forge`.
52
53## What is `Git-Over-SSH`
54
55`Git-Over-SSH` is the standard `Git` protocol for _both reading and writing_ a
56repository. It is the same `Git` protocol one uses when _pushing_ to
57`github.com` or any other `Git`-based `Forge`.
58
59`Git` has other protocols for read-only access, including `Git-Over-HTTPS`. That
60type of access to a `Git` repository, including domain name and CA certificate,
61can be provided via `CGit` by running `selfpublish.sh`.
62
63HOW TO ACCESS A SELF-FORGE
64--------------------------
29 65
30Git contains a program `git-receive-pack` which implements a git 66Users can run `git clone` on your `SSH` address, like this:
31protocol server. The `git-receive-pack` expects to be launched as an SSH
32server "ForcedCommand" in a configuration that protects the server from
33untrustworthy users.
34 67
35Normally, the SSH server only permits users who have already uploaded 68[TODO: edit document dynamically to get real values here]
36their public keys to the server. It assumes that access should be closed 69```
37to new users. 70 git clone $(id -u)@$(hostname):$(pwd)
71```
38 72
39Installing this code reverses that assumption, granting open access to 73They can then commit changes to the repository, and push them back to `origin`.
40unrecognized users. This is made safe by limiting write access to a
41GIT_NAMESPACE over which the user proves global mathematical ownership with
42their SSH client key. This means that the user cannot overwrite anyone else's
43data.
44 74
45The user's uploaded data is still saved and is ready to be be merged into the 75The changes will exist in a separate space from where any other user can
46main repository manually, or even automatically. Automatic merging could be 76overwrite. The cryptography of `OpenSSH` makes this possible.
47authorized on the basis of the public key, or through a consensus algorithm
48comparing branches signed by many different keys.
49 77
78HOW IT WORKS
79------------
50 80
81Normally, `OpenSSH` server only permits connections from users whose keys have
82been pre-authorized on the server. `OpenSSH` assumes that access should be
83closed to new users. Installing `EndoForge` modifies the `OpenSSH` server
84configuration so that this assumption is reversed. Access is opened to unknown
85users.
51 86
87Anonymous users are forced to run the command `~/.ssh/AnonymousAccessCommand`
88upon login, instead of whatever command they select for themselves. The user can
89choose or configure their `AnonymousAccessCommand` to provide sandboxing, or to
90implement a user authentication scheme in some flexible way.
52 91
92`EndoForge` installs a `~/.ssh/AnonymousAccessCommand` that allows anonymous
93users to run the `Git` protocol commands (`git-receive-pack`, etc.) to access
94repositories available on the system. A repository must be configured
95`core.self-forge true` to allow this access.
53 96
54HOW TO INSTALL 97INSTALLATION
55-------------- 98--------------
56 99
57Run: 100Run:
58``` 101```
59 make install 102 make install
60``` 103```
61 104
62This installs the `AnonymousAccessCommand` in the current user's home directory 105This installs the `AnonymousAccessCommand` in the current user's home directory
63(under `$HOME/.ssh`). 106(under `$HOME/.ssh`).
64 107
65Then, if sudo access is available, it enables anonymous access by 108Then, if sudo access is available, it enables anonymous access by editing the
66editing the system `OpenSSH` configuration. 109system `OpenSSH` configuration. This allows any user to listen for `SSH`
110connections via the file `$HOME/.ssh/AnonymousAccessCommand`.
67 111
112Finally, the command to enable public access to the `Self-Forge` may be run:
68 113
114Run:
115```
116 git config core.self-forge true
117```
118
119Note that, once installed, you can run this in ANY repository.
120
121You can also run `make shared` but that just runs the same `git config` for you.
69 122
123## HOW TO DISABLE
70 124
125To disable public access to the repository, run:
71 126
127```
128 git config core.self-forge false
129```
72 130
73NON-ROOT INSTALLATION 131NON-ROOT INSTALLATION
74--------------------- 132---------------------
@@ -77,12 +135,14 @@ A systemd unit file to run `OpenSSH` as an unprivileged user is included.
77 135
78The configuration file sets the port to `22022`. 136The configuration file sets the port to `22022`.
79 137
80This type of installation is vastly inferior to running as root, because only 138This type of installation is vastly inferior to one requiring root, because
81root can make `OpenSSH` listen on port `22`, as it is designed to do. 139`OpenSSH` is much easier to connect to servers that listen on port `22` than any
140other port.
82 141
83The `install-user` target runs the unprivileged `OpenSSH` server. 142The `install-user` target runs the unprivileged `OpenSSH` server.
84 143
85``` 144```
86 make install-user 145 make install-user
87``` 146```
88 147
148The script `selftest.sh` tests connecting to the port 22022 server.