aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-02-10 15:05:01 -0500
committerDrew DeVault <sir@cmpwn.com>2018-02-10 15:05:01 -0500
commitc5e3c78d4570b684667d817c114efd441424c481 (patch)
tree4cc8488da75810e4bbbb7f881be87a8ab47445b1
parent858020e4fbb6c65629fc69e5d0ffd020847af778 (diff)
downloadsr.ht-docs-c5e3c78d4570b684667d817c114efd441424c481.tar.gz
Add git.sr.ht docs
-rw-r--r--git.sr.ht/index.md60
-rw-r--r--git.sr.ht/installation.md85
2 files changed, 145 insertions, 0 deletions
diff --git a/git.sr.ht/index.md b/git.sr.ht/index.md
new file mode 100644
index 0000000..21fc1f4
--- /dev/null
+++ b/git.sr.ht/index.md
@@ -0,0 +1,60 @@
+[git.sr.ht](https://git.sr.ht) is a service for hosting git repositories on
+sr.ht.
+
+**See also**:
+
+- [Installation guide](installation.md)
+
+**Important**: git.sr.ht is a work in progress. As a consequence, URLs of
+specific files, commits, branches, etc in the repository viewer are **NOT**
+guaranteed to remain consistent forever. When we finish writing our new
+repository viewer, these will change.
+
+# Profile
+
+Your public profile as available at git.sr.ht/~username. Here any public
+repositories on your account are listed and searchable, but unlisted and private
+repositories are hidden unless you're logged in.
+
+The information displayed on your profile page is sourced from your [meta.sr.ht
+profile](/meta.sr.ht#profile).
+
+# Repository creation
+
+Creating new repositories is done on the [create
+page](https://git.sr.ht/create), which you can access from any page via the
+navigation on the top right.
+
+The *name* and *description* fields are used to describe your repository to the
+public. The *visibility* field will change how your repository is shown on the
+website. Public repositories are visible on your profile, to anonymous users,
+and on third-party search engines. Unlisted repositories are visible to anyone
+who has the link, but are not shown in your profile or in search results.
+Private repositories are only visible to you and other logged-in users who you
+explicitly [grant access to](#access).
+
+# Settings
+
+Each repository's settings may be accessed via the settings link on the
+repository's detail page.
+
+## Info
+
+You can change the repository's visibility and description on this page. Click
+"Rename?" if you wish to rename your repository. Renaming your repository sets
+up a redirect from the previous name to the new.
+
+## Access
+
+The access page allows you to grant other users read or write access to your
+repository. Users with read access will be able to clone and view private
+repositories on the web, and users with write access will be able to push new
+to your repository. Users will write access will not be able to edit your
+repository's settings.
+
+## Delete
+
+You can delete your repository from this page. This operation cannot be undone.
+This does not delete any other resources that may be associated with this
+project, such as a ticket tracker on todo.sr.ht or build history on
+builds.sr.ht.
diff --git a/git.sr.ht/installation.md b/git.sr.ht/installation.md
new file mode 100644
index 0000000..f72c1ab
--- /dev/null
+++ b/git.sr.ht/installation.md
@@ -0,0 +1,85 @@
+git.sr.ht is the git repository hosting service for the sr.ht network.
+
+# Installation
+
+git.sr.ht is a standard sr.ht web service and can be installed through the
+[standard procedure](/installation.md). However, there are several additional
+steps required.
+
+## Repository storage
+
+You will need to set up a directory for repositories to be stored in - we
+suggest `/var/lib/git/`. Also configure a `git` user and assign ownership over
+`/var/lib/git/` to this user. The git.sr.ht package will automatically prepare
+these for you. If you do not use the package, you must create the user yourself
+and ensure that the git.sr.ht web application runs as this user.
+
+## cgit
+
+Presently git.sr.ht's repository viewer is designed as a proxy to
+[cgit](https://git.zx2c4.com/cgit/). This is eventually going to change, but
+for the time being you must install and configure cgit on your server. Set your
+cgitrc file to the following configuration:
+
+ virtual-root=/
+ enable-index-owner=0
+ embedded=1
+ noheader=1
+ source-filter=/usr/lib/cgit/filters/syntax-highlighting.py
+ clone-url=__CLONE_URL__
+ snapshots=tar.xz
+ scan-path=/var/lib/git/
+ readme=:README
+ readme=:readme
+
+Then configure nginx to serve cgit to localhost with something like this:
+
+ server {
+ listen 80;
+ server_name cgit.local;
+ root /usr/share/webapps/cgit;
+ try_files $uri @cgit;
+
+ location @cgit {
+ include fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root/cgit.cgi;
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_param QUERY_STRING $args;
+ fastcgi_param HTTP_HOST $server_name;
+ fastcgi_pass unix:/run/fcgiwrap.sock;
+ }
+ }
+
+Update your git.sr.ht configuration accordingly:
+
+ [cgit]
+ remote=http://cgit.local
+ repos=/var/lib/git/
+
+## SSH dispatch
+
+It is necessary to configure git.sr.ht's SSH dispatcher as the system-wide SSH
+authorization hook. In `/etc/ssh/sshd_config`, configure git-srht-dispatch like
+so:
+
+ AuthorizedKeysCommand=/usr/bin/git-srht-dispatch "%u" "%h" "%t" "%k"
+ AuthorizedKeysUser=root
+
+sshd will invoke our dispatcher whenever a connection is made to the server to
+obtain a list of authorized keys for the connecting user. The default behavior
+is to read the `.ssh/authorized_keys` file from that user's HOME directory, but
+the dispatcher can also "dispatch" to other authentication tools for other
+users. This is used to authorize and perform git operations via the
+`git-srht-keys` and `git-srht-shell`. See the `[dispatch]` section of your
+git.sr.ht configuration for details on how this works and how to configure it
+for additional services (e.g. man.sr.ht).
+
+Authorization logs are written to `/var/log/git-srht-dispatch` and
+`git-srht-shell`.
+
+## Cronjobs
+
+You must also configure `git-srht-periodic` to run periodically with your
+favorite cron daemon. We recommend the following crontab:
+
+ */20 * * * * git-srht-periodic