Compare commits

...

459 Commits

Author SHA1 Message Date
Greg Karékinian
d135b3873c Switch to a systemd unit Chef resource 2021-07-09 11:32:33 +02:00
Greg Karékinian
e9c86081f7 Update sockethub to the latest npm release 2021-07-09 11:32:11 +02:00
Greg Karékinian
b8ac5e1c07 Merge branch 'master' into feature/145-sockethub_from_npm 2021-07-09 10:51:02 +02:00
7fc0a65a22 Merge pull request 'Upgrade all bitcoin software to latest versions' (#328) from chore/upgrade_bitcoin_software into master
Reviewed-on: #328
2021-07-07 09:42:33 +00:00
bb6394ab42 Merge pull request 'Add Tor support for LND' (#332) from feature/lnd_tor into chore/upgrade_bitcoin_software
Reviewed-on: #332
2021-07-07 09:40:37 +00:00
b17c81a1aa Merge branch 'chore/upgrade_bitcoin_software' into feature/lnd_tor 2021-07-07 09:36:11 +00:00
b7af04e8be
Support Tor connections for LND
Adds basics for general Tor support in bitcoin recipes, and specific
support for Tor to the lnd recipe.
2021-07-01 15:34:06 +02:00
9f0b5f0e64
(tor) Add support for ControlPort and CookieAuthentication
Allow to configure Tor to be controlled by other applications, so they
can manage hidden services and such.
2021-07-01 15:32:28 +02:00
c60e65020b Merge pull request 'Auto-unlock LND wallet/node' (#331) from feature/auto_unlock_lnd into chore/upgrade_bitcoin_software
Reviewed-on: #331
2021-07-01 13:21:41 +00:00
37873fb881
Add data bag for LND credentials 2021-07-01 13:17:51 +02:00
4bda4d7857
Install LND with all subsystems enabled
This allows to run loopd and other tools.
2021-06-30 17:10:57 +02:00
2ca576468e
Auto-unlock LND wallet/node
The latest release added a new config option for auto-unlocking the
wallet/node using a password file. This changeset adds support for just
that to the lnd recipe, so that nobody has to manually unlock it after
reboots or service restarts.
2021-06-30 17:09:31 +02:00
a65065c793 Upgrade all bitcoin software to latest versions 2021-06-29 15:55:20 +02:00
f095094cf7 Fix compilation issue with dotnet services
Compilation fails while the executable is running.
Fixed by stopping the services before upgrades.
2021-06-29 15:53:52 +02:00
3dcb9e76ce Update node info 2021-06-29 15:53:22 +02:00
aa98b07f33 Merge pull request 'Configure/deploy RSKj' (#326) from feature/deploy_rsk_testnet into master
Reviewed-on: #326
2021-06-21 16:38:55 +00:00
54274cef77 Merge branch 'master' into feature/deploy_rsk_testnet 2021-06-21 16:37:26 +00:00
65140f92ed Merge pull request 'Upgrade Gitea to 1.14.3' (#327) from chore/322-update_gitea into master
Reviewed-on: #327
2021-06-21 16:36:55 +00:00
b6d0bafce0
Remove license header, improve formatting 2021-06-21 17:50:23 +02:00
bbaeeb5099
Upgrade Gitea to 1.14.3
Adds a new config for the repository root directory.

closes #322
2021-06-21 17:47:30 +02:00
40a943354a
Update generated docs 2021-06-16 11:35:40 +02:00
5bc4266857 Merge pull request 'Use Chef Workstation's ruby with rbenv' (#324) from chore/remove_bundler_version_lock into master
Reviewed-on: #324
2021-06-15 20:26:23 +00:00
Greg Karékinian
9a3565c11f Only keep the knife-zero gem in the Gemfile
The rest is already shipped with Chef Workstation
2021-06-15 22:21:04 +02:00
cbdbb9c2eb
Switch to dokken for testing in kitchen 2021-06-13 17:50:32 +02:00
37787ce3e6
Specify package version for rskj 2021-06-13 17:50:25 +02:00
2063f5c953
WIP RSK cookbook 2021-06-13 16:58:53 +02:00
d7af1a57d1
Create RSK testnet VM 2021-06-12 14:52:36 +02:00
bda100313e
Update README
Add some info about Chef Workstation and rbenv.
2021-05-28 14:51:42 +02:00
ec75f1446c
Use chef-workstation Ruby with rbenv
See https://github.com/docwhat/rbenv-chef-workstation for painlessly
using Chef Workstation's Ruby with rbenv.
2021-05-28 14:40:02 +02:00
6bd76ebec6
Don't require old bundler version 2021-05-28 14:36:07 +02:00
dbdb803b7a Merge pull request 'Upgrade Gitea from 1.13.1 to 1.13.7' (#321) from chore/update_gitea into master
Reviewed-on: #321
2021-04-10 09:01:26 +00:00
7624bcec11
Upgrade Gitea from 1.13.1 to 1.13.7 2021-04-10 11:00:00 +02:00
18a5e0d5d0 Merge pull request 'Deploy hubots from Gitea repos' (#320) from chore/hubot_repos into master
Reviewed-on: #320
2021-04-09 20:03:21 +00:00
f9c992e48e Merge branch 'master' into chore/hubot_repos 2021-04-09 11:48:38 +00:00
Greg Karékinian
87d50d067c Add updated upstream nodejs cookbook
... and its new dependency, chocolatey
2021-04-09 13:18:35 +02:00
c99f82fcd4
Update cookbook version 2021-04-09 11:45:39 +02:00
29e1d64ae0
Remove superfluous license headers from recipe files 2021-04-09 11:44:36 +02:00
9939e4d993
Deploy hubots from Gitea repos
The repos have been moved over from GitHub.
2021-04-09 11:35:49 +02:00
18e45cdaab Merge pull request 'Upgrade nodejs to the latest version from the repo' (#319) from feature/upgrade_nodejs into master
Reviewed-on: #319
2021-03-30 12:02:31 +00:00
769843e6ab Merge branch 'master' into feature/upgrade_nodejs 2021-03-30 12:01:26 +00:00
Greg Karékinian
edf2e071e4 Upgrade nodejs to the latest version from the repo
This is possible in newer versions of the nodejs cookbook, by setting
the `node["nodejs"]["package_action"]["nodejs"]` attribute to `:upgrade`
2021-03-30 13:58:55 +02:00
aea5e07d2e Merge pull request 'Set the environment variables in the hubot-kredits dir' (#318) from feature/315-kredits_for_reviews_fix into master
Reviewed-on: #318
2021-03-30 11:58:26 +00:00
Greg Karékinian
f937e5dc68 Set the environment variables in the hubot-kredits dir
This is meant to be executed as a script manually, not as part of Hubot.

Example usage:

    cd /opt/hal8000_xmpp/node_modules/hubot-kredits
    ./scripts/review-kredits.js --start 2021-02-01 --end 2021-02-28T23:59:59Z --dry

Closes #315
2021-03-30 13:54:21 +02:00
9fc49deafe Merge pull request 'Fix an undefined variable' (#317) from bugfix/dirsrv_undefined_variable into master
Reviewed-on: #317
2021-03-30 10:33:47 +00:00
9b2ba2c714 Merge branch 'master' into bugfix/dirsrv_undefined_variable 2021-03-30 10:33:35 +00:00
0504001e31 Merge pull request 'Deploy hubot with new hubot-kredits' (#316) from feature/315-kredits_for_reviews into master
Reviewed-on: #316
2021-03-30 10:19:30 +00:00
Greg Karékinian
346b6540d1 Fix an undefined variable 2021-03-30 12:14:40 +02:00
Greg Karékinian
45817ba997 Update the barnard node file after running Chef 2021-03-30 12:12:27 +02:00
Greg Karékinian
9415b71965 Deploy hubot with new hubot-kredits
It includes a script for creating Kredits for reviews

Refs #135
2021-03-30 12:11:03 +02:00
3502fb0eec Merge pull request 'Tell browsers to cache Gitea avatars for 30 days' (#313) from bugfix/312-gitea_avatar_caching into master
Reviewed-on: #313
2021-02-26 21:25:41 +00:00
891b5f3fee
Tell browsers to cache Gitea avatars for 30 days
fixes #312
2021-02-26 20:41:53 +01:00
ab515e2101 Merge pull request 'Use shared Kosmos webfont for Gitea' (#311) from feature/gitea_fonts into master
Reviewed-on: #311
2021-02-25 16:38:37 +00:00
5559ca41a7
Support IPv6 and CORS for font hosting 2021-02-25 17:38:11 +01:00
a96d29c716 Merge branch 'master' into feature/gitea_fonts 2021-02-25 15:38:06 +00:00
13ea0e3148 Merge pull request 'Set up assets.kosmos.org for shared static file/webfont hosting' (#309) from feature/static_assets into master
Reviewed-on: #309
2021-02-25 15:22:52 +00:00
474208ea8e
Use shared Kosmos webfont for Gitea
Currently using a custom rule for system fonts. This change also adds a
missing new class to the custom rule to cover Markdown-generated content
like e.g. comments.
2021-02-25 14:29:41 +01:00
6109707f3c
Host assets.kosmos.org on centaurus 2021-02-25 12:13:20 +01:00
1c47f9ab27
Add cookbook for static asset hosting
Configures assets.kosmos.org, only for webfont hosting for now.
2021-02-25 12:12:41 +01:00
09f0faadda
Add missing header to recipe 2021-02-24 19:11:53 +01:00
26e8698e4f Merge pull request 'Replace expired Zoom authentication token for hal8000' (#308) from chore/update_zoom_jwt into master
Reviewed-on: #308
2021-02-18 18:53:45 +00:00
adc2ed895f Merge pull request 'Update node.js (apt repo)' (#307) from chore/update_nodejs_apt_repo into master
Reviewed-on: #307
2021-02-18 18:53:18 +00:00
fd901f6e64
Update Zoom JWT 2021-02-18 18:51:36 +01:00
f7d3736712
Update node details
Removes unused recipes from generated runlist
2021-02-18 18:51:11 +01:00
f3def7b71d
Update node.js (apt repo) 2021-02-10 23:47:23 +01:00
bac66d4dba Merge pull request 'Configure/run Sidekiq for Akkounts' (#304) from feature/303-akkounts_sidekiq into master
Reviewed-on: #304
2021-02-08 21:17:54 +00:00
f88ccae8a6 Merge branch 'master' into feature/303-akkounts_sidekiq 2021-02-08 21:17:43 +00:00
25e3dae4d4 Merge pull request 'Set up Zerotier Controller UI' (#305) from feature/zncui into master
Reviewed-on: #305
2021-02-08 21:16:53 +00:00
9a54a7554f
Use package resource instead of custom command 2021-02-08 20:01:22 +01:00
e1bcd5efa0
Set up Zerotier Control UI
Install/configure ztncui[1], with HTTP access allowed from within the
private network.

[1]: https://key-networks.com/ztncui/
2021-02-07 17:44:08 +01:00
1adf3281bf
Configure/run Sidekiq for Akkounts 2021-02-03 19:53:13 +01:00
241f0807b3 Merge pull request 'Fix/refactor bitcoind recipe, upgrade bitcoind to 0.21' (#298) from chore/update_bitcoin-core into master
Reviewed-on: #298
2021-01-28 15:26:31 +00:00
fe0a955314 Merge pull request 'Update lnd to 0.12.0' (#299) from chore/update_lnd into chore/update_bitcoin-core
Reviewed-on: #299
2021-01-27 17:06:34 +00:00
65185b1a1b
Update lnd to 0.12.0 2021-01-27 18:05:30 +01:00
0d2a04f8ba
Refactor bitcoind recipe
Fixes various issues, like compilation not starting on subsequent
version updates, service not restarting after compilation, and a TODO
note on the compilation script itself.
2021-01-26 12:45:28 +01:00
152edbc958
Update bitcoind to 0.21 2021-01-26 12:45:17 +01:00
40fe403879
Stop c-lightning before compilation
See https://github.com/ElementsProject/lightning/issues/4346 for
potential issues with not doing that.
2021-01-26 12:33:09 +01:00
9023c14849 Merge pull request 'Update c-lightning to v0.9.3' (#297) from chore/update_c-lightning into master
Reviewed-on: #297
2021-01-26 11:07:21 +00:00
c3256a07cc
Fix c-lightning configure not finding python
Broke in the latest release.
2021-01-26 12:05:29 +01:00
461af035ac
Update c-lightning to 0.9.3 2021-01-26 12:05:19 +01:00
e3507879a1 Merge pull request 'BTCPay recipe fixes (compilation + PostgreSQL config)' (#296) from chore/btcpay_update_and_recipe_fix into master
Reviewed-on: #296
2021-01-26 10:52:03 +00:00
5a5db43de3
Use new postgres client role and config
Fixes btcpay having still used the old postgres master, and integrating
it into the global client config setup from here on out.
2021-01-26 11:49:20 +01:00
f7d3abc307
Stop BTCPay server before compilation
fixes #291
2021-01-26 11:48:41 +01:00
f1ff34d769 Merge pull request 'Add Onion-Location header for kosmos.social' (#295) from feature/mastodon_onion_header into master
Reviewed-on: #295
2021-01-25 11:14:38 +00:00
49c75bbb05
Add Onion-Location header for kosmos.social
Tells Tor Browser where to find the native onion site.

refs #201
2021-01-25 12:09:28 +01:00
0920803535 Merge pull request 'Add script for notifying Kosmos channels from Ruby' (#279) from feature/notify_xmpp_from_ruby into master
Reviewed-on: #279
2021-01-25 10:59:05 +00:00
ad271e55d4 Merge pull request 'Move PostgreSQL to VMs and access via Zerotier' (#282) from feature/postgres_vms into master
Reviewed-on: #282
2021-01-25 10:56:42 +00:00
a3136e820b Merge pull request 'Update Gitea to 1.13.1' (#293) from chore/253-gitea_1.13.1 into master
Reviewed-on: #293
2021-01-24 12:49:49 +00:00
c2f36c6f01 Merge pull request 'Update ejabberd to 20.12' (#294) from chore/ejabberd_20.12 into master
Reviewed-on: #294
2021-01-24 12:47:37 +00:00
Greg Karékinian
90ce664f2e Update ejabberd to 20.12
It fixes a bug that prevented the config to be reloaded for LDAP options
(https://github.com/processone/ejabberd/issues/3181) and more:
https://www.process-one.net/blog/ejabberd-20-12/
2021-01-24 10:14:29 +01:00
Greg Karékinian
0e5519a4b7 Update Gitea to 1.13.1
Running on centaurus

Closes #253
2021-01-24 10:12:37 +01:00
Greg Karékinian
1ad7a6936c Generate the hosts entry for the PostgreSQL replica 2021-01-24 10:11:17 +01:00
Greg Karékinian
b1fea4b09f Update the postgres-3 node after Chef run 2021-01-23 19:25:49 +01:00
Greg Karékinian
7ce8b7d461 Enable PostgreSQL service 2021-01-23 19:14:55 +01:00
Greg Karékinian
112eb903ec Add a script to switch the primary PostgreSQL server
Usage: scripts/postgresql/switch_primary.sh <old_primary_hostname> <new_primary_hostname>
2021-01-23 19:13:54 +01:00
Greg Karékinian
7e61e9cb45 Promote a new PostgreSQL primary: postgres-2 2021-01-23 19:09:41 +01:00
Greg Karékinian
a7116b8fe5 Switch the TLS mode to disabled for Gitea
We connect through a Zerotier private IP
2021-01-23 19:08:06 +01:00
Greg Karékinian
a4a35da0ff Replace the hardcoded primary pg IP with a hostname 2021-01-23 17:34:58 +01:00
Greg Karékinian
5cb390f340 Remove the postgresql_replica from centaurus, run Chef
I have also deleted the data directory (in /mnt/data)
2021-01-23 17:11:45 +01:00
Greg Karékinian
4e1bd458f3 Update the mastodon-1 node after Chef run 2021-01-23 17:11:45 +01:00
Greg Karékinian
40fde8a861 Update the ejabberd nodes after Chef run 2021-01-23 17:11:45 +01:00
Greg Karékinian
39d0304ab4 Update the akkounts-1 node after Chef run 2021-01-23 17:11:45 +01:00
Greg Karékinian
ee7b3626be Generate a host entry for the current PostgreSQL primary 2021-01-23 17:11:45 +01:00
Greg Karékinian
286cd2f2a3 Move the postgresql_client role to the top
We want the host file to be written before database connections happen
2021-01-23 17:11:45 +01:00
Greg Karékinian
1e3a2b40d4 Add the postgresql_client role to the akkounts role 2021-01-23 17:11:45 +01:00
Greg Karékinian
bb0e73d1b9 Switch ejabberd, mastodon and gitea to a hostname for Postgres 2021-01-23 17:11:45 +01:00
Greg Karékinian
fdd70d1872 Remove postgres-1 server
It was created with an encfs volume inside a VM, we want full disk encryption
instead. I have deleted the VM from centaurus as well as its disk and
have also unauthorized its id from the zerotier controller
2021-01-23 17:11:45 +01:00
bd48dab1d8
Set up postgres-3 VM 2021-01-23 17:06:15 +01:00
Greg Karékinian
41ca5938a2 Merge branch 'master' into feature/postgres_vms 2021-01-23 14:43:58 +01:00
e31f9ced96 Merge pull request 'Re-enable and improve Tor access for kosmos.social' (#292) from feature/mastodon_tor into master
Reviewed-on: #292
2021-01-23 13:32:57 +00:00
05cd38a5b9
Re-enable and improve Tor access for kosmos.social 2021-01-23 14:22:34 +01:00
d1929fcc9c Merge pull request 'Fix LN nodes not being accessible from the outside' (#289) from bugfix/lnd_externalip into master
Reviewed-on: #289
2021-01-23 11:07:38 +00:00
Greg Karékinian
6ec747d416 Add missing credentials for zerotier 2021-01-22 18:43:05 +01:00
Greg Karékinian
cbcb50bc86 Create a zerotier_controller role 2021-01-22 18:41:46 +01:00
Greg Karékinian
eba7d63b43 Delete the test-2 client and node file 2021-01-22 18:41:46 +01:00
Greg Karékinian
5fa23fe872 Remove the andromeda client and node files 2021-01-22 18:41:46 +01:00
Greg Karékinian
0e1a73b18f Set the private Zerotier IP for draco in the node file 2021-01-22 18:41:46 +01:00
Greg Karékinian
9b4756441a Add a recipe to join the private Zerotier network 2021-01-22 18:41:45 +01:00
Greg Karékinian
dd78b8cf7e Use the PG primary private Zerotier IP if it exists 2021-01-22 18:41:45 +01:00
Greg Karékinian
88e52607e3 Add a recipe to set up a hosts entry for the PG primary 2021-01-22 18:41:45 +01:00
Greg Karékinian
511400a7b8 Update hostsfile and add zerotier cookbook 2021-01-22 18:41:45 +01:00
Greg Karékinian
9a4420fc11 Add the ability to pass a disk size to the create_vm script
Defaults to 10GB
2021-01-22 18:41:45 +01:00
fd4844a012 Fix ejabberd API permission for akkounts VMs
It should have been using a /32, not a /8 subnet, in order to only allow
the akkounts VM(s) to use the API endpoints without further
authorization.
2021-01-22 18:41:45 +01:00
d018b6570d Use default Redis database now 2021-01-22 18:41:45 +01:00
69c1994840 Update node data 2021-01-22 18:41:45 +01:00
d121971cca Set up mastodon-1 VM 2021-01-22 18:41:45 +01:00
1403d91631 Remove extra license header 2021-01-22 18:41:45 +01:00
6da190b110 Don't configure HTTPS site when certs missing 2021-01-22 18:41:45 +01:00
8a870f6fd6 Don't fail on first run, when Tor hostname missing 2021-01-22 18:41:45 +01:00
ad64bfc0be Update system package dependencies for 20.04 2021-01-22 18:41:45 +01:00
971a3a25a1 Remove extra license headers
And update year in LICENSE file
2021-01-22 18:41:45 +01:00
Greg Karékinian
ab422155e4 Add the ability to pass a disk size to the create_vm script
Defaults to 10GB
2021-01-22 13:49:23 +01:00
775ec691ef
Add firewall rules for LND and c-lightning 2021-01-14 21:25:35 +01:00
6c6026958b
Fix typo in port number of externalip config 2021-01-14 21:23:03 +01:00
d1ab4c24ea Merge pull request 'Set up new Mastodon VM, fix/improve Chef recipes' (#284) from chore/move_mastodon_to_vm into master
Reviewed-on: #284
2021-01-14 15:17:19 +00:00
e7fbd57189 Merge branch 'master' into chore/move_mastodon_to_vm 2021-01-14 15:16:17 +00:00
12a3fa5b4e Use default Redis database now 2021-01-13 17:06:36 +01:00
9224aa9d97 Update node data 2021-01-13 17:06:25 +01:00
a27b6a1601 Merge pull request 'Fix ejabberd API permission for akkounts VMs' (#283) from bugfix/ejabberd_api_permission into master
Reviewed-on: #283
2021-01-13 10:40:29 +00:00
ab3ca92228 Merge branch 'master' into bugfix/ejabberd_api_permission 2021-01-13 10:40:06 +00:00
62320106cb
Set up mastodon-1 VM 2021-01-13 09:50:37 +01:00
c622f81572 Remove extra license header 2021-01-13 09:50:10 +01:00
047526e0fc Don't configure HTTPS site when certs missing 2021-01-13 09:49:49 +01:00
9d13acd41a Don't fail on first run, when Tor hostname missing 2021-01-13 09:49:36 +01:00
4d0259493f Update system package dependencies for 20.04 2021-01-13 09:48:23 +01:00
c4fa9e6ec1
Remove extra license headers
And update year in LICENSE file
2021-01-12 18:42:14 +01:00
74cf26846e
Fix ejabberd API permission for akkounts VMs
It should have been using a /32, not a /8 subnet, in order to only allow
the akkounts VM(s) to use the API endpoints without further
authorization.
2021-01-12 18:06:16 +01:00
4872677066
Configure postgres recipes for VMs and zerotier access
* Remove encfs (using encrypted volumes instead)
* Allow access without TLS from zerotier network
2021-01-07 13:53:30 +01:00
9d9907f0ed
Remove extra license copy from recipe, update year 2021-01-07 12:53:44 +01:00
4309efd228
Add postgres-2 VM 2021-01-07 12:53:20 +01:00
4ca875a77b Merge pull request 'Create postgres-1 VM' (#281) from feature/280-postgres_vm into master
Reviewed-on: #281
2021-01-07 11:29:37 +00:00
Greg Karékinian
af54777250 Create postgresql-1 VM
Refs #280
2021-01-07 12:04:52 +01:00
Greg Karékinian
f6086e2f6a Add the firewall rules to the postgresql role 2021-01-07 12:02:35 +01:00
6db296a7f1 Merge pull request 'Move wormhole from barnard to nodejs-2' (#278) from chore/move_wormhole into master
Reviewed-on: #278
2021-01-07 10:42:41 +00:00
1eb73711a2
Remove application_javascript usage from wormhole recipe 2021-01-06 19:12:36 +01:00
eb4764026b
Add script for notifying Kosmos channels from Ruby
An example for notifying Kosmos XMPP channels from plain Ruby, with no
dependencies.
2021-01-06 11:27:50 +01:00
fe63f01f7b
Move wormhole from barnard to nodejs-2
Fixed two small bugs in the recipe:

* hubot user wasn't created when necessary
* systemd template always included redis service dependency
2021-01-05 18:03:15 +01:00
333a76f086 Merge pull request 'Configure and run LND and RTL' (#274) from feauture/lnd into master
Reviewed-on: #274
2021-01-05 10:33:37 +00:00
9ab097dd9a Merge pull request 'Configure local LND as Lightning node in BTCPay Server' (#275) from feature/btcpay_lnd_settings into feauture/lnd
Reviewed-on: #275
2021-01-05 10:33:01 +00:00
876d857dde Merge pull request 'Create new nodejs VM, move kredits-github to it' (#277) from chore/nodejs-2 into master
Reviewed-on: #277
2021-01-05 10:32:44 +00:00
ddded6fbae
Create new nodejs VM, move kredits-github to it 2021-01-05 11:30:31 +01:00
adfd76aa64
Configure local LND as Lightning node in BTCPay Server 2021-01-02 09:59:50 +01:00
2b765e744a
Configure and run RTL
Ride The Lightning is a Web UI for Lightning Network nodes. It is
accessible via the bitcoin VM's private zerotier IP on port 3000.
2021-01-01 17:42:57 +01:00
19e3dfa7b9
Remove obsolete non-standard RPC and REST ports
We'll just run those on default ports without custom config.
2021-01-01 14:14:59 +01:00
37f1fa79e7
Use standard Lightning Network port for LND
Only use the non-standard one internally, so we can run both c-lightning
and lnd on the same machine.
2021-01-01 14:13:58 +01:00
f5f234c0fd Use name of existing node
Migrated from andromeda to bitcoin-2.
2021-01-01 14:13:17 +01:00
5a8d780d37 Merge pull request 'Fix a syntax error in certbot dirsrv hook' (#273) from bugfix/272-certbot_dirsrv into master
Reviewed-on: #273
2020-12-31 11:54:17 +00:00
bf3bb3ed97 Merge branch 'master' into bugfix/272-certbot_dirsrv 2020-12-31 10:41:06 +00:00
Greg Karékinian
456639bdf8 Fix a syntax error in certbot dirsrv hook
The newline was not escaped and rendered as an actual newline

Fixes #272
2020-12-31 11:38:49 +01:00
1360836377 Merge pull request 'Set up NBXplorer, BTCPay Server, and C-Lightning with Chef' (#270) from feature/btcpay_server into master
Reviewed-on: #270
2020-12-31 10:25:08 +00:00
8a6b81485a Merge branch 'master' into feature/btcpay_server 2020-12-31 10:20:28 +00:00
3fcdc8b056
Configure and run LND 2020-12-31 10:10:22 +01:00
61accc05c2
Add nginx proxy for BTCPay 2020-12-29 15:56:53 +01:00
c71d243c40 Merge pull request 'Add a firewall rule to allow PostgreSQL clients to connect' (#269) from bugfix/postgresql_client_firewall into master
Reviewed-on: #269
2020-12-22 22:15:06 +00:00
7d0490f3da Merge branch 'master' into bugfix/postgresql_client_firewall 2020-12-22 17:16:49 +00:00
5892e3c0ab
Configure and run c-lightning daemon 2020-12-22 12:28:29 +01:00
f88354c67c
Compile and install c-lightning 2020-12-21 16:53:22 +01:00
bbd5500982
Configure and run BTCPay Server 2020-12-21 13:50:28 +01:00
ca373a1503
Don't require auth cookie for nbxplorer API 2020-12-21 12:25:13 +01:00
570a692bb2
Configure and run nbxplorer 2020-12-21 12:19:30 +01:00
5277bce20b
Formatting 2020-12-21 11:14:19 +01:00
aa2aa59e28
Download and build NBXplorer and BTCPay 2020-12-21 11:12:14 +01:00
a2b76c7d76
New recipe: Install .NET Core SDK 2020-12-21 11:01:20 +01:00
bb4b919548 Merge pull request 'Always set the promote trigger file config' (#267) from bugfix/pg_promote_trigger_file into master
Reviewed-on: #267
2020-12-18 21:23:11 +00:00
Greg Karékinian
87388ac69d Add the postgresql_client role to the mastodon role
This will add the firewall rule and pg_hba access rule on the PostgreSQL
servers
2020-12-18 17:54:31 +01:00
Greg Karékinian
c700f98976 Add a firewall rule to allow clients to connect
Previously it was not an issue because services that connected to the
PostgreSQL primary were also on the same server as a standby server.
2020-12-18 17:53:28 +01:00
Greg Karékinian
f75aeaf9b5 Always set the promote trigger file config
Only setting it for standby servers isn't useful, as we need to be able
to touch this file to trigger the promotion of a new primary server
after running Chef on it.
2020-12-18 17:02:13 +01:00
4be542670b Merge pull request 'Add new Zoom meeting ID to hubot-kredits whitelist' (#266) from chore/zoom_meeting_id into master
Reviewed-on: #266
2020-12-17 16:40:24 +00:00
db51f1f332
Add new Zoom meeting ID to whitelist 2020-12-17 14:09:41 +01:00
95c8b9fea9 Merge pull request 'Migrate to self-hosted zerotier network' (#265) from chore/zerotier_migration into master
Reviewed-on: #265
2020-12-13 12:39:14 +00:00
84fdcc4760 Merge pull request 'Fix zerotier network creation' (#262) from bugfix/zerotier_default_rules into master
Reviewed-on: #262
2020-12-13 12:38:59 +00:00
Greg Karékinian
1551fe6d1b Update the ipfs-1 node file after running chef 2020-12-11 19:29:56 +01:00
Greg Karékinian
83736d2a85 Update the bitcoin-2 node file after running chef 2020-12-11 19:28:34 +01:00
4b9dfd9c60
Update node configs 2020-12-11 19:24:12 +01:00
fb996e9abf
Join new zerotier network on VM creation 2020-12-11 19:07:11 +01:00
396fe6e714
Whitelist ejabberd custom node attributes
fixes #256
2020-12-11 19:07:06 +01:00
Greg Karékinian
ebfd36bab8 Add nodejs-1 client and node file
Refs #259
2020-12-11 19:02:04 +01:00
c4dbed8d65
Fix zerotier network creation
Using outdated/invalid rules syntax. Remove the property entirely, so
the API will create the default rule (which is the same) on creation.

Co-authored-by: Greg Karékinian <greg@karekinian.com>
2020-12-11 17:42:25 +01:00
2de9d5fe17
Fix typo 2020-12-11 17:40:40 +01:00
8896beab67 Merge pull request 'Configure a zerotier-one network controller' (#260) from feature/zerotier_controller into master
Reviewed-on: #260
2020-12-11 10:42:40 +00:00
8b624b666a Merge branch 'master' into feature/zerotier_controller 2020-12-11 10:39:20 +00:00
ba4e3fdd6f Merge pull request 'Document commands for running Chef against VMs' (#261) from docs/update_readme into master
Reviewed-on: #261
2020-12-11 10:39:08 +00:00
1cb366a160
Add commands for running Chef against VMs 2020-12-10 23:39:59 +01:00
cb8fc25fc8
Configure a zerotier-one network controller 2020-12-10 22:51:35 +01:00
f66f6e2969 Merge pull request 'Add hosts entries for ejabberd private IPs' (#257) from feature/akkounts_xmpp_host into master
Reviewed-on: #257
2020-12-10 13:28:46 +00:00
a06223d764 Merge branch 'master' into feature/akkounts_xmpp_host 2020-12-10 13:27:37 +00:00
0c537d04ef Merge pull request 'Add ejabberd HTTP API permissions for akkounts' (#255) from feature/api_permissions into master
Reviewed-on: #255
2020-12-10 13:27:19 +00:00
f1c8faff85 Merge branch 'master' into feature/api_permissions 2020-12-10 13:26:48 +00:00
623bb1e153 Merge pull request 'Script creating new VMs' (#252) from feature/244-new_vm_script into master
Reviewed-on: #252
2020-12-09 15:33:08 +00:00
Greg Karékinian
a92205bd65 Fix the VM creation script
Also join the zerotier network
2020-12-09 16:29:15 +01:00
Greg Karékinian
77ab77afe8 Update the centaurus and draco nodes after Chef run 2020-12-09 15:42:49 +01:00
Greg Karékinian
6273271d40 Remove kosmos-bitcoin::source from draco
Bitcoind runs inside a VM, not directly on the host
2020-12-09 15:42:19 +01:00
742dc6ff7f Merge branch 'master' into feature/244-new_vm_script 2020-12-09 13:59:52 +00:00
f540661de4 Merge pull request 'Update ejabberd doc' (#254) from docs/ejabberd into master
Reviewed-on: #254
2020-12-09 12:12:51 +00:00
Greg Karékinian
7ceb9af3ed Rename the kosmos_kvm default recipe to host
It makes it clear it is meant for KVM hosts
2020-12-09 11:19:13 +01:00
12125bf0b2
Add hosts entries for ejabberd private IPs 2020-12-08 20:31:01 +01:00
239b6aed51
Add API permissions for akkounts VMs
Using the zerotier IP, which is the same as the knife-zero host.
2020-12-08 20:00:31 +01:00
8e0a66184c
Use role for akkounts
Lets us search by role
2020-12-08 19:59:51 +01:00
Greg Karékinian
6c907419aa Set the VM name from the script argument 2020-12-08 17:10:40 +01:00
Greg Karékinian
8f304d00ce Remove unused kitchen.yml files 2020-12-08 16:34:24 +01:00
Greg Karékinian
94a34e4758 Add arguments for RAM and number of CPUs 2020-12-08 16:33:27 +01:00
Greg Karékinian
b3c1f81ec6 Set the description of the kosmos_zerotier cookbook 2020-12-08 16:26:14 +01:00
Greg Karékinian
6f7b493173 Create the base Ubuntu 20.04 cloud image with code 2020-12-08 16:25:32 +01:00
Greg Karékinian
176083497c Install the libvirt-daemon-system package
It creates the libvirt-qemu user
2020-12-08 16:25:04 +01:00
Greg Karékinian
89c8f42a46 Set the description for the kosmos_kvm cookbook 2020-12-08 16:03:18 +01:00
56d9144ad6
Disable ACME
Throws a warning when reloading the config, because it is enabled by
default, but not configured entirely. Disabling it explicitly removes
the warning.
2020-12-08 14:30:29 +01:00
02239dd9a8
Update ejabberd doc 2020-12-08 13:13:05 +01:00
Greg Karékinian
1837285b79 Add the kosmos_kvm recipe and the firewall rules
... to the KVM hosts, centaurus and draco

Refs #244
2020-12-04 16:33:18 +01:00
Greg Karékinian
ee7a117d63 Add initial kosmos_zerotier cookbook
For now it only includes the firewall rule

Refs #244
2020-12-04 16:29:22 +01:00
Greg Karékinian
e6b7794e20 Extract firewall definitions to their own recipe
This allows us to use them for KVM hosts as well. Until now we had set
up ufw rules manually on the two KVM hosts (draco and centaurus)

Refs #244
2020-12-04 16:27:42 +01:00
Greg Karékinian
9dbe5bcfcb Deploy a script to create new VMs
It uses `virt-install` with the official Ubuntu 20.04 cloud image as a
starting point, with cloud-init to add our SSH keys to the ubuntu user
and set up Zerotier.

USAGE: create_vm VMNAME

Closes #244
2020-12-04 16:21:52 +01:00
bc80540c14 Merge pull request 'Deploy new wormhole release on barnard' (#251) from chore/wormhole_barnard into master
Reviewed-on: #251
2020-11-27 12:25:01 +00:00
dace63b667
Remove akkounts recipe from barnard runlist
Must have been committed accidentally.
2020-11-27 13:22:29 +01:00
58c5fad2a7
Add new nickname config for wormhole 2020-11-27 13:22:09 +01:00
39ca70d64e Merge pull request 'Set up ejabberd-2 VM/node; add cluster configs to Chef' (#248) from chore/ejabberd-2_vm into master
Reviewed-on: #248
2020-11-26 14:47:33 +00:00
58854da648
Add erland_node fqdn to ejabberd node configs 2020-11-25 21:04:33 +01:00
137d90ed8a
Configure ejabberd on ejabberd-2 2020-11-25 21:03:16 +01:00
8c60279fe1
Add cluster configs to ejabberd recipe 2020-11-25 21:02:46 +01:00
7a1a5c03e3
Set up ejabberd-2 VM 2020-11-25 17:40:40 +01:00
8e067e8901 Merge pull request 'Enable ejabberd clustering' (#246) from feature/243-ejabberd_cluster into master
Reviewed-on: #246
2020-11-25 16:10:14 +00:00
Greg Karékinian
bbf01711f8 Add ejabberd-1 client and node file 2020-11-25 16:42:23 +01:00
Greg Karékinian
fbd71204c2 Use the production run list when no Chef environment was set 2020-11-25 16:41:43 +01:00
Greg Karékinian
613b316588 Add comment about needing to run Chef a second time...
... after the TLS certs are generated
2020-11-25 16:36:07 +01:00
Greg Karékinian
3a8af26b5f Remove firewall rule for an unused port 2020-11-25 16:36:07 +01:00
Greg Karékinian
23ca3552d2 Remove the absolute path of certbot to use the new package 2020-11-25 16:36:07 +01:00
Greg Karékinian
ddb706b61c Add a missing dependency on kosmos-dirsrv 2020-11-25 16:36:07 +01:00
Greg Karékinian
085bd8abd5 Move TURN port to a different range
It landed on a port used by PostgreSQL. Also switch STUN/TURN to TCP
because HAProxy does not support UDP.

Closes #240
2020-11-25 16:36:07 +01:00
Greg Karékinian
7636f6ed19 Move the Gandi DNS certbot hook to kosmos-ejabberd 2020-11-25 16:36:07 +01:00
Greg Karékinian
8b1f90c568 Use the same Erlang cookie to enable clustering
Refs #243
2020-11-25 16:35:37 +01:00
3da883864b Merge pull request 'Configure/deploy HTTP upload service for Kosmos Chat/XMPP' (#245) from feature/http_upload_service into master
Reviewed-on: #245
2020-11-25 09:46:47 +00:00
134493d2d6 Merge branch 'master' into feature/http_upload_service 2020-11-25 09:46:31 +00:00
f39f953b8a
Configure ejabberd nodes for HTTP upload service 2020-11-24 15:44:59 +01:00
0e29c930ed
Configure subdirectory level for upload.pm
This allows to post to per-domain subdirectories from XMPP clients.
2020-11-24 15:33:34 +01:00
0aef830aa3
Fix upload folder permissions
Uploads are failing with the current mode.
2020-11-23 20:50:01 +01:00
0bebdf7635
Do not require nginx from certbot recipe
In order to be able to use different nginx install recipes, we must not
require a specific one from this recipe.
2020-11-23 17:40:14 +01:00
6a89bb9d2e
Add node info for uploads-1
Runs uploads.kosmos.chat
2020-11-23 17:39:47 +01:00
9efb9cd78c
Configure/deploy HTTP upload service on uploads.kosmos.chat
https://xmpp.org/extensions/xep-0363.html

(Does not contain the config for ejabberd itself yet.)
2020-11-23 17:37:14 +01:00
89f5a81952 Merge pull request 'Configure/deploy new akkounts Rails app' (#242) from feature/akkounts into master
Reviewed-on: #242
2020-11-23 09:52:16 +00:00
c26fcd5b26
Remove obsolete manual daemon reload 2020-11-22 20:26:56 +01:00
0dc314b1e7
Add node data for akkounts-1 2020-11-21 15:12:39 +01:00
d384f69139
Configure/deploy new akkounts app 2020-11-21 15:12:31 +01:00
21be68feb5 Merge pull request 'Add CLI script for hashing LDAP passwords' (#239) from chore/ldap_hash_password_script into master
Reviewed-on: #239
2020-11-20 13:39:40 +00:00
b63c86b37f
Add CLI script for hashing LDAP passwords
Only takes a cleartext password and outputs a salted, hashed password
string for LDAP documents.
2020-11-20 14:36:25 +01:00
9470e62e3b Merge pull request 'Set up Drone CI with Gitea integration' (#236) from feature/235-drone_ci into master
Reviewed-on: #236
2020-11-19 13:47:43 +00:00
Greg Karékinian
df4c92b64e Update the centaurus node after adding drone to it 2020-11-19 12:59:24 +01:00
Greg Karékinian
d7e54bf7ce Add drone role 2020-11-19 12:59:24 +01:00
Greg Karékinian
ebf5f405f5 Initial kosmos_drone cookbook
Closes #235
2020-11-19 12:59:15 +01:00
9ba364ad7a Merge pull request 'Fix 389 Directory Server CLIs not working' (#234) from bugfix/install_lib389 into master
Reviewed-on: #234
2020-11-08 16:26:16 +00:00
ac49430521
Install lib389
Fixes 389 CLIs not working (e.g. `dsctl`).
2020-11-08 17:23:24 +01:00
f12cf704ac Merge pull request 'Update barnard.kosmos.org node data' (#232) from chore/update_node_info into master
Reviewed-on: #232
2020-10-30 09:01:13 +00:00
4c17d9ad53
Update barnard.kosmos.org node data 2020-10-30 10:00:23 +01:00
eaa3d78684 Merge pull request 'Remove hubot-rss-reader from hubots' (#231) from chore/remove_hubot-rss-reader into master
Reviewed-on: #231
2020-10-29 15:20:16 +00:00
f874d7f979
Remove hubot-rss-reader from hubots
Not available in latest hal8000 source anymore
2020-10-29 16:19:24 +01:00
96d0f7dd04 Merge pull request 'Update IPFS cookbook/software' (#230) from chore/update_go-ipfs into master
Reviewed-on: #230
2020-10-29 08:35:56 +00:00
af132c072d Merge branch 'master' into chore/update_go-ipfs 2020-10-29 08:35:36 +00:00
c06d530f62
Update ipfs-1 kernel version 2020-10-25 12:09:22 +01:00
2c368f0f10
Update IPFS cookbook 2020-10-25 12:09:01 +01:00
efd985f6ba Merge pull request 'Initial kosmos_discourse cookbook' (#223) from feature/222-discourse into master
Reviewed-on: #223
2020-10-23 10:12:12 +00:00
42a70962e8 Merge branch 'master' into feature/222-discourse 2020-10-23 10:11:05 +00:00
Greg Karékinian
255e43c680 Fix the Systemd unit for discourse
Switch the systemd unit to a oneshot type
2020-10-23 09:28:31 +02:00
0f5f84dba2 Merge pull request 'Send wiki notifications to new info chatroom (instead of main Kosmos room)' (#224) from chore/hubot_mediawiki_notifications into master
Reviewed-on: #224
2020-10-21 11:43:26 +00:00
71c8f6d91a Merge branch 'master' into chore/hubot_mediawiki_notifications 2020-10-21 11:43:08 +00:00
da7ff96937 Merge pull request 'Fix the undefined variable in the instance resource' (#225) from bugfix/dirsrv_certbot_undefined_var into master
Reviewed-on: #225
2020-10-21 08:12:48 +00:00
Greg Karékinian
5062392c71 Fix the undefined variable in the instance resource 2020-10-20 19:53:11 +02:00
4f5b005087
Send wiki notifications to new info XMPP room 2020-10-20 15:46:58 +02:00
69383a666b
Let hal8000 join new info@kosmos.chat room 2020-10-20 15:42:42 +02:00
Greg Karékinian
dc2fe38e10 Add the discourse role to centaurus 2020-10-20 12:22:07 +02:00
Greg Karékinian
07e6da4d33 Add a role for discourse 2020-10-20 12:22:07 +02:00
Greg Karékinian
429b609ac2 Initial kosmos_discourse cookbook
The systemd unit does not work

Refs #222
2020-10-20 12:21:53 +02:00
d1c9cf853f Merge pull request 'Set the autocreate permission for Mediawiki users' (#220) from bugfix/219-ldap_autocreate_wiki into master
Reviewed-on: #220
2020-10-06 13:56:05 +00:00
Greg Karékinian
7eaf177bb2 Set the autocreate permission for Mediawiki users
This allows LDAP sign ins to create an account automatically

Fixes #219
2020-10-06 15:51:01 +02:00
7d2374449a Merge pull request 'Do not install PostgreSQL with ejabberd by default' (#218) from bugfix/ejabberd_include_postgresql into master
Reviewed-on: #218
2020-09-25 18:12:07 +00:00
Greg Karékinian
2119c11243 Do not include kosmos-postgresql in kosmos-ejabberd default recipe
It will install PostgreSQL, and we do not want that on the ejabberd
server
2020-09-25 16:29:01 +02:00
fcd9e8ff74 Merge pull request 'Fix kosmos-ipfs not requiring nodejs/npm' (#215) from bugfix/kosmos-ipfs_recipe into master
Reviewed-on: #215
2020-09-24 15:47:52 +00:00
70363c1a93 Merge pull request 'Migrate IPFS gateway to new VM on draco.kosmos.org' (#216) from ops/ipfs_gateway_migration into master
Reviewed-on: #216
2020-09-24 15:47:25 +00:00
7c4af862b7
Add node config for new IPFS (gateway) VM 2020-09-24 17:41:24 +02:00
3d8d31c32f
Fix kosmos-ipfs not requiring nodejs/npm
If node isn't installed on a machine by something else before running
the kosmos-ipfs recipe, then it fails.
2020-09-24 17:39:28 +02:00
d2550d80c8 Merge pull request 'Switch Certbot to Snap package on Ubuntu 20.04+' (#211) from feature/certbot_snap into master
Reviewed-on: #211
2020-09-24 14:16:55 +00:00
Greg Karékinian
a8b303af4a Fix the search command for Kosmos LDAP users 2020-09-16 11:36:29 +02:00
104090d34e Merge pull request 'Add shell script for creating LDAP user accounts' (#214) from feature/add_user_script into master
Reviewed-on: #214
2020-09-16 09:34:34 +00:00
41319fc5bc
Add shell script for creating LDAP user accounts 2020-09-15 13:04:54 +02:00
be4d1ca7f4 Merge pull request 'Set up a testing VM on draco' (#212) from test_vm into master
Reviewed-on: #212
2020-09-06 12:02:26 +00:00
ee7a853b5c
Set up a testing VM on draco
Currently only has base recipe and nginx with certbot running.

https://test-2.kosmos.org/
2020-09-06 14:00:35 +02:00
a1a0d7e4c1
Switch Certbot to snap package on Ubuntu 20.04+
Needs only minor changes. Tested and running on wiki.kosmos.org already.
2020-09-06 13:46:06 +02:00
ded21fb009 Merge pull request 'Move wiki to new VM, update cookbooks and software' (#210) from feature/wiki_vm into master
Reviewed-on: #210
2020-09-06 11:45:30 +00:00
2d559ebd91
Update wiki node config
Just committing the changes after a successful run with letsencrypt also
working.
2020-09-06 13:43:07 +02:00
8dd146e95c
Remove obsolete mysql client install
This fails nowadays,and the client is already installed via the mysql
package in the first place.
2020-09-06 13:42:34 +02:00
b7e2a72369
Add missing changes for mediawiki upgrades 2020-09-05 23:43:28 +02:00
7af26d6ad3
Remove wiki role from andromeda 2020-09-05 20:59:07 +02:00
c646c3d5b4
Update mediawiki cookbook (Kosmos fork) 2020-08-30 18:03:44 +02:00
38c6a1ae15
Update mediawiki, install extensions from git repos 2020-08-30 17:59:45 +02:00
c9440800df
Update vendored cookbooks for mediawiki 2020-08-30 17:48:52 +02:00
d6ad68c50a
Add node config for new wiki VM 2020-08-30 17:34:02 +02:00
48f4a7e31d Merge pull request 'Create basic LND cookbook' (#206) from feature/lnd into master
Reviewed-on: #206
2020-08-30 15:32:43 +00:00
4b9e110ffd Merge branch 'master' into feature/lnd 2020-08-30 15:32:31 +00:00
43cfb95a57 Merge pull request 'Move bitcoin-core to VM' (#205) from feature/bitcoin_vm into master
Reviewed-on: #205
2020-08-30 15:29:35 +00:00
d5448e8240
Basic LND installation 2020-08-23 12:37:53 +02:00
0005f9ab7d
Add golang cookbook
Needs updating of ark and git cookbooks
2020-08-23 11:01:05 +02:00
217ab471ce
Moving bitcoin-core to VM 2020-08-22 23:16:11 +02:00
414a595719 Merge pull request 'Bitcoin (Core) cookbook' (#121) from feature/bitcoin_cookbook into master
Reviewed-on: #121
2020-08-20 17:17:30 +00:00
5c105f00d1
Use MIT license for bitcoin cookbook 2020-08-19 15:29:18 +02:00
1a8c3e4350
Suggest bitcoin source recipe for dev 2020-08-19 15:28:00 +02:00
c98be94404
Add rpcpassword support to bitcoin snap recipe 2020-08-18 14:44:23 +02:00
97ae73c987
Improve variable name 2020-08-18 14:38:16 +02:00
23588760fa
Add walletdir flag to bitcoind service start 2020-08-17 21:43:56 +02:00
b0daa3d463
Only store wallet in encrypted dir
Storing all chain data in encfs caused unsolvable issues with leveldb.
So now we're only storing wallet data in the encrypted dir.
2020-08-17 16:46:59 +02:00
d65363f964
Remove obsolete ulimit dep 2020-08-17 10:51:54 +02:00
9795e77fde
Bitcoin source recipe 2020-08-17 10:45:15 +02:00
4606773440
Update license note 2020-08-16 16:25:14 +02:00
bbbd0f7408
Change default username 2020-08-16 16:25:06 +02:00
476316e13b
Always use latest/stable channel for bitcoind snap 2020-08-16 16:20:43 +02:00
4889f40c6a
WIP 2020-08-16 16:18:01 +02:00
c8122a44f1
Add systemd service
Plus some refactoring
2020-08-16 16:14:18 +02:00
4a6a02c137
Use 0.19 stable channel
Instead of relying on the default channel
2020-08-16 16:14:18 +02:00
Greg Karékinian
e31f480f27
Fix the attribute name 2020-08-16 16:14:18 +02:00
Greg Karékinian
aedf7bcb62
Create the snap mount directory in the user's home 2020-08-16 16:14:18 +02:00
Greg Karékinian
069246cf41
Create the bitcoind user and its home directory 2020-08-16 16:14:18 +02:00
Greg Karékinian
1b9a4aad17
Work around a bug in Chef's snap_package resource
https://github.com/chef/chef/issues/8827

`snap install` returns 0 when a package is already installed, so no need
for a guard clause
2020-08-16 16:14:17 +02:00
09527e693b
WIP bitcoind config 2020-08-16 16:14:15 +02:00
47105b2a1c
Initial version of bitcoin cookbook 2020-08-16 16:13:39 +02:00
2c40ad4591 Merge pull request 'Increase size limit for Gitea uploads/attachments' (#199) from bugfix/188-attachment_size_limit into master
Reviewed-on: #199
2020-08-07 16:14:43 +00:00
9a28a03265
Increase size limit for Gitea uploads/attachments
The default limit in nginx is only 1MB. This increases it to 20MB.

fixes #188
2020-08-05 15:53:13 +02:00
f235aee17a Merge pull request 'Fix comet icon on maintenance page' (#198) from bugfix/61-maintenance_page_logo into master
Reviewed-on: #198
2020-08-02 19:05:18 +00:00
af0717a65b
Fix comet icon on maintenance page
The data URI declares an SVG source, but this was actually a PNG. Hence
the failure in Chrome. This change turns it into an actual inline SVG
and uses UTF8 encoding instead of base64, because SVG is just text anyway.

fixes #61
2020-08-02 21:00:10 +02:00
436bb8fcc1 Merge pull request 'Update Gitea to 1.12.3' (#197) from feature/189-gitea_1.12.3 into master
Reviewed-on: #197
2020-07-30 10:39:17 +00:00
Greg Karékinian
41fd1576ad Override the header template to remove the Roboto font
Using the system font instead
2020-07-30 12:33:09 +02:00
Greg Karékinian
924f67d8a8 Update Gitea to 1.12.3
Closes #189
2020-07-30 12:16:31 +02:00
Greg Karékinian
5e5bbe07dc Restart gitea after upgrading it 2020-07-30 12:16:04 +02:00
c68bf472d4 Merge pull request 'Upgrading centaurus to Ubuntu 20.04' (#196) from feature/195-centaurus_20.04 into master 2020-07-30 10:03:01 +00:00
Greg Karékinian
3f7894bd46 Run Chef again after upgrading centaurus to Ubuntu 20.04
Closes #195
2020-07-30 11:59:30 +02:00
Greg Karékinian
44b49ddd57 Upgrade nginx to the latest mainline version 2020-07-30 11:58:52 +02:00
3563b05932 Merge pull request 'Use the right variable for the TLS cert's domain in kosmos-dirsrv's instance resource' (#194) from bugfix/193-dirsrv_undefined_var into master 2020-07-22 14:16:53 +00:00
Greg Karékinian
d2126f6153 Use the right variable for the TLS cert's domain
`domain` was undefined. `new_resource.hostname` is ldap.kosmos.org and
is what we need

Fixes #193
2020-07-22 15:59:27 +02:00
9ec1fe1db4 Merge pull request 'Add PostgreSQL primary server support to the mastodon cookbook' (#187) from feature/186-postgresql_primary_mastodon into master 2020-07-07 15:45:54 +00:00
Greg Karékinian
4583421597 Connect to the PostgreSQL primary server instead of localhost
Move the db and user creation to its own recipe

Refs #186
2020-06-26 15:22:14 +02:00
Greg Karékinian
004a6913b4 Remove dependency to an old PostgreSQL in the Systemd unit
Refs #186
2020-06-26 15:22:05 +02:00
6adb910e1b Merge pull request 'Chef base role improvements' (#184) from feature/unattended_upgrades_and_vim into master 2020-06-22 13:07:20 +00:00
f55fc71765 Merge pull request 'Bootstrap draco.kosmos.org' (#185) from feature/175-draco_bootstrap into master 2020-06-22 13:06:41 +00:00
Greg Karékinian
fb8687b63c Add the postgresql_replica role to draco 2020-06-19 17:33:06 +02:00
Greg Karékinian
f7dfffd967 Add the kosmos_encfs recipe to draco 2020-06-19 17:33:06 +02:00
Greg Karékinian
8386dae46f Add the new Hetzner server, draco.kosmos.org 2020-06-19 17:33:06 +02:00
Greg Karékinian
84cf008bac Install vim 2020-06-19 17:30:02 +02:00
Greg Karékinian
b4357df471 Enable unattended-upgrades (security and updates repositories)
... with email notifications on failure and logging with syslog
2020-06-19 17:30:02 +02:00
Greg Karékinian
e7edb5a464 Update apt to 7.3.0
It now includes unattended-upgrades support
2020-06-19 17:30:02 +02:00
1b84009958 Merge pull request 'Add PostgreSQL primary support to the kosmos-ejabberd cookbook' (#181) from feature/180-ejabberd_pg_primary into master 2020-06-19 14:46:52 +00:00
01f8af6e38 Merge pull request 'Set the Gitea root URL to HTTPS' (#183) from bugfix/182-gitea_root_url into master 2020-06-15 12:39:29 +00:00
Greg Karékinian
5e483240c3 Set the Gitea root URL to HTTPS
It fixes U2F security keys support, that was broken because the protocol
did not match

Fixes #182
2020-06-12 17:22:34 +02:00
Greg Karékinian
ee9c241a4d Add a postgresql_client role
The role is empty but is used to explicitly define servers that have
access rights to all PostgreSQL databases and users
2020-06-12 16:54:58 +02:00
Greg Karékinian
6f696d7634 Define access rules in the PostgreSQL primary recipe
Access is done for the IP of a server for all users and all databases
for ejabberd and gitea
2020-06-11 18:20:04 +02:00
Greg Karékinian
26097a7584 Use the correct database name for the access rights 2020-06-11 09:00:50 +02:00
Greg Karékinian
1a6ce44758 Create a minimalist ejabberd role for development
No Let's Encrypt, no backups
2020-06-10 18:43:34 +02:00
Greg Karékinian
2c21d6255b Add PostgreSQL primary support to the kosmos-ejabberd cookbook
* Move the PostgreSQL user and database creation to a pg_db recipe
* Generate access rights for the ejabberd servers in the pg_db recipe
* Connect to the PostgreSQL primary instead of localhost

Refs #180
2020-06-10 18:38:40 +02:00
Greg Karékinian
091a46e972 Do not pass the pgsql_password variable to ejabberd.yml
The password is only used in the config files for the vhosts
2020-06-10 18:37:36 +02:00
81403b7cb9 Merge pull request 'Fix PostgreSQL replica config with encrypted data directory' (#179) from bugfix/postgres_issues into master 2020-06-10 14:04:58 +00:00
Greg Karékinian
a0db6adaf2 Pass the data_directory to the postgresql_server_conf resource
Previously we were passing it as an additional config, but it is set by
default. The last value was used, the custom one, so the server still
used the correct file
2020-06-10 14:41:07 +02:00
Greg Karékinian
e3e726097f Do not enable the postgresql@12-main service
We want it to run only once the encrypted data directory has been
mounted
2020-06-10 14:41:07 +02:00
Greg Karékinian
dba6629869 Use the attribute from the encfs recipe for the data directory 2020-06-10 14:41:03 +02:00
Greg Karékinian
229e9cfbd2 Add the kosmos_encfs recipe to centaurus 2020-06-10 14:40:01 +02:00
d88d3b07a5 Merge pull request 'Encrypt PostgreSQL data directory' (#166) from feature/pg_encfs into master 2020-06-08 15:02:58 +00:00
b662c04183
Finish initial encfs cookbook and postgres adaptations 2020-06-08 17:01:24 +02:00
379161eb1e
Fix postgres installation
Also, do not start at boot anymore, in favor of path-based activation.
2020-06-07 12:47:06 +02:00
353f2c13f1
Improve encfs cookbook
Fix some things, and prepare for path-based activation. Also, comment
the buggy initial dir creation and explain manual provisioning in README
for now.
2020-06-07 12:45:33 +02:00
8918452fc5
Use latest postgresql fork 2020-06-07 12:40:39 +02:00
501626de1f
Add encfs to Vagrantfile 2020-06-07 12:30:00 +02:00
4fe0e913f8
Use our own fork of the postgresql cookbook 2020-06-07 12:29:34 +02:00
bd99b76287
Use human-readable flag for encfs mount script
In case someone wants to see what it does without reading a manual in
the future.
2020-06-06 12:24:08 +02:00
Greg Karékinian
1e60722ec4 Create an initial encfs cookbook
Usage: Add the kosmos_encfs::default recipe to the run list of a node.
Creating the encrypted directory will keep it mounted. After a reboot,
start the encfs service and enter the password:

```
$ systemctl start encfs
encfs password:
```

For now postgresql@12-main is a hardcoded dependency of the encfs
Systemd unit that is automatically started once the user inputs the
correct password. This list of dependency will need to be different for
every server, based on the services it is running
2020-06-04 19:50:20 +02:00
Greg Karékinian
eded62a3ec Merge branch 'master' into feature/pg_encfs 2020-06-04 15:13:53 +02:00
db4792e836 Merge pull request 'Gitea fixes' (#174) from bugfix/147-gitea_fixes into master 2020-06-02 14:24:11 +00:00
Greg Karékinian
ccd49aefa4 Add Gitea to the run lists for Andromeda and Centaurus 2020-06-02 16:19:21 +02:00
Greg Karékinian
759fa52e03 Enable the certbot resource 2020-06-02 16:19:05 +02:00
Greg Karékinian
0f10723c81 Enable secure cookies 2020-06-02 16:18:48 +02:00
Greg Karékinian
55865c526c Add the Let's Encrypt hook dir to the config
Only enabled when there is no TLS cert. This is already part of the
certbot nginx vhost
2020-06-02 16:17:34 +02:00
Greg Karékinian
0c502580c2 Fix the condition for the Let's Encrypt cert in the template
The line contained an extra !
2020-06-02 16:16:30 +02:00
Greg Karékinian
27845525da Use the same JWT_SECRET as on our previous Gitea
A different one breaks 2FA
2020-06-02 12:12:59 +02:00
Greg Karékinian
c8e50fd226 Install git, it is a required dependency for Gitea
I didn't catch it because git is installed by default in the Vagrant box
I used to write the cookbook
2020-06-02 11:41:19 +02:00
Greg Karékinian
2d6c514257 Add the gitea role 2020-06-02 11:22:10 +02:00
8342298c89 Merge branch 'feature/147-gitea_cookbook' of kosmos/chef into master 2020-06-02 09:16:37 +00:00
Greg Karékinian
94330f2052 Comment out the COOKIE_SECURE config for now
We will enable it again after we have a valid TLS cert generated with
Let's Encrypt. It prevents logins using http, and we will need that as
an admin account
2020-05-28 18:43:31 +02:00
Greg Karékinian
baaae695af Merge branch 'master' into feature/147-gitea_cookbook 2020-05-28 15:44:44 +02:00
5b2d4f269d Merge branch 'bugfix/171-letsencrypt_resource' of kosmos/chef into master 2020-05-26 15:25:27 +00:00
Greg Karékinian
baa0739936 Add the backup recipe
Also move the Gitea data dir to an attribute
2020-05-26 15:21:26 +02:00
Greg Karékinian
3332a1b2e8 Write initial README 2020-05-26 15:21:07 +02:00
Greg Karékinian
210c76c479 Fix the name of the Let's Encrypt cert execute resource
The resource in the notification was invalid, missing the type of
resource (execute)

Fixes #171
2020-05-26 14:10:47 +02:00
6469d2286e Merge branch 'feature/zoom_options' of kosmos/chef into master 2020-05-25 15:52:41 +00:00
9dec1cfce8 Merge branch 'chore/mastodon_system_deps' of kosmos/chef into master 2020-05-25 15:50:58 +00:00
5fcb047505
Update Mastodon system dependencies
Needs new Ruby, and why not upgrade Yarn in the process. Running in
production.
2020-05-25 17:49:22 +02:00
f92b43e0f4
Configure Zoom meeting whitelist
So we only log contributions for actual Kosmos calls
2020-05-25 16:57:09 +02:00
Greg Karékinian
1f0e2ccbdd Move the binary URL to an attribute 2020-05-21 11:51:06 +02:00
Greg Karékinian
51d4d88568 Initial kosmos_gitea cookbook
The default recipe deploys the gitea binary, generates a config file and
our custom Kosmos label set. The service runs as a Systemd unit.

The pg_db recipe needs to run on the primary PostgreSQL (currently
andromeda).

The backup recipe is empty for now

Refs #147
2020-05-18 19:39:43 +02:00
Greg Karékinian
20cbc678bc Add a method that returns the PostgreSQL service 2020-05-18 19:38:37 +02:00
82f1e9863b Merge branch 'bugfix/160-cookbook_fixes' of kosmos/chef into master 2020-05-16 08:53:24 +00:00
Greg Karékinian
d0daa9cee7 Add the encryption password for encfs to the data bag 2020-05-15 18:46:24 +02:00
Greg Karékinian
d79cdf087b Move the PGPASS environment variable to the execute resource
That way it does not appear in the list of running processes while the
command is running
2020-05-15 18:45:12 +02:00
Greg Karékinian
31dc14e88c Fix the firewall rules for PostgreSQL
I got the source and destination mixed up.
2020-05-15 18:44:42 +02:00
Greg Karékinian
55b1cbc1d7 Encrypt the Postgresql data dir on the replica (centaurus)
encfs always runs a configuration assistant when creating a new
volume, so this needs to be done manually:

   systemctl stop postgresql@12-main
   mv /var/lib/postgresql /var/lib/postgresql.old
   encfs /var/lib/postgresql_encrypted /var/lib/postgresql --public
Pick p (paranoia mode) and enter the password from the data bag twice

   mv /var/lib/postgresql/* /var/lib/postgresql/
   systemctl start postgresql@12-main

This is running on centaurus and is mounted automatically on boot by a
system unit

Refs #129
2020-05-15 18:41:31 +02:00
4475af9204 Merge branch 'bugfix/enable_dirsrv' of kosmos/chef into master 2020-05-15 15:24:42 +00:00
Greg Karékinian
57f46c6c61 Merge branch 'master' into bugfix/enable_dirsrv 2020-05-15 17:24:04 +02:00
d900ca352c Merge branch 'bugfix/dirsrv_acis_really_fix' of kosmos/chef into master 2020-05-15 15:22:04 +00:00
Greg Karékinian
b4209fa294 Fix the invalid ACIs on initial creation (for real)
Follow-up to #156

I found another issue with the initial ACI creation, while creating a
fresh VM. I thought I had fixed it in #156 but I was wrong. This time
the ACIs are really set and the code runs successfully.

The ACIs are set on the suffix, so modifying it is needed

This won't be executed on a server that is already running, this is only
done on the initial setup
2020-05-15 14:05:35 +02:00
Greg Karékinian
10f0460fd5 Fix startup of the dirsrv@master Systemd unit on boot
The symlink created by Chef's service resource was wrong. Creating the
correct symlink fixes the automatic startup on boot
2020-05-15 13:54:34 +02:00
Greg Karékinian
bf60f9fca8 Add the Chef client public keys for andromeda and barnard 2020-05-14 15:34:10 +02:00
773aa3ddee
Update node configs 2020-05-14 15:29:25 +02:00
3c905dd51e Merge branch 'feature/160-postgres_replication' of kosmos/chef into master 2020-05-14 13:10:34 +00:00
Greg Karékinian
da278822f6 Use the new postgresql_primary role on andromeda 2020-05-14 15:09:33 +02:00
Greg Karékinian
18973fe4f6 Remove the deleted tls property from the resources 2020-05-14 15:09:15 +02:00
Greg Karékinian
fbf610a643 Merge branch 'master' into feature/160-postgres_replication 2020-05-14 15:06:00 +02:00
Greg Karékinian
069090bf44 Remove TODOs
Access rules will not be part of this cookbook, they need to be added to
the cookbooks that use a PostgreSQL database
2020-05-14 13:15:47 +02:00
Greg Karékinian
dd92d6cdb7 Remove deploying the root cert to clients from the README
We do not want to verify the root cert so this is not needed
2020-05-14 13:14:42 +02:00
Greg Karékinian
124ee5e6f3 Update the README 2020-05-14 12:36:20 +02:00
Greg Karékinian
0063776297 Remove unused dependencies 2020-05-13 19:11:00 +02:00
Greg Karékinian
8d2ab785fc Use a self-signed TLS certificate for PostgreSQL 2020-05-13 19:10:14 +02:00
Greg Karékinian
84cb3de4a0 Remove outdated comment
This was the case when the code lived inside of the custom resource
2020-05-13 19:04:12 +02:00
Greg Karékinian
f3f8e47cce Add replication_password to the postgresql credentials 2020-05-13 15:35:34 +02:00
Greg Karékinian
51b23c2f47 Add postgresql roles 2020-05-13 15:35:15 +02:00
Greg Karékinian
eb98aa1bac Clarify the firewall and client authentication rules 2020-05-12 16:04:58 +02:00
Greg Karékinian
0180da1aa6 Fix a typo in the README 2020-05-12 15:59:55 +02:00
Greg Karékinian
254f9020ae Enable firewall rules to allow primary/replica to connect 2020-05-12 12:10:10 +02:00
Greg Karékinian
80c7263a72 Upgrade PostgreSQL from 10 to 12
Refs #160
2020-05-11 18:26:57 +02:00
Greg Karékinian
b22a7e3c0f Update the postgresql upstream cookbook 2020-05-11 18:26:35 +02:00
Greg Karékinian
21119fff08 Add a custom resource to set up PostgreSQL 12
Supports both primary and replica. The access rules and firewall have to
be set up outside of the custom resource, so they are part of the
recipes instead

Refs #160
2020-05-11 18:23:11 +02:00
0aae86b545 Merge branch 'feature/turn_ip_config' of kosmos/chef into master 2020-05-02 12:43:38 +00:00
4448ec2173
Configure TURN properly
Was missing a couple of necessary properties, and is now using an
explicit port range for TURN, and opening those ports in UFW.
2020-05-02 14:07:14 +02:00
0bcb2597e8
Update node info 2020-05-02 12:41:30 +02:00
136fc84c4f Merge branch 'feature/159-ejabberd_stun_turn' of kosmos/chef into master 2020-05-02 10:01:15 +00:00
ef2fa2da72
Configure STUN/TURN
Configures built-in STUN/TURN support, and adds the new service discovery
module for it.
2020-05-01 16:25:38 +02:00
35a56aa221
Update version to 20.04 2020-05-01 14:55:13 +02:00
53d53f2375 Merge branch 'bugfix/152-remove_encryption_keys_tls' of kosmos/chef into master 2020-04-30 15:50:26 +00:00
ee13c3cbe9 Merge branch 'bugfix/153-update_ejabberd_20.03' of kosmos/chef into master 2020-04-21 13:38:53 +00:00
4c1879b84e Merge branch 'bugfix/ldap_invalid_aci' of kosmos/chef into master 2020-04-21 11:22:50 +00:00
Greg Karékinian
1c920a8cb2 Remove the encryption keys after TLS cert renewal
This is done with awk, this was the best way I found to perform the
multi-line deletion. It deletes both the AES AND 3DES sections

The keys will be recreated on service restart

https://access.redhat.com/documentation/en-us/red_hat_directory_server/9.0/html/administration_guide/ssl-and-attr-encryption

Closes #152
2020-04-20 19:11:34 +02:00
Greg Karékinian
5e3c8066f9 Add the missing certbot command to generate the LDAP TLS cert
This had been done manually on barnard. This will not be executed on
barnard again since the cert exists
2020-04-20 19:10:15 +02:00
Greg Karékinian
d01c9a4d0a Fix the name of the deploy certbot hook 2020-04-20 19:09:43 +02:00
Greg Karékinian
3ca8ab45da Fix the invalid ACIs on initial creation
This is only executed on initial creation of the instance, the
production one is using these fixed ACIs, this was only an issue with
the setup

The issue was the ACI was set at the wrong level
2020-04-20 19:00:28 +02:00
Greg Karékinian
db8bb44c8b Update ejabberd to 20.03
The download URL has changed, they removed a prefix

Closes #153
2020-04-20 14:53:08 +02:00
Greg Karékinian
f5dd2c7de9 Fix the command importing the schema on db creation
It had an extra }, but this only fails when creating the databases
2020-04-20 14:52:11 +02:00
f5bdc3e892 Merge branch 'doc/ldap' of kosmos/chef into master 2020-04-20 09:29:34 +00:00
73e87f8f45
Improve LDAP example command
We should not log passwords in bash history files. This change will
prompt the user for the password instead.
2020-04-19 13:01:39 +02:00
4f1bf768ee Merge branch 'feature/hal8000_zoom' of kosmos/chef into master 2020-04-16 20:19:30 +00:00
cc4c8fb903
Add hubot-kredits Zoom config 2020-04-16 17:52:28 +02:00
468 changed files with 13070 additions and 6396 deletions

View File

@ -26,5 +26,5 @@ knife[:automatic_attribute_whitelist] = %w[
chef_packages
]
knife[:default_attribute_whitelist] = []
knife[:normal_attribute_whitelist] = ['knife_zero']
knife[:normal_attribute_whitelist] = ['knife_zero','kosmos-ejabberd']
knife[:override_attribute_whitelist] = []

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
/.chef/encrypted_data_bag_secret
.chef/chef_guid
/.bundle/
/.vagrant/
/.kitchen
/nodes/vagrant-node.json

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "site-cookbooks/postgresql"]
path = site-cookbooks/postgresql
url = git@github.com:67P/postgresql.git

1
.ruby-version Normal file
View File

@ -0,0 +1 @@
chef-workstation

View File

@ -3,15 +3,14 @@
source 'https://supermarket.chef.io'
cookbook 'mediawiki',
git: 'https://github.com/67P/mediawiki-cookbook.git',
ref: '55a4680ee298199fa5f7fa51b5c589fbfa52eed0'
git: 'https://github.com/67P/mediawiki-cookbook.git',
ref: 'nginx'
cookbook 'redis',
git: 'https://github.com/phlipper/chef-redis.git',
ref: 'v0.5.6'
git: 'https://github.com/phlipper/chef-redis.git',
ref: 'v0.5.6'
cookbook 'postfix', '= 5.0.2'
cookbook 'php-fpm', '~> 0.8.0'
cookbook 'php', '~> 6.1.1'
cookbook 'composer', '~> 2.6.1'
cookbook 'php', '~> 8.0.0'
cookbook 'composer', '~> 2.7.0'
cookbook 'poise-ruby-build', '~> 1.1.0'
cookbook 'application', '~> 5.2.0'
cookbook 'application_javascript', '~> 1.0.0'
@ -29,15 +28,15 @@ cookbook 'nginx', '= 9.0.0'
# Remove when cookbooks stop depending on it, the build_essential resource is
# part of Chef 14 (https://docs.chef.io/resource_build_essential.html)
cookbook 'build-essential', '~> 8.2.1'
cookbook 'mysql', '~> 8.5.1'
cookbook 'postgresql', '= 7.1.4'
cookbook 'apt', '~> 7.0.0'
cookbook 'git', '= 6.0.0'
cookbook 'hostsfile', '= 2.4.5'
cookbook 'mysql', '~> 8.7.3'
# cookbook 'postgresql', '= 7.1.8'
cookbook 'apt', '~> 7.3.0'
cookbook 'git', '~> 10.0.0'
cookbook 'hostsfile', '~> 3.0.1'
cookbook 'ohai', '~> 5.2.5'
cookbook 'nodejs', '~> 5.0.0'
cookbook 'nodejs', '~> 7.3.1'
cookbook 'timezone_iii', '= 1.0.4'
cookbook 'ark', '= 3.1.0'
cookbook 'ark', '>= 5.0.0'
cookbook 'logrotate', '= 2.2.0'
cookbook 'openssl', '~> 8.5.5'
cookbook 'ntp', '= 3.4.0'
@ -47,9 +46,10 @@ cookbook 'compat_resource', '= 12.19.0'
cookbook 'homebrew', '= 3.0.0'
cookbook 'mariadb', '= 0.3.1'
cookbook 'ipfs',
git: 'https://gitea.kosmos.org/kosmos/ipfs-cookbook.git',
ref: 'v0.4.1'
git: 'https://gitea.kosmos.org/kosmos/ipfs-cookbook.git',
ref: 'v0.7.0'
cookbook 'elasticsearch', '= 4.2.0'
cookbook 'java', '~> 4.3.0'
cookbook 'ulimit', '~> 1.0.0'
cookbook 'golang', '~> 4.1.0'
cookbook 'zerotier', '~> 1.0.7'

View File

@ -3,37 +3,37 @@ DEPENDENCIES
application (~> 5.2.0)
application_git (= 1.1.0)
application_javascript (~> 1.0.0)
apt (~> 7.0.0)
ark (= 3.1.0)
apt (~> 7.3.0)
ark (>= 5.0.0)
build-essential (~> 8.2.1)
chef-sugar (= 3.3.0)
compat_resource (= 12.19.0)
composer (~> 2.6.1)
composer (~> 2.7.0)
elasticsearch (= 4.2.0)
firewall (~> 2.6.3)
git (= 6.0.0)
git (~> 10.0.0)
golang (~> 4.1.0)
homebrew (= 3.0.0)
hostname (= 0.4.2)
hostsfile (= 2.4.5)
hostsfile (~> 3.0.1)
ipfs
git: https://gitea.kosmos.org/kosmos/ipfs-cookbook.git
revision: 5c31191ff8571bc8425375fbf938913ac64aa2ee
ref: v0.4.1
revision: d7c25b6ce5fa490b6de3529fdc163fb64f1ece8a
ref: v0.7.0
java (~> 4.3.0)
logrotate (= 2.2.0)
mariadb (= 0.3.1)
mediawiki
git: https://github.com/67P/mediawiki-cookbook.git
revision: 55a4680ee298199fa5f7fa51b5c589fbfa52eed0
ref: 55a4680
mysql (~> 8.5.1)
revision: 78641e53635ba6cbd4a2a51fd597adb8fef1e8ad
ref: nginx
mysql (~> 8.7.3)
nginx (= 9.0.0)
nodejs (~> 5.0.0)
nodejs (~> 7.3.1)
ntp (= 3.4.0)
ohai (~> 5.2.5)
openssl (~> 8.5.5)
php (~> 6.1.1)
php-fpm (~> 0.8.0)
php (~> 8.0.0)
poise (~> 2.8.2)
poise-archive (~> 1.5.0)
poise-javascript
@ -44,7 +44,6 @@ DEPENDENCIES
poise-ruby-build (~> 1.1.0)
poise-service (~> 1.5.2)
postfix (= 5.0.2)
postgresql (= 7.1.4)
redis
git: https://github.com/phlipper/chef-redis.git
revision: 7476279fc9c8727f082b8d77b5e1922dc2ef437b
@ -52,6 +51,7 @@ DEPENDENCIES
timezone_iii (= 1.0.4)
ulimit (~> 1.0.0)
users (~> 5.3.1)
zerotier (~> 1.0.7)
GRAPH
apache2 (3.3.0)
@ -67,21 +67,19 @@ GRAPH
poise (~> 2.0)
poise-javascript (~> 1.0)
poise-service (~> 1.0)
apt (7.0.0)
ark (3.1.0)
build-essential (>= 0.0.0)
apt (7.3.0)
ark (5.0.0)
seven_zip (>= 0.0.0)
windows (>= 0.0.0)
build-essential (8.2.1)
mingw (>= 1.1)
seven_zip (>= 0.0.0)
chef-sugar (3.3.0)
chocolatey (3.0.0)
compat_resource (12.19.0)
composer (2.6.1)
composer (2.7.0)
apt (>= 0.0.0)
php (>= 0.0.0)
windows (>= 0.0.0)
dmg (4.1.1)
elasticsearch (4.2.0)
apt (>= 0.0.0)
ark (>= 0.0.0)
@ -89,15 +87,14 @@ GRAPH
yum (>= 0.0.0)
firewall (2.6.5)
chef-sugar (>= 0.0.0)
git (6.0.0)
build-essential (>= 0.0.0)
dmg (>= 0.0.0)
yum-epel (>= 0.0.0)
git (10.0.0)
golang (4.1.0)
ark (~> 5.0)
homebrew (3.0.0)
hostname (0.4.2)
hostsfile (>= 0.0.0)
hostsfile (2.4.5)
ipfs (0.4.1)
hostsfile (3.0.1)
ipfs (0.7.0)
ark (>= 0.0.0)
java (4.3.0)
homebrew (>= 0.0.0)
@ -111,24 +108,21 @@ GRAPH
apache2 (>= 0.0.0)
nginx (>= 0.0.0)
php (>= 0.0.0)
php-fpm (>= 0.0.0)
mingw (2.1.0)
seven_zip (>= 0.0.0)
mysql (8.5.1)
mysql (8.7.3)
nginx (9.0.0)
build-essential (>= 5.0)
ohai (>= 4.1.0)
yum-epel (>= 0.0.0)
nodejs (5.0.0)
nodejs (7.3.1)
ark (>= 2.0.2)
build-essential (>= 0.0.0)
chocolatey (>= 3.0)
ntp (3.4.0)
ohai (5.2.5)
openssl (8.5.5)
php (6.1.1)
build-essential (>= 5.0)
php (8.0.0)
yum-epel (>= 0.0.0)
php-fpm (0.8.0)
poise (2.8.2)
poise-archive (1.5.0)
poise (~> 2.6)
@ -154,7 +148,6 @@ GRAPH
poise-service (1.5.2)
poise (~> 2.0)
postfix (5.0.2)
postgresql (7.1.4)
redis (0.5.6)
apt (>= 0.0.0)
seven_zip (3.1.1)
@ -165,3 +158,5 @@ GRAPH
windows (6.0.0)
yum (5.1.0)
yum-epel (3.3.0)
zerotier (1.0.7)
ohai (>= 0.0.0)

View File

@ -1,7 +1,3 @@
source 'https://rubygems.org'
gem 'chef', '~> 15.3.14'
gem 'berkshelf', '~> 7.0'
gem 'knife-zero'
gem 'cookstyle'
gem 'test-kitchen'

View File

@ -3,253 +3,251 @@ GEM
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
ast (2.4.0)
bcrypt_pbkdf (1.0.1)
berkshelf (7.0.8)
chef (>= 13.6.52)
chef-config
cleanroom (~> 1.0)
concurrent-ruby (~> 1.0)
minitar (>= 0.6)
mixlib-archive (>= 0.4, < 2.0)
mixlib-config (>= 2.2.5)
mixlib-shellout (>= 2.0, < 4.0)
octokit (~> 4.0)
retryable (>= 2.0, < 4.0)
solve (~> 4.0)
thor (>= 0.20)
builder (3.2.3)
chef (15.3.14)
builder (3.2.4)
chef (17.2.29)
addressable
bcrypt_pbkdf (~> 1.0)
bundler (>= 1.10)
chef-config (= 15.3.14)
chef-config (= 17.2.29)
chef-utils (= 17.2.29)
chef-vault
chef-zero (>= 14.0.11)
diff-lcs (~> 1.2, >= 1.2.4)
ed25519 (~> 1.2)
diff-lcs (>= 1.2.4, < 1.4.0)
erubis (~> 2.7)
ffi (~> 1.9, >= 1.9.25)
ffi-libarchive
ffi (>= 1.5.0)
ffi-libarchive (~> 1.0, >= 1.0.3)
ffi-yajl (~> 2.2)
highline (>= 1.6.9, < 2)
iniparse (~> 1.4)
license-acceptance (~> 1.0, >= 1.0.5)
inspec-core (~> 4.23)
license-acceptance (>= 1.0.5, < 3)
mixlib-archive (>= 0.4, < 2.0)
mixlib-authentication (~> 2.1)
mixlib-authentication (>= 2.1, < 4)
mixlib-cli (>= 2.1.1, < 3.0)
mixlib-log (>= 2.0.3, < 4.0)
mixlib-shellout (>= 3.0.3, < 4.0)
net-sftp (~> 2.1, >= 2.1.2)
net-ssh (>= 4.2, < 6)
net-ssh-multi (~> 1.2, >= 1.2.1)
ohai (~> 15.0)
mixlib-shellout (>= 3.1.1, < 4.0)
net-sftp (>= 2.1.2, < 4.0)
ohai (~> 17.0)
plist (~> 3.2)
proxifier (~> 1.0)
syslog-logger (~> 1.6)
train-core (~> 3.0)
train-winrm
tty-screen (~> 0.6)
uuidtools (~> 2.1.5)
chef-config (15.3.14)
train-core (~> 3.2, >= 3.2.28)
train-winrm (>= 0.2.5)
uuidtools (>= 2.1.5, < 3.0)
chef-config (17.2.29)
addressable
chef-utils (= 17.2.29)
fuzzyurl
mixlib-config (>= 2.2.12, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
tomlrb (~> 1.2)
chef-zero (14.0.13)
chef-telemetry (1.0.29)
chef-config
concurrent-ruby (~> 1.0)
chef-utils (17.2.29)
concurrent-ruby
chef-vault (4.1.0)
chef-zero (15.0.4)
ffi-yajl (~> 2.2)
hashie (>= 2.0, < 4.0)
hashie (>= 2.0, < 5.0)
mixlib-log (>= 2.0, < 4.0)
rack (~> 2.0, >= 2.0.6)
uuidtools (~> 2.1)
cleanroom (1.0.0)
concurrent-ruby (1.1.5)
cookstyle (5.7.0)
rubocop (= 0.72.0)
webrick
coderay (1.1.3)
concurrent-ruby (1.1.9)
diff-lcs (1.3)
ed25519 (1.2.4)
equatable (0.6.1)
erubi (1.10.0)
erubis (2.7.0)
faraday (0.17.0)
faraday (1.4.2)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
multipart-post (>= 1.2, < 3)
ffi (1.11.1)
ffi-libarchive (0.4.10)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.1.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
ffi (1.15.1)
ffi-libarchive (1.0.17)
ffi (~> 1.0)
ffi-yajl (2.3.1)
libyajl2 (~> 1.2)
ffi-yajl (2.4.0)
libyajl2 (>= 1.2)
fuzzyurl (0.9.0)
gssapi (1.3.0)
gssapi (1.3.1)
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
hashie (3.6.0)
highline (1.7.10)
hashie (4.1.0)
httpclient (2.8.3)
iniparse (1.4.4)
iniparse (1.5.0)
inspec-core (4.37.25)
addressable (~> 2.4)
chef-telemetry (~> 1.0, >= 1.0.8)
faraday (>= 0.9.0, < 1.5)
faraday_middleware (~> 1.0)
hashie (>= 3.4, < 5.0)
license-acceptance (>= 0.2.13, < 3.0)
method_source (>= 0.8, < 2.0)
mixlib-log (~> 3.0)
multipart-post (~> 2.0)
parallel (~> 1.9)
parslet (>= 1.5, < 2.0)
pry (~> 0.13)
rspec (>= 3.9, < 3.11)
rspec-its (~> 1.2)
rubyzip (>= 1.2.2, < 3.0)
semverse (~> 3.0)
sslshake (~> 1.2)
thor (>= 0.20, < 2.0)
tomlrb (>= 1.2, < 2.1)
train-core (~> 3.0)
tty-prompt (~> 0.17)
tty-table (~> 0.10)
ipaddress (0.8.3)
jaro_winkler (1.5.3)
json (2.2.0)
knife-zero (2.1.0)
json (2.5.1)
knife-zero (2.3.2)
chef (>= 15.0)
libyajl2 (1.2.0)
license-acceptance (1.0.13)
libyajl2 (2.1.0)
license-acceptance (2.1.13)
pastel (~> 0.7)
tomlrb (~> 1.2)
tty-box (~> 0.3)
tty-prompt (~> 0.18)
tomlrb (>= 1.2, < 3.0)
tty-box (~> 0.6)
tty-prompt (~> 0.20)
little-plugger (1.1.4)
logging (2.2.2)
logging (2.3.0)
little-plugger (~> 1.1)
multi_json (~> 1.10)
minitar (0.9)
mixlib-archive (1.0.1)
multi_json (~> 1.14)
method_source (1.0.0)
mixlib-archive (1.1.7)
mixlib-log
mixlib-authentication (2.1.1)
mixlib-cli (2.1.1)
mixlib-config (3.0.1)
mixlib-authentication (3.0.10)
mixlib-cli (2.1.8)
mixlib-config (3.0.9)
tomlrb
mixlib-install (3.11.21)
mixlib-shellout
mixlib-versioning
thor
mixlib-log (3.0.1)
mixlib-shellout (3.0.7)
mixlib-versioning (1.2.7)
molinillo (0.6.6)
multi_json (1.13.1)
mixlib-log (3.0.9)
mixlib-shellout (3.2.5)
chef-utils
multi_json (1.15.0)
multipart-post (2.1.1)
necromancer (0.5.0)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (5.2.0)
net-ssh-gateway (2.0.0)
net-ssh (>= 4.0.0)
net-ssh-multi (1.2.1)
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-sftp (3.0.0)
net-ssh (>= 5.0.0, < 7.0.0)
net-ssh (6.1.0)
nori (2.6.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
ohai (15.3.1)
chef-config (>= 12.8, < 16)
ohai (17.1.0)
chef-config (>= 14.12, < 18)
chef-utils (>= 16.0, < 18)
ffi (~> 1.9)
ffi-yajl (~> 2.2)
ipaddress
mixlib-cli (>= 1.7.0)
mixlib-config (>= 2.0, < 4.0)
mixlib-log (>= 2.0.1, < 4.0)
mixlib-shellout (>= 2.0, < 4.0)
mixlib-shellout (~> 3.2, >= 3.2.5)
plist (~> 3.1)
systemu (~> 2.6.4)
train-core
wmi-lite (~> 1.0)
parallel (1.18.0)
parser (2.6.5.0)
ast (~> 2.4.0)
pastel (0.7.3)
equatable (~> 0.6)
parallel (1.20.1)
parslet (1.8.2)
pastel (0.8.0)
tty-color (~> 0.5)
plist (3.5.0)
plist (3.6.0)
proxifier (1.0.3)
public_suffix (4.0.1)
rack (2.0.7)
rainbow (3.0.0)
retryable (3.0.4)
rubocop (0.72.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.6)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
ruby-progressbar (1.10.1)
rubyntlm (0.6.2)
rubyzip (1.3.0)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
rack (2.2.3)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.10.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
ruby2_keywords (0.0.4)
rubyntlm (0.6.3)
rubyzip (2.3.0)
semverse (3.0.0)
solve (4.0.2)
molinillo (~> 0.6)
semverse (>= 1.1, < 4.0)
strings (0.1.6)
strings-ansi (~> 0.1)
unicode-display_width (~> 1.5)
sslshake (1.3.1)
strings (0.2.1)
strings-ansi (~> 0.2)
unicode-display_width (>= 1.5, < 3.0)
unicode_utils (~> 1.4)
strings-ansi (0.1.0)
strings-ansi (0.2.0)
syslog-logger (1.6.8)
systemu (2.6.5)
test-kitchen (2.3.3)
bcrypt_pbkdf (~> 1.0)
ed25519 (~> 1.2)
license-acceptance (~> 1.0, >= 1.0.11)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 4.0)
net-scp (>= 1.1, < 3.0)
net-ssh (>= 2.9, < 6.0)
net-ssh-gateway (>= 1.2, < 3.0)
thor (~> 0.19)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (0.20.3)
tomlrb (1.2.8)
train-core (3.1.3)
thor (1.1.0)
tomlrb (1.3.0)
train-core (3.7.2)
addressable (~> 2.5)
ffi (!= 1.13.0)
json (>= 1.8, < 3.0)
mixlib-shellout (>= 2.0, < 4.0)
net-scp (>= 1.2, < 3.0)
net-ssh (>= 2.9, < 6.0)
train-winrm (0.2.5)
winrm (~> 2.0)
net-scp (>= 1.2, < 4.0)
net-ssh (>= 2.9, < 7.0)
train-winrm (0.2.12)
winrm (>= 2.3.6, < 3.0)
winrm-elevated (~> 1.2.2)
winrm-fs (~> 1.0)
tty-box (0.4.1)
pastel (~> 0.7.2)
strings (~> 0.1.6)
tty-box (0.7.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-cursor (~> 0.7)
tty-color (0.5.0)
tty-cursor (0.7.0)
tty-prompt (0.19.0)
necromancer (~> 0.5.0)
pastel (~> 0.7.0)
tty-reader (~> 0.6.0)
tty-reader (0.6.0)
tty-color (0.6.0)
tty-cursor (0.7.1)
tty-prompt (0.23.1)
pastel (~> 0.8)
tty-reader (~> 0.8)
tty-reader (0.9.0)
tty-cursor (~> 0.7)
tty-screen (~> 0.7)
wisper (~> 2.0.0)
tty-screen (0.7.0)
unicode-display_width (1.6.0)
tty-screen (~> 0.8)
wisper (~> 2.0)
tty-screen (0.8.1)
tty-table (0.12.0)
pastel (~> 0.8)
strings (~> 0.2.0)
tty-screen (~> 0.8)
unicode-display_width (2.0.0)
unicode_utils (1.4.0)
uuidtools (2.1.5)
winrm (2.3.2)
uuidtools (2.2.0)
webrick (1.7.0)
winrm (2.3.6)
builder (>= 2.1.2)
erubis (~> 2.7)
erubi (~> 1.8)
gssapi (~> 1.2)
gyoku (~> 1.0)
httpclient (~> 2.2, >= 2.2.0.2)
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
winrm-elevated (1.1.1)
rubyntlm (~> 0.6.0, >= 0.6.3)
winrm-elevated (1.2.3)
erubi (~> 1.8)
winrm (~> 2.0)
winrm-fs (~> 1.0)
winrm-fs (1.3.2)
erubis (~> 2.7)
winrm-fs (1.3.5)
erubi (~> 1.8)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
rubyzip (~> 2.0)
winrm (~> 2.0)
wisper (2.0.0)
wmi-lite (1.0.2)
wisper (2.0.1)
wmi-lite (1.0.5)
PLATFORMS
ruby
x86_64-darwin-18
DEPENDENCIES
berkshelf (~> 7.0)
chef (~> 15.3.14)
cookstyle
knife-zero
test-kitchen
BUNDLED WITH
1.17.3

View File

@ -1,19 +1,38 @@
### Install dependencies
### Install Chef Workstation
* macOS, Windows, RHEL, Ubuntu: https://docs.chef.io/workstation/install_workstation/
* Arch Linux: https://aur.archlinux.org/packages/chef-workstation
#### rbenv
If you use rbenv to manage Ruby versions on your system, install the
(rbenv-chef-workstation)[https://github.com/docwhat/rbenv-chef-workstation]
plugin.
### Install gem dependencies
bundle install
### Run Chef Solo
knife zero converge name:dev.kosmos.org
### Update Chef Client on a server:
knife zero converge name:dev.kosmos.org --client-version 15.3.14
### Bootstrap a new server
knife zero bootstrap root@dev.kosmos.org --run-list "recipe[kosmos-base],..." -j '{"example_cookbook":{"memory_max":"256M"}}' --secret-file .chef/encrypted_data_bag_secret
### Bootstrap a new VM
knife zero bootstrap ubuntu@zerotier-ip-address -x ubuntu --sudo --run-list "recipe[kosmos-base]" --secret-file .chef/encrypted_data_bag_secret
### Run Chef Zero
knife zero converge name:dev.kosmos.org
### Run Chef Zero on a VM
knife zero converge -a knife_zero.host name:vm-name-23
### Update Chef Client on a server:
knife zero converge name:dev.kosmos.org --client-version 15.3.14
### Managing cookbooks
Cookbooks are managed via Berkshelf. Run `berks --help` for command help.

2
Vagrantfile vendored
View File

@ -94,6 +94,8 @@ Vagrant.configure(2) do |config|
chef.encrypted_data_bag_secret_key_path = '.chef/encrypted_data_bag_secret'
chef.environment = 'development'
chef.add_recipe 'kosmos-base'
chef.add_recipe 'kosmos_encfs'
# chef.add_recipe 'kosmos-bitcoin::source'
# chef.add_recipe 'kosmos-mediawiki'
# chef.add_recipe 'kosmos-wordpress'
# chef.add_recipe 'kosmos-ejabberd'

4
clients/akkounts-1.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "akkounts-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0LKcqydrG3zgtmThEg+q\nOcw8QvIB2usMkF4kNMFeqhhdr2q/AtRcq4RJ0u0MiZbkHduGWfG9QZpjmbFZcEke\nURJbddqSDPHFAtrK2+BpcMqNN/mSp59f4MJf6wdLnBoeZCF5pCCXibyj+/754Ly+\nEJNiB1sf1Lu82YW2YM7iLhOLk1QQD2DTfBGbj9swdPrgKK+1npQ4A7O8sOB5gDjb\n9QVLCvCEoYFi+9is0vw/YryEr6tfnNw+CroP2uDfyVfWznF8oPUuttAcHgqDA3CV\n7lCRk9yVt1FKwuq2lFcsMqZ7wO4EoxpzCz/XTnpFPFvgeVinyXjSPsQCBAdwJe5T\nWQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -0,0 +1,4 @@
{
"name": "barnard.kosmos.org",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5Rr+3giLkr0xqZPRPn9Z\ngxvmAaUo6VSs1qnMfznNNN/CGCYett0ndEJp4wI8xp2fq75b2TSm4jqhqjtgYVVD\nEeSOKTZEnoE7YSssodGTAK5YnrVIPNyWd61Ih/NkHzCjlcuVX6sJD7z/pgK+WMao\nAAxzMrefvHALFBmJIxbugakru/nvDcQeV8DOF+UjzsO5CTC0BUzCFeXBG7HD3W+6\nP2wQlMKteM9uQU6Agx7XegeWS2Lfnxg1em5TNbw1PbLofROwr1pCUPfVzQ0CAVxm\nXLzmA2xtMqCT2j83DU9WleZPYiS0rg+r9T1jsDX0TyH4NTV8gO2SJ9BMUNcX+3Ox\nmQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/bitcoin-2.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "bitcoin-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuNy0NZUQo93anCe3YkGI\nGTzHnH1SUqc7315ShEEgp9GC9ghEaFe9YX6fdYma4KLfehi1LNoYhibpaVvF6qMB\n5p2pCk4eM9EjRYve3byqt0ZJZzLEcR4zfoiqJHLMBfB1tDiGj3BbahY6LJ0WH/q2\nTek61LOp2nB/9HYSIRlYz8EJtt2YyjV57oqQD5rnEDCJyBf34VI81SZFBeSHCeHQ\nUDALdnkro840FHfFKMUTdUmtpq/bhBA13EkFqVObnc0xZQP3eW6pRNeZ5oUpBLK3\nbAXahd8YEW6c6XerK3JqROs/l2ZRXmfmOMB5RjzmTEuCDsZFuCnJDQEY1nWCyUmu\nhQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -0,0 +1,4 @@
{
"name": "centaurus.kosmos.org",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsVV0j8DQSlefAAAmafjx\nyT1j1idLQF0oltTp2p4jFEsnEdFeP4Plpluy+detra1gM9sBBBuvRKGt8NP+Yoc7\nbnn7qU13E/nWUQh9n15+jjgUirXg7CxluKfj2VvsdchJRIvzDwwZz5sqITiGG7/S\n2r2KBBBnuGlGShQJZhhcLW4P+3YgxW8DUgUsRdvreVuvF1hcnaSymldfos1CqYL8\nawtsZ2rtdZHmZxfguXl91WBCu2OxsT13i3kInnDQsFB0tYKq+TFSLAHxneKTYPRW\ngYgP9RSBZ51iQ+6R1CenYsr4SePVCmwaZGb8bmd0QLvGKlBhjX29a5bE5tjzeoBD\nuwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -0,0 +1,4 @@
{
"name": "draco.kosmos.org",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqJiREO7WJyKWzOltXREs\n6bCMBzHTeyBSLxK/50xPvk43A8e+8qW1V52oO/uQkHh8YJ8BCDdSsWTNTudTuMhm\nEFLYP7n+ESYyz7nBgcwLX19lSo3dGnyuQBwlno6W/F1uEdTxfY6MtxJdiPZQDIt0\noijEwOF4ZhA5A+kqx6fpp+rX48r9wdidjdhrJimQixL0SsJFkoStc17BxrnqPpv9\n/sd4xYKgK9hEmEovhghBN3ULsxDOj63cGmM4uWLjbO4ZpL6g1lZRJR5kmcziL9KH\n23M7ShaJu90PnPiFSCUFgNN24zA7aKTkKulNs4g2OYovWVG/z8WglGqHNY83dBP0\nLwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/ejabberd-1.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "ejabberd-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtoVmQAEmmAWjjzi5X8Ia\n9sl2aH8Lh0AsckM0aE3hvw9lGfbNCPpYWrr0uh7R6/+13Z0OghrT3yDAZ+XfH39Y\nuGomazTzSMMOEofjepo+nXSgq4meFfX5vobYG7rpBdz1EsIT1bElHduItA2zsw9J\nFpXtGd4BjumMq1VykSTA+QaEE8byes/+groQTtXPqXf5gJMxyGlh4SU0MzmkGHaW\n8c9BPCQrV0CMiuGOGJ5mZ28HajbvSg3+bpgwThh3M5uQaQ6on1N2pvJuBypUySS6\nyc4TauocUcUsULYXq9wM8/rqDYsUah0PR0WSiOi90m5thGeBchFAmhdCvrS34FlR\nVQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/ejabberd-2.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "ejabberd-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAudueTsPYnRXRu/rmMGZe\nI7LdyrWKdY9FJaRhkXR5J9Yb8QnIcDS7ZXDJsVhyQW8pZ2DuaIs5dmGYvRtmx0ol\nqHTEel01Q3/xI1blJoq4uRm639PB5M9dSJ0w+s6P5zj7rbFKpvMBYxBSK6z+gXIc\n/L1ayJ6JOssX5/tEvcvx/d4GIxof/Q+puACAXawx7W88Wl7yYWdBQ78uTPHzuMyB\n8BRYz24tki/O1fa9JijW32d3EELD0EccI3iJ+/CR4BFEEM2QdDczY/Q6Ny7h7inH\n/TdU246nvtJIx7bAZHmDIDva8YPtL27RIOQ3JqBBe7prQP5Q9MBGPyCXWAglj99a\n6QIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/nodejs-1.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "nodejs-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9L4BQgLEpQSSbSLwXOab\nfFey5VSk8ynDmj2I9sOpPMIXkXpmbONkyXqZ4CqKrMRtesXAg1F1lIwzE/WJy0wP\n9CRhEgnclHRHE3TVqWt8dC6+u5kx5o48EF8X9UWgV1098c21gcn68NZ7+l/janws\ntLYrgMynikcadaGtAkRszGG0dX+qdeRx9hRzhTNUIG4AYe6bUA6/LfOEPyRyuo3Q\ncaN5fAJSK+RRMWr1d7Mzd8k+l3xXzcUTMUL2To+Zh0Fw2SIEocM4NS1W9nAm4+Cq\nhlQUhsoHDwk7bDsIQtRNfy3bX59PSIVMcWLNkWilLzZW1yRtFGPTJfPlR4Y1XJb5\nuwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/nodejs-2.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "nodejs-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuWyrBQXathrKzRO7HbX7\nZXqkeGo7X0q3qckO/Uh4Ht67bFb6iQDRo/gRkaVA0PM++2AhtW7wV2NYXR/3qowc\n1gGtO0zuQq56crcL7k9nVuFJ1IbYDyasEq+5nUKzEUVT0hK1/Vzh12gLFhDkBOX+\nCvISLTTQgEGljwNQLf1kZTraJcdDSN0R2k2jl+idJkeAuK5cjMEJa7Fog8scM2rR\nzGhB8gDRp+iq4HQ+yE3R1yXW9rBfWoConnXiNxholt3e2aAte2V1KnEmVLO/8ceo\nvqIp5xEcDKIAIrSqsmopRFXJ0PjS/nbS0Z2ynxpyh1BV4sqr/y4oOryrnwO+LqBB\nHwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/postgres-2.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "postgres-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoQmrHoW5X6jpN6cJnafW\nWKz1LpT2DvOFPeRmrlSPOPIUSVPUMZI8ojdxzmri/dzC8C4quCIYaL5ssARhe17L\no16LG3z/wdPENYONBj/oH5GRvmG1/uCgzL5+QQENk3kAWVAUb7EL3EgHNx90b2oC\nDNoHcjuoi3ZkCUXxkX7BESvw1jII4hP+HyoIqGh8TZLIAQ25/mS9aNL3TbcLYp5d\npqoM0Ruc4DHVuZTamN+zBZwNRCBz6uxMmaEBD+piYTEPJOnf7yUT7d2l/QzLftfE\nkSo80KOyrPOFdIPCpqKJyPOJZgg7fSgpR0YC6BH7I/JgIsIwUsQcMS8/ELUC5+Zg\nfwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/postgres-3.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "postgres-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPsFwxISCjy38kw78N2I\nhkxK6S0uARkPggE+OP7jWwZqHtnz1O+ZUbM/o9i/dWgm0Xl+hQ6grPtjS57VzXJq\nlwsVDGTkyb5T6wAcZao/koQbA9ZABknLH/ra52gny+7j3b2q5RIdyhddTYZwsbIG\n9y2BfcUW0Z1mPVkR2NxzFloj0ulsrJs6/5GhqbREqPz5BsyBJlwFsREK2Dy6m2nm\nVMp+GIQlRdhy/D09s/BZ/Ejwe8D3tv3jJT5CRXkndwa5qIc96E1uzRQpyyKvXZDK\nYvUdQwniW4EBNHEo/se+OqP+Du/M1dReX6aTq9axbhKiVWoD3FtMVtGqE3uf/i4I\n0QIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -0,0 +1,4 @@
{
"name": "rsk-testnet-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0JU46rCyLGOi5OdeeE2M\nobUUxO+Jqd9t9bP75Pyj0uH8WaxNv1PIdWZJiR+fcE+draBV86/YLxHzOFvsnMi+\nE/qgeXLKErGtTSb12mWq0gYv/wz9uqRbtcsv40gpu2BtNv9ycdXYACB/s0ipnuUO\nX/os4YHDvWV1cshwzgsQ87ad7OdT/Nldggtp4go60TkBi49VaftiJzYqVm1ey3xz\nd7+EsQWqhQHAac6POEuPjwNuM2valf/8+nI4Uday/CiFrDDV1SffRG30sd4rJF15\nh1S1Kxyetr72EmQwIGbJuDJL7eUU7blXjg6UtTxDDsl6rYUO5s/j7wZLoFhmC854\npQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/uploads-1.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "uploads-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwJwWaz8TeGv3SFlKzLMx\nqN8GTL/c0N9ppBvv8xNSS/yF9Y40SbL418uxYzm9hIhOXgIygIgLT2EKIXX32t+R\neOJCdYycQFM3At2fhMkjhuUW0gmDRcYBcBJLC5hLh2EZ+A8V7k4qgrBpPLOjEv48\nhQY0vuAw2DGndWr4QLh5NLUmQiOrfuzcZSSNCBOTIgUZgNmRd9QcCHDq4WDH3poa\nosJo4a9JGEGUL1irOivvEdyJPwEd2f++nYAdWwj8pjCYgpRshQlLhxOlylMx7MxB\nQt2bgJC9sahfbfJCOqdlCU3DMJL0bRUiuxK77WeSsxWBJmrsiF3+Ljs2Ix+s7fnS\nywIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/wiki-1.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "wiki-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3LprIvOWrnsywbvFGXtK\nsbd6xmILw/W/dSogLi0DQBXxPsOipH8pL4K6IeZmMeU3TXaW7faf/54KrMnh+4s1\nLEXpWSATvCaw1LzihzoXELpVLNvBLHZjAAO2TJ5ay1knTlA92hqN8qZOKzRtfHBX\n49dIgJgY95UIIJqSk4425llgQY/tntEWPjSduPIyST/PKkuW+RbUj4XyKm/qrASV\nXrbDK0dZAD0kJrOEjKspUyBQjyutFy+hkv0ldiGogcpCNPDaDsJqnw+Gp0gv6w7V\n92omCx8oJuXoqL1SIB6ayHV3q1pEWC9VbDRdcSYBjbRPFITEj6Er0m6OhJjlOyyR\nfwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/zerotier-1.json Normal file
View File

@ -0,0 +1,4 @@
{
"name": "zerotier-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx59liuiEXuAykaiQhjvO\nMimzWH2MOE/GdfPdlGG0IupDtGbDgpsu6lHB/Tc8ct+SEsj55KuamEmUew3EzWRQ\ngVWAPjWtlk6gqVlpU+8eJjTAxT1vaEOvetzliPDNzRBk1AAzS0IkMQwPAIqOD2Vm\nz+QDrTiEFNnbKyBDQ54uY9jBtEgTHgzZyc9KHTjcodJu/oCmOuO0ieTtMS4CDWVl\no2auyABpXX6PzW3hFvH/GB0IlVC5IBa7XS6JrbIFbZCvoAYf/egcQUTToNiKH45e\n2tPZbFpOt955zwInKTioW+Ak3qVVEPvCZ9IBTN7jZkSQuP4Ob5SA4+IbDJcXGulG\nZQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@ -2,6 +2,34 @@
This file is used to list changes made in each version of the apt cookbook.
## 7.3.0 (2020-05-01)
- Cookstyle fixes - [@tas50](https://github.com/tas50)
- Remove unnecessary Foodcritic comments - [@tas50](https://github.com/tas50)
- Simplify the metadata.rb to resolve cookstyle warnings - [@tas50](https://github.com/tas50)
- Prevent helper collisions in Chef Infra Client 16 - [@tas50](https://github.com/tas50)
## 7.2.0 (2019-08-05)
- Allow you to specify dpkg options just for unattended upgrades - [@majormoses](https://github.com/majormoses)
- Adding documentation and tests for setting dpkg options unattended upgrades - [@majormoses](https://github.com/majormoses)
- Test on Chef 15 + Chef Workstation - [@tas50](https://github.com/tas50)
- Remove tests of the resources now built into Chef - [@tas50](https://github.com/tas50)
- Remove respond_to from the metadata - [@tas50](https://github.com/tas50)
- Remove the recipe description from the metadata as these aren't used - [@tas50](https://github.com/tas50)
- Replace Chef 12 testing with 13.3 - [@tas50](https://github.com/tas50)
- Remove Ubuntu 14.04 / Debian 8 testing and add Debian 10 testing - [@tas50](https://github.com/tas50)
## 7.1.1 (2018-10-11)
- Allow to customize sender email for unattended-upgrades
## 7.1.0 (2018-09-05)
- Add the installation of dirmngr and gnupg to the apt default cookbook to support secure repositories
- Added support for the unattended-upgrade SyslogEnable configuration feature
- Added support for the unattended-upgrade SyslogFacility configuration feature
## 7.0.0 (2018-04-06)
### Breaking Change
@ -16,7 +44,7 @@ This file is used to list changes made in each version of the apt cookbook.
## 6.1.3 (2017-07-19)
- Fixed typo in readme
- Fixed config namespace in the 10dpkg-options file
- Fixed config namespace in the 10dpkg-options file
## 6.1.2 (2017-06-20)

View File

@ -83,7 +83,7 @@ For example, to prevent caching and directly connect to the repository at `downl
"cacher_server": {
"cache_bypass": {
"download.oracle.com": "http",
"nginx.org": "https"
"nginx.org": "https"
}
}
}
@ -129,11 +129,15 @@ To pull just security updates, set `origins_patterns` to something like `["origi
- `['apt']['unattended_upgrades']['minimal_steps']` - Split the upgrade into the smallest possible chunks. This makes the upgrade a bit slower but it has the benefit that shutdown while a upgrade is running is possible (with a small delay). Defaults to false.
- `['apt']['unattended_upgrades']['install_on_shutdown']` - Install upgrades when the machine is shuting down instead of doing it in the background while the machine is running. This will (obviously) make shutdown slower. Defaults to false.
- `['apt']['unattended_upgrades']['mail']` - Send email to this address for problems or packages upgrades. Defaults to no email.
- `['apt']['unattended_upgrades']['sender']` - Send email from this address for problems or packages upgrades. Defaults to 'root'.
- `['apt']['unattended_upgrades']['mail_only_on_error']` - If set, email will only be set on upgrade errors. Otherwise, an email will be sent after each upgrade. Defaults to true.
- `['apt']['unattended_upgrades']['remove_unused_dependencies']` Do automatic removal of new unused dependencies after the upgrade. Defaults to false.
- `['apt']['unattended_upgrades']['automatic_reboot']` - Automatically reboots _without confirmation_ if a restart is required after the upgrade. Defaults to false.
- `['apt']['unattended_upgrades']['dl_limit']` - Limits the bandwidth used by apt to download packages. Value given as an integer in kb/sec. Defaults to nil (no limit).
- `['apt']['unattended_upgrades']['random_sleep']` - Wait a random number of seconds up to this value before running daily periodic apt actions. System default is 1800 seconds (30 minutes).
- `['apt']['unattended_upgrades']['syslog_enable']` - Enable logging to syslog. Defaults to false.
- `['apt']['unattended_upgrades']['syslog_facility']` - Specify syslog facility. Defaults to 'daemon'.
- `['apt']['unattended_upgrades']['dpkg_options']` An array of dpkg options to be used specifically only for unattended upgrades. Defaults to `[]` which will prevent it from being rendered from the template in the resulting file.
### Configuration for APT

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Attributes:: default
#
# Copyright:: 2009-2017, Chef Software, Inc.
# Copyright:: 2009-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -41,12 +41,17 @@ default['apt']['unattended_upgrades']['auto_fix_interrupted_dpkg'] = false
default['apt']['unattended_upgrades']['minimal_steps'] = false
default['apt']['unattended_upgrades']['install_on_shutdown'] = false
default['apt']['unattended_upgrades']['mail'] = nil
default['apt']['unattended_upgrades']['sender'] = nil
default['apt']['unattended_upgrades']['mail_only_on_error'] = true
default['apt']['unattended_upgrades']['remove_unused_dependencies'] = false
default['apt']['unattended_upgrades']['automatic_reboot'] = false
default['apt']['unattended_upgrades']['automatic_reboot_time'] = 'now'
default['apt']['unattended_upgrades']['dl_limit'] = nil
default['apt']['unattended_upgrades']['random_sleep'] = nil
default['apt']['unattended_upgrades']['syslog_enable'] = false
default['apt']['unattended_upgrades']['syslog_facility'] = 'daemon'
default['apt']['unattended_upgrades']['dpkg_options'] = []
default['apt']['confd']['force_confask'] = false
default['apt']['confd']['force_confdef'] = false

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Library:: helpers
#
# Copyright:: 2013-2017, Chef Software, Inc.
# Copyright:: 2013-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -24,13 +24,13 @@ module Apt
#
# @return [Boolean]
def apt_installed?
!which('apt-get').nil?
!apt_which('apt-get').nil?
end
# Finds a command in $PATH
#
# @return [String, nil]
def which(cmd)
def apt_which(cmd)
ENV['PATH'] = '' if ENV['PATH'].nil?
paths = (ENV['PATH'].split(::File::PATH_SEPARATOR) + %w(/bin /usr/bin /sbin /usr/sbin))
@ -44,6 +44,6 @@ module Apt
end
end
Chef::Recipe.send(:include, ::Apt::Helpers)
Chef::Resource.send(:include, ::Apt::Helpers)
Chef::Provider.send(:include, ::Apt::Helpers)
Chef::Recipe.include ::Apt::Helpers
Chef::Resource.include ::Apt::Helpers
Chef::Provider.include ::Apt::Helpers

File diff suppressed because one or more lines are too long

13
cookbooks/apt/metadata.rb Normal file
View File

@ -0,0 +1,13 @@
name 'apt'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Configures apt and apt caching.'
version '7.3.0'
supports 'ubuntu'
supports 'debian'
source_url 'https://github.com/chef-cookbooks/apt'
issues_url 'https://github.com/chef-cookbooks/apt/issues'
chef_version '>= 13.3'

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Recipe:: cacher-client
#
# Copyright:: 2011-2017, Chef Software, Inc.
# Copyright:: 2011-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -49,4 +49,4 @@ else
t.run_action(:create) if node['apt']['compiletime']
end
include_recipe 'apt::default'
include_recipe 'apt::default' # rubocop: disable ChefModernize/IncludingAptDefaultRecipe

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Recipe:: cacher-ng
#
# Copyright:: 2008-2017, Chef Software, Inc.
# Copyright:: 2008-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.

View File

@ -2,8 +2,8 @@
# Cookbook:: apt
# Recipe:: default
#
# Copyright:: 2008-2017, Chef Software, Inc.
# Copyright:: 2009-2017, Bryan McLellan <btm@loftninjas.org>
# Copyright:: 2008-2019, Chef Software, Inc.
# Copyright:: 2009-2019, Bryan McLellan <btm@loftninjas.org>
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
@ -42,8 +42,7 @@ apt_update 'periodic' do
end
# For other recipes to call to force an update
execute 'apt-get update' do
command 'apt-get update'
execute 'apt-get update' do # rubocop: disable ChefModernize/ExecuteAptUpdate
ignore_failure true
action :nothing
notifies :touch, 'file[/var/lib/apt/periodic/update-success-stamp]', :immediately
@ -93,6 +92,6 @@ template '/etc/apt/apt.conf.d/10recommends' do
only_if { apt_installed? }
end
package 'apt-transport-https' do
package %w(apt-transport-https gnupg dirmngr) do
only_if { apt_installed? }
end

View File

@ -2,7 +2,7 @@
# Cookbook:: apt
# Recipe:: unattended-upgrades
#
# Copyright:: 2014-2017, Chef Software, Inc.
# Copyright:: 2014-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.

View File

@ -25,7 +25,7 @@ Unattended-Upgrade::Package-Blacklist {
};
// This option allows you to control if on a unclean dpkg exit
// unattended-upgrades will automatically run
// unattended-upgrades will automatically run
// dpkg --force-confold --configure -a
// The default is true, to ensure updates keep getting installed
Unattended-Upgrade::AutoFixInterruptedDpkg "<%= node['apt']['unattended_upgrades']['auto_fix_interrupted_dpkg'] ? 'true' : 'false' %>";
@ -41,14 +41,20 @@ Unattended-Upgrade::MinimalSteps "<%= node['apt']['unattended_upgrades']['minima
// This will (obviously) make shutdown slower
Unattended-Upgrade::InstallOnShutdown "<%= node['apt']['unattended_upgrades']['install_on_shutdown'] ? 'true' : 'false' %>";
<% if node['apt']['unattended_upgrades']['mail'] -%>
// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. A package that provides
// 'mailx' must be installed.
<% if node['apt']['unattended_upgrades']['mail'] -%>
Unattended-Upgrade::Mail "<%= node['apt']['unattended_upgrades']['mail'] %>";
<% end -%>
<% if node['apt']['unattended_upgrades']['sender'] -%>
// This option allows to customize the email address used in the
// 'From' header. unattended-upgrades will use "root" if unset.
Unattended-Upgrade::Sender "<%= node['apt']['unattended_upgrades']['sender'] %>";
<% end -%>
// Set this value to "true" to get emails only on errors. Default
// is to always send a mail if Unattended-Upgrade::Mail is set
Unattended-Upgrade::MailOnlyOnError "<%= node['apt']['unattended_upgrades']['mail_only_on_error'] ? 'true' : 'false' %>";
@ -57,19 +63,42 @@ Unattended-Upgrade::MailOnlyOnError "<%= node['apt']['unattended_upgrades']['mai
// (equivalent to apt-get autoremove)
Unattended-Upgrade::Remove-Unused-Dependencies "<%= node['apt']['unattended_upgrades']['remove_unused_dependencies'] ? 'true' : 'false' %>";
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
// Automatically reboot *WITHOUT CONFIRMATION* if a
// the file /var/run/reboot-required is found after the upgrade
Unattended-Upgrade::Automatic-Reboot "<%= node['apt']['unattended_upgrades']['automatic_reboot'] ? 'true' : 'false' %>";
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
// Default: "now"
<% if node['apt']['unattended_upgrades']['automatic_reboot'] -%>
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately. Default is "now"
Unattended-Upgrade::Automatic-Reboot-Time "<%= node['apt']['unattended_upgrades']['automatic_reboot_time'] %>";
<% end %>
<% if node['apt']['unattended_upgrades']['dl_limit'] -%>
// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
<% if node['apt']['unattended_upgrades']['dl_limit'] -%>
// Acquire::http::Dl-Limit "70";
Acquire::http::Dl-Limit "<%= node['apt']['unattended_upgrades']['dl_limit'] %>";
<% end -%>
// Enable logging to syslog. Default is False
Unattended-Upgrade::SyslogEnable "<%= node['apt']['unattended_upgrades']['syslog_enable'] ? 'true' : 'false' %>";
// Specify syslog facility. Default is daemon
Unattended-Upgrade::SyslogFacility "<%= node['apt']['unattended_upgrades']['syslog_facility'] %>";
// specify any dpkg options you want to run
// for example if you wanted to upgrade and use
// the installed version of config files when
// resolving conflicts during an upgrade you
// typically need:
// Dpkg::Options {
// "--force-confdef";
// "--force-confold";
//};
<% unless node['apt']['unattended_upgrades']['dpkg_options'].empty? -%>
Dpkg::Options {
<% node['apt']['unattended_upgrades']['dpkg_options'].each do |option|%>
"<%= option %>";
<% end -%>
};
<% end -%>

View File

@ -1 +0,0 @@
~FC016

View File

@ -2,6 +2,27 @@
This file is used to list changes made in each version of the ark cookbook.
## 5.0.0 (2020-01-02)
- Require Chef Infra Client 14+ and remove the need for the build_essential dependency - [@tas50](https://github.com/tas50)
- Use Ruby classes in resource properties - [@tas50](https://github.com/tas50)
- Simplify the platform check logic - [@tas50](https://github.com/tas50)
- Remove the .foocritic file - [@tas50](https://github.com/tas50)
- Remove long_description and recipe metadata - [@tas50](https://github.com/tas50)
- Expand testing - [@tas50](https://github.com/tas50)
- Remove Ubuntu 14.04 testing - [@tas50](https://github.com/tas50)
## 4.0.0 (2018-07-25)
- Support append_env_path property on Windows, which increases the minimum required Chef release to Chef 13.4
## 3.1.1 (2018-07-24)
- Remove ChefSpec matchers since these are autogenerated now
- Update specs to the latest platform versions
- Remove template out of defaults directory
- Remove dependency on the Windows cookbook
## 3.1.0 (2017-05-06)
- Ensure the dependencies get installed on Chef 13 Amazon Linux systems
@ -12,7 +33,7 @@ This file is used to list changes made in each version of the ark cookbook.
- Rewrite of resource to custom resources.
- Remove EOL platforms from testing.
- Update zlib URL
-
-
## 2.2.1 (2016-12-16)
- Use Ohai root_group attribute to avoid trying to set the group to root on BSD/macOS.
- Add missing accessor for owner property

View File

@ -1,15 +0,0 @@
<!-- This is a generated file. Please do not edit directly -->
# Maintainers
This file lists how this cookbook project is maintained. When making changes to the system, this file tells you who needs to review your patch - you need a review from an existing maintainer for the cookbook to provide a :+1: on your pull request. Additionally, you need to not receive a veto from a Lieutenant or the Project Lead.
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) for details on the process and how to become a maintainer or the project lead.
# Project Maintainer
* [Tim Smith](https://github.com/tas50)
# Maintainers
* [Jennifer Davis](https://github.com/sigje)
* [Tim Smith](https://github.com/tas50)
* [Thom May](https://github.com/thommay)

View File

@ -25,7 +25,7 @@ The `ark` resource will:
By default, the ark will not run again if the `:path` is not empty. Ark provides many actions to accommodate different use cases, such as `:dump`, `:cherry_pick`, `:put`, and `:install_with_make`.
At this time ark only handles files available from URLs using the [remote_file](http://docs.chef.io/resource_remote_file.html) provider. It does handle local files using the `file://` protocol.
For remote files ark supports URLs using the [remote_file](http://docs.chef.io/resource_remote_file.html) resource. Local files are accessed with the `file://` syntax.
## Requirements
@ -36,7 +36,7 @@ At this time ark only handles files available from URLs using the [remote_file](
- Fedora
- FreeBSD
- SmartOS
- Mac OS X
- macOS
- openSUSE / SUSE Linux Enterprises
- Windows
@ -44,13 +44,11 @@ Should work on common Unix/Linux systems with typical userland utilities like ta
### Chef
- Chef 12.7+
- Chef 14+
### Cookbooks
- build-essential
- seven_zip
- windows
## Attributes
@ -66,7 +64,7 @@ Customize the attributes to suit site specific conventions and defaults.
## Resources
- `ark` - does the extract/build/configure
- `ark` - does the extract/build/configure
### Actions

View File

@ -58,7 +58,6 @@ module Ark
new_resource.path = defaults.path
new_resource.release_file = defaults.release_file
end
# rubocop:enable Metrics/AbcSize
def set_put_paths
new_resource.extension = defaults.extension

View File

@ -1,44 +0,0 @@
if defined?(ChefSpec)
ChefSpec.define_matcher :ark
def install_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :install, resource_name)
end
def dump_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :dump, resource_name)
end
def cherry_pick_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :cherry_pick, resource_name)
end
def put_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :put, resource_name)
end
def install_with_make_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :install_with_make, resource_name)
end
def configure_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :configure, resource_name)
end
def setup_py_build_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py_build, resource_name)
end
def setup_py_install_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py_install, resource_name)
end
def setup_py_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :setup_py, resource_name)
end
def unzip_ark(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:ark, :unzip, resource_name)
end
end

View File

@ -25,9 +25,7 @@ module Ark
end
def sevenzip_command
if resource.strip_components <= 0
return sevenzip_command_builder(resource.path, 'x')
end
return sevenzip_command_builder(resource.path, 'x') if resource.strip_components <= 0
tmpdir = make_temp_directory.tr('/', '\\')
cmd = sevenzip_command_builder(tmpdir, 'x')

File diff suppressed because one or more lines are too long

16
cookbooks/ark/metadata.rb Normal file
View File

@ -0,0 +1,16 @@
name 'ark'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Provides a custom resource for installing runtime artifacts in a predictable fashion'
version '5.0.0'
%w(ubuntu debian redhat centos suse opensuse opensuseleap scientific oracle amazon windows mac_os_x smartos freebsd).each do |os|
supports os
end
depends 'seven_zip' # for windows os
source_url 'https://github.com/chef-cookbooks/ark'
issues_url 'https://github.com/chef-cookbooks/ark/issues'
chef_version '>= 14.0'

View File

@ -18,6 +18,6 @@
# limitations under the License.
#
package node['ark']['package_dependencies'] unless %w(windows mac_os_x).include?(node['platform_family'])
package node['ark']['package_dependencies'] unless platform_family?('windows', 'mac_os_x')
include_recipe 'seven_zip' if node['platform_family'] == 'windows'
include_recipe 'seven_zip' if platform_family?('windows')

View File

@ -83,8 +83,16 @@ action :install do
action :nothing
end
# usually on windows there is no central directory with executables where the applications are linked
unless node['platform_family'] == 'windows'
if platform_family?('windows')
# usually on windows there is no central directory with executables where the applications are linked
# so ignore has_binaries for now
# Add to PATH permanently on Windows if append_env_path
windows_path "#{new_resource.path}/bin" do
action :add
only_if { new_resource.append_env_path }
end
else
# symlink binaries
new_resource.has_binaries.each do |bin|
link ::File.join(new_resource.prefix_bin, ::File.basename(bin)) do

View File

@ -0,0 +1,118 @@
# Changelog for Chocolatey cookbook
## v3.0.0 (2019-07-11)
- Add `node['chocolatey']['sensitive']` attribute (default: false) to give users the option to suppress output spam when the install.ps1 file is pushed to the machine.
- Require Chef Infra Client 12.15 or later
- Resolve minor Cookstyle warnings
- Fix `node['chocolatey']['upgrade']` to properly upgrade the `chocolatey` package
- Upgrade to the latest and greatest Chocolatey install script
## v2.0.1 (2018-07-03)
- Remove mentions of the package provider from the readme and metadata
## v2.0.0 (2018-05-01)
### Breaking Change
The package LWRP has been removed from this cookbook. chocolatey_package was integrated into Chef 12.7, which was released in Feb 2016\. This cookbook now requires Chef 12.7 or later.
### Other Changes
- This cookbook no longer requires the Windows cookbook
- The install script has been updated to the latest Chocolatey install script
- Converted testing to use Delivery Local Mode from within ChefDK
## v1.2.1 (2017-08-20)
- Explicitly use the double-dash long option names for `--source` and `--installargs`
## v1.2.0 (2017-05-04)
- Change the default `['chocolatey']['upgrade']` attribute value to `false`. Preventing chocolatey from reinstalling every chef run
## v1.1.1 (2017-04-22)
- Fix chef 13 converges renaming conflicting `env_path` method
## v1.1.0 (2017-01-09)
- Update the chocolatey install script to match chocolatey.org.
## v1.0.3 (2016-09-12)
- Loosen windows-cookbook constraint
## v1.0.2 (2016-08-29)
- Ensure `chocolateyVersion` attribute is used and the correct version of chocolatey is installed.
## v1.0.1 (2016-07-15)
- Always execute chocolatey installer unless guard is satisfied to allow the install to retry on subsequent attempts if it fails.
## v1.0.0 (2016-03-07)
- No longer dependent on chocolatey.org for install script
- Removed deprecated overwriting of the current_resource and fixed visibility problem with `env_path`
## v0.6.2 (2016-01-07)
- Fix Chocolatey detection on chef clients older than 12.4.0
## v0.6.1 (2015-11-24)
- Fix LocalJumpError on existing chocolatey package
## v0.6.0 (2015-11-17)
- Path Tracking. Tracking additions to the user and machine %PATH% environment and merging them into the current process.
- Downcase package name results from choco upgrade.
## v0.5.1 (2015-11-10)
- Prepend library include with :: in provder to fix 12.3.0 and likely other versions older than 12.5.1.
- Add backward compatibiliy to new metadata.rb attributes `source_url` and `issues_url`.
## v0.5.0 (2015-11-09)
- Refactored install script (and .kitchen.yml) to support installing Chocolatey in test-kitchen behind a proxy.
- Download `node['chocolatey']['Uri']` via `remote_file` resource instead of .net web client
- Set `chocolateyProxyLocation` environment variable to `Chef::Config['https_proxy']` if one is set before chocolatey install
- Changed helpers module namespacing from: `ChocolateyHelpers` to `Chocolatey::Helpers`
- Add ChefSpec unit tests
- Add ServerSpec integration tests
- Gemfile: bump foodcritic to 5.0 and Berkshelf to 4.0
- Add ChefSpec matchers
## v0.4.1 (2015-10-15)
- Adds example how to install package with version
- use the vanilla script resource to bypass 64bit interpreter builder introduced in Chef 12.5
## v0.4.0 (2015-06-30)
- Refactor script to download Chocolatey install script
- Chocolatey install: add proxy support
- fix for 64-bit chocolatey installs
## v0.3.0 (2015-04-20)
- Support for chocolatey >= 0.9.9
- Make package name case insensitive
## v0.2.0 (2014-09-24)
- Allow spaces in the path to the "choco" command.
- Update tests to use Rakefile
- Support Chocolatey version 0.9.8.24+
- Support custom command line options when installing packages
## v0.1.0 (2014-02-20)
- Fix and tests
## v0.0.5 (2013-04-30)
- Initial release

View File

@ -0,0 +1,46 @@
# chocolatey Cookbook
[![Cookbook Version](https://img.shields.io/cookbook/v/chocolatey.svg)](https://supermarket.getchef.com/cookbooks/chocolatey) ![delivery](https://github.com/chocolatey-community/chocolatey-cookbook/workflows/delivery/badge.svg)
Install Chocolatey with the default recipe.
## Requirements
### Platform
- Windows
### Chef Infra Client
- 12.15 or greater
## Notes
As of Chocolatey version [0.9.8.24](https://github.com/chocolatey/chocolatey/blob/master/CHANGELOG.md#09824-july-3-2014) the install directory for Chocolatey has changed from `C:\Chocolatey` to `C:\ProgramData\Chocolatey`.
More information can be gotten from the [Chocolateywiki](https://github.com/chocolatey/chocolatey/wiki/DefaultChocolateyInstallReasoning).
## Attributes
All attributes below are pre-pended with `node['chocolatey']`
Attribute | Description | Type | Default
---------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------
`['upgrade']` | Whether to upgrade Chocolatey if it's already installed | Boolean | false
`['install_vars']['chocolateyProxyLocation']` | HTTPS proxy for Chocolatey install script | String | Chef::Config['https_proxy'] or ENV['https_proxy']
`['install_vars']['chocolateyProxyUser']` | Proxy user for authenticating proxies | String | nil
`['install_vars']['chocolateyProxyPassword']` | Proxy user password | String | nil
`['install_vars']['chocolateyVersion']` | Version of Chocolatey to install, e.g. '0.9.9.11' | String | nil (download latest version)
`['install_vars']['chocolateyDownloadUrl']` | Chocolatey .nupkg file URL. Use this if you host an internal copy of the chocolatey.nupkg | String | <https://chocolatey.org/api/v2/package/chocolatey> (download from chocolatey.org)
`['install_vars']['chocolateyUseWindowsCompression']`| To use built-in compression instead of 7zip (requires additional download) set to `true` | String | nil (use 7zip)
`['sensitive']` | When true, will suppress writing the contents of install.ps1 to the console | Boolean | false
## Recipes
- `chocolatey::default` - installs Chocolatey
## License and Maintainer
Maintainer:: Guilhem Lettron ([guilhem@lettron.fr](mailto:guilhem@lettron.fr))
License:: Apache 2.0

View File

@ -0,0 +1,12 @@
default['chocolatey']['upgrade'] = false
default['chocolatey']['sensitive'] = false
# Chocolatey install.ps1 env vars. See https://chocolatey.org/install.ps1
default['chocolatey']['install_vars'].tap do |env|
env['chocolateyProxyLocation'] = Chef::Config['https_proxy'] || ENV['https_proxy']
env['chocolateyProxyUser'] = nil
env['chocolateyProxyPassword'] = nil
env['chocolateyVersion'] = nil
env['chocolateyDownloadUrl'] = 'https://chocolatey.org/api/v2/package/chocolatey'
env['chocolateyUseWindowsCompression'] = nil
end

View File

@ -0,0 +1,421 @@
# =====================================================================
# Copyright 2017 - 2020 Chocolatey Software, Inc, and the
# original authors/contributors from ChocolateyGallery
# Copyright 2011 - 2017 RealDimensions Software, LLC, and the
# original authors/contributors from ChocolateyGallery
# at https://github.com/chocolatey/chocolatey.org
#
# 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.
# =====================================================================
# For organizational deployments of Chocolatey, please see https://chocolatey.org/docs/how-to-setup-offline-installation
# Environment Variables, specified as $env:NAME in PowerShell.exe and %NAME% in cmd.exe.
# For explicit proxy, please set $env:chocolateyProxyLocation and optionally $env:chocolateyProxyUser and $env:chocolateyProxyPassword
# For an explicit version of Chocolatey, please set $env:chocolateyVersion = 'versionnumber'
# To target a different url for chocolatey.nupkg, please set $env:chocolateyDownloadUrl = 'full url to nupkg file'
# NOTE: $env:chocolateyDownloadUrl does not work with $env:chocolateyVersion.
# To use built-in compression instead of 7zip (requires additional download), please set $env:chocolateyUseWindowsCompression = 'true'
# To bypass the use of any proxy, please set $env:chocolateyIgnoreProxy = 'true'
#specifically use the API to get the latest version (below)
$url = ''
$chocolateyVersion = $env:chocolateyVersion
if (![string]::IsNullOrEmpty($chocolateyVersion)){
Write-Output "Downloading specific version of Chocolatey: $chocolateyVersion"
$url = "https://chocolatey.org/api/v2/package/chocolatey/$chocolateyVersion"
}
$chocolateyDownloadUrl = $env:chocolateyDownloadUrl
if (![string]::IsNullOrEmpty($chocolateyDownloadUrl)){
Write-Output "Downloading Chocolatey from : $chocolateyDownloadUrl"
$url = "$chocolateyDownloadUrl"
}
if ($env:TEMP -eq $null) {
$env:TEMP = Join-Path $env:SystemDrive 'temp'
}
$chocTempDir = Join-Path $env:TEMP "chocolatey"
$tempDir = Join-Path $chocTempDir "chocInstall"
if (![System.IO.Directory]::Exists($tempDir)) {[void][System.IO.Directory]::CreateDirectory($tempDir)}
$file = Join-Path $tempDir "chocolatey.zip"
# PowerShell v2/3 caches the output stream. Then it throws errors due
# to the FileStream not being what is expected. Fixes "The OS handle's
# position is not what FileStream expected. Do not use a handle
# simultaneously in one FileStream and in Win32 code or another
# FileStream."
function Fix-PowerShellOutputRedirectionBug {
$poshMajorVerion = $PSVersionTable.PSVersion.Major
if ($poshMajorVerion -lt 4) {
try{
# http://www.leeholmes.com/blog/2008/07/30/workaround-the-os-handles-position-is-not-what-filestream-expected/ plus comments
$bindingFlags = [Reflection.BindingFlags] "Instance,NonPublic,GetField"
$objectRef = $host.GetType().GetField("externalHostRef", $bindingFlags).GetValue($host)
$bindingFlags = [Reflection.BindingFlags] "Instance,NonPublic,GetProperty"
$consoleHost = $objectRef.GetType().GetProperty("Value", $bindingFlags).GetValue($objectRef, @())
[void] $consoleHost.GetType().GetProperty("IsStandardOutputRedirected", $bindingFlags).GetValue($consoleHost, @())
$bindingFlags = [Reflection.BindingFlags] "Instance,NonPublic,GetField"
$field = $consoleHost.GetType().GetField("standardOutputWriter", $bindingFlags)
$field.SetValue($consoleHost, [Console]::Out)
[void] $consoleHost.GetType().GetProperty("IsStandardErrorRedirected", $bindingFlags).GetValue($consoleHost, @())
$field2 = $consoleHost.GetType().GetField("standardErrorWriter", $bindingFlags)
$field2.SetValue($consoleHost, [Console]::Error)
} catch {
Write-Output "Unable to apply redirection fix."
}
}
}
Fix-PowerShellOutputRedirectionBug
# Attempt to set highest encryption available for SecurityProtocol.
# PowerShell will not set this by default (until maybe .NET 4.6.x). This
# will typically produce a message for PowerShell v2 (just an info
# message though)
try {
# Set TLS 1.2 (3072) as that is the minimum required by Chocolatey.org.
# Use integers because the enumeration value for TLS 1.2 won't exist
# in .NET 4.0, even though they are addressable if .NET 4.5+ is
# installed (.NET 4.5 is an in-place upgrade).
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
} catch {
Write-Output 'Unable to set PowerShell to use TLS 1.2. This is required for contacting Chocolatey as of 03 FEB 2020. https://chocolatey.org/blog/remove-support-for-old-tls-versions. If you see underlying connection closed or trust errors, you may need to do one or more of the following: (1) upgrade to .NET Framework 4.5+ and PowerShell v3+, (2) Call [System.Net.ServicePointManager]::SecurityProtocol = 3072; in PowerShell prior to attempting installation, (3) specify internal Chocolatey package location (set $env:chocolateyDownloadUrl prior to install or host the package internally), (4) use the Download + PowerShell method of install. See https://chocolatey.org/docs/installation for all install options.'
}
function Get-Downloader {
param (
[string]$url
)
$downloader = new-object System.Net.WebClient
$defaultCreds = [System.Net.CredentialCache]::DefaultCredentials
if ($defaultCreds -ne $null) {
$downloader.Credentials = $defaultCreds
}
$ignoreProxy = $env:chocolateyIgnoreProxy
if ($ignoreProxy -ne $null -and $ignoreProxy -eq 'true') {
Write-Debug "Explicitly bypassing proxy due to user environment variable"
$downloader.Proxy = [System.Net.GlobalProxySelection]::GetEmptyWebProxy()
} else {
# check if a proxy is required
$explicitProxy = $env:chocolateyProxyLocation
$explicitProxyUser = $env:chocolateyProxyUser
$explicitProxyPassword = $env:chocolateyProxyPassword
if ($explicitProxy -ne $null -and $explicitProxy -ne '') {
# explicit proxy
$proxy = New-Object System.Net.WebProxy($explicitProxy, $true)
if ($explicitProxyPassword -ne $null -and $explicitProxyPassword -ne '') {
$passwd = ConvertTo-SecureString $explicitProxyPassword -AsPlainText -Force
$proxy.Credentials = New-Object System.Management.Automation.PSCredential ($explicitProxyUser, $passwd)
}
Write-Debug "Using explicit proxy server '$explicitProxy'."
$downloader.Proxy = $proxy
} elseif (!$downloader.Proxy.IsBypassed($url)) {
# system proxy (pass through)
$creds = $defaultCreds
if ($creds -eq $null) {
Write-Debug "Default credentials were null. Attempting backup method"
$cred = get-credential
$creds = $cred.GetNetworkCredential();
}
$proxyaddress = $downloader.Proxy.GetProxy($url).Authority
Write-Debug "Using system proxy server '$proxyaddress'."
$proxy = New-Object System.Net.WebProxy($proxyaddress)
$proxy.Credentials = $creds
$downloader.Proxy = $proxy
}
}
return $downloader
}
function Download-String {
param (
[string]$url
)
$downloader = Get-Downloader $url
return $downloader.DownloadString($url)
}
function Download-File {
param (
[string]$url,
[string]$file
)
#Write-Output "Downloading $url to $file"
$downloader = Get-Downloader $url
$downloader.DownloadFile($url, $file)
}
if ($url -eq $null -or $url -eq '') {
Write-Output "Getting latest version of the Chocolatey package for download."
$url = 'https://chocolatey.org/api/v2/Packages()?$filter=((Id%20eq%20%27chocolatey%27)%20and%20(not%20IsPrerelease))%20and%20IsLatestVersion'
[xml]$result = Download-String $url
$url = $result.feed.entry.content.src
}
# Download the Chocolatey package
Write-Output "Getting Chocolatey from $url."
Download-File $url $file
# Determine unzipping method
# 7zip is the most compatible so use it by default
$7zaExe = Join-Path $tempDir '7za.exe'
$unzipMethod = '7zip'
$useWindowsCompression = $env:chocolateyUseWindowsCompression
if ($useWindowsCompression -ne $null -and $useWindowsCompression -eq 'true') {
Write-Output 'Using built-in compression to unzip'
$unzipMethod = 'builtin'
} elseif (-Not (Test-Path ($7zaExe))) {
Write-Output "Downloading 7-Zip commandline tool prior to extraction."
# download 7zip
Download-File 'https://chocolatey.org/7za.exe' "$7zaExe"
}
# unzip the package
Write-Output "Extracting $file to $tempDir..."
if ($unzipMethod -eq '7zip') {
$params = "x -o`"$tempDir`" -bd -y `"$file`""
# use more robust Process as compared to Start-Process -Wait (which doesn't
# wait for the process to finish in PowerShell v3)
$process = New-Object System.Diagnostics.Process
$process.StartInfo = New-Object System.Diagnostics.ProcessStartInfo($7zaExe, $params)
$process.StartInfo.RedirectStandardOutput = $true
$process.StartInfo.UseShellExecute = $false
$process.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
$process.Start() | Out-Null
$process.BeginOutputReadLine()
$process.WaitForExit()
$exitCode = $process.ExitCode
$process.Dispose()
$errorMessage = "Unable to unzip package using 7zip. Perhaps try setting `$env:chocolateyUseWindowsCompression = 'true' and call install again. Error:"
switch ($exitCode) {
0 { break }
1 { throw "$errorMessage Some files could not be extracted" }
2 { throw "$errorMessage 7-Zip encountered a fatal error while extracting the files" }
7 { throw "$errorMessage 7-Zip command line error" }
8 { throw "$errorMessage 7-Zip out of memory" }
255 { throw "$errorMessage Extraction cancelled by the user" }
default { throw "$errorMessage 7-Zip signalled an unknown error (code $exitCode)" }
}
} else {
if ($PSVersionTable.PSVersion.Major -lt 5) {
try {
$shellApplication = new-object -com shell.application
$zipPackage = $shellApplication.NameSpace($file)
$destinationFolder = $shellApplication.NameSpace($tempDir)
$destinationFolder.CopyHere($zipPackage.Items(),0x10)
} catch {
throw "Unable to unzip package using built-in compression. Set `$env:chocolateyUseWindowsCompression = 'false' and call install again to use 7zip to unzip. Error: `n $_"
}
} else {
Expand-Archive -Path "$file" -DestinationPath "$tempDir" -Force
}
}
# Call chocolatey install
Write-Output "Installing chocolatey on this machine"
$toolsFolder = Join-Path $tempDir "tools"
$chocInstallPS1 = Join-Path $toolsFolder "chocolateyInstall.ps1"
& $chocInstallPS1
Write-Output 'Ensuring chocolatey commands are on the path'
$chocInstallVariableName = "ChocolateyInstall"
$chocoPath = [Environment]::GetEnvironmentVariable($chocInstallVariableName)
if ($chocoPath -eq $null -or $chocoPath -eq '') {
$chocoPath = "$env:ALLUSERSPROFILE\Chocolatey"
}
if (!(Test-Path ($chocoPath))) {
$chocoPath = "$env:SYSTEMDRIVE\ProgramData\Chocolatey"
}
$chocoExePath = Join-Path $chocoPath 'bin'
if ($($env:Path).ToLower().Contains($($chocoExePath).ToLower()) -eq $false) {
$env:Path = [Environment]::GetEnvironmentVariable('Path',[System.EnvironmentVariableTarget]::Machine);
}
Write-Output 'Ensuring chocolatey.nupkg is in the lib folder'
$chocoPkgDir = Join-Path $chocoPath 'lib\chocolatey'
$nupkg = Join-Path $chocoPkgDir 'chocolatey.nupkg'
if (![System.IO.Directory]::Exists($chocoPkgDir)) { [System.IO.Directory]::CreateDirectory($chocoPkgDir); }
Copy-Item "$file" "$nupkg" -Force -ErrorAction SilentlyContinue
# SIG # Begin signature block
# MIIcpwYJKoZIhvcNAQcCoIIcmDCCHJQCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDNxwdauklvXMYd
# R6F324woy4ZDT1pBVoUMp0tAZ0LTVKCCF7EwggUwMIIEGKADAgECAhAECRgbX9W7
# ZnVTQ7VvlVAIMA0GCSqGSIb3DQEBCwUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0xMzEwMjIxMjAwMDBa
# Fw0yODEwMjIxMjAwMDBaMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lD
# ZXJ0IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwggEiMA0GCSqGSIb3
# DQEBAQUAA4IBDwAwggEKAoIBAQD407Mcfw4Rr2d3B9MLMUkZz9D7RZmxOttE9X/l
# qJ3bMtdx6nadBS63j/qSQ8Cl+YnUNxnXtqrwnIal2CWsDnkoOn7p0WfTxvspJ8fT
# eyOU5JEjlpB3gvmhhCNmElQzUHSxKCa7JGnCwlLyFGeKiUXULaGj6YgsIJWuHEqH
# CN8M9eJNYBi+qsSyrnAxZjNxPqxwoqvOf+l8y5Kh5TsxHM/q8grkV7tKtel05iv+
# bMt+dDk2DZDv5LVOpKnqagqrhPOsZ061xPeM0SAlI+sIZD5SlsHyDxL0xY4PwaLo
# LFH3c7y9hbFig3NBggfkOItqcyDQD2RzPJ6fpjOp/RnfJZPRAgMBAAGjggHNMIIB
# yTASBgNVHRMBAf8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjATBgNVHSUEDDAK
# BggrBgEFBQcDAzB5BggrBgEFBQcBAQRtMGswJAYIKwYBBQUHMAGGGGh0dHA6Ly9v
# Y3NwLmRpZ2ljZXJ0LmNvbTBDBggrBgEFBQcwAoY3aHR0cDovL2NhY2VydHMuZGln
# aWNlcnQuY29tL0RpZ2lDZXJ0QXNzdXJlZElEUm9vdENBLmNydDCBgQYDVR0fBHow
# eDA6oDigNoY0aHR0cDovL2NybDQuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0QXNzdXJl
# ZElEUm9vdENBLmNybDA6oDigNoY0aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0Rp
# Z2lDZXJ0QXNzdXJlZElEUm9vdENBLmNybDBPBgNVHSAESDBGMDgGCmCGSAGG/WwA
# AgQwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzAK
# BghghkgBhv1sAzAdBgNVHQ4EFgQUWsS5eyoKo6XqcQPAYPkt9mV1DlgwHwYDVR0j
# BBgwFoAUReuir/SSy4IxLVGLp6chnfNtyA8wDQYJKoZIhvcNAQELBQADggEBAD7s
# DVoks/Mi0RXILHwlKXaoHV0cLToaxO8wYdd+C2D9wz0PxK+L/e8q3yBVN7Dh9tGS
# dQ9RtG6ljlriXiSBThCk7j9xjmMOE0ut119EefM2FAaK95xGTlz/kLEbBw6RFfu6
# r7VRwo0kriTGxycqoSkoGjpxKAI8LpGjwCUR4pwUR6F6aGivm6dcIFzZcbEMj7uo
# +MUSaJ/PQMtARKUT8OZkDCUIQjKyNookAv4vcn4c10lFluhZHen6dGRrsutmQ9qz
# sIzV6Q3d9gEgzpkxYz0IGhizgZtPxpMQBvwHgfqL2vmCSfdibqFT+hKUGIUukpHq
# aGxEMrJmoecYpJpkUe8wggU6MIIEIqADAgECAhAH+0XZ9wtVKQNgl7T04UNwMA0G
# CSqGSIb3DQEBCwUAMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJ
# bmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lDZXJ0
# IFNIQTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0EwHhcNMTgwMzMwMDAwMDAw
# WhcNMjEwNDE0MTIwMDAwWjB3MQswCQYDVQQGEwJVUzEPMA0GA1UECBMGS2Fuc2Fz
# MQ8wDQYDVQQHEwZUb3Bla2ExIjAgBgNVBAoTGUNob2NvbGF0ZXkgU29mdHdhcmUs
# IEluYy4xIjAgBgNVBAMTGUNob2NvbGF0ZXkgU29mdHdhcmUsIEluYy4wggEiMA0G
# CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC4irdLWVJryfKSgPPCyMN+nBmxtZIm
# mTBhJMaYVJ6gtfvHcFakH7IC8TcjcEIrkK7wB/2vEJkEqiOTgbVQPZLnfX8ZAxhd
# UiJmwQHEiSwLzoo2B35ROQ9qdOsn1bYIEzDpaqm/XwYH925LLpxhr9oCkBNf5dZs
# e5bc/s1J5sQ9HRYwpb3MimmNHGpNP/YhjXX/kNFCZIv3mUadFHi+talYIN5dp6ai
# /k+qgZeL5klPdmjyIgf3JiDywCf7j5nSbm3sWarYjM5vLe/oD+eK70fez30a17Cy
# 97Jtqmdz6WUV1BcbMWeb9b8x369UJq5vt7vGwVFDOeGjwffuVHLRvWLnAgMBAAGj
# ggHFMIIBwTAfBgNVHSMEGDAWgBRaxLl7KgqjpepxA8Bg+S32ZXUOWDAdBgNVHQ4E
# FgQUqRlYCMLOvsDUS4mx9UA1avD3fvgwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQM
# MAoGCCsGAQUFBwMDMHcGA1UdHwRwMG4wNaAzoDGGL2h0dHA6Ly9jcmwzLmRpZ2lj
# ZXJ0LmNvbS9zaGEyLWFzc3VyZWQtY3MtZzEuY3JsMDWgM6Axhi9odHRwOi8vY3Js
# NC5kaWdpY2VydC5jb20vc2hhMi1hc3N1cmVkLWNzLWcxLmNybDBMBgNVHSAERTBD
# MDcGCWCGSAGG/WwDATAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy5kaWdpY2Vy
# dC5jb20vQ1BTMAgGBmeBDAEEATCBhAYIKwYBBQUHAQEEeDB2MCQGCCsGAQUFBzAB
# hhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wTgYIKwYBBQUHMAKGQmh0dHA6Ly9j
# YWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFNIQTJBc3N1cmVkSURDb2RlU2ln
# bmluZ0NBLmNydDAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQA+ddcs
# z/NB/+V+AIlUNOVTlGDNCtn1AfvwoRZg9XMmx0/S0EKayfVFTk/x96WMQgxL+/5x
# B8Uhw6anlhbPC6bjBcIxRj/IUgR7yJ/NAykyM1x+pWvkPZV3slwe0GDPwhaqGUTU
# aG8njO4EvA682a1o7wqQFR1MIltjtuPB2gp311LLxP1k5dpUMgaA0lAfnbRr+5dc
# QOFWslkho1eBf0xlzSrhRGPy0e/IYWpl+/sEwXhD88QUkN7dSXY0fMlyGQfn6H4f
# ozBQvCk37eoE0uAtkUrWAlJxO/4Esi83ko4hokwQJHaN64/7NdNaKlG3shC9+2QM
# kY3j3BU+Ym2GZgtBMIIGajCCBVKgAwIBAgIQAwGaAjr/WLFr1tXq5hfwZjANBgkq
# hkiG9w0BAQUFADBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5j
# MRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBB
# c3N1cmVkIElEIENBLTEwHhcNMTQxMDIyMDAwMDAwWhcNMjQxMDIyMDAwMDAwWjBH
# MQswCQYDVQQGEwJVUzERMA8GA1UEChMIRGlnaUNlcnQxJTAjBgNVBAMTHERpZ2lD
# ZXJ0IFRpbWVzdGFtcCBSZXNwb25kZXIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
# ggEKAoIBAQCjZF38fLPggjXg4PbGKuZJdTvMbuBTqZ8fZFnmfGt/a4ydVfiS457V
# WmNbAklQ2YPOb2bu3cuF6V+l+dSHdIhEOxnJ5fWRn8YUOawk6qhLLJGJzF4o9GS2
# ULf1ErNzlgpno75hn67z/RJ4dQ6mWxT9RSOOhkRVfRiGBYxVh3lIRvfKDo2n3k5f
# 4qi2LVkCYYhhchhoubh87ubnNC8xd4EwH7s2AY3vJ+P3mvBMMWSN4+v6GYeofs/s
# jAw2W3rBerh4x8kGLkYQyI3oBGDbvHN0+k7Y/qpA8bLOcEaD6dpAoVk62RUJV5lW
# MJPzyWHM0AjMa+xiQpGsAsDvpPCJEY93AgMBAAGjggM1MIIDMTAOBgNVHQ8BAf8E
# BAMCB4AwDAYDVR0TAQH/BAIwADAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDCCAb8G
# A1UdIASCAbYwggGyMIIBoQYJYIZIAYb9bAcBMIIBkjAoBggrBgEFBQcCARYcaHR0
# cHM6Ly93d3cuZGlnaWNlcnQuY29tL0NQUzCCAWQGCCsGAQUFBwICMIIBVh6CAVIA
# QQBuAHkAIAB1AHMAZQAgAG8AZgAgAHQAaABpAHMAIABDAGUAcgB0AGkAZgBpAGMA
# YQB0AGUAIABjAG8AbgBzAHQAaQB0AHUAdABlAHMAIABhAGMAYwBlAHAAdABhAG4A
# YwBlACAAbwBmACAAdABoAGUAIABEAGkAZwBpAEMAZQByAHQAIABDAFAALwBDAFAA
# UwAgAGEAbgBkACAAdABoAGUAIABSAGUAbAB5AGkAbgBnACAAUABhAHIAdAB5ACAA
# QQBnAHIAZQBlAG0AZQBuAHQAIAB3AGgAaQBjAGgAIABsAGkAbQBpAHQAIABsAGkA
# YQBiAGkAbABpAHQAeQAgAGEAbgBkACAAYQByAGUAIABpAG4AYwBvAHIAcABvAHIA
# YQB0AGUAZAAgAGgAZQByAGUAaQBuACAAYgB5ACAAcgBlAGYAZQByAGUAbgBjAGUA
# LjALBglghkgBhv1sAxUwHwYDVR0jBBgwFoAUFQASKxOYspkH7R7for5XDStnAs0w
# HQYDVR0OBBYEFGFaTSS2STKdSip5GoNL9B6Jwcp9MH0GA1UdHwR2MHQwOKA2oDSG
# Mmh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydEFzc3VyZWRJRENBLTEu
# Y3JsMDigNqA0hjJodHRwOi8vY3JsNC5kaWdpY2VydC5jb20vRGlnaUNlcnRBc3N1
# cmVkSURDQS0xLmNybDB3BggrBgEFBQcBAQRrMGkwJAYIKwYBBQUHMAGGGGh0dHA6
# Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBBBggrBgEFBQcwAoY1aHR0cDovL2NhY2VydHMu
# ZGlnaWNlcnQuY29tL0RpZ2lDZXJ0QXNzdXJlZElEQ0EtMS5jcnQwDQYJKoZIhvcN
# AQEFBQADggEBAJ0lfhszTbImgVybhs4jIA+Ah+WI//+x1GosMe06FxlxF82pG7xa
# FjkAneNshORaQPveBgGMN/qbsZ0kfv4gpFetW7easGAm6mlXIV00Lx9xsIOUGQVr
# NZAQoHuXx/Y/5+IRQaa9YtnwJz04HShvOlIJ8OxwYtNiS7Dgc6aSwNOOMdgv420X
# Ewbu5AO2FKvzj0OncZ0h3RTKFV2SQdr5D4HRmXQNJsQOfxu19aDxxncGKBXp2JPl
# VRbwuwqrHNtcSCdmyKOLChzlldquxC5ZoGHd2vNtomHpigtt7BIYvfdVVEADkitr
# wlHCCkivsNRu4PQUCjob4489yq9qjXvc2EQwggbNMIIFtaADAgECAhAG/fkDlgOt
# 6gAK6z8nu7obMA0GCSqGSIb3DQEBBQUAMGUxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xJDAiBgNV
# BAMTG0RpZ2lDZXJ0IEFzc3VyZWQgSUQgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBa
# Fw0yMTExMTAwMDAwMDBaMGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2Vy
# dCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNVBAMTGERpZ2lD
# ZXJ0IEFzc3VyZWQgSUQgQ0EtMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
# ggEBAOiCLZn5ysJClaWAc0Bw0p5WVFypxNJBBo/JM/xNRZFcgZ/tLJz4FlnfnrUk
# FcKYubR3SdyJxArar8tea+2tsHEx6886QAxGTZPsi3o2CAOrDDT+GEmC/sfHMUiA
# fB6iD5IOUMnGh+s2P9gww/+m9/uizW9zI/6sVgWQ8DIhFonGcIj5BZd9o8dD3QLo
# Oz3tsUGj7T++25VIxO4es/K8DCuZ0MZdEkKB4YNugnM/JksUkK5ZZgrEjb7Szgau
# rYRvSISbT0C58Uzyr5j79s5AXVz2qPEvr+yJIvJrGGWxwXOt1/HYzx4KdFxCuGh+
# t9V3CidWfA9ipD8yFGCV/QcEogkCAwEAAaOCA3owggN2MA4GA1UdDwEB/wQEAwIB
# hjA7BgNVHSUENDAyBggrBgEFBQcDAQYIKwYBBQUHAwIGCCsGAQUFBwMDBggrBgEF
# BQcDBAYIKwYBBQUHAwgwggHSBgNVHSAEggHJMIIBxTCCAbQGCmCGSAGG/WwAAQQw
# ggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3LmRpZ2ljZXJ0LmNvbS9zc2wtY3Bz
# LXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUHAgIwggFWHoIBUgBBAG4AeQAgAHUA
# cwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQByAHQAaQBmAGkAYwBhAHQAZQAgAGMA
# bwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBjAGUAcAB0AGEAbgBjAGUAIABvAGYA
# IAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAgAEMAUAAvAEMAUABTACAAYQBuAGQA
# IAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQAGEAcgB0AHkAIABBAGcAcgBlAGUA
# bQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBtAGkAdAAgAGwAaQBhAGIAaQBsAGkA
# dAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBjAG8AcgBwAG8AcgBhAHQAZQBkACAA
# aABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBlAHIAZQBuAGMAZQAuMAsGCWCGSAGG
# /WwDFTASBgNVHRMBAf8ECDAGAQH/AgEAMHkGCCsGAQUFBwEBBG0wazAkBggrBgEF
# BQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29tMEMGCCsGAQUFBzAChjdodHRw
# Oi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0Eu
# Y3J0MIGBBgNVHR8EejB4MDqgOKA2hjRodHRwOi8vY3JsMy5kaWdpY2VydC5jb20v
# RGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3JsMDqgOKA2hjRodHRwOi8vY3JsNC5k
# aWdpY2VydC5jb20vRGlnaUNlcnRBc3N1cmVkSURSb290Q0EuY3JsMB0GA1UdDgQW
# BBQVABIrE5iymQftHt+ivlcNK2cCzTAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun
# pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEARlA+ybcoJKc4HbZbKa9Sz1LpMUer
# Vlx71Q0LQbPv7HUfdDjyslxhopyVw1Dkgrkj0bo6hnKtOHisdV0XFzRyR4WUVtHr
# uzaEd8wkpfMEGVWp5+Pnq2LN+4stkMLA0rWUvV5PsQXSDj0aqRRbpoYxYqioM+Sb
# OafE9c4deHaUJXPkKqvPnHZL7V/CSxbkS3BMAIke/MV5vEwSV/5f4R68Al2o/vsH
# OE8Nxl2RuQ9nRc3Wg+3nkg2NsWmMT/tZ4CMP0qquAHzunEIOz5HXJ7cW7g/DvXwK
# oO4sCFWFIrjrGBpN/CohrUkxg0eVd3HcsRtLSxwQnHcUwZ1PL1qVCCkQJjGCBEww
# ggRIAgEBMIGGMHIxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMx
# GTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xMTAvBgNVBAMTKERpZ2lDZXJ0IFNI
# QTIgQXNzdXJlZCBJRCBDb2RlIFNpZ25pbmcgQ0ECEAf7Rdn3C1UpA2CXtPThQ3Aw
# DQYJYIZIAWUDBAIBBQCggYQwGAYKKwYBBAGCNwIBDDEKMAigAoAAoQKAADAZBgkq
# hkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgorBgEEAYI3AgELMQ4wDAYKKwYBBAGC
# NwIBFTAvBgkqhkiG9w0BCQQxIgQgVOMYjIaBHu7LkOhlbFNa1FFBBUFQu8BKOfZZ
# AK2CtCUwDQYJKoZIhvcNAQEBBQAEggEAccxIsQDitasvwWmCy+JQLBU4qNfShPld
# fVFg7Dte5/KpHMEd6rgw0ECoN1H8nabSf3dVMPDWGTdXzYVc+zB5Nmhlwy/9CGAs
# XmIICX16xcwYb18miih52j/m5JXT4NhTIl/+e5mF4nyoJUJeBJwIUSDuV3rHyOpE
# 90BGZXJPX2ItGbp1J//bMDECzkxRtSRDxNCQ8QlS0YBc2h+ftQFmlmb86N8XCqdB
# 32paBD1OmhH7tVB9eXQRQ9rtNLbVUB790d/IGYkHU7zlVMwxpI7wYNqgdcV9bv5z
# O9GaG8QaQXxxtIB/hH5m5wWvcberqJb2qr5Ke6U1mPV1T6G6TGdctKGCAg8wggIL
# BgkqhkiG9w0BCQYxggH8MIIB+AIBATB2MGIxCzAJBgNVBAYTAlVTMRUwEwYDVQQK
# EwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xITAfBgNV
# BAMTGERpZ2lDZXJ0IEFzc3VyZWQgSUQgQ0EtMQIQAwGaAjr/WLFr1tXq5hfwZjAJ
# BgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0B
# CQUxDxcNMjAwNDE2MDA1MDU0WjAjBgkqhkiG9w0BCQQxFgQUSnVQXFG9NidxPlpR
# Zbf9t65cx2kwDQYJKoZIhvcNAQEBBQAEggEAlpX/WR+PI6eEsARfNpjEQAdcOOG6
# Kp1TyXOaikIUh0BI7IjCiGRr7LbXQdkZIMcl3UD8TN+GQ59RsHSsYaAQJozUW9uo
# pj3NaQJaKwHB15zHzcD1TMi18zCCPlebPmUTDsbICWBWangCST0zqU849+3tlx7E
# LLjYjs/ybeS7aQffy1Dv87ElCYWsVuoQ0n9U/7hqJ3pv88SM52xmg9IlexfOanCz
# tTAM+ke9OcXuPhoZJuDL3c8gaWxELpkokMoqX0UCgCgY4RTmJ44mC9GcYKSnpMQZ
# qFot8MXA8t5cdxN2EL8j0ASufyE0oucys4cs+yiN65GWds7YbjYC/ihG6A==
# SIG # End signature block

View File

@ -0,0 +1,55 @@
module Chocolatey
module Helpers
# include the PowershellOut module from the windows cookbook
# in case we are running an older chef client
include Chef::Mixin::PowershellOut
# Get the ChocolateyInstall directory from the environment.
def chocolatey_install
ENV.fetch('ChocolateyInstall') { |env_var| machine_env_var(env_var) }
end
# The Chocolatey command.
#
# Reference: https://github.com/chocolatey/chocolatey-cookbook/pull/16#issuecomment-47975896
def chocolatey_executable
"\"#{::File.join(chocolatey_install, 'bin', 'choco')}\""
end
def chocolatey_lib_dir
File.join(chocolatey_install, 'lib', 'chocolatey')
end
# Check if Chocolatey is installed
def chocolatey_installed?
return @is_chocolatey_installed if @is_chocolatey_installed
return false if chocolatey_install.nil?
# choco /? returns an exit status of -1 with chocolatey 0.9.9 => use list
cmd = Mixlib::ShellOut.new("#{chocolatey_executable} list -l chocolatey")
cmd.run_command
@is_chocolatey_installed = cmd.exitstatus == 0
end
# combine the local path with the user and machine paths
def environment_path(local_path)
machine = env_var('PATH', 'MACHINE').split(';')
user = env_var('PATH', 'USER').split(';')
local = local_path.split(';')
combined = local.concat(machine).concat(user).uniq.compact
combined.join(';')
end
private
def machine_env_var(env_var)
env_var(env_var, 'MACHINE')
end
def env_var(env_var, scope)
env_var = powershell_out!(
"[System.Environment]::GetEnvironmentVariable('#{env_var}', '#{scope}')"
)
env_var.stdout.chomp
end
end
end

View File

@ -0,0 +1 @@
{"name":"chocolatey","version":"3.0.0","description":"Install Chocolatey on Windows","long_description":"","maintainer":"Guilhem Lettron","maintainer_email":"guilhem.lettron@youscribe.com","license":"Apache-2.0","platforms":{"windows":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chocolatey/chocolatey-cookbook","issues_url":"https://github.com/chocolatey/chocolatey-cookbook/issues","chef_version":[[">= 12.15"]],"ohai_version":[]}

View File

@ -0,0 +1,13 @@
name 'chocolatey'
maintainer 'Guilhem Lettron'
maintainer_email 'guilhem.lettron@youscribe.com'
license 'Apache-2.0'
description 'Install Chocolatey on Windows'
version '3.0.0'
source_url 'https://github.com/chocolatey/chocolatey-cookbook'
issues_url 'https://github.com/chocolatey/chocolatey-cookbook/issues'
supports 'windows'
chef_version '>= 12.15'

View File

@ -0,0 +1,48 @@
#
# Cookbook:: chocolatey
# recipe:: default
# Author:: Guilhem Lettron <guilhem.lettron@youscribe.com>
#
# Copyright:: 2012, Societe Publica.
# Copyright:: 2015, Doug Ireton
#
# 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.
#
unless platform_family?('windows')
return "Chocolatey install not supported on #{node['platform_family']}"
end
Chef::Resource.include Chocolatey::Helpers
install_ps1 = File.join(Chef::Config['file_cache_path'], 'chocolatey-install.ps1')
cookbook_file install_ps1 do
action :create
backup false
source 'install.ps1'
sensitive node['chocolatey']['sensitive']
end
powershell_script 'Install Chocolatey' do
environment node['chocolatey']['install_vars']
cwd Chef::Config['file_cache_path']
code install_ps1
not_if { chocolatey_installed? }
end
if node['chocolatey']['upgrade']
chocolatey_package 'chocolatey' do
action :upgrade
version node['chocolatey']['install_vars']['chocolateyVersion']
end
end

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2012-2017 David Joos
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -159,7 +159,7 @@ end
## License and Authors
Author: David Joos <development@davidjoos.com>
Copyright: 2016, David Joos
Copyright: 2016-2017, David Joos
Author: David Joos <david.joos@escapestudios.com>
Author: Escape Studios Development <dev@escapestudios.com>

View File

@ -14,7 +14,7 @@ if node['platform'] == 'windows'
default['composer']['global_install']['install_dir'] = 'C:\\Program\ Files\\Composer'
default['composer']['global_install']['bin_dir'] = 'C:\\ProgramData\\Composer'
else
default['composer']['url'] = 'http://getcomposer.org/composer.phar'
default['composer']['url'] = 'http://getcomposer.org/composer-stable.phar'
default['composer']['install_dir'] = '/usr/local/bin'
default['composer']['bin'] = "#{node['composer']['install_dir']}/composer"
default['composer']['install_globally'] = true
@ -27,3 +27,4 @@ end
default['composer']['global_configs'] = {}
default['composer']['home_dir'] = nil
default['composer']['php_recipe'] = 'php::default'
default['composer']['self_update_channel'] = nil

File diff suppressed because one or more lines are too long

View File

@ -4,9 +4,10 @@ maintainer_email 'development@davidjoos.com'
license 'MIT'
description 'Installs/Configures Composer'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.6.1'
version '2.7.0'
chef_version '>= 0.10.0' if respond_to?(:chef_version)
%w(debian ubuntu redhat centos fedora scientific amazon windows).each do |os|
%w[debian ubuntu redhat centos fedora scientific amazon windows].each do |os|
supports os
end

View File

@ -13,17 +13,14 @@ end
action :install do
install_global_install
new_resource.updated_by_last_action(true)
end
action :remove do
install_global_remove
new_resource.updated_by_last_action(true)
end
action :update do
install_global_update
new_resource.updated_by_last_action(true)
end
def install_global_install

View File

@ -13,7 +13,6 @@ end
action :install do
make_execute 'install'
new_resource.updated_by_last_action(true)
end
action :require do
@ -22,12 +21,10 @@ end
action :update do
make_execute 'update'
new_resource.updated_by_last_action(true)
end
action :dump_autoload do
make_execute 'dump-autoload'
new_resource.updated_by_last_action(true)
end
action :remove do

View File

@ -10,9 +10,9 @@ include_recipe node['composer']['php_recipe']
if node['platform'] == 'windows'
windows_package 'Composer - PHP Dependency Manager' do
source node['composer']['url']
options %w(
options %w[
/VERYSILENT
).join(' ')
].join(' ')
end
install_dir = "#{node['composer']['install_dir'].tr('/', '\\')}\\bin"

View File

@ -7,9 +7,15 @@
include_recipe 'composer::install'
channel = if node['composer']['self_update_channel'].nil?
''
else
" --#{node['composer']['self_update_channel']}"
end
execute 'composer-self_update' do
cwd node['composer']['install_dir']
command 'composer self-update'
command 'composer self-update' + channel
environment 'COMPOSER_HOME' => Composer.home_dir(node)
action :run
ignore_failure true

View File

@ -17,8 +17,3 @@ attribute :quiet, :kind_of => [TrueClass, FalseClass], :default => true
attribute :optimize_autoloader, :kind_of => [TrueClass, FalseClass], :default => false
attribute :prefer_dist, :kind_of => [TrueClass, FalseClass], :default => false
attribute :prefer_source, :kind_of => [TrueClass, FalseClass], :default => false
def initialize(*args)
super
@action = :install
end

View File

@ -22,8 +22,3 @@ attribute :user, :kind_of => String, :default => 'root'
attribute :group, :kind_of => String, :default => 'root'
attribute :umask, :kind_of => [String, Integer], :default => '0002'
attribute :environment, :kind_of => Hash, :default => {}
def initialize(*args)
super
@action = :install
end

View File

@ -1,142 +0,0 @@
# dmg Cookbook CHANGELOG
This file is used to list changes made in each version of the dmg cookbook.
## 4.1.1 (2018-04-06)
- The dmg_package resource is now included in Chef 14 and this cookbook has been deprecated. We highly recommend updating to Chef 14 so you can use this resource without the need for a cookbook dependency.
- Validate the type field in the resource
- Remove the now autogenerated ChefSpec matchers
## 4.1.0 (2017-11-15)
- Adds allow_untrusted property for older packages that aren't signed
- Resolve Chef 14 deprecation warnings
- Minor testing updates and cleanup
## 4.0.0 (2017-04-27)
- Converted the existing LWRP to a custom resource which increases the required chef-client release to 12.5+
- Added Test Kitchen config with private atlas boxes for 10.10 and 10.11
- Added a test recipe to installed Tunnelblick
- Added an Inspec test to confirm that Tunnelblick actually installs
- Remove unused attributes and the entire attributes file
- Add a warning if you include the default recipe on your runlist
- Update specs to run on 10.12 and against the test recipe since dmg::default is empty and the existing spec tested nothing
## 3.1.1 (2017-04-11)
- Cookstyle updates
- Test with Local Delivery and not Rake
- Update apache2 license string
- Remove foodcritic exclusions
## 3.1.0 (2017-01-18)
- Fixed pkg,mpkg installation when it was using mounted app name while it was actually mounted under different name for some applications
- Cookstyle fixes
## 3.0.0 (2016-09-06)
- Add chef_version metadata
- Run the specs against a mock of OS X
- Testing updates
- Require Chef 12+
## v2.4.0 (2016-04-26)
- Added support for local .dmg files with the file property. See the readme for details
- Resolved all rubocop warnings
## v2.3.0 (2015-10-20)
- Add new headers property to the LWRP for custom http headers. See the readme for more information
- Removed pivotal tracker example in the readme
- Added travis and cookbook version badges to the readme
- Added a .foodcritic file to exclude rules
- Updated chefignore and .gitignore files
- Updated platforms in Test Kitchen
- Added standard Rubocop file
- Updated Travis to test using ChefDK for the latest deps
- Added a Berksfile
- Updated contributing and testing docs
- Updated Gemfile with the latest testing deps
- Added maintainers.md and maintainers.toml
- Added rakefile for simplified testing
- Added source_url and issues_url metadata
- Added basic converge chefspec
## v2.2.2 (2014-11-12)
- # 23, add chefspec matchers
## v2.2.0 (2014-02-25)
- [COOK-4285] Accept long EULAs
## v2.1.4 (2014-01-26)
- [COOK-4157] - dmg_package LWRP broken due to "puts" instead of "system"
- [COOK-4065] - dmg cookbook outputs the name of packages when checking if they are installed
## v2.1.2
Cleaning up merge errors
## v2.1.0
### Bug
- **[COOK-3946](https://tickets.chef.io/browse/COOK-3946)** - Syntax error in resources/package.rb
- **[COOK-2672](https://tickets.chef.io/browse/COOK-2672)** - EULA for package is displayed instead accepted
## v2.0.8
Adding a Chef 10 compatibility check in provider
## v2.0.6
# BUG
- [COOK-3302] - Sometimes hdiutil detach fails due to cfprefsd running in background
# IMPROVEMENT
- Adding foodcritic and rubocop to .travis.yml
## v2.0.4
### Bug
- **[COOK-3331](https://tickets.chef.io/browse/COOK-3331)** - Fix an issue where `dmg_package` with no source raises an exception
## v2.0.2
### Bug
- **[COOK-3578](https://tickets.chef.io/browse/COOK-3578)** - Support `package_id`s with spaces
- **[COOK-3302](https://tickets.chef.io/browse/COOK-3302)** - Fix an issue where `hdiutil detach` fails due to `cfprefsd` running in the background
## v2.0.0
### Bug
- **[COOK-3389](https://tickets.chef.io/browse/COOK-3389)** - Use `rsync` instead of `cp` (potentially a breaking change on some systems)
## v1.1.0
- [COOK-1847] - accept owner parameter for installing packages
## v1.0.0
- [COOK-852] - Support "pkg" in addition to "mpkg" package types
## v0.7.0
- [COOK-854] - use `cp -R` instead of `cp -r`
- [COOK-855] - specify a file or directory to check for prior install
## v0.6.0
- option to install software that is an .mpkg inside a .dmg
- ignore failure on chmod in case mode is already set, or is root owned

View File

@ -1,2 +0,0 @@
Please refer to
https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD

View File

@ -1,149 +0,0 @@
The dmg_package resource is now included in Chef 14 and this cookbook has been deprecated. We highly recommend updating to Chef 14 so you can use this resource without the need for a cookbook dependency.
# dmg Cookbook
[![Build Status](https://travis-ci.org/chef-cookbooks/dmg.svg?branch=master)](https://travis-ci.org/chef-cookbooks/dmg) [![Cookbook Version](https://img.shields.io/cookbook/v/dmg.svg)](https://supermarket.chef.io/cookbooks/dmg)
Resource to install OS X applications (.app) from dmg files.
## Requirements
### Platforms
- macOS
### Chef
- Chef 12.5+
### Cookbooks
- none
## Resources/Providers
### dmg_package
This resource will install a DMG "Package". It will retrieve the DMG from a remote URL, mount it using OS X's `hdid`, copy the application (.app directory) to the specified destination (/Applications), and detach the image using `hdiutil`. The dmg file will be stored in the `Chef::Config[:file_cache_path]`. If you want to install an application that has already been downloaded (not using the `source` parameter), copy it to the appropriate location. You can find out what directory this is with the following command on the node to run chef:
```bash
knife exec -E 'p Chef::Config[:file_cache_path]' -c /etc/chef/client.rb
```
Optionally, the LWRP can install an "mpkg" or "pkg" package using installer(8).
#### Actions
- :install - Installs the application.
#### Parameter attributes:
- `app` - This is the name of the application used by default for the /Volumes directory and the .app directory copied to /Applications.
- `source` - remote URL for the dmg to download if specified. Default is nil.
- `file` - local dmg full file path. Default is nil.
- `owner` - owner that should own the package installation.
- `destination` - directory to copy the .app into. Default is /Applications.
- `checksum` - sha256 checksum of the dmg to download. Default is nil.
- `type` - type of package, "app", "pkg" or "mpkg". Default is "app". When using "pkg" or "mpkg", the destination must be /Applications.
- `volumes_dir` - Directory under /Volumes where the dmg is mounted. Not all dmgs are mounted into a /Volumes location matching the name of the dmg. If not specified, this will use the name attribute.
- `package_id` - Package id registered with pkgutil when a pkg or mpkg is installed
- `dmg_name` - Specify the name of the dmg if it is not the same as `app`, or if the name has spaces.
- `dmg_passphrase` - Specify a passphrase to use to unencrypt the dmg while mounting.
- `accept_eula` - Specify whether to accept the EULA. Certain dmgs require acceptance of EULA before mounting. Can be true or false, defaults to false.
- `headers` - Allows custom HTTP headers (like cookies) to be set on the remote_file resource.
- `allow_untrusted` - Allows packages with untrusted certs to be installed.
#### Examples
Install `/Applications/Tunnelblick.app` from the primary download site.
```ruby
dmg_package 'Tunnelblick' do
source 'https://tunnelblick.net/release/Tunnelblick_3.7.0_build_4790.dmg'
checksum '5053038aa8caf7dea66dcab11d6d240672216e6546eff4c2622e216c61af85e5'
action :install
end
```
Install Google Chrome. Uses the `dmg_name` because the application name has spaces. Installs in `/Applications/Google Chrome.app`.
```ruby
dmg_package 'Google Chrome' do
dmg_name 'googlechrome'
source 'https://dl-ssl.google.com/chrome/mac/stable/GGRM/googlechrome.dmg'
checksum '7daa2dc5c46d9bfb14f1d7ff4b33884325e5e63e694810adc58f14795165c91a'
action :install
end
```
Install Dropbox. Uses `volumes_dir` because the mounted directory is different than the name of the application directory. Installs in `/Applications/Dropbox.app`.
```ruby
dmg_package 'Dropbox' do
volumes_dir 'Dropbox Installer'
source 'http://www.dropbox.com/download?plat=mac'
checksum 'b4ea620ca22b0517b75753283ceb82326aca8bc3c86212fbf725de6446a96a13'
action :install
end
```
Install MacIrssi to `~/Applications` from the local file downloaded to the cache path into an Applications directory in the current user's home directory. Chef should run as a non-root user for this.
```ruby
directory "#{ENV['HOME']}/Applications"
dmg_package 'MacIrssi' do
destination "#{ENV['HOME']}/Applications"
action :install
end
```
Install Virtualbox to `/Applications` from the .mpkg:
```ruby
dmg_package 'Virtualbox' do
source 'http://dlc.sun.com.edgesuite.net/virtualbox/4.0.8/VirtualBox-4.0.8-71778-OSX.dmg'
type 'mpkg'
end
```
Install pgAdmin to `/Applications` and automatically accept the EULA:
```ruby
dmg_package 'pgAdmin3' do
source 'http://wwwmaster.postgresql.org/redir/198/h/pgadmin3/release/v1.12.3/osx/pgadmin3-1.12.3.dmg'
checksum '9435f79d5b52d0febeddfad392adf82db9df159196f496c1ab139a6957242ce9'
accept_eula true
end
```
Install Silverlight, with idempotence check based on pkgutil:
```ruby
dmg_package 'Silerlight' do
source 'http://silverlight.dlservice.microsoft.com/download/D/C/2/DC2D5838-9138-4D25-AA92-52F61F7C51E6/runtime/Silverlight.dmg'
type 'pkg'
checksum '6d4a0ad4552d9815531463eb3f467fb8cf4bffcc'
package_id 'com.microsoft.installSilverlightPlugin'
end
```
## License & Authors
**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))
**Copyright:** 2011-2017, Chef Software, Inc.
```
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.
```

File diff suppressed because one or more lines are too long

View File

@ -1,102 +0,0 @@
#
# Author:: Joshua Timberman (<jtimberman@chef.io>)
# Cookbook:: dmg
# Resource:: package
#
# Copyright:: 2011-2017, Chef Software, Inc.
#
# 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.
#
property :app, String, name_property: true
property :source, String
property :file, String
property :owner, String
property :destination, String, default: '/Applications'
property :checksum, String
property :volumes_dir, String
property :dmg_name, String
property :type, String, default: 'app', equal_to: %w(app pkg mpkg)
property :installed, [true, false], default: false, desired_state: false
property :package_id, String
property :dmg_passphrase, String
property :accept_eula, [true, false], default: false
property :headers, [Hash, nil], default: nil
property :allow_untrusted, [true, false], default: false
load_current_value do |new_resource|
if ::File.directory?("#{new_resource.destination}/#{new_resource.app}.app")
Chef::Log.info "Already installed; to upgrade, remove \"#{new_resource.destination}/#{new_resource.app}.app\""
installed true
elsif shell_out("pkgutil --pkgs='#{new_resource.package_id}'").exitstatus == 0
Chef::Log.info "Already installed; to upgrade, try \"sudo pkgutil --forget '#{new_resource.package_id}'\""
installed true
else
installed false
end
end
action :install do
unless current_resource.installed
volumes_dir = new_resource.volumes_dir ? new_resource.volumes_dir : new_resource.app
dmg_name = new_resource.dmg_name ? new_resource.dmg_name : new_resource.app
dmg_file = if new_resource.file.nil?
"#{Chef::Config[:file_cache_path]}/#{dmg_name}.dmg"
else
new_resource.file
end
remote_file "#{dmg_file} - #{new_resource.name}" do
path dmg_file
source new_resource.source
headers new_resource.headers if new_resource.headers
checksum new_resource.checksum if new_resource.checksum
end if new_resource.source
passphrase_cmd = new_resource.dmg_passphrase ? "-passphrase #{new_resource.dmg_passphrase}" : ''
ruby_block "attach #{dmg_file}" do
block do
cmd = shell_out("hdiutil imageinfo #{passphrase_cmd} '#{dmg_file}' | grep -q 'Software License Agreement: true'")
software_license_agreement = cmd.exitstatus == 0
raise "Requires EULA Acceptance; add 'accept_eula true' to package resource" if software_license_agreement && !new_resource.accept_eula
accept_eula_cmd = new_resource.accept_eula ? 'echo Y | PAGER=true' : ''
shell_out!("#{accept_eula_cmd} hdiutil attach #{passphrase_cmd} '#{dmg_file}' -mountpoint '/Volumes/#{volumes_dir}' -quiet")
end
not_if "hdiutil info #{passphrase_cmd} | grep -q 'image-path.*#{dmg_file}'"
end
case new_resource.type
when 'app'
execute "rsync --force --recursive --links --perms --executability --owner --group --times '/Volumes/#{volumes_dir}/#{new_resource.app}.app' '#{new_resource.destination}'" do
user new_resource.owner if new_resource.owner
end
declare_resource(:file, "#{new_resource.destination}/#{new_resource.app}.app/Contents/MacOS/#{new_resource.app}") do
mode '755'
ignore_failure true
end
when 'mpkg', 'pkg'
install_cmd = "installation_file=$(ls '/Volumes/#{volumes_dir}' | grep '.#{new_resource.type}$') && sudo installer -pkg \"/Volumes/#{volumes_dir}/$installation_file\" -target /"
install_cmd += ' -allowUntrusted' if new_resource.allow_untrusted
execute install_cmd do
# Prevent cfprefsd from holding up hdiutil detach for certain disk images
environment('__CFPREFERENCES_AVOID_DAEMON' => '1')
end
end
execute "hdiutil detach '/Volumes/#{volumes_dir}' || hdiutil detach '/Volumes/#{volumes_dir}' -force"
end
end

View File

@ -1 +0,0 @@
~FC016

View File

@ -2,6 +2,63 @@
This file is used to list changes made in each version of the git cookbook.
## 10.0.0 (2019-10-16)
- Add testing for CentOS 8, openSUSE 15, Ubuntu 18.04 in Travis
- Require Chef Infra Client 14 or later so we can drop the dependency on build-essential
- Resolve multiple cookstyle warnings
## 9.0.1 (2018-06-02)
- Update the platforms we test on
- Remove extra attr_accessor in config and requires
- Bump git version to 2.17.1 to resolve CVE
## 9.0.0 (2018-03-08)
- Remove the dependency on the homebrew cookbook by not automatically installing homebrew in the git resource on macOS systems. Homebrew needs to be setup before this resource runs and that should probably be the very first thing you do on a macOS system
- Use the build_essential resource instead of including the default recipe. This requires version 5.0 or later of the build-essential cookbook and allows us to use the build_essential resource that will be built into Chef 14 when that ships
- Remove extra includes in the resources that weren't necessary
- Updated testing to include Fedora 27, Ubuntu 18.04, Debian 9, macOS 10.12, and Windows 2016
## 8.0.1 (2018-02-10)
- Resolve the new FC118 foodcritic warning
- Remove the ChefSpec matchers which are auto generated now
- Resolve FC104 warning
## 8.0.0 (2017-09-01)
### Breaking Changes
- macOS resource now properly executes and uses homebrew to install git instead of dmg and packages posted to SourceForge
- Default to Git 2.9.5 now, which properly compiles on Fedora / Amazon Linux
## Other Changes
- Fixed support for Amazon Linux on Chef 13
- Unified the package setup for source installs which fixes Amazon/Fedora
- Removed an entirely duplicate service provider
- Remove unused runit templates
- Properly fail when we're on an unsupported platform
## 7.0.0 (2017-09-01)
- Remove support for RHEL 5 which removes the need for the yum-epel cookbook
- Move templates out of the default directory now that we require Chef 12
- Remove support for Ubuntu 10.04
- Remove the version requirement on mac_os_x in the metadata
- Move maintainer information to the readme
- Expand Travis testing
## 6.1.0 (2017-05-30)
- Test with Local Delivery and not Rake
- Remove EOL platforms from the kitchen configs
- Use a SPDX standard license string
- Updated default versions documented in README to fix Issue #120.
- Remove class_eval and require chef 12.7+
## 6.0.0 (2017-02-14)
- Fail on deprecations is now enabled so we're fully Chef 13 compatible

View File

@ -1,15 +0,0 @@
<!-- This is a generated file. Please do not edit directly -->
# Maintainers
This file lists how this cookbook project is maintained. When making changes to the system, this file tells you who needs to review your patch - you need a review from an existing maintainer for the cookbook to provide a :+1: on your pull request. Additionally, you need to not receive a veto from a Lieutenant or the Project Lead.
Check out [How Cookbooks are Maintained](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD) for details on the process and how to become a maintainer or the project lead.
# Project Maintainer
* [Tim Smith](https://github.com/tas50)
# Maintainers
* [Jennifer Davis](https://github.com/sigje)
* [Tim Smith](https://github.com/tas50)
* [Thom May](https://github.com/thommay)

View File

@ -20,17 +20,17 @@ The following platforms have been tested with Test Kitchen:
|---------------+-------|
| centos-7 | X |
|---------------+-------|
| centos-8 | X |
|---------------+-------|
| fedora | X |
|---------------+-------|
| debian-7 | X |
| debian-9 | X |
|---------------+-------|
| debian-8 | X |
|---------------+-------|
| ubuntu-14.04 | X |
| debian-10 | X |
|---------------+-------|
| ubuntu-16.04 | X |
|---------------+-------|
| openSUSE 13.2 | X |
| ubuntu-18.04 | X |
|---------------+-------|
| openSUSE Leap | X |
|---------------+-------|
@ -38,13 +38,11 @@ The following platforms have been tested with Test Kitchen:
### Chef
- Chef 12.5+
- Chef 14+
### Cookbooks
- depends 'build-essential' - For compiling from source
- depends 'dmg' - For macOS Support
- depends 'yum-epel' - For older RHEL platform_family support
- none
## Usage
@ -60,6 +58,8 @@ Add `git::default`, `git::source` or `git::windows` to your run_list OR add `dep
The `git_client` resource manages the installation of a Git client on a machine.
`Note`: on macOS systems homebrew must first be installed on the system before running this resource. Prior to version 9.0 of this cookbook homebrew was automatically installed.
#### Example
```ruby
@ -68,6 +68,17 @@ git_client 'default' do
end
```
#### Example of source install
```ruby
git_client 'source' do
provider Chef::Provider::GitClient::Source
source_version '2.14.2'
source_checksum 'a03a12331d4f9b0f71733db9f47e1232d4ddce00e7f2a6e20f6ec9a19ce5ff61'
action :install
end
```
### git_config
The `git_config` resource manages the configuration of Git client on a machine.
@ -96,23 +107,15 @@ Currently, there are distinct sets of resource properties, used by the providers
- `source_prefix` - Defaults to '/usr/local'
- `source_url` - Defaults to a calculated URL based on source_version
- `source_version` - Defaults to 2.7.4
- `source_version` - Defaults to 2.8.1
- `source_use_pcre` - configure option for build. Defaults to false
- `source_checksum` - Defaults to a known value for the 2.7.4 source tarball
# used by OSX package providers
- `osx_dmg_app_name` - Defaults to 'git-2.7.1-intel-universal-mavericks'
- `osx_dmg_package_id` - Defaults to 'GitOSX.Installer.git271.git.pkg'
- `osx_dmg_volumes_dir` - Defaults to 'Git 2.7.1 Mavericks Intel Universal'
- `osx_dmg_url` - Defaults to Sourceforge
- `osx_dmg_checksum` - Defaults to the value for 2.7.1
- `source_checksum` - Defaults to a known value for the 2.8.1 source tarball
# used by the Windows package providers
- `windows_display_name` - Windows display name
- `windows_package_url` - Defaults to the Internet
- `windows_package_checksum` - Defaults to the value for 2.7.4
- `windows_package_checksum` - Defaults to the value for 2.8.1
## Recipes
@ -127,11 +130,6 @@ This cookbook ships with ready to use, attribute driven recipes that utilize the
- `node['git']['checksum']` - package SHA256 checksum
- `node['git']['display_name']` - `windows_package` resource Display Name (makes the package install idempotent)
### Mac OS X
- `node['git']['osx_dmg']['url']` - URL to git package
- `node['git']['osx_dmg']['checksum']` - package SHA256 checksum
### Linux
- `node['git']['prefix']` - git install directory
@ -140,11 +138,13 @@ This cookbook ships with ready to use, attribute driven recipes that utilize the
- `node['git']['checksum']` - tarball SHA256 checksum
- `node['git']['use_pcre']` - if true, builds git with PCRE enabled
## License & Authors
## Maintainers
- Author:: Joshua Timberman ([joshua@chef.io](mailto:joshua@chef.io))
- Author:: Sean OMeara ([sean@sean.io](mailto:sean@sean.io))
- Copyright:: 2009-2017, Chef Software, Inc.
This cookbook is maintained by Chef's Community Cookbook Engineering team. Our goal is to improve cookbook quality and to aid the community in contributing to cookbooks. To learn more about our team, process, and design goals see our [team documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/COOKBOOK_TEAM.MD). To learn more about contributing to cookbooks like this see our [contributing documentation](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD), or if you have general questions about this cookbook come chat with us in #cookbok-engineering on the [Chef Community Slack](http://community-slack.chef.io/)
## License
**Copyright:** 2009-2017, Chef Software, Inc.
```
Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -3,7 +3,7 @@
# Cookbook:: git
# Attributes:: default
#
# Copyright:: 2008-2016, Chef Software, Inc.
# Copyright:: 2008-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
@ -29,17 +29,11 @@ when 'windows'
end
default['git']['url'] = 'https://github.com/git-for-windows/git/releases/download/v%{version}.windows.1/Git-%{version}-%{architecture}-bit.exe'
default['git']['display_name'] = "Git version #{node['git']['version']}"
when 'mac_os_x'
default['git']['osx_dmg']['app_name'] = 'git-2.8.1-intel-universal-mavericks'
default['git']['osx_dmg']['volumes_dir'] = 'Git 2.8.1 Mavericks Intel Universal'
default['git']['osx_dmg']['package_id'] = 'GitOSX.Installer.git281Universal.git.pkg'
default['git']['osx_dmg']['url'] = 'http://sourceforge.net/projects/git-osx-installer/files/git-2.8.1-intel-universal-mavericks.dmg/download'
default['git']['osx_dmg']['checksum'] = 'c2912895a1e2018d9be4c646765d511f7c82e0114275505dbd13d1ac70c62023'
else
default['git']['prefix'] = '/usr/local'
default['git']['version'] = '2.8.1'
default['git']['version'] = '2.17.1'
default['git']['url'] = 'https://nodeload.github.com/git/git/tar.gz/v%{version}'
default['git']['checksum'] = 'e08503ecaf5d3ac10c40f22871c996a392256c8d038d16f52ebf974cba29ae42'
default['git']['checksum'] = '690f12cc5691e5adaf2dd390eae6f5acce68ae0d9bd9403814f8a1433833f02a'
default['git']['use_pcre'] = false
end

View File

@ -3,9 +3,8 @@ module GitCookbook
# linux packages default to distro offering
def parsed_package_name
return new_resource.package_name if new_resource.package_name
return 'git-core' if node['platform'] == 'ubuntu' && node['platform_version'].to_f < 10.10
return 'developer/versioning/git' if node['platform'] == 'omnios'
return 'scmgit' if node['platform'] == 'smartos'
return 'developer/versioning/git' if platform?('smartos')
return 'scmgit' if platform?('smartos')
'git'
end
@ -21,7 +20,7 @@ module GitCookbook
def parsed_source_checksum
return new_resource.source_checksum if new_resource.source_checksum
'8d53703d75890c03e26a915c7af3b7b98d8cfb94382f685a9bcbee1eeaec47b4' # 2.7.4 tarball
'690f12cc5691e5adaf2dd390eae6f5acce68ae0d9bd9403814f8a1433833f02a' # 2.17.1 tarball
end
# windows

View File

@ -1,16 +0,0 @@
if defined?(ChefSpec)
ChefSpec.define_matcher(:git_client)
ChefSpec.define_matcher(:git_service)
def set_git_config(resource_name) # rubocop:disable Style/AccessorMethodName
ChefSpec::Matchers::ResourceMatcher.new(:git_config, :set, resource_name)
end
def install_git_client(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:git_client, :install, resource_name)
end
def install_git_service(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:git_service, :install, resource_name)
end
end

View File

@ -1,12 +1,6 @@
class Chef
class Provider
class GitClient < Chef::Provider::LWRPBase
use_inline_resources
def whyrun_supported?
true
end
include GitCookbook::Helpers
end
end

View File

@ -2,20 +2,10 @@ class Chef
class Provider
class GitClient
class Osx < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
provides :git_client, os: 'mac_os_x'
provides :git_client, platform: 'mac_os_x'
action :install do
dmg_package 'GitOSX-Installer' do
app new_resource.osx_dmg_app_name
package_id new_resource.osx_dmg_package_id
volumes_dir new_resource.osx_dmg_volumes_dir
source new_resource.osx_dmg_url
checksum new_resource.osx_dmg_checksum
type 'pkg'
action :install
end
package 'git'
end
action :delete do

View File

@ -2,14 +2,9 @@ class Chef
class Provider
class GitClient
class Package < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
provides :git_client, os: 'linux'
action :install do
# FIXME: rhel 5
include_recipe 'yum-epel' if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 5
# Software installation
package "#{new_resource.name} :create #{parsed_package_name}" do
package_name parsed_package_name

View File

@ -2,30 +2,16 @@ class Chef
class Provider
class GitClient
class Source < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
action :install do
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" unless platform_family?('rhel', 'suse', 'fedora', 'debian')
raise "#{node['platform']} is not supported by the git_client source resource" unless platform_family?('rhel', 'suse', 'fedora', 'debian', 'amazon')
include_recipe 'build-essential'
include_recipe 'yum-epel' if node['platform_family'] == 'rhel' && node['platform_version'].to_i == 5
build_essential 'install compilation tools for git'
# move this to attributes.
case node['platform_family']
when 'fedora'
pkgs = %w(tar openssl-devel libcurl-devel expat-devel perl-ExtUtils-MakeMaker)
when 'rhel'
case node['platform_version'].to_i
when 5
pkgs = %w(tar expat-devel gettext-devel curl-devel openssl-devel zlib-devel)
pkgs += %w( pcre-devel ) if new_resource.source_use_pcre
when 6, 7
pkgs = %w(tar expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel)
pkgs += %w( pcre-devel ) if new_resource.source_use_pcre
else
pkgs = %w(expat-devel gettext-devel curl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel) if node['platform'] == 'amazon'
pkgs += %w( pcre-devel ) if new_resource.source_use_pcre
end
when 'rhel', 'fedora', 'amazon'
pkgs = %w(tar expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel)
pkgs += %w( pcre-devel ) if new_resource.source_use_pcre
when 'debian'
pkgs = %w(libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev)
pkgs += %w( libpcre3-dev ) if new_resource.source_use_pcre
@ -52,7 +38,7 @@ class Chef
command <<-COMMAND
(mkdir git-#{new_resource.source_version} && tar -zxf git-#{new_resource.source_version}.tar.gz -C git-#{new_resource.source_version} --strip-components 1)
(cd git-#{new_resource.source_version} && make prefix=#{new_resource.source_prefix} #{additional_make_params} install)
COMMAND
COMMAND
not_if "git --version | grep #{new_resource.source_version}"
not_if "#{new_resource.source_prefix}/bin/git --version | grep #{new_resource.source_version}"
end

View File

@ -3,8 +3,6 @@ class Chef
class Provider
class GitClient
class Windows < Chef::Provider::GitClient
include Chef::DSL::IncludeRecipe
provides :git_client, os: 'windows'
action :install do
@ -22,7 +20,7 @@ class Chef
else
ENV['ProgramW6432'] || ENV['ProgramFiles']
end
GIT_PATH = "#{PROGRAM_FILES}\\Git\\Cmd".freeze
GIT_PATH = "#{PROGRAM_FILES}\\Git\\Cmd"
# COOK-3482 - windows_path resource doesn't change the current process
# environment variables. Therefore, git won't actually be on the PATH
@ -36,7 +34,7 @@ class Chef
end
windows_path GIT_PATH do
notifies :create, 'ruby_block[Add Git Path]', :immediately
notifies :run, 'ruby_block[Add Git Path]', :immediately
action :add
end
end

View File

@ -1,19 +1,13 @@
class Chef
class Provider
class GitClient < Chef::Provider::LWRPBase
use_inline_resources
def whyrun_supported?
true
end
include Chef::DSL::IncludeRecipe
include GitCookbook::Helpers
provides :git_service, os: 'linux'
action :create do
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" if node['platform'] == 'windows'
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" if platform?('windows')
include_recipe 'git'

View File

@ -1,55 +0,0 @@
class Chef
class Provider
class GitClient < Chef::Provider::LWRPBase
use_inline_resources
def whyrun_supported?
true
end
include Chef::DSL::IncludeRecipe
include GitCookbook::Helpers
action :create do
return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe" if node['platform'] == 'windows'
include_recipe 'git'
directory new_resource.service_base_path do
owner 'root'
group 'root'
mode '0755'
end
case node['platform_family']
when 'debian'
package 'xinetd'
when 'rhel'
package 'git-daemon'
else
log 'Platform requires setting up a git daemon service script.'
log "Hint: /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=#{new_resource.service_base_path}"
return
end
template '/etc/xinetd.d/git' do
backup false
source 'git-xinetd.d.erb'
owner 'root'
group 'root'
mode '0644'
variables(
git_daemon_binary: value_for_platform_family(
'debian' => '/usr/lib/git-core/git-daemon',
'rhel' => '/usr/libexec/git-core/git-daemon'
)
)
end
service 'xinetd' do
action [:enable, :restart]
end
end
end
end
end

File diff suppressed because one or more lines are too long

26
cookbooks/git/metadata.rb Normal file
View File

@ -0,0 +1,26 @@
name 'git'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Installs git and/or sets up a Git server daemon'
version '10.0.0'
supports 'amazon'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'freebsd'
supports 'mac_os_x'
supports 'omnios'
supports 'oracle'
supports 'redhat'
supports 'smartos'
supports 'scientific'
supports 'suse'
supports 'opensuseleap'
supports 'ubuntu'
supports 'windows'
source_url 'https://github.com/chef-cookbooks/git'
issues_url 'https://github.com/chef-cookbooks/git/issues'
chef_version '>= 14'

View File

@ -2,7 +2,7 @@
# Cookbook:: git
# Recipe:: default
#
# Copyright:: 2008-2016, Chef Software, Inc.
# Copyright:: 2008-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
# Cookbook:: git
# Recipe:: package
#
# Copyright:: 2008-2016, Chef Software, Inc.
# Copyright:: 2008-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -17,17 +17,6 @@
# limitations under the License.
case node['platform']
when 'mac_os_x'
# FIXME: The resource has three distinct groups of properties used in
# different providers... should we make multiple resource types instead?
git_client 'default' do
osx_dmg_app_name node['git']['osx_dmg']['app_name']
osx_dmg_package_id node['git']['osx_dmg']['package_id']
osx_dmg_volumes_dir node['git']['osx_dmg']['volumes_dir']
osx_dmg_url node['git']['osx_dmg']['url']
osx_dmg_checksum node['git']['osx_dmg']['checksum']
action :install
end
when 'windows'
include_recipe 'git::windows'
else

View File

@ -2,7 +2,7 @@
# Cookbook:: git
# Recipe:: server
#
# Copyright:: 2009-2016, Chef Software, Inc.
# Copyright:: 2009-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@ -2,7 +2,7 @@
# Cookbook:: git
# Recipe:: windows
#
# Copyright:: 2008-2016, Chef Software, Inc.
# Copyright:: 2008-2019, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@ -1,4 +1,4 @@
property :key, String, name_attribute: true
property :key, String, name_property: true
property :value, String
property :scope, equal_to: %w(local global system), default: 'global', desired_state: false
property :path, String, desired_state: false
@ -6,10 +6,6 @@ property :user, String, desired_state: false
property :group, String, desired_state: false
property :options, String, desired_state: false
attr_accessor :exists
require 'mixlib/shellout'
def initialize(*args)
super
@ -38,7 +34,7 @@ action :set do
end
end
action_class.class_eval do
action_class do
def config_cmd
"git config --#{new_resource.scope}"
end

View File

@ -1,2 +0,0 @@
#!/bin/sh
exec svlogd -tt ./main

View File

@ -1,3 +0,0 @@
#!/bin/sh
exec 2>&1
exec /usr/bin/git daemon <%= node['git']['server']['export_all'] ? '--export-all' : nil %> --user=nobody --group=daemon --syslog --base-path=<%= node["git"]["server"]["base_path"] %> <%= node["git"]["server"]["base_path"] %>

View File

@ -0,0 +1,98 @@
# CHANGELOG for golang
This file is used to list changes made in each version of golang.
## 4.1.0
- Create a custom resource to install Go from source or by downloading a package
## 4.0.0
- Update testing setup:
- Use Chef Workstation instead of Rubygems
- Includes dropping `foodcritic` in favor of current `cookstyle`
- Add more recent & current distro versions
- Add very basic unit tests
- Use GitHub Actions instead of Travis CI
- Refactor minitest to Inspec
- Refactor to use current style of Chef Custom Resource
- Update default version to Go v1.14.4
- Use `build_essential` when building from source
- Requires Chef >= 14.0.0
- Omit attempting to install `bzr` on CentOS 8, they do not have that package available
- Utilize default Chef order-of-operations instead of `notifies`
- Use `ark` resource to simplify download & installation of binary & source
- Clean up unnecessary env vars from source build
- Build from source per [official Go docs](https://golang.org/doc/install/source)
- Use native resources instead of shell commands when building from source
- Set `$PATH` in `golang.sh` so that the existing values are last, per general practice
- Tighten up `golang_package` so it does not perform actions at compile time, it uses `execute` in favor of `bash` resources, and in general is more Chef-y
- Update tests to validate that non-root users can install Go and Go packages
- Refactor attributes to add ability to install a version from source that differs from the packaged version (which is needed to build from source)
## 3.0.0
- rename to `chef-golang` so that metadata name matches repositoriy name
## 2.0.0
- change attribute namespace to `node['golang']`
## 1.7.2
- Better chef12,13 support
- Ruby 2.3
- Update gems, lint
## 1.7.1
- Create a temporary directory
## 1.7.0
- Golang 1.5
## 1.6.2
- Ability to install from source
## 1.6.0
- Removed support for Ruby 1.9.3
## 1.5.1
- Fix testing with Vagrant, Test-Kitchen
- Golang 1.4
## 1.5.0
- Golang 1.3
## 1.4.0
- Add build action to LWRP
- Update default go version to 1.2.2
- Add autodetection the platform architecture
- Change package location to `http://golang.org/dl/`
## 1.3.0
## 1.2.0
## 1.1.0
- Added package LWRP
- Configurable `gopath` & `gobin`
## 1.0.2
- Lets users easily specify another install dir
## 1.0.1
- Avoid extra unpacked copy of Go
## 1.0.0
- Initial release of golang

View File

@ -0,0 +1,4 @@
# Contributing
Please refer to
[https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD](https://github.com/chef-cookbooks/community_cookbook_documentation/blob/master/CONTRIBUTING.MD)

View File

@ -0,0 +1,77 @@
# Golang (Go) Cookbook
[![Cookbook Version](https://img.shields.io/cookbook/v/golang.svg?style=flat)](https://supermarket.chef.io/cookbooks/golang)
[![CI State](https://github.com/sous-chefs/golang/workflows/ci/badge.svg)](https://github.com/sous-chefs/golang/actions?query=workflow%3Aci)
[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)
[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
## Description
Chef cookbook for the [Go programming language](http://golang.org/).
## Requirements
### Platform
* Ubuntu >= 18.04
* Debian >= 8
* CentOS >= 7
## Usage
### golang::default
Include `golang` in your node's `run_list`:
```json
{
"name":"my_node",
"run_list": [
"recipe[golang]"
]
}
```
### golang::packages
To install Go packages using node attributes add the packages to the `['golang']['packages']` attribute:
```json
{
"name":"my_node",
"golang": {
"packages": [
"github.com/go-check/check"
]
},
"run_list": [
"recipe[golang]"
]
}
```
## Contributors
This project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890&button=false)
### Backers
Thank you to all our backers!
![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600&avatarHeight=40)
### Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100)
![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100)

View File

@ -0,0 +1,15 @@
#
# Cookbook:: golang
# Attribute:: default
#
default['golang']['scm'] = true
default['golang']['scm_packages'] = value_for_platform(
'centos' => { '>= 8' => %w(git mercurial) },
'default' => %w(git mercurial bzr)
)
default['golang']['install_dir'] = '/usr/local'
default['golang']['gopath'] = '/opt/go'
default['golang']['gobin'] = '/opt/go/bin'
default['golang']['packages'] = []

Some files were not shown because too many files have changed in this diff Show More