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

@@ -45,9 +45,9 @@ public:
file_processing->unzip(filename, this->publish_app_path + app_final_file_path);
check_port_and_increase_if_not_available();
check_port_and_increase_if_not_available();//
file_processing->adjust_nginx_configuration_and_reloud(app->get_name(), std::to_string(last_available_port));
file_processing->adjust_nginx_configuration_and_reloud(app->get_name(), std::to_string(last_available_port));//
file_processing->create_service_file(this->publish_app_path, app_final_file_path, std::to_string(last_available_port));
@@ -63,9 +63,9 @@ public:
file_processing->delete_file(filename);
app->set_url("https://" + app->get_name() + ".almavid.ru/");
app->set_url("https://" + app->get_name() + ".almavid.ru/");//
app->set_url_on_local_machine("http://localhost:" + std::to_string(last_available_port));
app->set_url_on_local_machine("http://localhost:" + std::to_string(last_available_port));//
app->set_service_name(app_final_file_path);

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";

View File

@@ -81,7 +81,7 @@ int main()
mongo_service.increase_user_app_count_(app->get_user_id());
res.set_content("App is running on address:" + app->get_url(), "text/plain");
res.set_content("App is running " + app->get_url(), "text/plain");
delete app;
});