Compare commits

...

474 Commits

Author SHA1 Message Date
packetcat 095e0918d2 remove old pimeyes.com IPs from erlking ipset 2024-04-22 11:19:59 -04:00
packetcat b135a4afc6 remove Bytespider IPs 2024-03-26 09:09:53 -04:00
packetcat 1986d21347 block Content-Nation user agent 2024-02-29 08:22:45 -05:00
packetcat e738cd5545 disable rpcbind target as well 2024-02-28 07:43:29 -05:00
packetcat c752206a5a disable the socket and the service 2024-02-28 07:41:47 -05:00
packetcat 03b90b70ce add disable-rpcbind role 2024-02-28 07:39:27 -05:00
packetcat d68f25b004 remove ultonomy.com vhosts 2023-12-24 11:01:33 -05:00
packetcat d1882d9209 add ClaudeBot to bot block list 2023-11-30 18:50:26 -05:00
packetcat 7099c9bad5 add vhost for wiki.bastetrix.org 2023-11-18 18:29:33 -05:00
packetcat d6aaedae52 add bastetrix.com vhosts back to erlking 2023-11-18 18:14:33 -05:00
packetcat bda7fddd7d fix space alignmend, lol yaml 2023-11-07 18:35:17 -05:00
packetcat a9f9b8a500 fix positioning of blockbots snippet 2023-11-07 18:34:43 -05:00
packetcat 09c98315ea add blocks for fidget-spinner-bot/thesis-research-bot 2023-11-07 18:32:55 -05:00
packetcat 6c64c7437f remove wiki.tenforward.social vhost from erlking 2023-07-02 21:28:44 -04:00
packetcat 86acf67b13 add vhost for wiki.tenforward.social to dresden 2023-07-02 21:14:54 -04:00
packetcat 355f8d0066 add dhparams to dresden 2023-07-02 21:06:34 -04:00
packetcat cb16b7aa90 add dresden config 2023-07-02 21:00:22 -04:00
packetcat b4c3efe21d remove miniflux.packetcat.ca vhost 2023-06-23 09:58:22 -04:00
packetcat 7f74160f06 remove old drop rules 2023-06-19 10:00:48 -04:00
packetcat 01e9a94621 remove sadiq.ae vhost 2023-06-14 08:57:01 -04:00
packetcat b33ce3f48c remove iptables-persistent and netfilter-persistent 2023-04-22 19:29:25 -04:00
packetcat a2427a856f remove packages before installing 2023-04-22 19:20:06 -04:00
packetcat 634ccb19b6 remove wiki.bastetrix.org vhost 2023-04-22 18:58:59 -04:00
packetcat 479116b326 remove bastetrix.com vhost 2023-04-22 18:00:26 -04:00
packetcat 3662db7e8e remove asininetech.com vhosts 2023-03-23 20:43:23 -04:00
packetcat 0690460f00 rename files for new hostnames 2023-03-13 10:36:04 -04:00
packetcat 65129be636 rename deirdre's firewall rules for molly 2023-03-13 10:29:52 -04:00
packetcat 7286c8e8eb Remove deirdre.silvestris.systems.yml 2023-03-13 10:20:45 -04:00
packetcat 4a90334dab remove pcrejit 2023-03-03 19:00:13 -05:00
packetcat 4b138ede90 enable pcre_jit in nginx 2023-03-03 18:57:25 -05:00
packetcat 89c3b18091 let's try without the various location blocks 2023-03-03 14:51:48 -05:00
packetcat 089a56adee let's try new config without the try_files 2023-03-03 14:46:48 -05:00
packetcat 1962531ff1 remove munin 2023-03-03 14:27:59 -05:00
packetcat 3899c63b09 fix config 2023-03-03 14:26:58 -05:00
packetcat 2009e9737c use ips 2023-03-03 14:21:30 -05:00
packetcat 47fcd5289b move upstreams into vhost 2023-03-03 14:19:33 -05:00
packetcat 3d511a092d revert 29969a0f01
revert revert 883043f110

