More instructions

This commit is contained in:
Your Name
2025-04-25 23:29:50 +12:00
parent fb46dffdaf
commit 3c99ad1503
6 changed files with 103 additions and 25 deletions

View File

@ -157,8 +157,8 @@ void create_server(const std::string &server_name)
}
// 2. create a new directory in the user config directory
std::string config_dir = get_local_config_path(0);
std::string server_dir = config_dir + "/" + server_name;
std::string config_servers_dir = get_local_config_servers_path(0);
std::string server_dir = config_servers_dir + "/" + server_name;
fs::create_directory(server_dir);
// 3. create a template server.env file in the server directory
@ -169,21 +169,21 @@ void create_server(const std::string &server_name)
server_env_file << "SSH_USER=" << user << std::endl;
server_env_file << "SSH_PORT=" << 22 << std::endl;
server_env_file << std::endl;
server_env_file << "DROPSHELL_PATH=/home/"+user+"/.dropshell" << std::endl;
server_env_file << "DROPSHELL_DIR=/home/"+user+"/.dropshell" << std::endl;
server_env_file.close();
// 4. add dropshell-agent service to server
std::string service_dir = server_dir + "/dropshell-agent";
fs::create_directory(service_dir);
std::string service_env_path = service_dir + "/service.env";
std::filesystem::copy(get_local_system_templates_path() + "/dropshell-agent/service.env", service_env_path);
std::filesystem::copy(get_local_system_templates_path() + "/dropshell-agent/example/service.env", service_env_path);
std::cout << "Server created successfully: " << server_name << std::endl;
std::cout << "Please edit the server.env file to configure the server, it is located at: "<<std::endl;
std::cout << " " << server_env_path << std::endl;
std::cout << "Then run 'dropshell install " << server_name << " dropshell-agent' to install the agent" << std::endl;
std::cout << "Please complete the installation:" <<std::endl;
std::cout << "1) edit the server configuration: dropshell edit " << server_name << std::endl;
std::cout << "2) test ssh is working: dropshell ssh " << server_name << std::endl;
std::cout << "3) install dropshell-agent: dropshell install " << server_name << " dropshell-agent" << std::endl;
std::cout << std::endl;
std::cout << "You can then start managing your server with DropShell" << std::endl;
}
} // namespace dropshell