mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
fix(CORE): another attempt to fix the dbimport command line warning (#13449)
This commit is contained in:
@@ -47,6 +47,7 @@ RUN addgroup --gid $GROUP_ID acore && \
|
|||||||
RUN mkdir -p /azerothcore/env/dist/bin
|
RUN mkdir -p /azerothcore/env/dist/bin
|
||||||
RUN mkdir -p /azerothcore/env/dist/data
|
RUN mkdir -p /azerothcore/env/dist/data
|
||||||
RUN mkdir -p /azerothcore/env/dist/logs
|
RUN mkdir -p /azerothcore/env/dist/logs
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/temp
|
||||||
RUN mkdir -p /azerothcore/env/dist/etc
|
RUN mkdir -p /azerothcore/env/dist/etc
|
||||||
RUN mkdir -p /azerothcore/var/build/obj
|
RUN mkdir -p /azerothcore/var/build/obj
|
||||||
|
|
||||||
|
|||||||
2
env/docker/etc/authserver.conf.dockerdist
vendored
2
env/docker/etc/authserver.conf.dockerdist
vendored
@@ -6,6 +6,8 @@
|
|||||||
# Do not change this
|
# Do not change this
|
||||||
# Files in LogsDir will reflect on your host directory: docker/authserver/logs
|
# Files in LogsDir will reflect on your host directory: docker/authserver/logs
|
||||||
LogsDir = "/azerothcore/env/dist/logs"
|
LogsDir = "/azerothcore/env/dist/logs"
|
||||||
|
# Files in TempDir will reflect on your host directory: docker/authserver/temp
|
||||||
|
TempDir = "/azerothcore/env/dist/temp"
|
||||||
|
|
||||||
# Change this configuration accordingly with your docker setup
|
# Change this configuration accordingly with your docker setup
|
||||||
# The format is "hostname;port;username;password;database":
|
# The format is "hostname;port;username;password;database":
|
||||||
|
|||||||
2
env/docker/etc/dbimport.conf.dockerdist
vendored
2
env/docker/etc/dbimport.conf.dockerdist
vendored
@@ -1,6 +1,8 @@
|
|||||||
# Do NOT change those Dir configs
|
# Do NOT change those Dir configs
|
||||||
# Files in LogsDir will reflect on your host directory: docker/worldserver/logs
|
# Files in LogsDir will reflect on your host directory: docker/worldserver/logs
|
||||||
LogsDir = "/azerothcore/env/dist/logs"
|
LogsDir = "/azerothcore/env/dist/logs"
|
||||||
|
# Files in TempDir will reflect on your host directory: docker/authserver/temp
|
||||||
|
TempDir = "/azerothcore/env/dist/temp"
|
||||||
DataDir = "/azerothcore/env/dist/data"
|
DataDir = "/azerothcore/env/dist/data"
|
||||||
|
|
||||||
# Change this configuration accordingly with your docker setup
|
# Change this configuration accordingly with your docker setup
|
||||||
|
|||||||
2
env/docker/etc/worldserver.conf.dockerdist
vendored
2
env/docker/etc/worldserver.conf.dockerdist
vendored
@@ -6,6 +6,8 @@
|
|||||||
# Do NOT change those Dir configs
|
# Do NOT change those Dir configs
|
||||||
# Files in LogsDir will reflect on your host directory: docker/worldserver/logs
|
# Files in LogsDir will reflect on your host directory: docker/worldserver/logs
|
||||||
LogsDir = "/azerothcore/env/dist/logs"
|
LogsDir = "/azerothcore/env/dist/logs"
|
||||||
|
# Files in TempDir will reflect on your host directory: docker/authserver/temp
|
||||||
|
TempDir = "/azerothcore/env/dist/temp"
|
||||||
DataDir = "/azerothcore/env/dist/data"
|
DataDir = "/azerothcore/env/dist/data"
|
||||||
|
|
||||||
# Change this configuration accordingly with your docker setup
|
# Change this configuration accordingly with your docker setup
|
||||||
|
|||||||
@@ -64,5 +64,19 @@ std::string Acore::String::TrimRightInPlace(std::string& str)
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Util function to add a suffix char. Can be used to add a slash at the end of a path
|
||||||
|
*
|
||||||
|
* @param str String where to apply the suffix
|
||||||
|
* @param suffix Character to add at the end of the str
|
||||||
|
* @return std::string Suffixed string
|
||||||
|
*/
|
||||||
|
std::string Acore::String::AddSuffixIfNotExists(std::string str, const char suffix) {
|
||||||
|
if (str.empty() || (str.at(str.length() - 1) != suffix))
|
||||||
|
str.push_back(suffix);
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
// Template Trim
|
// Template Trim
|
||||||
template AC_COMMON_API std::string Acore::String::Trim<std::string>(const std::string& s, const std::locale& loc /*= std::locale()*/);
|
template AC_COMMON_API std::string Acore::String::Trim<std::string>(const std::string& s, const std::locale& loc /*= std::locale()*/);
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ namespace Acore::String
|
|||||||
AC_COMMON_API Str Trim(const Str& s, const std::locale& loc = std::locale());
|
AC_COMMON_API Str Trim(const Str& s, const std::locale& loc = std::locale());
|
||||||
|
|
||||||
AC_COMMON_API std::string TrimRightInPlace(std::string& str);
|
AC_COMMON_API std::string TrimRightInPlace(std::string& str);
|
||||||
|
|
||||||
|
AC_COMMON_API std::string AddSuffixIfNotExists(std::string str, const char suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ SourceDirectory = ""
|
|||||||
# Description: The path to your MySQL CLI binary.
|
# Description: The path to your MySQL CLI binary.
|
||||||
# If the path is left empty, built-in path from cmake is used.
|
# If the path is left empty, built-in path from cmake is used.
|
||||||
# Example: "C:/Program Files/MariaDB 10.5/bin/mysql.exe"
|
# Example: "C:/Program Files/MariaDB 10.5/bin/mysql.exe"
|
||||||
# "C:/Program Files/MySQL/MySQL Server 5.6/bin/mysql.exe"
|
# "C:/Program Files/MySQL/MySQL Server 8.0/bin/mysql.exe"
|
||||||
# "mysql.exe"
|
# "mysql.exe"
|
||||||
# "/usr/bin/mysql"
|
# "/usr/bin/mysql"
|
||||||
# Default: ""
|
# Default: ""
|
||||||
@@ -175,6 +175,16 @@ SourceDirectory = ""
|
|||||||
|
|
||||||
MySQLExecutable = ""
|
MySQLExecutable = ""
|
||||||
|
|
||||||
|
#
|
||||||
|
# TempDir
|
||||||
|
# Description: Temp directory setting.
|
||||||
|
# Important: TempDir needs to be quoted, as the string might contain space characters.
|
||||||
|
# TempDir directory must exists, or the server can't work properly
|
||||||
|
# Example: "/home/youruser/azerothcore/temp"
|
||||||
|
# Default: "" - (Temp files will be stored in the current path)
|
||||||
|
|
||||||
|
TempDir = ""
|
||||||
|
|
||||||
#
|
#
|
||||||
# IPLocationFile
|
# IPLocationFile
|
||||||
# Description: The path to your IP2Location database CSV file.
|
# Description: The path to your IP2Location database CSV file.
|
||||||
|
|||||||
@@ -81,6 +81,16 @@ DataDir = "."
|
|||||||
|
|
||||||
LogsDir = ""
|
LogsDir = ""
|
||||||
|
|
||||||
|
#
|
||||||
|
# TempDir
|
||||||
|
# Description: Temp directory setting.
|
||||||
|
# Important: TempDir needs to be quoted, as the string might contain space characters.
|
||||||
|
# TempDir directory must exists, or the server can't work properly
|
||||||
|
# Example: "/home/youruser/azerothcore/temp"
|
||||||
|
# Default: "" - (Temp files will be stored in the current path)
|
||||||
|
|
||||||
|
TempDir = ""
|
||||||
|
|
||||||
#
|
#
|
||||||
# LoginDatabaseInfo
|
# LoginDatabaseInfo
|
||||||
# WorldDatabaseInfo
|
# WorldDatabaseInfo
|
||||||
@@ -193,7 +203,7 @@ SourceDirectory = ""
|
|||||||
# MySQLExecutable
|
# MySQLExecutable
|
||||||
# Description: The path to your MySQL CLI binary.
|
# Description: The path to your MySQL CLI binary.
|
||||||
# If the path is left empty, built-in path from cmake is used.
|
# If the path is left empty, built-in path from cmake is used.
|
||||||
# Example: "C:/Program Files/MySQL/MySQL Server 5.7/bin/mysql.exe"
|
# Example: "C:/Program Files/MySQL/MySQL Server 8.0/bin/mysql.exe"
|
||||||
# "mysql.exe"
|
# "mysql.exe"
|
||||||
# "/usr/bin/mysql"
|
# "/usr/bin/mysql"
|
||||||
# Default: ""
|
# Default: ""
|
||||||
|
|||||||
@@ -442,16 +442,29 @@ template<class T>
|
|||||||
void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& host, std::string const& user,
|
void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& host, std::string const& user,
|
||||||
std::string const& password, std::string const& port_or_socket, std::string const& database, std::string const& ssl, Path const& path)
|
std::string const& password, std::string const& port_or_socket, std::string const& database, std::string const& ssl, Path const& path)
|
||||||
{
|
{
|
||||||
|
std::string configTempDir = sConfigMgr->GetOption<std::string>("TempDir", "");
|
||||||
|
|
||||||
|
auto tempDir = configTempDir.empty() ? std::filesystem::temp_directory_path().string() : configTempDir;
|
||||||
|
|
||||||
|
tempDir = Acore::String::AddSuffixIfNotExists(tempDir, std::filesystem::path::preferred_separator);
|
||||||
|
|
||||||
|
std::string confFileName = "mysql_ac.conf";
|
||||||
|
|
||||||
|
std::ofstream outfile (tempDir + confFileName);
|
||||||
|
|
||||||
|
outfile << "[client]\npassword = \"" << password << '"' << std::endl;
|
||||||
|
|
||||||
|
outfile.close();
|
||||||
|
|
||||||
std::vector<std::string> args;
|
std::vector<std::string> args;
|
||||||
args.reserve(9);
|
args.reserve(9);
|
||||||
|
|
||||||
|
args.emplace_back("--defaults-extra-file="+tempDir + confFileName+"");
|
||||||
|
|
||||||
// CLI Client connection info
|
// CLI Client connection info
|
||||||
args.emplace_back("-h" + host);
|
args.emplace_back("-h" + host);
|
||||||
args.emplace_back("-u" + user);
|
args.emplace_back("-u" + user);
|
||||||
|
|
||||||
if (!password.empty())
|
|
||||||
args.emplace_back("-p" + password);
|
|
||||||
|
|
||||||
// Check if we want to connect through ip or socket (Unix only)
|
// Check if we want to connect through ip or socket (Unix only)
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,17 @@ SourceDirectory = ""
|
|||||||
#
|
#
|
||||||
|
|
||||||
MySQLExecutable = ""
|
MySQLExecutable = ""
|
||||||
|
|
||||||
|
#
|
||||||
|
# TempDir
|
||||||
|
# Description: Temp directory setting.
|
||||||
|
# Important: TempDir needs to be quoted, as the string might contain space characters.
|
||||||
|
# TempDir directory must exists, or the server can't work properly
|
||||||
|
# Example: "/home/youruser/azerothcore/temp"
|
||||||
|
# Default: "" - (Temp files will be stored in the current path)
|
||||||
|
|
||||||
|
TempDir = ""
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user