revert revert to new config
2023-03-03 19:15:33 +00:00
packetcat 29969a0f01 revert 883043f110
revert revert to new config
2023-03-03 16:56:18 +00:00
packetcat 883043f110 revert to new config 2023-03-03 11:50:57 -05:00
packetcat e8aff7a548 remove dhparams 2023-03-03 11:26:38 -05:00
packetcat 0551a5b0fd remove munin 2023-03-03 11:25:21 -05:00
packetcat 7bdff45298 again? 2023-03-03 11:23:19 -05:00
packetcat ddee3f9256 trying 1 2023-03-03 11:20:20 -05:00
packetcat a337e612ef change order of proxy 2023-03-03 11:15:46 -05:00
packetcat 48f0724487 add outbound SSH rule 2023-03-03 10:20:51 -05:00
packetcat 0e1f9b93b4 remove dhparams 2023-03-03 10:15:11 -05:00
packetcat d31cd34303 remove extraneous semi-colon 2023-03-03 10:13:28 -05:00
packetcat b9bd448122 add nginx config for molly 2023-03-03 10:11:00 -05:00
packetcat 39c53f1eae remove iperf testing rule for deirdre 2023-03-02 10:05:38 -05:00
packetcat ddc0a433af add rule to allow some iperf testing on deirdre 2023-03-02 09:55:21 -05:00
packetcat cb3adece9d fix spacing 2023-02-25 19:26:12 -05:00
packetcat a35d8e0f89 add vhost for wallabag.packetcat.ca 2023-02-25 19:24:02 -05:00
packetcat 3049462726 set pgbackrest version to 2.44 2023-02-21 11:24:15 -05:00
packetcat 864aa428ad remove irreverent.space vhosts 2023-02-11 18:27:10 -05:00
packetcat 820f4b6018 fix role name in rclone-install.yml 2023-01-13 10:28:20 -05:00
packetcat 2dc58bf8bd add rclone-install.yml 2023-01-13 10:26:35 -05:00
packetcat 4449336212 rename firewall ruleset files for new hostnames 2022-12-18 10:03:38 -05:00
packetcat 63d5805167 update host specific playbooks for new hostnames 2022-12-18 09:55:49 -05:00
packetcat 3a8d6bfc16 remove poetry.packetcat.ca vhost 2022-12-07 11:03:37 -05:00
packetcat 0de498bcd9 removed elaine and namshiel playbooks 2022-11-27 18:08:41 -05:00
packetcat 9c462a0f66 use fucking html method instead 2022-11-11 11:42:30 -05:00
packetcat 5e59e0aa83 use valid cert for munin.tenforward.social 2022-11-11 11:25:38 -05:00
packetcat 7ce1b0bc2a add acme-challenge config 2022-11-11 11:17:01 -05:00
Sadiq Saif a3d69e2a1c add https vhost for munin.tenforward.social 2022-11-11 11:11:13 -05:00
Sadiq Saif 0041a0b297 add munin.tenforward.social config 2022-11-11 11:07:22 -05:00
packetcat f61abd96bf disable nitter.ca error logging for now 2022-09-14 19:40:31 -04:00
packetcat 2dd11a8553 remote ttrss.sadiqsaif.com vhost 2022-08-31 11:18:44 -04:00
packetcat 2e56a5a9ba change SSL certs for miniflux.packetcat.ca 2022-08-31 11:10:30 -04:00
packetcat d3c6f6dd7d add config for miniflux.packetcat.ca 2022-08-31 11:02:54 -04:00
packetcat be432569f8 change PHP version to 8.1 2022-08-31 10:12:36 -04:00
packetcat 863e1b5cd0 Remove old Pimeyes IPs, most likely reassigned to other Hetzner customers 2022-08-17 10:10:11 -04:00
packetcat db7df90dc4 re-enable ssl_ciphers 2022-08-14 17:40:57 -04:00
packetcat f15053e70c turn off cipher selection in elaine.asininetech.net.yml 2022-08-14 17:37:06 -04:00
packetcat 515f1b0737 turn off access logging for nitter.ca 2022-08-11 22:13:34 -04:00
packetcat 0713103201 let's try setting tcp_nodelay on; to the proxy 2022-08-11 17:32:58 -04:00
packetcat bf4596f342 add proxy tuning back in 2022-08-11 15:13:30 -04:00
packetcat 713ad5e5be nope causes nitter to crash 2022-08-11 14:52:13 -04:00
packetcat ae171c173a back to 1024 worker connections 2022-08-11 14:49:06 -04:00
packetcat c718d51575 let's try tweaking the proxy params 2022-08-11 14:48:48 -04:00
packetcat c21fba3e42 again... 2022-08-11 14:39:48 -04:00
packetcat 960d8ca26d let's try this again 2022-08-11 14:38:20 -04:00
packetcat ae000335d1 remove invalid worker parameter 2022-08-11 14:36:16 -04:00
packetcat 40a1a39808 change nginx worker parameters 2022-08-11 14:33:51 -04:00
packetcat 2abce115ab add sadiqsaif.ca vhost with redirect 2022-07-30 18:33:43 -04:00
packetcat 3f7b3a32af redirect for sadiq.ae should be to sadiqsaif.com 2022-07-18 20:27:42 -04:00
packetcat f89dd5ff0d add vhost with redirect for sadiq.ae 2022-07-18 18:11:58 -04:00
packetcat ab893263c8 change SSL cert for wiki.packetcat.ca 2022-07-16 15:26:19 -04:00
packetcat 774f1b5276 change wiki.staticsafe.ca vhosts to wiki.packetcat.ca 2022-07-16 15:21:06 -04:00
packetcat 0a1133cebd Remove netdata playbooks as they are not necessary anymore. 2022-07-04 17:35:23 -04:00
Sadiq Saif 923f7595a0 update pgbackrest version to 2.39 2022-07-02 10:01:16 -04:00
Sadiq Saif fb53c7808c add ssl config for sanya.asininetech.net.yml 2022-07-01 20:50:42 -04:00
Sadiq Saif eb726493db add ubuntu/sanya.asininetech.net.yml 2022-07-01 20:46:14 -04:00
Sadiq Saif 797d48b52f add support for 22.04 in ubuntu/roles/common/tasks/main.yml 2022-06-26 16:05:11 -04:00
packetcat f06823a062 add 157.90.177.214 to deirdre.asininetech.net.ipset 2022-04-04 12:49:13 -04:00
staticsafe 2955428f01 add 2002:2d8d:56bb::2d8d:56bb to deirdre.asininetech.net.rules.v6 2022-01-13 09:30:24 -05:00
staticsafe 66e206d7c8 add AS206728 to deirdre and erlking ipsets 2022-01-12 12:37:00 -05:00
staticsafe 0cf1563566 change pgbackrest version to 2.36 2021-12-31 09:29:21 -05:00
staticsafe 47eb6aa778 add redirect for asininetech.com to nullrouted.space 2021-12-29 20:59:22 -05:00
staticsafe 4f7fe6dc39 change certs for nullrouted.space to proper ones 2021-12-29 20:46:28 -05:00
staticsafe d4466fa486 add initial config for nullrouted.space 2021-12-29 20:41:23 -05:00
staticsafe 5f0de6725c add tailscale ipv6 addresses to allow list 2021-11-21 12:38:51 -05:00
staticsafe 834890958b add tailscale subnet to allow list 2021-11-20 23:07:47 -05:00
staticsafe fa5dc5c4b4 oops..fix syntax error in deirdre.asininetech.net.ipset 2021-10-27 18:18:01 -04:00
staticsafe 7ee004dbce add 101.200.169.64 to deirdre.asininetech.net.ipset 2021-10-27 18:16:29 -04:00
staticsafe 0bc698d2a3 use proper cert for wiki.bastetrix.org 2021-10-17 12:00:47 -04:00
staticsafe 417fe5bba3 add wiki.bastetrix.org 2021-10-17 11:55:15 -04:00
staticsafe 4965c02d78 wp sites should use the wp_with_supercache snippet now 2021-10-17 11:49:25 -04:00
staticsafe 14f4f9e564 use proper certs for poetry.packetcat.ca 2021-10-17 11:43:21 -04:00
staticsafe 1cffac6a06 add poetry.packetcat.ca and php snippet 2021-10-17 11:36:05 -04:00
staticsafe 30cd26621b use sslstapling snippet to consolidate configs 2021-10-17 11:17:26 -04:00
staticsafe b6dfff5b55 use proper cert for bastetrix.com 2021-10-17 11:15:22 -04:00
staticsafe a9cee4de3b use different resolver for ssl stapling snippet 2021-10-17 11:12:14 -04:00
staticsafe 941ae1d6d5 oops wrong section 2021-10-17 11:09:53 -04:00
staticsafe 90225209a8 add sslstapling_hsts snippet 2021-10-17 11:09:21 -04:00
staticsafe 75a7f31a34 add bastetrix.com.https 2021-10-17 11:06:40 -04:00
staticsafe 6760952018 add bastetrix.com.http 2021-10-17 10:59:25 -04:00
staticsafe 4059278a32 include norobots.conf snippets 2021-10-14 22:25:07 -04:00
staticsafe c425d6b291 turn on access logging in ubuntu/elaine.asininetech.net.yml 2021-10-14 22:07:23 -04:00
staticsafe 07e9a24ce3 errors should be logged 2021-09-07 18:17:14 -04:00
staticsafe 4c09da012d turn off access logging for nitter.ca 2021-09-07 18:16:47 -04:00
staticsafe 1eb8567d07 remove dhparams parameter 2021-09-07 17:29:36 -04:00
staticsafe 3a88e45cbc remove add_header 2021-09-07 17:24:11 -04:00
staticsafe 0cdad6a443 remove robots.txt section 2021-09-07 17:21:15 -04:00
staticsafe f5e67ae71d add https config for nitter.ca 2021-09-07 17:20:14 -04:00
staticsafe d650f545b7 add ubuntu/elaine.asininetech.net.yml 2021-09-07 16:57:04 -04:00
staticsafe 3ffa834b4a fix typo in demonreach.asininetech.net.rules.v4 2021-09-04 13:50:34 -04:00
staticsafe c8a274c39a fix more incorrect syntax in demonreach.asininetech.net.rules.v6 2021-09-04 13:49:25 -04:00
staticsafe 1a658b71a0 fix NAT rules in demonreach.asininetech.net.rules.v6 2021-09-04 13:48:06 -04:00
staticsafe cac6aab56a add some wireguard specific rules to demonreach 2021-09-04 13:45:10 -04:00
staticsafe d1c8a3eb55 add TinyBotTestUA to block list 2021-07-16 15:07:53 -04:00
staticsafe d38daabc0c add TinyTestBot to bot block list 2021-06-29 14:33:04 -04:00
staticsafe 32e5b1396a use custom 404 page for sadiqsaif.com 2021-06-13 16:16:29 -04:00
staticsafe 1b2227555c change webroot for sadiqsaif.com 2021-06-13 15:49:35 -04:00
staticsafe d4bd7cfcf9 add lanaibot useragent to block list in deirdre.asininetech.net.yml 2021-05-18 11:30:22 -04:00
staticsafe 736158c9b5 update pgbackrest-install/tasks/main.yml to use 2.33 2021-05-11 12:35:29 -04:00
staticsafe 9852a4ea21 remove tinc ports in deirdre 2021-04-05 09:18:44 -04:00
staticsafe 4085481ed0 remove elasticsearch ports from deirdre firewall rules 2021-04-05 09:18:06 -04:00
staticsafe 9aec73785d add rules to allow outbound NTP to deirdre 2021-04-05 08:29:25 -04:00
staticsafe 2fb9123db3 update IP range for Infegy bot to 173.244.135.0/25 2021-03-20 19:01:08 -04:00
staticsafe 45935b847a remove old ipset block of Comcast dynamic IP 2021-03-20 18:56:52 -04:00
staticsafe 53efc0c07c remove waldo.asininetech.net.yml
host is decommissioned
2021-03-20 18:44:17 -04:00
staticsafe 83f211675b change hosts value to specific hosts for webserver plays 2021-03-20 18:43:31 -04:00
staticsafe 8cbf3b0e64 add blockbots nginx snippet and use it in TF vhost 2021-03-20 18:41:38 -04:00
staticsafe 0b3265d75c add a new IP into deirdre and erlking ipsets
remove waldo ipsets and rules
2021-03-17 09:56:10 -04:00
staticsafe ae99eaef7b home nodes should be updated as well 2021-01-17 19:15:50 -05:00
staticsafe 1541a24467 add package-update role 2021-01-17 19:14:41 -05:00
staticsafe 3cb30d2985 add aliases copy task to common play 2020-12-01 10:31:07 -05:00
staticsafe db53abe225 remove zsh from common packages install list 2020-11-29 09:21:54 -05:00
staticsafe 2860f23b85 add net-tools to common packages install list 2020-11-29 09:21:03 -05:00
staticsafe 2d2e5a78c5 we should set hostname before package installation 2020-11-25 16:20:30 -05:00
staticsafe 42b6960609 add 217.160.142.105 to ipset 2020-10-28 10:40:14 -04:00
staticsafe 8ac714f548 consolidate adsbot prefixes into two /24s 2020-10-15 13:15:06 -04:00
staticsafe 0506ecb009 remove - in host group name in icinga-client-install.yml 2020-10-12 09:12:07 -04:00
staticsafe 87c531e0c5 update adsbot prefixes 2020-10-12 09:10:40 -04:00
staticsafe 4343fdf1f6 install python-is-python3 as part of common role 2020-10-11 14:37:53 -04:00
staticsafe 016d71151a set phpfpm socket to 7.4 2020-10-03 22:02:26 -04:00
staticsafe 4e96352e88 add another adsbot IP into the ipset 2020-09-23 11:00:00 -04:00
staticsafe 340637ef19 add another subnet of Aspiegel bot 2020-09-12 12:19:39 -04:00
staticsafe c28997cd60 add another adsbot IP to nasties ipset 2020-09-11 19:47:15 -04:00
staticsafe 4f7b399783 add another adsbot IP to ipset list 2020-09-09 09:27:07 -04:00
staticsafe 10ba23f5d6 add another Adsbot IP to the nasties ipset 2020-09-07 12:40:23 -04:00
staticsafe 4d0660e162 quotes needed 2020-08-22 19:03:10 -04:00
staticsafe 1bd0269944 make sure to set hostname on new nodes and turn off motd news on focal 2020-08-22 19:00:56 -04:00
staticsafe 2d45e87d98 remove sshd_config copy in common role
its in ssh-enforcement now
2020-08-22 18:43:35 -04:00
staticsafe e574b1d4de remove catsith.asininetech.net.yml
no longer needed
2020-08-22 16:44:50 -04:00
staticsafe 9aa40b3967 Clean up site.yml and move some other roles into their own yml files 2020-08-22 16:21:24 -04:00
staticsafe b2bd30101b ssh-enforcement role should be run for unsetup hosts as well. 2020-08-22 15:59:38 -04:00
staticsafe 2bfed5b9ed add ssh-enforcement playbook 2020-08-22 15:47:23 -04:00
Sadiq Saif b6946a3e26
Update pgbackrest version to 2.28 2020-08-18 08:40:19 -04:00
staticsafe c73f1f6b7c add woff2 to static resources to be cached 2020-07-30 17:57:33 -04:00
staticsafe d2b0e47564 add Adsbot IPs to webserver ipsets 2020-07-29 08:46:33 -04:00
staticsafe 36086ba967 fix an extraneous space in erlking.asininetech.net.yml 2020-07-27 15:26:12 -04:00
staticsafe 3715879e77 add WP caching config to other sites now 2020-07-27 13:42:50 -04:00
staticsafe 33c6fc78e2 fix extra bracket 2020-07-27 13:37:43 -04:00
staticsafe b604283ce5 improve WP caching setup
testing on asininetech.com
2020-07-27 13:33:52 -04:00
staticsafe 91404bb5f1 remove extraneous ; 2020-07-26 19:27:42 -04:00
staticsafe 377568f7cd remove quotes 2020-07-26 19:26:46 -04:00
staticsafe 2e468240fd add new Access-Control-Allow-Origin header for Mastodon 3.2.0 2020-07-26 19:24:05 -04:00
staticsafe 1b6e048e43 cleanup as393949.net 2020-07-18 22:41:10 -04:00
staticsafe 8dd8505d0a remove as393949.net 2020-07-18 22:21:41 -04:00
staticsafe 4ea258d17b add 149.248.4.242 to deirdre.asininetech.net.ipset 2020-07-05 14:34:47 -04:00
staticsafe 71fc82ed22 remove namshiel.asininetech.net.rules.* 2020-07-05 14:33:29 -04:00
staticsafe f5f09ebc58 add 2001:19f0:6001:5aa0:5400:2ff:fecf:eee5 to drop for deirdre 2020-07-05 14:31:44 -04:00
staticsafe 7426c88be2 add 75.64.236.168/32 to deirdre and waldo ipset 2020-06-27 17:31:15 -04:00
staticsafe f091373a1b add yet another pimeyes.com crawler IP to ipset 2020-06-01 23:31:36 -04:00
staticsafe 07badc1ff1 add another pimeyes crawler IP to ipset 2020-06-01 23:17:07 -04:00
staticsafe c69b2dda9a add another pimeyes.com crawler IP 2020-05-27 21:05:14 -04:00
staticsafe 146fd41a7f add pimeeyes.com crawler IP to nasties ipset 2020-05-27 21:01:18 -04:00
staticsafe e1c36822fa add a centurybot IP to nasties ipset 2020-05-27 13:44:27 -04:00
staticsafe 4fbedfec4e add Aspiegel bot range to nasties ipset 2020-05-19 13:24:00 -04:00
staticsafe 1a633fb947 sadiqsaif.com does not need a custom 404 page anymore. 2020-05-07 16:48:02 -04:00
staticsafe 4c573cb5a0 remove python-pip and python-dev from common role 2020-04-23 16:55:18 -04:00
staticsafe 27b9e93b0d reference nasties ipset for erlking and waldo 2020-04-15 10:54:52 -04:00
staticsafe fd475f98cb add some more ipsets for erlking and waldo 2020-04-15 10:52:33 -04:00
staticsafe d8f5681c52 fix typo in ipset.service 2020-04-15 10:26:29 -04:00
staticsafe dd4d335302 make ipset.service import even if ipset already exists and then reload in main.yml 2020-04-15 10:24:02 -04:00
staticsafe 05176fb83e don't destroy ipset in main.yml 2020-04-15 10:15:37 -04:00
staticsafe 3fb3507d40 make some more explicit requirements in ipset.service 2020-04-15 10:14:05 -04:00
staticsafe 8aa1d869ba clean up unnecessary comments in firewall rulesets 2020-04-14 22:41:05 -04:00
staticsafe a7888e95bf set FLUSH_ON_STOP to 0 2020-04-14 22:36:13 -04:00
staticsafe 358b88ea60 we use a default file for netfilter-persistent 2020-04-14 22:29:56 -04:00
staticsafe 14c62687a7 ipset service stop destroy 2020-04-14 22:16:02 -04:00
staticsafe 53d62d54f5 let's try this again with destroy 2020-04-14 22:15:06 -04:00
staticsafe 377a5bcebf temporarily comment out firewall rule 2020-04-14 22:12:03 -04:00
staticsafe 58c0b0e2c1 always reload systemd 2020-04-14 22:09:46 -04:00
staticsafe 3abbcbbd9e use flush instead of destroy in ipset everywhere 2020-04-14 22:07:16 -04:00
staticsafe 92f286bbd6 should be src for ipset based rule 2020-04-14 22:03:31 -04:00
staticsafe c267ec243f use ipset instead of a bunch of INPUTs 2020-04-14 22:02:50 -04:00
staticsafe 0d7df674ec dont use handler 2020-04-14 21:56:14 -04:00
staticsafe 02a376b367 restart ipset service instead of start and use handler 2020-04-14 21:52:51 -04:00
staticsafe 1430497f5c move order of ipset destroy up 2020-04-14 21:47:16 -04:00
staticsafe 696bf3348f fix syntax error in ubuntu/roles/ipset-deploy/tasks/main.yml 2020-04-14 21:44:55 -04:00
staticsafe ce39f769a2 add ipset-deploy role 2020-04-14 21:42:03 -04:00
staticsafe 835384a24d add rulesets for uriel.asininetech.net. 2020-04-04 19:19:53 -04:00
staticsafe 66eebc37d3 add moz.com crawler to firewall block list on web servers 2020-03-28 23:10:00 -04:00
staticsafe 99137e82f1 Merge branch 'nextgen' of github.com:staticsafe/ansible-playbooks into nextgen 2020-03-27 13:08:19 -04:00
staticsafe 07cf97fa21 add rpcbind to list of packages we remove on setup 2020-03-27 13:08:12 -04:00
Sadiq Saif 57a0f65ffd
Update README.md to say 18.04 2020-03-24 11:43:02 -04:00
staticsafe 114970ec4b Use a more generic sshd_config with our options. 2020-03-24 11:15:43 -04:00
staticsafe 1f1bf5147b common role is now copying over a sshd_config 2020-03-24 10:27:23 -04:00
staticsafe 1de56b96b9 remove grevane.asininetech.net.rules.*, not needed anymore 2020-03-23 11:26:08 -04:00
staticsafe c1b3d2a171 clean up nginx_remove_sites 2020-03-09 20:38:56 -04:00
staticsafe 6613d75162 remove sadiqsaif.ca and staticsafe.ca vhosts 2020-03-09 19:26:22 -04:00
staticsafe 7fb64da246 no need for 127/8 rules in demonreach.asininetech.net.rules.v4 2020-03-08 22:56:18 -04:00
staticsafe 10c45c850b DNS resolving issues in demonreach.asininetech.net.rules.v4? 2020-03-08 15:58:13 -04:00
staticsafe f9e74ee5aa allow TCP DNS as well for VPN subnet 2020-03-04 17:50:43 -05:00
staticsafe 13f9b1575c add 2620:98:4002::/48 to port 53 for demonreach.asininetech.net.rules.v6 2020-03-04 17:16:48 -05:00
staticsafe a0d1c0598d remove port 1723 from demonreach.asininetech.net.rules.v4 2020-03-04 13:49:55 -05:00
staticsafe 12e58f3c01 add port 1723 to demonreach.asininetech.net.rules.v4 2020-03-04 13:45:18 -05:00
staticsafe 907b86492b add a DROP rule in deirdre.asininetech.net.rules.v4 2020-02-25 23:31:22 -05:00
staticsafe e866d062a9 add AlkonavtNetwork subnet to drop list on deirdre.asininetech.net.rules.v4 2020-02-20 14:46:21 -05:00
staticsafe db59ab205e add rule to drop SearchAtlas crawler 2020-02-20 14:26:02 -05:00
staticsafe c6997dcd39 add drop for Seekport crawler IP to deirdre and waldo 2020-02-14 19:29:13 -05:00
staticsafe 9766d2ced5 Add vhost for ultonomy.com. 2020-01-22 10:46:15 -05:00
staticsafe 2af73d2d4e allow ES traffic over Tinc VPN 2020-01-19 10:35:58 -05:00
staticsafe bc92c9d437 Port opening for Tinc 2020-01-18 20:49:05 -05:00
staticsafe a4c0bcde30 min heap size 4g 2020-01-18 18:56:24 -05:00
staticsafe 42bf05965b increase min heap size to 2g 2020-01-18 18:54:41 -05:00
staticsafe 2c83554698 elasticsearch_version should be 6.x 2020-01-18 18:49:03 -05:00
staticsafe 869d80e6f7 we need to secure port 9300 on namshiel as well 2020-01-18 18:00:08 -05:00
staticsafe 201f4a35ca min heap size to 1g? 2020-01-18 17:39:47 -05:00
staticsafe 6f0febf806 needs min heap size? 2020-01-18 17:36:56 -05:00
staticsafe d810ba667e let's try again? 2020-01-18 17:34:00 -05:00
staticsafe d0976ca7fb fix formatting on namshiel-elasticsearch.asininetech.net.yml? 2020-01-18 17:33:01 -05:00
staticsafe e306a60ea6 add namshiel related files 2020-01-18 17:29:03 -05:00
staticsafe a0e26301cf deirdre should be able to talk outbound 9200 for ES 2020-01-18 17:17:51 -05:00
staticsafe d384b41e75 cleanup i.asininetech.com. 2020-01-16 18:17:01 -05:00
staticsafe 748ddb1008 remove i.asininetech.com. 2020-01-16 18:09:51 -05:00
staticsafe 9e1e20d33f Remove port 4949 from allowed ports
deirdre no longer using munin-node
2020-01-06 10:17:29 -05:00
staticsafe da2f7aef93 Remove catsith.asininetech.net.rules.v4 and catsith.asininetech.net.rules.v6
catsith is gone
2020-01-06 10:16:20 -05:00
staticsafe 3b73edf491 add firewall rule to drop aggressive crawler in catsith.asininetech.net.rules.v6 2019-12-23 18:40:54 -05:00
staticsafe 85d19dd3a0 add ipset package install to ubuntu/roles/firewall-ruleset-deploy/tasks/main.yml 2019-11-17 16:22:27 -05:00
staticsafe 48e67daf37 remove duplicity/python-boto, add postfix, mailutils 2019-11-16 23:12:22 -05:00
staticsafe 7cc0101f0d change Unattended-Upgrade::Remove-Unused-Dependencies in 50unattended-upgrades 2019-10-29 12:06:14 -04:00
staticsafe 87e7452be6 Remove apt-maintenance.sh as it isn't needed anymore. 2019-10-29 10:39:54 -04:00
staticsafe da7c56eeb5 Update ubuntu/site.yml for unattended-upgrades task 2019-10-29 10:37:11 -04:00
staticsafe 18188cb971 Switch to using unattended-upgrades for apt-maintenance. 2019-10-29 10:35:24 -04:00
staticsafe 5703b44e75 update last task name in ubuntu/roles/apt-maintenance/tasks/main.yml 2019-10-29 10:18:09 -04:00
staticsafe c951fe766d We are disabling the apt-maintenance cron job for now. 2019-10-29 10:13:27 -04:00
staticsafe 4d30f0245e add vhost for irreverent.space to ubuntu/erlking.asininetech.net.yml 2019-10-23 23:35:15 -04:00
staticsafe 05283b00ef Copy pgbackrest logrotate config as well 2019-10-20 21:53:09 -04:00
staticsafe fbb5391eae Permissions for pgbackrest binary should be 755. 2019-10-20 21:28:45 -04:00
staticsafe 665d24a6cb fix typo in ubuntu/site.yml 2019-10-20 21:04:25 -04:00
staticsafe 74f35940f3 Add pgbackrest-install role 2019-10-20 21:02:36 -04:00
staticsafe ab33cd0200 Add yet another Bytespider range to block list to firewall rules. 2019-10-17 12:20:28 -04:00
staticsafe 7c7ff101e5 Missed a Bytespider crawler range 2019-10-17 12:03:15 -04:00
staticsafe f5d7c6dc39 Block aggressive Bytespider crawler across web servers 2019-10-17 11:58:42 -04:00
staticsafe afa8aa556c Add firewall rules to drop kiwifarms subnets. 2019-10-11 00:00:45 -04:00
staticsafe 7152d8d5f2 should be multiports 2019-10-04 09:44:14 -04:00
staticsafe d16ec626e1 add OUTPUT rules to allow DHCP on restricted nodes 2019-10-04 09:42:26 -04:00
staticsafe 90d4342ac2 cleanup some more 2019-09-29 22:54:53 -04:00
staticsafe 63490bb22b char.packet.cat is now removed, clean up 2019-09-29 22:54:02 -04:00
staticsafe 4100790fa9 Remove char.packet.cat. 2019-09-29 22:50:57 -04:00
staticsafe e419d3aefb add drop rule for 159.149.133.66 to deirdre.asininetech.net.rules.v4 2019-09-16 12:05:46 -04:00
staticsafe bd8a5c8435 Increase worker_connections across the board. 2019-09-03 14:20:40 -04:00
staticsafe e9ec840823 increase nginx worker_connections to 1024 in ubuntu/deirdre.asininetech.net.yml 2019-09-03 14:07:14 -04:00
staticsafe 0a3cae443f rename some files to new hostnames. 2019-09-03 14:03:12 -04:00
staticsafe 4c23562144 add handlers to firewall-ruleset-deploy 2019-08-25 21:08:39 -04:00
staticsafe 3002276209 clean up of firewall rulesets
remove byte counters, remove chains that didn't need to be there
2019-08-21 23:42:07 -04:00
staticsafe 8e471b7254 add COMMIT after end of filter 2019-08-21 23:23:58 -04:00
staticsafe df177dd04b clear out packet values in demonreach.asininetech.net.rules.v4 2019-08-21 23:21:17 -04:00
staticsafe 83fcf86900 POSTROUTING should be in nat chain 2019-08-21 23:20:41 -04:00
staticsafe e86367ed83 add firewall rulesets for demonreach.asininetech.net. 2019-08-21 23:18:16 -04:00
staticsafe ab7979ce01 add firewall rulesets for grevane.asininetech.net. 2019-08-21 22:46:53 -04:00
staticsafe 135e9bd008 add firewall rulesets for erlking.asininetech.net. 2019-08-21 22:37:20 -04:00
staticsafe d411bc74dd add firewall rulesets for deirdre.asininetech.net. 2019-08-21 22:26:34 -04:00
staticsafe ee1e6fb76f add firewall rulesets for catsith.asininetech.net 2019-08-21 22:23:10 -04:00
staticsafe 8b77463939 turn off backups in firewall-ruleset-deploy/tasks/main.yml 2019-08-21 22:15:34 -04:00
staticsafe 985895c082 add firewall rulesets for waldo.asininetech.net. 2019-08-21 22:12:42 -04:00
staticsafe df3044c9f3 fix another error in gard.asininetech.net.rules.v6 2019-08-21 22:07:24 -04:00
staticsafe ecda411031 fix syntax error in gard.asininetech.net.rules.v6 2019-08-21 22:02:55 -04:00
staticsafe 70fb7c8212 maybe fully enclosed? 2019-08-21 22:00:48 -04:00
staticsafe 62530669c9 double quotes maybe? 2019-08-21 21:58:10 -04:00
staticsafe 89e35f402b add quotes around ansible_fqdn 2019-08-21 21:56:43 -04:00
staticsafe 7705504cf7 add firewall-ruleset-deploy to site.yml 2019-08-21 21:53:38 -04:00
staticsafe f1623be2e9 add firewall-ruleset-deploy playbook and gard's ruleset 2019-08-21 21:52:12 -04:00
staticsafe de780e0254 make sure iptables-persistent and netfilter-persistent is installed via common playbook 2019-08-21 18:45:56 -04:00
staticsafe a4b94b8ded add char.packet.cat conf 2019-07-27 11:57:05 -04:00
staticsafe c074a6bb0a add wiki.tenforward.social configs 2019-07-27 11:28:12 -04:00
staticsafe b7f3e9b2c2 removed erroneous block 2019-07-26 23:42:18 -04:00
staticsafe 74d3a686a5 add as393949.net vhost 2019-07-26 23:39:26 -04:00
staticsafe 7b42ceeca2 Remove warn=false in ubuntu/roles/common/tasks/main.yml 2019-07-21 20:43:43 -04:00
staticsafe 8d6bcde072 set warn=False for non-module apt task 2019-07-21 20:43:06 -04:00
staticsafe 32190262bc stop using with_items for apt in ubuntu/roles/common/tasks/main.yml 2019-07-21 20:34:13 -04:00
staticsafe 26d749a670 make sure PATH is set in ubuntu/roles/apt-maintenance/files/apt-maintenance.sh 2019-07-14 08:18:44 -04:00
staticsafe c82b4f2ccf remove MAILTO from apt-maintenance.sh 2019-07-12 23:42:20 -04:00
staticsafe c1e39c3f73 remove insertafter from ubuntu/roles/apt-maintenance/tasks/main.yml 2019-07-12 23:40:21 -04:00
staticsafe e7865d16c9 Add MAILTO variable addition into apt-maintenance/tasks/main.yml 2019-07-12 23:39:01 -04:00
staticsafe 616b5c1a83 make sure /root/scripts exists 2019-07-12 23:13:48 -04:00
staticsafe 1ca719c43f Copy script to dif location and add cronjob to root 2019-07-12 23:11:51 -04:00
staticsafe e698c4a809 Change permission of script to 755 2019-07-12 11:30:46 -04:00
staticsafe cd6efefd3f turn off backups for apt-maintenance/tasks/main.yml 2019-07-10 10:15:54 -04:00
staticsafe d0452a3e95 modify apt-maintenance.sh to add a mailto addr 2019-07-10 10:13:44 -04:00
staticsafe 4761744224 add apt-maintenance defs in ubuntu/site.yml 2019-07-07 20:04:04 -04:00
staticsafe acdb50458f Add apt-maintenance role 2019-07-07 20:00:42 -04:00
Sadiq Saif 785924e5ba
Update dev-glitch nginx to use TLSv1.3 2019-07-03 21:11:04 -04:00
Sadiq Saif 178a01cba2
Delete mercy.sickstack.com.yml
server terminated
2019-07-03 21:07:42 -04:00
Sadiq Saif 06ddcd9929
Delete mei.sickstack.com.yml
server terminated
2019-07-03 21:07:06 -04:00
Sadiq Saif ebfc8eff5c
Delete ivy.asininetech.com.yml
server terminated
2019-07-03 21:06:48 -04:00
Sadiq Saif b1e6c25fbf
Delete aphrodite.selfie.town config
Server terminated
2019-07-03 21:06:26 -04:00
Sadiq Saif 6241b2e321
Update tfmain nginx to use TLSv1.3 2019-07-03 21:06:03 -04:00
Sadiq Saif 075c8cd1ec
Update mastodon.zombocloud.com's nginx config to use TLSv1.3 2019-07-03 21:05:08 -04:00
Sadiq Saif b21cf6176c
Update webserver1 nginx config to use TLSv1.3 2019-07-03 21:04:35 -04:00
staticsafe c76ff142ab Rename the yml file for ivy 2019-03-23 19:42:51 -04:00
staticsafe ad9cc8af24 remove invalid variables in grafana 2019-03-23 16:42:01 -04:00
staticsafe 8c4b104f35 Change grafana listen to localhost 2019-03-23 16:37:13 -04:00
staticsafe e4563e9c30 add webserver config to ubuntu/prometheus.sickstack.com.yml 2019-03-23 15:45:38 -04:00
staticsafe 07c937e944 remove include from ubuntu/prometheus.sickstack.com.yml 2019-03-23 13:13:58 -04:00
staticsafe a6b4f8fafc include should in vars? 2019-03-23 12:59:59 -04:00
staticsafe be0c6f6c32 include secrets.yml for ubuntu/prometheus.sickstack.com.yml 2019-03-23 12:54:10 -04:00
staticsafe 7992363f14 add grafana to ubuntu/prometheus.sickstack.com.yml 2019-03-23 12:48:55 -04:00
staticsafe 49f6e93d96 add netdata.internal.sickstack.com to server_name
in ubuntu/mei.sickstack.com.yml
2019-03-23 11:51:59 -04:00
staticsafe e94bc70c6d eh? 2019-03-23 11:28:49 -04:00
staticsafe d63b44bc6f okay maybe this one? 2019-03-23 11:22:49 -04:00
staticsafe 9aae6acae5 okay I think this is the right format? 2019-03-23 11:20:55 -04:00
staticsafe 19250e5b21 let's try a different format 2019-03-23 11:17:52 -04:00
staticsafe 89c3f8d997 complete prometheus.sickstack.com.yml 2019-03-23 11:16:03 -04:00
staticsafe faa099e917 add ubuntu/prometheus.sickstack.com.yml 2019-03-23 11:07:06 -04:00
staticsafe 6540d059d7 turn off access logging in netdata 2019-03-19 13:05:44 -04:00
staticsafe f4b8e96652 modify netdata.conf to make sure clients only bind on localhost 2019-03-19 11:58:00 -04:00
staticsafe fa7675a549 make sure netdata service is not masked 2019-03-19 11:53:07 -04:00
staticsafe c2becab877 change netdata service to be restarted just in case its already installed 2019-03-19 11:40:58 -04:00
staticsafe f391e7f3a0 specify bash in netdata-client/tasks/main.yml 2019-03-19 11:37:30 -04:00
staticsafe 346e781f92 Move site.yml up a dir 2019-03-19 11:35:43 -04:00
staticsafe 2232ff8732 add netdata-client/site.yml 2019-03-19 11:32:15 -04:00
staticsafe 83bb915308 Add netdata-client role 2019-03-19 11:30:52 -04:00
staticsafe 2f54131368 Add ubuntu/mei.sickstack.com.yml 2019-03-19 11:11:14 -04:00
staticsafe e0f2bedf62 Use variable method for listing package installs in ubuntu/roles/icinga-client/tasks/main.yml 2019-02-03 13:35:19 -05:00
staticsafe 7bfa5fa8d1 make icinga2 systemd service modifications to centos version 2019-02-03 13:23:25 -05:00
staticsafe 279b4e10f0 Modify icinga-client role to add some systemd options 2019-02-03 13:11:39 -05:00
staticsafe aa14f2f64f Merge branch 'nextgen' of github.com:staticsafe/ansible-playbooks into nextgen 2019-01-19 18:31:01 -05:00
staticsafe aff6f703ed Add ubuntu/dev.glitch.social.yml 2019-01-19 18:30:53 -05:00
Sadiq Saif 94ae12002a
Update package removal list
add snapd and lxcfs to removal list
2019-01-15 21:22:27 -05:00
staticsafe 1f81721ab6 Remove letsencrypt from packages list. 2019-01-12 15:13:10 -05:00
staticsafe 040efa346f Add ubuntu/aphrodite.selfie.town.yml 2018-12-29 11:43:19 -05:00
staticsafe d6dd8b95c3 Add ubuntu/aphrodite.selfie.town.yml and remove selfie.town config from mercy.sickstack.com.yml 2018-12-29 11:42:36 -05:00
staticsafe f27f5135a4 common configuration should include turning off MOTD 2018-09-25 21:02:34 -04:00
staticsafe df28d10f01 hosts group should be myubuntunodes 2018-09-25 20:40:33 -04:00
staticsafe 482bbc8cf1 add turn-off-motd-news role 2018-09-25 20:38:53 -04:00
Sadiq Saif eb4ca4c8fe
Update PHP upstream to 7.2 2018-08-26 12:04:52 -04:00
staticsafe 3ff719370f Remove pixelfed upstream from nginx config 2018-08-25 22:29:30 -04:00
staticsafe 05f8b1a1a0 client_max_body_size 0 for selfie.town 2018-08-25 21:47:01 -04:00
staticsafe f5a495818f Switch back to default pool for pixelfed 2018-08-25 21:38:28 -04:00
staticsafe c011cc7485 Use separate PHP upstream for pixelfed 2018-08-25 21:29:48 -04:00
staticsafe a887f9615b Add selfie.town vhost to ubuntu/mercy.sickstack.com.yml 2018-08-25 20:57:09 -04:00
staticsafe 52f3df89ff Install nagios-plugins-all instead in centos/roles/icinga-client/tasks/main.yml 2018-07-07 14:22:16 -04:00
staticsafe 9ff60b1062 Fix indentations in centos/roles/icinga-client/tasks/main.yml 2018-07-07 14:11:58 -04:00
staticsafe 3180339833 Add icinga2 check packages to centos/roles/icinga-client/tasks/main.yml 2018-07-07 14:10:02 -04:00
staticsafe baf1c53f13 we need to actually install the icinga2 package 2018-07-07 13:54:44 -04:00
staticsafe a900a1cba0 Add CentOS folder and centos/roles/icinga-client/tasks/main.yml 2018-07-07 13:48:57 -04:00
staticsafe c1ebd44be3 Add HTTP to HTTPS redirect for wiki.sickstack.com 2018-06-10 15:53:16 -04:00
staticsafe 62f285f786 Add wiki.sickstack.com vhost 2018-06-10 15:51:31 -04:00
staticsafe 40e6a57afa Add GD to the PHP extensions list 2018-06-10 15:40:42 -04:00
staticsafe 7d06e18935 add PHP upstream config to ubuntu/mercy.sickstack.com.yml 2018-06-10 13:16:32 -04:00
staticsafe f5d3828f3c Add some Ubuntu version conditionals to ubuntu/roles/php/tasks/main.yml 2018-06-10 13:11:12 -04:00
staticsafe 4d992b8fc7 Add a LEMP stack combo to ubuntu/site.yml 2018-06-10 13:04:44 -04:00
staticsafe e0e30edeb0 Add MySQL role to ubuntu/site.yml 2018-06-10 12:47:46 -04:00
staticsafe 02e8237c42 Add MySQL server role 2018-06-10 12:41:02 -04:00
staticsafe 4874d5fcfc proxy_pass for gitea is using localhost now 2018-06-05 10:14:00 -04:00
staticsafe 53d757c46a Change gitea proxy_pass to use HTTPS 2018-06-05 09:47:20 -04:00
staticsafe 180f53774f Remove cryptpad.sickstack.com vhost 2018-06-04 22:53:20 -04:00
staticsafe eac8443003 Add cryptpad.sickstack.com vhost 2018-06-04 22:39:32 -04:00
staticsafe f5683efd4b Make the icinga role Ubuntu version agnostic 2018-06-03 18:15:46 -04:00
staticsafe 270497f949 should say git.sickstack.com for nginx config filenames 2018-06-03 18:09:26 -04:00
staticsafe dad8e5a6a4 Add ubuntu/mercy.sickstack.com.yml 2018-06-03 18:08:41 -04:00
Sadiq Saif 181d95e78e
add client_max_body_size 2018-04-13 15:36:22 -04:00
Sadiq Saif c7c6806689
Add client_max_body_size 2018-04-13 15:36:01 -04:00
staticsafe 9eb9954845 Add ubuntu/tfmain.tenforward.social.yml 2018-04-08 19:07:09 -04:00
staticsafe b99eea2a6c Forgot to remove some semi-colons in ubuntu/mastodon.zombocloud.com.yml 2018-04-08 18:56:10 -04:00
staticsafe 1128317729 Add ssl config to ubuntu/mastodon.zombocloud.com.yml 2018-04-08 18:55:33 -04:00
staticsafe 11f7b2f07e another quotes situation 2018-04-08 18:48:06 -04:00
staticsafe 2d229a436d god I hate this quote situation 2018-04-08 18:45:26 -04:00
staticsafe 6c65f62aa3 remove quotes around referrer-policy and add HSTS back in 2018-04-08 18:42:56 -04:00
staticsafe 829e337ef1 Remove HSTS header add 2018-04-08 18:40:39 -04:00
staticsafe 5828fd6d89 can we escape the semi-colons maybe? 2018-04-08 18:39:15 -04:00
staticsafe 539b844d5a another try 2018-04-08 18:36:39 -04:00
staticsafe 99d70a22af this quote situation is getting out of hand 2018-04-08 18:33:34 -04:00
staticsafe b1e0d39af1 add some quotes around add_header in ubuntu/mastodon.zombocloud.com.yml 2018-04-08 18:30:58 -04:00
staticsafe d8ebe62efd Remove some semi-colons from ubuntu/mastodon.zombocloud.com.yml 2018-04-08 18:28:02 -04:00
staticsafe 8eb16489c8 Remove comment from ubuntu/mastodon.zombocloud.com.yml 2018-04-08 18:26:26 -04:00
staticsafe ff0eee420b add ubuntu/mastodon.zombocloud.com.yml 2018-04-08 18:24:13 -04:00
staticsafe a85dfac3fc Move webserver1's nginx config to its own YAML file 2018-04-08 14:38:42 -04:00
staticsafe bf36cacc89 Remove LetsEncrypt role, it is no longer useful. 2018-04-08 14:35:06 -04:00
Sadiq Saif 2dd075b853
Check that chrony service is enabled instead of ntpd 2018-02-12 17:21:28 -05:00
Sadiq Saif 0aad55187b
Replace ntpd with chrony 2018-02-12 17:20:52 -05:00
staticsafe 3c428e0781 Replace 8.8.8.8 with [::1] in ubuntu/site.yml 2018-02-12 10:34:16 -05:00
staticsafe d0814a5657 Use wildcard v4 listeners in nginx 2018-02-06 11:42:11 -05:00
staticsafe 1874de7c22 nginx does not need to bind to a specific address
just bind to all addresses on the required ports
2018-01-14 20:28:16 -05:00
Sadiq Saif 6215dbcfc6
Remove netdata upstream 2017-12-17 23:58:00 -05:00
staticsafe 8174e2d60f Fix missing repo string in ubuntu/roles/icinga-client/tasks/main.yml 2017-11-27 14:26:24 -05:00
staticsafe 508e73ff39 Fix another typo in ubuntu/site.yml 2017-11-27 14:24:02 -05:00
staticsafe 26d4fa21f8 Fix small typo in ubuntu/site.yml 2017-11-27 14:21:49 -05:00
staticsafe 6a74202168 Add icinga-client role. 2017-11-27 14:20:22 -05:00
Sadiq Saif 084ee25fa9
Add some deny blocks to secure cache directories for tt-rss 2017-11-09 16:07:57 -05:00
Sadiq Saif 9bea7f7d08
Add vhosts for ttrss.sadiqsaif.com 2017-11-09 11:27:19 -05:00
Sadiq Saif 4dafe9ee93
Remove netdata vhosts
we are no longer using netdata
2017-11-09 11:10:36 -05:00
Sadiq Saif 760d2fe9df
turns out fastcgi_cache_path didn't need quoting 2017-10-29 14:40:01 -04:00
Sadiq Saif 662051312c
remove inactive parameter from fastcgi_cache_path 2017-10-29 14:32:16 -04:00
Sadiq Saif 310a8373ae
Add fcgicache nginx config block for global use 2017-10-29 14:27:37 -04:00
Sadiq Saif 8a8426e5d4 Remove location block from netdata http 2017-09-16 13:06:13 -04:00
Sadiq Saif d52252e0d9 Remove root variable from http netdata 2017-09-16 13:03:51 -04:00
Sadiq Saif becd78336d Update SSL certificates with new acme.sh locations 2017-09-16 13:00:53 -04:00
Sadiq Saif d2aed3cfae remove ACME location block and add it to http block 2017-09-16 12:21:31 -04:00
Sadiq Saif 1c1002be6e Add ACME location in netdat vhost 2017-09-16 12:17:34 -04:00
Sadiq Saif 62709d3731 Add some custom APT periodic task configuration
Ensure that the periodic APT cron task clears out old kernels and does unattended security upgrades
2017-08-06 16:24:25 -04:00
Sadiq Saif 7969f8908d Add 10periodic file, APT Periodic task config 2017-08-06 16:21:10 -04:00
Sadiq Saif 3f9ab5a693 Add unattended-upgrades to package list
subversion was removed as we don't need it anymore
2017-08-06 16:03:17 -04:00
Sadiq Saif b85519e0f1 Turn off access log for netdata vhost 2017-07-18 14:52:13 -04:00
Sadiq Saif 5d11eaaf47 fix server_name in netdata https vhost 2017-07-17 23:08:11 -04:00
Sadiq Saif 861b13471b only unsetup hosts need the initial package install 2017-07-17 23:02:32 -04:00
Sadiq Saif 2d6a0a42b3 update netdata proxy pass and add backend 2017-07-17 23:01:33 -04:00
Sadiq Saif 055458219e disable letsencrypt role for now
its broken with webroot method
2017-07-17 22:57:09 -04:00
Sadiq Saif 7bb3478ea7 add netdata LE and change to webroot use 2017-07-17 22:55:15 -04:00
Sadiq Saif 1ca6c8643c add site configurations for netdata.asininetech.net 2017-07-17 22:52:57 -04:00
Sadiq Saif fb6039aebf Update letsencrypt-renew
changes for webroot renewal
2017-07-16 19:43:34 -04:00
Sadiq Saif f7b40f6e28 Add "gzip_types" parameter for nginx gzip config 2017-07-07 09:40:20 -04:00
staticsafe f428fadf2b Typo in error_page configuration variable. 2017-06-28 13:02:53 -04:00
staticsafe 3f15c339ec Add custom 404 page for entropynet.net. 2017-06-28 12:58:34 -04:00
staticsafe e60c082e78 Add SSL session settings to nginx config. 2017-05-08 23:58:22 -04:00
staticsafe bc0645c412 We are moving to Mozilla's recommended settings for 'Modern' browsers. 2017-05-08 22:36:52 -04:00
staticsafe c80fc35887 We redirect all HTTP requests to their HTTPS equivalents. 2017-05-08 21:12:15 -04:00
staticsafe de8c801cb3 301 staticsafe.ca to sadiqsaif.com. 2017-03-18 18:31:37 +00:00
staticsafe 8130b10d7b lets try that port 80 thing again 2017-03-18 02:06:53 +00:00
staticsafe 9f3efeb9a2 Revert "Add port 80 listens for sadiqsaif.*"
This reverts commit bb2be78f67.
2017-03-18 02:00:25 +00:00
staticsafe bb2be78f67 Add port 80 listens for sadiqsaif.* 2017-03-18 01:57:01 +00:00
staticsafe feaa58b5ca Add a 301 return for sadiqsaif.ca. 2017-03-17 02:45:44 +00:00
staticsafe 1b8bb49e03 Add nginx config for sadiqsaif.com 2017-03-17 02:39:11 +00:00
staticsafe 2da2ba0312 add sadiqsaif.com to LE domain list. 2017-03-17 02:34:27 +00:00
staticsafe ef896a0f2f letsencrypt renew script had invalid arguments 2017-01-14 14:41:07 +00:00
staticsafe 0897a454ae PHP role is now installing required PHP libs.
Close issue #2
2017-01-14 14:17:50 +00:00
staticsafe f7bdbcd297 add some location directives for dokuwiki 2017-01-14 04:08:03 +00:00
staticsafe 0d09eae129 Add nginx service conditional to LetsEncrypt role.
Resolve issue #1
2017-01-14 03:51:43 +00:00
staticsafe 6b87ad2c87 add ssl_dhparam in nginx config options 2017-01-14 01:59:08 +00:00
staticsafe 7bc7afbb24 Fix error in TSOB's nginx config block 2017-01-14 01:12:37 +00:00
staticsafe 6c077a8f0a Remove rewrite statements now due to some parsing issues 2017-01-14 01:04:53 +00:00
staticsafe 822924ea95 Add all nginx sites to site.yml. 2017-01-14 00:17:51 +00:00
staticsafe 03276432f4 Add LetsEncrypt roles for webserver use. 2017-01-13 22:21:21 +00:00
staticsafe 98d8783038 Remove gzip_types directive 2017-01-13 03:19:08 +00:00
staticsafe 34bb61e026 Oops, wrong nginx variable name. 2017-01-13 03:15:16 +00:00
staticsafe 860dfd2a44 increase nginx's server_names_has_bucket_size to 128 2017-01-13 03:12:32 +00:00
staticsafe 14af637538 Upstream configuration probably doesn't need quotes 2017-01-13 03:05:20 +00:00
staticsafe 25ef8aee95 Add webserver role using jdauphant.nginx 2017-01-13 03:00:01 +00:00
staticsafe baf710fc32 PHP-FPM daemon should be in a started state. 2017-01-13 02:49:33 +00:00
staticsafe eb644482c3 Fix YAML syntax error in roles/php/tasks/main.yml 2017-01-13 02:45:22 +00:00
staticsafe 2ed429d06a Add new basic PHP role. 2017-01-13 02:43:11 +00:00
staticsafe f73a0972f5 Remove unbound from boot check list. 2017-01-12 20:27:22 +00:00
staticsafe 7bfc6267e1 We are no longer modifying host resolvers.
VPS provider defaults are sufficient.
2017-01-12 20:24:45 +00:00
staticsafe 05b4122862 Remove appservers-php and webservers-nginx roles.
We are going to be using Galaxy roles going forward.
2017-01-12 20:20:40 +00:00
staticsafe 01dd5a9491 Update cloudflare.conf with latest set of Cloudflare IPs from their docs. 2016-09-06 19:42:15 -04:00
staticsafe d0e17c7351 Remove uwsgi role as I don't really need it anymore. 2016-09-06 19:32:11 -04:00
staticsafe ee8dba40ee Fix indentation from last commit. 2016-09-06 19:25:04 -04:00
staticsafe 4f65a95591 Add letsencrypt to required packages list. 2016-09-06 19:23:38 -04:00
staticsafe 4690ace036 Use "127.0.0.1" instead of "::1" to prevent odd behaviour in mtr. 2016-09-06 19:18:52 -04:00
staticsafe 4661cf606d Remove Debian folder, modify README.md for nextgen branch. 2016-09-06 19:17:31 -04:00
92 changed files with 1414 additions and 1647 deletions

