puppetfactory 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/puppetfactory.rb +8 -3
- data/lib/puppetfactory/plugins/gitea.rb +3 -0
- data/public/js/usermanagement.js +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cec32bdf45caae0009512d87b8bea2a44cbe39b9
|
4
|
+
data.tar.gz: 27301c30a9c58642bce89a379e87a6ecbc2a8799
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95af4028098cec7c6ae2ba5d7a3195881fc9eb2ef3810c95832414c61b518baf14594538df61ccd84260b4fc10f730f5b431afa9cb4882288a3f1fcf26e921a2
|
7
|
+
data.tar.gz: 9359226c973d85989484ec7163123d44f2241756cd0c45a11002a82c30911db649e076a3ce7af6dfe509f011c81ebf58e831b2131b3362364b0e242bfefbfe3b
|
data/lib/puppetfactory.rb
CHANGED
@@ -97,13 +97,18 @@ class Puppetfactory < Sinatra::Base
|
|
97
97
|
end
|
98
98
|
|
99
99
|
session[:username] = username
|
100
|
-
{
|
101
|
-
|
100
|
+
{
|
101
|
+
"status" => "ok",
|
102
|
+
"event" => "login"
|
103
|
+
}.to_json
|
102
104
|
end
|
103
105
|
|
104
106
|
get '/users/deactive' do
|
105
107
|
session.delete :username
|
106
|
-
|
108
|
+
{
|
109
|
+
"status" => "ok",
|
110
|
+
"event" => "logout"
|
111
|
+
}.to_json
|
107
112
|
end
|
108
113
|
|
109
114
|
# admin login
|
@@ -20,6 +20,9 @@ class Puppetfactory::Plugins::Gitea < Puppetfactory::Plugins
|
|
20
20
|
@gitea_port = options[:gitea_port] || '3000'
|
21
21
|
@gitea_user = options[:gitea_user] || 'git'
|
22
22
|
@gitea_homedir = Dir.home(@gitea_user)
|
23
|
+
|
24
|
+
# gitea will scream if the admin's .ssh directory doesn't exist
|
25
|
+
FileUtils.mkdir_p(File.expand_path("~#{@admin_username}/.ssh"))
|
23
26
|
|
24
27
|
migrate_repo! unless File.directory?(@cache_dir)
|
25
28
|
end
|
data/public/js/usermanagement.js
CHANGED
@@ -35,11 +35,16 @@ $(document).ready(function(){
|
|
35
35
|
close();
|
36
36
|
});
|
37
37
|
|
38
|
-
$('#users .select a, #user-logout'
|
38
|
+
$('article').on('click', '#users .select a, #user-logout', function(event){
|
39
39
|
event.preventDefault();
|
40
40
|
var action = $(this).attr('href');
|
41
41
|
$.get(action, function(data) {
|
42
|
-
|
42
|
+
var results = $.parseJSON(data);
|
43
|
+
if (results.status == 'ok') {
|
44
|
+
location.replace('/');
|
45
|
+
} else {
|
46
|
+
alert('User selection failed');
|
47
|
+
}
|
43
48
|
});
|
44
49
|
});
|
45
50
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetfactory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Ford
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-11-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: sinatra
|