neetob 0.5.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b3d361ac2b2a6e6e135dd47cc1f445dc805a556862fea7c5fbdb3b574d45f53
4
- data.tar.gz: 54daf0d3a4c27f05d1a484d860134f09aaf695060c9e2ba279aca0d821da650b
3
+ metadata.gz: 2b2325ebc1866deb2683b1c5743b1003ce9d6d1b57d6cf001991acea931470fd
4
+ data.tar.gz: c09a5e51b296182e5118bbc0cf5384dbac1fbc4c3a91d714ab0d1ade2a2cae03
5
5
  SHA512:
6
- metadata.gz: 5cfac2e067944b1d3cadc33d9ec784c0add718cac09b93c030ce7dab9f1876d3d851c0123b9d1e3c97385d3533d59d0041874b2e1076daec95ae7cc9a111a24d
7
- data.tar.gz: 69d33a4653768925a9ee42e9ea37e5cd5168d6798dd0979d60ab9c14d36d4ac01dd2873e4817631f5de305a477d1c9bf4b77008b1edfae9ade9f8fd5b5ec08c9
6
+ metadata.gz: c77745dec211548d68a9ba9566c0338564ae32bea9e33a8452942f4048a31d19659b2c19ac0ce2866aa88b44897fd7e1df40086a47ecdade4c34a6a82698bf2d
7
+ data.tar.gz: b3a1ff909ee65fef7f280d3f17de2c1b1a62db363bd2c3996f8cd11732c9dd51e0e95cd7d03d6b59dc8f400d6942fb0d3fa282800e6700293a5da38004ddf6b7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neetob (0.5.0)
4
+ neetob (0.5.2)
5
5
  brakeman (~> 5.0)
6
6
  chronic
7
7
  dotenv (~> 2.8.1)
