ronin-db 0.1.2-java → 0.1.3-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +2 -2
- data/ChangeLog.md +5 -0
- data/lib/ronin/db/config_file.rb +12 -7
- data/lib/ronin/db/exceptions.rb +9 -0
- data/lib/ronin/db/version.rb +1 -1
- data/lib/ronin/db.rb +9 -0
- data/man/ronin-db-add.1 +2 -2
- data/man/ronin-db-asn.1 +2 -2
- data/man/ronin-db-creds.1 +2 -2
- data/man/ronin-db-edit.1 +2 -2
- data/man/ronin-db-emails.1 +3 -3
- data/man/ronin-db-hosts.1 +2 -2
- data/man/ronin-db-ips.1 +2 -2
- data/man/ronin-db-irb.1 +2 -2
- data/man/ronin-db-list.1 +2 -2
- data/man/ronin-db-migrate.1 +2 -2
- data/man/ronin-db-remove.1 +2 -2
- data/man/ronin-db-urls.1 +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f6e27ff78808feb23e2ecc4b6c312b2e399cea35f836b96bab022af31a46a9e
|
4
|
+
data.tar.gz: 610600e31740724b9ad1f41dd38e947229dde19f0d66d5abd7f16c033b472918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60dc49d5d5e2acf6702f26e87ac033224563e8c8e542f37f8500f80c318afbcf08fbf77c3ad4bb8f13758fcb2cebbfe77a25d17a7d6cbde7caff716fcdc5c314
|
7
|
+
data.tar.gz: d8cda3a4d0d908de6f17df9f1d2af5a79d590c64c0f4e487a887198130bc095d56186ad61b31b799153f61d1e646ec810847204901580af153eddfdf992180c4
|
data/.github/workflows/ruby.yml
CHANGED
@@ -16,7 +16,7 @@ jobs:
|
|
16
16
|
- truffleruby
|
17
17
|
name: Ruby ${{ matrix.ruby }}
|
18
18
|
steps:
|
19
|
-
- uses: actions/checkout@
|
19
|
+
- uses: actions/checkout@v4
|
20
20
|
- name: Set up Ruby
|
21
21
|
uses: ruby/setup-ruby@v1
|
22
22
|
with:
|
@@ -35,7 +35,7 @@ jobs:
|
|
35
35
|
rubocop:
|
36
36
|
runs-on: ubuntu-latest
|
37
37
|
steps:
|
38
|
-
- uses: actions/checkout@
|
38
|
+
- uses: actions/checkout@v4
|
39
39
|
- name: Set up Ruby
|
40
40
|
uses: ruby/setup-ruby@v1
|
41
41
|
with:
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
### 0.1.3 / 2023-12-13
|
2
|
+
|
3
|
+
* Fixed a bug in {Ronin::DB::ConfigFile.edit} when `YAML::Store` would attempt
|
4
|
+
to create the config file but the parent directory did not exist yet.
|
5
|
+
|
1
6
|
### 0.1.2 / 2023-09-19
|
2
7
|
|
3
8
|
* Fixed a typo in an exception message in {Ronin::DB.connect}.
|
data/lib/ronin/db/config_file.rb
CHANGED
@@ -21,6 +21,7 @@
|
|
21
21
|
require 'ronin/db/exceptions'
|
22
22
|
require 'ronin/db/home'
|
23
23
|
|
24
|
+
require 'fileutils'
|
24
25
|
require 'yaml'
|
25
26
|
require 'yaml/store'
|
26
27
|
|
@@ -65,21 +66,21 @@ module Ronin
|
|
65
66
|
#
|
66
67
|
def self.validate(path,data)
|
67
68
|
unless data.kind_of?(Hash)
|
68
|
-
raise(InvalidConfig)
|
69
|
+
raise(InvalidConfig,"config data must be a Hash: #{data.inspect}")
|
69
70
|
end
|
70
71
|
|
71
72
|
data.each do |key,value|
|
72
|
-
unless
|
73
|
-
raise(InvalidConfig)
|
73
|
+
unless key.kind_of?(Symbol)
|
74
|
+
raise(InvalidConfig,"all Hash keys must be a Symbol: #{key.inspect}")
|
74
75
|
end
|
75
76
|
|
76
77
|
unless value.kind_of?(Hash)
|
77
|
-
raise(InvalidConfig)
|
78
|
+
raise(InvalidConfig,"all Hash values must also be a Hash: #{value.inspect}")
|
78
79
|
end
|
79
80
|
|
80
81
|
value.each_key do |sub_key|
|
81
|
-
unless
|
82
|
-
raise(InvalidConfig)
|
82
|
+
unless sub_key.kind_of?(Symbol)
|
83
|
+
raise(InvalidConfig,"all sub-keys must be a Symbol: #{sub_key.inspect}")
|
83
84
|
end
|
84
85
|
end
|
85
86
|
end
|
@@ -124,8 +125,12 @@ module Ronin
|
|
124
125
|
# The loaded YAML configuration data.
|
125
126
|
#
|
126
127
|
def self.edit(path=PATH,&block)
|
127
|
-
|
128
|
+
unless File.file?(path)
|
129
|
+
# create the parent directory for YAML::Store
|
130
|
+
FileUtils.mkdir_p(File.dirname(path))
|
131
|
+
end
|
128
132
|
|
133
|
+
store = YAML::Store.new(path)
|
129
134
|
store.transaction(&block)
|
130
135
|
end
|
131
136
|
end
|
data/lib/ronin/db/exceptions.rb
CHANGED
@@ -20,7 +20,16 @@
|
|
20
20
|
|
21
21
|
module Ronin
|
22
22
|
module DB
|
23
|
+
#
|
24
|
+
# Indicates that the given database name is not in the config file.
|
25
|
+
#
|
23
26
|
class UnknownDatabase < RuntimeError
|
24
27
|
end
|
28
|
+
|
29
|
+
#
|
30
|
+
# Indicates that the config file is corrupted.
|
31
|
+
#
|
32
|
+
class InvalidConfig < RuntimeError
|
33
|
+
end
|
25
34
|
end
|
26
35
|
end
|
data/lib/ronin/db/version.rb
CHANGED
data/lib/ronin/db.rb
CHANGED
@@ -91,6 +91,15 @@ module Ronin
|
|
91
91
|
# @raise [ArgumentError]
|
92
92
|
# The given database was not a Symbol or a Hash.
|
93
93
|
#
|
94
|
+
# @example Connect to the default database (`~/.local/share/ronin-db/default.sqlite3`):
|
95
|
+
# DB.connect
|
96
|
+
#
|
97
|
+
# @example Connect to a specific database from the configuration file (`~/.config/ronin-db/databases.yml`):
|
98
|
+
# DB.connect(:my_database)
|
99
|
+
#
|
100
|
+
# @example Connect to an arbitrary database:
|
101
|
+
# Db.connect({adapter: 'sqlite3', database: '/path/to/database.sqlite3'})
|
102
|
+
#
|
94
103
|
# @api semipublic
|
95
104
|
#
|
96
105
|
def self.connect(database=:default, migrate: nil, load_models: true)
|
data/man/ronin-db-add.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-add 1 "2023-02-01" Ronin DB "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db add\fR \[lB]\fIoptions\fP\[rB] \fINAME\fP \[lB]\fIURI\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-asn.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-asn 1 "2023-02-01" Ronin "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db asn\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-creds.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-creds 1 "2023-01-02" Ronin "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db creds\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-edit.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-edit 1 "2023-02-01" Ronin DB "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db edit\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-emails.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-emails 1 "2023-02-01" Ronin "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db emails\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
@@ -59,7 +59,7 @@ Searches for email addresses associated with the \fIHOST\fP\.
|
|
59
59
|
\fB-I\fR, \fB--with-ip\fR \fIIP\fP
|
60
60
|
Searches for email addresses associated with the IP address\.
|
61
61
|
.LP
|
62
|
-
.
|
62
|
+
.PP
|
63
63
|
\fB-u\fR, \fB--with-users\fR \fINAME\fP \[lB]\.\.\.\[rB]
|
64
64
|
Searches for email addresses associated with the user NAME(s)\.
|
65
65
|
.LP
|
data/man/ronin-db-hosts.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-hosts 1 "2023-02-01" Ronin "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db hosts\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-ips.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-ips 1 "2023-02-01" Ronin "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db ips\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-irb.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-irb 1 "2023-02-01" Ronin DB "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db irb\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-list.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-list 1 "2023-02-01" Ronin DB "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db list\fR \[lB]\fIoptions\fP\[rB] \[lB]\fINAME\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-migrate.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-migrate 1 "2023-02-01" Ronin DB "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db migrate\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-remove.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-remove 1 "2023-02-01" Ronin DB "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db remove\fR \[lB]\fIoptions\fP\[rB] \fINAME\fP
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
data/man/ronin-db-urls.1
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
.\" Generated by kramdown-man 0.1.
|
1
|
+
.\" Generated by kramdown-man 0.1.9
|
2
2
|
.\" https://github.com/postmodern/kramdown-man#readme
|
3
3
|
.TH ronin-db-urls 1 "2023-02-01" Ronin "User Manuals"
|
4
4
|
.LP
|
5
5
|
.SH SYNOPSIS
|
6
6
|
.LP
|
7
|
-
.
|
7
|
+
.PP
|
8
8
|
\fBronin-db urls\fR \[lB]\fIoptions\fP\[rB]
|
9
9
|
.LP
|
10
10
|
.SH DESCRIPTION
|
@@ -71,11 +71,11 @@ Searches for URLs associated with the \fIPORT\fP\.
|
|
71
71
|
\fB-d\fR, \fB--directory\fR \fIDIRECTORY\fP
|
72
72
|
Searches for URLs sharing the DIRECTORY\.
|
73
73
|
.LP
|
74
|
-
.
|
74
|
+
.PP
|
75
75
|
\fB-q\fR, \fB--with-query-param\fR \fINAME\fP \[lB]\.\.\.\[rB]
|
76
76
|
Searches for URLs containing the query\-param NAME\.
|
77
77
|
.LP
|
78
|
-
.
|
78
|
+
.PP
|
79
79
|
\fB-Q\fR, \fB--with-query-value\fR \fIVALUE\fP \[lB]\.\.\.\[rB]
|
80
80
|
Searches for URLs containing the query\-param VALUE\.
|
81
81
|
.LP
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ronin-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|