A read-only clone of the dehub project, for until dehub.dev can be brought back online.
Go to file
mediocregopher 4389da48e4 Fix a bug in typeobj when a type field's name is the same as one of its inner...
---
type: change
description: |-
  Fix a bug in typeobj when a type field's name is the same as one of its inner fields

  This specifically came up with Comment (though it wasn't caught because an error
  wasn't being caught, that's fixed here as well). Prior to unmarshaling into the
  selected inner struct field, typeobj.UnmarshalYAML unmarshals into the outer
  struct in order to unmarshal all non-type fields. However, if one of the fields
  intended for the inner struct field has the same name as one of the type fields
  in the outer struct there would be a conflict at this point.

  The solution is to modify the type of the outer struct being unmarshaled into at
  this stage, so that all fields with type tags automatically have a `yaml:"-"`
  tag, and so are ignored by the yaml unmarshaler at this stage.
fingerprint: AL32FBVJ7Bu2dz1ysrCiRFz2/y+QuaEyhKygvWP/fihw
credentials:
- type: pgp_signature
  pub_key_id: 95C46FA6A41148AC
  body: iQIzBAABAgAdFiEEJ6tQKp6olvZKJ0lwlcRvpqQRSKwFAl6rQYoACgkQlcRvpqQRSKzs0RAAkdU5Ty2uigHZSXqSgU4JiDLMmzlr4B4ODautUuLBmdskVaAAuOUJuS+egUU6Xz6lmL4+zQRBNGCvaZTxu0OT4H4wFWNQ9RdurLbuSJDeQY4htn5bP6BqcOy5aiTiYpnrZu6yuzMTco4jVSZ961o6t829gDBu1jAk32i/l3ivQpMSijEwjK9m74jKxF+fIVqT3+isgs0qzaDkskpdlDEgd/cf4Ibeb1+BAEZRShMXHBhF415rldjYs9H1Q2TSVwAaP7Zqn9gIV04yB/C8Waysh/NCMsIvQcACbVoO9vSBQ/1d+jttI+KTqOTA8lQ/ygWrFdYtPBjXRO7CVrah7PPE+EbFbPBbjH6ddP20uVeoTPTcjUwaWpdg5e4vZfuqXEe0IWW8NyMh8UL1tJ1LpLlWZKx6tz7gcUgoq+jOLUmUG5EB8HjQfqZx6WDHuyPTpy3c646SaIjg8B8tKkwUR+w9zntId7N4mWB+c+qMDH72mU54sXJ/i+XexqZaQgQiz2jRcltNc4S+/ohT5UDAYuivJsCDBcZdOYiMIB2cnPsm2DbCdbQPAq4oK1Ni+2wo7Pj9nVENamc+g6evqCnBZsWQUt5bDUwneIFwYcqdIPulX0NV9rtZQxexIkCmsO1vSrzdkeNyfWizFlRLavW5OBmxuLtoFoZUv5Oijwu8QT0eXMU=
  account: mediocregopher
