finalizing release

This commit is contained in:
Chee Yee
2023-07-17 18:40:55 -07:00
parent d0f1d013ab
commit 1cd1fb7fad
13 changed files with 130 additions and 22 deletions
+1 -1
View File
@@ -6,6 +6,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDONT_HAVE_STRUPR")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
add_definitions(-DCPPHTTPLIB_OPENSSL_SUPPORT)
add_definitions(-DCPPHTTPLIB_THREAD_POOL_COUNT=16)
include_directories(
source
@@ -64,7 +65,6 @@ add_self(ezremote_client)
add_pkg(ezremote_client ${CMAKE_SOURCE_DIR}/data "RMTC00001" "ezRemote Client" "01.08" 32 0)
target_link_libraries(ezremote_client
dbglogger
c
c++
png
Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 264 KiB

+2 -3
View File
@@ -42,17 +42,16 @@
installUrl: '/__local__/install',
uploadResumeSizeUrl: '__local__/uploadResumeSize',
multipleDownloadFileName: 'ezremote-client.zip',
isExtractableFilePattern: /\.(7z|rar|zip)$/i,
pickCallback: function (item) {
var msg = 'Picked %s "%s" for external use'
.replace('%s', item.type)
.replace('%s', item.fullPath());
window.alert(msg);
},
allowedActions: angular.extend(defaults.allowedActions, {
pickFiles: false,
pickFolders: false,
changePermissions: false,
isExtractableFilePattern: /\.(7z|rar|g?zip)$/i
changePermissions: false
}),
});
}]);
+5
View File
@@ -145,3 +145,8 @@ STR_VIEW_IMAGE=View Image
STR_VIEW_PKG_INFO=Package Information
STR_NFS_EXP_PATH_MISSING_MSG=NFS export path missing in URL
STR_FAIL_INIT_NFS_CONTEXT=Failed to init NFS context
STR_FAIL_MOUNT_NFS_MSG=Failed to mount NFS share
STR_WEB_SERVER=Web Server
STR_ENABLE=Enable
STR_COMPRESSED_FILE_PATH=Compressed Files Location
STR_COMPRESSED_FILE_PATH_MSG=Location of where compressed files are stored on the web server
File diff suppressed because one or more lines are too long
+10
View File
@@ -204,6 +204,12 @@ namespace CONFIG
http_server_port = ReadInt(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_PORT, 8080);
WriteInt(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_PORT, http_server_port);
sprintf(compressed_file_path, "%s", ReadString(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_COMPRESSED_FILE_PATH, CONFIG_DEFAULT_COMPRESSED_FILE_PATH));
WriteString(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_COMPRESSED_FILE_PATH, compressed_file_path);
web_server_enabled = ReadBool(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_ENABLED, true);
WriteBool(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_ENABLED, web_server_enabled);
for (int i = 0; i < sites.size(); i++)
{
RemoteSettings setting;
@@ -354,6 +360,10 @@ namespace CONFIG
WriteString(CONFIG_GOOGLE, CONFIG_GOOGLE_PERMISSIONS, gg_app.permissions);
WriteBool(CONFIG_GLOBAL, CONFIG_AUTO_DELETE_TMP_PKG, auto_delete_tmp_pkg);
WriteBool(CONFIG_GLOBAL, CONFIG_SHOW_HIDDEN_FILES, show_hidden_files);
WriteInt(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_PORT, http_server_port);
WriteString(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_COMPRESSED_FILE_PATH, compressed_file_path);
WriteBool(CONFIG_HTTP_SERVER, CONFIG_HTTP_SERVER_ENABLED, web_server_enabled);
WriteIniFile(CONFIG_INI_FILE);
CloseIniFile();
}
+3
View File
@@ -44,6 +44,9 @@
#define CONFIG_HTTP_SERVER "HttpServer"
#define CONFIG_HTTP_SERVER_PORT "http_server_port"
#define CONFIG_HTTP_SERVER_ENABLED "http_server_enabled"
#define CONFIG_HTTP_SERVER_COMPRESSED_FILE_PATH "compressed_files_path"
#define CONFIG_DEFAULT_COMPRESSED_FILE_PATH DATA_PATH "/compressed_files"
#define CONFIG_REMOTE_SERVER_NAME "remote_server_name"
#define CONFIG_REMOTE_SERVER_URL "remote_server_url"
+4
View File
@@ -160,6 +160,10 @@ char lang_strings[LANG_STRINGS_NUM][LANG_STR_SIZE] = {
"NFS export path missing in URL", // STR_NFS_EXP_PATH_MISSING_MSG
"Failed to init NFS context", // STR_FAIL_INIT_NFS_CONTEXT
"Failed to mount NFS share", // STR_FAIL_MOUNT_NFS_MSG
"Web Server", // STR_WEB_SERVER
"Enable", // STR_ENABLE
"Compressed Files Location", // STR_COMPRESSED_FILE_PATH
"Location of where compressed files are stored on the web server", // STR_COMPRESSED_FILE_PATH_MSG
};
bool needs_extended_font = false;
+6 -2
View File
@@ -151,7 +151,11 @@
FUNC(STR_VIEW_PKG_INFO) \
FUNC(STR_NFS_EXP_PATH_MISSING_MSG) \
FUNC(STR_FAIL_INIT_NFS_CONTEXT) \
FUNC(STR_FAIL_MOUNT_NFS_MSG)
FUNC(STR_FAIL_MOUNT_NFS_MSG) \
FUNC(STR_WEB_SERVER) \
FUNC(STR_ENABLE) \
FUNC(STR_COMPRESSED_FILE_PATH) \
FUNC(STR_COMPRESSED_FILE_PATH_MSG)
#define GET_VALUE(x) x,
#define GET_STRING(x) #x,
@@ -161,7 +165,7 @@ enum
FOREACH_STR(GET_VALUE)
};
#define LANG_STRINGS_NUM 148
#define LANG_STRINGS_NUM 152
#define LANG_ID_SIZE 64
#define LANG_STR_SIZE 384
extern char lang_identifiers[LANG_STRINGS_NUM][LANG_ID_SIZE];
+3 -3
View File
@@ -11,7 +11,7 @@
#include <orbis/Pad.h>
#include <orbis/AudioOut.h>
#include <orbis/Net.h>
#include <dbglogger.h>
// #include <dbglogger.h>
#include "imgui.h"
#include "SDL2/SDL.h"
@@ -271,8 +271,8 @@ static void terminate()
int main()
{
dbglogger_init();
dbglogger_log("If you see this you've set up dbglogger correctly.");
// dbglogger_init();
// dbglogger_log("If you see this you've set up dbglogger correctly.");
int rc;
// No buffering
setvbuf(stdout, NULL, _IONBF, 0);
+35 -8
View File
@@ -10,7 +10,6 @@
#include "system.h"
#include "zip_util.h"
#include "installer.h"
#include "dbglogger.h"
#define SERVER_CERT_FILE "/app0/assets/certs/domain.crt"
#define SERVER_PRIVATE_KEY_FILE "/app0/assets/certs/domain.key"
@@ -22,6 +21,8 @@
using namespace httplib;
Server *svr;
int http_server_port = 8080;
char compressed_file_path[1024];
bool web_server_enabled = false;
namespace HttpServer
{
@@ -200,6 +201,26 @@ namespace HttpServer
});
});
svr->Get("/favicon.ico", [&](const Request & req, Response & res)
{
FILE *in = FS::OpenRead("/mnt/sandbox/pfsmnt/RMTC00001-app0/assets/favicon.ico");
size_t size = FS::GetSize("/mnt/sandbox/pfsmnt/RMTC00001-app0/assets/favicon.ico");
res.set_content_provider(
size, "image/vnd.microsoft.icon",
[in](size_t offset, size_t length, DataSink &sink) {
size_t size_to_read = std::min(static_cast<size_t>(length), (size_t)1048576);
char buff[size_to_read];
size_t read_len;
FS::Seek(in, offset);
read_len = FS::Read(in, buff, size_to_read);
sink.write(buff, read_len);
return read_len == size_to_read;
},
[in](bool success) {
FS::Close(in);
});
});
svr->Post("/__local__/list", [&](const Request & req, Response & res)
{
const char *path;
@@ -225,6 +246,7 @@ namespace HttpServer
int err;
std::vector<DirEntry> files = FS::ListDir(path, &err);
DirEntry::Sort(files);
json_object *json_files = json_object_new_array();
for (std::vector<DirEntry>::iterator it = files.begin(); it != files.end();)
{
@@ -588,7 +610,9 @@ namespace HttpServer
return;
}
std::string zip_file = std::string(DATA_PATH) + "/" + compressedFilename;
if (!FS::FolderExists(compressed_file_path))
FS::MkDirs(compressed_file_path);
std::string zip_file = std::string(compressed_file_path) + "/" + compressedFilename;
zipFile zf = zipOpen64(zip_file.c_str(), APPEND_STATUS_CREATE);
if (zf != NULL)
{
@@ -701,26 +725,22 @@ namespace HttpServer
items.back().content.append(data, data_length);
if (items.back().name == "destination")
{
dbglogger_log("destination=%s", destination.c_str());
destination = items.back().content;
}
else if (items.back().name == "_chunkSize")
{
std::stringstream ss(items.back().content);
ss >> chunk_size;
dbglogger_log("chunk_size=%llu", chunk_size);
}
else if (items.back().name == "_chunkNumber")
{
std::stringstream ss(items.back().content);
ss >> chunk_number;
dbglogger_log("chunk_number=%llu", chunk_number);
}
else if (items.back().name == "_totalSize")
{
std::stringstream ss(items.back().content);
ss >> total_size;
dbglogger_log("_totalSize=%llu", total_size);
}
else
{
@@ -745,8 +765,11 @@ namespace HttpServer
return;
}
if (!FS::FolderExists(compressed_file_path))
FS::MkDirs(compressed_file_path);
std::string toFilename = req.get_param_value("toFilename");
std::string zip_file = std::string(DATA_PATH) + "/" + toFilename;
std::string zip_file = std::string(compressed_file_path) + "/" + toFilename;
zipFile zf = zipOpen64(zip_file.c_str(), APPEND_STATUS_CREATE);
if (zf != NULL)
{
@@ -900,7 +923,11 @@ namespace HttpServer
svr->set_payload_max_length(1024 * 1024 * 12);
svr->set_tcp_nodelay(true);
svr->set_mount_point("/", "/");
svr->listen("0.0.0.0", http_server_port);
if (web_server_enabled)
svr->listen("0.0.0.0", http_server_port);
else
svr->listen("127.0.0.1", http_server_port);
return NULL;
}
+2
View File
@@ -8,6 +8,8 @@ extern Server *svr;
static pthread_t http_server_thid;
extern int http_server_port;
extern char compressed_file_path[];
extern bool web_server_enabled;
namespace HttpServer
{
+58 -4
View File
@@ -38,7 +38,7 @@ static std::vector<std::string> *ime_multi_field;
static char *ime_single_field;
static int ime_field_size;
static char txt_server_port[6];
static char txt_http_server_port[6];
static char txt_http_port[6];
bool handle_updates = false;
@@ -119,6 +119,7 @@ namespace Windows
sprintf(local_filter, "");
sprintf(remote_filter, "");
sprintf(txt_http_port, "%d", remote_settings->http_port);
sprintf(txt_http_server_port, "%d", http_server_port);
dont_prompt_overwrite = false;
confirm_transfer_state = -1;
dont_prompt_overwrite_cb = false;
@@ -1631,7 +1632,7 @@ namespace Windows
ImGui::OpenPopup(lang_strings[STR_SETTINGS]);
ImGui::SetNextWindowPos(ImVec2(1050, 80));
ImGui::SetNextWindowSizeConstraints(ImVec2(850, 80), ImVec2(850, 400), NULL, NULL);
ImGui::SetNextWindowSizeConstraints(ImVec2(850, 80), ImVec2(850, 500), NULL, NULL);
if (ImGui::BeginPopupModal(lang_strings[STR_SETTINGS], NULL, ImGuiWindowFlags_AlwaysAutoResize))
{
ImGui::TextColored(colors[ImGuiCol_ButtonHovered], "%s", lang_strings[STR_GLOBAL]);
@@ -1648,13 +1649,66 @@ namespace Windows
ImGui::SetCursorPosX(805);
ImGui::Checkbox("##show_hidden_files", &show_hidden_files);
ImGui::Separator();
// Web Server settings
ImGui::TextColored(colors[ImGuiCol_ButtonHovered], "%s", lang_strings[STR_WEB_SERVER]);
ImGui::Separator();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 15);
ImGui::Text("%s", lang_strings[STR_ENABLE]);
ImGui::SameLine();
ImGui::SetCursorPosX(805);
ImGui::Checkbox("##web_server_enabled", &web_server_enabled);
ImGui::Separator();
ImVec2 field_size;
field_size = ImGui::CalcTextSize(lang_strings[STR_PORT]);
float width = field_size.x + 45;
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 15);
ImGui::Text("%s", lang_strings[STR_PORT]);
ImGui::SameLine();
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 1.0f));
char id[192];
sprintf(id, "%s##http_server_port", txt_http_server_port);
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 15);
if (ImGui::Button(id, ImVec2(835-width, 0)))
{
ResetImeCallbacks();
ime_single_field = txt_http_server_port;
ime_field_size = 5;
ime_callback = SingleValueImeCallback;
ime_after_update = AfterHttpPortChangeCallback;
Dialog::initImeDialog(lang_strings[STR_PORT], txt_http_server_port, 5, ORBIS_TYPE_NUMBER, 1050, 80);
gui_mode = GUI_MODE_IME;
}
ImGui::Separator();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 15);
ImGui::Text("%s", lang_strings[STR_COMPRESSED_FILE_PATH]);
ImGui::SameLine();
field_size = ImGui::CalcTextSize(lang_strings[STR_COMPRESSED_FILE_PATH]);
width = field_size.x + 45;
sprintf(id, "%s##compressed_file_path", compressed_file_path);
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 15);
if (ImGui::Button(id, ImVec2(835-width, 0)))
{
ResetImeCallbacks();
ime_single_field = compressed_file_path;
ime_field_size = 512;
ime_callback = SingleValueImeCallback;
Dialog::initImeDialog(lang_strings[STR_COMPRESSED_FILE_PATH], compressed_file_path, 512, ORBIS_TYPE_BASIC_LATIN, 1050, 80);
gui_mode = GUI_MODE_IME;
}
ImGui::PopStyleVar();
ImGui::Separator();
// Google settings
ImGui::TextColored(colors[ImGuiCol_ButtonHovered], "%s", lang_strings[STR_GOOGLE]);
ImGui::Separator();
ImVec2 id_size, secret_size;
id_size = ImGui::CalcTextSize(lang_strings[STR_CLIENT_ID]);
secret_size = ImGui::CalcTextSize(lang_strings[STR_CLIENT_SECRET]);
float width = MAX(id_size.x, secret_size.x) + 45;
width = MAX(id_size.x, secret_size.x) + 45;
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 15);
ImGui::Text("%s", lang_strings[STR_CLIENT_ID]);
@@ -1662,7 +1716,6 @@ namespace Windows
ImGui::SetCursorPosX(width);
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.0f, 1.0f));
char id[192];
sprintf(id, "%s##client_id_input", gg_app.client_id);
if (ImGui::Button(id, ImVec2(835-width, 0)))
{
@@ -2347,6 +2400,7 @@ namespace Windows
if (ime_result == IME_DIALOG_RESULT_FINISHED)
{
remote_settings->http_port = atoi(txt_http_port);
http_server_port = atoi(txt_http_server_port);
}
}