368 Commits

Author SHA1 Message Date
6607474370 Configure commit signing for Gitea
refs #237
2024-08-09 16:13:58 +02:00
ec9b912e45 Merge pull request 'Configure nginx default vhost, add specific redirects for some domains' (#565) from chore/nginx_redirects into master
Reviewed-on: #565
2024-08-09 12:44:29 +00:00
d53ba42a1d Make kosmos.org the default nginx vhost 2024-08-04 16:51:57 +02:00
a99f7f7574 Add config for accounts .well-known proxyying 2024-08-04 16:51:18 +02:00
1c8ee14bb3 Add HTTP redirects for kosmos.chat and kosmos.cash 2024-08-04 16:49:20 +02:00
cdedf49be3 Merge pull request 'Fix download URLs for Mastodon exports/archives' (#564) from bugfix/mastodon_archive_download_urls into master
Reviewed-on: #564
2024-08-04 14:46:26 +00:00
5e727ec279 Fix download URLs for Mastodon exports/archives
See https://github.com/mastodon/mastodon/issues/24380
2024-08-04 14:55:22 +02:00
9d928298d2 Fix Gitea user/repo avatar URLs in certain situations
I encountered a CORS proxy which somehow ended up with http://_gitea_web
URLs.
2024-07-10 11:36:07 +02:00
1174661b46 Use proxy domain for RS Discourse ACME challenge 2024-07-08 20:31:46 +02:00
2dff7cf850 Merge pull request 'Add new service: nostr.kosmos.org (members-only nostr relay)' (#559) from feature/strfry into master
Reviewed-on: #559
Reviewed-by: Greg <greg@noreply.kosmos.org>
2024-07-05 07:33:40 +00:00
232360efba Remove commented code 2024-07-03 09:23:13 +02:00
8b8e8f3438 Move strfry extras into their own directory 2024-07-03 09:22:50 +02:00
522c213b09 Add Deno lockfile 2024-06-20 18:16:27 +02:00
80eddfbf56 Configure strfry whitelist
Allow akkounts pubkey to publish to our own relay
2024-06-20 15:38:27 +02:00
7e664723a1 Configure akkounts nostr relay URL in production 2024-06-20 15:04:17 +02:00
f5961af7fe Create/deploy strfry VM 2024-06-11 23:17:33 +02:00
d1301dad3e Add, configure, deploy strfry policies 2024-06-11 23:12:22 +02:00
42c46a5645 Deploy strfry reverse proxy 2024-06-11 23:10:24 +02:00
5be9081613 Header name has to be all lowercase in strfry config 2024-06-11 23:09:49 +02:00
1649d03665 Update strfry cookbook 2024-06-11 23:09:48 +02:00
b9a3910364 Update strfry cookbook 2024-06-11 23:09:48 +02:00
9835b85181 Fall back to default port for strfry proxy
When we don't override it elsewhere
2024-06-11 23:09:48 +02:00
dbccd9d2bf Add kosmos_strfry cookbook, configs 2024-06-11 23:09:48 +02:00
1a5f312699 Add strfry cookbook 2024-06-11 23:09:48 +02:00
f843a31e03 Merge pull request 'Improve mail server TLS certificate management' (#556) from chore/mail_server_cert into master
Reviewed-on: #556
Reviewed-by: Greg <greg@noreply.kosmos.org>
2024-06-05 14:49:01 +00:00
ff313525c8 Reload postfix and dovecot on cert renewal
closes #552

Co-authored-by: Greg Karékinian <greg@karekinian.com>
2024-06-05 16:44:18 +02:00
cfb379741e Add imap and smtp subdomains to mail server cert
closes #543

Co-authored-by: Greg Karékinian <greg@karekinian.com>
2024-06-05 15:55:29 +02:00
0c29fad404 Remove superfluous license header
Co-authored-by: Greg Karékinian <greg@karekinian.com>
2024-06-05 15:50:09 +02:00
416935d8b5 Merge pull request 'Upgrade Gitea to 1.22' (#555) from chore/upgrade_gitea into master
Reviewed-on: #555
2024-06-02 21:18:07 +00:00
2b6f81c5d6 Upgrade Gitea to 1.22 2024-06-02 23:17:16 +02:00
18496bb0da Merge pull request 'Configure akkounts for nostr zaps' (#554) from chore/akkounts_config into master
Reviewed-on: #554
2024-06-02 21:05:15 +00:00
d878b4208e Configure akkounts for nostr zaps 2024-06-02 23:03:06 +02:00
d31440d235 Add CORS headers to kosmos.social LNURL paths 2024-06-02 23:02:22 +02:00
6f287f14ef Deploy live branch 2024-06-02 23:01:49 +02:00
b77df3d0db Update email aliases 2024-05-16 14:34:09 +02:00
f7f5a0069d Merge pull request 'Add support for proxy domain validation to tls_cert resource' (#553) from feature/letsencrypt_proxy_validation into master
Reviewed-on: #553
Reviewed-by: Greg <greg@noreply.kosmos.org>
2024-05-08 12:30:29 +00:00
989185f951 Support proxy domain validation for Garage web domains
Also rename the data bag item
2024-04-30 12:23:36 +02:00
4cbda69a6b Add support for proxy domain validation to tls_cert resource 2024-04-26 12:24:17 +02:00
6931fe05d0 Hide Gitea version and load times in footer 2024-04-07 13:16:19 +03:00
b248ef70db Upgrade Gitea to 1.21.10 2024-04-07 13:10:10 +03:00
45159ad4e7 Resolve Mastodon addresses as Lightning Address 2024-03-31 08:27:20 +04:00
612cd0c55e Merge pull request 'Configure LDAP login for Mastodon (merge .social and .org accounts)' (#551) from feature/mastodon_ldap_integration into master
Reviewed-on: #551
Reviewed-by: Greg <greg@noreply.kosmos.org>
2024-03-29 09:51:42 +00:00
83380047bb Configure LDAP integration for Mastodon 2024-03-29 09:28:13 +04:00
8aebb386a4 Configure Mastodon user address domain for akkounts 2024-03-27 20:19:24 +04:00
a8c4f0bd0e Merge pull request 'Only allow ejabberd logins when XMPP service is enabled for user' (#550) from feature/xmpp_service_enabled into master
Reviewed-on: #550
2024-03-27 16:17:04 +00:00
12b4fb37fa Only allow ejabberd logins when XMPP service is enabled 2024-03-27 20:12:33 +04:00
263eb88b72 Add new env var for akkounts 2024-03-14 23:05:05 +01:00
25ee38fe27 Update kredits-ipfs-pinner 2024-03-14 23:04:27 +01:00
e701938442 Merge pull request 'Support letsencrypt proxy validation via CNAMEs' (#548) from feature/letsencrypt_proxy_validation into master
Reviewed-on: #548
Reviewed-by: greg <greg@noreply.kosmos.org>
2024-03-12 14:11:14 +00:00
309bc45791 Merge pull request 'Fix backup script removing image after unsuccessful pivot' (#549) from bugfix/vm_backups into master
Reviewed-on: #549
2024-03-11 15:35:50 +00:00
82a4af05ef Fix backup script removing image after unsuccessful pivot
If pivoting the VM backing storage back to the original image fails
(e.g. VM being down at that time), the script currently still deletes
the hotswap image, which means that all changes since the creation of
the hotswap image are lost.
2024-03-11 16:26:14 +01:00
4a8ab3abe3 Support letsencrypt proxy validation via CNAMEs
Allows to point other domains' `_acme-challenge.example.com` entries at
`example.com.letsencrypt.kosmos.chat` so we can validate from our side
without access to the other domain's DNS records.

Used for 5apps.com XMPP for now. Can be used for others later.

Co-authored-by: Greg Karékinian <greg@karekinian.com>
2024-03-11 16:21:28 +01:00
21de964e1b Upgrade nbxplorer, btcpay 2024-03-11 16:14:03 +01:00
b4ddfd19e3 Upgrade Ruby for latest Mastodon release 2024-03-11 16:13:48 +01:00
08c604962c Upgrade Ruby for latest akkounts release 2024-03-11 16:13:30 +01:00
089574d0de Merge pull request 'Update Gitea and act_runner, improve recipes' (#547) from chore/upgrade_gitea into master
Reviewed-on: #547
2024-03-11 15:12:00 +00:00
d19a8eebfb Update Gitea and act_runner, improve recipes 2024-03-11 16:11:12 +01:00
c0487d0e13 Deploy 5apps Gitea act runner 2024-03-11 16:08:22 +01:00
023a4261cd Update node info 2024-03-11 16:07:32 +01:00
fea65404cf Deploy new garage node 2024-03-11 16:03:22 +01:00
5139f242a4 Merge pull request 'Switch postgresql primary, deploy new replica' (#546) from switch_postgres_primary into master
Reviewed-on: #546
2024-03-11 14:59:57 +00:00
9c2aa9faaa Add info about required, unautomated step to script 2024-03-11 15:57:46 +01:00
164b974eb8 Switch postgresql primary, deploy new replica 2024-03-11 15:55:05 +01:00
6e4cc48068 Upgrade Gitea to 1.21.5 2024-02-05 14:39:12 +02:00
c2bd03dc23 Update node info 2024-02-05 10:14:27 +02:00
210a83a686 Increase max user offline messages for ejabberd 2024-02-04 15:47:55 +02:00
49db14869d Merge pull request 'Add Liquor Cabinet cookbooks and configs, deploy to production' (#541) from feature/535-liquor_cabinet into master
Reviewed-on: #541
2024-02-04 13:47:05 +00:00
000a13cec4 Merge pull request 'Set up coturn, switch from ejabberd in production' (#532) from feature/coturn into master
Reviewed-on: #532
2024-02-04 13:46:50 +00:00
5f7701c288 Fix missing listen IP for storage proxy 2024-01-29 18:16:07 +02:00
bcaee3bb21 Fix ActiveStorage not liking the local S3 endpoint 2024-01-29 18:15:36 +02:00
f352901582 Consolidate akkounts well-known proxying, add Webfinger and Nostr
refs #158
2024-01-29 14:17:15 +02:00
5c1c63f94e Add S3/Garage config for akkounts 2024-01-26 10:40:36 +03:00
98543f3e7d Configure RS integration for akkounts 2024-01-26 09:01:55 +03:00
7ab83d3d82 Section header comments for ENV vars
Improve readability of recipe
2024-01-26 09:00:25 +03:00
b5020efdd5 Merge branch 'master' into feature/535-liquor_cabinet 2024-01-26 08:19:50 +03:00
2763244fdc Merge pull request 'Config updates and improvements for new akkounts release' (#542) from chore/akkounts_updates into master
Reviewed-on: #542
2024-01-26 05:19:16 +00:00
e10e54c12a Deploy liquor-cabinet proxy to production 2024-01-26 08:16:26 +03:00
6114f0f799 Add liquor-cabinet proxy recipe 2024-01-26 08:15:53 +03:00
a2ec41b68a Add/use kosmos_liquor-cabinet cookbook 2024-01-25 17:42:56 +03:00
715fdbc2ba Node-attribute ALL THE THINGS 2024-01-25 17:40:42 +03:00
211a613e5c Add liquor-cabinet configs, deploy to production 2024-01-25 16:27:31 +03:00
d3c22ea787 Add liquor_cabinet cookbook 2024-01-25 16:26:41 +03:00
6047ea3f84 Merge pull request 'Add support for Redis replication, set up in production' (#540) from feature/redis_replication into master
Reviewed-on: #540
2024-01-25 10:19:12 +00:00
7d478f0183 Set up Redis replication in production 2024-01-24 18:12:22 +03:00
88e96747e3 Add Redis replica recipe and role 2024-01-24 18:11:58 +03:00
4b04aa7cd9 Let akkounts API proxy forward all API requests
... instead of just a specific subdirectory/path
2024-01-24 16:19:04 +03:00
2597e211ed Add new akkounts configs 2024-01-24 16:18:50 +03:00
f96faf9fa2 Install libvips for image manipulation in akkounts 2024-01-24 16:18:19 +03:00
c32e8bc9e5 Add new garage nodes 2024-01-11 18:38:22 +03:00
Râu Cao
24b22b8f91 Merge pull request 'Add email service' (#526) from feature/email into master
Reviewed-on: #526
2024-01-10 12:09:21 +00:00
456ec7a5fa Deploy new email VM 2024-01-09 15:57:04 +03:00
daadd9374f Use attribute for root dir 2024-01-08 11:35:04 +03:00
98acd429de Add configs for virtual email aliases 2024-01-08 11:29:56 +03:00
cfa7da2051 Create vmail dir on fresh systems 2024-01-08 10:47:19 +03:00
0d3082e1c8 Upgrade Gitea to 1.21.3 2024-01-01 16:13:15 +03:00
e1007f7886 ejabberd disco config additions 2023-12-18 13:23:21 +01:00
292366a77f Domain vs realm vs IP 2023-12-18 13:23:05 +01:00
ed998fc1d3 Use TCP for TLS connections 2023-12-18 13:22:34 +01:00
8a97ebf4f8 Use domain instead of IP, add TLS endpoints 2023-12-17 17:57:49 +01:00
ca3f06f831 Increase size of port range for TURN 2023-12-17 17:05:06 +01:00
1576a8e731 Set up coturn, switch from ejabberd in production
https://github.com/coturn/coturn
2023-12-17 15:20:11 +01:00
6e3fb80565 Upgrade CLN 2023-12-16 19:23:09 +01:00
Râu Cao
295d95c048 Upgrade Gitea to 1.21.1 2023-12-16 11:49:35 +01:00
789532fae9 Merge pull request 'Upgrade bitcoind, LND, CLN, RTL, NBXplorer, BTCPay' (#531) from chore/upgrade_bitcoin_software into master
Reviewed-on: #531
2023-12-14 17:15:40 +00:00
Râu Cao
404f492e6e Update node info 2023-12-14 18:14:37 +01:00
Râu Cao
574f78f128 Upgrade bitcoind, LND, CLN, RTL, NBXplorer, BTCPay
Also required upgrading node.js and the .NET SDK.
2023-12-14 18:12:29 +01:00
f4d1009473 Merge pull request 'Switch to virtual domains/aliases/mailboxes' (#530) from feature/email_virtual_domains into feature/email
Reviewed-on: #530
2023-12-13 12:06:44 +00:00
Râu Cao
69af908f6b Virtual domain configs 2023-12-13 13:05:31 +01:00
Râu Cao
e8880ded90 Remove vagrant (dev) node config files
No need for sharing them, since the actual roles etc. are defined in the
Vagrantfile.
2023-12-07 10:37:09 +01:00
Râu Cao
10dd3bf16e Add new RSK testnet node, don't serve from current one 2023-12-07 09:55:29 +01:00
Râu Cao
ca580bcfe2 Set email report contact in production 2023-12-07 09:37:37 +01:00
5b0cb438ba Merge pull request 'Set up SpamAssassin' (#529) from feature/spamassassin into feature/email
Reviewed-on: #529
2023-12-06 11:28:14 +00:00
Râu Cao
5a4cdf9c30 Prevent local users from impersonating other local users 2023-12-06 12:27:38 +01:00
Râu Cao
b3f2ca415e Set up SpamAssassin
Scan incoming and outgoing email for spam. Use a local Unbound for DNS,
so we don't run into blocks for RBL queries.
2023-12-06 12:22:24 +01:00
Râu Cao
05ccbcc58f Merge branch 'master' into feature/email 2023-12-05 18:37:43 +01:00
Râu Cao
e3c4bf8969 Update node config 2023-12-05 18:21:26 +01:00
Râu Cao
cc6cebb8a2 Increase TURN throughput allowance 2023-12-05 18:20:27 +01:00
Râu Cao
4dbc960eed Switch ejabberd node handling TURN
Should use the same outgoing IP as for incoming
2023-12-05 18:19:48 +01:00
ce47072b0d Merge pull request 'Improve VM backups, configure backups on "her"' (#528) from feature/backup_improvements into master
Reviewed-on: #528
2023-12-05 17:18:40 +00:00
Râu Cao
7805182457 Change borg backup default interval to 3 hrs 2023-12-05 18:16:15 +01:00
Râu Cao
769ac4a081 Support node-specific borg repo config 2023-12-05 18:09:44 +01:00
Râu Cao
b1763cd032 Pattern-match node names for VM backup exclusion 2023-12-05 18:04:57 +01:00
Râu Cao
c746b38ebf Update node info 2023-12-05 14:19:52 +01:00
0a58cac0cf Merge pull request 'Set up DKIM signing and verification' (#527) from feature/email_dkim into feature/email
Reviewed-on: #527
2023-12-04 12:42:37 +00:00
Râu Cao
42c04538d8 Set up DKIM signing and verification 2023-12-04 13:40:37 +01:00
Râu Cao
c9ad3c2d18 Create/configure common default mailboxes 2023-12-04 13:33:23 +01:00
Râu Cao
fbad0bf896 More explicit postfix configs 2023-12-03 18:33:12 +01:00
Râu Cao
8a7eeb1dd9 Change INBOX location 2023-12-03 18:32:55 +01:00
Râu Cao
568197737a Fix SMTP connection delay when peer hostname cannot be resolved 2023-12-03 18:31:47 +01:00
Râu Cao
738e96f7e4 Fix auth for SMTP submission on port 465 2023-12-03 18:31:12 +01:00
Râu Cao
87411274ae Configure email domain for production 2023-12-03 18:29:35 +01:00
Râu Cao
ce00852bba Remove obsolete config file 2023-12-01 12:19:21 +01:00
Râu Cao
366c0c0d3c Add WIP email domain and hostname 2023-12-01 10:02:25 +01:00
Râu Cao
89d00afd1c Set up email proxy 2023-12-01 10:02:11 +01:00
Râu Cao
e4abfb1b75 Use more reasonable priority for attributes in recipe 2023-12-01 10:01:34 +01:00
Râu Cao
335a082171 Put an LDAP server in the production env 2023-12-01 10:00:35 +01:00
Râu Cao
9d0ff358ef Only use certbot deploy hook when applicable 2023-12-01 10:00:07 +01:00
Râu Cao
495a4231fb Add mail server node 2023-12-01 09:59:41 +01:00
Râu Cao
51068e5259 Add email credentials 2023-12-01 09:58:25 +01:00
Râu Cao
fbcf1ed5e7 WIP Add initial cookbook and roles for email service 2023-12-01 09:56:54 +01:00
Râu Cao
158a9c2fbe Update postfix cookbook 2023-11-29 22:26:59 +01:00
Râu Cao
1e9878d17e Remove obsolete clients 2023-11-28 22:43:21 +01:00
Râu Cao
3df7a386e6 Remove rsk-testnet-3 2023-11-28 22:43:21 +01:00
cbeddefa34 Merge pull request 'Set max size for external S3 upload requests' (#525) from bugfix/s3_nginx_max_upload_size into master
Reviewed-on: #525
2023-11-15 13:04:34 +00:00
Râu Cao
aefd01d38d Remove old RSK mainnet node 2023-11-15 13:22:15 +01:00
Râu Cao
5765c08d6e Fail over to next node when and RSK backend is down 2023-11-15 13:21:46 +01:00
Râu Cao
aaae90bc0d Don't exit VM backup scripts immediately on failures 2023-11-15 13:20:42 +01:00
Râu Cao
087616b6b6 Set max size for external S3 upload requests
Fix uploads failing when exceeding the default nginx limit
2023-11-08 21:44:49 +01:00
Râu Cao
390753faa3 Increase update delay for Gandi DNS records 2023-11-05 01:01:16 +01:00
Râu Cao
1a3516904d Update node info 2023-11-05 01:01:04 +01:00
adafb132ee Merge pull request 'Upgrade Mastodon to 4.2.1' (#524) from chore/upgrade_mastodon into master
Reviewed-on: #524
2023-11-05 00:00:51 +00:00
Râu Cao
8071f44f41 Upgrade Mastodon to 4.2.1 2023-11-05 00:57:43 +01:00
Râu Cao
05d04fe76c Update node info 2023-11-04 15:25:01 +01:00
231811f9d0 Merge pull request 'Upgrade Gitea to 1.20.5' (#523) from chore/upgrade_gitea into master
Reviewed-on: #523
2023-11-04 14:15:47 +00:00
Râu Cao
9fa7d8b28f Upgrade Gitea to 1.20.5 2023-11-04 15:14:58 +01:00
5fbc48df9a Merge pull request 'Upgrade RSKj to 5.3.0, deploy new nodes' (#522) from chore/upgrade_rskj_jammy into master
Reviewed-on: #522
2023-11-04 14:09:30 +00:00
Râu Cao
925a5da239 Upgrade RSKj to 5.3.0, deploy new nodes
Adapted the cookbook for new nodes running on Jammy.
2023-11-04 15:06:31 +01:00
Râu Cao
3d3156a031 Add new host 2023-11-01 12:39:17 +01:00
2c33ee79f2 Merge pull request 'Upgrade ejabberd to 23.10, enable anonymous occupant IDs' (#520) from chore/upgrade_ejabberd into master
Reviewed-on: #520
2023-11-01 11:32:18 +00:00
Râu Cao
abc168ebf1 Upgrade ejabberd to 23.10, enable anonymous occupant IDs 2023-11-01 12:29:23 +01:00
873c235539 Merge pull request 'Migrate ejabberd uploads to mod_s3_upload and Garage' (#518) from feature/469-ejabberd_s3 into master
Reviewed-on: #518
2023-10-17 19:07:23 +00:00
Râu Cao
65d71d6a73 Migrate ejabberd uploads to mod_s3_upload and Garage
In addition to installing and configuring the new module, this also
enables public access to the S3 API via `bucket-name.s3.kosmos.org` as
well as Web access on `bucket-name.web.s3.kosmos.org` (when enabled).

Also includes some drive-by improvements to Chef attribute naming and
usage.

Co-authored-by: Greg Karékinian <greg@karekinian.com>
2023-10-10 17:55:55 +02:00
Râu Cao
832075dfb2 Shorten root domains for external Garage S3 and Web access
And move the configuration-specific preceding dot to the config
template.
2023-10-10 16:34:23 +02:00
1c9e28448f Merge pull request 'Improve PostgreSQL streaming replication in production' (#516) from feature/keep_wal_segments into master
Reviewed-on: #516
2023-10-07 08:18:24 +00:00
Râu Cao
3505212e92 Add missing header to RS discourse proxy config 2023-10-04 12:36:07 +02:00
Râu Cao
2d3872a692 Update chef client on postgres-4
refs #500
2023-10-02 15:48:50 +02:00
Râu Cao
eb1303a8da Fix postgres primary not holding onto any WAL segments for later sync
closes #515
2023-10-02 15:46:26 +02:00
9af38219af Merge pull request 'Upgrade bitcoind, LND, .NET, NBXplorer, and BTCPay' (#514) from chore/upgrade_btc_things into master
Reviewed-on: #514
2023-09-28 14:44:00 +00:00
Râu Cao
08d9819fd2 Upgrade bitcoind, LND, dotnet, NBXplorer, and BTCPay 2023-09-28 16:41:44 +02:00
Râu Cao
f0968aae5b Add Drone CI config for akkounts 2023-09-01 12:51:40 +02:00
b4ce426ce9 Merge pull request 'Upgrade Gitea to 1.20.3, Chef client to 18.x' (#512) from chore/upgrade_gitea into master
Reviewed-on: #512
2023-08-25 15:14:46 +00:00
Râu Cao
e65c58ff6c Upgrade Gitea to 1.20.3, Chef client to 18.x 2023-08-25 17:12:33 +02:00
cc8264432c Merge pull request 'Migrate nginx sites to openresty' (#511) from chore/migrate_nginx_sites_to_openresty into master
Reviewed-on: #511
2023-08-01 13:02:32 +00:00
Râu Cao
1650e429a8 Migrate fornax nginx to openresty 2023-07-31 15:57:13 +02:00
Râu Cao
123b304dd0 Use correct node attributes 2023-07-31 15:57:07 +02:00
Râu Cao
bbd25ebb9c Add nginx logs for gitea 2023-07-31 15:56:40 +02:00
Râu Cao
ec43f4ee0f Update openresty cookbook 2023-07-31 15:56:20 +02:00
Râu Cao
eab94090e8 Use openresty node attributes in openresty templates 2023-07-31 15:07:35 +02:00
Râu Cao
7f2805831c Remove obsolete cookbook 2023-07-31 15:07:18 +02:00
Râu Cao
0f12a54eab Refactor tor usage entirely
Use a custom resource and separate recipe for service configs with
pre-set keys and hostnames
2023-07-30 12:39:41 +02:00
Râu Cao
68b56789c5 Migrate ejabberd UDP streams to openresty
And remove the other streams in the process, in favor of running haproxy
on all LBs.
2023-07-30 12:39:36 +02:00
Râu Cao
438ee4ace0 Migrate Gitea SSH stream to openresty 2023-07-30 12:35:21 +02:00
Râu Cao
27bdc1f60d Update openresty cookbook 2023-07-30 12:34:21 +02:00
Râu Cao
cb0fc27134 Refactor tor usage, set up new tor proxy on draco 2023-07-29 16:26:20 +02:00
Râu Cao
b149264919 Use paths from node attributes 2023-07-29 14:30:46 +02:00
Râu Cao
53c35fda51 Migrate garage proxies to openresty 2023-07-26 16:42:48 +02:00
Râu Cao
bb2f41fdb3 Migrate hubot proxies to openresty 2023-07-26 16:21:03 +02:00
Râu Cao
027d0ed570 Migrate IPFS proxies to openresty 2023-07-26 16:12:33 +02:00
Râu Cao
1362da0add Migrate RS Discourse proxy to openresty 2023-07-26 15:57:08 +02:00
Râu Cao
15b2ea284a Migrate mastodon proxy to openresty 2023-07-26 15:44:04 +02:00
Râu Cao
ad59913555 Migrate lndhub proxy to openresty 2023-07-26 15:00:55 +02:00
Râu Cao
1bad2939de Migrate accounts API proxy to openresty 2023-07-26 15:00:43 +02:00
Râu Cao
7b5d46c813 Update openresty cookbook 2023-07-26 14:52:16 +02:00
Râu Cao
98d423aa70 Update roles 2023-07-26 14:16:33 +02:00
Râu Cao
4b14297f83 WIP Migrate Gitea proxy to openresty
TODO: Make nginx_ssh stream resource work with openresty cookbook
2023-07-26 14:15:46 +02:00
Râu Cao
1681942fb1 Migrate static website to openresty 2023-07-26 14:15:22 +02:00
Râu Cao
4d528d67ef Migrate RSK proxies to openresty 2023-07-26 14:08:44 +02:00
Râu Cao
53abc2ec9a Migrate Drone CI proxy to openresty 2023-07-26 14:07:48 +02:00
Râu Cao
543b482adb Migrate discourse proxy to openresty 2023-07-26 13:40:19 +02:00
Râu Cao
87657db8a7 Update openresty cookbook 2023-07-26 13:39:07 +02:00
Râu Cao
4b0b4b8d80 Migrate akkounts proxy to openresty 2023-07-26 13:31:28 +02:00
Râu Cao
77c97607d5 Update openresty cookbook 2023-07-26 13:31:27 +02:00
Râu Cao
4b08e4fc8c Add JSON log format to openresty 2023-07-26 13:31:23 +02:00
507a812f33 Merge pull request 'Exclude specified VMs from image backups' (#509) from feature/kvm_backup_exceptions into master
Reviewed-on: #509
2023-07-26 08:58:45 +00:00
Râu Cao
fb708743cc Remove obsolete node 2023-07-26 09:31:38 +02:00
Râu Cao
9568b7072d Exclude specified nodes/VMs from image backups 2023-07-25 16:58:16 +02:00
Râu Cao
a85bbc4a3e Add kvm host role 2023-07-25 16:38:52 +02:00
266b17eb98 Merge pull request 'Set up openresty' (#502) from feature/501-openresty into master
Reviewed-on: #502
2023-07-25 11:24:39 +00:00
7d9faf40d8 Merge pull request 'Upgrade Gitea to 1.20.1' (#508) from chore/upgrade_gitea_to_1.20.1 into master
Reviewed-on: #508
2023-07-23 10:59:11 +00:00
Râu Cao
149760702b Upgrade Gitea to 1.20.1 2023-07-23 12:58:02 +02:00
Râu Cao
ec77e19ab0 Update SMTP credentials 2023-07-23 12:56:46 +02:00
Râu Cao
baab02515c Remove attributes from node config 2023-07-23 12:56:27 +02:00
Râu Cao
c48dd4c997 Replace postgresql primary, add new replica 2023-07-21 14:56:14 +02:00
Râu Cao
e5805169f5 Improve script for switching postgres primary 2023-07-21 14:55:43 +02:00
Greg Karékinian
be072fb985 Update vagrant-openresty node file 2023-07-19 10:01:51 +02:00
Greg Karékinian
0fc388f43c Don't redirect http for the hello_world openresty app 2023-07-19 10:01:10 +02:00
Greg Karékinian
27b466f30d Add new architecture to Gemfile.lock 2023-07-17 18:09:55 +02:00
Greg Karékinian
1a19fa012d Deploy openresty proxy on draco
Also update Chef to 18.2.7
2023-07-17 18:09:13 +02:00
Greg Karékinian
7b0313fbd4 Add access and error logs for the assets vhost 2023-07-17 18:08:32 +02:00
Greg Karékinian
1183f6a621 Add missing dependency on git to deploy the assets 2023-07-17 18:08:21 +02:00
Greg Karékinian
05daff9029 Install certbot when using the tls_cert_for resource 2023-07-17 18:07:50 +02:00
Greg Karékinian
307ccbd561 Set a production run list for the openresty_proxy role
It only contains the assets for now
2023-07-17 18:06:58 +02:00
Greg Karékinian
cc91aab155 Use the new way of setting attribute whitelists 2023-07-17 18:06:23 +02:00
Greg Karékinian
bf72367cf2 Add a firewall rule to the kosmos_openresty cookbook
It is part of the run list in production
2023-07-17 18:05:34 +02:00
Greg Karékinian
4e0bd191c3 Move the Hello World lua app to its own recipe
Use it in the development environment
2023-07-17 18:04:35 +02:00
Greg Karékinian
96f45b1f63 Set the required Chef version to 18 2023-07-17 18:03:02 +02:00
Greg Karékinian
030dbc3584 Update the openresty cookbook submodule 2023-07-17 18:00:38 +02:00
Greg Karékinian
84ffb46ed5 Add Chef node file for openresty VM 2023-07-17 14:46:38 +02:00
Greg Karékinian
491cd31fac Add openresty Vagrant box 2023-07-15 17:20:06 +02:00
Greg Karékinian
2acf4c2b59 Update Chef in Vagrant setup 2023-07-15 17:19:50 +02:00
Greg Karékinian
df1143525d Add openresty roles 2023-07-12 20:37:03 +02:00
Greg Karékinian
d79dcd8e65 Deploy kosmos assets with Openresty 2023-07-12 20:36:12 +02:00
Greg Karékinian
c1e2145ba1 Create a resource to get a Let's Encrypt cert with DNS validation 2023-07-12 20:35:15 +02:00
Greg Karékinian
d077dfdcf2 Deploy a hello world openresty app 2023-07-12 20:34:00 +02:00
Greg Karékinian
8a3c519a6c Update our fork of the openresty cookbook 2023-07-12 20:32:53 +02:00
Greg Karékinian
abb652cc2b Fix the openresty submodule 2023-07-08 15:37:12 +02:00
Greg Karékinian
b7c36d427e Add jemalloc and yum cookbooks 2023-07-08 15:12:30 +02:00
Greg Karékinian
1bdcda0e97 Initial kosmos_openresty wrapper cookbook 2023-07-06 10:17:11 +02:00
Greg Karékinian
0a15199364 Add cookbook dependencies for openresty 2023-07-06 10:14:23 +02:00
Greg Karékinian
aebf0a12e8 Don't use AIO in development
This was needed in my Vagrant setup (VirtualBox)
2023-07-06 10:13:52 +02:00
Greg Karékinian
2950ab5bfc Add openresty cookbook fork as a submodule 2023-07-05 15:50:46 +02:00
8072fafa46 Merge pull request 'Set up Redis VM, upgrade all cookbooks for Chef 18, major cleanup' (#496) from feature/488-redis_server into master
Reviewed-on: #496
2023-07-01 12:22:38 +00:00
Greg Karékinian
2637d755af Remove old server 2023-06-29 17:17:06 +02:00
Greg Karékinian
b550c1b79e Remove deleted servers 2023-06-29 16:58:28 +02:00
Greg Karékinian
1f29d8a01a Get rid of compat_resource and mariadb 2023-06-29 16:49:06 +02:00
Greg Karékinian
462bdabf01 Get rid of the chef-sugar dependency
It's now deprecated
2023-06-29 16:41:08 +02:00
Greg Karékinian
7683de09a2 Update the elasticsearch cookbook 2023-06-29 16:39:09 +02:00
Greg Karékinian
68ce3c4834 Update the firewall cookbook to the latest version
This gives us comments from the named resources
2023-06-29 15:08:44 +02:00
Greg Karékinian
916ae8094c Get rid of the build-essential cookbook
The build_essential resource has been part of Chef since 14.0
2023-06-29 14:48:49 +02:00
Greg Karékinian
05834b6013 Get rid of the application and poise cookbooks 2023-06-28 18:59:31 +02:00
Greg Karékinian
d7bc5e6f08 Update Chef on these servers 2023-06-28 18:55:13 +02:00
Greg Karékinian
b7d17c1ad7 Replace application cookbook with git resource 2023-06-28 18:55:05 +02:00
Greg Karékinian
54098a450c Replace application cookbook with git resource 2023-06-28 18:54:38 +02:00
Greg Karékinian
3a5a038f7e Replace application cookbook with git resource 2023-06-28 18:53:59 +02:00
Greg Karékinian
3cf9c3868b Deploy mastodon without the application cookbooks 2023-06-28 17:23:05 +02:00
Greg Karékinian
57fdf0723f Deploy RTL without the deprecated application cookbook 2023-06-28 16:35:57 +02:00
Greg Karékinian
9378df23db Remove unused lndhub recipe 2023-06-28 16:35:56 +02:00
Greg Karékinian
88caae26e4 Install the latest backup gem
It added a few dev dependencies, install them
2023-06-28 16:35:56 +02:00
Greg Karékinian
0564165e81 Override the attributes in attributes, not the default recipe 2023-06-28 16:35:56 +02:00
Greg Karékinian
ddeebc739d Update chef-sugar to fix a conflict in Chef 16+ 2023-06-28 16:35:56 +02:00
Greg Karékinian
b9cf396d42 Deploy akkounts without the application_git cookbook
Use the built-in git resource from Chef instead. poise/application does
not work on modern Chef.
2023-06-28 16:35:56 +02:00
0506b75115 Merge pull request 'Configure all new and remaining options for akkounts' (#498) from chore/akkounts_config into feature/488-redis_server
Reviewed-on: #498
2023-06-28 12:29:41 +00:00
Râu Cao
01977e088a Configure remaining options for akkounts
And refactor attributes/variables to use the various service cookbook's
own attributes.
2023-06-28 14:27:25 +02:00
Greg Karékinian
d1a4e4cbc5 Merge branch 'master' into feature/488-redis_server 2023-06-28 14:15:30 +02:00
Râu Cao
bcbee255f1 Add primary domain config for akkounts 2023-06-21 15:08:14 +02:00
0a25ef6d7a Merge pull request 'Upgrade Kredits IPFS Pinner' (#497) from chore/deploy_kredits-ipfs-pinner into master
Reviewed-on: #497
2023-06-20 16:54:48 +00:00
Râu Cao
d6989ab161 Replace hardcoded value with variable 2023-06-20 18:52:44 +02:00
Râu Cao
b94484d0dd Upgrade Kredits IPFS Pinner 2023-06-20 18:52:16 +02:00
Greg Karékinian
b19fca6e7c Add firewall rule to allow access to Redis on Zerotier network 2023-06-20 15:19:34 +02:00
Greg Karékinian
76a952dbac Add missing Berksfile changes 2023-06-19 16:13:08 +02:00
Greg Karékinian
3fb89517ab Add redis_server role to redis-1 2023-06-19 16:08:59 +02:00
Greg Karékinian
44e23ffa1f Merge branch 'master' into feature/488-redis_server 2023-06-19 16:08:44 +02:00
Greg Karékinian
6116729907 Set up Redis using the latest version of redisio
This replaces the deprecated redis cookbook. Compiles the latest version
of Redis, currently 7.0.11

Refs #488
2023-06-19 16:02:58 +02:00
e924d714af Merge pull request 'Refactor RSK nginx sites for proxy/lb usage' (#495) from chore/rsk_nginx_sites into master
Reviewed-on: #495
2023-06-19 14:01:25 +00:00
Râu Cao
90f66c74d2 Refactor RSK nginx sites for proxy/lb usage 2023-06-18 16:55:38 +02:00
635ca3870a Merge pull request 'Upgrade RSKj to 4.4.0' (#494) from chore/upgrade_rskj into master
Reviewed-on: #494
2023-06-15 14:40:52 +00:00
Râu Cao
80a7751267 Test for correct network in RSKj config 2023-06-07 15:28:23 +03:00
Râu Cao
ba573798ee Upgrade RSKj to latest stable release 2023-06-07 15:27:58 +03:00
3b8326283f Merge pull request 'Configure/deploy akkounts for Discourse SSO' (#493) from chore/akkounts_upgrade into master
Reviewed-on: #493
2023-06-04 12:29:50 +00:00
Râu Cao
d113edb004 Set X-Forwarded-Proto for Discourse requests 2023-06-04 15:25:00 +03:00
Râu Cao
9648e071ca Configure akkounts for Discourse Connect 2023-06-04 15:24:06 +03:00
b164d7a444 Merge pull request 'Provision VMs for Redis cluster, RS API' (#490) from chore/new_vms into master
Reviewed-on: #490
2023-05-23 13:08:15 +00:00
7f97d95bad Merge pull request 'Upgrade ZeroTier Controller UI to latest version' (#491) from chore/upgrade_ztncui into master
Reviewed-on: #491
2023-05-23 13:02:04 +00:00
26b1682bdb Merge pull request 'Upgrade Gitea to 1.19.3' (#492) from chore/upgrade_gitea into master
Reviewed-on: #492
2023-05-13 13:43:22 +00:00
Râu Cao
91ede90184 Upgrade Gitea to 1.19.3 2023-05-13 15:41:59 +02:00
Râu Cao
6c329b7200 Upgrade ztncui to 0.8.13 2023-05-12 17:16:22 +02:00
Râu Cao
d0a1785847 Install new versions of ztncui, restart service 2023-05-12 17:15:52 +02:00
Râu Cao
29052ce509 Deploy new VMs for Redis, Liquor Cabinet 2023-05-12 17:02:10 +02:00
Râu Cao
fc041965f4 Update Ubuntu base image 2023-05-12 17:01:50 +02:00
b9e2f3b8e8 Merge pull request 'Upgrade Go to 1.20.3, LND to 0.16.1' (#486) from chore/upgrade_golang_lnd into master
Reviewed-on: #486
2023-04-26 13:06:53 +00:00
Râu Cao
807ca52f1c Upgrade LND to 0.16.1 2023-04-26 15:05:17 +02:00
Râu Cao
78eb3c033a Upgrade golang to 1.20.3 2023-04-26 15:05:06 +02:00
bffa24884c Merge pull request 'Upgrade ejabberd to 23.04, activate real-time MUC blocklists against spam' (#485) from chore/upgrade_ejabberd into master
Reviewed-on: #485
2023-04-19 15:38:07 +00:00
Râu Cao
efb07ad3c1 Allow akkounts to set private XML storage data
Enables kosmos/akkounts#116
2023-04-19 17:32:30 +02:00
Râu Cao
14e04d77a9 Activate real-time MUC blocklist module 2023-04-19 17:32:15 +02:00
Râu Cao
f8f3fc7c3a Upgrade ejabberd to 23.04
Also add a package version attribute, since the value changed in the
past.
2023-04-19 17:30:55 +02:00
Râu Cao
5ad15ba1f3 Upgrade Gitea to 1.19.1 2023-04-13 18:31:42 +02:00
4778253ad3 Merge pull request 'Fix Gitea Actions runner not working with private host' (#484) from bugfix/act_runner_needs_public_host into master
Reviewed-on: #484
2023-04-11 10:16:20 +00:00
Râu Cao
1afc860b21 Fix Gitea Actions runner not working with private host 2023-04-11 12:14:17 +02:00
Râu Cao
03a02a19c4 Use proxy protocol for ejabberd nginx streams 2023-04-04 15:14:41 +02:00
Râu Cao
7a1be33b7a Make all nginx vhosts listen on IPv6 2023-04-04 15:10:23 +02:00
Râu Cao
f36268e906 Update ejabberd admin list 2023-04-04 10:14:50 +02:00
Râu Cao
2dd4d572a6 Configure akkounts domain 2023-04-04 09:32:40 +02:00
a44fa31951 Merge pull request 'Improve ejabberd HTTP API configs and access' (#483) from bugfix/ejabberd_api_access into master
Reviewed-on: #483
2023-04-03 16:03:03 +00:00
Râu Cao
797dd241e0 Improve ejabberd HTTP API configs and access
Move the listener to a separate endpoint on port 80, which is only
accessible from the private network. Change accounts.kosmos.org to use
the new endpoint via a `.local` domain instead of faking external
access.
2023-04-03 15:38:40 +02:00
ac00aa9def Merge pull request 'Upgrade Gitea to 1.19, configure Gitea Actions, set up Actions runners' (#482) from chore/upgrade_gitea into master
Reviewed-on: #482
2023-04-02 13:57:45 +00:00
Râu Cao
059812524e Set up Gitea Actions runners 2023-04-01 12:56:21 +02:00
d7cbdbd6a5 Merge pull request 'Set up Sentry' (#478) from feature/sentry into master
Reviewed-on: #478
2023-03-28 20:13:28 +00:00
Râu Cao
702449acc1 Upgrade Gitea to 1.19.0, enable Actions 2023-03-28 19:36:30 +02:00
Râu Cao
b78de9a3c9 Deploy Sentry from release tag 2023-03-28 15:23:57 +02:00
Râu Cao
99d985c0d5 Configure Sentry for akkounts 2023-03-27 19:10:48 +02:00
Râu Cao
9f886cc286 Configure Sentry DSN for lndhub-go 2023-03-27 19:04:03 +02:00
Râu Cao
05d0a19b5f Add Sentry client recipe and role
Configures a local domain for Sentry in the hostsfile.
2023-03-27 19:04:03 +02:00
Râu Cao
798ee3d1d8 Basic Sentry setup
Not running the install script automatically at this point yet.
2023-03-27 19:03:58 +02:00
0fbba8baa8 Merge pull request 'Add new SMTP config for akkounts' (#480) from feature/479-akkounts_smtp_config into master
Reviewed-on: #480
2023-03-27 09:56:15 +00:00
Greg Karékinian
0c4466b040 Namespace the smtp attributes 2023-03-27 10:49:12 +02:00
Greg Karékinian
34970fe3cf Set a better name for the from address 2023-03-27 10:48:56 +02:00
Greg Karékinian
3873ebaac2 Don't override the SMTP config with the same values 2023-03-27 10:45:02 +02:00
Greg Karékinian
4f1fb347a8 Add new SMTP config for akkounts
This is not running on akkounts-1

closes #479
refs kosmos/akkounts#107
2023-03-24 16:55:11 +01:00
819109849a Merge pull request 'Improve ejabberd config' (#477) from feature/ejabberd_enhanced_configs into master
Reviewed-on: #477
2023-03-24 09:38:18 +00:00
Râu Cao
6e31c7a79b Use proxy protocol 2023-03-24 16:35:23 +07:00
Râu Cao
a2fc3ba25c Remove obsolete folder permissions 2023-03-24 16:35:07 +07:00
Râu Cao
13fc2e6e24 Improve MUC config 2023-03-24 16:34:40 +07:00
d308c2536d Merge pull request 'Switch Discourse uploads and backups to Garage/S3' (#476) from feature/discourse_garage into master
Reviewed-on: #476
2023-03-21 09:04:58 +00:00
4baff4cc03 Merge branch 'master' into feature/discourse_garage 2023-03-21 09:02:20 +00:00
Râu Cao
f34647b2bd Fix akkounts asset requests when nginx is on proxy 2023-03-17 19:29:24 +07:00
Râu Cao
8ae7cdfafd Switch Discourse uploads and backups to Garage/S3 2023-03-17 19:13:04 +07:00
Râu Cao
d8d1609572 Serve static assets from Rails in prod 2023-03-04 11:14:11 +08:00
Râu Cao
cf082833a7 Add lndhub pubkey in prod, update node config 2023-03-03 21:48:38 +08:00
6779f5a5dc Merge pull request 'Add keysend support for Lightning Address' (#471) from feature/lightning_address_keysend into master
Reviewed-on: #471
2023-03-02 10:53:07 +00:00
55bfc0c80f Merge branch 'master' into feature/lightning_address_keysend 2023-03-02 10:52:25 +00:00
796b7e4436 Merge pull request 'Move akkounts nginx to nginx proxy' (#474) from chore/move_akkounts_nginx into master
Reviewed-on: #474
2023-03-02 10:52:12 +00:00
Râu Cao
8225e1b67b Move akkounts nginx to nginx proxy 2023-03-02 18:05:37 +08:00
e2e857ec76 Merge pull request 'Move akkounts to redisio cookbook, switch in production' (#473) from chore/akkounts_redis into master
Reviewed-on: #473
2023-03-02 08:12:12 +00:00
8f70bf5033 Move akkounts to redisio cookbook 2023-03-02 16:09:51 +08:00
0320cae893 Merge pull request 'Upgrade BTCPay Server to 1.8.0' (#472) from bugfix/btcpay_builds into master
Reviewed-on: #472
2023-03-02 07:36:46 +00:00
Râu Cao
9d1dd499bb Upgrade BTCPay Server to 1.8.0
* Fixed build and run scripts
  https://github.com/btcpayserver/btcpayserver/pull/4655
* Fixed bug when using LndHub account as Lightning back-end
  https://github.com/btcpayserver/btcpayserver/issues/4658
2023-03-02 15:31:47 +08:00
Râu Cao
53f8a06e6f Add keysend support for Lightning Address 2023-03-02 13:32:07 +08:00
e9832551ac Merge pull request 'Write akkounts .env config, add config for lndhub admin UI' (#470) from feature/462_akkounts_config into master
Reviewed-on: #470
2023-02-14 13:11:49 +00:00
7549164a2e Merge branch 'master' into feature/462_akkounts_config 2023-02-14 13:04:00 +00:00
48f678148c Merge pull request 'Switch/migrate NBXplorer to PostgreSQL' (#468) from chore/nbxplorer_postgres into master
Reviewed-on: #468
2023-02-14 13:03:49 +00:00
544984abce Merge branch 'master' into chore/nbxplorer_postgres 2023-02-14 13:02:06 +00:00
643af4a4a2 Merge pull request 'Upgrade RSKj, fix and document test suite' (#465) from core/upgrade_rskj into master
Reviewed-on: #465
2023-02-14 13:01:55 +00:00
6209dcfc25 Merge branch 'master' into core/upgrade_rskj 2023-02-14 13:00:44 +00:00
Râu Cao
a1ec9b4d6a Write akkounts .env config, add config for lndhub admin UI
closes #462
2023-02-13 22:39:11 +08:00
Râu Cao
b762d70b43 Use service resource 2023-02-11 17:22:22 +08:00
Râu Cao
99e029a5ca Switch NBXplorer to Postgres 2023-02-08 15:30:44 +08:00
86d7514739 Merge pull request 'Upgrade bitcoind, NBXplorer, BTCPayServer' (#467) from chore/upgrade_btcpay into master
Reviewed-on: #467
2023-02-03 09:05:46 +00:00
Râu Cao
4c7a5f4db8 Upgrade bitcoind, NBXplorer, BTCPayServer 2023-02-03 17:04:16 +08:00
Râu Cao
5e709a3a4f Update node configs 2023-02-01 21:53:50 +08:00
Râu Cao
d04e2f4fd5 Bump cookbook version 2023-02-01 20:45:01 +08:00
Râu Cao
f9e7d98bf9 Document testing commands 2023-02-01 20:44:45 +08:00
Râu Cao
9c33fbda21 Bump rskj version 2023-02-01 20:44:07 +08:00
Râu Cao
a7b990c64f Update preseed syntax 2023-02-01 20:43:41 +08:00
Râu Cao
55e48cca86 Include nginx cookbook in local deps (for testing) 2023-02-01 20:43:07 +08:00
Râu Cao
063858f06c Install imagemagick for mediawiki thumbnail generation 2023-02-01 18:17:39 +08:00
Râu Cao
cd4d21efc8 Remove superfluous license header 2023-02-01 18:17:29 +08:00
Râu Cao
ad10e8cceb Fix up lndhub hook config, converge all relevant nodes 2023-01-25 13:02:09 +08:00
Râu Cao
3e79955261 Deploy akkounts from master again 2023-01-25 12:31:17 +08:00
Râu Cao
d3d046b0d0 Merge branch 'feature/libretranslate' 2023-01-25 12:28:33 +08:00
7447ba2842 Merge pull request 'Configuration for LndHub webhooks' (#461) from feature/lndhub_webhooks into master
Reviewed-on: #461
2023-01-17 13:45:00 +00:00
1a7fd5ac65 Merge branch 'master' into feature/lndhub_webhooks 2023-01-17 13:44:14 +00:00
cdb1213e1d Merge pull request 'Migrate Mastodon S3 from AWS to Garage' (#458) from feature/22-mastodon_s3 into master
Reviewed-on: #458
2023-01-17 13:42:28 +00:00
Râu Cao
03fa49ed0c Remove unused import 2023-01-17 17:15:16 +08:00
Râu Cao
ed0e030106 Set up libretranslate for kosmos.social 2023-01-17 17:12:22 +08:00
Râu Cao
3933e4c310 Fix endpoint URL 2023-01-17 15:36:42 +08:00
Râu Cao
89865bcd2a Allow send_message endpoint from akkounts 2023-01-12 15:37:08 +08:00
Râu Cao
62d1a86555 Configure Webhook URL for lndhub.go 2023-01-12 15:37:04 +08:00
1043 changed files with 20923 additions and 49754 deletions

View File

@@ -26,8 +26,7 @@ knife[:automatic_attribute_whitelist] = %w[
chef_packages
]
knife[:default_attribute_whitelist] = []
knife[:normal_attribute_whitelist] = ['knife_zero', 'kosmos_kvm', 'kosmos-ejabberd']
knife[:override_attribute_whitelist] = []
knife[:allowed_normal_attributes] = ['knife_zero', 'kosmos_kvm', 'kosmos-ejabberd']
# Added to /etc/chef/client.rb on node bootstrap
# https://docs.chef.io/attribute_persistence/
knife[:normal_attribute_allowlist] = ['knife_zero', 'kosmos_kvm', 'kosmos-ejabberd', 'openresty']
knife[:allowed_normal_attributes] = ['knife_zero', 'kosmos_kvm', 'kosmos-ejabberd', 'openresty']

9
.gitmodules vendored
View File

@@ -1,3 +1,12 @@
[submodule "site-cookbooks/postgresql"]
path = site-cookbooks/postgresql
url = git@github.com:67P/postgresql.git
[submodule "site-cookbooks/openresty"]
path = site-cookbooks/openresty
url = https://github.com/67P/chef-openresty.git
[submodule "site-cookbooks/strfry"]
path = site-cookbooks/strfry
url = git@gitea.kosmos.org:kosmos/strfry-cookbook.git
[submodule "site-cookbooks/deno"]
path = site-cookbooks/deno
url = git@gitea.kosmos.org:kosmos/deno-cookbook.git

View File

@@ -2,56 +2,44 @@
source 'https://supermarket.chef.io'
cookbook 'mediawiki',
git: 'https://github.com/67P/mediawiki-cookbook.git',
ref: 'nginx'
cookbook 'redis',
git: 'https://github.com/phlipper/chef-redis.git',
ref: 'v0.5.6'
cookbook 'redisio', '= 5.0.0' # TODO upgrade to 6.x when we use Chef 16
cookbook 'postfix', '= 5.0.2'
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'
cookbook 'application_git', '= 1.1.0' # 1.2.0 doesn't work with knife-solo
cookbook 'poise', '~> 2.8.2'
cookbook 'poise-languages', '~> 2.1.1'
cookbook 'poise-javascript', git: 'https://github.com/67p/poise-javascript.git',
ref: 'e5fff15'
cookbook 'poise-archive', '~> 1.5.0'
cookbook 'poise-service', '~> 1.5.2'
cookbook 'users', '~> 5.3.1'
cookbook 'hostname', '= 0.4.2'
cookbook 'firewall', '~> 2.6.3'
cookbook 'nginx', '= 9.0.0'
cookbook 'fail2ban', '~> 7.0.4'
# 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.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', '~> 7.3.1'
cookbook 'timezone_iii', '= 1.0.4'
cookbook 'ark', '>= 5.0.0'
cookbook 'logrotate', '= 2.2.0'
cookbook 'openssl', '~> 8.5.5'
cookbook 'ntp', '= 3.4.0'
cookbook 'apache2', '= 3.3.0'
cookbook 'chef-sugar', '= 3.3.0'
cookbook 'compat_resource', '= 12.19.0'
cookbook 'homebrew', '= 3.0.0'
cookbook 'mariadb', '= 0.3.1'
cookbook 'elasticsearch', '~> 5.1.3'
cookbook 'firewall', '~> 6.2.16'
cookbook 'redisio', '~> 6.4.1'
cookbook 'ruby_build', '~> 2.5.0'
cookbook 'ipfs',
git: 'https://gitea.kosmos.org/kosmos/ipfs-cookbook.git',
ref: 'v0.7.0'
cookbook 'elasticsearch', '= 4.3.0'
cookbook 'java', '~> 4.3.0'
cookbook 'ulimit', '~> 1.0.0'
cookbook 'mediawiki',
git: 'https://github.com/67P/mediawiki-cookbook.git',
ref: 'nginx'
cookbook 'apache2', '= 3.3.0'
cookbook 'apt', '~> 7.3.0'
cookbook 'ark', '>= 5.0.0'
cookbook 'composer', '~> 2.7.0'
cookbook 'fail2ban', '~> 7.0.4'
cookbook 'git', '~> 10.0.0'
cookbook 'golang', '~> 5.3.1'
cookbook 'gpg', '~> 2.0.13'
cookbook 'hostname', '= 0.4.2'
cookbook 'hostsfile', '~> 3.0.1'
cookbook 'java', '~> 4.3.0'
cookbook 'logrotate', '= 2.2.0'
cookbook 'mysql', '~> 8.7.3'
cookbook 'nginx', '= 9.0.0'
cookbook 'nodejs', '~> 7.3.1'
cookbook 'ntp', '= 3.4.0'
cookbook 'ohai', '~> 5.2.5'
cookbook 'openssl', '~> 8.5.5'
cookbook 'php', '~> 8.0.0'
cookbook 'postfix', '~> 6.0.26'
cookbook 'timezone_iii', '= 1.0.4'
cookbook 'ulimit', '~> 1.0.0'
cookbook 'users', '~> 5.3.1'
cookbook 'zerotier', '~> 1.0.7'
cookbook 'unbound', '~> 3.0.2'
# openresty dependency
cookbook 'jemalloc', '~> 0.1.7'
cookbook 'yum'

View File

@@ -1,20 +1,14 @@
DEPENDENCIES
apache2 (= 3.3.0)
application (~> 5.2.0)
application_git (= 1.1.0)
application_javascript (~> 1.0.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.7.0)
elasticsearch (= 4.3.0)
elasticsearch (~> 5.1.3)
fail2ban (~> 7.0.4)
firewall (~> 2.6.3)
firewall (~> 6.2.16)
git (~> 10.0.0)
golang (~> 5.3.1)
homebrew (= 3.0.0)
gpg (~> 2.0.13)
hostname (= 0.4.2)
hostsfile (~> 3.0.1)
ipfs
@@ -22,8 +16,8 @@ DEPENDENCIES
revision: d7c25b6ce5fa490b6de3529fdc163fb64f1ece8a
ref: v0.7.0
java (~> 4.3.0)
jemalloc (~> 0.1.7)
logrotate (= 2.2.0)
mariadb (= 0.3.1)
mediawiki
git: https://github.com/67P/mediawiki-cookbook.git
revision: 78641e53635ba6cbd4a2a51fd597adb8fef1e8ad
@@ -35,66 +29,40 @@ DEPENDENCIES
ohai (~> 5.2.5)
openssl (~> 8.5.5)
php (~> 8.0.0)
poise (~> 2.8.2)
poise-archive (~> 1.5.0)
poise-javascript
git: https://github.com/67p/poise-javascript.git
revision: e5fff15098ac80c2a625b8d77d4eaf39d48f7ba7
ref: e5fff15
poise-languages (~> 2.1.1)
poise-ruby-build (~> 1.1.0)
poise-service (~> 1.5.2)
postfix (= 5.0.2)
redis
git: https://github.com/phlipper/chef-redis.git
revision: 7476279fc9c8727f082b8d77b5e1922dc2ef437b
ref: v0.5.6
redisio (= 5.0.0)
postfix (~> 6.0.26)
redisio (~> 6.4.1)
ruby_build (~> 2.5.0)
timezone_iii (= 1.0.4)
ulimit (~> 1.0.0)
unbound (~> 3.0.2)
users (~> 5.3.1)
yum
zerotier (~> 1.0.7)
GRAPH
apache2 (3.3.0)
application (5.2.0)
poise (~> 2.4)
poise-service (~> 1.0)
application_git (1.1.0)
application (~> 5.0)
git (>= 0.0.0)
poise (~> 2.0)
application_javascript (1.0.0)
application (~> 5.0)
poise (~> 2.0)
poise-javascript (~> 1.0)
poise-service (~> 1.0)
apt (7.3.0)
ark (6.0.3)
seven_zip (>= 3.1)
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.7.0)
apt (>= 0.0.0)
php (>= 0.0.0)
windows (>= 0.0.0)
elasticsearch (4.3.0)
apt (>= 0.0.0)
elasticsearch (5.1.3)
ark (>= 0.0.0)
chef-sugar (>= 0.0.0)
yum (>= 0.0.0)
fail2ban (7.0.4)
yum-epel (>= 0.0.0)
firewall (2.6.5)
chef-sugar (>= 0.0.0)
firewall (6.2.16)
git (10.0.0)
golang (5.3.1)
ark (>= 6.0)
homebrew (3.0.0)
gpg (2.0.13)
yum-epel (>= 0.0.0)
homebrew (5.4.1)
hostname (0.4.2)
hostsfile (>= 0.0.0)
hostsfile (3.0.1)
@@ -103,16 +71,14 @@ GRAPH
java (4.3.0)
homebrew (>= 0.0.0)
windows (>= 0.0.0)
jemalloc (0.1.7)
build-essential (>= 0.0.0)
logrotate (2.2.0)
mariadb (0.3.1)
apt (>= 0.0.0)
yum (>= 0.0.0)
yum-epel (>= 0.0.0)
mediawiki (0.5.0)
apache2 (>= 0.0.0)
nginx (>= 0.0.0)
php (>= 0.0.0)
mingw (2.1.3)
mingw (2.1.7)
seven_zip (>= 0.0.0)
mysql (8.7.4)
nginx (9.0.0)
@@ -127,43 +93,20 @@ GRAPH
openssl (8.5.5)
php (8.0.1)
yum-epel (>= 0.0.0)
poise (2.8.2)
poise-archive (1.5.0)
poise (~> 2.6)
poise-build-essential (1.0.0)
poise (~> 2.6)
poise-git (1.0.0)
poise (~> 2.6)
poise-languages (~> 2.1)
poise-javascript (1.2.1)
poise (~> 2.0)
poise-languages (~> 2.0)
poise-languages (2.1.2)
poise (~> 2.5)
poise-archive (~> 1.0)
poise-ruby (2.4.0)
poise (~> 2.0)
poise-languages (~> 2.0)
poise-ruby-build (1.1.0)
poise (~> 2.0)
poise-build-essential (~> 1.0)
poise-git (~> 1.0)
poise-ruby (~> 2.1)
poise-service (1.5.2)
poise (~> 2.0)
postfix (5.0.2)
redis (0.5.6)
apt (>= 0.0.0)
redisio (5.0.0)
selinux_policy (>= 2.2.0)
ulimit (>= 0.1.2)
selinux_policy (2.4.3)
postfix (6.0.26)
redisio (6.4.1)
selinux (>= 0.0.0)
ruby_build (2.5.0)
homebrew (>= 0.0.0)
yum-epel (>= 0.0.0)
selinux (6.1.12)
seven_zip (4.2.2)
timezone_iii (1.0.4)
ulimit (1.0.0)
unbound (3.0.2)
users (5.3.1)
windows (7.0.2)
yum (7.2.0)
yum (7.4.13)
yum-epel (4.2.3)
zerotier (1.0.7)
ohai (>= 0.0.0)

View File

@@ -306,6 +306,7 @@ GEM
PLATFORMS
x86_64-darwin-18
x86_64-darwin-19
x86_64-linux
DEPENDENCIES

27
Vagrantfile vendored
View File

@@ -26,7 +26,7 @@ Vagrant.configure(2) do |config|
ldap.vm.network "private_network", ip: "192.168.56.5"
ldap.vm.provision :chef_zero do |chef|
chef.version = "17.10.0"
chef.version = "18.2.7"
chef.node_name = "vagrant-node-ldap"
chef.arguments = "--chef-license accept"
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
@@ -49,7 +49,7 @@ Vagrant.configure(2) do |config|
# bitcoin.vm.synced_folder "../kredits/yap/", "/opt/yap"
bitcoin.vm.provision :chef_zero do |chef|
chef.version = "15.13.8"
chef.version = "18.2.7"
chef.node_name = "vagrant-node-bitcoin"
chef.arguments = "--chef-license accept"
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
@@ -66,4 +66,27 @@ Vagrant.configure(2) do |config|
end
end
config.vm.define "openresty" do |openresty|
openresty.vm.box = "bento/ubuntu-20.04"
openresty.vm.network "forwarded_port", guest: 6379, host: 6379
openresty.vm.network "private_network", ip: "192.168.56.7"
openresty.vm.provision :chef_zero do |chef|
chef.version = "18.2.7"
chef.node_name = "vagrant-openresty"
chef.arguments = "--chef-license accept"
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
chef.data_bags_path = "data_bags"
chef.roles_path = "roles"
chef.nodes_path = "nodes"
chef.environments_path = "environments"
chef.encrypted_data_bag_secret_key_path = ".chef/encrypted_data_bag_secret"
chef.environment = "development"
chef.add_recipe "kosmos-base"
chef.add_role "openresty"
chef.add_role "openresty_proxy"
end
end
end

View File

@@ -1,4 +0,0 @@
{
"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"
}

View File

@@ -1,4 +0,0 @@
{
"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

@@ -1,4 +0,0 @@
{
"name": "discourse-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxJBhKUtTcmjP8eG4aLNF\n9UfNU9lRIFhfywjFJjtXoYdNaUatZHE3s1HKND0SjJs5BRQbZBEKLxTHCgnPZD4U\nlRgZ65JtHwi+JNM6ac4TQm5JYKA++KxX7FtOiJV6oGX6foNoFVHrGi+fhTlLE9hL\npHRQWTpM8ErpUEj3VHez+k6KT1Mr3QO5T9L5kqu1BdTYwtyfXJE0VfyDKz/rwrvc\ngPvZd167p8YCTu/rWLG9X8tag+ySUR9cmlEn5sCsBLmq56Zurf0VIe/0tuGPI8DP\nAVc4dIXHsfGuKLwBfFPSDy9YbI7F8gbaD05UnUVn60IWPmWsE19K/iIc/OnJZwRO\nkQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "ejabberd-6",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqvGOanDqJOhf0xl/TYcs\nqYhhGz4ptFzxmfxiCMWbnbDcICBLHni28dJHhP2ggfUKOGcp+OIqiy783eRUrPsf\nnH9VmvTnz4NdXIB5J45FgBtfYiF9ZseaPL+ufTSCbZj7Ih3lzTAbO5Ug+UOj852B\nnnqH2Ht2jXMp2v3NW4gAG9QyRpr6P5cyVWBrMFExjuhNWg119tJv+33oGnflrNRi\njV3yGbRFRpqAomAVCr6DAA9SX/R8J3yKTky6MdRGrXKH/7eXH0ehDi33Y9Pyy9Ci\nkQX/JRHffuJeBF3Tndiojqdx81C6oIh2s/H3JMew/DdRxjzlPP4nemYWXv1/YVcS\nCwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "ejabberd-7",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzHfqcI/6w58gLwDFCKxw\n0TeKFOf4MFBnmUGsWyi8BEskkjh4QEDc4pUFeiVuEADFyBfCnALWh004nKhiwamc\nECybfAKlJryoQQEcYZC6H4rZf3SW7xPLk12X00YySNroYM50PM5Ly/G7MI9a669g\n6HNOgn1MYIEh8unpsAHjfKpx72bNutRYKKvBDaHXNvlJ459Jr8HNpERFk8IeaGcF\n4BKqf/MNxkQHOfy7R4ETXeLUBrgD13SmLbs6mM3lXS6IgkoeFyAvAPP4ZgwgiJ6w\nqIKsX4cRt8xnJJ+MTNBX4oc0f9+Gu8bUpr2JZ8tcwq3GUgDjv+JSJpk/uDzzbQUe\nIwIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "email-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxDRdvMYKRjejoFsOxS6s\n4gj0Gsaxk/j25A5VPHBcEhr+NOh8W/6NnTTHuFMaorEIl/2kscgrcwriDN7xIFmO\nz/C1+spDLPMGSWd+422KSS3fjVfByLlMwxh171RDZBlZVze7H7CIV/rxCG7Ri85y\nPvyp2rT4ioyVGyYK3e8CiXwQckpFC1ex9VRk/GR8zbCYUIw+qbTFRcl/mQuxKqWK\n22vrgAR+6OL8lcyhssmKiQ1r3GtxwJusgffw4/5S8sRR1z8OB4wiwgOWR1E36EbF\nhTBjFzPiKVjVjP/TQpUoYdnBhuD223M8nPWJl1HMVQPMjL6R2BBOF+iK0Wx9SiFD\nJwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "garage-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtRSB8/ObjvQq6WuOVS/f\nypdX/2fLsUlt5tQ8GNuSY9rSM8gdvcXUvnPlxthZO4yvcPX85wmtBZX8fRJFdkJg\nYRCJbuVKO9sLTq8OUWXYpfU1q10FUhl034zxOMslpxVB6toirnk025vyq9jbuKP+\nYO+c40KZr67mgm0hveJfylayfiKP1HGm4HrV0maFivCgC8D+MPDDv75CsqRe5WSc\nh2CoauDJwVlhKZ92yq87ugGBhJJRUGOQZcfEvkUGj/HNAS6tuHl8YmVmhO8hBdee\nNto6RF54E1zB80R9oT/qitw23miEyUcHHVxhTR4tTWflZgd8l4wDOhX3Nf20xknu\nFQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/garage-5.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "garage-5",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnJxLFOBbml94W/GAe7nm\ntZs1Ziy8IbqXySsm8bSwWhRMQ8UuseqQLG30R3Q5X5AoJbtNfd26l63qLtP2fFtL\n5km9dV+2FoIJWFetl8Wzr7CaLYAiNzTQSFHlV7+6DKmPMDcJ63GKrFR77vkSGOG6\nOWL1bJy5BOaClp/sKL/0WQ0+mRbTP6RCQ2eI+46clAg702SenBU6Nz9HDm+teKN7\nYlP1CvzXgfgfpDOsat7wGn5+oKcmKavZxcdn8bt5jRpg8v3JezaZIjMXt7XcNS4n\n0F4XO/efnZE5B5SN68j4BpD8N79zJw4HlRIGP+RaYv2qLtBeWgLHCCs9wXQXfj6b\nLwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/garage-6.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "garage-6",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwasYgWLM8ShvirFiKRE6\nGWqc3pMlvcrk4YnWAUW5Y/H26EnyexxWNfnwlEcq8thJ3M3hs7zkoF3Yk4uqX869\n4/niYqXwYgeE1K3gzLp4K1+w3yVupYAFVFStVEHJyuMlLJ+ulDEGvNdQDuIfw7+E\nr6DcDLa1o92Eo0wL1ihYyMilduH0LdFTixL+tEBXbbPWBa3RDJJCFsRF1+UC6hAH\nzmaWL661Gdzdabxjm/FlGUYkdbDqeInZq/1GMQqv+9/DcNRkWA9H7i4Ykrfpx4/2\nRZ8xtx/DbnJVB1zYoORygFMMAkTu5E+R8ropeI7Wi77Yq0S7laiRlYQYQml3x9ak\nzQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/garage-7.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "garage-7",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwoAigZUSwsfbBHx2PQ6W\n38Ght6eCvbpW1lsS58hTieRmRn+pgZVjvixhsBh57rUasCjaBywXk9BpNj2Foxck\nReHeoDI0RHsgniClyMrYj80y2NhoB6J8NB+cHkhdzIKplm6AH6M5xaAedtZU639a\n1nHMtpDlJhzgIYsiq1q06Aqd1w0Z9tf1RXQ1WvMDhTY4wlE5RZ2epBb6Usnlbjo2\nSqCIGIjRLmZxdsSWoiUUTlVPdUCzTNsN5G/ZVdRswhgseDmVJCIkK2Aji/XzhIrR\nh4RvUv9dhFemOVsFctJ/dQILXz5MZLUgakKf970M5R/Zggv//pqRSsYcB2UfaBpV\nLQIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/garage-8.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "garage-8",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt4hXODzgHsIeWxXJm/F6\nSTFJ8JC89mWru7pOFzPWenOVMHgp4UpUB4rDTwQqojsWTDiq0x3ckUyOPw3Nj0jv\nxP4MMGS4SI0oRSJKzrYYss0hgUDTOBBd+Wxn0UiNEpN/PfQo9VZj9v/jak57cz7z\n5+rpl5v27fhgUIChjsHxdy+EamvCrYc+1JhyrLOlwlt8JxkZ8UPhoeZLWAbDgGLS\nEzHWSSVtBUPK+KYmVb2OK4lB56zPfek0U3gKN+04a1650jzOit8LzE6NaT180QDv\nX+gG6tk53vSXDmkBXsQ1mtB8aF+HaEG2Pra5HyihlweCPYdJT+e28wpq6+P5l3YR\ndQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "gitea-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0bp4I/f5dLL22GRHanLV\nw57sNBEWT3Vx32B24hScKNP5nYDW0dIRkt1c7SLEpe+diNgyIwk7JlI20Vl+oaVo\njdCpmHSB18yXxQT2Ub6aI8ApwFLECVA6SckekcwxLJc/oGRMB52PonI8opJOVbPa\nF+heZ5NNDiMvn3E8qODdMWSjDiJNSVLJgsCPFHAt32aJgLaXQTqG5lrmltaamscW\njGlFqiBJw/5saCkKBPdPwdX4RcDqvGX1FdE1LVB42cskv8CrnvEVFLBxKXAhAr6s\nNhOhenzLGHpy58tNoUoUw3v4WiPRtcnlNxeSVG5LKkjaK04f2oxeZx3SiSU/1naY\nkwIDAQAB\n-----END PUBLIC KEY-----\n"
}

4
clients/her.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "her",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsuj7OCWX2qz/WbsjMgpi\nI4CM13Pxrj+8Enrl4IorkK6O338rhdtfXmOJt2AuDuj6u12Xtnk0LN2n01hffXNu\nU0Hwy+szavnbjiqC8jw1nyCFwYgdy8lCj3WV4t/gRWFhiHZGkhBKaksAoo8jJqZv\nXi/4ZuRov01HJgT6CJBEfR5TUaRCHM4hz2Y60mmegmUNLTRUNIDy6rg5W8JplMlJ\ny0dJc6uEp8asKhPnEfMz1kXukjnsBLXZmxglqdAQeaZ1I78QvRV3rYh0Ge2ZPF8t\nv2c+mUMbH7e80lJPgp7rwqjKrjLfaYo/1ZqTqr3ArWw3253ttLp8KX1ltX69nIHq\nMwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "jitsi-meet-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyNMD7N7s+JZM6PLlcrKN\n4jnr0jB5kU+Gr8EHtdpaBDGN5x8BahAkMuXcWfMQj4xIvUhTY4tTvDDYgcJGbrY4\ncmmt/YLX4t/OR6g2JxzIRWDBITTTlX7h5QUg10irjfPsyaU9O7lChDk4M3j5J4c2\nZFlZAar1+CeC5nwcEtNg4nL36I6bxUL5e/rEeeUGCGuqn3tAQ+GXj1G4uJYI18JQ\nhv43nIqbF+oVe5iRy58rXILd+zmbOq87cnF8O2ode44jRwtH4K0+uHTmq+83Q8Ld\n3wBZTnrQEnUDm6IuFuWfYhvNGlXAJrcmoH/wA1B5IAcuF3vhw9JY9axy+GDFszOX\nxwIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "lq-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6mrJdvfx2pvuYIOCwDe4\nXJ4NJSEq+9oyqW/JWNDnUN/GAZLCfTOa+qu1nA8sOspWWpaikHpo2meYlzA1HCPh\nF4LX7C83dA9CXB8BDCddmkAxhPPXIeFM3AmaEwfv+dLYNuO6bWvOKcHjJdw7Mp4W\nrdg9MsIh28W9jf7KehvPWx3ZvrJm2vyiFGQNBDWGdkVq40P2lhvCISvWb+Ugpjos\nJzq/HZNFq6Fc72jWfwwGcDgwfc1/jmWJlz2J5v8xHwwhVtcWTg1AWqfcVQZ6OKtf\nwP6s/pAK4dAXqPz8OE17GPJ42r94AeWr39Cn5b8EzrVhKOeODlpihfzIaa/sfb44\n6wIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "lq-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzyquIPPckL4Bybw4H0t6\nHexR7u97//eXBGpN+PJcp3PAUTJVWr1m7uDnpD9JAP370Cp05Tz0ydYXk/2NTpFf\nvRu20401VWTWbClIdN7n89edtER/XX90KrcKplV4bZcFN0UC2Il6SGH0uvUYzZRr\nPV2eXftDvu7Mhl1xlmeJ0S6bH95v1G2k6TrTLAOBs6gpqiCWyjrNB9AY3SpEv9Ya\nK8T0M10LAY0UwKccSp/eTZzCfbmzvNIyyRlJbzEAsHmoDPyR2/4LB1ndtbkTszmk\noHvpBJu3noKXo0SW/WqhSvwxBVV0bZUYjgH3Bx8nudNkHgL6ZH6FVQ6ED+70jWiq\ngwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "mastodon-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA27a8h17CCQLP8JY59n+M\nURsrbeVvRi3yIUe1IklOlRSTy0L3Z37rFuSNC3dC9rKl/pHDKtorgeukxbFADXQx\nkta2LNX8gf09jCWsUdga5lWIbfOdtlCLRDG1MVEUSA0f6Sxdqr8RbjM2ch31T6Me\n5Z6DYdggwBujcPHwZC1AugI1wJ0T5XHY9f2MDs/XjNEdw3ThYbAdbl1e09ql6Gtg\nSVCa4RlLg/KICdLJtVOLkX6049/XRxi41I6xvu9tXsqgV3+bs8dYbeGLsTWmpPIv\naAUMcf/A5t4B2DVpnlXDytPqfvZQPD3aBVyfEJRGI1yD6Vi9zL3RyIhDQ/I7PMNI\naQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"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"
}

View File

@@ -1,4 +0,0 @@
{
"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"
}

View File

@@ -1,4 +0,0 @@
{
"name": "nodejs-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyqP7aGx+S9Mdt6xmaGnJ\nfNWWQsg4BvLiP1qtVt3VRrcXF2cy1bhgfnmqoBqnDk4bGlRoTzF+rSOw284+O2UQ\ntUlsBRos4TOyGfbYHehF12Re6NX51K9LHwaprr3eN5h08wLI8pjVrRJlbce8pHST\nXQ/CZvU+CBg43LE08cXr5kRmhnZrgh70g7zTO8+1E6y74r1LEh77Ar4uaaB5jXw7\n6o9TyfaA1HgyqvfYbH+9KPrJfMX/DeLrYPMI3IG/j3fzDUQQ8o9Pb5B+G1Apl+I+\nsTcgWRei5u06aZHLMMd8MMo4O1yUhbt05kxfVhlDGUDWBdi3cvsMf95t6MNdz/eq\niwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"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"
}

View File

@@ -1,4 +0,0 @@
{
"name": "postgres-4",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu6fPxOZeKloF/EgYvU0k\nOwv8bJjsCQcWaMTPle5//mRTszA6PM2z9RI+Mfr45qxTlsL9pQY8WJOWF6QOK31x\nszuqcr7oOjtAhrLI8f/oNDEDjcx325FqG9gNKQEAD7d4zodh+PhDe6x7GIyIS7lG\nIcD5Zre9iDwv8FGLR+5GLqS8SJOPL/wJkQ8w+N0f8YDFw81kiTta5NLhAx3fMDs0\n2kmoNlbmKlNZTtLjCfCV+/pa9oY6wycjck3GvobiFE/4cWaNkeGlPc+uAwlfmrOv\nHy0tq1XBX/BCvE5kMXmhnMT23JXjm2s2PgCLgEVGAXilXk/T597KDm+z4oBpAQma\nnQIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "postgres-5",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvXZv6Gk+dhIVkTXH9hJ1\nt2oqsMSLmTUj71uPN+4j0rxCQriXa095Nle9ifJAxfwzQyKEpWKyZd1Hpyye6bL1\nwgWATZ/u5ZS4B63NhRFyDxgPlHWBBohaZBN42zeq0Y0PNGHPVGDH/zFDrpP22Q9Q\nYScsyXTauE/Yf8a/rKR5jdnoVsVVMxk0LHxka8FcM2cqVsDAcK7GqIG6epqNFY8P\nUb1P+mVxRwnkzvf1VtG212ezV/yw9uiQcUkHS+JwZMAgbC34k9iDyRmk6l4sj/Zk\nNem20ImMqdDzsrX8zEe21K+KNvpejPH9fxaNCwR8W+woBMMzqD3I7P9PbLjc70Rx\nRwIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "postgres-6",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtVzM0fwlimmq11jTGTko\nK87LRYSar61tNF3qVWp9axNSMa6BSxVark9eYOqY4eLh/5vJVDqXDFq30/IUWg40\nH8hHWaOEvQrP2dm/XFw1RmunfbfN9gN07TuhaT3xFD5t+jFBuOSoJ4cPnFIABuVt\nFLrjgtYYjtZe5hGE9ZPmS7o2ATM5EU9mxeQ+TkgDbr8StvSPGdZ1ykhagf1pegGU\nRIfZ+4ZKzyDUAq+fYNhIbmlm5h2gP+XdtakPy43j7n0iN1vwDgBqJ2pdaVs/GcFf\nvaztoltguoknI2NPSez1N217asTTLuth0nHxVXiKCVXnqwDjxgWmuP6X2B7VYjyc\nxQIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "redis-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7J/jWx6xCoz3ECDA9gr6\nAVVjd3MhE9LmE/bFLdQLariJjyNxJ1qLp/SN1P/H/aBS9YP6HEGkkTekRkWrHkDr\n5pliR9lmdS7c1W2pRKOaBm8r3pl98fBcFtxrkEhlULX5XMUCeGqANjDYeswaKYGb\nYF/OPsL2ZyIzUiejIVoPR9kuCWA8DNa1whgO84r2gMkBSzGu8hAhBoAlXQAoZWWj\nem3sNNwA9X+0WVGuG0X+RxdzNnZ6o28f5UZuDTCuMjJubKM4qg5uuwFtSXHoW8nU\nGl6Y7Owmqsdkh8ZCM8gA4lPu5Kh6XatqQ6Gzq0PXFyCykuXzJRwW4ZVCKC+UyhA0\nQQIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "redis-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzjHtl5iChC5+uxr9YrQu\n3x4zihlVZGk+fYlpbHg2hV880NslRb1MJYFTaKcJrYmgVAnMaKZjfA4fGsWQ3tDl\n/2JcA95U0Soj9BMwr1EUfvna587xS5DnYNCd+OkVtNwqujdoU8Use13UcpwnaN4V\n/9bslQdw2qDeVmeqx7bfTvsATIedWt9eseMR/qnsMd9Rkz/Q3xJ9NgIdQL6cC7uf\nN6H/B+Y+qV5Kv84nwrkTGPyzNOt21mfzeYOiAMGUTUoS+l38hA4ehfVxb8dWTmNa\n8QENbx6DKP5xUEyCiluzFp5jiGJu9xSDngndLVsQ7de5+KvxTjfipczmrWSjPuYB\nXQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "rsk-mainnet-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtavs6RQW6af9fWuEuhI1\nQa4Ff7Z1CfZ0fHz152UqUeUKatQ/psKVs5ULWDV/b69fSuNsUzkCny9OwtwyQB/F\n2U+vbv3/3As3z6i3V3q8q4ahCHd7tkMmxMLaWcdkfWbpupWTRkCEX+PSDKS0hdfp\n3EQKVA2FrqR0sSnnT+Q66kZw4/WJrNwtSLcps4D5OubG7xr/uUn3Vyv5qXvS/7kx\nGvMONs55qh64Gtc3FSFPEdVyZXasCMEWwXyadqzf+/qJtEYlK0Uy5E/u7CTsnmcH\n9TEiYVw0/6PomQ2HJfSlZVUUO007OliBHO9bWOwZ6qI5c53pt5KES0dyy6SQ4m+8\nawIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "rsk-mainnet-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAu1cuvB3l7sBKJXqjhTih\nQloXteYOr/cQ24R5xUDnHZpCzM75khBjf9ZIX5fskManQ7MI4oFHAaKF6sCWT9QQ\nnL3ON0rCX8wDwBJpKY3iFisAK7f86GO5qkG2ovwG4wO1x69eKX52w33xGpPLPrmw\nBhFv+KfT56KZ3NCvDIQ6tew9VJ3g2V2zUtlL7xZIcdkgTXB06Ec8gbtoCAD3MVUQ\noxMCn+CK6QIAHGxpLIFEv5Y4hNRJ3+0RSuQikhhFzd7P2swnUgDSxDpbfoShroCC\neDw29sapOkQ+PwiHo2Zy8Qtr5m1ToGIhh8l1f/k2vi0Vf2xWVaTjbaeePEDMy9Fd\nKQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-mainnet-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwdrYfy0Spmt8VETCdUgW\nHbxV3uYA3kn2swvOdIjIR29gNO+t6wWv6FHnV/pfefIweIPaNlr9VMoUejUKX809\ngzdsiVWh1T6s4Yzbbt+O8mF3my5RXiSvizda8c6U65vofBSL2WVzE1AW9v7lXRHX\nJ4auKrpgKWkNLU52QLIP9/X5YLUHQtpTnplO31eb+jSD185aN1qoIxugunxnWSgm\n2NgUPlVbNCFrhv0PVv4Ts10eX6smRX3LKyNBtRRXM3GIrQHlAYRohIpy3lt8tKm4\nE/v9qpXQHvqEmX9FH1/Sonea849cWX3LuxUYLT2XFpaNwUxJK56Ef0HsgZESaxL+\n3QIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"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"
}

View File

@@ -1,4 +0,0 @@
{
"name": "rsk-testnet-2",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzG2bgL0n5Q7bTR4WYHOB\nZNOuRem/jjarU/bL0VKKn0JqD3PPDAnhq9gRn7H8SwyGoVFN60YGzu45O4c+SqN3\nCXN+FeFabigH2tKLxBz3kNDYTT/F1ErLLi/6ydrCV3tpddR5KTqLSOntojG8KNzc\nyG4rMV9ebCE1wDVxAFdEA+YDZS8YjP0nO5sLWFacA0ZTx27t5ugqZP1acjSvKzWs\nZ+ekX5Pbws/oUHyaqEEPdz7er4MTBm0bdkCHZbM7132oBcH/huJZhmTXFEdoy4ML\nhP4MWWSvwo66HDYjnaID82a8W1RJZZu2irbPHrfVlaFAh8VQk1T1kkUu0bMovT3V\nYQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,4 +0,0 @@
{
"name": "rsk-testnet-3",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxbo3GccgPZp8UWhb9l2w\n+o6Qe5s4Tf/1TMOw3ppLw+IGCZhq9LEe8s8kngbBX7dMywbyDuf8vLXwvAHFKvC+\nx4XOXq0r9xDX8ujTCfqJxiSYk1KTyqM4lmi7qno7F9/Nwo7h3HuVbpkT752ojf+/\nDCSXwHL+uHlF6z3jKZ8iYBRHFrWmudh8bOm6lVsp/Iv4pQ/btZf8W5zULlk/Z6lT\nb6GS538Lnaoeu7wPCf/awL5GBg9findY3oS1lsEE+PfAu6SAHmbJcItMkrON7Esd\ng9xtwsjX1VICpJhOSkVS1nmRfYohELVJMdiKSLq+b5UskscbCjkRGY6GAPH8cVGg\nSQIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-testnet-4",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1NgmlPomxGRtu5oyro+m\ndQwBXwrhEuE73aLrUsqGOVSezph6LnETiEMFUIe1weoG+xdcykcUUMt7o1+nKs+E\nl8dxMIgbXAxdpI4n8gOpii70Sh30BDbh8+qZHsKBq32UmkCpz2ViVe/Vb3ViqB3e\n0GIkknPle5G4IC612O8EUkCenwcD1jSXYyug5zWI2T/TwnTuw4JdxfhkMgBM7Y2n\nR1YY6GwAMkK97wE/yBM74+Tiv/6lDy/JDbYmUVcQ55C937oodSWLAEM24EcOOtMA\nKfGumnthbdHzmHjONmLIegD3OJGYC2ulcB9qmaL/7cyIRhf6fEQrBolCH5881fxl\nxwIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -0,0 +1,4 @@
{
"name": "rsk-testnet-5",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx/UHlgcSeh9Do7CTCKXC\n/4/aO2OvT+ijDVmrMYCNtE4sMeuFqKPnV1zxJZmRm4VNhkSQDkdWYD+6XvuFYW60\nyjB/N6D5lLlyjG4HD6fTkfh0K6f7t5mOYV7o4T59OoA3cBZuSROjtWmJ8jEFJ+k9\nII2kcyhPQcFN01ckzvZKRSPbVRccMoc+AKTjB3ZUfs/ERtlVoDrK4jEHluXOxUJO\nBKCcLonjJuLlpRLh7QfKrKFcR4idn5Ir43R6aSUesI/ipKwKsXnR3Bu7vXp74VF3\nMJ3EkdSBG+qJzy51fbRfQiUPAr/vSoVQZwW7FkIhIqqLkMaYCymn7qKfTGujoNU7\nlwIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "sentry-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtZFwP58ym+92YFa0adU3\nVGEJW13NkfaHChx+akB3IioSPKyJ9eOXEI8pOmU3QyqOUKSbqth78DY84hobXlqs\n4O0A7TV029uepcj5zPN047gDsV1TJ6Dakma5eH+Pe5kP/TigCEOF0Cgo+fqtEBEJ\nT/rhSs3zHD1EfBnZdyj/7YyeDv1XLWI8dXoizDUAoBSCDeJ5d7fG56zmFYLV05Ex\nMrjJuHitEmeJXTZABKstRbEd+3Rld+gfJZ/jI4djEW2j1EKAYMT1SxoXdjKlCrpQ\nGux2RSe+Gspt1hyp/flU5gHGO+qLDNSU9tZInClToyFMVBfoW8kWg28Gm2kGkIvr\npQIDAQAB\n-----END PUBLIC KEY-----\n"
}

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

@@ -0,0 +1,4 @@
{
"name": "strfry-1",
"public_key": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzDV/RMGMXVDbvoA6PNh8\nQzhtHwYDCFcUSkbrwP6tzh6GpVunGEOdOdhj2V63T2tF1H+lujxQXh5pK7C0D6VZ\niO04ftJlo7/svyxUcwWr+znyN5sFdQRh3cBZiGSBYolizwoqgtPFlbNhmWAzV0Du\n9t8mhz70IK3B+UdwWyHtoK0NNsJGnQ9YzAvcjyDmEO/3sCjAhNnxVpmXftpcSmd9\nMonzFtIDBbRRll4AHZYRbmXCzx63+VmelvdnufnbY82liol0zzBwJaBD1wyNlG0y\ni96p3Kx03bLNlIaYVGbjZeJi+6oo2VDWJ4OloLLAYoHDSipeHT9qWfUdnE6ge4Lm\nywIDAQAB\n-----END PUBLIC KEY-----\n"
}

View File

@@ -1,101 +0,0 @@
# Application Changelog
## v5.2.0
* Add `application_directory` resource.
* Chef 13 compatibility.
## v5.1.0
* Add `application_cookbook_file`, `application_file`, and `application_template` resources.
## v5.0.0
* Massive rewrite on top of newer Chef patterns. See the 5.0 README for details.
## v4.1.6
* Support for Chef 12.
* Add `strict_ssh` option to enable host key checking.
* Add `keep_releases` option to control number of releases to keep.
* Allow passing a path to a file for `deploy_key`.
## v4.1.4
* [COOK-3343](https://tickets.opscode.com/browse/COOK-3343) - Can't parse release candidate version number.
## v4.1.2
* [COOK-3343](https://tickets.opscode.com/browse/COOK-3343) - Can't parse release candidate version number.
## v4.1.0
* [COOK-3343] - Can't parse release candidate version number.
## v4.0.0
* Removes compatability with Chef 10.
* [COOK-3564](https://tickets.opscode.com/browse/COOK-3564) - Replace calls to `Chef::Mixin::RecipeDefinitionDSLCore`.
## v3.0.0
* [COOK-3306]: Multiple Memory Leaks in Application Cookbook.
## v2.0.4
* [COOK-2812]: application cookbook doesn't allow to specify a block as `restart_command`.
## v2.0.2
* [COOK-2537]: Provide proper `respond_to` behavior when using `method_missing`.
* [COOK-2713]: application resource should Allow sub-resource attributes to propogate up.
### Improvement
* [COOK-2597]: Allow customization for `shallow_clone` when doing a git deploy.
## v2.0.0
This release is incompatible with previous releases (hence major version change). The recipes used in older versions are deprecated and completely removed. See README.md for further detail.
* [COOK-1673] - `deploy_revision` in the application cookbook gives an argument error.
* [COOK-1820] - Application cookbook: remove deprecated recipes.
## v1.0.4
* [COOK-1567] - Add git submodules to application cookbook.
## v1.0.2
* [COOK-1312] - string callbacks fail with method not found (really included this time).
* [COOK-1332] - add `release_path` and `shared_path` methods.
* [COOK-1333] - add example for running migrations.
* [COOK-1360] - fix minor typos in README.
* [COOK-1374] - use runit attributes in unicorn run script.
## v1.0.0
This release introduces the LWRP for application deployment, as well as other improvements. The recipes will be deprecated in August 2012 as indicated by their warning messages and in the README.md.
* [COOK-634] - Implement LWRP for application deployment.
* [COOK-1116] - use other SCMs than git.
* [COOK-1252] - add `:force_deploy` that maps to corresponding action of deploy resource.
* [COOK-1253] - fix rollback error.
* [COOK-1312] - string callbacks fail with method not found.
* [COOK-1313] - implicit file based hooks aren't invoked.
* [COOK-1318] - Create `to_ary` method to resolve issue in resources() lookup on "application[foo]" resources.
## v0.99.14
* [COOK-1065] - use pip in virtualenv during deploy.
## v0.99.12
* [COOK-606] application cookbook deployment recipes should use ipaddress instead of fqdn.
## v0.99.11
* make the `_default` `chef_environment` look like production rails env.
## v0.99.10
* Use Chef 0.10's `node.chef_environment` instead of `node['app_environment']`.

View File

@@ -1,260 +0,0 @@
# Application cookbook
[![Build Status](https://img.shields.io/travis/poise/application.svg)](https://travis-ci.org/poise/application)
[![Gem Version](https://img.shields.io/gem/v/poise-application.svg)](https://rubygems.org/gems/poise-application)
[![Cookbook Version](https://img.shields.io/cookbook/v/application.svg)](https://supermarket.chef.io/cookbooks/application)
[![Coverage](https://img.shields.io/codeclimate/coverage/github/poise/application.svg)](https://codeclimate.com/github/poise/application)
[![Gemnasium](https://img.shields.io/gemnasium/poise/application.svg)](https://gemnasium.com/poise/application)
[![License](https://img.shields.io/badge/license-Apache_2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
A [Chef](https://www.chef.io/) cookbook to deploy applications.
## Getting Started
The application cookbook provides a central framework to deploy applications
using Chef. Generally this will be web applications using things like Rails,
Django, or NodeJS, but the framework makes no specific assumptions. The core
`application` resource provides DSL support and helpers, but the heavy lifting
is all done in specific plugins detailed below. Each deployment starts with
an `application` resource:
```ruby
application '/path/to/deploy' do
owner 'root'
group 'root'
# ...
end
```
The `application` resource uses the Poise subresource system for plugins. This
means you configure the steps of the deployment like normal recipe code inside
the `application` resource, with a few special additions:
```ruby
application '/path/to/deploy' do
# Application resource properties.
owner 'root'
group 'root'
# Subresources, like normal recipe code.
package 'ruby'
git '/path/to/deploy' do
repository 'https://github.com/example/myapp.git'
end
application_rails '/path/to/deploy' do
database 'mysql://dbhost/myapp'
end
end
```
When evaluating the recipe inside the `application` resource, it first checks
for `application_#{resource}`, as well as looking for an LWRP of the same name
in any cookbook starting with `application_`. This means that a resource named
`application_foo` can be used as `foo` inside the `application` resource:
```ruby
application '/path/to/deploy' do
owner 'root'
group 'root'
rails '/path/to/deploy' do
database 'mysql://dbhost/myapp'
end
end
```
Additionally if a resource inside the `application` block doesn't have a name,
it uses the same name as the application resource itself:
```ruby
application '/path/to/deploy' do
owner 'root'
group 'root'
rails do
database 'mysql://dbhost/myapp'
end
end
```
Other than those two special features, the recipe code inside the `application`
resource is processed just like any other recipe.
## Available Plugins
* [`application_git`](https://github.com/poise/application_git) Deploy
application code from a git repository.
* [`application_ruby`](https://github.com/poise/application_ruby) Manage Ruby
deployments, such as Rails or Sinatra applications.
* [`application_python`](https://github.com/poise/application_python) Manage
Python deployments, such as Django or Flask applications.
* [`application_javascript`](https://github.com/poise/application_javascript)
Manage server-side JavaScript deployments using Node.js or io.js.
* `application_java` *Coming soon!*
* `application_go` *Coming soon!*
* `application_erlang` *Coming soon!*
## Requirements
Chef 12 or newer is required.
## Resources
### `application`
The `application` resource has top-level configuration properties for each
deployment and acts as a container for other deployment plugin resources.
```ruby
application '/opt/test_sinatra' do
git 'https://github.com/example/my_sinatra_app.git'
bundle_install do
deployment true
end
unicorn do
port 9000
end
end
```
#### Actions
* `:deploy` Deploy the application. *(default)*
* `:start` - Run `:start` on all subresources that support it.
* `:stop` - Run `:stop` on all subresources that support it.
* `:restart` - Run `:restart` on all subresources that support it.
* `:reload` - Run `:reload` on all subresources that support it.
#### Properties
* `path` Path to deploy the application to. *(name attribute)*
* `environment` Environment variables for all application deployment steps.
* `group` System group to deploy the application as.
* `owner` System user to deploy the application as.
* `action_on_update` Action to run on the application resource when any
subresource is updated. *(default: restart)*
* `action_on_update_immediately` Run the `action_on_update` notification with
`:immediately`. *(default: false)*
### `application_cookbook_file`, `application_directory`, `application_file`, `application_template`
The `application_cookbook_file`, `application_directory`, `application_file`, and `application_template`
resources extend the core Chef resources to take some application-level
configuration in to account:
```ruby
application '/opt/myapp' do
template 'myapp.conf' do
source 'myapp.conf.erb'
end
directory 'logs'
end
```
If the resource name is a relative path, it will be expanded relative to the
application path. If an owner or group is declared for the application, those
will be the default user and group for the resource.
All other actions and properties are the same as the similar resource in core Chef.
## Examples
Some test recipes are available as examples for common application frameworks:
* [Sinatra](https://github.com/poise/application_ruby/blob/master/test/cookbooks/application_ruby_test/recipes/sinatra.rb)
* [Rails](https://github.com/poise/application_ruby/blob/master/test/cookbooks/application_ruby_test/recipes/rails.rb)
* [Flask](https://github.com/poise/application_python/blob/master/test/cookbook/recipes/flask.rb)
* [Django](https://github.com/poise/application_python/blob/master/test/cookbook/recipes/django.rb)
* [Express](https://github.com/poise/application_javascript/blob/master/test/cookbook/recipes/express.rb)
## Upgrading From 4.x
While the overall design of the revamped application resource is similar to the
4.x version, some changes will need to be made. The `name` property no longer
exists, with the name attribute being used as the path to the deployment.
The `packages` property has been removed as this is more easily handled via
normal recipe code.
The SCM-related properties like `repository` and `revision` are now handled by
normal plugins. If you were deploying from a private git repository you will
likely want to use the `application_git` cookbook, otherwise just use the
built-in `git` or `svn` resources as per normal.
The properties related to the `deploy` resource like `strategy` and `symlinks`
have been removed. The `deploy` resource is no longer used so these aren't
relevant. As a side effect of this, you'll likely want to point the upgraded
deployment at a new folder or manually clean the `current` and `shared` folders
from the existing folder. The pseudo-Capistrano layout used by the `deploy`
resource has few benefits in a config-managed world and introduced a lot of
complexity and moving pieces that are no longer required.
With the removal of the `deploy` resource, the callback properties and commands
are no longer used as well. Subresources no longer use the complex
actions-as-callbacks arrangement as existed before, instead following normal
Chef recipe flow. Individual subresources may need to be tweaked to work with
newer versions of the cookbooks they come from, though most have stayed similar
in overall approach.
## Database Migrations and Chef
Several of the web application deployment plugins include optional support to
run database migrations from Chef. For "toy" applications where the app and
database run together on a single machine, this is fine and is a nice time
saver. For anything more complex I highly recommend not running database
migrations from Chef. Some initial operations like creating the database and/or
database user are more reasonable as they tend to be done only once and by their
nature the application does not yet have users so some level of eventual
consistency is more acceptable. With migrations on a production application, I
encourage using Chef and the application cookbooks to handle deploying the code
and writing configuration files, but use something more specific to run the
actual migration task. [Fabric](http://www.fabfile.org/),
[Capistrano](http://capistranorb.com/), and [Rundeck](http://rundeck.org/) are
all good choices for this orchestration tooling.
Migrations can generally be applied idempotently but they have unique
constraints (pun definitely intended) that make them tricky in a Chef-like,
convergence-based system. First and foremost is that many table alterations
lock the table for updating for at least some period of time. That can mean that
while staging the new code or configuration data can happen within a window, the
migration itself needs to be run in careful lockstep with the rest of the
deployment process (eg. moving things in and out of load balancers). Beyond
that, while most web frameworks have internal idempotence checks for migrations,
running the process on two servers at the same time can have unexpected effects.
Overall migrations are best thought of as a procedural step rather than a
declaratively modeled piece of the system.
## Application Signals and Updates
The `application` resource exposes `start`, `stop`, `restart`, and `reload`
actions which will dispatch to any subresources attached to the application.
This allows for generic application-level restart or reload signals that will
work with any type of deployment.
Additionally the `action_on_update` property is used to set a default
notification so any subresource that updates will trigger an application
restart or reload. This can be disabled by setting `action_on_update false` if
you want to take manual control of service restarts.
## Sponsors
Development sponsored by [Chef Software](https://www.chef.io/), [Symonds & Son](http://symondsandson.com/), and [Orion](https://www.orionlabs.co/).
The Poise test server infrastructure is sponsored by [Rackspace](https://rackspace.com/).
## License
Copyright 2015-2016, Noah Kantrowitz
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.

View File

@@ -1,25 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
module PoiseApplication
autoload :AppMixin, 'poise_application/app_mixin'
autoload :Error, 'poise_application/error'
autoload :Resources, 'poise_application/resources'
autoload :ServiceMixin, 'poise_application/service_mixin'
autoload :Utils, 'poise_application/utils'
autoload :VERSION, 'poise_application/version'
end

View File

@@ -1,64 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise/utils'
require 'poise_application/app_mixin'
module PoiseApplication
# A helper mixin for `file`-like resources to make them take application
# resource data. Relative paths are expanded against the application path and
# the app owner/group are the default user/group for the resource.
#
# @api private
# @since 5.1.0
module AppFileMixin
include Poise::Utils::ResourceProviderMixin
module Resource
include PoiseApplication::AppMixin
def initialize(*)
super
# So our lazy default below can work. Not needed on 12.7+.
remove_instance_variable(:@path) if instance_variable_defined?(:@path)
end
# @!attribute path
# Override the default path to be relative to the app path.
# @return [String]
attribute(:path, kind_of: String, default: lazy { parent ? ::File.expand_path(name, parent.path) : name })
# @!attribute group
# Override the default group to be the app group if unspecified.
# @return [String, Integer]
attribute(:group, kind_of: [String, Integer, NilClass], default: lazy { parent && parent.group })
# @!attribute owner
# Override the default user to be the app owner if unspecified.
# @return [String, Integer]
attribute(:owner, kind_of: [String, Integer, NilClass], default: lazy { parent && parent.owner })
# For the forgetful.
alias_method :user, :owner
end
module Provider
include PoiseApplication::AppMixin
end
end
end

View File

@@ -1,69 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'chef/mash'
require 'poise/provider'
require 'poise/resource'
require 'poise/utils'
module PoiseApplication
# A helper mixin for application resources and providers. These are things
# intended to be used as subresources of the `application` resource.
#
# @since 5.0.0
module AppMixin
include Poise::Utils::ResourceProviderMixin
# A helper mixin for application resources.
module Resource
include Poise::Resource
# Set the parent type and optional flag.
poise_subresource(:application, true)
# @!attribute path
# Base path for the application.
# @return [String]
attribute(:path, kind_of: String, name_attribute: true)
# A delegator for accessing the application state. If no application
# parent is found, the state will be tracked internally within the
# resource.
#
# @return [Hash<Symbol, Object>]
def app_state
if parent
parent.app_state
else
# If there isn't a parent, just track within the resource.
@local_app_state ||= Mash.new
end
end
# Environment variables stored in the application state.
#
# @return [Hash<String, String>]
def app_state_environment
app_state[:environment] ||= Mash.new
end
end
module Provider
include Poise::Provider
end
end
end

View File

@@ -1,17 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application/resources'

View File

@@ -1,24 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
module PoiseApplication
# Base exception class for poise-application errors.
#
# @since 5.0.0
class Error < Exception
end
end

View File

@@ -1,30 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application/resources/application'
require 'poise_application/resources/application_cookbook_file'
require 'poise_application/resources/application_directory'
require 'poise_application/resources/application_file'
require 'poise_application/resources/application_template'
module PoiseApplication
# Chef resources and providers for poise-application.
#
# @since 5.0.0
module Resources
end
end

View File

@@ -1,259 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'chef/dsl/recipe' # On 12.4+ this will pull in chef/dsl/resources.
require 'chef/resource'
require 'chef/provider'
require 'poise'
module PoiseApplication
module Resources
# (see Application::Resource)
# @since 5.0.0
module Application
# An `application` resource to manage application deployment.
#
# @since 5.0.0
# @provides application
# @action deploy
# @action start
# @action stop
# @action restart
# @action reload
# @example
# application '/srv/myapp' do
# git '...'
# poise_service 'myapp' do
# command '/srv/myapp/main'
# end
# end
class Resource < Chef::Resource
include Poise(container: true, container_namespace: false)
provides(:application)
actions(:deploy, :start, :stop, :restart, :reload)
# @!attribute path
# Application base path.
# @return [String]
attribute(:path, kind_of: String, name_attribute: true)
# @!attribute environment
# Environment variables to set for the whole application.
# @return [Hash<String, String>]
attribute(:environment, kind_of: Hash, default: lazy { Mash.new })
# @!attribute owner
# System user that will own the application. This can be overriden in
# individual subresources.
# @return [String]
attribute(:owner, kind_of: String)
# @!attribute group
# System group that will own the application. This can be overriden in
# individual subresources.
# @return [String]
attribute(:group, kind_of: String)
# @!attribute action_on_update
# Action to run when any subresource is updated. Defaults to `:restart`.
# @return [String, Symbol, nil, false]
attribute(:action_on_update, kind_of: [Symbol, String, NilClass, FalseClass], default: :restart)
# @!attribute action_on_update_immediately
# Run the {#action_on_update} notification with `:immediately`.
# @return [Boolean]
attribute(:action_on_update_immediately, equal_to: [true, false], default: false)
# Run the DSL rewire when the resource object is created.
# @api private
def initialize(*args)
super
_rewire_dsl! if node
end
# Application-specific state values used as a way to communicate between
# subresources.
#
# @return [Mash]
# @example
# if new_resource.parent && new_resource.parent.app_state['gemfile_path']
def app_state
@app_state ||= Mash.new(environment: environment)
end
# Override Container#register_subresource to add our action_on_update.
#
# @api private
def register_subresource(resource)
super.tap do |added|
if added && action_on_update
Chef::Log.debug("[#{self}] Registering #{action_on_update_immediately ? 'immediate ' : ''}#{action_on_update} notification from #{resource}")
resource.notifies action_on_update.to_sym, self, (action_on_update_immediately ? :immediately : :delayed)
end
end
end
private
# Find all resources that need to be rewired. This is anything with a
# name starting with application_.
#
# @return [Array<String>]
def _rewire_resources
if defined?(Chef::DSL::Resources)
# Chef >= 12.4.
Chef::DSL::Resources.instance_methods
else
# Chef < 12.4 >= 12.0.
Chef::Resource.descendants.map do |klass|
klass.node_map.instance_variable_get(:@map).keys + if klass.dsl_name.include?('::')
# Probably not valid.
# :nocov:
[]
# :nocov:
else
# Needed for things that don't call provides().
[klass.dsl_name]
end
end.flatten
end.map {|name| name.to_s }.select {|name| name.start_with?('application_') }.uniq
end
# Find all cookbooks that might contain LWRPs matching our name scheme.
#
# @return [Array<String>]
def _rewire_cookbooks
# Run context might be unset during test setup.
if run_context
run_context.cookbook_collection.keys.select {|cookbook_name| cookbook_name.start_with?('application_') }
else
[]
end
end
# Build the mapping of new_name => old_name for each resource to rewire.
#
# @return [Hash<String, String>]
def _rewire_map
application_cookbooks = _rewire_cookbooks
_rewire_resources.inject({}) do |memo, name|
# Grab the resource class to check if it is an LWRP.
klass = Chef::Resource.resource_for_node(name.to_sym, node)
# Find the part to trim. Check for LWRP first, then just application_.
trim = if klass < Chef::Resource::LWRPBase
application_cookbooks.find {|cookbook_name| name.start_with?(cookbook_name) && name != cookbook_name } || 'application'
else
# Non-LWRPs are assumed to have a better name.
'application'
end
# Map trimmed to untrimmed.
memo[name[trim.length+1..-1]] = name
memo
end
end
# Build new DSL methods to implement the foo -> application_foo behavior.
#
# @return [void]
def _rewire_dsl!
# Generate stub methods for all the rewiring.
_rewire_map.each do |new_name, old_name|
# This is defined as a singleton method on self so it looks like
# the DSL but is scoped to just this context.
define_singleton_method(new_name) do |name=nil, *args, &block|
# Store the caller to correct the source_line.
created_at = caller[0]
public_send(old_name, name, *args) do
# Set the declared type to be the native name.
self.declared_type = self.class.resource_name
# Fix the source location. For Chef 12.4 we could do this with the
# declared_at parameter on the initial send.
self.source_line = created_at
# Run the original block.
instance_exec(&block) if block
end
end
end
end
end
# Provider for `application`.
#
# @since 5.0.0
# @see Resource
# @provides application
class Provider < Chef::Provider
include Poise
provides(:application)
# `deploy` action for `application`. Creates the application base folder.
#
# @return [void]
def action_deploy
notifying_block do
directory new_resource.path do
owner new_resource.owner
group new_resource.group
mode '755'
end
end
end
# `start` action for `application`. Proxies to subresources.
#
# @return [void]
def action_start
proxy_action(:start)
end
# `stop` action for `application`. Proxies to subresources.
#
# @return [void]
def action_stop
proxy_action(:stop)
end
# `restart` action for `application`. Proxies to subresources.
#
# @return [void]
def action_restart
proxy_action(:restart)
end
# `reload` action for `application`. Proxies to subresources.
#
# @return [void]
def action_reload
proxy_action(:reload)
end
private
# Proxy an action to any subresources that support it.
#
# @param action [Symbol] Action to proxy.
# @return [void]
def proxy_action(action)
Chef::Log.debug("[#{new_resource} Running proxied #{action} action")
new_resource.subresources.each do |r|
begin
r.run_action(action) if r.allowed_actions.include?(action)
rescue Chef::Exceptions::UnsupportedAction
# Don't care, just move on.
end
end
end
end
end
end
end

View File

@@ -1,54 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application/app_file_mixin'
module PoiseApplication
module Resources
# (see ApplicationCookbookFile::Resource)
# @since 5.1.0
module ApplicationCookbookFile
# An `application_cookbook_file` resource to manage Chef cookbook_files inside and
# Application cookbook deployment.
#
# @provides application_cookbook_file
# @action create
# @action create_if_missing
# @action delete
# @action touch
# @example
# application '/srv/myapp' do
# cookbook_file 'myapp.conf' do
# source 'myapp.conf'
# end
# end
class Resource < Chef::Resource::CookbookFile
include PoiseApplication::AppFileMixin
provides(:application_cookbook_file)
actions(:create, :create_if_missing, :delete, :touch)
subclass_providers!
def initialize(*args)
super
# For older Chef.
@resource_name = :application_cookbook_file
end
end
end
end
end

View File

@@ -1,50 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application/app_file_mixin'
module PoiseApplication
module Resources
# (see ApplicationDirectory::Resource)
# @since 5.1.0
module ApplicationDirectory
# An `application_directory` resource to manage Chef files inside and
# Application cookbook deployment.
#
# @provides application_directory
# @action create
# @action delete
# @example
# application '/srv/myapp' do
# directory 'logs'
# end
class Resource < Chef::Resource::Directory
include PoiseApplication::AppFileMixin
provides(:application_directory)
actions(:create, :delete)
subclass_providers!
def initialize(*args)
super
# For older Chef.
@resource_name = :application_directory
end
end
end
end
end

View File

@@ -1,54 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application/app_file_mixin'
module PoiseApplication
module Resources
# (see ApplicationFile::Resource)
# @since 5.1.0
module ApplicationFile
# An `application_file` resource to manage Chef files inside and
# Application cookbook deployment.
#
# @provides application_file
# @action create
# @action create_if_missing
# @action delete
# @action touch
# @example
# application '/srv/myapp' do
# file 'myapp.conf' do
# source 'myapp.conf.erb'
# end
# end
class Resource < Chef::Resource::File
include PoiseApplication::AppFileMixin
provides(:application_file)
actions(:create, :create_if_missing, :delete, :touch)
subclass_providers!
def initialize(*args)
super
# For older Chef.
@resource_name = :application_file
end
end
end
end
end

View File

@@ -1,54 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application/app_file_mixin'
module PoiseApplication
module Resources
# (see ApplicationTemplate::Resource)
# @since 5.1.0
module ApplicationTemplate
# An `application_template` resource to manage Chef templates inside and
# Application cookbook deployment.
#
# @provides application_template
# @action create
# @action create_if_missing
# @action delete
# @action touch
# @example
# application '/srv/myapp' do
# template 'myapp.conf' do
# source 'myapp.conf.erb'
# end
# end
class Resource < Chef::Resource::Template
include PoiseApplication::AppFileMixin
provides(:application_template)
actions(:create, :create_if_missing, :delete, :touch)
subclass_providers!
def initialize(*args)
super
# For older Chef.
@resource_name = :application_template
end
end
end
end
end

View File

@@ -1,116 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'chef/resource'
require 'chef/provider'
require 'poise/utils'
require 'poise_service/service_mixin'
require 'poise_service/utils'
require 'poise_application/app_mixin'
require 'poise_application/utils'
module PoiseApplication
# Mixin for application services. This is any resource that will be part of
# an application deployment and involves running a persistent service.
#
# @api public
# @since 5.0.0
# @example
# module MyApp
# class Resource < Chef::Resource
# include Poise
# provides(:my_app)
# include PoiseApplication::ServiceMixin
# end
#
# class Provider < Chef::Provider
# include Poise
# provides(:my_app)
# include PoiseApplication::ServiceMixin
#
# def action_enable
# notifying_block do
# template '/etc/myapp.conf' do
# # ...
# end
# end
# super
# end
#
# def service_options(r)
# super
# r.command('myapp --serve')
# end
# end
# end
module ServiceMixin
include Poise::Utils::ResourceProviderMixin
# Mixin for application service resources.
#
# @see ServiceMixin
module Resource
include PoiseService::ServiceMixin::Resource
include PoiseApplication::AppMixin::Resource
module ClassMethods
# @api private
def included(klass)
super
klass.extend(ClassMethods)
klass.class_exec do
attribute(:path, kind_of: String, name_attribute: true)
# Redefines from the PoiseService version so we get a better default.
attribute(:service_name, kind_of: String, default: lazy { PoiseService::Utils.parse_service_name(path) })
attribute(:user, kind_of: [String, Integer], default: lazy { parent ? parent.owner : 'root' })
end
end
end
extend ClassMethods
end
# Mixin for application service providers.
#
# @see ServiceMixin
module Provider
include PoiseService::ServiceMixin::Provider
include PoiseApplication::AppMixin::Provider
private
# Abstract hook to set parameters on {#service_resource} when it is
# created. This is required to set at least `resource.command`.
#
# @api public
# @param resource [Chef::Resource] Resource instance to set parameters on.
# @return [void]
# @example
# def service_options(resource)
# super
# resource.command('myapp --serve')
# end
def service_options(resource)
super
resource.directory(new_resource.path)
resource.user(new_resource.user)
resource.environment.update(new_resource.app_state_environment) if new_resource.parent
end
end
end
end

View File

@@ -1,51 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'etc'
module PoiseApplication
# Utility methods for PoiseApplication.
#
# @api public
# @since 5.0.0
module Utils
# Methods are also available as module-level methods as well as a mixin.
extend self
# Try to find the primary group name for a given user.
#
# @param user [String, Integer] User to check, if given as an integer this
# is used as a UID, otherwise it is the username.
# @return [String]
# @example
# attribute(:group, kind_of: [String, Integer], default: lazy { PoiseApplication::Utils.primary_group_for(user) })
def primary_group_for(user)
# Force a reload in case any users were created earlier in the run.
Etc.endpwent
Etc.endgrent
user = if user.is_a?(Integer)
Etc.getpwuid(user)
else
Etc.getpwnam(user.to_s)
end
Etc.getgrgid(user.gid).name
rescue ArgumentError
# One of the get* calls exploded. ¯\_(ツ)_/¯
user.to_s
end
end
end

View File

@@ -1,20 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
module PoiseApplication
VERSION = '5.2.0'
end

View File

@@ -1,19 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
raise 'Halite is not compatible with no_lazy_load false, please set no_lazy_load true in your Chef configuration file.' unless Chef::Config[:no_lazy_load]
$LOAD_PATH << File.expand_path('../../files/halite_gem', __FILE__)
require "poise_application/cheftie"

File diff suppressed because one or more lines are too long

View File

@@ -1,10 +0,0 @@
# Application_Git Changelog
## v1.1.0
* [#2](https://github.com/poise/application_git/issues/2) Inherit user and group values from the parent `application` resource.
* [#3](https://github.com/poise/application_git/issues/3) Fix usage with users created during the current Chef run.
## v1.0.0
* Initial release.

View File

@@ -1,108 +0,0 @@
# Application_Git Cookbook
[![Build Status](https://img.shields.io/travis/poise/application_git.svg)](https://travis-ci.org/poise/application_git)
[![Gem Version](https://img.shields.io/gem/v/poise-application-git.svg)](https://rubygems.org/gems/poise-application-git)
[![Cookbook Version](https://img.shields.io/cookbook/v/application_git.svg)](https://supermarket.chef.io/cookbooks/application_git)
[![Coverage](https://img.shields.io/codecov/c/github/poise/application_git.svg)](https://codecov.io/github/poise/application_git)
[![Gemnasium](https://img.shields.io/gemnasium/poise/application_git.svg)](https://gemnasium.com/poise/application_git)
[![License](https://img.shields.io/badge/license-Apache_2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
A [Chef](https://www.chef.io/) cookbook to handle deploying code from git when
using the [application cookbook](https://github.com/poise/application).
## Quick Start
To deploy from a private GitHub repository:
```ruby
application '/srv/myapp' do
git 'git@github.com:example/myapp.git' do
deploy_key chef_vault_item('deploy_keys', 'myapp')['key']
end
end
```
## Requirements
Chef 12 or newer is required.
## Resources
### `application_git`
The `application_git` resource deploys code from git. It extends the core `git`
resource to support deploy keys and disabling strict host key verification.
```ruby
application '/srv/myapp' do
git 'git@github.com:example/myapp.git'
end
```
#### Actions
All actions work the same as the core `git` resource.
* `:sync` Clone and checkout the requested revision *(default)*
* `:checkout` Checkout the request revision. If the repository isn't already
cloned, this action does nothing.
* `:export` Export the repository without the `.git` folder.
#### Properties
All properties from the core `git` resource work the same way with the following
additions:
* `deploy_key` SSH key to use with git. Can be specified either as a path to
key file already created or as a string value containing the key directly.
* `strict_ssh` Enable strict SSH host key checking. *(default: false)*
### DSL Usage
The `application_git` resource can be used directly as a replacement for the
core `git` resource:
```ruby
application_git '/srv/myapp' do
repository 'git@github.com:example/myapp.git'
deploy_key chef_vault_item('deploy_keys', 'myapp')['key']
end
```
Within the `application` resource, a simplified DSL is available. As with other
`application` plugins, the default name of the resource if unspecified is the
application path. The following two examples are equivalent:
```ruby
application '/srv/myapp' do
git do
repository 'git@github.com:example/myapp.git'
end
end
application '/srv/myapp' do
git 'git@github.com:example/myapp.git'
end
```
## Sponsors
Development sponsored by [Chef Software](https://www.chef.io/), [Symonds & Son](http://symondsandson.com/), and [Orion](https://www.orionlabs.co/).
The Poise test server infrastructure is sponsored by [Rackspace](https://rackspace.com/).
## License
Copyright 2015-2016, Noah Kantrowitz
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.

View File

@@ -1,17 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application_git'

View File

@@ -1,21 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application_git/resource'
module PoiseApplicationGit
end

View File

@@ -1,17 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'poise_application_git/resource'

View File

@@ -1,204 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
require 'zlib'
require 'chef/provider'
require 'chef/resource'
require 'poise_application/app_mixin'
require 'poise_application/resources/application'
require 'poise_application_git/safe_string'
module PoiseApplicationGit
# An `application_git` resource to clone application code from git.
#
# @since 1.0.0
# @provides application_git
# @action sync
# @action checkout
# @action export
# @example
# application '/srv/myapp' do
# git 'git@github.com:example/myapp.git' do
# deploy_key data_bag_item('deploy_keys', 'myapp')['key']
# end
# end
class Resource < Chef::Resource::Git
include PoiseApplication::AppMixin
provides(:application_git)
# @api private
def initialize(*args)
super
# Because the superclass declares this, we have to as well. Should be
# removable at some point when Chef makes everything use the provider
# resolver system instead.
@resource_name = :application_git
@provider = PoiseApplicationGit::Provider
# Clear defaults in older versions of Chef.
remove_instance_variable(:@group) if instance_variable_defined?(:@group)
remove_instance_variable(:@user) if instance_variable_defined?(:@user)
end
# @!attribute group
# Group to run git as. Defaults to the application group.
# @return [String, Integer, nil, false]
attribute(:group, kind_of: [String, Integer, NilClass, FalseClass], default: lazy { parent && parent.group })
# @!attribute strict_ssh
# Enable strict SSH host key checking. Defaults to false.
# @return [Boolean]
attribute(:strict_ssh, equal_to: [true, false], default: false)
# @!attribute user
# User to run git as. Defaults to the application owner.
# @return [String, Integer, nil, false]
attribute(:user, kind_of: [String, Integer, NilClass, FalseClass], default: lazy { parent && parent.owner })
# @api private
def after_created
# Allow using the repository as the name in an application block.
if parent && !repository
destination(parent.path)
repository(name)
end
end
# @!attribute deploy_key
# SSH deploy key as either a string value or a path to a key file.
# @return [String]
def deploy_key(val=nil)
# Use a SafeString for literal deploy keys so they aren't shown.
val = SafeString.new(val) if val && !deploy_key_is_local?(val)
set_or_return(:deploy_key, val, kind_of: String)
end
# Default SSH wrapper path.
#
# @api private
# @return [String]
def ssh_wrapper_path
@ssh_wrapper_path ||= ::File.expand_path("~#{user}/.ssh/ssh_wrapper_#{Zlib.crc32(name)}")
end
# Guess if the deploy key is a local path or literal value.
#
# @api private
# @param key [String, nil] Key value to check. Defaults to self.key.
# @return [Boolean]
def deploy_key_is_local?(key=nil)
key ||= deploy_key
key && key[0] == '/'
end
# Path to deploy key.
#
# @api private
# @return [String]
def deploy_key_path
@deploy_key_path ||= if deploy_key_is_local?
deploy_key
else
::File.expand_path("~#{user}/.ssh/id_deploy_#{Zlib.crc32(name)}")
end
end
end
# Provider for `application_git`.
#
# @since 1.0.0
# @see Resource
# @provides application_git
class Provider < Chef::Provider::Git
include PoiseApplication::AppMixin
provides(:application_git)
# @api private
def initialize(*args)
super
# Set the SSH wrapper path in a late-binding kind of way. This better
# supports situations where the user doesn't exist until Chef converges.
new_resource.ssh_wrapper(new_resource.ssh_wrapper_path) if new_resource.deploy_key
end
# @api private
def whyrun_supported?
false # Just not dealing with this right now
end
# Hack our special login in before load_current_resource runs because that
# needs access to the git remote.
#
# @api private
def load_current_resource
include_recipe('git')
notifying_block do
create_dotssh
write_deploy_key
write_ssh_wrapper
end if new_resource.deploy_key
super
end
private
# Create a .ssh folder for the user.
#
# @return [void]
def create_dotssh
directory ::File.expand_path("~#{new_resource.user}/.ssh") do
owner new_resource.user
group new_resource.group
mode '755'
end
end
# Copy the deploy key to a file if needed.
#
# @return [void]
def write_deploy_key
# Check if we have a local path or some actual content
return if new_resource.deploy_key_is_local?
file new_resource.deploy_key_path do
owner new_resource.user
group new_resource.group
mode '600'
content new_resource.deploy_key
sensitive true
end
end
# Create the SSH wrapper script.
#
# @return [void]
def write_ssh_wrapper
# Write out the GIT_SSH script, it should already be enabled above
file new_resource.ssh_wrapper_path do
owner new_resource.user
group new_resource.group
mode '700'
content %Q{#!/bin/sh\n/usr/bin/env ssh #{'-o "StrictHostKeyChecking=no" ' unless new_resource.strict_ssh}-i "#{new_resource.deploy_key_path}" $@\n}
end
end
# Patch back in the `#git` from the git provider. This otherwise conflicts
# with the `#git` defined by the DSL, which gets included in such a way
# that the DSL takes priority.
def git(*args, &block)
Chef::Provider::Git.instance_method(:git).bind(self).call(*args, &block)
end
end
end

View File

@@ -1,19 +0,0 @@
#
# Copyright 2015-2016, Noah Kantrowitz
#
# 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.
#
raise 'Halite is not compatible with no_lazy_load false, please set no_lazy_load true in your Chef configuration file.' unless Chef::Config[:no_lazy_load]
$LOAD_PATH << File.expand_path('../../files/halite_gem', __FILE__)
require "poise_application_git/cheftie"

View File

@@ -1 +0,0 @@
{"name":"application_git","version":"1.1.0","description":"A plugin for poise-application to deploy applications from git.","long_description":"# Application_Git Cookbook\n\n[![Build Status](https://img.shields.io/travis/poise/application_git.svg)](https://travis-ci.org/poise/application_git)\n[![Gem Version](https://img.shields.io/gem/v/poise-application-git.svg)](https://rubygems.org/gems/poise-application-git)\n[![Cookbook Version](https://img.shields.io/cookbook/v/application_git.svg)](https://supermarket.chef.io/cookbooks/application_git)\n[![Coverage](https://img.shields.io/codecov/c/github/poise/application_git.svg)](https://codecov.io/github/poise/application_git)\n[![Gemnasium](https://img.shields.io/gemnasium/poise/application_git.svg)](https://gemnasium.com/poise/application_git)\n[![License](https://img.shields.io/badge/license-Apache_2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n\nA [Chef](https://www.chef.io/) cookbook to handle deploying code from git when\nusing the [application cookbook](https://github.com/poise/application).\n\n## Quick Start\n\nTo deploy from a private GitHub repository:\n\n```ruby\napplication '/srv/myapp' do\n git 'git@github.com:example/myapp.git' do\n deploy_key chef_vault_item('deploy_keys', 'myapp')['key']\n end\nend\n```\n\n## Requirements\n\nChef 12 or newer is required.\n\n## Resources\n\n### `application_git`\n\nThe `application_git` resource deploys code from git. It extends the core `git`\nresource to support deploy keys and disabling strict host key verification.\n\n```ruby\napplication '/srv/myapp' do\n git 'git@github.com:example/myapp.git'\nend\n```\n\n#### Actions\n\nAll actions work the same as the core `git` resource.\n\n* `:sync` Clone and checkout the requested revision *(default)*\n* `:checkout` Checkout the request revision. If the repository isn't already\n cloned, this action does nothing.\n* `:export` Export the repository without the `.git` folder.\n\n#### Properties\n\nAll properties from the core `git` resource work the same way with the following\nadditions:\n\n* `deploy_key` SSH key to use with git. Can be specified either as a path to\n key file already created or as a string value containing the key directly.\n* `strict_ssh` Enable strict SSH host key checking. *(default: false)*\n\n### DSL Usage\n\nThe `application_git` resource can be used directly as a replacement for the\ncore `git` resource:\n\n```ruby\napplication_git '/srv/myapp' do\n repository 'git@github.com:example/myapp.git'\n deploy_key chef_vault_item('deploy_keys', 'myapp')['key']\nend\n```\n\nWithin the `application` resource, a simplified DSL is available. As with other\n`application` plugins, the default name of the resource if unspecified is the\napplication path. The following two examples are equivalent:\n\n```ruby\napplication '/srv/myapp' do\n git do\n repository 'git@github.com:example/myapp.git'\n end\nend\n\napplication '/srv/myapp' do\n git 'git@github.com:example/myapp.git'\nend\n```\n\n## Sponsors\n\nDevelopment sponsored by [Chef Software](https://www.chef.io/), [Symonds & Son](http://symondsandson.com/), and [Orion](https://www.orionlabs.co/).\n\nThe Poise test server infrastructure is sponsored by [Rackspace](https://rackspace.com/).\n\n## License\n\nCopyright 2015-2016, Noah Kantrowitz\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","maintainer":"Noah Kantrowitz","maintainer_email":"noah@coderanger.net","license":"Apache 2.0","platforms":{},"dependencies":{"git":">= 0.0.0","poise":"~> 2.0","application":"~> 5.0"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{}}

View File

@@ -1,5 +0,0 @@
# Application_Javascript Changelog
## v1.0.0
Initial release!

View File

@@ -1,132 +0,0 @@
# Application_Javascript Cookbook
[![Build Status](https://img.shields.io/travis/poise/application_javascript.svg)](https://travis-ci.org/poise/application_javascript)
[![Gem Version](https://img.shields.io/gem/v/poise-application-javascript.svg)](https://rubygems.org/gems/poise-application-javascript)
[![Cookbook Version](https://img.shields.io/cookbook/v/application_javascript.svg)](https://supermarket.chef.io/cookbooks/application_javascript)
[![Coverage](https://img.shields.io/codecov/c/github/poise/application_javascript.svg)](https://codecov.io/github/poise/application_javascript)
[![Gemnasium](https://img.shields.io/gemnasium/poise/application_javascript.svg)](https://gemnasium.com/poise/application_javascript)
[![License](https://img.shields.io/badge/license-Apache_2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
A [Chef](https://www.chef.io/) cookbook to deploy server-side JavaScript
applications using Node.js or io.js.
## Quick Start
To deploy an Express application from git:
```ruby
application '/srv/myapp' do
git 'https://github.com/example/myapp.git'
npm_install
npm_start
end
```
## Requirements
Chef 12 or newer is required.
## Resources
### `application_javascript`
The `application_javascript` resource installs a JavaScript runtime for the
deployment.
```ruby
application '/srv/myapp' do
javascript '3'
end
```
All actions and properties are the same as the [`javascript_runtime` resource](https://github.com/poise/poise-javascript#javascript_runtime).
### `application_javascript_service`
The `application_javascript_javascript_service` resource creates a service for a
JavaScript command.
```ruby
application '/srv/myapp' do
javascript_service 'main.js'
end
```
#### Actions
* `:enable` Create, enable and start the service. *(default)*
* `:disable` Stop, disable, and destroy the service.
* `:start` Start the service.
* `:stop` Stop the service.
* `:restart` Stop and then start the service.
* `:reload` Send the configured reload signal to the service.
#### Properties
* `command` Command to run. *(name attribute)*
* `path` Base path for the application. *(default: application path)*
* `service_name` Name of the service to create. *(default: auto-detect)*
# `user` User to run the service as. *(default: application owner)*
### `application_node_package`
The `application_node_package` resource installs NPM packages for the deployment.
```ruby
application '/srv/myapp' do
node_package 'grunt-cli'
end
```
All actions and properties are the same as the [`node_package` resource](https://github.com/poise/poise-javascript#node_package),
except that the `group` and `user` properties default to the application-level
data if not specified.
### `application_npm_start`
The `application_npm_start` resource creates a service for a JavaScript
application using `npm start`.
```ruby
application '/srv/myapp' do
npm_start
end
```
#### Actions
* `:enable` Create, enable and start the service. *(default)*
* `:disable` Stop, disable, and destroy the service.
* `:start` Start the service.
* `:stop` Stop the service.
* `:restart` Stop and then start the service.
* `:reload` Send the configured reload signal to the service.
#### Properties
* `path` Base path for the application. *(default: name attribute)*
* `command` NPM subcommand to run. *(default: start)*
* `service_name` Name of the service to create. *(default: auto-detect)*
# `user` User to run the service as. *(default: application owner)*
## Sponsors
Development sponsored by [Chef Software](https://www.chef.io/), [Symonds & Son](http://symondsandson.com/), and [Orion](https://www.orionlabs.co/).
The Poise test server infrastructure is sponsored by [Rackspace](https://rackspace.com/).
## License
Copyright 2015, Noah Kantrowitz
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.

View File

@@ -1,23 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
module PoiseApplicationJavascript
autoload :AppMixin, 'poise_application_javascript/app_mixin'
autoload :Error, 'poise_application_javascript/error'
autoload :Resources, 'poise_application_javascript/resources'
autoload :VERSION, 'poise_application_javascript/version'
end

View File

@@ -1,67 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise/backports'
require 'poise/utils'
require 'poise_application/app_mixin'
require 'poise_javascript/javascript_command_mixin'
module PoiseApplicationJavascript
# A helper mixin for Javascript application resources and providers.
#
# @since 4.0.0
module AppMixin
include Poise::Utils::ResourceProviderMixin
# A helper mixin for Javascript application resources.
module Resource
include PoiseApplication::AppMixin::Resource
include PoiseJavascript::JavascriptCommandMixin::Resource
# @!attribute parent_javascript
# Override the #parent_javascript from JavascriptCommandMixin to grok the
# application level parent as a default value.
# @return [PoiseJavascript::Resources::JavascriptRuntime::Resource, nil]
parent_attribute(:javascript, type: :javascript_runtime, optional: true, default: lazy { app_state_javascript.equal?(self) ? nil : app_state_javascript })
# @attribute app_state_javascript
# The application-level Javascript parent.
# @return [PoiseJavascript::Resources::JavascriptRuntime::Resource, nil]
def app_state_javascript(javascript=Poise::NOT_PASSED)
unless javascript == Poise::NOT_PASSED
app_state[:javascript] = javascript
end
app_state[:javascript]
end
# A merged hash of environment variables for both the application state
# and parent javascript.
#
# @return [Hash<String, String>]
def app_state_environment_javascript
env = app_state_environment
env = env.merge(parent_javascript.javascript_environment) if parent_javascript
env
end
end
# A helper mixin for Javascript application providers.
module Provider
include PoiseApplication::AppMixin::Provider
end
end
end

View File

@@ -1,17 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise_application_javascript/resources'

View File

@@ -1,25 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise_application/error'
module PoiseApplicationJavascript
# Base exception class for poise-application-javascript errors.
#
# @since 1.0.0
class Error < PoiseApplication::Error
end
end

View File

@@ -1,22 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise_application_javascript/resources/javascript'
require 'poise_application_javascript/resources/javascript_execute'
require 'poise_application_javascript/resources/javascript_service'
require 'poise_application_javascript/resources/node_package'
require 'poise_application_javascript/resources/npm_install'
require 'poise_application_javascript/resources/npm_start'

View File

@@ -1,64 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise_javascript/resources/javascript_runtime'
require 'poise_application_javascript/app_mixin'
module PoiseApplicationJavascript
module Resources
# (see Javascript::Resource)
# @since 1.0.0
module Javascript
# An `application_javascript` resource to manage Javascript runtimes
# inside an Application cookbook deployment.
#
# @provides application_javascript
# @provides application_javascript_runtime
# @action install
# @action uninstall
# @example
# application '/app' do
# javascript '3'
# end
class Resource < PoiseJavascript::Resources::JavascriptRuntime::Resource
include PoiseApplicationJavascript::AppMixin
provides(:application_javascript)
# Need the double javascript for application resource rewriting.
provides(:application_javascript_runtime)
container_default(false)
subclass_providers!
# We want to run the base class version of this, not the one from the
# mixin. HULK SMASH.
def npm_binary
self.class.superclass.instance_method(:npm_binary).bind(self).call
end
# Set this resource as the app_state's parent javascript.
#
# @api private
def after_created
super.tap do |val|
app_state_javascript(self)
end
end
end
end
end
end

View File

@@ -1,88 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise_javascript/resources/javascript_execute'
require 'poise_application_javascript/app_mixin'
module PoiseApplicationJavascript
module Resources
# (see JavascriptExecute::Resource)
# @since 1.0.0
module JavascriptExecute
# An `application_javascript_execute` resource to run Javascript commands inside an
# Application cookbook deployment.
#
# @provides application_javascript_execute
# @action run
# @example
# application '/srv/myapp' do
# javascript_execute 'setup.py install'
# end
class Resource < PoiseJavascript::Resources::JavascriptExecute::Resource
include PoiseApplicationJavascript::AppMixin
provides(:application_javascript_execute)
def initialize(*args)
super
# Clear some instance variables so my defaults work.
remove_instance_variable(:@cwd)
remove_instance_variable(:@group)
remove_instance_variable(:@user)
end
# #!attribute cwd
# Override the default directory to be the app path if unspecified.
# @return [String]
attribute(:cwd, kind_of: [String, NilClass, FalseClass], default: lazy { parent && parent.path })
# #!attribute group
# Override the default group to be the app group if unspecified.
# @return [String, Integer]
attribute(:group, kind_of: [String, Integer, NilClass, FalseClass], default: lazy { parent && parent.group })
# #!attribute user
# Override the default user to be the app owner if unspecified.
# @return [String, Integer]
attribute(:user, kind_of: [String, Integer, NilClass, FalseClass], default: lazy { parent && parent.owner })
end
# The default provider for `application_javascript_execute`.
#
# @see Resource
# @provides application_javascript_execute
class Provider < PoiseJavascript::Resources::JavascriptExecute::Provider
provides(:application_javascript_execute)
private
# Override environment to add the application envivonrment instead.
#
# @return [Hash]
def environment
super.tap do |environment|
# Don't use the app_state_environment_javascript because we already have
# those values in place.
environment.update(new_resource.app_state_environment)
# Re-apply the resource environment for correct ordering.
environment.update(new_resource.environment) if new_resource.environment
end
end
end
end
end
end

View File

@@ -1,59 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'chef/provider'
require 'chef/resource'
require 'poise'
require 'poise_application_javascript/service_mixin'
module PoiseApplicationJavascript
module Resources
# (see JavascriptService::Resource)
# @since 1.0.0
module JavascriptService
class Resource < Chef::Resource
include PoiseApplicationJavascript::ServiceMixin
provides(:application_javascript_service)
# @!attribute command
# Command to run.
# @return [String]
attribute(:command, kind_of: String, name_attribute: true)
# @!attribute path
# Override {PoiseApplicationJavascript::ServiceMixin#path} to make it
# not the name_attribute.
# @return [String]
attribute(:path, kind_of: String, default: lazy { parent && parent.path })
end
class Provider < Chef::Provider
include PoiseApplicationJavascript::ServiceMixin
provides(:application_javascript_service)
private
# (see PoiseApplication::ServiceMixin#service_options)
def service_options(resource)
super
resource.javascript_command(new_resource.command)
end
end
end
end
end

View File

@@ -1,63 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise_javascript/resources/node_package'
require 'poise_application_javascript/app_mixin'
module PoiseApplicationJavascript
module Resources
# (see NodePackage::Resource)
# @since 1.0.0
module NodePackage
# An `application_node_package` resource to install NPM packages inside
# an Application cookbook deployment.
#
# @provides application_node_package
# @action install
# @action upgrade
# @action remove
# @example
# application '/app' do
# node_package %w{grunt-cli gulp}
# end
class Resource < PoiseJavascript::Resources::NodePackage::Resource
include PoiseApplicationJavascript::AppMixin
provides(:application_node_package)
subclass_providers!
def initialize(*args)
super
# For older Chef.
@resource_name = :application_node_package
end
# #!attribute group
# Override the default group to be the app group if unspecified.
# @return [String, Integer]
attribute(:group, kind_of: [String, Integer, NilClass], default: lazy { parent && parent.group })
# #!attribute user
# Override the default user to be the app owner if unspecified.
# @return [String, Integer]
attribute(:user, kind_of: [String, Integer, NilClass], default: lazy { parent && parent.owner })
# @todo This should handle relative paths against parent.path.
end
end
end
end

View File

@@ -1,45 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise_javascript/resources/npm_install'
require 'poise_application_javascript/app_mixin'
module PoiseApplicationJavascript
module Resources
# (see NpmInstall::Resource)
# @since 1.0.0
module NpmInstall
# An `application_npm_install` resource to install package
# dependencies inside an Application cookbook deployment.
#
# @provides application_npm_install
# @action install
# @example
# application '/app' do
# npm_install
# end
class Resource < PoiseJavascript::Resources::NpmInstall::Resource
include PoiseApplicationJavascript::AppMixin
provides(:application_npm_install)
subclass_providers!
# @todo This should handle relative paths against parent.path.
end
end
end
end

View File

@@ -1,78 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'shellwords'
require 'chef/provider'
require 'chef/resource'
require 'poise'
require 'poise_application_javascript/service_mixin'
module PoiseApplicationJavascript
module Resources
# (see NpmStart::Resource)
# @since 1.0.0
module NpmStart
# An `application_npm_start` resource to create a service for a Javascript
# application using `npm start`.
#
# @provides application_npm_start
# @action enable
# @action disable
# @action start
# @action stop
# @action restart
# @action reload
# @example
# application '/app' do
# npm_start
# end
class Resource < Chef::Resource
include PoiseApplicationJavascript::ServiceMixin
provides(:application_npm_start)
# @!attribute command
# NPM sub-command to run. Defaults to `start`.
# @return [String, Array<String>]
attribute(:command, kind_of: [String, Array], default: 'start')
end
# The default provider for `application_npm_start`.
#
# @see Resource
# @provides application_npm_start
class Provider < Chef::Provider
include PoiseApplicationJavascript::ServiceMixin
provides(:application_npm_start)
private
# (see PoiseApplication::ServiceMixin#service_options)
def service_options(resource)
super
npm_cmd = [new_resource.npm_binary] + Array(new_resource.command)
resource.javascript_command(Shellwords.join(npm_cmd))
# Make sure node is on $PATH because grrr.
new_path = [::File.dirname(new_resource.javascript), (new_resource.app_state_environment_javascript['PATH'] || ENV['PATH']).to_s].join(::File::PATH_SEPARATOR)
resource.environment['PATH'] = new_path
end
end
end
end
end

View File

@@ -1,57 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
require 'poise/utils'
require 'poise_application/service_mixin'
require 'poise_languages/utils'
require 'poise_application_javascript/app_mixin'
module PoiseApplicationJavascript
# A helper mixin for Javascript service resources and providers.
#
# @since 1.0.0
module ServiceMixin
include Poise::Utils::ResourceProviderMixin
# A helper mixin for Javascript service resources.
module Resource
include PoiseApplication::ServiceMixin::Resource
include PoiseApplicationJavascript::AppMixin::Resource
end
# A helper mixin for Javascript service providers.
module Provider
include PoiseApplication::ServiceMixin::Provider
include PoiseApplicationJavascript::AppMixin::Provider
# Set up the service for running Javascript stuff.
def service_options(resource)
super
# Closure scoping for #javascript_command below.
self_ = self
# Create a new singleton method that fills in `node` for you.
resource.define_singleton_method(:javascript_command) do |val|
resource.command("#{self_.new_resource.javascript} #{PoiseLanguages::Utils.absolute_command(val, path: self_.new_resource.app_state_environment_javascript['PATH'])}")
end
# Include env vars as needed.
resource.environment.update(new_resource.parent_javascript.javascript_environment) if new_resource.parent_javascript
end
end
end
end

View File

@@ -1,19 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
module PoiseApplicationJavascript
VERSION = '1.0.0'
end

View File

@@ -1,19 +0,0 @@
#
# Copyright 2015, Noah Kantrowitz
#
# 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.
#
raise 'Halite is not compatible with no_lazy_load false, please set no_lazy_load true in your Chef configuration file.' unless Chef::Config[:no_lazy_load]
$LOAD_PATH << File.expand_path('../../files/halite_gem', __FILE__)
require "poise_application_javascript/cheftie"

File diff suppressed because one or more lines are too long

View File

@@ -1,189 +0,0 @@
Chef Sugar Changelog
=========================
This file is used to list changes made in each version of the chef-sugar cookbook and gem.
v3.3.0 (2016-01-11)
-------------------
### Improvements
- Break up `Chef::Sugar::Constraints` into a class and a dsl file
- Add `platform_version` method with full constraints comparison support
v3.2.0 (2015-12-10)
-------------------
### Improvements
- Add platform matchers for `debian` and `fedora`
- Add `openvz` support under virtualization
- Add init system detection support
- Add support for `nexus`, `ios_xr` platforms and `wrlinux` platform_family
- Add additional `aix` helpers
### Bug Fixes
- Properly expose `Architecture#i386?` in the DSL
v3.1.1 (2015-06-23)
-------------------
### Improvements
- Update Intel CPU types based on existing Fauxhai data
- Update SPARC logic and 32/64-bit logic for x86 and i386
### Bug Fixes
- Fix 32-bit logic
- Fix default behavior to include chef-sugar at compile time
- Fix Chef 12.1.0 warnings for chef_gem compile time install
- Fix `redhat_enterprise_linux?` matcher
v3.0.2 (2015-03-26)
-------------------
### Improvements
- Add helpers for `ppc64` and `ppc64le` architecture
### Bug Fixes
- Adjustments to error message
v3.0.1 (2015-03-20)
-------------------
### Breaking Changes
- Rename `compile_time` `to at_compile_time` - if your recipes are affected by
this breaking change, your Chef Client run will produce a verbose error
message with details on how to fix the error.
v3.0.0 (2015-03-17)
-------------------
### Breaking Changes
- Drop support for Ruby 1.9 (it might still work, but it is no longer officially supported)
### Improvements
- Remove accidentially committed gem source
- Bump development dependencies
- Add `digitalocean?` matcher
- Expose the `rhel` platform as `el`
- Add `ppc64le` platform
- Add helper for determining if architecture is SPARC
- Add helper for determining if architecture is Intel
- Add dynamic platform/version matchers for Solaris
### Bug Fixes
- Reset namespace_options when reaching top-level resources
v2.5.0 (2015-01-05)
-------------------
### Improvements
- Add `data_bag_item_for_environment` function
- Add `kvm?` matcher
- Add `virtualbox?` matcher
### Bug Fixes
- Use `.key?` to check for hash key presence, raising an `AttributeDoesNotExist`
error sooner
v2.4.1 (2014-10-12)
-------------------
- No changes from v2.4.0 - forced a new version upload to the Chef Supermarket
v2.4.0 (2014-10-12)
-------------------
### Improvements
- Add `docker?` matcher
v2.3.2 (2014-10-07)
-------------------
### Big Fixues
- Include `amd64` in `_64_bit?` check
v2.3.1 (2014-10-07)
-------------------
### Improvements
- Check all 64-bit architectures that may be reported by Ohai
### Bug Fixes
- Be more tolerant of `nil` values return from sub functions
- Check to make sure `node['domain']` is not `nil` before calling `#include?`
v2.3.0 (2014-09-24)
-------------------
### Improvements
- Add `vmware?` matcher
- Allow the attribute DSL to access parent attributes
### Bug Fixes
- Return `true` or `false` from all Boolean methods (instead of `nil` or truthy values)
v2.2.0 (2014-08-20)
-------------------
### Improvements
- Add `smartos?` matcher
- Add `omnios?` matcher
v2.1.0 (2014-06-26)
-------------------
### Improvements
- Add `solaris2?` matcher
- Add `aix?` matcher
- Add 'lxc?' matcher
### Bug Fixes
- Fix a bug in namespace memoization during attribute initialization
v2.0.0 (2014-06-16)
-------------------
### Breaking
- Remove `not_linux?` method
- Remove `not_windows?` method
### Improvements
- Miscellaneous spelling fixes
- Update a failing unit test for `installed?`
- Add Mac OS X to the list of platforms (Yosemite)
- Upgrade to RSpec 3
- Fix `which` (and `installed?` and `installed_at_version?`) when given an absolute path
- Fix `linux?` check to only return true on real linuxes
v1.3.0 (2014-05-05)
-------------------
- Check both `$stdout` and `$stderr` in `version_for`
- Add additional platform versions
- Make `includes_recipe?` a top-level API (instead of just Node)
- Match on the highest version number instead of direct equality checking on platform versions
- Define `Object#blank?` as a core extension
- Define `String#flush` as a core extension
- Remove Stove
v1.2.6 (2014-03-16)
-------------------
- Fix a bug in `vagrant?` returning false on newer Vagrant versions
- Remove Coveralls
v1.2.4 (2014-03-13)
-------------------
- See (1.2.2), but I botched the release
v1.2.2 (2014-03-13)
-------------------
- Fix a critical bug with `encrypted_data_bag_item` using the wrong key
v1.2.0 (2014-03-09)
-------------------
- Add `namespace` functionality for specifying attributes in a DSL
- Add constraints helpers for comparing version strings
- Add `require_chef_gem` to safely require and degrade if a gem is not installed
- Add `deep_fetch` and `deep_fetch!` to fetch deeply nested keys
- Accept an optional secret key in `encrypted_data_bag_item` helper and raise a helpful error if one is not set (NOTE: this changes the airity of the method, but it's backward-compatible because Ruby is magic)
- Add Stove for releasing
- Updated copyrights for 2014
v1.1.0 (2013-12-10)
-------------------
- Add `cloudstack?` helper
- Add data bag helpers
- Remove foodcritic checks
- Upgrade development gem versions
- Randomize spec order
v1.0.1 (2013-10-15)
-------------------
- Add development recipe
- Add `compile_time`, `before`, and `after` filters
v1.0.0 (2013-10-15)
-------------------
- First public release

View File

@@ -1,20 +0,0 @@
Contributing to Chef Sugar
===============================
The process for contributing to Chef sugar is rather straight-forward. It is unlikely that you'll need to modify the actual Chef recipe, so it's assumed that you want to work on the Gem itself.
1. Fork the repository on GitHub.
2. Clone your fork.
3. Create a new, semantically-named branch:
$ git checkout -b my_feature_branch
4. Make any changes, ensuring you write adequate test coverage.
5. Document your changes (YARD).
6. Run the tests (make sure they pass).
7. Submit a Pull Request on GitHub.
8. (optional) Ping me on Twitter (@sethvargo)
Additionally, please **DO NOT**:
- Modify the version of the cookbook or gem.
- Update the CHANGELOG
- Make unnecessary changes to the gemspec

View File

@@ -1,495 +0,0 @@
Chef Sugar
==========
[![Gem Version](http://img.shields.io/gem/v/chef-sugar.svg?style=flat-square)][gem]
[![Build Status](http://img.shields.io/travis/sethvargo/chef-sugar.svg?style=flat-square)][travis]
[gem]: https://rubygems.org/gems/chef-sugar
[travis]: http://travis-ci.org/sethvargo/chef-sugar
Chef Sugar is a Gem & Chef Recipe that includes series of helpful sugar of the Chef core and other resources to make a cleaner, more lean recipe DSL, enforce DRY principles, and make writing Chef recipes an awesome experience!
Installation
------------
If you want to develop/hack on chef-sugar, please see the Contributing.md.
If you are using Berkshelf, add `chef-sugar` to your `Berksfile`:
```ruby
cookbook 'chef-sugar'
```
Otherwise, you can use `knife` or download the tarball directly from the community site:
```ruby
knife cookbook site install chef-sugar
```
Usage
-----
In order to use Chef Sugar in your Chef Recipes, you'll first need to include it:
```ruby
include_recipe 'chef-sugar::default'
```
Alternatively you can put it in a base role or recipe and it will be included subsequently.
Requiring the Chef Sugar Gem will automatically extend the Recipe DSL, `Chef::Resource`, and `Chef::Provider` with helpful convenience methods.
### Module Method
If you are working outside of the Recipe DSL, you can use the module methods instead of the Recipe DSL. In general, the module methods have the same name as their Recipe-DSL counterparts, but require the node object as a parameter. For example:
In a Recipe:
```ruby
# cookbook/recipes/default.rb
do_something if windows?
```
In a Library as a singleton:
```ruby
# cookbook/libraries/default.rb
def only_on_windows(&block)
yield if Chef::Sugar::PlatformFamily.windows?(@node)
end
```
In a Library as a Mixin:
```ruby
# cookbook/libraries/default.rb
include Chef::Sugar::PlatformFamily
def only_on_windows(&block)
yield if windows?(@node)
end
```
API
---
**Note:** For the most extensive API documentation, please see the YARD documentation.
### Architecture
**Note:** Some of the architecture commands begin with an underscore (`_`) because Ruby does not permit methods to start with a numeric.
- `_64_bit?`
- `_32_bit?`
- `intel?`
- `sparc?`
- `ppc64?`
- `ppc64le?`
- `powerpc?`
#### Examples
```ruby
execute 'build[my binary]' do
command '...'
not_if { _64_bit? }
end
```
### Cloud
- `azure?`
- `cloud?`
- `digitalocean?`
- `ec2?`
- `eucalyptus?`
- `gce?`
- `linode?`
- `openstack?`
- `cloudstack?`
- `rackspace?`
#### Examples
```ruby
template '/tmp/config' do
variables(
# See also: best_ip_for
ipaddress: cloud? ? node['local_ipv4'] : node['public_ipv4']
)
end
```
### Core Extensions
**Note:** Core extensions are **not** included by default. You must require the `chef/sugar/core_extensions` module manually to gain access to these APIs:
```ruby
require 'chef/sugar/core_extensions'
```
- `String#satisfies?`
- `String#satisfied_by?`
- `Array#satisfied_by?`
- `Object#blank?`
#### Examples
```ruby
# Checking version constraints
'1.0.0'.satisfies?('~> 1.0') #=> true
'~> 1.0'.satisfied_by?('1.0') #=> true
```
```ruby
# Check for an object's presence
''.blank? #=> true
['hello'].blank? #=> false
```
### Data Bag
- `encrypted_data_bag_item` - a handy DSL method for loading encrypted data bag items the same way you load a regular data bag item; this requires `Chef::Config[:encrypted_data_bag_secret]` is set!
- `encrypted_data_bag_item_for_environment` - find the encrypted data bag entry for the current node's Chef environment.
- `data_bag_item_for_environment` - find the data bag entry for the current node's Chef environment.
#### Examples
```ruby
encrypted_data_bag_item('accounts', 'hipchat')
```
```ruby
encrypted_data_bag_item_for_environment('accounts', 'github')
```
```ruby
data_bag_item_for_environment('accounts', 'github')
```
### Docker
Chef Sugar looks for hints to see if the node being converged is a Docker container. When [Ohai supports checking other nodes](https://github.com/opscode/ohai/pull/428), Chef Sugar will automatically pick up the information.
- `docker?`
#### Examples
```ruby
template '/runme' do
only_if { docker?(node) }
end
```
### Attributes
Chef Sugar adds more Chef-like DSL to attribute definitions. Instead of using the Ruby hash syntax, you can define attributes using nested namespaces. This DSL may be more friendly to non-Ruby developers. It can safely be mixed-and-matched with the standard syntax.
```ruby
# This is functionally the same as default['apache2']['config']['root'] = '/var/www'
namespace 'apache2' do
namespace 'config' do
root '/var/www'
end
end
```
```ruby
# Specify multiple keys instead of nesting namespaces
namespace 'apache2', 'config' do
root '/var/www'
end
```
```ruby
# Specify different nested precedence levels
namespace 'apache2', precedence: normal do
namespace 'config', precedence: override do
root '/var/www' #=> override['apache2']['config']['root'] = '/var/www'
end
end
```
### Constraints
- `constraints` - create a new constraint (or requirement) that can be used to test version validations.
- `chef_version` - (DSL only) a wrapper for `version(Chef::VERSION)`
- `version` - create a new version that can be used to test constraint validation.
#### Examples
```ruby
# Check if a version is satisfied by a constraint
version('1.2.3').satisfies?('~> 1.2.0')
```
```ruby
# Check if a constraint is satisfied by a version
constraint('~> 1.2.0').satisfied_by?('1.2.3')
```
```ruby
# Support multiple constraints
version('1.2.3').satisfies?('> 1.2', '< 2.0')
constraint('> 1.2', '< 2.0').satisfied_by?('1.2.3')
```
```ruby
# Only perform an operation if Chef is at a certain version
package 'apache2' do
not_if { chef_version.satisfies?('~> 11.0') } # Ignore Chef 11
end
```
### Kernel
- `require_chef_gem` - "safely" require a gem. Loading a gem with Chef is sometimes difficult and confusing. The errors that Chef produces are also sometimes not very intuitive. In the event you require a gem to exist on the system, you can use `require_chef_gem`, which will attempt to require the gem and then produce helpful output if the gem is not installed:
Chef could not load the gem `#{name}'! You may need to install the gem
manually with `gem install #{name}', or include a recipe before you can
use this resource. Please consult the documentation for this cookbook
for proper usage.
#### Examples
```ruby
# LWRP
require_chef_gem 'pry'
```
```ruby
class Chef
class Provider
class MyProvider > Provider
require_chef_gem 'pry'
end
end
end
```
### Init
- `systemd?` - detect if init system is systemd
- `upstart?` - detect if init system is upstart
- `runit?` - detect if init system is runit
#### Examples
```ruby
systemd_service 'my-service' do
description 'My Service'
install do
wanted_by 'multi-user.target'
end
service do
exec_start '/usr/bin/myserviced'
end
action [:create, :enable, :start]
only_if { systemd? }
end
cookbook_file '/etc/init/my-service.conf' do
source 'my-service.conf'
only_if { upstart? }
end
```
### IP
- `best_ip_for` - determine the best IP address for the given "other" node, preferring local IP addresses over public ones.
#### Examples
```ruby
redis = search('node', 'role:redis').first
template '/tmp/config' do
variables(
ipaddress: best_ip_for(redis)
)
end
```
### Node
Additional methods for the `node` object
- `deep_fetch` - safely fetch a nested attribute.
- `deep_fetch!` - fetch a nested attribute, raising a more semantic error if the key does not exist.
- `in?` - determine if the node is in the given Chef environment.
#### Examples
```ruby
credentials = if node.in?('production')
Chef::EncryptedDataBag.new('...')
else
data_bag('...')
end
```
```ruby
node.deep_fetch('apache2', 'config', 'root') => node['apache2']['config']['root']
```
### Platform
- `amazon_linux?`
- `centos?`
- `linux_mint?`
- `oracle_linux?`
- `redhat_enterprise_linux?`
- `scientific_linux?`
- `ubuntu?`
- `solaris2?`
- `aix?`
- `smartos?`
- `omnios?`
- `raspbian?`
- `nexus?`
- `ios_xr?`
There are also a series of dynamically defined matchers that map named operating system release versions and comparison operators in the form "#{platform}\_#{operator}\_#{name}?". For example:
- `debian_after_squeeze?`
- `linuxmint_after_or_at_olivia?`
- `mac_os_x_lion?`
- `ubuntu_before_lucid?`
- `ubuntu_before_or_at_maverick?`
- `solaris_10?`
- `solaris_11?`
To get a full list, run the following in IRB:
```ruby
require 'chef/sugar'
puts Chef::Sugar::Platform.instance_methods
```
#### Examples
```ruby
if ubuntu?
execute 'apt-get update'
end
```
### Platform Family
- `arch_linux?`
- `debian?`
- `fedora?`
- `freebsd?`
- `gentoo?`
- `linux?`
- `mac_os_x?`
- `openbsd?`
- `rhel?`
- `slackware?`
- `suse?`
- `windows?`
- `wrlinux?`
#### Examples
```ruby
node['attribute'] = if windows?
'C:\Foo\BarDrive'
else
'/foo/bar_drive'
end
```
### Ruby
**Note:** The applies to the Ruby found at `node['languages']['ruby']`.
- `ruby_20?`
- `ruby_19?`
#### Examples
```ruby
log 'This has been known to fail on Ruby 2.0' if ruby_20?
```
### Run Context
- `includes_recipe?` - determines if the current run context includes the recipe
```ruby
if includes_recipe?('apache2::default')
apache_module 'my_module' do
# ...
end
end
```
### Shell
- `which`
- `dev_null`
- `installed?`
- `installed_at_version?`
- `version_for`
#### Examples
```ruby
log "Using `mongo` at `#{which('mongo')}`"
if installed?('apt')
execute 'apt-get update'
end
execute 'install[thing]' do
command "... 2>&1 #{dev_null}"
not_if { installed_at_version?('thing', node['thing']['version']) }
end
log "Skipping git install, version is at #{version_for('mongo', '-v')}"
```
### Vagrant
- `vagrant?`
#### Examples
```ruby
http_request 'http://...' do
not_if { vagrant? }
end
```
### Virtualization
- `kvm?`
- `lxc?`
- `virtualbox?`
- `vmware?`
- `openvz?`
#### Examples
```ruby
service 'ntpd' do
action [:enable, :start]
not_if { lxc? }
end
```
### Filters
- `at_compile_time` - accepts a block of resources to run at compile time
- `before` - insert resource in the collection before the given resource
- `after` - insert resource in the collection after the given resource
#### Examples
```ruby
at_compile_time do
package 'apache2'
end
# This is equivalent to
package 'apache2' do
action :nothing
end.run_action(:install)
```
```ruby
before 'service[apache2]' do
log 'I am before the apache 2 service fires!'
end
```
```ruby
after 'service[apache2]' do
log 'I am after the apache 2 service fires!'
end
```
License & Authors
-----------------
- Author: Seth Vargo (sethvargo@gmail.com)
```text
Copyright 2013-2015 Seth Vargo
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.
```

View File

@@ -1 +0,0 @@
{"name":"chef-sugar","version":"3.3.0","description":"Installs chef-sugar. Please see the chef-sugar Ruby gem for more information.","long_description":"Chef Sugar is a Gem & Chef Recipe that includes series of helpful syntactic\nsugars on top of the Chef core and other resources to make a cleaner, more lean\nrecipe DSL, enforce DRY principles, and make writing Chef recipes an awesome and\nfun experience!\n\nFor the most up-to-date information and documentation, please visit the [Chef\nSugar project page on GitHub](https://github.com/sethvargo/chef-sugar).\n","maintainer":"Seth Vargo","maintainer_email":"sethvargo@gmail.com","license":"Apache 2.0","platforms":{},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{}}

View File

@@ -1,53 +0,0 @@
# compat_resource Cookbook CHANGELOG
This file is used to list changes made in each version of the compat_resource cookbook.
## 12.19.0 (2017-04-17)
- Suppress warning already initialized constant
- Backport yum/apt changes from 12.19
## 12.16.2 (2016-11-09)
- Sync chef-client changes from Chef 12.16.42
## 12.16.1 (2016-10-20)
- add delayed_action helper
## 12.16.0 (2016-10-19)
- Sync chef-client changes from Chef 12.16.14
## 12.14.7 (2016-09-26)
- Update to 12.14.89 Chef
- Fix autoload by applying fix from #106
## 12.14.6 (2016-09-20)
- Update backported codebase to Chef 12.14.77 which brings in yum_repository updates and why-run enabled by default in custom resources
## 12.14.5 (2016-09-19)
- Prevent spamming messages in Chefspec runs for cookbooks that depend on compat_resource
## 12.14.4 (2016-09-19)
- Fix delayed notifications cloning
## 12.14.3 (2016-09-12)
- Fix subscribes notifications
## 12.14.2 (2016-09-09)
- Improve documentation
- keep ChefCompat::Resource defined even if we don't load
## 12.14.1 (2016-09-07)
- add yum_repository resource from Chef 12.14
- Update the minimum chef version in the metadata to 12.1
- Added maintainers files
- suppress constant redef warnings when running chefspec

View File

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

View File

@@ -1,16 +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
* [Lamont Granquist](https://github.com/lamont-granquist)
# Maintainers
* [Jennifer Davis](https://github.com/sigje)
* [Tim Smith](https://github.com/tas50)
* [Thom May](https://github.com/thommay)
* [Lamont Granquist](https://github.com/lamont-granquist)

View File

@@ -1,60 +0,0 @@
# compat_resource cookbook
[![Build Status](https://travis-ci.org/chef-cookbooks/compat_resource.svg?branch=master)](https://travis-ci.org/chef-cookbooks/compat_resource) [![Cookbook Version](https://img.shields.io/cookbook/v/compat_resource.svg)](https://supermarket.chef.io/cookbooks/compat_resource)
This cookbook backports functionality introduced in the latest chef-client releases to any chef-client from 12.1 onwards. This includes [Custom Resource](https://docs.chef.io/custom_resources.html) functionality, notification improvements, as well as new resources added to core chef. It allows for the usage of these new resources in cookbooks without requiring the very latest Chef client release.
## Backported functionality
- [Custom Resources](https://docs.chef.io/custom_resources.html)
- [apt_repository](https://docs.chef.io/resource_apt_repository.html)
- [apt_update](https://docs.chef.io/resource_apt_update.html)
- [systemd_unit](https://docs.chef.io/resource_systemd_unit.html)
- [yum_repository](https://docs.chef.io/resource_yum_repository.html)
- [:before notifications](https://docs.chef.io/resources.html#timers)
## Requirements
### Platforms
- All platforms supported by Chef
### Chef
- Chef 12.1+
### Cookbooks
- none
## Usage
To use this cookbook, put `depends 'compat_resource'` in the metadata.rb of your cookbook. Once this is done, you can use all the new custom resource features to define resources. It Just Works.
## Custom Resources?
Curious about how to use custom resources?
- Docs: <https://docs.chef.io/custom_resources.html>
- Slides: <https://docs.chef.io/decks/custom_resources.html>
## License & Authors
- Author:: Lamont Granquist ([lamont@chef.io](mailto:lamont@chef.io))
- Author:: John Keiser ([jkeiser@chef.io](mailto:jkeiser@chef.io))
```text
Copyright:: 2015-2016 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.
```

View File

@@ -1,29 +0,0 @@
module ChefCompat
module CopiedFromChef
def self.extend_chef_module(chef_module, target)
target.instance_eval do
include chef_module
@chef_module = chef_module
def self.method_missing(name, *args, &block)
@chef_module.send(name, *args, &block)
end
def self.const_missing(name)
@chef_module.const_get(name)
end
end
end
# This patch to CopiedFromChef's ActionClass is necessary for the include to work
require 'chef/resource'
class Chef < ::Chef
class Resource < ::Chef::Resource
module ActionClass
def self.use_inline_resources
end
def self.include_resource_dsl(include_resource_dsl)
end
end
end
end
end
end

View File

@@ -1,47 +0,0 @@
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
begin
require 'chef/constants'
rescue LoadError; end
require 'chef_compat/copied_from_chef'
class Chef
module ::ChefCompat
module CopiedFromChef
#
# Author:: John Keiser <jkeiser@chef.io>
# Copyright:: Copyright 2015-2016, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class Chef < (defined?(::Chef) ? ::Chef : Object)
NOT_PASSED = Object.new
def NOT_PASSED.to_s
"NOT_PASSED"
end
def NOT_PASSED.inspect
to_s
end
NOT_PASSED.freeze
end
end
end
end

View File

@@ -1,40 +0,0 @@
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
begin
require 'chef/delayed_evaluator'
rescue LoadError; end
require 'chef_compat/copied_from_chef'
class Chef
module ::ChefCompat
module CopiedFromChef
#
# Author:: John Keiser <jkeiser@chef.io>
# Copyright:: Copyright 2015-2016, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
class Chef < (defined?(::Chef) ? ::Chef : Object)
class DelayedEvaluator < (defined?(::Chef::DelayedEvaluator) ? ::Chef::DelayedEvaluator : Proc)
end
end
end
end
end

View File

@@ -1,73 +0,0 @@
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
begin
require 'chef/dsl/core'
rescue LoadError; end
require 'chef_compat/copied_from_chef'
class Chef
module ::ChefCompat
module CopiedFromChef
#--
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Christopher Walters (<cw@chef.io>)
# Copyright:: Copyright 2008-2016 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
require "chef_compat/copied_from_chef/chef/dsl/declare_resource"
require "chef_compat/copied_from_chef/chef/dsl/universal"
require "chef_compat/copied_from_chef/chef/mixin/notifying_block"
require "chef_compat/copied_from_chef/chef/mixin/lazy_module_include"
class Chef < (defined?(::Chef) ? ::Chef : Object)
module DSL
CopiedFromChef.extend_chef_module(::Chef::DSL, self) if defined?(::Chef::DSL)
# Part of a family of DSL mixins.
#
# Chef::DSL::Recipe mixes into Recipes and LWRP Providers.
# - this does not target core chef resources and providers.
# - this is restricted to recipe/resource/provider context where a resource collection exists.
# - cookbook authors should typically include modules into here.
#
# Chef::DSL::Core mixes into Recipes, LWRP Providers and Core Providers
# - this adds cores providers on top of the Recipe DSL.
# - this is restricted to recipe/resource/provider context where a resource collection exists.
# - core chef authors should typically include modules into here.
#
# Chef::DSL::Universal mixes into Recipes, LWRP Resources+Providers, Core Resources+Providers, and Attributes files.
# - this adds resources and attributes files.
# - do not add helpers which manipulate the resource collection.
# - this is for general-purpose stuff that is useful nearly everywhere.
# - it also pollutes the namespace of nearly every context, watch out.
#
module Core
CopiedFromChef.extend_chef_module(::Chef::DSL::Core, self) if defined?(::Chef::DSL::Core)
include Chef::DSL::Universal
include Chef::DSL::DeclareResource
include Chef::Mixin::NotifyingBlock
extend Chef::Mixin::LazyModuleInclude
end
end
end
end
end
end

View File

@@ -1,315 +0,0 @@
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
begin
require 'chef/dsl/declare_resource'
rescue LoadError; end
require 'chef_compat/copied_from_chef'
class Chef
module ::ChefCompat
module CopiedFromChef
#--
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Christopher Walters
# Copyright:: Copyright 2008-2016 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
class Chef < (defined?(::Chef) ? ::Chef : Object)
module DSL
CopiedFromChef.extend_chef_module(::Chef::DSL, self) if defined?(::Chef::DSL)
module DeclareResource
CopiedFromChef.extend_chef_module(::Chef::DSL::DeclareResource, self) if defined?(::Chef::DSL::DeclareResource)
# Helper for switching run_contexts. Allows for using :parent or :root in place of
# passing the run_context. Executes the block in the run_context. Returns the return
# value of the passed block.
#
# @param rc [Chef::RunContext,Symbol] Either :root, :parent or a Chef::RunContext
#
# @return return value of the block
#
# @example
# # creates/returns a 'service[foo]' resource in the root run_context
# resource = with_run_context(:root)
# edit_resource(:service, "foo") do
# action :nothing
# end
# end
#
def with_run_context(rc)
raise ArgumentError, "with_run_context is useless without a block" unless block_given?
old_run_context = @run_context
@run_context =
case rc
when Chef::RunContext
rc
when :root
run_context.root_run_context
when :parent
run_context.parent_run_context
else
raise ArgumentError, "bad argument to run_context helper, must be :root, :parent, or a Chef::RunContext"
end
yield
ensure
@run_context = old_run_context
end
# Lookup a resource in the resource collection by name and delete it. This
# will raise Chef::Exceptions::ResourceNotFound if the resource is not found.
#
# @param type [Symbol] The type of resource (e.g. `:file` or `:package`)
# @param name [String] The name of the resource (e.g. '/x/y.txt' or 'apache2')
# @param run_context [Chef::RunContext] the run_context of the resource collection to operate on
#
# @return [Chef::Resource] The resource
#
# @example
# delete_resource!(:template, '/x/y.txy')
#
def delete_resource!(type, name, run_context: self.run_context)
run_context.resource_collection.delete("#{type}[#{name}]").tap do |resource|
# Purge any pending notifications too. This will not raise an exception
# if there are no notifications.
if resource
run_context.before_notification_collection.delete(resource.declared_key)
run_context.immediate_notification_collection.delete(resource.declared_key)
run_context.delayed_notification_collection.delete(resource.declared_key)
end
end
end
# Lookup a resource in the resource collection by name and delete it. Returns
# nil if the resource is not found and should not fail.
#
# @param type [Symbol] The type of resource (e.g. `:file` or `:package`)
# @param name [String] The name of the resource (e.g. '/x/y.txt' or 'apache2')
# @param run_context [Chef::RunContext] the run_context of the resource collection to operate on
#
# @return [Chef::Resource] The resource
#
# @example
# delete_resource(:template, '/x/y.txy')
#
def delete_resource(type, name, run_context: self.run_context)
delete_resource!(type, name, run_context: run_context)
rescue Chef::Exceptions::ResourceNotFound
nil
end
# Lookup a resource in the resource collection by name and edit the resource. If the resource is not
# found this will raise Chef::Exceptions::ResourceNotFound. This is the correct API to use for
# "chef_rewind" functionality.
#
# @param type [Symbol] The type of resource (e.g. `:file` or `:package`)
# @param name [String] The name of the resource (e.g. '/x/y.txt' or 'apache2')
# @param run_context [Chef::RunContext] the run_context of the resource collection to operate on
# @param resource_attrs_block A block that lets you set attributes of the
# resource (it is instance_eval'd on the resource instance).
#
# @return [Chef::Resource] The updated resource
#
# @example
# edit_resource!(:template, '/x/y.txy') do
# cookbook_name: cookbook_name
# end
#
def edit_resource!(type, name, created_at = nil, run_context: self.run_context, &resource_attrs_block)
resource = find_resource!(type, name, run_context: run_context)
if resource_attrs_block
if defined?(new_resource)
resource.instance_exec(new_resource, &resource_attrs_block)
else
resource.instance_exec(&resource_attrs_block)
end
end
resource
end
# Lookup a resource in the resource collection by name. If it exists,
# return it. If it does not exist, create it. This is a useful function
# for accumulator patterns. In CRUD terminology this is an "upsert" operation and is
# used to assert that the resource must exist with the specified properties.
#
# @param type [Symbol] The type of resource (e.g. `:file` or `:package`)
# @param name [String] The name of the resource (e.g. '/x/y.txt' or 'apache2')
# @param created_at [String] The caller of the resource. Use `caller[0]`
# to get the caller of your function. Defaults to the caller of this
# function.
# @param run_context [Chef::RunContext] the run_context of the resource collection to operate on
# @param resource_attrs_block A block that lets you set attributes of the
# resource (it is instance_eval'd on the resource instance).
#
# @return [Chef::Resource] The updated or created resource
#
# @example
# resource = edit_resource(:template, '/x/y.txy') do
# source "y.txy.erb"
# variables {}
# end
# resource.variables.merge!({ home: "/home/klowns" })
#
def edit_resource(type, name, created_at = nil, run_context: self.run_context, &resource_attrs_block)
edit_resource!(type, name, created_at, run_context: run_context, &resource_attrs_block)
rescue Chef::Exceptions::ResourceNotFound
declare_resource(type, name, created_at, run_context: run_context, &resource_attrs_block)
end
# Lookup a resource in the resource collection by name. If the resource is not
# found this will raise Chef::Exceptions::ResourceNotFound. This API is identical to the
# resources() call and while it is a synonym it is not intended to deprecate that call.
#
# @param type [Symbol] The type of resource (e.g. `:file` or `:package`)
# @param name [String] The name of the resource (e.g. '/x/y.txt' or 'apache2')
# @param run_context [Chef::RunContext] the run_context of the resource collection to operate on
#
# @return [Chef::Resource] The updated resource
#
# @example
# resource = find_resource!(:template, '/x/y.txy')
#
def find_resource!(type, name, run_context: self.run_context)
raise ArgumentError, "find_resource! does not take a block" if block_given?
run_context.resource_collection.find(type => name)
end
# Lookup a resource in the resource collection by name. If the resource is not found
# the will be no exception raised and the call will return nil. If a block is given and
# no resource is found it will create the resource using the block, if the resource is
# found then the block will not be applied. The block version is similar to create_if_missing
#
# @param type [Symbol] The type of resource (e.g. `:file` or `:package`)
# @param name [String] The name of the resource (e.g. '/x/y.txt' or 'apache2')
# @param run_context [Chef::RunContext] the run_context of the resource collection to operate on
#
# @return [Chef::Resource] The updated resource
#
# @example
# if ( find_resource(:template, '/x/y.txy') )
# # do something
# else
# # don't worry about the error
# end
#
# @example
# # this API can be used to return a resource from an outer run context, and will only create
# # an action :nothing service if one does not already exist.
# resource = with_run_context(:root) do
# find_resource(:service, 'whatever') do
# action :nothing
# end
# end
#
def find_resource(type, name, created_at: nil, run_context: self.run_context, &resource_attrs_block)
find_resource!(type, name, run_context: run_context)
rescue Chef::Exceptions::ResourceNotFound
if resource_attrs_block
declare_resource(type, name, created_at, run_context: run_context, &resource_attrs_block)
end # returns nil otherwise
end
# Instantiates a resource (via #build_resource), then adds it to the
# resource collection. Note that resource classes are looked up directly,
# so this will create the resource you intended even if the method name
# corresponding to that resource has been overridden.
#
# @param type [Symbol] The type of resource (e.g. `:file` or `:package`)
# @param name [String] The name of the resource (e.g. '/x/y.txt' or 'apache2')
# @param created_at [String] The caller of the resource. Use `caller[0]`
# to get the caller of your function. Defaults to the caller of this
# function.
# @param run_context [Chef::RunContext] the run_context of the resource collection to operate on
# @param resource_attrs_block A block that lets you set attributes of the
# resource (it is instance_eval'd on the resource instance).
#
# @return [Chef::Resource] The new resource.
#
# @example
# declare_resource(:file, '/x/y.txy', caller[0]) do
# action :delete
# end
# # Equivalent to
# file '/x/y.txt' do
# action :delete
# end
#
def declare_resource(type, name, created_at = nil, run_context: self.run_context, create_if_missing: false, &resource_attrs_block)
created_at ||= caller[0]
if create_if_missing
Chef::Log.deprecation "build_resource with a create_if_missing flag is deprecated, use edit_resource instead"
# midly goofy since we call edit_resource only to re-call ourselves, but that's why its deprecated...
return edit_resource(type, name, created_at, run_context: run_context, &resource_attrs_block)
end
resource = build_resource(type, name, created_at, &resource_attrs_block)
run_context.resource_collection.insert(resource, resource_type: type, instance_name: name)
resource
end
# Instantiate a resource of the given +type+ with the given +name+ and
# attributes as given in the +resource_attrs_block+.
#
# The resource is NOT added to the resource collection.
#
# @param type [Symbol] The type of resource (e.g. `:file` or `:package`)
# @param name [String] The name of the resource (e.g. '/x/y.txt' or 'apache2')
# @param created_at [String] The caller of the resource. Use `caller[0]`
# to get the caller of your function. Defaults to the caller of this
# function.
# @param run_context [Chef::RunContext] the run_context of the resource collection to operate on
# @param resource_attrs_block A block that lets you set attributes of the
# resource (it is instance_eval'd on the resource instance).
#
# @return [Chef::Resource] The new resource.
#
# @example
# build_resource(:file, '/x/y.txy', caller[0]) do
# action :delete
# end
#
def build_resource(type, name, created_at = nil, run_context: self.run_context, &resource_attrs_block)
created_at ||= caller[0]
# this needs to be lazy in order to avoid circular dependencies since ResourceBuilder
# will requires the entire provider+resolver universe
require "chef_compat/copied_from_chef/chef/resource_builder" unless defined?(Chef::ResourceBuilder)
Chef::ResourceBuilder.new(
type: type,
name: name,
created_at: created_at,
params: @params,
run_context: run_context,
cookbook_name: cookbook_name,
recipe_name: recipe_name,
enclosing_provider: self.is_a?(Chef::Provider) ? self : nil
).build(&resource_attrs_block)
end
end
end
end
end
end
end

View File

@@ -1,292 +0,0 @@
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
begin
require 'chef/dsl/platform_introspection'
rescue LoadError; end
require 'chef_compat/copied_from_chef'
class Chef
module ::ChefCompat
module CopiedFromChef
#
# Author:: Adam Jacob (<adam@chef.io>)
# Copyright:: Copyright 2008-2016, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
class Chef < (defined?(::Chef) ? ::Chef : Object)
module DSL
CopiedFromChef.extend_chef_module(::Chef::DSL, self) if defined?(::Chef::DSL)
# == Chef::DSL::PlatformIntrospection
# Provides the DSL for platform-dependent switch logic, such as
# #value_for_platform.
module PlatformIntrospection
CopiedFromChef.extend_chef_module(::Chef::DSL::PlatformIntrospection, self) if defined?(::Chef::DSL::PlatformIntrospection)
# Implementation class for determining platform dependent values
class PlatformDependentValue < (defined?(::Chef::DSL::PlatformIntrospection::PlatformDependentValue) ? ::Chef::DSL::PlatformIntrospection::PlatformDependentValue : Object)
# Create a platform dependent value object.
# === Arguments
# platform_hash (Hash) a hash of the same structure as Chef::Platform,
# like this:
# {
# :debian => {:default => 'the value for all debian'}
# [:centos, :redhat, :fedora] => {:default => "value for all EL variants"}
# :ubuntu => { :default => "default for ubuntu", '10.04' => "value for 10.04 only"},
# :default => "the default when nothing else matches"
# }
# * platforms can be specified as Symbols or Strings
# * multiple platforms can be grouped by using an Array as the key
# * values for platforms need to be Hashes of the form:
# {platform_version => value_for_that_version}
# * the exception to the above is the default value, which is given as
# :default => default_value
def initialize(platform_hash)
super if defined?(::Chef::DSL::PlatformIntrospection::PlatformDependentValue)
@values = {}
platform_hash.each { |platforms, value| set(platforms, value) }
end
def value_for_node(node)
platform, version = node[:platform].to_s, node[:platform_version].to_s
# Check if we match a version constraint via Chef::VersionConstraint::Platform and Chef::Version::Platform
matched_value = match_versions(node)
if @values.key?(platform) && @values[platform].key?(version)
@values[platform][version]
elsif matched_value
matched_value
elsif @values.key?(platform) && @values[platform].key?("default")
@values[platform]["default"]
elsif @values.key?("default")
@values["default"]
else
nil
end
end
private
def match_versions(node)
begin
platform, version = node[:platform].to_s, node[:platform_version].to_s
return nil unless @values.key?(platform)
node_version = Chef::Version::Platform.new(version)
key_matches = []
keys = @values[platform].keys
keys.each do |k|
begin
if Chef::VersionConstraint::Platform.new(k).include?(node_version)
key_matches << k
end
rescue Chef::Exceptions::InvalidVersionConstraint => e
Chef::Log.debug "Caught InvalidVersionConstraint. This means that a key in value_for_platform cannot be interpreted as a Chef::VersionConstraint::Platform."
Chef::Log.debug(e)
end
end
return @values[platform][version] if key_matches.include?(version)
case key_matches.length
when 0
return nil
when 1
return @values[platform][key_matches.first]
else
raise "Multiple matches detected for #{platform} with values #{@values}. The matches are: #{key_matches}"
end
rescue Chef::Exceptions::InvalidCookbookVersion => e
# Lets not break because someone passes a weird string like 'default' :)
Chef::Log.debug(e)
Chef::Log.debug "InvalidCookbookVersion exceptions are common and expected here: the generic constraint matcher attempted to match something which is not a constraint. Moving on to next version or constraint"
return nil
rescue Chef::Exceptions::InvalidPlatformVersion => e
Chef::Log.debug "Caught InvalidPlatformVersion, this means that Chef::Version::Platform does not know how to turn #{node_version} into an x.y.z format"
Chef::Log.debug(e)
return nil
end
end
def set(platforms, value)
if platforms.to_s == "default"
@values["default"] = value
else
assert_valid_platform_values!(platforms, value)
Array(platforms).each { |platform| @values[platform.to_s] = normalize_keys(value) }
value
end
end
def normalize_keys(hash)
hash.inject({}) do |h, key_value|
keys, value = *key_value
Array(keys).each do |key|
h[key.to_s] = value
end
h
end
end
def assert_valid_platform_values!(platforms, value)
unless value.kind_of?(Hash)
msg = "platform dependent values must be specified in the format :platform => {:version => value} "
msg << "you gave a value #{value.inspect} for platform(s) #{platforms}"
raise ArgumentError, msg
end
end
end
# Given a hash similar to the one we use for Platforms, select a value from the hash. Supports
# per platform defaults, along with a single base default. Arrays may be passed as hash keys and
# will be expanded.
#
# === Parameters
# platform_hash:: A platform-style hash.
#
# === Returns
# value:: Whatever the most specific value of the hash is.
def value_for_platform(platform_hash)
PlatformDependentValue.new(platform_hash).value_for_node(node)
end
# Given a list of platforms, returns true if the current recipe is being run on a node with
# that platform, false otherwise.
#
# === Parameters
# args:: A list of platforms. Each platform can be in string or symbol format.
#
# === Returns
# true:: If the current platform is in the list
# false:: If the current platform is not in the list
def platform?(*args)
has_platform = false
args.flatten.each do |platform|
has_platform = true if platform.to_s == node[:platform]
end
has_platform
end
# Implementation class for determining platform family dependent values
class PlatformFamilyDependentValue < (defined?(::Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue) ? ::Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue : Object)
# Create a platform family dependent value object.
# === Arguments
# platform_family_hash (Hash) a map of platform families to values.
# like this:
# {
# :rhel => "value for all EL variants"
# :fedora => "value for fedora variants fedora and amazon" ,
# [:fedora, :rhel] => "value for all known redhat variants"
# :debian => "value for debian variants including debian, ubuntu, mint" ,
# :default => "the default when nothing else matches"
# }
# * platform families can be specified as Symbols or Strings
# * multiple platform families can be grouped by using an Array as the key
# * values for platform families can be any object, with no restrictions. Some examples:
# - [:stop, :start]
# - "mysql-devel"
# - { :key => "value" }
def initialize(platform_family_hash)
super if defined?(::Chef::DSL::PlatformIntrospection::PlatformFamilyDependentValue)
@values = {}
@values["default"] = nil
platform_family_hash.each { |platform_families, value| set(platform_families, value) }
end
def value_for_node(node)
if node.key?(:platform_family)
platform_family = node[:platform_family].to_s
if @values.key?(platform_family)
@values[platform_family]
else
@values["default"]
end
else
@values["default"]
end
end
private
def set(platform_family, value)
if platform_family.to_s == "default"
@values["default"] = value
else
Array(platform_family).each { |family| @values[family.to_s] = value }
value
end
end
end
# Given a hash mapping platform families to values, select a value from the hash. Supports a single
# base default if platform family is not in the map. Arrays may be passed as hash keys and will be
# expanded
#
# === Parameters
# platform_family_hash:: A hash in the form { platform_family_name => value }
#
# === Returns
# value:: Whatever the most specific value of the hash is.
def value_for_platform_family(platform_family_hash)
PlatformFamilyDependentValue.new(platform_family_hash).value_for_node(node)
end
# Given a list of platform families, returns true if the current recipe is being run on a
# node within that platform family, false otherwise.
#
# === Parameters
# args:: A list of platform families. Each platform family can be in string or symbol format.
#
# === Returns
# true:: if the current node platform family is in the list.
# false:: if the current node platform family is not in the list.
def platform_family?(*args)
args.flatten.any? do |platform_family|
platform_family.to_s == node[:platform_family]
end
end
# Shamelessly stolen from https://github.com/sethvargo/chef-sugar/blob/master/lib/chef/sugar/docker.rb
# Given a node object, returns whether the node is a docker container.
#
# === Parameters
# node:: [Chef::Node] The node to check.
#
# === Returns
# true:: if the current node is a docker container
# false:: if the current node is not a docker container
def docker?(node = run_context.nil? ? nil : run_context.node)
# Using "File.exist?('/.dockerinit') || File.exist?('/.dockerenv')" makes Travis sad,
# and that makes us sad too.
node && node[:virtualization] && node[:virtualization][:systems] &&
node[:virtualization][:systems][:docker] && node[:virtualization][:systems][:docker] == "guest"
end
end
end
end
# **DEPRECATED**
# This used to be part of chef/mixin/language. Load the file to activate the deprecation code.
end
end
end

View File

@@ -1,37 +0,0 @@
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
# THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
#
# NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
#
begin
require 'chef/dsl/recipe'
rescue LoadError; end
require 'chef_compat/copied_from_chef'
class Chef
module ::ChefCompat
module CopiedFromChef
require "chef_compat/copied_from_chef/chef/dsl/core"
require "chef_compat/copied_from_chef/chef/mixin/lazy_module_include"
class Chef < (defined?(::Chef) ? ::Chef : Object)
module DSL
CopiedFromChef.extend_chef_module(::Chef::DSL, self) if defined?(::Chef::DSL)
module Recipe
CopiedFromChef.extend_chef_module(::Chef::DSL::Recipe, self) if defined?(::Chef::DSL::Recipe)
include Chef::DSL::Core
extend Chef::Mixin::LazyModuleInclude
module FullDSL
CopiedFromChef.extend_chef_module(::Chef::DSL::Recipe::FullDSL, self) if defined?(::Chef::DSL::Recipe::FullDSL)
include Chef::DSL::Recipe
extend Chef::Mixin::LazyModuleInclude
end
end
end
end
require "chef_compat/copied_from_chef/chef/resource"
end
end
end

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