meroku 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/frontend/app/models/app.rb +11 -0
- data/frontend/app/models/publickey.rb +7 -6
- data/lib/meroku/version.rb +1 -1
- data/meroku.gemspec +2 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6715ff22d4132899602bd83a1d6a4b0b806f8a1e
|
4
|
+
data.tar.gz: dabfae897d476694db33c1f9e978e8501a22b2f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49a87725609385c18792e7652323d0a8b7a2377217c23fb2845cd4623df6d3f76c8488ac74d23e96fc96dde367f38fac552809081462bedb9b942d9f8fa0f73b
|
7
|
+
data.tar.gz: 0c9966ca3382a39d20a6008a0015cd3bc4afc200b00a7591eb944b6b677890ef9ca8ebe4ea3a7c3841c794d2950c09844ab5cce570c421fe7ef1d28560e925d9
|
data/frontend/app/models/app.rb
CHANGED
@@ -1,3 +1,14 @@
|
|
1
1
|
class App < ApplicationRecord
|
2
2
|
belongs_to :user
|
3
|
+
|
4
|
+
after_commit :make_folder, on: [:create]
|
5
|
+
|
6
|
+
def make_folder
|
7
|
+
Rails.logger.debug "DB8 app.rb:def self.make_folder called"
|
8
|
+
system(%Q[sudo -u git mkdir /home/git/#{self.name}.git])
|
9
|
+
system(%Q[sudo -u git sh -c "cd /home/git/#{self.name}.git; git --bare init"])
|
10
|
+
system(%Q[sudo -u git sh -c "echo '#!/bin/bash' >> /home/git/#{self.name}.git/hooks/post-receive"])
|
11
|
+
system(%Q[sudo -u git sh -c 'echo "echo abc123499999999999999999999999999999" >> /home/git/#{self.name}.git/hooks/post-receive'])
|
12
|
+
system(%Q[sudo -u git sh -c 'sudo chmod +x /home/git/#{self.name}.git/hooks/post-receive'])
|
13
|
+
end
|
3
14
|
end
|
@@ -1,14 +1,15 @@
|
|
1
1
|
class Publickey < ApplicationRecord
|
2
2
|
belongs_to :user
|
3
|
+
after_commit :do_refresh, on: [:create]
|
3
4
|
|
4
5
|
# Updates /home/git/.ssh/authorized_keys
|
5
6
|
# called when something added/?/etc to publickeys table
|
6
|
-
def
|
7
|
+
def do_refresh
|
7
8
|
Rails.logger.debug "DB8 publickey.rb:def self.refresh called"
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
if Publickey.all.size > 0
|
10
|
+
File.write('/tmp/authorized_keys', Publickey.pluck(:data).join("\n") )
|
11
|
+
system("sudo -u git cp /tmp/authorized_keys /home/git/.ssh/authorized_keys")
|
12
|
+
File.delete('/tmp/authorized_keys')
|
13
|
+
end
|
13
14
|
end
|
14
15
|
end
|
data/lib/meroku/version.rb
CHANGED
data/meroku.gemspec
CHANGED
@@ -22,7 +22,8 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
24
|
spec.add_dependency 'escape', '~> 0.0.4'
|
25
|
-
|
25
|
+
|
26
|
+
spec.add_runtime_dependency 'rest-client', '~> 0'
|
26
27
|
|
27
28
|
spec.add_runtime_dependency "activesupport", "~> 5.1.4"
|
28
29
|
spec.add_runtime_dependency "aws-sdk-ec2", "~> 1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meroku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Weerasinghe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: escape
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: rest-client
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|