Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For databases, especially mysql, connect over 127.0.0.1 IP address #522

Merged
merged 1 commit into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/drupal_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module ClassMethods
DEFAULTS = {
"engine" => "mysql",
"password" => "",
"host" => "localhost",
"host" => "127.0.0.1",
"prefix" => "",
"port" => "3306",
"types" => %w(blog story article),
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/easyblog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.process(options)
dbname = options.fetch("dbname")
user = options.fetch("user")
pass = options.fetch("password", "")
host = options.fetch("host", "localhost")
host = options.fetch("host", "127.0.0.1")
section = options.fetch("section", "1")
table_prefix = options.fetch("prefix", "jos_")

Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/joomla.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def self.process(options)
dbname = options.fetch("dbname")
user = options.fetch("user")
pass = options.fetch("password", "")
host = options.fetch("host", "localhost")
host = options.fetch("host", "127.0.0.1")
port = options.fetch("port", 3306).to_i
section = options.fetch("section", "1")
table_prefix = options.fetch("prefix", "jos_")
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/joomla3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def self.process(options)
dbname = options.fetch("dbname")
user = options.fetch("user")
pass = options.fetch("password", "")
host = options.fetch("host", "localhost")
host = options.fetch("host", "127.0.0.1")
port = options.fetch("port", 3306).to_i
cid = options.fetch("category", 0)
table_prefix = options.fetch("prefix", "jos_")
Expand Down
4 changes: 2 additions & 2 deletions lib/jekyll-import/importers/mephisto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.postgres(c)
COPY jekyll TO STDOUT WITH CSV HEADER;
ROLLBACK;
SQL
command = %(psql -h #{c[:host] || "localhost"} -c "#{sql.strip}" #{c[:database]} #{c[:username]} -o #{c[:filename] || "posts.csv"})
command = %(psql -h #{c[:host] || "127.0.0.1"} -c "#{sql.strip}" #{c[:database]} #{c[:username]} -o #{c[:filename] || "posts.csv"})
Jekyll.logger.info "Executing:", command
`#{command}`
CSV.process
Expand Down Expand Up @@ -61,7 +61,7 @@ def self.process(options)
dbname = options.fetch("dbname")
user = options.fetch("user")
pass = options.fetch("password", "")
host = options.fetch("host", "localhost")
host = options.fetch("host", "127.0.0.1")

db = Sequel.mysql2(dbname, :user => user,
:password => pass,
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/mt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def self.database_from_opts(options)
Sequel.sqlite(dbname)
when "mysql", "postgres"
db_connect_opts = {
:host => options.fetch("host", "localhost"),
:host => options.fetch("host", "127.0.0.1"),
:user => options.fetch("user"),
:password => options.fetch("password", ""),
}
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/roller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def self.process(opts)
options = {
:user => opts.fetch("user", ""),
:pass => opts.fetch("password", ""),
:host => opts.fetch("host", "localhost"),
:host => opts.fetch("host", "127.0.0.1"),
:port => opts.fetch("port", "3306"),
:socket => opts.fetch("socket", nil),
:dbname => opts.fetch("dbname", ""),
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/s9y_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def self.process(opts)
options = {
:user => opts.fetch("user", ""),
:pass => opts.fetch("password", ""),
:host => opts.fetch("host", "localhost"),
:host => opts.fetch("host", "127.0.0.1"),
:port => opts.fetch("port", 3306),
:socket => opts.fetch("socket", nil),
:dbname => opts.fetch("dbname", ""),
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/textpattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def self.process(options)
dbname = options.fetch("dbname")
user = options.fetch("user")
pass = options.fetch("password", "")
host = options.fetch("host", "localhost")
host = options.fetch("host", "127.0.0.1")

db = Sequel.mysql2(dbname, :user => user, :password => pass, :host => host, :encoding => "utf8")

Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/typo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.process(options)
dbname = options.fetch("dbname")
user = options.fetch("user")
pass = options.fetch("password", "")
host = options.fetch("host", "localhost")
host = options.fetch("host", "127.0.0.1")

FileUtils.mkdir_p "_posts"
case server.intern
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/wordpress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def self.process(opts)
options = {
:user => opts.fetch("user", ""),
:pass => opts.fetch("password", ""),
:host => opts.fetch("host", "localhost"),
:host => opts.fetch("host", "127.0.0.1"),
:port => opts.fetch("port", "3306"),
:socket => opts.fetch("socket", nil),
:dbname => opts.fetch("dbname", ""),
Expand Down