View File

@ -1,4 +1,5 @@
ansible-playbooks
=================
Repo for my Ansible playbooks
Repo for my Ansible playbooks.
nextgen branch is for Ubuntu 18.04 systems only as that is what I am standardizing on.

View File

@ -0,0 +1,2 @@
[Service]
Restart=on-failure

View File

@ -0,0 +1,35 @@
---
# This role installs Icinga 2 and the plugins required on a Icinga client nodes
- name: Make sure EPEL repository is enabled
yum:
name: epel-release
state: latest
- name: Add Icinga2 repository key
rpm_key:
state: present
key: https://packages.icinga.com/icinga.key
- name: Install Icinga2 repository
yum:
name: https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm
state: latest
- name: Install Icinga2 packages
yum:
name: "{{ packages }}"
vars:
packages:
- icinga2
- nagios-plugins-all
- name: Ensure icinga2 systemd folder exists
file:
path: /etc/systemd/system/icinga2.service.d/
state: directory
- name: Copy custom icinga2 systemd service file modifications
copy:
src: restart.conf
dest: /etc/systemd/system/icinga2.service.d/restart.conf
- name: Ensure that icinga2 systemd service is enabled
systemd:
name: icinga2
enabled: yes
daemon_reload: yes

6
centos/site.yml Normal file
View File

