charmkit 0.5.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -0
- data/README.md +46 -94
- data/charmkit.gemspec +3 -3
- data/examples/Charmkitfile +66 -0
- data/examples/basic.rb +6 -0
- data/examples/demo/Gemfile +10 -0
- data/examples/demo/Gemfile.lock +64 -0
- data/examples/demo/README.md +27 -0
- data/examples/demo/Rakefile +9 -0
- data/examples/demo/config.yaml +2 -0
- data/examples/demo/hooks/config-changed +3 -0
- data/examples/{my-demo-charm → demo}/hooks/install +3 -5
- data/examples/demo/hooks/leader-elected +3 -0
- data/examples/demo/hooks/leader-settings-changed +3 -0
- data/examples/demo/hooks/start +3 -0
- data/examples/demo/hooks/stop +3 -0
- data/examples/demo/hooks/update-status +3 -0
- data/examples/demo/hooks/upgrade-charm +3 -0
- data/examples/demo/metadata.yaml +9 -0
- data/examples/load-charmkit-file.rb +2 -0
- data/examples/plugin_loader.rb +9 -0
- data/examples/template.rb +6 -0
- data/examples/templates/user_auth.txt +1 -0
- data/exe/charmkit +5 -0
- data/lib/charmkit.rb +6 -7
- data/lib/charmkit/cli.rb +124 -0
- data/lib/charmkit/dependencies.rb +26 -0
- data/lib/charmkit/helpers.rb +5 -0
- data/lib/charmkit/helpers/crypt.rb +8 -6
- data/lib/charmkit/helpers/fs.rb +0 -15
- data/lib/charmkit/helpers/hookenv.rb +10 -0
- data/lib/charmkit/helpers/runner.rb +2 -1
- data/lib/charmkit/helpers/template.rb +1 -0
- data/lib/charmkit/hook.rb +47 -0
- data/lib/charmkit/scroll.rb +15 -0
- metadata +48 -29
- data/examples/my-demo-charm/Gemfile +0 -5
- data/examples/my-demo-charm/Gemfile.lock +0 -15
- data/examples/my-demo-charm/README.md +0 -45
- data/examples/my-demo-charm/Rakefile +0 -63
- data/examples/my-demo-charm/config.yaml +0 -21
- data/examples/my-demo-charm/copyright +0 -21
- data/examples/my-demo-charm/hooks/config-changed +0 -3
- data/examples/my-demo-charm/hooks/upgrade-charm +0 -3
- data/examples/my-demo-charm/icon.svg +0 -322
- data/examples/my-demo-charm/metadata.yaml +0 -18
- data/examples/my-demo-charm/readme +0 -1
- data/examples/my-demo-charm/tasks/vim.rb +0 -8
- data/examples/my-demo-charm/templates/acl.auth.php +0 -10
- data/examples/my-demo-charm/templates/local.php +0 -15
- data/examples/my-demo-charm/templates/plugins.local.php +0 -12
- data/examples/my-demo-charm/templates/users.auth.php +0 -11
- data/examples/my-demo-charm/templates/vhost.conf +0 -42
- data/examples/render_inline.rb +0 -59
- data/lib/charmkit/extend/string_tools.rb +0 -14
- data/lib/charmkit/plugins/nginx.rb +0 -8
- data/lib/charmkit/plugins/php.rb +0 -19
- data/lib/charmkit/version.rb +0 -14
@@ -1,18 +0,0 @@
|
|
1
|
-
name: dokuwiki
|
2
|
-
summary: |
|
3
|
-
Dokuwiki is a simple to use wiki.
|
4
|
-
description: |
|
5
|
-
DokuWiki is a simple to use and highly versatile Open Source wiki software
|
6
|
-
that doesn't require a database. It is loved by users for its clean and
|
7
|
-
readable syntax.
|
8
|
-
maintainers: ['Adam Stokes <adam.stokes@ubuntu.com>']
|
9
|
-
series:
|
10
|
-
- xenial
|
11
|
-
tags:
|
12
|
-
- php
|
13
|
-
- wiki
|
14
|
-
resources:
|
15
|
-
stable-release:
|
16
|
-
type: file
|
17
|
-
filename: stable.tgz
|
18
|
-
description: "Dokuwiki stable wiki source"
|
@@ -1 +0,0 @@
|
|
1
|
-
example charm demo using charmkit
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
/* Generated by Juju
|
3
|
-
*/
|
4
|
-
$conf['title'] = 'Dokuwiki';
|
5
|
-
$conf['tagline'] = 'deployed by Juju';
|
6
|
-
$conf['license'] = 'cc-by-sa';
|
7
|
-
$conf['useacl'] = 1;
|
8
|
-
$conf['superuser'] = '@admin';
|
9
|
-
$conf['disableactions'] = 'register';
|
10
|
-
$conf['showuseras'] = 'username';
|
11
|
-
$conf['youarehere'] = 1;
|
12
|
-
$conf['gzip_output'] = 1;
|
13
|
-
$conf['sitemap'] = 1;
|
14
|
-
$conf['userewrite'] = '1';
|
15
|
-
$conf['useslash'] = 1;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# users.auth.php
|
2
|
-
# <?php exit()?>
|
3
|
-
# Don't modify the lines above
|
4
|
-
#
|
5
|
-
# Userfile
|
6
|
-
#
|
7
|
-
# Format:
|
8
|
-
#
|
9
|
-
# login:passwordhash:Real Name:email:groups,comma,seperated
|
10
|
-
|
11
|
-
<%= admin_user %>:<%= admin_password %>:<%= admin_name %>:<%= admin_email %>:admin,user
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# set cgi.fix_pathinfo = 0 in /etc/php/7.0/fpm/php.ini
|
2
|
-
|
3
|
-
server {
|
4
|
-
## Your website name goes here.
|
5
|
-
server_name <%= public_address %>;
|
6
|
-
## Your only path reference.
|
7
|
-
root <%= app_path %>;
|
8
|
-
location / {
|
9
|
-
index doku.php;
|
10
|
-
# This is cool because no php is touched for static content.
|
11
|
-
# include the "?$args" part so non-default permalinks doesn't break when using query string
|
12
|
-
try_files $uri $uri/ @dokuwiki;
|
13
|
-
}
|
14
|
-
|
15
|
-
location ~ ^/lib.*\.(gif|png|ico|jpg)$ {
|
16
|
-
expires 30d;
|
17
|
-
}
|
18
|
-
|
19
|
-
location ^~ /conf/ { return 403; }
|
20
|
-
location ^~ /data/ { return 403; }
|
21
|
-
|
22
|
-
location @dokuwiki {
|
23
|
-
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
|
24
|
-
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
|
25
|
-
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
|
26
|
-
rewrite ^/(.*) /doku.php?id=$1 last;
|
27
|
-
}
|
28
|
-
|
29
|
-
location ~ \.php$ {
|
30
|
-
include fastcgi_params;
|
31
|
-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
32
|
-
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
|
33
|
-
}
|
34
|
-
# Block access to data folders
|
35
|
-
location ~ /(data|conf|bin|inc)/ {
|
36
|
-
deny all;
|
37
|
-
}
|
38
|
-
# Block access to .htaccess files
|
39
|
-
location ~ /\.ht {
|
40
|
-
deny all;
|
41
|
-
}
|
42
|
-
}
|
data/examples/render_inline.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'charmkit'
|
2
|
-
|
3
|
-
template('examples/my-demo-charm/templates/vhost.conf',
|
4
|
-
'/tmp/nginx-data.conf',
|
5
|
-
public_address: 'localhost',
|
6
|
-
app_path: '/srv/app')
|
7
|
-
|
8
|
-
inline_template('vhost.conf',
|
9
|
-
'/tmp/output.txt',
|
10
|
-
public_address: "localhost",
|
11
|
-
app_path: "/srv/app")
|
12
|
-
__END__
|
13
|
-
|
14
|
-
@@ nginx.conf
|
15
|
-
|
16
|
-
server_connections { 50m; }
|
17
|
-
|
18
|
-
@@ vhost.conf
|
19
|
-
|
20
|
-
server {
|
21
|
-
## Your website name goes here.
|
22
|
-
server_name <%= public_address %>;
|
23
|
-
## Your only path reference.
|
24
|
-
root <%= app_path %>;
|
25
|
-
location / {
|
26
|
-
index doku.php;
|
27
|
-
# This is cool because no php is touched for static content.
|
28
|
-
# include the "?$args" part so non-default permalinks doesn't break when using query string
|
29
|
-
try_files $uri $uri/ @dokuwiki;
|
30
|
-
}
|
31
|
-
|
32
|
-
location ~ ^/lib.*\.(gif|png|ico|jpg)$ {
|
33
|
-
expires 30d;
|
34
|
-
}
|
35
|
-
|
36
|
-
location ^~ /conf/ { return 403; }
|
37
|
-
location ^~ /data/ { return 403; }
|
38
|
-
|
39
|
-
location @dokuwiki {
|
40
|
-
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
|
41
|
-
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
|
42
|
-
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
|
43
|
-
rewrite ^/(.*) /doku.php?id=$1 last;
|
44
|
-
}
|
45
|
-
|
46
|
-
location ~ \.php$ {
|
47
|
-
include fastcgi_params;
|
48
|
-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
49
|
-
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
|
50
|
-
}
|
51
|
-
# Block access to data folders
|
52
|
-
location ~ /(data|conf|bin|inc)/ {
|
53
|
-
deny all;
|
54
|
-
}
|
55
|
-
# Block access to .htaccess files
|
56
|
-
location ~ /\.ht {
|
57
|
-
deny all;
|
58
|
-
}
|
59
|
-
}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
class String
|
2
|
-
# Simple classify to rename our hooks to their proper class
|
3
|
-
#
|
4
|
-
# charmkit config-changed
|
5
|
-
#
|
6
|
-
# This will load config-changed.rb and classify it's name to
|
7
|
-
# ConfigChanged.
|
8
|
-
#
|
9
|
-
# Note most libraries use '_'(underscore) for word separation whereas
|
10
|
-
# Juju hooks are '-'(hyphenated).
|
11
|
-
def classify
|
12
|
-
return self.split('-').collect!{ |w| w.capitalize }.join
|
13
|
-
end
|
14
|
-
end
|
data/lib/charmkit/plugins/php.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
namespace :php do
|
2
|
-
desc "Install PHP"
|
3
|
-
task :install do
|
4
|
-
pkgs = [
|
5
|
-
'php-fpm',
|
6
|
-
'php-cgi',
|
7
|
-
'php-curl',
|
8
|
-
'php-gd',
|
9
|
-
'php-json',
|
10
|
-
'php-mcrypt',
|
11
|
-
'php-readline',
|
12
|
-
'php-mbstring',
|
13
|
-
'php-xml'
|
14
|
-
]
|
15
|
-
cmd.run "apt-get update"
|
16
|
-
cmd.run "juju-log Installing PHP7 and its dependencies."
|
17
|
-
cmd.run "apt-get install -qyf #{pkgs.join(' ')}"
|
18
|
-
end
|
19
|
-
end
|
data/lib/charmkit/version.rb
DELETED