مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2026-03-03 14:24:06 +00:00
Compare commits
3 الالتزامات
| المؤلف | SHA1 | التاريخ | |
|---|---|---|---|
|
|
304828a672 | ||
|
|
4528a14d27 | ||
|
|
96ba4b8f30 |
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
".": "2.2.0"
|
".": "2.2.1"
|
||||||
}
|
}
|
||||||
|
|||||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -2,6 +2,18 @@
|
|||||||
|
|
||||||
This file contains all the latest changes and updates to Postal.
|
This file contains all the latest changes and updates to Postal.
|
||||||
|
|
||||||
|
## [2.2.1](https://github.com/postalserver/postal/compare/2.2.0...2.2.1) (2024-02-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* fixes issue starting application in production mode ([4528a14](https://github.com/postalserver/postal/commit/4528a14d273c141e5719f19c3b08c00364b47638))
|
||||||
|
|
||||||
|
|
||||||
|
### Code Refactoring
|
||||||
|
|
||||||
|
* remove Postal.database_url ([96ba4b8](https://github.com/postalserver/postal/commit/96ba4b8f309cfcd1d605e5c7fc05507b21c78c6f))
|
||||||
|
|
||||||
## [2.2.0](https://github.com/postalserver/postal/compare/2.1.6...2.2.0) (2024-02-01)
|
## [2.2.0](https://github.com/postalserver/postal/compare/2.1.6...2.2.0) (2024-02-01)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,18 @@
|
|||||||
|
default: &default
|
||||||
|
adapter: mysql2
|
||||||
|
encoding: <%= Postal.config.main_db.encoding %>
|
||||||
|
pool: <%= Postal.config.main_db.pool_size %>
|
||||||
|
username: <%= Postal.config.main_db.username %>
|
||||||
|
password: <%= Postal.config.main_db.password %>
|
||||||
|
host: <%= Postal.config.main_db.host %>
|
||||||
|
port: <%= Postal.config.main_db.port %>
|
||||||
|
database: <%= Postal.config.main_db.database %>
|
||||||
|
|
||||||
development:
|
development:
|
||||||
url: <%= Postal.database_url %>
|
<<: *default
|
||||||
|
|
||||||
production:
|
production:
|
||||||
url: <%= Postal.database_url %>
|
<<: *default
|
||||||
|
|
||||||
test:
|
test:
|
||||||
url: <%= Postal.database_url %>
|
<<: *default
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|||||||
|
|
||||||
inflect.acronym "API"
|
inflect.acronym "API"
|
||||||
inflect.acronym "DNS"
|
inflect.acronym "DNS"
|
||||||
|
inflect.acronym "MySQL"
|
||||||
|
|
||||||
inflect.acronym "DB"
|
inflect.acronym "DB"
|
||||||
inflect.acronym "IP"
|
inflect.acronym "IP"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ main_db:
|
|||||||
password: <%= ENV.fetch('MAIN_DB_PASSWORD', '') %>
|
password: <%= ENV.fetch('MAIN_DB_PASSWORD', '') %>
|
||||||
database: <%= ENV.fetch('MAIN_DB_DATABASE', 'postal') %>
|
database: <%= ENV.fetch('MAIN_DB_DATABASE', 'postal') %>
|
||||||
pool_size: <%= ENV.fetch('MAIN_DB_POOL_SIZE', '5') %>
|
pool_size: <%= ENV.fetch('MAIN_DB_POOL_SIZE', '5') %>
|
||||||
|
encoding: <%= ENV.fetch('MAIN_DB_ENCODING', 'utf8mb4') %>
|
||||||
|
|
||||||
message_db:
|
message_db:
|
||||||
host: <%= ENV.fetch('MESSAGE_DB_HOST', '127.0.0.1') %>
|
host: <%= ENV.fetch('MESSAGE_DB_HOST', '127.0.0.1') %>
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ require_relative "version"
|
|||||||
|
|
||||||
module Postal
|
module Postal
|
||||||
|
|
||||||
|
class Config
|
||||||
|
end
|
||||||
|
|
||||||
def self.host
|
def self.host
|
||||||
@host ||= config.web.host || "localhost:5000"
|
@host ||= config.web.host || "localhost:5000"
|
||||||
end
|
end
|
||||||
@@ -86,14 +89,6 @@ module Postal
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.database_url
|
|
||||||
if config.main_db
|
|
||||||
"mysql2://#{CGI.escape(config.main_db.username.to_s)}:#{CGI.escape(config.main_db.password.to_s)}@#{config.main_db.host}:#{config.main_db.port}/#{config.main_db.database}?reconnect=true&encoding=#{config.main_db.encoding || 'utf8mb4'}&pool=#{config.main_db.pool_size}"
|
|
||||||
else
|
|
||||||
"mysql2://root@localhost/postal"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.logger_for(name)
|
def self.logger_for(name)
|
||||||
@loggers ||= {}
|
@loggers ||= {}
|
||||||
@loggers[name.to_sym] ||= begin
|
@loggers[name.to_sym] ||= begin
|
||||||
|
|||||||
@@ -7,7 +7,13 @@ module Postal
|
|||||||
# it would be undesirable as we'd just end up with lots of connections.
|
# it would be undesirable as we'd just end up with lots of connections.
|
||||||
|
|
||||||
def self.new_client
|
def self.new_client
|
||||||
Mysql2::Client.new(host: Postal.config.message_db.host, username: Postal.config.message_db.username, password: Postal.config.message_db.password, port: Postal.config.message_db.port, reconnect: true, encoding: Postal.config.message_db.encoding || "utf8mb4")
|
Mysql2::Client.new(
|
||||||
|
host: Postal.config.message_db.host,
|
||||||
|
username: Postal.config.message_db.username,
|
||||||
|
password: Postal.config.message_db.password,
|
||||||
|
port: Postal.config.message_db.port,
|
||||||
|
encoding: Postal.config.message_db.encoding || "utf8mb4"
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@free_clients = []
|
@free_clients = []
|
||||||
|
|||||||
@@ -11,4 +11,6 @@ module Postal
|
|||||||
VERSION
|
VERSION
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Version = VERSION
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم