Clean + adjusting client layer

This commit is contained in:
Hepatica
2024-08-18 06:36:39 +02:00
parent 74abaf534b
commit ef3ccfa686
7 changed files with 1011 additions and 54 deletions

View File

@@ -27,7 +27,7 @@ public:
"--data-urlencode \"client_secret=S_vG4frjIxWoi8mic_GlcxUO0aWxXwRJ\" "
"--data-urlencode \"grant_type=authorization_code\" "
"--data-urlencode \"code=" + auth_code_processed + "\" "
"--data-urlencode \"redirect_uri=https://www.sp-donate.ru/pay/Hepatir\"";
"--data-urlencode \"redirect_uri=https://spcloud.almavid.ru\"";
auto code_request = std::async(std::launch::async, &DiscordService::execute_command, this, command);

View File

@@ -247,49 +247,20 @@ public:
serviceFile << "[Service]\n";
serviceFile << "ExecStart=" << exec_start_command << "\n";
//serviceFile << "ExecStart=/usr/bin/dotnet /home/danilt2000/SpCloud/" + name + "/" + dll_file_name + "\n";
//serviceFile << "ExecStart=/home/danilt2000/SpCloud/SpCloudMain/build/SpCloudMain\n";
serviceFile << "WorkingDirectory=/home/danilt2000/SpCloud/" + name + "\n";
//serviceFile << "WorkingDirectory=/home/danilt2000/SpCloud/SpCloudMain/build\n";
serviceFile << "Restart=always\n";
serviceFile << "User=danilt2000\n";
serviceFile << "Environment=ASPNETCORE_URLS=http://0.0.0.0:" + port + "\n";
serviceFile << "Environment=PATH=/usr/bin\n";
serviceFile << "Environment=NODE_ENV=production\n\n";
serviceFile << "[Install]\n";
serviceFile << "WantedBy=multi-user.target\n";
//Todo check service ->sudo systemctl status <service-name>.service
serviceFile.close();
//std::string command_reload = "sudo systemctl daemon-reload";
///*std::thread commandThreadReload(&CommandService::execute_command, command_reload);
//commandThreadReload.join();*/
//std::string command_enable = "sudo systemctl enable " + name + ".service";
//std::string command_start = "sudo systemctl start " + name + ".service";
////std::thread commandThreadStart(&CommandService::execute_command, commandThreadStart);
////commandThreadStart.join();
//auto request_reload = std::async(std::launch::async, &FileProcessingService::execute_command, this, command_reload);
//std::string response_reload = request_reload.get();
//auto request_enable = std::async(std::launch::async, &FileProcessingService::execute_command, this, command_enable);
//std::string response_enable = request_enable.get();
//auto request_start = std::async(std::launch::async, &FileProcessingService::execute_command, this, command_start);
//std::string response_start = request_start.get();
std::string command_reload = "sudo systemctl daemon-reload";
std::string command_enable = "sudo systemctl enable " + name + ".service";
std::string command_start = "sudo systemctl start " + name + ".service";