@ -0,0 +1,6 @@
- name: install Icinga 2 for client usage
hosts: icinga-clients
user: root
roles:
- icinga-client

View File

@ -1,392 +0,0 @@
; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = www-data
group = www-data
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
; Set listen(2) backlog. A value of '-1' means unlimited.
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
;listen.backlog = -1
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0666
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0666
; List of ipv4 addresses of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
listen.allowed_clients = 127.0.0.1
; Specify the nice(2) priority to apply to the pool processes (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool processes will inherit the master process priority
; unless it specified otherwise
; Default Value: no set
; priority = -19
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; ondemand - no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children - the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = dynamic
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 5
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 2
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 1
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
; pool - the name of the pool;
; process manager - static, dynamic or ondemand;
; start time - the date and time FPM has started;
; start since - number of seconds since FPM has started;
; accepted conn - the number of request accepted by the pool;
; listen queue - the number of request in the queue of pending
; connections (see backlog in listen(2));
; max listen queue - the maximum number of requests in the queue
; of pending connections since FPM has started;
; listen queue len - the size of the socket queue of pending connections;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes;
; max active processes - the maximum number of active processes since FPM
; has started;
; max children reached - number of times, the process limit has been reached,
; when pm tries to start more children (works only for
; pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
; pool: www
; process manager: static
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 62636
; accepted conn: 190460
; listen queue: 0
; max listen queue: 1
; listen queue len: 42
; idle processes: 4
; active processes: 11
; total processes: 15
; max active processes: 12
; max children reached: 0
;
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
; http://www.foo.bar/status?xml&full
; The Full status returns for each process:
; pid - the PID of the process;
; state - the state of the process (Idle, Running, ...);
; start time - the date and time the process has started;
; start since - the number of seconds since the process has started;
; requests - the number of requests the process has served;
; request duration - the duration in µs of the requests;
; request method - the request method (GET, POST, ...);
; request URI - the request URI with the query string;
; content length - the content length of the request (only with POST);
; user - the user (PHP_AUTH_USER) (or '-' if not set);
; script - the main script called (or '-' if not set);
; last request cpu - the %cpu the last request consumed
; it's always 0 if the process is not in Idle state
; because CPU calculation is done when the request
; processing has terminated;
; last request memory - the max amount of memory the last request consumed
; it's always 0 if the process is not in Idle state
; because memory calculation is done when the request
; processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
; ************************
; pid: 31330
; state: Running
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 63087
; requests: 12808
; request duration: 1250261
; request method: GET
; request URI: /test_mem.php?N=10000
; content length: 0
; user: -
; script: /home/fat/web/docs/php/test_mem.php
; last request cpu: 0.00
; last request memory: 0
;
; Note: There is a real-time FPM status monitoring sample web page available
; It's available in: ${prefix}/share/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping
; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong
; The access log file
; Default: not set
;access.log = /var/log/$pool.access.log
; The access log format.
; The following syntax is allowed
; %%: the '%' character
; %C: %CPU used by the request
; it can accept the following format:
; - %{user}C for user CPU only
; - %{system}C for system CPU only
; - %{total}C for user + system CPU (default)
; %d: time taken to serve the request
; it can accept the following format:
; - %{seconds}d (default)
; - %{miliseconds}d
; - %{mili}d
; - %{microseconds}d
; - %{micro}d
; %e: an environment variable (same as $_ENV or $_SERVER)
; it must be associated with embraces to specify the name of the env
; variable. Some exemples:
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
; %f: script filename
; %l: content-length of the request (for POST request only)
; %m: request method
; %M: peak of memory allocated by PHP
; it can accept the following format:
; - %{bytes}M (default)
; - %{kilobytes}M
; - %{kilo}M
; - %{megabytes}M
; - %{mega}M
; %n: pool name
; %o: ouput header
; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o
; - %{X-Powered-By}o
; - %{Transfert-Encoding}o
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
; %s: status (response code)
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /var/log/$pool.log.slow
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_slowlog_timeout = 0
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =
; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
chdir = /
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; exectute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr)
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

View File

@ -1,3 +0,0 @@
---
- name: start php5-fpm
service: name=php5-fpm state=started

View File

@ -1,9 +0,0 @@
---
- name: Install php5-fpm
apt: pkg=php5-fpm state=latest
- name: Stop the php5-fpm daemon for now and ensure it starts on boot
service: name=php5-fpm state=stopped enabled=yes
- name: Copy over the php5-fpm www pool config
copy: src=www.conf dest=/etc/php5/fpm/pool.d/www.conf backup=yes
notify:
- start php5-fpm

View File

@ -1,72 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: uwsgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the uwsgi app server
# Description: starts uwsgi app server using start-stop-daemon
### END INIT INFO
PATH=/opt/uwsgi:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/uwsgi
OWNER=uwsgi
NAME=uwsgi
DESC=uwsgi
test -x $DAEMON || exit 0
# Include uwsgi defaults if available
if [ -f /etc/default/uwsgi ] ; then
. /etc/default/uwsgi
fi
set -e
#DAEMON_OPTS="-s 127.0.0.1:9001 -M 4 -t 30 -A 4 -p 4 -d /var/log/uwsgi.log --pythonpath $PYTHONPATH --module $MODULE"
DAEMON_OPTS="--emperor /etc/uwsgi/apps -d /var/log/uwsgi.log"
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --chuid $OWNER:$OWNER --user $OWNER \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --signal 3 --user $OWNER --quiet --retry 2 --stop \
--exec $DAEMON
echo "$NAME."
;;
reload)
killall -1 $DAEMON
;;
force-reload)
killall -15 $DAEMON
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --signal 3 --user $OWNER --quiet --retry 2 --stop \
--exec $DAEMON
sleep 1
start-stop-daemon --user $OWNER --start --quiet --chuid $OWNER:$OWNER \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
status)
killall -10 $DAEMON
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac
exit 0

