MAJRO CHANGES!@!!@#

This commit is contained in:
j
2025-12-29 23:35:57 +13:00
parent a183b6814a
commit 7a406168e7
6 changed files with 121 additions and 17 deletions

View File

@@ -32,12 +32,6 @@ namespace dropshell
return (servicepath.empty() ? "" : (fs::path(servicepath) / filenames::service_env).string());
}
std::string template_info_env(const std::string &server_name, const std::string &service_name)
{
std::string servicepath = localpath::service(server_name, service_name);
return (servicepath.empty() ? "" : (fs::path(servicepath) / filenames::template_info_env).string());
}
std::string template_example()
{
return localpath::agent_local() + "/template_example";
@@ -146,6 +140,7 @@ namespace dropshell
//------------------------------------------------------------------------------------------------
// remote paths
// DROPSHELL_DIR
// |-- server.json
// |-- backups
// |-- temp_files
// |-- agent
@@ -157,9 +152,10 @@ namespace dropshell
// |-- service.env (actual service config)
// |-- template
// |-- (script files)
// |-- template_info.env
// |-- config
// |-- service.env (default service config)
// |-- (other config files for specific server&service)
// |-- (other template/example config files)
remotefile::remotefile(const std::string &server_name, const std::string &user) : mServer_name(server_name), mUser(user) {}
@@ -168,6 +164,11 @@ namespace dropshell
return remotepath(mServer_name, mUser).service_config(service_name) + "/" + filenames::service_env;
}
std::string remotefile::server_json()
{
return remotepath(mServer_name, mUser).DROPSHELL_DIR() + "/" + filenames::server_json;
}
remotepath::remotepath(const std::string &server_name, const std::string &user) : mServer_name(server_name), mUser(user) {}
std::string remotepath::DROPSHELL_DIR() const

View File

@@ -24,9 +24,9 @@ namespace dropshell {
// | |-- <template_name>.json
// | |-- <template_name>
// | |-- (...script files...)
// | |-- template_info.env
// | |-- config
// | |-- service.env
// | |-- .template_info.env
// | |-- (...other service config files...)
// backups_path
@@ -39,11 +39,10 @@ namespace dropshell {
// |-- services
// |-- <service_name>
// |-- service.env
// |-- .template_info.env
// |-- (...other config files for specific server&service...)
namespace filenames {
static const std::string template_info_env = ".template_info.env";
static const std::string template_info_env = "template_info.env";
static const std::string service_env = "service.env";
static const std::string readme = "README.txt";
static const std::string server_json = "server.json";
@@ -54,7 +53,6 @@ namespace dropshell {
std::string dropshell_json();
std::string server_json(const std::string &server_name);
std::string service_env(const std::string &server_name, const std::string &service_name);
std::string template_info_env(const std::string &server_name, const std::string &service_name);
std::string template_example();
std::string bb64();
} // namespace localfile
@@ -81,6 +79,7 @@ namespace dropshell {
//------------------------------------------------------------------------------------------------
// remote paths
// DROPSHELL_DIR
// |-- server.json
// |-- backups
// |-- temp_files
// |-- agent
@@ -90,18 +89,18 @@ namespace dropshell {
// |-- service name
// |-- config
// |-- service.env (actual service config)
// |-- .template_info.env
// |-- template
// |-- (script files)
// |-- template_info.env
// |-- config
// |-- service.env (default service config)
// |-- .template_info.env
// |-- (other config files for specific server&service)
// |-- (other template/example config files)
class remotefile {
public:
remotefile(const std::string &server_name, const std::string &user);
std::string service_env(const std::string &service_name) const;
std::string server_json();
private:
std::string mServer_name;
std::string mUser;