data/bookmarks.md CHANGED
@@ -28,11 +28,14 @@ example: [All nano issues created before the 20th Mar 2024](https://github.com/i
28
28
  - [Unni's Board](https://github.com/orgs/bigbinary/projects/66) - [neetoAuth & neeto-sso](https://github.com/orgs/bigbinary/projects/66/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-auth-web%22),
29
29
  [neetoDeploy](https://github.com/orgs/bigbinary/projects/66/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-deploy-web%22),
30
30
  [neetoCI](https://github.com/orgs/bigbinary/projects/66/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-ci-web%22),
31
- [neetoRecord](https://github.com/orgs/bigbinary/projects/66/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-record-web%22%2C%22bigbinary%2Fneeto-record-chrome-extension%22+),
32
31
  [neetoInvoice](https://github.com/orgs/bigbinary/projects/66/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-invoice-web%22),
33
32
  [Compliance & commons backend](https://github.com/orgs/bigbinary/projects/66/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-commons-backend%22+),
34
33
 
35
- - [Sandip's Board](https://github.com/orgs/bigbinary/projects/56): [neeto-desk-web](https://github.com/orgs/bigbinary/projects/56/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-desk-web%22),
34
+ - [Sandip's Board](https://github.com/orgs/bigbinary/projects/56):
35
+ [neeto-desk-web](https://github.com/orgs/bigbinary/projects/56/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-desk-web%22),
36
+ [neeto-planner-web](https://github.com/orgs/bigbinary/projects/68/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-planner-web%22),
37
+ [neeto-chat-web](https://github.com/orgs/bigbinary/projects/68/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-chat-web%22),
38
+ [neeto-runner-web](https://github.com/orgs/bigbinary/projects/68/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-runner-web%22),
36
39
  [neeto-kb-web](https://github.com/orgs/bigbinary/projects/56/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-kb-web%22),
37
40
  [neeto-kb-eui](https://github.com/orgs/bigbinary/projects/56/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-kb-eui%22),
38
41
  [neeto-activities-nano](https://github.com/orgs/bigbinary/projects/56/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-activities-nano%22),
@@ -47,6 +50,8 @@ example: [All nano issues created before the 20th Mar 2024](https://github.com/i
47
50
  [neeto-code-web](https://github.com/orgs/bigbinary/projects/57/views/2?filterQuery=repo%3A%22bigbinary%2Fneeto-code-web%22),
48
51
  [neeto-email-notifications-nano](https://github.com/orgs/bigbinary/projects/57/views/2?filterQuery=repo%3A%22bigbinary%2Femail-notifications-nano%22),
49
52
  [neeto-code-blocks](https://github.com/orgs/bigbinary/projects/57/views/2?filterQuery=repo%3A%22bigbinary%2Fneeto-code-blocks%22)
53
+ [neetob](https://github.com/orgs/bigbinary/projects/68/views/1?filterQuery=repo%3A%22bigbinary%2Fneetob%22),
54
+ [neeto-projects-nano](https://github.com/orgs/bigbinary/projects/68/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-projects-nano%22)
50
55
 
51
56
  - [Subin's Board](https://github.com/orgs/bigbinary/projects/67/views/1):
52
57
  [neeto-cal-web](https://github.com/orgs/bigbinary/projects/67/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-cal-web%22),
@@ -75,6 +80,7 @@ example: [All nano issues created before the 20th Mar 2024](https://github.com/i
75
80
  - [Chirag's Board](https://github.com/orgs/bigbinary/projects/52/views/3):
76
81
  [RN work](https://github.com/orgs/bigbinary/projects/52/views/3?filterQuery=repo%3A%22bigbinary%2Fneeto-chat-rn%22%2C%22bigbinary%2Fneeto-invoice-rn%22%2C%22bigbinary%2Fneeto-desk-rn%22%2C%22bigbinary%2Fneeto-planner-rn%22%2C%22bigbinary%2Fneeto-form-rn%22%2C%22bigbinary%2Fneeto-cal-rn%22%2C%22bigbinary%2Fneeto-quiz-rn%22%2C%22bigbinary%2Fneeto-wheel-rn%22%2C%22bigbinary%2Fneeto-ui-rn%22%2C%22bigbinary%2Fneeto-commons-rn%22%2C%22bigbinary%2Fneeto-engineering-rn%22),
77
82
  [neeto-form-web](https://github.com/orgs/bigbinary/projects/52/views/3?filterQuery=repo%3A%22bigbinary%2Fneeto-form-web%22),
83
+ [neetoRecord](https://github.com/orgs/bigbinary/projects/66/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-record-web%22%2C%22bigbinary%2Fneeto-record-chrome-extension%22+),
78
84
  [neeto-crm-web](https://github.com/orgs/bigbinary/projects/52/views/3?filterQuery=repo%3A%22bigbinary%2Fneeto-crm-web%22),
79
85
  [neeto-engineering-web](https://github.com/orgs/bigbinary/projects/52/views/3?filterQuery=repo%3A%22bigbinary%2Fneeto-engineering-web%22),
80
86
  [neeto-testify-web](https://github.com/orgs/bigbinary/projects/52/views/3?filterQuery=repo%3A%22bigbinary%2Fneeto-testify-web%22),
@@ -104,11 +110,6 @@ example: [All nano issues created before the 20th Mar 2024](https://github.com/i
104
110
  [neeto-ui](https://github.com/orgs/bigbinary/projects/53/views/3?filterQuery=repo%3A%22bigbinary%2Fneeto-ui%22),
105
111
  [neeto-molecules](https://github.com/orgs/bigbinary/projects/53/views/3?filterQuery=repo%3A%22bigbinary%2Fneeto-molecules%22),
106
112
 
107
- - [Yedhin's Board](https://github.com/orgs/bigbinary/projects/68/views/1):
108
- [neeto-planner-web](https://github.com/orgs/bigbinary/projects/68/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-planner-web%22),
109
- [neetob](https://github.com/orgs/bigbinary/projects/68/views/1?filterQuery=repo%3A%22bigbinary%2Fneetob%22),
110
- [neeto-projects-nano](https://github.com/orgs/bigbinary/projects/68/views/1?filterQuery=repo%3A%22bigbinary%2Fneeto-projects-nano%22)
111
-
112
113
  - [Praveen's Board](https://github.com/orgs/bigbinary/projects/100/views/1)
113
114
 
114
115
  - [Varun's Board](https://github.com/orgs/bigbinary/projects/73/views/1)
@@ -72,7 +72,8 @@ module Neetob
72
72
  "neetotribe.com": "45eb5b7d96820cf7c375dcdaf608d4c7",
73
73
  "neetotribe.net": "f49cb0229b1d67d228da7ab39a17dde3",
74
74
  "neetowireframe.com": "d6d17a3dab91dc0ca4b9f4f65b086ccc",
75
- "neetowireframe.net": "5866b3f9d20b45800d5657ec59ac630e"
75
+ "neeto.com": "83eeffbce76df68b60e50d1fa254b3fa",
76
+ "bigbinary.com": "dc60ee7ecbff0ef5e58e1bb27ad40e89"
76
77
  }
77
78
 
78
79
  def initialize
@@ -7,6 +7,7 @@ require_relative "always_use_https"
7
7
  require_relative "dns_proxy_status"
8
8
  require_relative "ensure_cdn"
9
9
  require_relative "bot_fight_mode"
10
+ require_relative "verify_spf"
10
11
 
11
12
  module Neetob
12
13
  class CLI
@@ -47,6 +48,12 @@ module Neetob
47
48
  def bot_fight_mode
48
49
  BotFightMode.new(options[:domain]).process
49
50
  end
51
+
52
+ desc "verify_spf", "Validate the TXT records for SPF"
53
+ option :domain, type: :string, aliases: "-d", required: true, description: "Domain name"
54
+ def verify_spf
55
+ VerifySpf.new(options[:domain]).process
56
+ end
50
57
  end
51
58
  end
52
59
  end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ module Neetob
6
+ class CLI
7
+ module Cloudflare
8
+ class VerifySpf < Base
9
+ attr_accessor :domain
10
+
11
+ def initialize(domain)
12
+ super()
13
+ @domain = domain
14
+ end
15
+
16
+ def run
17
+ zone_id = ZONE_IDS[domain.to_sym]
18
+ raise(StandardError, "Domain '#{domain}' not found.") if zone_id.nil?
19
+
20
+ url = create_url(zone_id, "dns_records")
21
+ response = get(url)
22
+
23
+ raise(StandardError, "No DNS records found") if response[:result].empty?
24
+
25
+ spf_txt_records = response[:result].filter { |dns| dns[:type] == "TXT" && dns[:content].start_with?("v=spf1") }
26
+
27
+ if spf_txt_records.count > 1
28
+ ui.error("More than one TXT record found for SPF")
29
+ else
30
+ ui.success("Only one TXT record for SPF present")
31
+ end
32
+
33
+ spf_txt_records.each_with_index do |dns, index|
34
+ ui.info("SPF TXT #{index + 1}: #{dns[:content]}")
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -34,6 +34,8 @@ module Neetob
34
34
  ui.info `neetob cloudflare always_use_https -d #{domain} | sed 's/^/ /'`
35
35
  ui.info "Bot fight mode"
36
36
  ui.info `neetob cloudflare bot_fight_mode -d #{domain} | sed 's/^/ /'`
37
+ ui.info "Validating SPF records"
38
+ ui.info `neetob cloudflare verify_spf -d #{domain} | sed 's/^/ /'`
37
39
  if is_heroku(app_name)
38
40
  ui.info "Heroku maintenance time"
39
41
  ui.info `neetob heroku maintenance_window -a #{app_name} | sed 's/^/ /'`
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Neetob
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Udai Gupta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-01 00:00:00.000000000 Z
11
+ date: 2024-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -179,6 +179,7 @@ files:
179
179
  - lib/neetob/cli/cloudflare/ensure_cdn.rb
180
180
  - lib/neetob/cli/cloudflare/min_tls_version.rb
181
181
  - lib/neetob/cli/cloudflare/ssl_mode.rb
182
+ - lib/neetob/cli/cloudflare/verify_spf.rb
182
183
  - lib/neetob/cli/code/audit.rb
183
184
  - lib/neetob/cli/code/commands.rb
184
185
  - lib/neetob/cli/fetchorupdate_repos/execute.rb