git-annex/doc/tips/remote_webapp_setup.mdwn
Joey Hess e213ef310f git-annex (5.20140717) unstable; urgency=high
* Fix minor FD leak in journal code. Closes: #754608
  * direct: Fix handling of case where a work tree subdirectory cannot
    be written to due to permissions.
  * migrate: Avoid re-checksumming when migrating from hashE to hash backend.
  * uninit: Avoid failing final removal in some direct mode repositories
    due to file modes.
  * S3: Deal with AWS ACL configurations that do not allow creating or
    checking the location of a bucket, but only reading and writing content to
    it.
  * resolvemerge: New plumbing command that runs the automatic merge conflict
    resolver.
  * Deal with change in git 2.0 that made indirect mode merge conflict
    resolution leave behind old files.
  * sync: Fix git sync with local git remotes even when they don't have an
    annex.uuid set. (The assistant already did so.)
  * Set gcrypt-publish-participants when setting up a gcrypt repository,
    to avoid unncessary passphrase prompts.
    This is a security/usability tradeoff. To avoid exposing the gpg key
    ids who can decrypt the repository, users can unset
    gcrypt-publish-participants.
  * Install nautilus hooks even when ~/.local/share/nautilus/ does not yet
    exist, since it is not automatically created for Gnome 3 users.
  * Windows: Move .vbs files out of git\bin, to avoid that being in the
    PATH, which caused some weird breakage. (Thanks, divB)
  * Windows: Fix locking issue that prevented the webapp starting
    (since 5.20140707).

# imported from the archive
2014-07-17 11:27:25 -04:00

49 lines
1.8 KiB
Markdown

Here's the scenario: You have a remote server you can ssh into,
and you want to use the git-annex webapp there, displaying back on your local
web browser.
Sure, no problem! It can even be done securely!
Let's start by making the git-annex repository on the remote server.
git init annex
cd annex
git annex init
Now, you need to generate a private key and a certificate for HTTPS.
These files are stored in `.git/annex/privkey.pem` and
`.git/annex/certificate.pem` inside the git repository. Here's
one way to generate those files, using a self-signed certificate:
(umask 077 ; openssl genrsa -out .git/annex/privkey.pem 4096)
openssl req -new -x509 -key .git/annex/privkey.pem > .git/annex/certificate.pem
With those files in place, git-annex will automatically only accept HTTPS
connections. That's good, since HTTP connections are not secure over the
big bad internet.
All that remains is to make the webapp listen on the external interface
of the server. Normally, for security, git-annex only listens on localhost.
Tell it what hostname to listen on:
git config annex.listen host.example.com
(If your hostname doesn't work, its IP address certianly will..)
When you run the webapp configured like that, it'll print out the
URL to use to open it. You can paste that into your web browser.
git annex webapp
http://host.example.com:42232/?auth=ea7857ad...
Notice that the URL has a big jumble of letters at the end -- this is a
secret token that the webapp uses to verify you're you. So random attackers
can't find your webapp and do bad things with it.
If you like, you can make the server run `git annex assistant --autostart`
on boot.
To automate opening the remote server's webapp in your local browser,
just run this:
firefox "$(ssh host.example.com git annex webapp)"