dropshell release 2025.0521.2125
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled
This commit is contained in:
@ -41,6 +41,16 @@ namespace localfile {
|
||||
return (servicepath.empty() ? "" : (fs::path(servicepath) / ".template_info.env").string());
|
||||
}
|
||||
|
||||
std::string template_example()
|
||||
{
|
||||
return localpath::agent_local() + "/template_example";
|
||||
}
|
||||
|
||||
std::string bb64()
|
||||
{
|
||||
return localpath::agent_local() + "/bb64";
|
||||
}
|
||||
|
||||
} // namespace localfile
|
||||
|
||||
|
||||
@ -66,12 +76,13 @@ namespace localpath {
|
||||
return ((template_cache_path.empty() || service_name.empty()) ? "" :
|
||||
(template_cache_path+"/remote_versions/"+service_name+".json"));
|
||||
}
|
||||
std::string agent(){
|
||||
return current_user_home() + "/.local/dropshell_agent";
|
||||
}
|
||||
std::string files_for_remote_agent()
|
||||
std::string agent_local()
|
||||
{
|
||||
return agent() + "/files_for_remote_agent";
|
||||
return current_user_home()+"/.local/dropshell_agent/agent-local";
|
||||
}
|
||||
std::string agent_remote()
|
||||
{
|
||||
return current_user_home() + "/.local/dropshell_agent/agent-remote";
|
||||
}
|
||||
std::string current_user_home()
|
||||
{
|
||||
@ -110,15 +121,17 @@ namespace localpath {
|
||||
{
|
||||
std::vector<std::filesystem::path> paths = {
|
||||
dropshell_files(),
|
||||
agent_local(),
|
||||
agent_remote(),
|
||||
template_cache(),
|
||||
backups(),
|
||||
temp_files(),
|
||||
agent()};
|
||||
temp_files()
|
||||
};
|
||||
for (auto &p : gConfig().get_local_server_definition_paths())
|
||||
paths.push_back(p);
|
||||
|
||||
for (auto &p : paths)
|
||||
if (!std::filesystem::exists(p))
|
||||
if (!p.empty() && !std::filesystem::exists(p))
|
||||
{
|
||||
info << "Creating directory: " << p << std::endl;
|
||||
std::filesystem::create_directories(p);
|
||||
|
@ -14,9 +14,12 @@ namespace dropshell {
|
||||
// ~/.config/dropshell/dropshell.json
|
||||
|
||||
// ~/.local/dropshell_agent
|
||||
// |-- bb64 (only used locally, as it's for the local machine's architecture!)
|
||||
// |-- files_for_remote_agent
|
||||
// |-- (other agent files, including _allservicesstatus.sh)
|
||||
// |-- agent-local
|
||||
// |-- agent-install.sh
|
||||
// |-- bb64 (only used locally, as it's for the local machine's architecture!)
|
||||
// |-- template_example
|
||||
// |-- agent-remote
|
||||
// |-- (remote agent files, including _allservicesstatus.sh)
|
||||
|
||||
// ~/.local/dropshell_files
|
||||
// |-- backups
|
||||
@ -52,6 +55,8 @@ namespace dropshell {
|
||||
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
|
||||
|
||||
namespace localpath {
|
||||
@ -60,8 +65,8 @@ namespace dropshell {
|
||||
|
||||
std::string remote_versions(const std::string &server_name, const std::string &service_name);
|
||||
|
||||
std::string agent();
|
||||
std::string files_for_remote_agent();
|
||||
std::string agent_local();
|
||||
std::string agent_remote();
|
||||
std::string current_user_home();
|
||||
|
||||
std::string dropshell_files();
|
||||
@ -69,7 +74,6 @@ namespace dropshell {
|
||||
std::string temp_files();
|
||||
std::string template_cache();
|
||||
|
||||
|
||||
bool create_directories();
|
||||
} // namespace local
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace dropshell
|
||||
{
|
||||
if (command.get_command_to_run().empty())
|
||||
return false;
|
||||
std::string full_command = command.construct_cmd(localpath::agent()+"/bb64"); // Get the command string
|
||||
std::string full_command = command.construct_cmd(localfile::bb64()); // Get the command string
|
||||
|
||||
pid_t pid = fork();
|
||||
|
||||
@ -130,7 +130,7 @@ namespace dropshell
|
||||
|
||||
std::string full_cmd;
|
||||
if (!hasFlag(mode, cMode::NoBB64))
|
||||
full_cmd = command.construct_cmd(localpath::agent()+"/bb64");
|
||||
full_cmd = command.construct_cmd(localfile::bb64());
|
||||
else
|
||||
full_cmd = command.construct_cmd("");
|
||||
|
||||
|
Reference in New Issue
Block a user