forked from zuazo/boxbilling-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmetadata.rb
258 lines (222 loc) · 8.54 KB
/
metadata.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# encoding: UTF-8
#
# Cookbook Name:: boxbilling
# Author:: Raul Rodriguez (<[email protected]>)
# Author:: Xabier de Zuazo (<[email protected]>)
# Copyright:: Copyright (c) 2014-2015 Onddo Labs, SL.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
name 'boxbilling'
maintainer 'Xabier de Zuazo'
maintainer_email '[email protected]'
license 'Apache 2.0'
description <<-EOS
Installs and configures BoxBilling, invoice and client management software
EOS
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.1.0' # WiP
if respond_to?(:source_url)
source_url "https://github.com/zuazo/#{name}-cookbook"
end
if respond_to?(:issues_url)
issues_url "https://github.com/zuazo/#{name}-cookbook/issues"
end
supports 'amazon'
supports 'centos', '>= 6.0'
supports 'debian'
supports 'fedora'
supports 'redhat'
supports 'ubuntu'
depends 'apache2', '~> 3.0'
depends 'cron', '~> 1.6'
depends 'database', '= 2.3.1'
depends 'encrypted_attributes', '~> 0.2'
depends 'mysql', '~> 5.0'
depends 'nginx', '~> 2.7'
depends 'openssl', '~> 2.0'
depends 'php', '~> 1.5'
depends 'php-fpm', '>= 0.7'
depends 'ssl_certificate', '~> 1.2'
depends 'yum-epel', '~> 0.5'
recipe 'boxbilling::default',
'Installs and configures BoxBilling. Including the MySQL server if set '\
'to localhost.'
recipe 'boxbilling::api',
'Installs the requirementes to use boxbilling_api resource.'
recipe 'boxbilling::mysql',
'Installs MySQL server for BoxBilling.'
provides 'boxbilling_api'
attribute 'boxbilling/version',
display_name: 'boxbilling version',
description: 'BoxBilling version.',
type: 'string',
default: '4.19.1'
attribute 'boxbilling/download_url',
display_name: 'boxbilling download url',
description: 'BoxBilling download URL.',
type: 'string',
calcualted: true
attribute 'boxbilling/required_packages',
display_name: 'boxbilling required packages',
description: 'BoxBilling required packages.',
type: 'array',
default: %w(unzip)
attribute 'boxbilling/php_packages',
display_name: 'boxbilling php packages',
description: 'BoxBilling required PHP packages.',
type: 'string',
calculated: true
attribute 'boxbilling/dir',
display_name: 'boxbilling directory',
description: 'BoxBilling installation directory.',
type: 'string',
default: '/srv/www/boxbilling'
attribute 'boxbilling/server_name',
display_name: 'boxbilling server',
description: 'BoxBilling server name.',
type: 'string',
calculated: true
attribute 'boxbilling/cron_enabled',
display_name: 'boxbilling cron enabled',
description: 'Whether to enable BoxBilling cron job.',
type: 'string',
choice: %w(true false),
default: 'true'
attribute 'boxbilling/headers',
display_name: 'boxbilling headers',
description: 'BoxBilling HTTP headers to set as hash.',
type: 'hash',
default: {}
attribute 'boxbilling/ssl',
display_name: 'boxbilling ssl',
description: 'Whether to enable SSL in BoxBilling.',
type: 'string',
choice: %w(true false),
default: 'true'
attribute 'boxbilling/encrypt_attributes',
display_name: 'boxbilling encrypt attributes',
description: 'Whether to encrypt BoxBilling attributes containing '\
'credential secrets.',
type: 'string',
choice: %w(true false),
default: 'false'
attribute 'boxbilling/web_server',
display_name: 'Web Server',
description: 'Web server to use: apache or nginx',
choice: %w(apache nginx),
type: 'string',
required: 'optional',
default: 'apache'
attribute 'boxbilling/admin/email',
display_name: 'boxbilling admin email',
description: 'BoxBilling admin email.',
type: 'string',
calculated: true
attribute 'boxbilling/admin/pass',
display_name: 'boxbilling admin pass',
description: 'BoxBilling admin password.',
type: 'string',
calculated: true
attribute 'boxbilling/config/timezone',
display_name: 'boxbilling config timezone',
description: 'BoxBilling timezone. See http://php.net/manual/en/timezones.php.',
type: 'string',
default: 'America/New_York'
attribute 'boxbilling/config/db_host',
display_name: 'boxbilling config db host',
description: 'BoxBilling database host.',
type: 'string',
default: 'localhost'
attribute 'boxbilling/config/db_name',
display_name: 'boxbilling config db name',
description: 'BoxBilling database name.',
type: 'string',
default: 'boxbilling'
attribute 'boxbilling/config/db_user',
display_name: 'boxbilling config db user',
description: 'BoxBilling database user.',
type: 'string',
default: 'boxbilling'
attribute 'boxbilling/config/db_password',
display_name: 'boxbilling config db password',
description: 'BoxBilling database user password.',
type: 'string',
calculated: true
attribute 'boxbilling/config/url',
display_name: 'boxbilling config url',
description: 'BoxBilling URL.',
type: 'string',
calculated: true
attribute 'boxbilling/config/license',
display_name: 'boxbilling config license',
description: 'BoxBilling license key.',
required: 'required',
type: 'string',
default: 'nil'
attribute 'boxbilling/config/locale',
display_name: 'boxbilling config locale',
description: 'BoxBilling locale.',
type: 'string',
default: 'en_US'
attribute 'boxbilling/config/sef_urls',
display_name: 'boxbilling config sef urls',
description: 'Whether to enable BoxBilling search engine friendly'\
' URLs.',
type: 'string',
choice: %w(true false),
default: 'false'
attribute 'boxbilling/config/debug',
display_name: 'boxbilling config debug',
description: 'Whether to enable BoxBilling debug.',
type: 'string',
choice: %w(true false),
default: 'false'
attribute 'boxbilling/api_config/require_referer_header',
display_name: 'boxbilling api config require referer header',
description: 'Whether to enable require referer header in the API.',
type: 'string',
choice: %w(true false),
default: 'true'
attribute 'boxbilling/api_config/allowed_ips',
display_name: 'boxbilling api config allowed ips',
description: 'BoxBilling allowed IP addresses to access the API. '\
'Empty array will allow all IPs to access the API.',
type: 'array',
default: []
attribute 'boxbilling/api_config/rate_span',
display_name: 'boxbilling api config rate span',
description: 'BoxBilling API time span for limit in seconds.',
type: 'string',
default: '3600'
attribute 'boxbilling/api_config/rate_limit',
display_name: 'boxbilling api config rate limit',
description: 'BoxBilling API requests allowed per time span.',
type: 'string',
default: '1000'
attribute 'boxbilling/mysql/server_root_password',
display_name: 'boxbilling mysql server root password',
description: 'BoxBilling MySQL root password.',
type: 'string',
calculated: true
attribute 'boxbilling/mysql/server_debian_password',
display_name: 'boxbilling mysql server debian password',
description: 'BoxBilling MySQL debian user password.',
type: 'string',
calculated: true
attribute 'boxbilling/mysql/server_repl_password',
display_name: 'boxbilling mysql server repl password',
description: 'BoxBilling MySQL repl user password.',
type: 'string',
calculated: true