View File

@ -1,9 +0,0 @@
"/var/log/uwsgi/*.log" "/var/log/uwsgi/*/*.log" {
copytruncate
daily
rotate 5
compress
delaycompress
missingok
notifempty
}

View File

@ -1,3 +0,0 @@
---
- name: start uwsgi
service: name=uwsgi state=started

View File

@ -1,24 +0,0 @@
---
- name: Install virtualenv
apt: name=python-virtualenv state=latest
- name: Install uwsgi from PyPI
pip: name=uWSGI
- name: Add uwsgi group
group: name=uwsgi state=present
- name: Add uwsgi user
user: name=uwsgi shell=/sbin/nologin createhome=no group=uwsgi password=$6$Qu5GfWUlAPXh$Ie8Fd9Vzl.PpaFciUbRCI4sIryI6i0rDE29Vf86/WYHgPSWG7x9IIkVU.tG1Mtfq2OM9IeH2IuvOKCcnErMgC1
- name: Copy over the uwsgi init script and logrotate config
copy: src={{ item.name }} dest={{ item.dir }} backup=yes
with_items:
- { name: 'uwsgi.init', dir: '/etc/init.d/uwsgi' }
- { name: 'uwsgi.logrotate', dir: '/etc/logrotate.d/uwsgi' }
- name: Make sure the init script is executable
file: path=/etc/init.d/uwsgi owner=root group=root mode=0755
- name: Make configuration directory
file: path=/etc/uwsgi/apps state=directory
- name: Make log file with correct permissions
file: path=/var/log/uwsgi.log owner=uwsgi group=uwsgi mode=0750 state=touch
- name: Make sure uwsgi starts on boot
service: name=uwsgi enabled=yes
notify:
- start uwsgi

View File

@ -1,2 +0,0 @@
nameserver ::1
nameserver 8.8.8.8

View File

@ -1,6 +0,0 @@
---
- name: restart rsyslog
service: name=rsyslog state=restarted
- name: restart cron
service: name=cron state=restarted

View File

@ -1,59 +0,0 @@
---
# This playbook contains common plays that will be run all nodes.
- name: Install python-apt, aptitude, and debconf-utils
shell: apt-get update && apt-get -y install python-apt aptitude debconf-utils
- name: Do any package upgrades
apt: upgrade=dist
- name: Set default locale to en_US.UTF-8
debconf: name=locales question='locales/default_environment_locale' value=en_US.UTF-8 vtype='select'
- name: Generate locales
debconf: name=locales question='locales/locales_to_be_generated' value='en_US.UTF-8 UTF-8' vtype='multiselect'
- name: Set timezone area
debconf: name=tzdata question='tzdata/Areas' value='Etc' vtype='select'
- name: Set timezone
debconf: name=tzdata question='tzdata/Zones/Etc' value='UTC' vtype='select'
notify:
- restart rsyslog
- restart cron
- name: Install required packages
apt: pkg={{ item }} state=latest
with_items:
- most
- zsh
- vim
- vim-scripts
- git
- subversion
- tmux
- multitail
- mtr-tiny
- curl
- dnsutils
- sudo
- gnupg
- traceroute
- htop
- haveged
- python-pip
- unbound
- duplicity
- python-boto
- build-essential
- vnstat
- python-dev
- ntp
- name: Remove exim4 and consolekit
apt: pkg={{ item }} state=absent
with_items:
- exim4-daemon-light
- consolekit
- name: Ensure haveged, unbound, ntp, and vnstat are started on boot
service: name={{ item }} enabled=yes
with_items:
- haveged
- unbound
- vnstat
- ntp
- name: use local unbound instance for DNS and Google Public DNS as backup
copy: src=resolv.conf dest=/etc/resolv.conf

View File

@ -1,12 +0,0 @@
# This file is a nginx catch-all vhost, probably put here in an automated
# fashion.
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name _; # This is just an invalid value which will never trigger on a real hostname.
access_log /var/log/nginx/default.access.log;
index index.html;
server_name_in_redirect off;
root /srv/www/catch-all;
}

View File

@ -1,11 +0,0 @@
# Cloudflare
set_real_ip_from 204.93.240.0/24;
set_real_ip_from 204.93.177.0/24;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
real_ip_header CF-Connecting-IP;

View File

@ -1,63 +0,0 @@
user www-data;
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 70;
types_hash_max_size 2048;
server_tokens off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
# Upstream to abstract backend connection(s) for PHP.
upstream php {
# server unix:/tmp/php-fpm.sock;
server 127.0.0.1:9000;
}
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
}

View File

@ -1,14 +0,0 @@
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
fastcgi_index index.php;
}

View File

@ -1,23 +0,0 @@
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Directives to send expires headers and turn off 404 error logging.
location ~* \.(js|css|png|jpg|jpeg|gif|ico|html)$ {
expires 24h;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}

View File

@ -1,39 +0,0 @@
# WordPress single blog rules.
# Designed to be included in any server {} block.
# This order might seem weird - this is attempted to match last if rules below fail.
# http://wiki.nginx.org/HttpCoreModule
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# Directives to send expires headers and turn off 404 error logging.
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
}
# Uncomment one of the lines below for the appropriate caching plugin (if used).
#include global/wordpress-supercache.conf;
#include global/wordpress-w3cache.conf;
# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ \.php$ {
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
# Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
# Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine. And then cross your fingers that you won't get hacked.
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_intercept_errors on;
fastcgi_pass php;
}

View File

@ -1,34 +0,0 @@
# Global restrictions configuration file.
# Designed to be included in any server {} block.</p>
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Deny access to any files with a .php extension in the uploads directory
location ~* ^/wp-content/uploads/.*.php$ {
deny all;
access_log off;
log_not_found off;
}
# Deny access to any files with a .php extension in the uploads directory for multisite
location ~* /files/(.*).php$ {
deny all;
access_log off;
log_not_found off;
}

View File

@ -1,3 +0,0 @@
---
- name: start nginx
service: name=nginx state=started

View File

@ -1,35 +0,0 @@
---
- name: Add nginx upstream repo key
apt_key: url=http://nginx.org/keys/nginx_signing.key state=present
- name: Add nginx upstream repository
apt_repository: repo='deb http://nginx.org/packages/debian/ wheezy nginx' state=present update_cache=yes
- name: Install nginx package
apt: pkg=nginx state=latest
- name: Stop nginx for now and also make it start on boot
service: name=nginx state=stopped enabled=yes
- name: Make nginx related dirs
file: path={{ item }} state=directory
with_items:
- /etc/nginx/global
- /etc/nginx/sites-available
- /etc/nginx/sites-enabled
- /srv/www/catch-all
- name: Clean out default vhost file in enabled and available dirs
file: path={{ item }} state=absent
with_items:
- /etc/nginx/sites-enabled/default
- /etc/nginx/sites-available/default
- name: Copy over all nginx configuration files
copy: src={{ item.name }} dest={{ item.dir }}
with_items:
- { name: 'nginx.conf', dir: '/etc/nginx/nginx.conf' }
- { name: '0-catch-all', dir: '/etc/nginx/sites-available/0-catch-all' }
- { name: 'cloudflare.conf', dir: '/etc/nginx/global/cloudflare.conf' }
- { name: 'php-generic.conf', dir: '/etc/nginx/global/php-generic.conf' }
- { name: 'security-generic.conf', dir: '/etc/nginx/global/security-generic.conf' }
- { name: 'wordpress-generic.conf', dir: '/etc/nginx/global/wordpress-generic.conf' }
- { name: 'wordpress-security.conf', dir: '/etc/nginx/global/wordpress-security.conf' }
- name: Symlink the default catch-all vhost
file: src=/etc/nginx/sites-available/0-catch-all dest=/etc/nginx/sites-enabled/0-catch-all state=link
notify:
- start nginx

29
debian/site.yml vendored
View File

@ -1,29 +0,0 @@
---
- name: apply common configuration to all nodes
hosts: all
user: root
roles:
- common
- name: apply configuration to web servers (nginx)
hosts: webservers-nginx
user: root
roles:
- webservers-nginx
- name: apply configuration to PHP app servers
hosts: appservers-php
user: root
roles:
- appservers-php
- name: apply configuration to uwsgi app servers
hosts: appservers-uwsgi
user: root
roles:
- appservers-uwsgi

View File

@ -0,0 +1,7 @@
---
- name: Disable rpcbind service
hosts: cloud
user: root
roles:
- disable-rpcbind

View File

@ -0,0 +1,120 @@
---
- hosts: dresden.silvestris.systems
roles:
- role: jdauphant.nginx
nginx_user: "www-data"
nginx_events_params:
- worker_connections 1024
nginx_http_params:
- sendfile "on"
- server_names_hash_bucket_size 512
nginx_sites:
donate.tenforward.social.http:
- listen *:80
- listen [::]:80
- server_name donate.tenforward.social
- root "/srv/www/donate.tenforward.social/"
- location /.well-known/acme-challenge/ {
allow all;
}
- return 301 "https://$host$request_uri"
donate.tenforward.social.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name donate.tenforward.social
- root "/srv/www/donate.tenforward.social"
- index index.html
- access_log "/var/log/nginx/donate.tenforward.social.access.log"
- error_log "/var/log/nginx/donate.tenforward.social.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/donate.tenforward.social.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/donate.tenforward.social.pem"
- include snippets/sslstapling_hsts.conf
wiki.tenforward.social.http:
- listen *:80
- listen [::]:80
- server_name wiki.tenforward.social
- return 301 "https://$host$request_uri"
wiki.tenforward.social.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name wiki.tenforward.social
- root "/srv/www/wiki.tenforward.social"
- index index.php
- access_log "/var/log/nginx/wiki.tenforward.social.access.log"
- error_log "/var/log/nginx/wiki.tenforward.social.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/wiki.tenforward.social.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/wiki.tenforward.social.pem"
- include snippets/sslstapling_hsts.conf
- location ~ /(data|conf|bin|inc)/ {
deny all;
}
- location / {
try_files $uri $uri/ /index.php?$args;
}
- location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
fastcgi_index index.php;
}
nginx_snippets:
sslstapling_hsts:
- ssl_stapling on
- resolver [::1] valid=300s
- add_header Strict-Transport-Security max-age=31536000
php_standard:
- location / {
try_files $uri $uri/ /index.php?$args;
}
- location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
fastcgi_index index.php;
}
wp_with_supercache:
- set $cache_uri $request_uri
- if ( $request_method = POST ) { set $cache_uri 'null cache'; }
- if ( $query_string != "" ) { set $cache_uri 'null cache'; }
- if ( $request_uri ~* "/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml" ) { set $cache_uri 'null cache'; }
- if ( $http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in" ) { set $cache_uri 'null cache'; }
- location / {
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args;
}
- location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|woff2)$ {
expires max;
}
- location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
}
nginx_configs:
gzip:
- gzip on
- gzip_disable msie6
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript
upstream:
- upstream php { server unix:/run/php/php8.1-fpm.sock; }
ssl:
- ssl_protocols TLSv1.2 TLSv1.3
- ssl_prefer_server_ciphers on
- ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'
- ssl_dhparam "/etc/nginx/dhparams.pem"
- ssl_session_timeout 1d
- ssl_session_cache shared:SSL:50m
- ssl_session_tickets off
fcgicache:
- fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m
- fastcgi_cache_key "$scheme$request_method$host$request_uri"
- fastcgi_cache_use_stale error timeout invalid_header http_500
- fastcgi_ignore_headers Cache-Control Expires Set-Cookie
- add_header rt-Fastcgi-Cache $upstream_cache_status

View File

@ -0,0 +1,269 @@
---
- hosts: erlking.silvestris.systems
roles:
- role: jdauphant.nginx
nginx_user: "www-data"
nginx_events_params:
- worker_connections 1024
nginx_http_params:
- sendfile "on"
- server_names_hash_bucket_size 512
nginx_sites:
nullrouted.space.http:
- listen *:80
- listen [::]:80
- server_name nullrouted.space
- return 301 "https://$host$request_uri"
nullrouted.space.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name nullrouted.space
- root "/srv/www/nullrouted.space"
- index index.php index.html
- access_log "/var/log/nginx/nullrouted.space.access.log"
- error_log "/var/log/nginx/nullrouted.space.error.log"
- client_max_body_size 10M
- ssl_certificate "/etc/ssl/letsencrypt/nullrouted.space.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/nullrouted.space.pem"
- include snippets/sslstapling_hsts.conf
- include snippets/wp_with_supercache.conf
- include snippets/blockbots.conf
entropynet.net.http:
- listen *:80
- listen [::]:80
- server_name entropynet.net
- return 301 "https://$host$request_uri"
entropynet.net.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name entropynet.net
- root "/srv/www/entropynet.net"
- error_page 404 /404.html
- index index.html
- access_log "/var/log/nginx/entropynet.net.access.log"
- error_log "/var/log/nginx/entropynet.net.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/entropynet.net.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/entropynet.net.pem"
- include snippets/sslstapling_hsts.conf
- include snippets/blockbots.conf
twoshadesofbrown.com.http:
- listen *:80
- listen [::]:80
- server_name twoshadesofbrown.com
- return 301 "https://$host$request_uri"
twoshadesofbrown.com.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name twoshadesofbrown.com
- root "/srv/www/twoshadesofbrown.com"
- index index.php index.html
- access_log "/var/log/nginx/twoshadesofbrown.com.access.log"
- error_log "/var/log/nginx/twoshadesofbrown.com.error.log"
- client_max_body_size 10M
- ssl_certificate "/etc/ssl/letsencrypt/twoshadesofbrown.com.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/twoshadesofbrown.com.pem"
- include snippets/sslstapling_hsts.conf
- include snippets/wp_with_supercache.conf
- include snippets/blockbots.conf
wiki.packetcat.ca.http:
- listen *:80
- listen [::]:80
- server_name wiki.packetcat.ca
- return 301 "https://$host$request_uri"
wiki.packetcat.ca.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name wiki.packetcat.ca
- root "/srv/www/wiki.packetcat.ca"
- index index.php
- access_log "/var/log/nginx/wiki.packetcat.ca.access.log"
- error_log "/var/log/nginx/wiki.packetcat.ca.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/wiki.packetcat.ca.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/wiki.packetcat.ca.pem"
- include snippets/sslstapling_hsts.conf
- include snippets/blockbots.conf
- location ~ /(data|conf|bin|inc)/ {
deny all;
}
- location / {
try_files $uri $uri/ /index.php?$args;
}
- location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
fastcgi_index index.php;
}
sadiqsaif.com.http:
- listen *:80
- listen [::]:80
- server_name sadiqsaif.com
- return 301 "https://$host$request_uri"
sadiqsaif.com.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name sadiqsaif.com
- root "/srv/www/sadiqsaif.com/public"
- index index.html
- error_page 404 /404.html
- access_log "/var/log/nginx/sadiqsaif.com.access.log"
- error_log "/var/log/nginx/sadiqsaif.com.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/sadiqsaif.com.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/sadiqsaif.com.pem"
- include snippets/sslstapling_hsts.conf
- include snippets/blockbots.conf
sadiqsaif.ca.http:
- listen *:80
- listen [::]:80
- server_name sadiqsaif.ca
- return 301 "https://sadiqsaif.com$request_uri"
sadiqsaif.ca.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name sadiqsaif.ca
- access_log "/var/log/nginx/sadiqsaif.ca.access.log"
- error_log "/var/log/nginx/sadiqsaif.ca.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/sadiqsaif.ca.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/sadiqsaif.ca.pem"
- return 301 "https://sadiqsaif.com$request_uri"
wallabag.packetcat.ca.http:
- listen *:80
- listen [::]:80
- server_name wallabag.packetcat.ca
- return 301 "https://$host$request_uri"
wallabag.packetcat.ca.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name wallabag.packetcat.ca
- root "/srv/www/wallabag.packetcat.ca/web"
- index app.php
- access_log "/var/log/nginx/wallabag.packetcat.ca.access.log"
- error_log "/var/log/nginx/wallabag.packetcat.ca.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/wallabag.packetcat.ca.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/wallabag.packetcat.ca.pem"
- include snippets/sslstapling_hsts.conf
- include snippets/blockbots.conf
- location / {
try_files $uri /app.php$is_args$args;
}
- location ~ ^/app\.php(/|$) {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
fastcgi_index index.php;
internal;
}
- location ~ \.php$ {
return 404;
}
bastetrix.com.http:
- listen *:80
- listen [::]:80
- server_name bastetrix.com
- root "/srv/www/bastetrix.com/public"
- location /.well-known/acme-challenge/ {
allow all;
}
- return 301 "https://$host$request_uri"
bastetrix.com.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name bastetrix.com
- root "/srv/www/bastetrix.com/public"
- index index.html
- access_log "/var/log/nginx/bastetrix.com.access.log"
- error_log "/var/log/nginx/bastetrix.com.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/bastetrix.com.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/bastetrix.com.pem"
- include snippets/sslstapling_hsts.conf
wiki.bastetrix.org.http:
- listen *:80
- listen [::]:80
- server_name wiki.bastetrix.org
- root "/srv/www/wiki.bastetrix.org"
- location /.well-known/acme-challenge/ {
allow all;
}
- return 301 "https://$host$request_uri"
wiki.bastetrix.org.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name wiki.bastetrix.org
- root "/srv/www/wiki.bastetrix.org"
- index index.php
- access_log "/var/log/nginx/wiki.bastetrix.org.access.log"
- error_log "/var/log/nginx/wiki.bastetrix.org.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/wiki.bastetrix.org.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/wiki.bastetrix.org.pem"
- include snippets/sslstapling_hsts.conf
- location ~ /(data|conf|bin|inc)/ {
deny all;
}
- include snippets/php_standard.conf
nginx_snippets:
sslstapling_hsts:
- ssl_stapling on
- resolver [::1] valid=300s
- add_header Strict-Transport-Security max-age=31536000
php_standard:
- location / {
try_files $uri $uri/ /index.php?$args;
}
- location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
fastcgi_index index.php;
}
wp_with_supercache:
- set $cache_uri $request_uri
- if ( $request_method = POST ) { set $cache_uri 'null cache'; }
- if ( $query_string != "" ) { set $cache_uri 'null cache'; }
- if ( $request_uri ~* "/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml" ) { set $cache_uri 'null cache'; }
- if ( $http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in" ) { set $cache_uri 'null cache'; }
- location / {
try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args;
}
- location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|woff2)$ {
expires max;
}
- location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
}
blockbots:
- if ($http_user_agent ~* (thesis-research-bot|fidget-spinner-bot|ClaudeBot) ) {
return 403;
}
nginx_configs:
gzip:
- gzip on
- gzip_disable msie6
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript
upstream:
- upstream php { server unix:/run/php/php8.1-fpm.sock; }
ssl:
- ssl_protocols TLSv1.2 TLSv1.3
- ssl_prefer_server_ciphers on
- ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'
- ssl_dhparam "/etc/nginx/dhparams.pem"
- ssl_session_timeout 1d
- ssl_session_cache shared:SSL:50m
- ssl_session_tickets off
fcgicache:
- fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m
- fastcgi_cache_key "$scheme$request_method$host$request_uri"
- fastcgi_cache_use_stale error timeout invalid_header http_500
- fastcgi_ignore_headers Cache-Control Expires Set-Cookie
- add_header rt-Fastcgi-Cache $upstream_cache_status

7
ubuntu/firewall.yml Normal file
View File

@ -0,0 +1,7 @@
---
- name: Deploy firewall rules
hosts: firewalled
user: root
roles:
- firewall-ruleset-deploy

View File

@ -0,0 +1,7 @@
---
- name: install Icinga 2 for client usage
hosts: icingaclients
user: root
roles:
- icinga-client

7
ubuntu/ipset.yml Normal file
View File

@ -0,0 +1,7 @@
---
- name: Deploy ipset rulesets
hosts: ipset
user: root
roles:
- ipset-deploy

View File

@ -0,0 +1,110 @@
---
- hosts: molly.silvestris.systems
roles:
- role: jdauphant.nginx
nginx_user: "www-data"
nginx_events_params:
- worker_connections 1024
nginx_http_params:
- sendfile "on"
- server_names_hash_bucket_size 512
nginx_sites:
tenforward.social.http:
- listen *:80
- listen [::]:80
- server_name tenforward.social
- location /.well-known/acme-challenge/ {
allow all;
}
- return 301 "https://$host$request_uri"
tenforward.social.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name tenforward.social
- root "/home/mastodon/live/public"
- access_log "/var/log/nginx/tenforward.social.access.log"
- error_log "/var/log/nginx/tenforward.social.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/tenforward.social.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/tenforward.social.pem"
- add_header Referrer-Policy "no-referrer, strict-origin-when-cross-origin"
- add_header Strict-Transport-Security max-age=31536000
- add_header Access-Control-Allow-Origin *
- include snippets/blockbots.conf
- client_max_body_size 0
- location / {
try_files $uri @proxy;
}
- location ~ ^/(emoji|packs|system/media_attachments/files|system/accounts/avatars) {
add_header Cache-Control "public, max-age=31536000, immutable";
}
- location ^~ /api/v1/streaming {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Proxy "";
proxy_pass http://streaming;
proxy_buffering off;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains";
tcp_nodelay on;
}
- location @proxy {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Proxy "";
proxy_pass_header Server;
proxy_pass http://backend;
proxy_buffering on;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_cache CACHE;
proxy_cache_valid 200 7d;
proxy_cache_valid 410 24h;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
add_header X-Cached $upstream_cache_status;
tcp_nodelay on;
}
- error_page 404 500 501 502 503 504 /500.html
nginx_configs:
gzip:
- gzip on
- gzip_disable msie6
- gzip_vary on
- gzip_proxied any
- gzip_comp_level 6
- gzip_buffers 16 8k
- gzip_http_version 1.1
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript
connectionupgrade:
- map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
proxycache:
- proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=CACHE:10m inactive=7d max_size=1g
ssl:
- ssl_protocols TLSv1.2 TLSv1.3
- ssl_session_timeout 1d
- ssl_session_cache shared:SSL:50m
- ssl_session_tickets off
upstreams:
- upstream backend {
server 127.0.0.1:3000 fail_timeout=0;
}
- upstream streaming {
server 127.0.0.1:4000 fail_timeout=0;
}
nginx_snippets:
blockbots:
- if ($http_user_agent ~* (LanaiBotmarch|lanaibot|TinyTestBot|TinyBotTestUA|Content-Nation) ) {
return 403;
}

14
ubuntu/package-update.yml Normal file
View File

@ -0,0 +1,14 @@
---
- name: Update packages on cloud nodes
hosts: cloud
user: root
roles:
- package-update
- name: Update packages on home nodes
hosts: home
user: root
roles:
- package-update

View File

@ -0,0 +1,7 @@
---
- name: Install pgbackrest
hosts: pgbackrest
user: root
roles:
- pgbackrest-install

View File

@ -0,0 +1,4 @@
---
- hosts: rclone-hosts
roles:
- stefangweichinger.ansible_rclone

View File

@ -1,392 +0,0 @@
; Start a new pool named 'www'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
; - 'chdir'
; - 'php_values'
; - 'php_admin_values'
; When not set, the global prefix (or /usr) applies instead.
; Note: This directive can also be relative to the global prefix.
; Default Value: none
;prefix = /path/to/pools/$pool
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = www-data
group = www-data
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
; Set listen(2) backlog. A value of '-1' means unlimited.
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
;listen.backlog = -1
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0666
;listen.owner = www-data
;listen.group = www-data
;listen.mode = 0666
; List of ipv4 addresses of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
listen.allowed_clients = 127.0.0.1
; Specify the nice(2) priority to apply to the pool processes (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool processes will inherit the master process priority
; unless it specified otherwise
; Default Value: no set
; priority = -19
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives. With this process management, there will be
; always at least 1 children.
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; ondemand - no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children - the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = dynamic
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI. The below defaults are based on a server without much resources. Don't
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 5
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = 2
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 1
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = 3
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
;pm.process_idle_timeout = 10s;
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
;pm.max_requests = 500
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. It shows the following informations:
; pool - the name of the pool;
; process manager - static, dynamic or ondemand;
; start time - the date and time FPM has started;
; start since - number of seconds since FPM has started;
; accepted conn - the number of request accepted by the pool;
; listen queue - the number of request in the queue of pending
; connections (see backlog in listen(2));
; max listen queue - the maximum number of requests in the queue
; of pending connections since FPM has started;
; listen queue len - the size of the socket queue of pending connections;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes;
; max active processes - the maximum number of active processes since FPM
; has started;
; max children reached - number of times, the process limit has been reached,
; when pm tries to start more children (works only for
; pm 'dynamic' and 'ondemand');
; Value are updated in real time.
; Example output:
; pool: www
; process manager: static
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 62636
; accepted conn: 190460
; listen queue: 0
; max listen queue: 1
; listen queue len: 42
; idle processes: 4
; active processes: 11
; total processes: 15
; max active processes: 12
; max children reached: 0
;
; By default the status page output is formatted as text/plain. Passing either
; 'html', 'xml' or 'json' in the query string will return the corresponding
; output syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; http://www.foo.bar/status?xml
;
; By default the status page only outputs short status. Passing 'full' in the
; query string will also return status for each pool process.
; Example:
; http://www.foo.bar/status?full
; http://www.foo.bar/status?json&full
; http://www.foo.bar/status?html&full
; http://www.foo.bar/status?xml&full
; The Full status returns for each process:
; pid - the PID of the process;
; state - the state of the process (Idle, Running, ...);
; start time - the date and time the process has started;
; start since - the number of seconds since the process has started;
; requests - the number of requests the process has served;
; request duration - the duration in µs of the requests;
; request method - the request method (GET, POST, ...);
; request URI - the request URI with the query string;
; content length - the content length of the request (only with POST);
; user - the user (PHP_AUTH_USER) (or '-' if not set);
; script - the main script called (or '-' if not set);
; last request cpu - the %cpu the last request consumed
; it's always 0 if the process is not in Idle state
; because CPU calculation is done when the request
; processing has terminated;
; last request memory - the max amount of memory the last request consumed
; it's always 0 if the process is not in Idle state
; because memory calculation is done when the request
; processing has terminated;
; If the process is in Idle state, then informations are related to the
; last request the process has served. Otherwise informations are related to
; the current request being served.
; Example output:
; ************************
; pid: 31330
; state: Running
; start time: 01/Jul/2011:17:53:49 +0200
; start since: 63087
; requests: 12808
; request duration: 1250261
; request method: GET
; request URI: /test_mem.php?N=10000
; content length: 0
; user: -
; script: /home/fat/web/docs/php/test_mem.php
; last request cpu: 0.00
; last request memory: 0
;
; Note: There is a real-time FPM status monitoring sample web page available
; It's available in: ${prefix}/share/fpm/status.html
;
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;pm.status_path = /status
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
;ping.path = /ping
; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong
; The access log file
; Default: not set
;access.log = /var/log/$pool.access.log
; The access log format.
; The following syntax is allowed
; %%: the '%' character
; %C: %CPU used by the request
; it can accept the following format:
; - %{user}C for user CPU only
; - %{system}C for system CPU only
; - %{total}C for user + system CPU (default)
; %d: time taken to serve the request
; it can accept the following format:
; - %{seconds}d (default)
; - %{miliseconds}d
; - %{mili}d
; - %{microseconds}d
; - %{micro}d
; %e: an environment variable (same as $_ENV or $_SERVER)
; it must be associated with embraces to specify the name of the env
; variable. Some exemples:
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
; %f: script filename
; %l: content-length of the request (for POST request only)
; %m: request method
; %M: peak of memory allocated by PHP
; it can accept the following format:
; - %{bytes}M (default)
; - %{kilobytes}M
; - %{kilo}M
; - %{megabytes}M
; - %{mega}M
; %n: pool name
; %o: ouput header
; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o
; - %{X-Powered-By}o
; - %{Transfert-Encoding}o
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
; %s: status (response code)
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = /var/log/$pool.log.slow
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_slowlog_timeout = 0
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
;request_terminate_timeout = 0
; Set open file descriptor rlimit.
; Default Value: system defined value
;rlimit_files = 1024
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
; of its subdirectories. If the pool prefix is not set, the global prefix
; will be used instead.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
;chroot =
; Chdir to this directory at the start.
; Note: relative path can be used.
; Default Value: current directory or / when chroot
chdir = /
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Note: on highloaded environement, this can cause some delay in the page
; process time (several ms).
; Default Value: no
;catch_workers_output = yes
; Limits the extensions of the main script FPM will allow to parse. This can
; prevent configuration mistakes on the web server side. You should only limit
; FPM to .php extensions to prevent malicious users to use other extensions to
; exectute php code.
; Note: set an empty value to allow all extensions.
; Default Value: .php
;security.limit_extensions = .php .php3 .php4 .php5
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
; Note: path INI options can be relative and will be expanded with the prefix
; (pool, global or /usr)
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M

View File

@ -1,3 +0,0 @@
---
- name: start php5-fpm
service: name=php5-fpm state=started

View File

@ -1,9 +0,0 @@
---
- name: Install php5-fpm
apt: pkg=php5-fpm state=latest
- name: Stop the php5-fpm daemon for now and ensure it starts on boot
service: name=php5-fpm state=stopped enabled=yes
- name: Copy over the php5-fpm www pool config
copy: src=www.conf dest=/etc/php5/fpm/pool.d/www.conf backup=yes
notify:
- start php5-fpm

View File

@ -1,72 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: uwsgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the uwsgi app server
# Description: starts uwsgi app server using start-stop-daemon
### END INIT INFO
PATH=/opt/uwsgi:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/uwsgi
OWNER=uwsgi
NAME=uwsgi
DESC=uwsgi
test -x $DAEMON || exit 0
# Include uwsgi defaults if available
if [ -f /etc/default/uwsgi ] ; then
. /etc/default/uwsgi
fi
set -e
#DAEMON_OPTS="-s 127.0.0.1:9001 -M 4 -t 30 -A 4 -p 4 -d /var/log/uwsgi.log --pythonpath $PYTHONPATH --module $MODULE"
DAEMON_OPTS="--emperor /etc/uwsgi/apps -d /var/log/uwsgi.log"
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --chuid $OWNER:$OWNER --user $OWNER \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --signal 3 --user $OWNER --quiet --retry 2 --stop \
--exec $DAEMON
echo "$NAME."
;;
reload)
killall -1 $DAEMON
;;
force-reload)
killall -15 $DAEMON
;;
restart)
echo -n "Restarting $DESC: "
start-stop-daemon --signal 3 --user $OWNER --quiet --retry 2 --stop \
--exec $DAEMON
sleep 1
start-stop-daemon --user $OWNER --start --quiet --chuid $OWNER:$OWNER \
--exec $DAEMON -- $DAEMON_OPTS
echo "$NAME."
;;
status)
killall -10 $DAEMON
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
exit 1
;;
esac
exit 0

View File

@ -1,9 +0,0 @@
"/var/log/uwsgi/*.log" "/var/log/uwsgi/*/*.log" {
copytruncate
daily
rotate 5
compress
delaycompress
missingok
notifempty
}

View File

@ -1,3 +0,0 @@
---
- name: start uwsgi
service: name=uwsgi state=started

