hostgitrb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +42 -21
- data/lib/only_git.rb +2 -2
- metadata +30 -12
data/README.textile
CHANGED
@@ -1,32 +1,53 @@
|
|
1
1
|
h1. HostGitRb
|
2
2
|
|
3
|
-
|
4
|
-
The directory that contains these scripts should be added to the PATH variable so they can be easily accessed.
|
3
|
+
By Raoul Felix
|
5
4
|
|
6
|
-
|
5
|
+
HostGitRb allows you to share your Git repositories with other users
|
6
|
+
using SSH Public keys as authentication. You only need one shell account,
|
7
|
+
which makes this great to use in a shared hosting environment, and users
|
8
|
+
won't be able to do anything else other than push/pull to the repositories
|
9
|
+
you define.
|
7
10
|
|
8
|
-
|
9
|
-
Rather than manually adding these entries to the file, the @hostgitrb@ script can be used.
|
11
|
+
h2. Features
|
10
12
|
|
11
|
-
|
13
|
+
* Easy to install
|
14
|
+
* Git Repository sharing via SSH under one user (ideal for shared hosting)
|
15
|
+
* User permission is based on their public keys
|
16
|
+
* You can set read/write or read-only permissions
|
17
|
+
* Users can *only* pull/push Git repos, they can't login via SSH.
|
12
18
|
|
13
|
-
|
14
|
-
Use the -h argument to see the options.
|
19
|
+
h2. Installation
|
15
20
|
|
16
|
-
|
21
|
+
It's easy as pie, just login to your server and install the gem: <code>gem install hostgitrb</code>
|
17
22
|
|
18
|
-
|
19
|
-
Now I want to allow a friend of mine to have access to those 2 repos but I don't want him to be able to login via SSH to my server.
|
23
|
+
Alternatively, clone the "HostGitRb repository":http://github.com/rfelix/hostgitrb from GitHub and add the @bin/@ directory to your @PATH@.
|
20
24
|
|
21
|
-
|
22
|
-
<pre>./allow_git.rb -d /home/user/myrepos -f /home/user/keys/friend_rsa.pub</pre>
|
25
|
+
h2. Usage
|
23
26
|
|
24
|
-
|
25
|
-
|
27
|
+
On my blog post introducing HostGitRb, "Git Repo Hosting via SSH":http://rfelix.com/2010/04/04/git-repo-hosting-via-ssh/, I go through two use cases:
|
28
|
+
* "Use Case 1":http://rfelix.com/2010/04/04/git-repo-hosting-via-ssh/#usecase1 - A simple scenario where I want to give a few users access to all the repositories under one project
|
29
|
+
* "Use Case 2":http://rfelix.com/2010/04/04/git-repo-hosting-via-ssh/#usecase2 - Another scenario where a user needs to have access to a repository that's shared with another user
|
26
30
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
h2. Reference
|
32
|
+
|
33
|
+
Running @hostgitrb --help@ will give you a list of possible options you can use (thanks to "Trollop":http://trollop.rubyforge.org/):
|
34
|
+
|
35
|
+
<pre>
|
36
|
+
> hostgitrb --help
|
37
|
+
Options:
|
38
|
+
--file, -f <s>: Set path to public ssh key file (default: )
|
39
|
+
--key, -k <s>: Provide public ssh key as a string (default: )
|
40
|
+
--dir, -d <s>: Set full path to directory with git repositories to
|
41
|
+
allow access to (default: )
|
42
|
+
--readonly, -r: Set access to repositories in --dir to read only
|
43
|
+
--nobackup, -n: Don't make backup of authorized_keys file
|
44
|
+
--authorizedkeys, -a <s>: Set authorized_keys file (default: ~/.ssh/authorized_keys)
|
45
|
+
--help, -h: Show this message
|
46
|
+
</pre>
|
47
|
+
|
48
|
+
They're pretty much self-explanatory, but here are a few notes:
|
49
|
+
* Use @--key@ when you have the SSH public key is in the clipboard (don't forget the "" due to spaces)
|
50
|
+
* Use @--file@ when you have the actual public key file on your server.
|
51
|
+
* @--readonly@ makes sure the user can only execute @git pull@
|
52
|
+
* HostGitRb makes backups of the _authorized_keys_ file it modifies; stop this with @--nobackup@
|
53
|
+
* @--authorizedkeys@ allows you to change the file that the new permission is added to.
|
data/lib/only_git.rb
CHANGED
@@ -9,8 +9,8 @@ DEBUG_LEVEL = Logger::ERROR
|
|
9
9
|
# git-upload-pack '/home/user/repo/Notes.git'
|
10
10
|
# git-receive-pack '/home/user/repo/Notes.git'
|
11
11
|
# git-upload-pack 'Notes.git'
|
12
|
-
GIT_R_REGEX = /^git[\-](upload)[\-]pack '([
|
13
|
-
GIT_RW_REGEX = /^git[\-](upload|receive)[\-]pack '([
|
12
|
+
GIT_R_REGEX = /^git[\-](upload)[\-]pack '([0-9a-zA-Z\-_\/]+)([.]git)?'$/
|
13
|
+
GIT_RW_REGEX = /^git[\-](upload|receive)[\-]pack '([0-9a-zA-Z\-_\/]+)([.]git)?'$/
|
14
14
|
|
15
15
|
opts = Trollop::options do
|
16
16
|
opt :log, "Set log file", :default => File.join(File.dirname(__FILE__), 'debug.log')
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hostgitrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Raoul Felix
|
@@ -9,20 +15,24 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-09-27 00:00:00 +01:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: mg
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
23
32
|
version: "0"
|
24
|
-
|
25
|
-
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
description: " HostGitRb allows you to share your Git repositories with other users\n using SSH Public keys as authentication. You only need one shell account,\n which makes this great to use in a shared hosting environment, and users\n won't be able to do anything else other than push/pull to the repositories\n you define.\n"
|
26
36
|
email: rf@rfelix.com
|
27
37
|
executables:
|
28
38
|
- hostgitrb
|
@@ -36,31 +46,39 @@ files:
|
|
36
46
|
- bin/hostgitrb
|
37
47
|
- Rakefile
|
38
48
|
- README.textile
|
39
|
-
has_rdoc:
|
49
|
+
has_rdoc: true
|
40
50
|
homepage: http://rfelix.com/
|
51
|
+
licenses: []
|
52
|
+
|
41
53
|
post_install_message:
|
42
54
|
rdoc_options: []
|
43
55
|
|
44
56
|
require_paths:
|
45
57
|
- lib
|
46
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
47
60
|
requirements:
|
48
61
|
- - ">="
|
49
62
|
- !ruby/object:Gem::Version
|
63
|
+
hash: 3
|
64
|
+
segments:
|
65
|
+
- 0
|
50
66
|
version: "0"
|
51
|
-
version:
|
52
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
53
69
|
requirements:
|
54
70
|
- - ">="
|
55
71
|
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
56
75
|
version: "0"
|
57
|
-
version:
|
58
76
|
requirements: []
|
59
77
|
|
60
78
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.3.
|
79
|
+
rubygems_version: 1.3.7
|
62
80
|
signing_key:
|
63
|
-
specification_version:
|
81
|
+
specification_version: 3
|
64
82
|
summary: Simple Git repository hosting using SSH Public Keys
|
65
83
|
test_files: []
|
66
84
|
|