From 350f7051226066761bd1a026a52fcbe6296e85f9 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 24 Aug 2025 14:56:27 +0700 Subject: [PATCH 1/7] update Makefile and .gitignore --- .gitignore | 1 + Makefile | 81 ++++++++++++++---------------------------------------- 2 files changed, 21 insertions(+), 61 deletions(-) diff --git a/.gitignore b/.gitignore index e101edd..26844db 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ cmake-build-debug .idea .vscode .cache +*.o diff --git a/Makefile b/Makefile index 6d4d4e9..0ea6f2f 100644 --- a/Makefile +++ b/Makefile @@ -1,62 +1,21 @@ -CXX=g++ -STRIP=strip -CXXFLAGS=-Wall -I src/libs -I src -std=c++20 -SOURCES=src/openrouter.cpp \ - src/security/cors.cpp \ - src/settings/settings.cpp \ - src/settings/backup.cpp \ - src/settings/telnet/enabled.cpp \ - src/settings/telnet/port.cpp \ - src/settings/ssh/status.cpp \ - src/settings/ssh/keys.cpp \ - src/settings/ssh/port.cpp \ - src/settings/ssh/server.cpp \ - src/settings/dns/enabled.cpp \ - src/settings/dns/servers.cpp \ - src/settings/dns/local_domains.cpp \ - src/settings/wifi/status.cpp \ - src/settings/wifi/name.cpp \ - src/settings/wifi/password.cpp \ - src/settings/wifi/qr.cpp \ - src/settings/wifi/channel.cpp \ - src/settings/ftp/ftp.cpp \ - src/system/reboot.cpp \ - src/system/syslog.cpp \ - src/system/uptime.cpp \ - src/system/update.cpp \ - src/OpenRouter/OpenRouter.cpp \ - src/auth/auth.cpp \ - src/libs/QR-Code-generator/qrcodegen.cpp \ - src/libs/QR-Code-generator/qrtosvg.cpp -TARGET=build/openrouter -default: all -all: build -.PHONY: build -build: - @if [ ! -d build ]; then \ - mkdir build; \ - fi - $(CXX) -o $(TARGET) $(SOURCES) $(CXXFLAGS) - $(STRIP) $(TARGET) +CXX = g++ +CFLAGS = -Wall -g -std=c++20 +LDFLAGS = +LIBS = +INCLUDES = -I./src/libs -I./src +SRCS = $(shell find src -type f -name '*.cpp') +OBJS = $(SRCS:.cpp=.o) +TARGET = auth_service +BUILD_DIR=./build +CROSS_COMPILE = + +all: $(TARGET) + +$(TARGET): $(OBJS) + $(CROSS_COMPILE)$(CXX) $(LDFLAGS) $^ -o $@ $(LIBS) + +%.o: %.cpp + $(CROSS_COMPILE)$(CXX) $(CFLAGS) $(INCLUDES) -c $< -o $@ + clean: - @if [ -f $(TARGET) ]; then \ - rm -v $(TARGET); \ - fi - -install: - @if [ ! -f /usr/bin/openrouter ]; then \ - install -v $(TARGET) /usr/bin/openrouter; \ - fi - # install -d /usr/share/openrouter - @if [ ! -d /usr/share/openrouter ]; then \ - install -dv src/web /usr/share/openrouter/web; \ - cp -rv src/web/* /usr/share/openrouter/web; \ - fi - -uninstall: - @if [ -d /usr/share/openrouter ]; then \ - rm -rv /usr/share/openrouter; \ - fi - @if [ -f /usr/bin/openrouter ]; then \ - rm -v /usr/bin/openrouter; \ - fi + rm -f $(OBJS) $(TARGET) -- 2.54.0 From 931452941f3a194e9c57619064fbb7d880437854 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 24 Aug 2025 14:56:53 +0700 Subject: [PATCH 2/7] Update actions.yaml --- .gitea/workflows/actions.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index 67ad552..b75551e 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -17,7 +17,7 @@ jobs: echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \ make -j$(nproc) - name: Testing to run binary builded with make - run: ./build/openrouter + run: ./openrouter Prepare-Build-Testing-With-CMake: runs-on: alpine-sdk -- 2.54.0 From dff6aa034cdc19695353d3b7ad34af5aa5ef9d2a Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Sun, 24 Aug 2025 14:57:57 +0700 Subject: [PATCH 3/7] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0ea6f2f..09302cb 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ LIBS = INCLUDES = -I./src/libs -I./src SRCS = $(shell find src -type f -name '*.cpp') OBJS = $(SRCS:.cpp=.o) -TARGET = auth_service +TARGET = openrouter BUILD_DIR=./build CROSS_COMPILE = -- 2.54.0 From 1b9344fb0d33beff33e8ff84a35392fe997184e5 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 28 Aug 2025 18:03:44 +0700 Subject: [PATCH 4/7] updated for work with new auth_service on c --- config.json | 2 +- src/auth/auth.cpp | 4 +- src/web/js/routes.js | 4 +- src/web/js/routes.js.h | 184 ++++++++++++++++++++--------------------- 4 files changed, 97 insertions(+), 97 deletions(-) diff --git a/config.json b/config.json index c6671d3..ebf0859 100644 --- a/config.json +++ b/config.json @@ -1,5 +1,5 @@ { - "auth_service": "http://127.0.0.1:43243", + "auth_service": "http://127.0.0.1:8222", "server": { "ip": "0.0.0.0", "port": 43244 diff --git a/src/auth/auth.cpp b/src/auth/auth.cpp index 76c3aea..78df698 100644 --- a/src/auth/auth.cpp +++ b/src/auth/auth.cpp @@ -9,11 +9,11 @@ bool authenticate(const std::string &token) httplib::Client cli(config::config.getConfig()["auth_service"]); std::string body = R"({"token":")" + token + R"("})"; - httplib::Result res = cli.Post("/api/access", body, JSON_TYPE); + httplib::Result res = cli.Post("/api/token/verify", body, JSON_TYPE); if (res->status == httplib::OK_200) { nlohmann::json resjson = nlohmann::json::parse(res->body); - if (resjson["access"] == "reject") + if (resjson["valid"] == "true") { return false; } diff --git a/src/web/js/routes.js b/src/web/js/routes.js index c74d19d..43063e9 100644 --- a/src/web/js/routes.js +++ b/src/web/js/routes.js @@ -2,8 +2,8 @@ const host = window.location.origin; const prefix = "api"; const routes = { - login: () => ["http://localhost:43243", prefix, "token"].join("/"), - user: () => ["http://localhost:43243", prefix, "users", "user"].join("/"), + login: () => ["http://localhost:8222", prefix, "token"].join("/"), + user: () => ["http://localhost:8222", prefix, "users", "user"].join("/"), wifi_password_set: () => [host, prefix, "settings", "wifi", "password", "set"].join("/"), diff --git a/src/web/js/routes.js.h b/src/web/js/routes.js.h index 75d8b1d..71ba5c2 100644 --- a/src/web/js/routes.js.h +++ b/src/web/js/routes.js.h @@ -8,101 +8,101 @@ unsigned char routes_js[] = { 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x22, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x68, 0x6f, 0x73, 0x74, 0x3a, 0x34, 0x33, 0x32, 0x34, 0x33, 0x22, 0x2c, - 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, - 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x73, 0x65, - 0x72, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x22, 0x68, - 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, - 0x6f, 0x73, 0x74, 0x3a, 0x34, 0x33, 0x32, 0x34, 0x33, 0x22, 0x2c, 0x20, - 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x73, 0x65, 0x72, 0x22, 0x5d, - 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, - 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x66, 0x69, 0x5f, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x3a, 0x20, - 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x22, 0x2c, 0x20, 0x22, 0x77, 0x69, 0x66, 0x69, 0x22, 0x2c, - 0x20, 0x22, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2c, - 0x20, 0x22, 0x73, 0x65, 0x74, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, - 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, - 0x69, 0x66, 0x69, 0x5f, 0x71, 0x72, 0x5f, 0x67, 0x65, 0x74, 0x3a, 0x20, - 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x22, 0x2c, 0x20, 0x22, 0x77, 0x69, 0x66, 0x69, 0x22, 0x2c, - 0x20, 0x22, 0x71, 0x72, 0x22, 0x2c, 0x20, 0x22, 0x67, 0x65, 0x74, 0x22, - 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, - 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x5f, 0x67, 0x65, 0x74, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, - 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x73, 0x22, 0x2c, 0x20, 0x22, 0x67, 0x65, 0x74, 0x22, 0x5d, 0x2e, - 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, - 0x20, 0x20, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, - 0x73, 0x65, 0x74, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, - 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, - 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, - 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, - 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, - 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, - 0x2c, 0x20, 0x22, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x22, 0x5d, 0x2e, - 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, - 0x20, 0x20, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, - 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x20, 0x28, 0x29, 0x20, - 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, - 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x22, 0x2c, 0x20, 0x22, 0x72, 0x65, 0x73, 0x74, 0x6f, - 0x72, 0x65, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, - 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, - 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x22, 0x2c, 0x20, 0x22, 0x72, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x73, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, - 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, - 0x62, 0x6f, 0x6f, 0x74, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, + 0x68, 0x6f, 0x73, 0x74, 0x3a, 0x38, 0x32, 0x32, 0x32, 0x22, 0x2c, 0x20, + 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, + 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x73, 0x65, 0x72, + 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x22, 0x68, 0x74, + 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, + 0x73, 0x74, 0x3a, 0x38, 0x32, 0x32, 0x32, 0x22, 0x2c, 0x20, 0x70, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x22, 0x2c, 0x20, 0x22, 0x75, 0x73, 0x65, 0x72, 0x22, 0x5d, 0x2e, 0x6a, + 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x0a, 0x20, + 0x20, 0x20, 0x20, 0x77, 0x69, 0x66, 0x69, 0x5f, 0x70, 0x61, 0x73, 0x73, + 0x77, 0x6f, 0x72, 0x64, 0x5f, 0x73, 0x65, 0x74, 0x3a, 0x20, 0x28, 0x29, + 0x20, 0x3d, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x2c, - 0x20, 0x22, 0x72, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x22, 0x5d, 0x2e, 0x6a, - 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, - 0x20, 0x20, 0x73, 0x79, 0x73, 0x6c, 0x6f, 0x67, 0x3a, 0x20, 0x28, 0x29, - 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, 0x74, - 0x65, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, 0x6c, 0x6f, 0x67, + 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x22, 0x2c, 0x20, 0x22, 0x77, 0x69, 0x66, 0x69, 0x22, 0x2c, 0x20, 0x22, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2c, 0x20, 0x22, + 0x73, 0x65, 0x74, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, + 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x66, + 0x69, 0x5f, 0x71, 0x72, 0x5f, 0x67, 0x65, 0x74, 0x3a, 0x20, 0x28, 0x29, + 0x20, 0x3d, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x22, 0x2c, 0x20, 0x22, 0x77, 0x69, 0x66, 0x69, 0x22, 0x2c, 0x20, 0x22, + 0x71, 0x72, 0x22, 0x2c, 0x20, 0x22, 0x67, 0x65, 0x74, 0x22, 0x5d, 0x2e, + 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x0a, + 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x5f, 0x67, 0x65, 0x74, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, + 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, + 0x22, 0x2c, 0x20, 0x22, 0x67, 0x65, 0x74, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, + 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x73, 0x65, + 0x74, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, + 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, + 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x2c, 0x20, + 0x22, 0x73, 0x65, 0x74, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, + 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x75, + 0x70, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, + 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, + 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x22, 0x2c, 0x20, + 0x22, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, + 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, + 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, + 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x73, 0x22, 0x2c, 0x20, 0x22, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, - 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, - 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, - 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, - 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x70, - 0x74, 0x69, 0x6d, 0x65, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, - 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, - 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x3a, - 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, - 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, - 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, - 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x28, 0x29, 0x20, - 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, - 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, 0x74, 0x65, - 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, - 0x2c, 0x20, 0x22, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x5d, 0x2e, - 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, - 0x20, 0x20, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, - 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, + 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x20, + 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x20, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x73, 0x22, 0x2c, 0x20, 0x22, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x22, 0x2c, 0x20, 0x22, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x73, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, + 0x29, 0x2c, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x62, 0x6f, + 0x6f, 0x74, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, + 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, + 0x20, 0x22, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x2c, 0x20, 0x22, + 0x72, 0x65, 0x62, 0x6f, 0x6f, 0x74, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, + 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, + 0x73, 0x79, 0x73, 0x6c, 0x6f, 0x67, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, - 0x22, 0x2c, 0x20, 0x22, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x2c, - 0x20, 0x22, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x5d, + 0x22, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, 0x6c, 0x6f, 0x67, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, - 0x7d, 0x3b, 0x0a + 0x20, 0x20, 0x20, 0x20, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x20, + 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, + 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x70, 0x74, 0x69, + 0x6d, 0x65, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, + 0x22, 0x29, 0x2c, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x28, + 0x29, 0x20, 0x3d, 0x3e, 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, + 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x22, 0x2c, 0x20, 0x22, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x22, + 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, + 0x0a, 0x20, 0x20, 0x20, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, + 0x20, 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, + 0x69, 0x78, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, + 0x2c, 0x20, 0x22, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x2c, 0x20, + 0x22, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x5d, 0x2e, 0x6a, 0x6f, + 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, + 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x67, + 0x72, 0x65, 0x73, 0x73, 0x3a, 0x20, 0x28, 0x29, 0x20, 0x3d, 0x3e, 0x20, + 0x5b, 0x68, 0x6f, 0x73, 0x74, 0x2c, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x2c, 0x20, 0x22, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x2c, + 0x20, 0x22, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x2c, 0x20, 0x22, + 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x5d, 0x2e, 0x6a, + 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2f, 0x22, 0x29, 0x2c, 0x0a, 0x7d, 0x3b, + 0x0a }; -unsigned int routes_js_len = 1251; +unsigned int routes_js_len = 1249; -- 2.54.0 From b3db7f5695de9fb1a3725aa68734546d1a250e93 Mon Sep 17 00:00:00 2001 From: TolaMironcenko Date: Thu, 25 Sep 2025 16:17:12 +0700 Subject: [PATCH 5/7] added more toolchain_files --- toolchain_files/aarch64-buildroot-linux-uclibc.cmake | 1 + toolchain_files/aarch64-buildroot-linux-uclibc.toml | 12 ++++++++++++ ...ibc => arm-buildroot-linux-uclibcgnueabihf.cmake} | 0 ....txt => arm-buildroot-linux-uclibcgnueabihf.toml} | 0 toolchain_files/x86_64-buildroot-linux-uclibc.cmake | 1 + toolchain_files/x86_64-buildroot-linux-uclibc.toml | 12 ++++++++++++ 6 files changed, 26 insertions(+) create mode 100644 toolchain_files/aarch64-buildroot-linux-uclibc.cmake create mode 100644 toolchain_files/aarch64-buildroot-linux-uclibc.toml rename toolchain_files/{arm_uclibc => arm-buildroot-linux-uclibcgnueabihf.cmake} (100%) rename toolchain_files/{arm_uclibc_meson.txt => arm-buildroot-linux-uclibcgnueabihf.toml} (100%) create mode 100644 toolchain_files/x86_64-buildroot-linux-uclibc.cmake create mode 100644 toolchain_files/x86_64-buildroot-linux-uclibc.toml diff --git a/toolchain_files/aarch64-buildroot-linux-uclibc.cmake b/toolchain_files/aarch64-buildroot-linux-uclibc.cmake new file mode 100644 index 0000000..5a25ed6 --- /dev/null +++ b/toolchain_files/aarch64-buildroot-linux-uclibc.cmake @@ -0,0 +1 @@ +set(CMAKE_CXX_COMPILER aarch64-buildroot-linux-uclibc-g++) diff --git a/toolchain_files/aarch64-buildroot-linux-uclibc.toml b/toolchain_files/aarch64-buildroot-linux-uclibc.toml new file mode 100644 index 0000000..54b358e --- /dev/null +++ b/toolchain_files/aarch64-buildroot-linux-uclibc.toml @@ -0,0 +1,12 @@ +[binaries] +c = 'aarch64-buildroot-linux-uclibc-gcc' +cpp = 'aarch64-buildroot-linux-uclibc-g++' +ar = 'aarch64-buildroot-linux-uclibc-ar' +strip = 'aarch64-buildroot-linux-uclibc-strip' +ld = 'aarch64-buildroot-linux-uclibc-ld' + +[host_machine] +system = 'linux' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' diff --git a/toolchain_files/arm_uclibc b/toolchain_files/arm-buildroot-linux-uclibcgnueabihf.cmake similarity index 100% rename from toolchain_files/arm_uclibc rename to toolchain_files/arm-buildroot-linux-uclibcgnueabihf.cmake diff --git a/toolchain_files/arm_uclibc_meson.txt b/toolchain_files/arm-buildroot-linux-uclibcgnueabihf.toml similarity index 100% rename from toolchain_files/arm_uclibc_meson.txt rename to toolchain_files/arm-buildroot-linux-uclibcgnueabihf.toml diff --git a/toolchain_files/x86_64-buildroot-linux-uclibc.cmake b/toolchain_files/x86_64-buildroot-linux-uclibc.cmake new file mode 100644 index 0000000..05ff4ce --- /dev/null +++ b/toolchain_files/x86_64-buildroot-linux-uclibc.cmake @@ -0,0 +1 @@ +set(CMAKE_CXX_COMPILER x86_64-buildroot-linux-uclibc-g++) diff --git a/toolchain_files/x86_64-buildroot-linux-uclibc.toml b/toolchain_files/x86_64-buildroot-linux-uclibc.toml new file mode 100644 index 0000000..6e3d527 --- /dev/null +++ b/toolchain_files/x86_64-buildroot-linux-uclibc.toml @@ -0,0 +1,12 @@ +[binaries] +c = 'x86_64-buildroot-linux-uclibc-gcc' +cpp = 'x86_64-buildroot-linux-uclibc-g++' +ar = 'x86_64-buildroot-linux-uclibc-ar' +strip = 'x86_64-buildroot-linux-uclibc-strip' +ld = 'x86_64-buildroot-linux-uclibc-ld' + +[host_machine] +system = 'linux' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' -- 2.54.0 From 519024d73c2fd9b534bfaf6fae2c43d4b620ebae Mon Sep 17 00:00:00 2001 From: wt Date: Thu, 17 Sep 2026 17:17:35 +0700 Subject: [PATCH 6/7] Update .gitea/workflows/actions.yaml --- .gitea/workflows/actions.yaml | 37 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index b75551e..e58c14f 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -6,11 +6,8 @@ jobs: Prepare-Build-Testing-With-Make: runs-on: alpine-sdk steps: - - name: prepare-container - run: | - echo "192.168.3.113 gitea.home.com" >> /etc/hosts - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Building binary with make run: | sed -i '1s/^/#define TEST\n/' src/config/config.hpp && \ @@ -22,37 +19,33 @@ jobs: Prepare-Build-Testing-With-CMake: runs-on: alpine-sdk steps: - - name: prepare-container - run: | - echo "192.168.3.113 gitea.home.com" >> /etc/hosts && \ - apk add cmake - name: Check out repository code - uses: actions/checkout@v3 - - name: Building binary with CMake + uses: actions/checkout@v4 + - name: Install build tools + run: apt update && apt install -y cmake + - name: Configure CMake + run: cmake -B ${{gitea.workspace}}/build + - name: Build project run: | sed -i '1s/^/#define TEST\n/' src/config/config.hpp && \ echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \ - mkdir build && \ - cd build && \ - cmake .. && \ - make -j$(nproc) + cmake --build ${{gitea.workspace}}/build - name: Testing to run binary builded with CMake run: ./build/openrouter Prepare-Build-Testing-With-Meson: runs-on: alpine-sdk steps: - - name: prepare-container - run: | - echo "192.168.3.113 gitea.home.com" >> /etc/hosts && \ - apk add meson ninja cmake - name: Check out repository code - uses: actions/checkout@v3 - - name: Building binary with meson + uses: actions/checkout@v4 + - name: Install build tools + run: apt update && apt install -y meson + - name: Configure Project + run: meson setup build --buildtype=release + - name: Build Project run: | sed -i '1s/^/#define TEST\n/' src/config/config.hpp && \ echo "#define TEST" >> src/OpenRouter/OpenRouter.hpp && \ - meson setup build && \ - ninja -C build + meson compile -C build - name: Testing to run binary builded with meson run: ./build/openrouter -- 2.54.0 From 1adffa812c66b1e454b15612b8755a923066aadf Mon Sep 17 00:00:00 2001 From: wt Date: Thu, 17 Sep 2026 17:19:21 +0700 Subject: [PATCH 7/7] Update .gitea/workflows/actions.yaml --- .gitea/workflows/actions.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/actions.yaml b/.gitea/workflows/actions.yaml index e58c14f..616f912 100644 --- a/.gitea/workflows/actions.yaml +++ b/.gitea/workflows/actions.yaml @@ -4,7 +4,7 @@ on: [push] jobs: Prepare-Build-Testing-With-Make: - runs-on: alpine-sdk + runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v4 @@ -17,7 +17,7 @@ jobs: run: ./openrouter Prepare-Build-Testing-With-CMake: - runs-on: alpine-sdk + runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v4 @@ -34,7 +34,7 @@ jobs: run: ./build/openrouter Prepare-Build-Testing-With-Meson: - runs-on: alpine-sdk + runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v4 -- 2.54.0