View File

@ -1,24 +0,0 @@
---
- name: Install virtualenv
apt: name=python-virtualenv state=latest
- name: Install uwsgi from PyPI
pip: name=uWSGI
- name: Add uwsgi group
group: name=uwsgi state=present
- name: Add uwsgi user
user: name=uwsgi shell=/sbin/nologin createhome=no group=uwsgi password=$6$Qu5GfWUlAPXh$Ie8Fd9Vzl.PpaFciUbRCI4sIryI6i0rDE29Vf86/WYHgPSWG7x9IIkVU.tG1Mtfq2OM9IeH2IuvOKCcnErMgC1
- name: Copy over the uwsgi init script and logrotate config
copy: src={{ item.name }} dest={{ item.dir }} backup=yes
with_items:
- { name: 'uwsgi.init', dir: '/etc/init.d/uwsgi' }
- { name: 'uwsgi.logrotate', dir: '/etc/logrotate.d/uwsgi' }
- name: Make sure the init script is executable
file: path=/etc/init.d/uwsgi owner=root group=root mode=0755
- name: Make configuration directory
file: path=/etc/uwsgi/apps state=directory
- name: Make log file with correct permissions
file: path=/var/log/uwsgi.log owner=uwsgi group=uwsgi mode=0750 state=touch
- name: Make sure uwsgi starts on boot
service: name=uwsgi enabled=yes
notify:
- start uwsgi

View File

@ -0,0 +1,91 @@
// Automatically upgrade packages from these (origin:archive) pairs
//
// Note that in Ubuntu security updates may pull in new dependencies
// from non-security sources (e.g. chromium). By allowing the release
// pocket these get automatically pulled in.
Unattended-Upgrade::Allowed-Origins {
"${distro_id}:${distro_codename}";
"${distro_id}:${distro_codename}-security";
// Extended Security Maintenance; doesn't necessarily exist for
// every release and this system may not have it installed, but if
// available, the policy for updates is such that unattended-upgrades
// should also install from here by default.
"${distro_id}ESM:${distro_codename}";
// "${distro_id}:${distro_codename}-updates";
// "${distro_id}:${distro_codename}-proposed";
// "${distro_id}:${distro_codename}-backports";
};
// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
// "vim";
// "libc6";
// "libc6-dev";
// "libc6-i686";
};
// This option will controls whether the development release of Ubuntu will be
// upgraded automatically.
Unattended-Upgrade::DevRelease "false";
// This option allows you to control if on a unclean dpkg exit
// unattended-upgrades will automatically run
// dpkg --force-confold --configure -a
// The default is true, to ensure updates keep getting installed
//Unattended-Upgrade::AutoFixInterruptedDpkg "false";
// Split the upgrade into the smallest possible chunks so that
// they can be interrupted with SIGTERM. This makes the upgrade
// a bit slower but it has the benefit that shutdown while a upgrade
// is running is possible (with a small delay)
//Unattended-Upgrade::MinimalSteps "false";
// Install all unattended-upgrades when the machine is shutting down
// instead of doing it in the background while the machine is running
// This will (obviously) make shutdown slower
//Unattended-Upgrade::InstallOnShutdown "true";
// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you
// have a working mail setup on your system. A package that provides
// 'mailx' must be installed. E.g. "user@example.com"
Unattended-Upgrade::Mail "s+cron@sadiqs.com";
// Set this value to "true" to get emails only on errors. Default
// is to always send a mail if Unattended-Upgrade::Mail is set
//Unattended-Upgrade::MailOnlyOnError "true";
// Remove unused automatically installed kernel-related packages
// (kernel images, kernel headers and kernel version locked tools).
//Unattended-Upgrade::Remove-Unused-Kernel-Packages "false";
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
Unattended-Upgrade::Remove-Unused-Dependencies "true";
// Automatically reboot *WITHOUT CONFIRMATION*
// if the file /var/run/reboot-required is found after the upgrade
//Unattended-Upgrade::Automatic-Reboot "false";
// If automatic reboot is enabled and needed, reboot at the specific
// time instead of immediately
// Default: "now"
//Unattended-Upgrade::Automatic-Reboot-Time "02:00";
// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
//Acquire::http::Dl-Limit "70";
// Enable logging to syslog. Default is False
// Unattended-Upgrade::SyslogEnable "false";
// Specify syslog facility. Default is daemon
// Unattended-Upgrade::SyslogFacility "daemon";
// Download and install upgrades only on AC power
// (i.e. skip or gracefully stop updates on battery)
// Unattended-Upgrade::OnlyOnACPower "true";
// Download and install upgrades only on non-metered connection
// (i.e. skip or gracefully stop updates on a metered connection)
// Unattended-Upgrade::Skip-Updates-On-Metered-Connections "true";

View File

@ -0,0 +1,21 @@
---
# This task sets up unattended-upgrade's config
- name: Install unattended-upgrade and apt-listchanges
apt: name={{ packages }} state=latest update_cache=yes
vars:
packages:
- unattended-upgrades
- apt-listchanges
- name: Copy our 50unattended-upgrades
copy:
src: 50unattended-upgrades
dest: /etc/apt/apt.conf.d/50unattended-upgrades
- name: Ensure 20auto-upgrades has the correct values using debconf
debconf:
name: unattended-upgrades
question: unattended-upgrades/enable_auto_updates
vtype: boolean
value: true

View File

@ -0,0 +1,4 @@
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "7";

View File

@ -0,0 +1,3 @@
# See man 5 aliases for format
postmaster: root
root: s+cron@sadiqs.com

View File

@ -1,2 +0,0 @@
nameserver ::1
nameserver 8.8.8.8

View File

@ -3,4 +3,5 @@
service: name=rsyslog state=restarted
- name: restart cron
service: name=cron state=restarted
- name: newaliases
shell: newaliases

View File

@ -1,8 +1,12 @@
---
# This playbook contains common plays that will be run all nodes.
- name: Install python-apt, aptitude, and debconf-utils
- name: Install python-apt, aptitude, and debconf-utils (20.04)
shell: apt-get update && apt-get -y install python-apt aptitude debconf-utils
when: ansible_distribution_release == 'focal'
- name: Install python-apt, aptitude, and debconf-utils (22.04)
shell: apt-get update && apt-get -y install python3-apt aptitude debconf-utils
when: ansible_distribution_release == 'jammy'
- name: Do any package upgrades
apt: upgrade=dist
- name: Set default locale to en_US.UTF-8
@ -16,44 +20,59 @@
notify:
- restart rsyslog
- restart cron
- name: Set hostname
hostname:
name: "{{ inventory_hostname }}"
use: systemd
- name: Remove packages we do not need
apt:
name: "{{ packages }}"
state: absent
vars:
packages:
- exim4-daemon-light
- consolekit
- snapd
- lxcfs
- rpcbind
- ufw
- name: Install required packages
apt: pkg={{ item }} state=latest
with_items:
- most
- zsh
- vim
- vim-scripts
- git
- subversion
- tmux
- multitail
- mtr-tiny
- curl
- dnsutils
- sudo
- gnupg
- traceroute
- htop
- haveged
- python-pip
- unbound
- duplicity
- python-boto
- build-essential
- vnstat
- python-dev
- ntp
- name: Remove exim4 and consolekit
apt: pkg={{ item }} state=absent
with_items:
- exim4-daemon-light
- consolekit
- name: Ensure haveged, unbound, ntp, and vnstat are started on boot
apt:
name: "{{ packages }}"
state: latest
vars:
packages:
- most
- vim
- vim-scripts
- git
- tmux
- multitail
- mtr-tiny
- curl
- dnsutils
- sudo
- gnupg
- traceroute
- htop
- haveged
- build-essential
- vnstat
- chrony
- unattended-upgrades
- mailutils
- postfix
- python-is-python3
- net-tools
- name: Ensure haveged, ntp, and vnstat are started on boot
service: name={{ item }} enabled=yes
with_items:
- haveged
- unbound
- vnstat
- ntp
- name: use local unbound instance for DNS and Google Public DNS as backup
copy: src=resolv.conf dest=/etc/resolv.conf
- chrony
- name: Ensure that the periodic APT cron task clears out old kernels and does unattended security upgrades
copy: src=10periodic dest=/etc/apt/apt.conf.d/10periodic backup=yes owner=root group=root mode=0644
- name: Copy over our aliases file
copy: src=aliases dest=/etc/aliases
notify:
- newaliases

View File

@ -0,0 +1,23 @@
---
# This role disables the rpcbind service on hosts
- name: Disable and mask the rpcbind service
systemd:
name: rpcbind.service
enabled: false
state: stopped
masked: true
- name: Disable and mask the rpcbind socket
systemd:
name: rpcbind.socket
enabled: false
state: stopped
masked: true
- name: Disable and mask the rpcbind target
systemd:
name: rpcbind.target
enabled: false
state: stopped
masked: true

View File

@ -0,0 +1,28 @@
*filter
:INPUT DROP
:FORWARD ACCEPT
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp --icmp-type ping -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 5665 -j ACCEPT
-A INPUT -p tcp --dport 9001 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 5269,5222 -j ACCEPT
-A INPUT -p udp --dport 1194 -j ACCEPT
-A INPUT -p udp --dport 53 -s 10.8.0.1/24 -j ACCEPT
-A INPUT -p tcp --dport 53 -s 10.8.0.1/24 -j ACCEPT
-A INPUT -p udp --dport 53 -s 10.66.66.0/24 -j ACCEPT
-A INPUT -p tcp --dport 53 -s 10.66.66.0/24 -j ACCEPT
-A INPUT -p udp --dport 53 -s 100.64.0.0/10 -j ACCEPT
-A INPUT -p tcp --dport 53 -s 100.64.0.0/10 -j ACCEPT
-A INPUT -p udp --dport 51802 -j ACCEPT
COMMIT
*nat
:PREROUTING ACCEPT
:INPUT ACCEPT
:OUTPUT ACCEPT
:POSTROUTING ACCEPT
-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
-A POSTROUTING -s 10.66.66.0/24 -o eth0 -j MASQUERADE
COMMIT

View File

@ -0,0 +1,32 @@
*filter
:INPUT DROP
:FORWARD ACCEPT
:OUTPUT ACCEPT
:icmp_in -
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 5665 -j ACCEPT
-A INPUT -p tcp --dport 9001 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 5269,5222 -j ACCEPT
-A INPUT -p udp -s 2620:98:4002::/48 --dport 53 -j ACCEPT
-A INPUT -p tcp -s 2620:98:4002::/48 --dport 53 -j ACCEPT
-A INPUT -p udp -s fd7a:115c:a1e0:ab12:4843:cd96:6241:b43c/128 --dport 53 -j ACCEPT
-A INPUT -p tcp -s fd7a:115c:a1e0:ab12:4843:cd96:6241:b43c/128 --dport 53 -j ACCEPT
-A INPUT -p ipv6-icmp -j icmp_in
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 128 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 134 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 135 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 136 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 1 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 2 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 3 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 4 -j ACCEPT
COMMIT
*nat
:PREROUTING ACCEPT
:INPUT ACCEPT
:OUTPUT ACCEPT
:POSTROUTING ACCEPT
-A POSTROUTING -s fd42:42:42::/64 -o eth0 -j MASQUERADE
COMMIT

View File

@ -0,0 +1,12 @@
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT ACCEPT
-A INPUT -m set --match-set nasties src -j DROP
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp --icmp-type ping -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A INPUT -p tcp --dport 5665 -j ACCEPT
COMMIT

View File

@ -0,0 +1,20 @@
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT ACCEPT
:icmp_in -
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m multiport --dport 80,443 -j ACCEPT
-A INPUT -p tcp --dport 5665 -j ACCEPT
-A INPUT -p ipv6-icmp -j icmp_in
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 128 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 134 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 135 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 136 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 1 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 2 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 3 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 4 -j ACCEPT
COMMIT

View File

@ -0,0 +1,10 @@
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp --icmp-type ping -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 5665 -j ACCEPT
COMMIT

View File

@ -0,0 +1,19 @@
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT ACCEPT
:icmp_in -
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 5665 -j ACCEPT
-A INPUT -p ipv6-icmp -j icmp_in
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 128 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 134 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 135 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 136 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 1 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 2 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 3 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 4 -j ACCEPT
COMMIT

View File

@ -0,0 +1,24 @@
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT DROP
-A INPUT -m set --match-set nasties src -j DROP
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5665 -j ACCEPT
-A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A OUTPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 587 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 5665 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A OUTPUT -p udp -m multiport --dports 67,68 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
COMMIT

View File

@ -0,0 +1,31 @@
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT DROP
:icmp_in -
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5665 -j ACCEPT
-A INPUT -p ipv6-icmp -j icmp_in
-A OUTPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 53 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 587 -j ACCEPT
-A OUTPUT -p ipv6-icmp -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 5665 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 25 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 123 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 128 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 134 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 135 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 136 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 1 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 2 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 3 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 4 -j ACCEPT
COMMIT

View File

@ -0,0 +1,4 @@
# Configuration for netfilter-persistent
# Plugins may extend this file or have their own
FLUSH_ON_STOP=0

View File

@ -0,0 +1,12 @@
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT ACCEPT
-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp --icmp-type ping -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 5665 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
COMMIT

View File

@ -0,0 +1,21 @@
*filter
:INPUT DROP
:FORWARD DROP
:OUTPUT ACCEPT
:icmp_in -
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp --dport 22 -j ACCEPT
-A INPUT -p tcp --dport 5665 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -p ipv6-icmp -j icmp_in
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 128 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 134 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 135 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 136 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 1 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 2 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 3 -j ACCEPT
-A icmp_in -p ipv6-icmp -m icmp6 --icmpv6-type 4 -j ACCEPT
COMMIT

View File

@ -0,0 +1,13 @@
---
- name: restart netfilter-persistent-v4
service:
name: netfilter-persistent
state: restarted
enabled: yes
- name: restart netfilter-persistent-v6
service:
name: netfilter-persistent
state: restarted
enabled: yes

View File

@ -0,0 +1,31 @@
---
# This role deploys firewall rulesets to Ubuntu hosts
- name: Make sure iptables and netfilter-persistent are installed
apt:
name: "{{ packages }}"
state: latest
vars:
packages:
- iptables-persistent
- netfilter-persistent
- ipset
- name: Copy defaults file with our mods
copy:
src: netfilter-persistent
dest: /etc/default/netfilter-persistent
- name: Copy IPv4 ruleset
copy:
src: "{{ ansible_fqdn }}.rules.v4"
dest: /etc/iptables/rules.v4
notify:
- restart netfilter-persistent-v4
- name: Copy IPv6 ruleset
copy:
src: "{{ ansible_fqdn }}.rules.v6"
dest: /etc/iptables/rules.v6
notify:
- restart netfilter-persistent-v6

View File

@ -0,0 +1,2 @@
[Service]
Restart=on-failure

View File

@ -0,0 +1,26 @@
---
# This role installs Icinga 2 and the plugins required on a Icinga client nodes
- name: Add Icinga package repository key
apt_key: url="https://packages.icinga.com/icinga.key" state=present
- name: Add Icinga apt repository
apt_repository: repo="deb https://packages.icinga.com/ubuntu icinga-{{ ansible_distribution_release }} main" state=present
- name: Update apt cache and install Icinga packages
apt: name={{ packages }} state=latest update_cache=yes
vars:
packages:
- icinga2
- monitoring-plugins
- name: Ensure icinga2 systemd folder exists
file:
path: /etc/systemd/system/icinga2.service.d/
state: directory
- name: Copy custom icinga2 systemd service file modifications
copy:
src: restart.conf
dest: /etc/systemd/system/icinga2.service.d/restart.conf
- name: Ensure that icinga2 systemd service is enabled
systemd:
name: icinga2
enabled: yes
daemon_reload: yes

View File

