ronin-db 0.1.0-java → 0.1.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.document +0 -1
  3. data/.github/workflows/ruby.yml +14 -0
  4. data/.rubocop.yml +16 -0
  5. data/ChangeLog.md +14 -1
  6. data/Gemfile +7 -3
  7. data/README.md +0 -1
  8. data/Rakefile +2 -3
  9. data/bin/ronin-db +6 -7
  10. data/lib/ronin/db/cli/command.rb +3 -0
  11. data/lib/ronin/db/cli/commands/asn.rb +1 -1
  12. data/lib/ronin/db/cli/commands/creds.rb +18 -18
  13. data/lib/ronin/db/cli/commands/migrate.rb +1 -1
  14. data/lib/ronin/db/cli/commands/urls.rb +6 -6
  15. data/lib/ronin/db/cli/resources_command.rb +0 -2
  16. data/lib/ronin/db/cli/uri_methods.rb +8 -3
  17. data/lib/ronin/db/cli.rb +5 -0
  18. data/lib/ronin/db/config_file.rb +2 -1
  19. data/lib/ronin/db/version.rb +1 -1
  20. data/lib/ronin/db.rb +6 -1
  21. data/man/ronin-db-add.1 +43 -12
  22. data/man/ronin-db-add.1.md +30 -10
  23. data/man/ronin-db-asn.1 +35 -3
  24. data/man/ronin-db-asn.1.md +25 -3
  25. data/man/ronin-db-creds.1 +34 -16
  26. data/man/ronin-db-creds.1.md +27 -16
  27. data/man/ronin-db-edit.1 +19 -12
  28. data/man/ronin-db-edit.1.md +15 -10
  29. data/man/ronin-db-emails.1 +35 -17
  30. data/man/ronin-db-emails.1.md +28 -17
  31. data/man/ronin-db-hosts.1 +32 -14
  32. data/man/ronin-db-hosts.1.md +25 -14
  33. data/man/ronin-db-ips.1 +35 -17
  34. data/man/ronin-db-ips.1.md +28 -17
  35. data/man/ronin-db-irb.1 +28 -12
  36. data/man/ronin-db-irb.1.md +19 -10
  37. data/man/ronin-db-list.1 +19 -12
  38. data/man/ronin-db-list.1.md +15 -10
  39. data/man/ronin-db-migrate.1 +34 -1
  40. data/man/ronin-db-migrate.1.md +24 -1
  41. data/man/ronin-db-remove.1 +19 -12
  42. data/man/ronin-db-remove.1.md +15 -10
  43. data/man/ronin-db-urls.1 +35 -17
  44. data/man/ronin-db-urls.1.md +28 -17
  45. data/ronin-db.gemspec +4 -3
  46. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a1e34813d6e31800174b9bf80798e088fcf8c0cc26f49f480d28f5ab38c31a7
4
- data.tar.gz: e977959fce2b57e7563bf037d431ba9ed2a16cf4d7c8b4da04bb606fab80b62d
3
+ metadata.gz: 5e20fde641f025149b699e70299af69f99289adf64e968fee91a49f9caf33ac1
4
+ data.tar.gz: b7b02264509ad9800f61320bc3a8042c34a7e9552e4c658c4d8d1c5a34dfac96
5
5
  SHA512:
6
- metadata.gz: da55ca64bf9f4a57972a7f657490b808ac77de8cc5b9dc5014942dd7a6be37bed29f2f9340520f4b4cf0068ed592cae87e340ee085a3772a8418a151fa12c083
7
- data.tar.gz: 752ec88041d604d14106bd14086cf3ca995621b58cbeb94fbe1a09f3ae52a481da96a7b056c72eb652971faac361580b294552db03ddaaff881bced2924722e7
6
+ metadata.gz: c83dc934afed20756221f7b54336c30e957e6a9849a5846bec7d068a81e1cf4a68c5bb098a57096bbba912da9353d9a2d9690374f1de024e38e71c2d420856cc
7
+ data.tar.gz: 1f62303657c9c113a2a4b14ce16e4f3849fb2f6f475757164e81b29cd431d9fa6ec43b6ad2e08737e14f40bf034036ff85bc06766a5a0cf126f3dea53e051232
data/.document CHANGED
@@ -2,4 +2,3 @@ lib/**/*.rb
2
2
  -
