...
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled

This commit is contained in:
Your Name
2025-05-24 11:15:23 +12:00
parent e1c631dc72
commit 0934179053
17 changed files with 523 additions and 366 deletions

View File

@@ -88,7 +88,7 @@ namespace dropshell
}
// Create service directory
std::string user = server_env.get_user_for_service(server, service);
std::string user = server_env.get_user_for_service(service);
std::string remote_service_path = remotepath(server,user).service(service);
std::string mkdir_cmd = "mkdir -p " + quote(remote_service_path);
if (!execute_ssh_command(server_env.get_SSH_INFO(user), sCommand("", mkdir_cmd, {}), cMode::Silent))
@@ -109,7 +109,7 @@ namespace dropshell
debug << "Copying: [LOCAL] " << tinfo.local_template_path() << std::endl
<< std::string(8, ' ') << "[REMOTE] " << remotepath(server,user).service_template(service) << "/" << std::endl;
if (!shared_commands::rsync_tree_to_remote(tinfo.local_template_path().string(), remotepath(server,user).service_template(service),
server_env, false))
server_env, false, service_info.user))
{
std::cerr << "Failed to copy template files using rsync" << std::endl;
return false;
@@ -119,7 +119,7 @@ namespace dropshell
debug << "Copying: [LOCAL] " << localpath::service(server, service) << std::endl
<< std::string(8, ' ') << "[REMOTE] " << remotepath(server,user).service_config(service) << std::endl;
if (!shared_commands::rsync_tree_to_remote(localpath::service(server, service), remotepath(server,user).service_config(service),
server_env, false))
server_env, false, service_info.user))
{
std::cerr << "Failed to copy service files using rsync" << std::endl;
return false;
@@ -273,7 +273,7 @@ namespace dropshell
// now create the agent.
// copy across from the local agent files.
info << "Copying local agent files to remote server... " << std::flush;
shared_commands::rsync_tree_to_remote(localpath::agent_remote(), agent_path, server, false);
shared_commands::rsync_tree_to_remote(localpath::agent_remote(), agent_path, server, false, user.user);
info << "done." << std::endl;
// run the agent installer. Can't use BB64 yet, as we're installing it on the remote server.