@ -0,0 +1,31 @@
create nasties hash:net family inet hashsize 1024 maxelem 65536
# domaincrawler.com aggressive crawler/bot
add nasties 185.6.8.3/32
add nasties 185.6.8.7/32
# Seekport Crawler, aggressive
add nasties 95.216.172.167/32
# SearchAtlas.com SEO Crawler, doesn't respect robots.txt
add nasties 147.75.106.146/32
# moz.com SEO crawler
add nasties 216.244.66.229/32
# Aspiegel (Huawei) bot range
add nasties 114.119.160.0/21
add nasties 114.119.128.0/19
# Centurybot
add nasties 64.62.202.73/32
# Adsbot
add nasties 216.18.204.0/24
add nasties 173.231.59.0/24
# Unknown crawler, no user agent, doesn't actually respect robots.txt
add nasties 217.160.142.105/32
# MegaIndex.ru Crawler
add nasties 176.9.41.28/32
# AS206728 Media Land LLC, seems to be botnet IPs
add nasties 45.141.84.0/24
add nasties 45.141.85.0/24
add nasties 45.141.86.0/24
add nasties 45.141.87.0/24
add nasties 91.220.163.0/24
add nasties 193.242.153.0/24
add nasties 194.26.29.0/24
add nasties 194.113.209.0/24

View File

@ -0,0 +1,15 @@
[Unit]
Description=Loading IP Sets
Before=network.target
Before=netfilter-persistent.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ipset -! -f /etc/ipset.conf restore
ExecReload=/sbin/ipset -! -f /etc/ipset.conf restore
ExecStop=/sbin/ipset flush
[Install]
WantedBy=multi-user.target
RequiredBy=netfilter-persistent.service

View File

@ -0,0 +1,49 @@
create nasties hash:net family inet hashsize 1024 maxelem 65536
# Scrapy bot from University of Milan
add nasties 159.149.133.66/32
# domaincrawler.com aggressive crawler/bot
add nasties 185.6.8.3/32
add nasties 185.6.8.7/32
# infegy data collection
add nasties 173.244.135.0/25
# 1776 Solutions, kiwifarms
add nasties 103.114.191.0/24
# Bytespider crawler, aggressive
add nasties 110.240.0.0/12
add nasties 111.224.0.0/14
add nasties 220.243.128.0/20
# Seekport Crawler, aggressive
add nasties 95.216.172.167/32
# SearchAtlas.com SEO Crawler, doesn't respect robots.txt
add nasties 147.75.106.146/32
# AlkonavtNetwork, Russian spam account creation source
add nasties 5.188.210.0/24
# moz.com SEO crawler
add nasties 216.244.66.229/32
# Aspiegel (Huawei) bot range
add nasties 114.119.160.0/21
add nasties 114.119.128.0/19
# Centurybot
add nasties 64.62.202.73/32
# search.noc.social
add nasties 149.248.4.242/32
# Adsbot
add nasties 216.18.204.0/24
add nasties 173.231.59.0/24
# Unknown crawler, no user agent, doesn't actually respect robots.txt
add nasties 217.160.142.105/32
# MegaIndex.ru Crawler
add nasties 176.9.41.28/32
# Unknown crawler, ignores robots.txt
add nasties 101.200.169.64/32
# AS206728 Media Land LLC, seems to be botnet IPs
add nasties 45.141.84.0/24
add nasties 45.141.85.0/24
add nasties 45.141.86.0/24
add nasties 45.141.87.0/24
add nasties 91.220.163.0/24
add nasties 193.242.153.0/24
add nasties 194.26.29.0/24
add nasties 194.113.209.0/24
# webmeup crawler, doesn't respect robots.txt
add nasties 157.90.177.214/32

View File

@ -0,0 +1,3 @@
- name: reload systemd
systemd:
daemon_reload: yes

View File

@ -0,0 +1,23 @@
---
# This role deploys ipset rulesets to Ubuntu hosts
- name: Copy ipset.service
copy:
src: ipset.service
dest: /etc/systemd/system/ipset.service
- name: Enable ipset.service
systemd:
name: ipset
enabled: yes
daemon_reload: yes
- name: Copy ipset rulesets
copy:
src: "{{ ansible_fqdn }}.ipset"
dest: /etc/ipset.conf
- name: Restart ipset service
systemd:
name: ipset
state: restarted

View File

@ -0,0 +1,5 @@
---
- name: Install MySQL server
apt: pkg=mysql-server state=latest
- name: Start MySQL daemon and ensure it starts on boot
service: name=mysql state=started enabled=yes

View File

@ -0,0 +1,5 @@
---
# This role updates packages and performs autoremove
- name: Update apt cache and then packages with autoremove
apt: update_cache=yes upgrade=safe autoremove=yes

View File

@ -0,0 +1,9 @@
/var/log/pgbackrest/*.log {
daily
missingok
rotate 7
compress
delaycompress
notifempty
create 640 postgres postgres
}

View File

@ -0,0 +1,39 @@
---
# This task installs pgbackrest on a host
- name: Copy pgbackrest binary to host
copy:
src: /builds/pgbackrest-release-2.44/src/pgbackrest
dest: /usr/bin/pgbackrest
mode: '0755'
- name: Make sure Perl is installed
apt:
name: perl
state: latest
- name: Make pgbackrest log directory with the correct permissions
file:
path: /var/log/pgbackrest
state: directory
owner: postgres
group: postgres
mode: '0770'
- name: Make pgbackrest config directory
file:
path: /etc/pgbackrest/conf.d
state: directory
- name: Touch pgbackrest.conf
file:
path: /etc/pgbackrest/pgbackrest.conf
state: touch
owner: postgres
group: postgres
mode: '0640'
- name: Copy pgbackrest logrotate configuration
copy:
src: pgbackrest
dest: /etc/logrotate.d/pgbackrest

View File

@ -0,0 +1,16 @@
---
- name: Install PHP libraries
apt: pkg={{ item }} state=latest
with_items:
- php-mysql
- php-xml
- php-gd
- name: Install php-fpm
apt: pkg=php-fpm state=latest
- name: Start PHP-FPM daemon, and make sure it is started on boot
when: ansible_distribution_release == 'xenial'
service: name=php7.0-fpm state=started enabled=yes
- name: Start PHP-FPM daemon, and make sure it is started on boot
when: ansible_distribution_release == 'bionic'
service: name=php7.2-fpm state=started enabled=yes

View File

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC2DmG7640FmD9QDLDrydiU5kmhJM/ScKOhhHPYndWEdFGMmfnJpqyoPOq5a6cDwLAFyl6ALTjVr6+y4U2hqHmqIs/ds9SeiNzOnPsMUp1DkuVoNyH4WekaA9oXgsb9ZCjHSXB+W3rOgvGYTAuC8GyLYGppInrd6+OKoyZtgx01JYAatfSWGncerNw+x8LiQaF+o62cCDq+3OpyZBbGpLg/wNMtg/Wsaton7fwo2hi8lOkQjzJZPUvPaOcpezK9SLXExyUl+oIcMmGqmExHpXwhA8+TuwbeM5XXT5RJCOw4c2WlMTb93FmdCjtXtInUYc/M80SftdLPokmbzc7uWDV+PX5XVoQCp7JiYS92gkAdlv8aeNMzpbGvd9uUjGKm08dh1aT76I9b9O4sA+vL2PwW2lKdsesksiseF92446kqvOEumB/wh+7yd1N9yOS3Vggasl2iEYgbNiDoCqyXnH6GSHkdxr9CwAyuWy5vmqR5zdV1UsQnRzECrQIFbJpFU98rLfuRM1L9qN4kqxuciv+DAPRm17WAhrjhoZL5xh5+t8TfaO+7qMmjvNO1oRbeTkM0JqdlvcvTUFB7sxDIPuCySIMfi2KTTUpk0i9HHRfJrOr1K02VvwKC302GkFnVEDYKPlXivoI6i1bLaubSZHqDIgUuZeGLTXhG47ner6dMKw== Network Management

View File

@ -0,0 +1,26 @@
# Supported HostKey algorithms by order of preference.
HostKey /etc/ssh/ssh_host_ed25519_key
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
# Password based logins are disabled - only public key based logins are allowed.
AuthenticationMethods publickey
# LogLevel VERBOSE logs user's key fingerprint on login. Needed to have a clear audit track of which key was using to log in.
LogLevel VERBOSE
# Log sftp level file access (read/write/etc.) that would not be easily logged otherwise.
Subsystem sftp /usr/lib/openssh/sftp-server -f AUTHPRIV -l INFO
# Some of the Debian specific options sans X11 Forwarding
# X11 Forwarding is turned off because we don't run X11 on servers
ChallengeResponseAuthentication no
PrintMotd no
AcceptEnv LANG LC_*
UsePAM yes

View File

@ -0,0 +1,5 @@
- name: restart sshd
service:
name: ssh
state: restarted
enabled: yes

View File

@ -0,0 +1,15 @@
---
# This task enforces our OpenSSH server config and authorized_keys for
# cloud servers
- name: Copy our authorized_keys
copy:
src: authorized_keys
dest: /root/.ssh/authorized_keys
- name: Copy our sshd_config
copy:
src: sshd_config
dest: /etc/ssh/sshd_config
notify:
- restart sshd

View File

@ -0,0 +1,19 @@
# Enable/disable the dynamic MOTD news service
# This is a useful way to provide dynamic, informative
# information pertinent to the users and administrators
# of the local system
ENABLED=0
# Configure the source of dynamic MOTD news
# White space separated list of 0 to many news services
# For security reasons, these must be https
# and have a valid certificate
# Canonical runs a service at motd.ubuntu.com, and you
# can easily run one too
URLS="https://motd.ubuntu.com"
# Specify the time in seconds, you're willing to wait for
# dynamic MOTD news
# Note that news messages are fetched in the background by
# a systemd timer, so this should never block boot or login
WAIT=5

View File

@ -0,0 +1,12 @@
---
# This role turns off the MOTD news in Ubuntu 18.04
- name: Copy motd-news file
when: ansible_distribution_release == 'bionic' or ansible_distribution_release == 'focal'
copy:
src: motd-news
dest: /etc/default/motd-news
owner: root
group: root
mode: 0644
backup: yes

View File

@ -1,12 +0,0 @@
# This file is a nginx catch-all vhost, probably put here in an automated
# fashion.
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name _; # This is just an invalid value which will never trigger on a real hostname.
access_log /var/log/nginx/default.access.log;
index index.html;
server_name_in_redirect off;
root /srv/www/catch-all;
}

View File

@ -1,11 +0,0 @@
# Cloudflare
set_real_ip_from 204.93.240.0/24;
set_real_ip_from 204.93.177.0/24;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
real_ip_header CF-Connecting-IP;

View File

@ -1,63 +0,0 @@
user www-data;
worker_processes auto;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 70;
types_hash_max_size 2048;
server_tokens off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
# Upstream to abstract backend connection(s) for PHP.
upstream php {
# server unix:/tmp/php-fpm.sock;
server 127.0.0.1:9000;
}
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
}

View File

@ -1,14 +0,0 @@
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass php;
fastcgi_index index.php;
}

View File

@ -1,23 +0,0 @@
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Directives to send expires headers and turn off 404 error logging.
location ~* \.(js|css|png|jpg|jpeg|gif|ico|html)$ {
expires 24h;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}

View File

@ -1,39 +0,0 @@
# WordPress single blog rules.
# Designed to be included in any server {} block.
# This order might seem weird - this is attempted to match last if rules below fail.
# http://wiki.nginx.org/HttpCoreModule
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# Directives to send expires headers and turn off 404 error logging.
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 24h;
}
# Uncomment one of the lines below for the appropriate caching plugin (if used).
#include global/wordpress-supercache.conf;
#include global/wordpress-w3cache.conf;
# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ \.php$ {
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
# Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
# Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine. And then cross your fingers that you won't get hacked.
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_intercept_errors on;
fastcgi_pass php;
}

View File

@ -1,34 +0,0 @@
# Global restrictions configuration file.
# Designed to be included in any server {} block.</p>
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Deny access to any files with a .php extension in the uploads directory
location ~* ^/wp-content/uploads/.*.php$ {
deny all;
access_log off;
log_not_found off;
}
# Deny access to any files with a .php extension in the uploads directory for multisite
location ~* /files/(.*).php$ {
deny all;
access_log off;
log_not_found off;
}

View File

@ -1,3 +0,0 @@
---
- name: start nginx
service: name=nginx state=started

View File

@ -1,31 +0,0 @@
---
- name: Install nginx package
apt: pkg=nginx state=latest
- name: Stop nginx for now and also make it start on boot
service: name=nginx state=stopped enabled=yes
- name: Make nginx related dirs
file: path={{ item }} state=directory
with_items:
- /etc/nginx/global
- /etc/nginx/sites-available
- /etc/nginx/sites-enabled
- /srv/www/catch-all
- name: Clean out default vhost file in enabled and available dirs
file: path={{ item }} state=absent
with_items:
- /etc/nginx/sites-enabled/default
- /etc/nginx/sites-available/default
- name: Copy over all nginx configuration files
copy: src={{ item.name }} dest={{ item.dir }}
with_items:
- { name: 'nginx.conf', dir: '/etc/nginx/nginx.conf' }
- { name: '0-catch-all', dir: '/etc/nginx/sites-available/0-catch-all' }
- { name: 'cloudflare.conf', dir: '/etc/nginx/global/cloudflare.conf' }
- { name: 'php-generic.conf', dir: '/etc/nginx/global/php-generic.conf' }
- { name: 'security-generic.conf', dir: '/etc/nginx/global/security-generic.conf' }
- { name: 'wordpress-generic.conf', dir: '/etc/nginx/global/wordpress-generic.conf' }
- { name: 'wordpress-security.conf', dir: '/etc/nginx/global/wordpress-security.conf' }
- name: Symlink the default catch-all vhost
file: src=/etc/nginx/sites-available/0-catch-all dest=/etc/nginx/sites-enabled/0-catch-all state=link
notify:
- start nginx

View File

@ -0,0 +1,47 @@
---
- hosts: sanya.silvestris.systems
roles:
- role: jdauphant.nginx
nginx_user: "www-data"
nginx_events_params:
- worker_connections 1024
nginx_http_params:
- sendfile "on"
- server_names_hash_bucket_size 512
nginx_sites:
git.packetcat.ca.http:
- listen *:80
- listen [::]:80
- server_name git.packetcat.ca
- return 301 "https://$host$request_uri"
git.packetcat.ca.https:
- listen *:443 ssl http2
- listen [::]:443 ssl http2
- server_name git.packetcat.ca
- access_log "/var/log/nginx/git.packetcat.ca.access.log"
- error_log "/var/log/nginx/git.packetcat.ca.error.log"
- ssl_certificate "/etc/ssl/letsencrypt/git.packetcat.ca.crt"
- ssl_certificate_key "/etc/ssl/letsencrypt/git.packetcat.ca.pem"
- ssl_stapling on
- resolver [::1] valid=300s
- add_header Strict-Transport-Security max-age=31536000
- location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
nginx_configs:
gzip:
- gzip on
- gzip_disable msie6
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript
ssl:
- ssl_protocols TLSv1.2 TLSv1.3
- ssl_prefer_server_ciphers on
- ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'
- ssl_session_timeout 1d
- ssl_session_cache shared:SSL:50m
- ssl_session_tickets off

View File

@ -1,29 +1,12 @@
---
- name: apply common configuration to all nodes
hosts: all
hosts: unsetup
user: root
roles:
- common
- name: apply configuration to web servers (nginx)
hosts: webservers-nginx
user: root
roles:
- webservers-nginx
- name: apply configuration to PHP app servers
hosts: appservers-php
user: root
roles:
- appservers-php
- name: apply configuration to uwsgi app servers
hosts: appservers-uwsgi
user: root
roles:
- appservers-uwsgi
- turn-off-motd-news
- apt-maintenance
- ssh-enforcement
- disable-rpcbind

View File

@ -0,0 +1,7 @@
---
- name: SSH Enforcement
hosts: cloud
user: root
roles:
- ssh-enforcement