giticious 0.9.1 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b29da90b02cefdd1a0396898095c078873328d76
4
- data.tar.gz: da90785550d986daf50c67f5364037e4373a475f
3
+ metadata.gz: 8084fca6e82b428f55b52da0e8a0cf06070c8ee0
4
+ data.tar.gz: 7d2358daf73c6ec7f19dfbaeb9f9db9680518cb5
5
5
  SHA512:
6
- metadata.gz: 03d7009a076332d96ea2d33ddcc8bbe9c9e9b6d622266d0862f0a33c5f90b01a952b11d6cbfff098306ad1f37f2840690a459c5cb5b272b47c7cb58554be44e7
7
- data.tar.gz: 71e705b8b3dd95c73c27b9339af52f651856fd7c69e1f3626a72f52d4e835d1145c55ff96a3d472432db0f30089f4a54c4f123c1e36dcdcd20a2144f704a402a
6
+ metadata.gz: c88dda89f4d3119fde4f6bb6f6d739f71042527a36657c07a60bf1f2f04feb96247725123fb618e5bcc18b1e89ecaf4386c986a294ce30d03e4595e87c2cd527
7
+ data.tar.gz: 36fd951ce31a539a1a81a6d930f39f08f90b77b20f3f04e2f3cab340462160bd2699a8d2b833d5501965e08303b3307eba9551f2b9523fade350af401225b416
data/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # Giticious - Lightweight Git Server
2
+
3
+ Giticious is a Ruby CLI tool that allows you to host multiple Git repositories with User Management/Access Control
4
+ almost effortlessly.
5
+
6
+ Repositories are served through SSH using public key authentication. All you need is a Linux system serving SSH on
7
+ port 22 and Ruby >= 2.0 as well as a separate system user to host your Git repositories.
8
+
9
+
10
+ ## Installation
11
+
12
+ While Giticious should run on almost any GNU/Linux distribution, a installation script currently only exists for Ubuntu 15.04 Vivid Vervet.
13
+
14
+ ### Ubuntu 15.04 (Vivid Vervet)
15
+
16
+ Log in as a user with privileges to run commands with `sudo` and run:
17
+
18
+ ```
19
+ curl -s https://raw.githubusercontent.com/dprandzioch/giticious/master/install/ubuntu-vivid.sh | bash -s
20
+ ```
21
+
22
+ Then follow the instruction on the screen.
23
+
24
+
25
+ ### CentOS 7 / RHEL 7
26
+
27
+ Log in as a privileged user (sudo is not installed by default) and run:
28
+
29
+ ```
30
+ curl -s https://raw.githubusercontent.com/dprandzioch/giticious/master/install/centos-rhel7.sh | bash -s
31
+ ```
32
+
33
+ Then follow the instruction on the screen.
34
+
35
+
36
+ ### Other GNU/Linux distros
37
+
38
+ Just run
39
+
40
+ ```
41
+ gem install giticious
42
+ ```
43
+
44
+ logged in as your `git` system user and then execute
45
+
46
+ ```
47
+ giticious init
48
+ ```
49
+
50
+ Make sure that SSH is running on port 22 and allows PubkeyAuthentication.
51
+
52
+
53
+ ## Usage
54
+
55
+ Usage is as easy as this:
56
+
57
+ ```
58
+ $ ~ (git)-[master] % sudo gem install giticious
59
+ Fetching: i18n-0.7.0.gem (100%)
60
+ Successfully installed i18n-0.7.0
61
+ [...]
62
+ Parsing documentation for giticious-0.9.1
63
+ Installing ri documentation for giticious-0.9.1
64
+ 10 gems installed
65
+
66
+ $ ~ (git)-[master] % giticious init
67
+ -- create_table(:repositories)
68
+ -> 0.0044s
69
+ -- create_table(:users)
70
+ -> 0.0016s
71
+ -- create_table(:permissions)
72
+ -> 0.0012s
73
+
74
+ $ ~ (git)-[master] % giticious user create testuser
75
+ User testuser has been created!
76
+ +---+----------+
77
+ | # | Username |
78
+ +---+----------+
79
+ | 1 | testuser |
80
+ +---+----------+
81
+
82
+ $ ~ (git)-[master] % giticious pubkey add testuser "ssh-rsa mypubkey"
83
+ Public key "ssh-rsa mypubkey" for user testuser has been added!
84
+ +----------+----------------------------+
85
+ | Username | Public key (last 80 chars) |
86
+ +----------+----------------------------+
87
+ | testuser | ssh-rsa mypubkey |
88
+ +----------+----------------------------+
89
+
90
+ $ ~ (git)-[master] % giticious repo create mytestrepo
91
+ The repository has been created
92
+ +------------+------------------------------------------------+----------------------------------------------+
93
+ | Name | Path | SSH URL |
94
+ +------------+------------------------------------------------+----------------------------------------------+
95
+ | mytestrepo | /Users/dprandzioch/repositories/mytestrepo.git | dprandzioch@<your-server-url>:mytestrepo.git |
96
+ +------------+------------------------------------------------+----------------------------------------------+
97
+
98
+ $ ~ (git)-[master] % giticious repo permit mytestrepo testuser rw
99
+ Permission granted!
100
+ +------------+----------+------+-------+
101
+ | Repository | User | Read | Write |
102
+ +------------+----------+------+-------+
103
+ | mytestrepo | testuser | true | true |
104
+ +------------+----------+------+-------+
105
+
106
+ $ ~ (git)-[master] % giticious repo list
107
+ +------------+------------------------------------------------+----------------------------------------------+
108
+ | Name | Path | SSH URL |
109
+ +------------+------------------------------------------------+----------------------------------------------+
110
+ | mytestrepo | /Users/dprandzioch/repositories/mytestrepo.git | dprandzioch@<your-server-url>:mytestrepo.git |
111
+ +------------+------------------------------------------------+----------------------------------------------+
112
+ ```
113
+
114
+
115
+ Now just go ahead and clone your repo:
116
+
117
+ ```
118
+ git clone dprandzioch@<your-server-url>:mytestrepo.git
119
+ ```
120
+
121
+
122
+ ## License
123
+
124
+ Giticious is released under the terms of the MIT Expat license, so feel free to use it for your projects :-)
data/Vagrantfile CHANGED
@@ -1,12 +1,27 @@
1
1
  Vagrant.configure(2) do |config|