3
3
  ChangeLog.md
4
4
  COPYING.txt
5
- man/*.md
@@ -30,3 +30,17 @@ jobs:
30
30
  run: bundle install --jobs 4 --retry 3
31
31
  - name: Run tests
32
32
  run: bundle exec rake test
33
+
34
+ # rubocop linting
35
+ rubocop:
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: actions/checkout@v2
39
+ - name: Set up Ruby
40
+ uses: ruby/setup-ruby@v1
41
+ with:
42
+ ruby-version: 3.0
43
+ - name: Install dependencies
44
+ run: bundle install --jobs 4 --retry 3
45
+ - name: Run rubocop
46
+ run: bundle exec rubocop --parallel
data/.rubocop.yml ADDED
@@ -0,0 +1,16 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+ TargetRubyVersion: 3.1
5
+
6
+ inherit_gem:
7
+ rubocop-ronin: rubocop.yml
8
+
9
+ #
10
+ # ronin-db specific exceptions
11
+ #
12
+
13
+ # This looks like a rubocop bug.
14
+ Lint/ShadowingOuterLocalVariable:
15
+ Exclude:
16
+ - 'lib/ronin/db/cli/commands/list.rb'
data/ChangeLog.md CHANGED
@@ -1,4 +1,17 @@
1
- ### 0.1.0 / 2023-XX-XX
1
+ ### 0.1.2 / 2023-09-19
2
+
3
+ * Fixed a typo in an exception message in {Ronin::DB.connect}.
4
+ * Documentation fixes and improvements.
5
+
6
+ ### 0.1.1 / 2023-06-09
7
+
8
+ #### CLI
9
+
10
+ * Fixed typos in the `ronin-db add` man-page.
11
+ * Fixed typos in the `ronin-db creds` man-page.
12
+ * Fixed formatting of man-pages.
13
+
14
+ ### 0.1.0 / 2023-02-01
2
15
 
3
16
  * Initial release:
4
17
  * Uses a [sqlite] database by default.
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
@@ -8,11 +10,11 @@ gem 'jruby-openssl', '~> 0.7', platform: :jruby
8
10
  # branch: 'main'
9
11
 
10
12
  # Library dependencies
11
- # gem 'ronin-db-activerecord', '~> 0.1', github: "ronin-rb/ronin-db-activerecord",
13
+ # gem 'ronin-db-activerecord', '~> 0.1', github: 'ronin-rb/ronin-db-activerecord',
12
14
  # branch: 'main'
13
- # gem 'ronin-support', '~> 1.0', github: "ronin-rb/ronin-support",
15
+ # gem 'ronin-support', '~> 1.0', github: 'ronin-rb/ronin-support',
14
16
  # branch: '1.0.0'
15
- # gem 'ronin-core', '~> 0.1', github: "ronin-rb/ronin-core",
17
+ # gem 'ronin-core', '~> 0.1', github: 'ronin-rb/ronin-core',
16
18
  # branch: 'main'
17
19
 
18
20
  group :development do
@@ -31,4 +33,6 @@ group :development do
31
33
  gem 'dead_end', require: false
32
34
  gem 'sord', require: false, platform: :mri
33
35
  gem 'stackprof', require: false, platform: :mri
36
+ gem 'rubocop', require: false, platform: :mri
37
+ gem 'rubocop-ronin', require: false, platform: :mri
34
38
  end
data/README.md CHANGED
@@ -9,7 +9,6 @@
9
9
  * [Issues](https://github.com/ronin-rb/ronin-db/issues)
10
10
  * [Documentation](https://ronin-rb.dev/docs/ronin-db/frames)
11
11
  * [Discord](https://discord.gg/6WAb3PsVX9) |
12
- [Twitter](https://twitter.com/ronin_rb) |
13
12
  [Mastodon](https://infosec.exchange/@ronin_rb)
14
13
 
15
14
  ## Description
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
- require 'rubygems'
1
+ # frozen_string_literal: true
2
2
 
3
3
  begin
4
4
  require 'bundler'
5
5
  rescue LoadError => e
6
6
  warn e.message
7
7
  warn "Run `gem install bundler` to install Bundler"
8
- exit -1
8
+ exit(-1)
9
9
  end
10
10
 
11
11
  begin
@@ -35,7 +35,6 @@ task :docs => :yara
35
35
  require 'kramdown/man/task'
36
36
  Kramdown::Man::Task.new
37
37
 
38
-
39
38
  directory 'db'
40
39
  file 'db/dev.sqlite3' => %w[db db:migrate]
41
40
 
data/bin/ronin-db CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
  #
3
4
  # Copyright (c) 2021 Hal Brodigan (postmodern.mod3 at gmail.com)
4
5
  #
@@ -21,13 +22,11 @@
21
22
  root = File.expand_path(File.join(__dir__,'..'))
22
23
  if File.file?(File.join(root,'Gemfile.lock'))
23
24
  Dir.chdir(root) do
24
- begin
25
- require 'bundler/setup'
26
- rescue LoadError => e
27
- warn e.message
28
- warn "Run `gem install bundler` to install Bundler"
29
- exit -1
30
- end
25
+ require 'bundler/setup'
26
+ rescue LoadError => e
27
+ warn e.message
28
+ warn "Run `gem install bundler` to install Bundler"
29
+ exit(-1)
31
30
  end
32
31
  end
33
32
 
@@ -25,6 +25,9 @@ require 'ronin/core/cli/command'
25
25
  module Ronin
26
26
  module DB
27
27
  class CLI
28
+ #
29
+ # Base class for all `ronin-db` commands.
30
+ #
28
31
  class Command < Core::CLI::Command
29
32
 
30
33
  man_dir File.join(ROOT,'man')
@@ -61,7 +61,7 @@ module Ronin
61
61
 
62
62
  option :number, short: '-n',
63
63
  value: {
64
- type: Integer,
64
+ type: Integer
65
65
  },
66
66
  desc: 'Searches for all ASN records with the AS number' do |number|
67
67
  @query_method_calls << [:with_number, [number]]
@@ -26,11 +26,11 @@ module Ronin
26
26
  class CLI
27
27
  module Commands
28
28
  #
29
- # Queries all credentials in the database.
29
+ # Manages all credentials in the database.
30
30
  #
31
31
  # ## Usage
32
32
  #
33
- # ronin creds [options]
33
+ # ronin-db creds [options]
34
34
  #
35
35
  # ## Options
36
36
  #
@@ -41,8 +41,8 @@ module Ronin
41
41
  # --import FILE Imports the values from the FILE into the database
42
42
  # --delete VALUE Deletes a value from the database
43
43
  # --delete-all Deletes all values from the database
44
- # -u, --user [USER] Username to search for.
45
- # -p, --password [PASS] Password to search for.
44
+ # -u, --for-user USER Username to search for
45
+ # -p, --with-password PASSWORD Password to search for
46
46
  #
47
47
  class Creds < ModelCommand
48
48
 
@@ -51,25 +51,25 @@ module Ronin
51
51
  model_file 'ronin/db/credential'
52
52
  model_name 'Credential'
53
53
 
54
- option :user, short: '-u',
55
- value: {
56
- type: String,
57
- usage: 'USER'
58
- },
59
- desc: 'Username to search for' do |user|
60
- @query_method_calls << [:for_user, [user]]
61
- end
62
-
63
- option :password, short: '-P',
54
+ option :for_user, short: '-u',
64
55
  value: {
65
56
  type: String,
66
- usage: 'PASSWORD'
57
+ usage: 'USER'
67
58
  },
68
- desc: 'Password to search for' do |password|
69
- @query_method_calls << [:with_password, [password]]
59
+ desc: 'Username to search for' do |user|
60
+ @query_method_calls << [:for_user, [user]]
70
61
  end
71
62
 
72
- description 'Queries all credentials in the database'
63
+ option :with_password, short: '-P',
64
+ value: {
65
+ type: String,
66
+ usage: 'PASSWORD'
67
+ },
68
+ desc: 'Password to search for' do |password|
69
+ @query_method_calls << [:with_password, [password]]
70
+ end
71
+
72
+ description 'Manages all credentials in the database'
73
73
 
74
74
  man_page 'ronin-db-creds.1'
75
75
 
@@ -37,7 +37,7 @@ module Ronin
37
37
  # --db NAME The database to connect to (Default: default)
38
38
  # --db-uri URI The database URI to connect to
39
39
  # -h, --help Print help information
40
- #
40
+ #
41
41
  class Migrate < DatabaseCommand
42
42
 
43
43
  usage '[options]'
@@ -122,7 +122,7 @@ module Ronin
122
122
  option :query_string, short: '-q',
123
123
  value: {
124
124
  type: String,
125
- usage: 'STRING',
125
+ usage: 'STRING'
126
126
  },
127
127
  desc: 'Searches for all URLs with the query string' do |string|
128
128
  @query_method_calls << [:where, [], {query: string}]
@@ -136,11 +136,11 @@ module Ronin
136
136
  desc: 'Searches for the associated query-param NAME(s)' do |string|
137
137
  name, value = string.split('=',2)
138
138
 
139
- if value
140
- @query_method_calls << [:with_query_param, [name, value]]
141
- else
142
- @query_method_calls << [:with_query_param_name, [name]]
143
- end
139
+ @query_method_calls << if value
140
+ [:with_query_param, [name, value]]
141
+ else
142
+ [:with_query_param_name, [name]]
143
+ end
144
144
  end
145
145
 
146
146
  option :with_query_param_name, value: {
@@ -60,8 +60,6 @@ module Ronin
60
60
  end
61
61
  end
62
62
 
63
- protected
64
-
65
63
  #
66
64
  # Sets the model used by the command.
67
65
  #
@@ -24,6 +24,10 @@ require 'ronin/db'
24
24
  module Ronin
25
25
  module DB
26
26
  class CLI
27
+ #
28
+ # Mixin which adds methods for parsing database URIs
29
+ # (ex: `sqlite3:path/to/db.sqlite3`).
30
+ #
27
31
  module URIMethods
28
32
  # Common database adapter names and their ActiveRecord equivalents.
29
33
  ADAPTER_ALIASES = {
@@ -57,8 +61,8 @@ module Ronin
57
61
  # The expanded path or `":memory:"` if the path was `":memory:"`.
58
62
  #
59
63
  def normalize_sqlite3_path(path)
60
- if path== ':memory:' then path
61
- else File.expand_path(path)
64
+ if path == ':memory:' then path
65
+ else File.expand_path(path)
62
66
  end
63
67
  end
64
68
 
@@ -72,7 +76,7 @@ module Ronin
72
76
  # The database configuration Hash.
73
77
  #
74
78
  def parse_uri(uri)
75
- if (match = uri.match(/\Asqlite[3]?:(.+)\z/))
79
+ if (match = uri.match(/\Asqlite(?:3)?:(.+)\z/))
76
80
  {
77
81
  adapter: 'sqlite3',
78
82
  database: normalize_sqlite3_path(match[1])
@@ -82,6 +86,7 @@ module Ronin
82
86
  adapter = normalize_adapter(uri.scheme)
83
87
 
84
88
  hash = {adapter: adapter}
89
+
85
90
  hash[:host] = uri.host if uri.host
86
91
  hash[:port] = uri.port if uri.port
87
92
  hash[:username] = uri.user if uri.user
data/lib/ronin/db/cli.rb CHANGED
@@ -26,6 +26,11 @@ require 'command_kit/options/version'
26
26
 
27
27
  module Ronin
28
28
  module DB
29
+ #
30
+ # The `ronin-db` command-line interface (CLI).
31
+ #
32
+ # @api private
33
+ #
29
34
  class CLI
30
35
 
31
36
  include CommandKit::Commands
@@ -35,7 +35,8 @@ module Ronin
35
35
  # Path to the `~/.config/ronin-db/databases.yml` configuration file.
36
36
  PATH = File.join(DB::Home::CONFIG_DIR,'databases.yml')
37
37
 
38
- # Path to the default sqlite3 database file.
38
+ # Path to the default sqlite3 database file
39
+ # (`~/.local/share/ronin-db/default.sqlite3`).
39
40
  DEFAULT_DB_FILE = File.join(DB::Home::LOCAL_SHARE_DIR,'default.sqlite3')
40
41
 
41
42
  # Default database configuration.
@@ -21,6 +21,6 @@
21
21
  module Ronin
22
22
  module DB
23
23
  # ronin-db version
24
- VERSION = '0.1.0'
24
+ VERSION = '0.1.2'
25
25
  end
26
26
  end
data/lib/ronin/db.rb CHANGED
@@ -23,6 +23,9 @@ require 'ronin/db/config_file'
23
23
  require 'ronin/db/version'
24
24
 
25
25
  module Ronin
26
+ #
27
+ # Manages the Ronin database.
28
+ #
26
29
  module DB
27
30
  #
28
31
  # Sets up the Database logger.
@@ -83,8 +86,10 @@ module Ronin
83
86
  # Specifies whether to load all models or just connect to the database.
84
87
  #
85
88
  # @raise [UnknownDatabase]
89
+ # The database name was not listed in the config file.
86
90
  #
87
91
  # @raise [ArgumentError]
92
+ # The given database was not a Symbol or a Hash.
88
93
  #
89
94
  # @api semipublic
90
95
  #
@@ -97,7 +102,7 @@ module Ronin
97
102
  raise(UnknownDatabase,"unknown database: #{database.inspect}")
98
103
  end
99
104
  else
100
- raise(ArgumentError,"#{self.class}.#{__method__} only accepts a Symbol or a Hash")
105
+ raise(ArgumentError,"#{self}.#{__method__} only accepts a Symbol or a Hash")
101
106
  end
102
107
 
103
108
  # load activerecord
data/man/ronin-db-add.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-db-add 1 "2022-01-01" Ronin DB "User Manuals"
3
+ .TH ronin-db-add 1 "2023-02-01" Ronin DB "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -10,7 +10,8 @@
10
10
  .SH DESCRIPTION
11
11
  .LP
12
12
  .PP
13
- Lists entries in the \fB~/.config/ronin-db/database.yml\fR configuration file\.
13
+ Adds a pre\-existing database to the \fB~/.config/ronin-db/database.yml\fR
14
+ configuration file\.
14
15
  .LP
15
16
  .SH ARGUMENTS
16
17
  .LP
@@ -69,22 +70,52 @@ may be given instead\.
69
70
  \fB-h\fR, \fB--help\fR
70
71
  Print help information\.
71
72
  .LP
72
- .SH FILES
73
+ .SH EXAMPLES
73
74
  .LP
74
- .TP
75
- \fI\[ti]\[sl]\.config\[sl]ronin\-db\[sl]database\.yml\fP
76
- The \fBronin-db\fR database(s) configuration file\.
75
+ .PP
76
+ Add a sqlite3 database file:
77
77
  .LP
78
- .SH ENVIRONMENT
78
+ .nf
79
+ \[Do] ronin\-db add other\[ru]db \-\-sqlite3 path\[sl]to\[sl]db\.sqlite3
80
+ .fi
79
81
  .LP
80
82
  .PP
81
- HOME
82
- Specifies the home directory of the user\. Ronin will search for the
83
- \fI\[ti]\[sl]\.config\[sl]ronin\-db\fP cache directory within the home directory\.
83
+ Add a PostgeSQL database:
84
+ .LP
85
+ .nf
86
+ \[Do] ronin\-db add other\[ru]db \-\-postgres \-\-host example\.com \-\-port 5432 \-\-username ronin \-\-password s3r3t \-\-database ronin\[ru]db
87
+ .fi
84
88
  .LP
85
89
  .PP
86
- XDG\[ru]CONFIG\[ru]HOME
87
- Specifies the cache directory to use\. Defaults to \fI\[Do]HOME\[sl]\.config\fP\.
90
+ Add a MySQL database:
91
+ .LP
92
+ .nf
93
+ \[Do] ronin\-db add other\[ru]db \-\-mysql2 \-\-host example\.com \-\-port 3306 \-\-username ronin \-\-password s3r3t \-\-database ronin\[ru]db
94
+ .fi
95
+ .LP
96
+ .SH ENVIRONMENT
97
+ .LP
98
+ .TP
99
+ \fIHOME\fP
100
+ Alternate location for the user\[cq]s home directory\.
101
+ .LP
102
+ .TP
103
+ \fIXDG\[ru]CONFIG\[ru]HOME\fP
104
+ Alternate location for the \fB~/.config\fR directory\.
105
+ .LP
106
+ .TP
107
+ \fIXDG\[ru]DATA\[ru]HOME\fP
108
+ Alternate location for the \fB~/.local/share\fR directory\.
109
+ .LP
110
+ .SH FILES
111
+ .LP
112
+ .TP
113
+ \fB~/.local/share/ronin-db/database.sqlite3\fR
114
+ The default sqlite3 database file\.
115
+ .LP
116
+ .TP
117
+ \fB~/.config/ronin-db/database.yml\fR
118
+ Optional database configuration\.
88
119
  .LP
89
120
  .SH AUTHOR
90
121
  .LP
@@ -1,4 +1,4 @@
1
- # ronin-db-add 1 "2022-01-01" Ronin DB "User Manuals"
1
+ # ronin-db-add 1 "2023-02-01" Ronin DB "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -6,7 +6,8 @@
6
6
 
7
7
  ## DESCRIPTION
8
8
 
9
- Lists entries in the `~/.config/ronin-db/database.yml` configuration file.
9
+ Adds a pre-existing database to the `~/.config/ronin-db/database.yml`
10
+ configuration file.
10
11
 
11
12
  ## ARGUMENTS
12
13
 
@@ -52,19 +53,38 @@ Lists entries in the `~/.config/ronin-db/database.yml` configuration file.
52
53
  `-h`, `--help`
53
54
  Print help information.
54
55
 
55
- ## FILES
56
+ ## EXAMPLES
57
+
58
+ Add a sqlite3 database file:
59
+
60
+ $ ronin-db add other_db --sqlite3 path/to/db.sqlite3
61
+
62
+ Add a PostgeSQL database:
63
+
64
+ $ ronin-db add other_db --postgres --host example.com --port 5432 --username ronin --password s3r3t --database ronin_db
65
+
66
+ Add a MySQL database:
56
67
 
57
- *~/.config/ronin-db/database.yml*
58
- The `ronin-db` database(s) configuration file.
68
+ $ ronin-db add other_db --mysql2 --host example.com --port 3306 --username ronin --password s3r3t --database ronin_db
59
69
 
60
70
  ## ENVIRONMENT
61
71
 
62
- HOME
63
- Specifies the home directory of the user. Ronin will search for the
64
- *~/.config/ronin-db* cache directory within the home directory.
72
+ *HOME*
73
+ Alternate location for the user's home directory.
74
+
75
+ *XDG_CONFIG_HOME*
76
+ Alternate location for the `~/.config` directory.
77
+
78
+ *XDG_DATA_HOME*
79
+ Alternate location for the `~/.local/share` directory.
80
+
81
+ ## FILES
82
+
83
+ `~/.local/share/ronin-db/database.sqlite3`
84
+ The default sqlite3 database file.
65
85
 
66
- XDG_CONFIG_HOME
67
- Specifies the cache directory to use. Defaults to *$HOME/.config*.
86
+ `~/.config/ronin-db/database.yml`
87
+ Optional database configuration.
68
88
 
69
89
  ## AUTHOR
70
90
 
data/man/ronin-db-asn.1 CHANGED
@@ -1,6 +1,6 @@
1
1
  .\" Generated by kramdown-man 0.1.8
2
2
  .\" https://github.com/postmodern/kramdown-man#readme
3
- .TH ronin-db-asn 1 "April 2012" Ronin "User Manuals"
3
+ .TH ronin-db-asn 1 "2023-02-01" Ronin "User Manuals"
4
4
  .LP
5
5
  .SH SYNOPSIS
6
6
  .LP
@@ -20,8 +20,16 @@ The database name to connect to\. Defaults to \fBdefault\fR if not given\.
20
20
  .LP
21
21
  .TP
22
22
  \fB--db-uri\fR \fIURI\fP
23
- The explicit database URI to connect to
24
- (ex: \fBpostgres://user:password@host/db\fR)\.
23
+ The explicit database URI to connect to\.
24
+ .LP
25
+ .RS
26
+ .IP \(bu 2
27
+ \fBsqlite3\fP: \fBsqlite3:relative/path.db\fR or \fBsqlite3:///absolute/path.db\fR
28
+ .IP \(bu 2
29
+ \fBmysql\fP: \fBmysql://user:password@host/database\fR
30
+ .IP \(bu 2
31
+ \fBpostgres\fP: \fBpostgres://user:password@host/database\fR
32
+ .RE
25
33
  .LP
26
34
  .TP
27
35
  \fB-v\fR, \fB--verbose\fR
@@ -70,6 +78,30 @@ if not given\.
70
78
  \fB-h\fR, \fB--help\fR
71
79
  Print help information\.
72
80
  .LP
81
+ .SH ENVIRONMENT
82
+ .LP
83
+ .TP
84
+ \fIHOME\fP
85
+ Alternate location for the user\[cq]s home directory\.
86
+ .LP
87
+ .TP
88
+ \fIXDG\[ru]CONFIG\[ru]HOME\fP
89
+ Alternate location for the \fB~/.config\fR directory\.
90
+ .LP
91
+ .TP
92
+ \fIXDG\[ru]DATA\[ru]HOME\fP
93
+ Alternate location for the \fB~/.local/share\fR directory\.
94
+ .LP
95
+ .SH FILES
96
+ .LP
97
+ .TP
98
+ \fB~/.local/share/ronin-db/database.sqlite3\fR
99
+ The default sqlite3 database file\.
100
+ .LP
101
+ .TP
102
+ \fB~/.config/ronin-db/database.yml\fR
103
+ Optional database configuration\.
104
+ .LP
73
105
  .SH AUTHOR
74
106
  .LP
75
107
  .PP
@@ -1,4 +1,4 @@
1
- # ronin-db-asn 1 "April 2012" Ronin "User Manuals"
1
+ # ronin-db-asn 1 "2023-02-01" Ronin "User Manuals"
2
2
 
3
3
  ## SYNOPSIS
4
4
 
@@ -14,8 +14,11 @@ Queries or updates Autonomous System Numbers (ASNs) in the database.
14
14
  The database name to connect to. Defaults to `default` if not given.
15
15
 
16
16
  `--db-uri` *URI*
17
- The explicit database URI to connect to
18
- (ex: `postgres://user:password@host/db`).
17
+ The explicit database URI to connect to.
18
+
19
+ * **sqlite3**: `sqlite3:relative/path.db` or `sqlite3:///absolute/path.db`
20
+ * **mysql**: `mysql://user:password@host/database`
21
+ * **postgres**: `postgres://user:password@host/database`
19
22
 
20
23
  `-v`, `--verbose`
21
24
  Enables verbose output
@@ -53,6 +56,25 @@ Queries or updates Autonomous System Numbers (ASNs) in the database.
53
56
  `-h`, `--help`
54
57
  Print help information.
55
58
 
59
+ ## ENVIRONMENT
60
+
61
+ *HOME*
62
+ Alternate location for the user's home directory.
63
+
64
+ *XDG_CONFIG_HOME*
65
+ Alternate location for the `~/.config` directory.
66
+
67
+ *XDG_DATA_HOME*
68
+ Alternate location for the `~/.local/share` directory.
69
+
70
+ ## FILES
71
+
72
+ `~/.local/share/ronin-db/database.sqlite3`
73
+ The default sqlite3 database file.
74
+
75
+ `~/.config/ronin-db/database.yml`
76
+ Optional database configuration.
77
+
56
78
  ## AUTHOR
57
79
 
58
80
  Postmodern <postmodern.mod3@gmail.com>