I2P.mdwn 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. Assuming you had a domain name, everything should work now via regular internet
  2. connections. But if you want to make your server accessible via I2P, we'll need
  3. to change some things. Assume the I2P eepsite name you want is mysite.i2p and
  4. the gitweb interface will be at git.mysite.i2p.
  5. Go to the gitweb configuration at /etc/gitweb.conf and change the URLs to point
  6. to the correct address, e.g. $logo\_url should point to mysite.i2p and not
  7. mysite.org.
  8. In the same file, change the URLs for @git\_base\_url\_list to these:
  9. git://localhost:8951
  10. ssh://git@localhost:8950
  11. Go to the server configuration at /etc/lighttpd/lighttpd.conf and change the
  12. gitweb host address to git.mysite.i2p, and change server.port from 80 to 7658.
  13. If you want both I2P and clearnet access, you leave it 80 but then you need to
  14. update the eepsite server tunnel to point to 80 as well.
  15. Using your favorite browser for I2P go <http://127.0.0.1:7657/configclients>. We
  16. need to turn off the built-in eepsite server, Jetty, so lighttpd can take over.
  17. Untick "I2P webserver (eepsite)" so it doesn't run at startup anymore, and click
  18. "Stop" to stop it. In case you need it, the default page you used to see when
  19. browsing to your eepsite (i.e. localhos:7658) can be found at
  20. /usr/share/i2p/eepsite/docroot/help/index.html.
  21. Load the new lighttpd config by running `service lighttpd reload` as root. If it
  22. reports the port is in use, make sure you stopped Jetty (and any other webserver
  23. you don't intend to use) and retry.
  24. Go to <http://127.0.0.1:7657/i2ptunnel>. We're going to setup several tunnels
  25. here. First, start the eepsite server tunnel (should be at the top of the page).
  26. Create the following server tunnels:
  27. + HTTP server tunnel (for Gitweb)
  28. - Name: gitweb (doesn't really matter)
  29. - Description: Web interface for git repos (doesn't really matter)
  30. - Target host: 127.0.0.1
  31. - Target port: 7658
  32. - Website name: git.mysite.i2p (the same you filled for the gitweb host in
  33. /etc/gitweb.conf)
  34. - Check the Auto-Start box
  35. + Standard server tunnel (for git daemon)
  36. - Name: git-daemon (doesn't really matter)
  37. - Description: Anonymous git:// access (doesn't really matter)
  38. - Target host: 127.0.0.1
  39. - Target port: 9418 (the same port git-daemon listens to)
  40. - Check the Auto-Start box
  41. + Standard server tunnel (for ssh access)
  42. - Name: ssh server (doesn't really matter)
  43. - Description: Authenticated ssh:// access (doesn't really matter)
  44. - Target host: 127.0.0.1
  45. - Target port: 22 (the same port openssh-server listens to)
  46. - Check the Auto-Start box
  47. We'll go back here to create client tunnels, but first let's create entries in
  48. the local addressbook for the new server tunnels. Copy the Local Destination
  49. field in the gitweb server tunnel configuration page (the long random-looking
  50. string), then go to <http://localhost:7657/dns> and switch to the Master
  51. addressbook. Here, create a new address with the name git.mysite.i2p and paste
  52. the destination you copied.
  53. Now repeat the same process for the git-daemon tunnel with address
  54. *anon.git.mysite.i2p* and for the ssh tunnel with address *auth.git.mysite.i2p*.
  55. Now, if you didn't create an addressbook entry for your eepsite before, repeat
  56. the same step for the eepsite server tunnel with address mysite.i2p.
  57. Client tunnels need to be added on the client side, i.e. by each team member on
  58. their i2p router. I suggest you do it first on your machine even if it's the
  59. same machine which runs the server, so you can easily test the connection.
  60. Anyway, here are the steps: Go to the tunnel configuration page and add the
  61. following client tunnels:
  62. + Standard client tunnel (for git daemon)
  63. - Name: anon.git.mysite.i2p (doesn't really matter)
  64. - Description: git:// access (doesn't really matter)
  65. - Reachable by: 127.0.0.1
  66. - Port: 8951 (can be any other unused port, as long as you remember to use it
  67. when using git)
  68. - Destination: anon.git.mysite.org
  69. - Check the Auto-Start box
  70. - If you want, check the *Reduce tunnel quantity when idle* box
  71. + Standard client tunnel (for ssh server)
  72. - Name: auth.git.mysite.i2p (doesn't really matter)
  73. - Description: ssh:// access (doesn't really matter)
  74. - Reachable by: 127.0.0.1
  75. - Port: 8950 (can be any other unused port, as long as you remember to use it
  76. when using git)
  77. - Destination: auth.git.mysite.org
  78. - Check the Auto-Start box
  79. - If you want, check the *Reduce tunnel quantity when idle* box
  80. Done! Now let's test the new configuration. If something doesn't work you can
  81. try restarting the I2P router or individual tunnels. Any repository will work;
  82. the example below uses the 'testing' repo preinstalled by gitolite.
  83. $ cd /home/alice/git-repos
  84. $ git clone git://localhost:8951/testing.git
  85. $ rm -R testing
  86. $ git clone ssh://git@localhost:8950/testing.git
  87. $ cd testing
  88. $ touch dummy
  89. $ git add dummy
  90. $ git commit
  91. $ git push origin master
  92. These commands test git:// pull and SSH in both directions, pull and push. If it
  93. was successful, the only thing left is to annouce the new eepsite and register
  94. it with address servers so finding it is becomes easier.
  95. [[TODO|TODO/OPEN]]
  96. - explain HTTP for interested people
  97. - write summary of commands
  98. - fix numbering of the references
  99. - fix code sections according to valid markdown
  100. - setup domain with namecoin
  101. - customize gitweb icons and CSS and add HTML
  102. - add support for categories, preferrably find a way to set them in
  103. gitolite.conf (e.g. modify the gitolite post-commit hook and invent some
  104. syntax for having the category on the repo line along with owner and
  105. description)