2
- config.vm.box = "ubuntu/vivid64"
2
+
3
3
  config.vm.network "private_network", ip: "192.168.33.10"
4
+ config.vm.synced_folder ".", "/vagrant", type: :nfs
4
5
 
5
- config.vm.provision "shell", inline: <<-SHELL
6
- sudo apt-get update
7
- sudo apt-get install -y git ruby ruby-dev libsqlite3-dev build-essential
8
- sudo gem install rake bundler
9
- cd /vagrant
10
- sudo bundle install
11
- SHELL
6
+ config.vm.define "vivid" do |box|
7
+ box.vm.box = "ubuntu/vivid64"
8
+
9
+ box.vm.provision "shell", inline: <<-SHELL
10
+ sudo apt-get update
11
+ sudo apt-get install -y git ruby ruby-dev libsqlite3-dev build-essential
12
+ sudo gem install rake bundler
13
+ cd /vagrant
14
+ sudo bundle install
15
+ SHELL
16
+ end
17
+
18
+ config.vm.define "centos7" do |box|
19
+ box.vm.box = "centos/7"
20
+
21
+ box.vm.provision "shell", inline: <<-SHELL
22
+ sudo yum install -y git ruby ruby-devel rubygems rubygem-bundler rubygem-rake sqlite-devel gcc-c++
23
+ cd /vagrant
24
+ sudo bundle install
25
+ SHELL
26
+ end
12
27
  end
@@ -0,0 +1,8 @@
1
+ #!/bin/bash
2
+
3
+ yum install -y git ruby ruby-devel rubygems rubygem-bundler sqlite-devel gcc-c++
4
+ gem install giticious
5
+
6
+ echo "Please start SSH service on port 22 and enable PubkeyAuthentication."
7
+ echo "Now create a user called 'git', log in and run 'giticious init'."
8
+ echo "From then on, your Git server can be managed through the giticious CLI util."
@@ -33,10 +33,12 @@ module Giticious
33
33
  desc "gitserve", "Hidden task to serve git ssh requests", hide: true
34
34
  def gitserve(user)
35
35
  abort unless user
36
+ abort if ENV["SSH_ORIGINAL_COMMAND"].nil?
36
37
 
37
38
  command_match = ENV["SSH_ORIGINAL_COMMAND"].match(/(git\-upload\-pack|git\-receive\-pack) \'([A-Za-z0-9\-_\.]+)\.git\'/)
38
39
  abort "Project not found / Command invalid" if command_match.nil?
39
40
 
41
+ action = command_match[1]
40
42
  repo = command_match[2]
41
43
  perms = Giticious::Service::Repository.new.permissions_for(repo, user)
42
44
  abort "You have no access to #{repo}" if perms == false
@@ -1,3 +1,3 @@
1
1
  module Giticious
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: giticious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Prandzioch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-08 00:00:00.000000000 Z
11
+ date: 2015-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -105,10 +105,12 @@ files:
105
105
  - Gemfile
106
106
  - Gemfile.lock
107
107
  - LICENSE
108
+ - README.md
108
109
  - Rakefile
109
110
  - Vagrantfile
110
111
  - bin/giticious
111
112
  - giticious.gemspec
113
+ - install/centos-rhel7.sh
112
114
  - install/ubuntu-vivid.sh
113
115
  - lib/giticious.rb
114
116
  - lib/giticious/check.rb