2020-04-30 15:22:27 -06:00
.dehub Refactor access controls to support multiple branches 2020-02-29 13:09:19 -07:00
accessctl Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
cmd change pre-receive hook from flag to sub-command 2020-04-26 14:33:54 -06:00
fs Initial commit, can create master commit and verify previous master commits 2020-02-15 15:13:50 -07:00
sigcred Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
typeobj Fix a bug in typeobj when a type field's name is the same as one of its inner... 2020-04-30 15:22:27 -06:00
yamlutil Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
.gitignore give git-http-server requests ability to specify specific revision 2020-03-29 10:56:04 -06:00
commit.go Fix a bug in typeobj when a type field's name is the same as one of its inner... 2020-04-30 15:22:27 -06:00
config.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
diff.go refactor how file changes and hashes are handled, and add tests for hashes 2020-04-18 13:26:32 -06:00
Dockerfile.dehub-remote Support non-fastforward commits 2020-04-24 13:33:33 -06:00
fingerprint_test.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
fingerprint.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
go.mod Give the project a proper root, dehub.dev/src/dehub.git 2020-03-29 15:16:36 -06:00
go.sum Initial commit, can create master commit and verify previous master commits 2020-02-15 15:13:50 -07:00
payload_change_test.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
payload_change.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
payload_comment.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
payload_credential_test.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
payload_credential.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
payload_test.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
payload.go Fix a bug in typeobj when a type field's name is the same as one of its inner... 2020-04-30 15:22:27 -06:00
project_test.go Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
project.go change pre-receive hook from flag to sub-command 2020-04-26 14:33:54 -06:00
README.md Remove extra lines from lists in README and SPEC, because apparently it matters 2020-04-26 17:16:58 -06:00
ROADMAP.md Completely refactor naming of everything, in light of new SPEC 2020-04-26 14:23:10 -06:00
SPEC.md Remove extra lines from lists in README and SPEC, because apparently it matters 2020-04-26 17:16:58 -06:00

dehub

dehub aims to provide all the features of a git hosting platform, but without the hosting part. These features include:

User management - Authentication that commits come from the user they say they do, and fine-grained control over which users can do what.

Pull requests and issues - Facilitation of discussion via comment commits, and fine-grained (down to the file level) sign-off requirements.

Tags and releases* - Mark releases in the repo itself, and provide immutable and verifiable git tags so there's never any funny business.

Plugins*: Extend all aspects of dehub functionality via executables managed in the repo itself (in the same style as git hooks).

Key Concepts

To implement these features, dehub combines two key concepts:

First, repo configuration is defined in the repo itself. A file called .dehub/config.yml contains all information related to user accounts, their pgp keys, branch and file level access controls, and more. Every commit must adhere to the configuration of its parent in order to be considered verifiable. The configuration file is committed to the repo like any other file would be, and so is even able to define the access controls on itself.

Second, the commit message of every dehub commit contains YAML encoded metadata, which allows dehub to extend git and provide multiple commit types, each with its own capabilities and restrictions. Some example dehub commit types are change commits, comment commits, and credential commits.

Infrastructure (or lack thereof)

Because a dehub project is entirely housed within a traditional git project, which is merely a collection of files, any existing git or network filesystem infrastructure can be used to host any dehub project:

  • The most barebones git daemon server (with a simple pre-receive hook set up).
  • A remote SSH endpoint.
  • A mailing list (aka the old school way).
  • Network file syncing utilities such as dropbox, syncthing, or NFS.
  • Existing git project hosts like GitHub, Bitbucket, or Keybase.
  • Decentralized filesystems such as IPFS*.

* Planned feature, but not yet implemented.

Getting Started

The dehub project itself can be found by cloning https://dehub.dev/src/dehub.git.

Installation of the dehub tool is currently done via the go get command:

go get dehub.dev/src/dehub.git/cmd/dehub

This will install the binary to your $GOBIN path, which you'll want to put in your $PATH. Run go env if you're not sure where your $GOBIN is.

Once installed, running dehub -h should show you the help output of the command. You can continue on to the tutorials if you're not sure where to go from here.

Tutorials

The following tutorials will guide you through the basic usage of dehub. As dehub is still very much in development a high level of git and PGP profiency is still required in order to use dehub effectively.

TODO

Documentation

The SPEC is the best place to see every possible nitty-gritty detail of how dehub works. It attempts to be both human-readable and exhaustive in its coverage.

ROADMAP documents upcoming features and other work required on the project. If you're looking to contribute, this is a great place to start.

dehub-remote is a simple docker image which can be used to host a remote dehub project over http(s). The endpoint will automatically verify all pushed commits.

git-http-server is a small server which makes a git repo's file tree available via http. It will automatically render markdown files to html as well. git-http-server is used to render dehub's website.