| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605 |
- {
- "nav": {
- "en": "Subservices",
- "zh-tw": "子服務",
- "zh-cn": "子服务",
- "ja": "サブサービス"
- },
- "title": {
- "en": "Subservices (deprecated) — ArozOS",
- "zh-tw": "子服務(已棄用)— ArozOS",
- "zh-cn": "子服务(已弃用)— ArozOS",
- "ja": "サブサービス(非推奨)— ArozOS"
- },
- "description": {
- "en": "How ArozOS subservices work: a binary in any language that ArozOS starts, reverse-proxies and puts on the desktop. The subservice infrastructure is deprecated and no longer maintained.",
- "zh-tw": "ArozOS 子服務的運作方式:以任何語言撰寫的執行檔,由 ArozOS 啟動、反向代理並放上桌面。子服務架構已棄用,不再維護。",
- "zh-cn": "ArozOS 子服务的运行方式:以任何语言编写的可执行文件,由 ArozOS 启动、反向代理并放上桌面。子服务架构已弃用,不再维护。",
- "ja": "ArozOS サブサービスの仕組み。どの言語で書いたバイナリでも、ArozOS が起動・プロキシしてデスクトップに載せます。サブサービスの基盤は非推奨で、今後メンテナンスされません。"
- },
- "accent": "makers",
- "folder": true,
- "sections": [
- {
- "type": "hero",
- "eyebrow": {
- "en": "Developer documentation",
- "zh-tw": "開發者文件",
- "zh-cn": "开发者文档",
- "ja": "開発者ドキュメント"
- },
- "title": {
- "en": "<span class=\"grad\">Subservices</span>",
- "zh-tw": "<span class=\"grad\">子服務</span>",
- "zh-cn": "<span class=\"grad\">子服务</span>",
- "ja": "<span class=\"grad\">サブサービス</span>"
- },
- "text": {
- "en": "Run a binary written in any language. ArozOS starts it, proxies it behind the same login and puts it on the desktop.",
- "zh-tw": "用任何語言撰寫的執行檔,由 ArozOS 啟動、以同一組登入反向代理,並放上桌面。",
- "zh-cn": "用任何语言编写的可执行文件,由 ArozOS 启动、以同一套登录反向代理,并放上桌面。",
- "ja": "どの言語で書いたバイナリでも、ArozOS が起動し、同じログインのままプロキシして、デスクトップに載せます。"
- }
- },
- {
- "type": "notice",
- "eyebrow": {
- "en": "Deprecated",
- "zh-tw": "已棄用",
- "zh-cn": "已弃用",
- "ja": "非推奨"
- },
- "title": {
- "en": "The subservice infrastructure is no longer maintained",
- "zh-tw": "子服務架構不再維護",
- "zh-cn": "子服务架构不再维护",
- "ja": "サブサービスの基盤は今後メンテナンスされません"
- },
- "text": {
- "en": "Subservices still work as described on this page, but they get no new features and no fixes, and they may be removed in a future release. Do not start new projects on them. This page is kept for people who already run one. For new work, use one of these instead:",
- "zh-tw": "子服務仍可依本頁所述運作,但不會再有新功能或修正,並可能在日後版本中移除。請勿以子服務開始新專案;本頁僅為已在使用的人保留。新的開發請改用以下方式:",
- "zh-cn": "子服务仍可按本页所述运行,但不会再有新功能或修复,并可能在今后的版本中移除。请勿以子服务开始新项目;本页仅为已在使用的人保留。新的开发请改用以下方式:",
- "ja": "サブサービスはこのページの説明どおり引き続き動作しますが、新機能や修正は提供されず、将来のリリースで削除される可能性があります。新しいプロジェクトでは使わないでください。このページは、すでに使っている方のために残してあります。新しく作る場合は、次の方法を使ってください。"
- },
- "bullets": [
- {
- "en": "<strong>A WebApp</strong>: HTML and JavaScript in a folder, with server-side AGI scripts for files, databases and the rest of ArozOS.",
- "zh-tw": "<strong>WebApp</strong>:資料夾內的 HTML 與 JavaScript,搭配伺服器端 AGI 腳本存取檔案、資料庫與 ArozOS 的其他功能。",
- "zh-cn": "<strong>WebApp</strong>:文件夹内的 HTML 与 JavaScript,搭配服务器端 AGI 脚本访问文件、数据库与 ArozOS 的其他功能。",
- "ja": "<strong>WebApp</strong>:フォルダに置いた HTML と JavaScript。ファイルやデータベースなどには、サーバーサイドの AGI スクリプトでアクセスします。"
- },
- {
- "en": "<strong>A Container App</strong>: publish any web server, in Docker or anywhere else, through the ArozOS port and pin it to the desktop.",
- "zh-tw": "<strong>Container App</strong>:把 Docker 或其他地方執行的任何網頁伺服器,透過 ArozOS 的連接埠發佈並釘選到桌面。",
- "zh-cn": "<strong>Container App</strong>:把 Docker 或其他地方运行的任何网页服务器,通过 ArozOS 的端口发布并固定到桌面。",
- "ja": "<strong>Container App</strong>:Docker など、どこで動いている Web サーバーでも、ArozOS のポート経由で公開してデスクトップにピン留めできます。"
- }
- ],
- "buttons": [
- {
- "href": "@makers",
- "style": "primary",
- "label": {
- "en": "WebApps and AGI",
- "zh-tw": "WebApp 與 AGI",
- "zh-cn": "WebApp 与 AGI",
- "ja": "WebApp と AGI"
- }
- },
- {
- "href": "@server",
- "style": "secondary",
- "label": {
- "en": "Container Apps",
- "zh-tw": "Container Apps",
- "zh-cn": "Container Apps",
- "ja": "Container Apps"
- }
- }
- ]
- },
- {
- "type": "doc",
- "id": "overview",
- "eyebrow": {
- "en": "Overview",
- "zh-tw": "概觀",
- "zh-cn": "概览",
- "ja": "概要"
- },
- "title": {
- "en": "A program that ArozOS runs for you",
- "zh-tw": "由 ArozOS 為您執行的程式",
- "zh-cn": "由 ArozOS 为你运行的程序",
- "ja": "ArozOS が代わりに動かすプログラム"
- },
- "items": [
- {
- "text": {
- "en": "A subservice is a separate program, usually a small web server, that ArozOS starts as a child process and reverse-proxies under its own address. It runs outside the core, so it can be written in Go, Rust, Python or anything else that can serve HTTP, and it can use native code that the sandboxed AGI JavaScript runtime cannot.",
- "zh-tw": "子服務是一支獨立的程式,通常是小型網頁伺服器。ArozOS 會把它當作子行程啟動,並在自己的位址下做反向代理。它在核心之外執行,因此可以用 Go、Rust、Python 或任何能提供 HTTP 的語言撰寫,也能使用沙盒化的 AGI JavaScript 執行環境做不到的原生程式碼。",
- "zh-cn": "子服务是一个独立的程序,通常是小型网页服务器。ArozOS 会把它当作子进程启动,并在自己的地址下做反向代理。它在内核之外运行,因此可以用 Go、Rust、Python 或任何能提供 HTTP 的语言编写,也能使用沙盒化的 AGI JavaScript 运行环境做不到的原生代码。",
- "ja": "サブサービスは独立したプログラム(多くは小さな Web サーバー)で、ArozOS が子プロセスとして起動し、自身のアドレスの下でリバースプロキシします。コアの外で動くため、Go、Rust、Python など HTTP を話せる言語なら何でも使え、サンドボックス化された AGI の JavaScript では扱えないネイティブコードも使えます。"
- }
- },
- {
- "text": {
- "en": "Once loaded, it registers as a normal module: it shows up on the desktop and in the start menu, and each user needs permission for it, just like a built-in WebApp.",
- "zh-tw": "載入後,它會註冊為一般模組:出現在桌面與開始選單,每位使用者都需要取得權限,與內建的 WebApp 相同。",
- "zh-cn": "加载后,它会注册为普通模块:出现在桌面与开始菜单,每位用户都需要获得权限,与内置的 WebApp 相同。",
- "ja": "読み込まれると通常のモジュールとして登録され、デスクトップとスタートメニューに表示されます。内蔵の WebApp と同じく、ユーザーごとに権限が必要です。"
- },
- "note": {
- "en": "<strong>Fun fact:</strong> the authenticated reverse proxy that was written for subservices is what <a href=\"https://zoraxy.aroz.org\">Zoraxy</a>, the standalone reverse proxy, grew out of.",
- "zh-tw": "<strong>小知識:</strong>為子服務而寫的、帶身分驗證的反向代理,後來長成了獨立的反向代理 <a href=\"https://zoraxy.aroz.org\">Zoraxy</a>。",
- "zh-cn": "<strong>小知识:</strong>为子服务而写的、带身份验证的反向代理,后来长成了独立的反向代理 <a href=\"https://zoraxy.aroz.org\">Zoraxy</a>。",
- "ja": "<strong>豆知識:</strong>サブサービスのために作られた認証付きリバースプロキシが、のちに独立したリバースプロキシ <a href=\"https://zoraxy.aroz.org\">Zoraxy</a> へと育ちました。"
- }
- }
- ]
- },
- {
- "type": "doc",
- "id": "layout",
- "title": {
- "en": "Folder layout",
- "zh-tw": "資料夾結構",
- "zh-cn": "文件夹结构",
- "ja": "フォルダ構成"
- },
- "text": {
- "en": "Every subservice lives in its own folder below <code>subservice/</code>, next to the ArozOS binary. The executable is named after the folder, with the platform added.",
- "zh-tw": "每個子服務都放在 ArozOS 執行檔旁 <code>subservice/</code> 之下自己的資料夾中。執行檔以資料夾命名,並加上平台名稱。",
- "zh-cn": "每个子服务都放在 ArozOS 可执行文件旁 <code>subservice/</code> 之下自己的文件夹中。可执行文件以文件夹命名,并加上平台名称。",
- "ja": "サブサービスはそれぞれ、ArozOS の実行ファイルの隣にある <code>subservice/</code> の下に専用のフォルダを持ちます。実行ファイルはフォルダ名にプラットフォーム名を付けた名前にします。"
- },
- "items": [
- {
- "code": "subservice/\n demo/\n demo.exe Windows\n demo_linux_amd64 Linux, x86-64\n demo_linux_arm64 Linux, ARM64\n demo_darwin_amd64 macOS, Intel\n moduleInfo.json optional, see \"Describing the module\"\n web/ anything the service serves",
- "note": {
- "en": "The names are <code><folder>.exe</code> on Windows and <code><folder>_<GOOS>_<GOARCH></code> everywhere else. ArozOS starts the process inside the service folder, so relative paths such as <code>./web</code> work.",
- "zh-tw": "Windows 上為 <code><資料夾>.exe</code>,其他平台為 <code><資料夾>_<GOOS>_<GOARCH></code>。ArozOS 在該服務的資料夾內啟動行程,因此 <code>./web</code> 這類相對路徑可以直接使用。",
- "zh-cn": "Windows 上为 <code><文件夹>.exe</code>,其他平台为 <code><文件夹>_<GOOS>_<GOARCH></code>。ArozOS 在该服务的文件夹内启动进程,因此 <code>./web</code> 这类相对路径可以直接使用。",
- "ja": "Windows では <code><フォルダ名>.exe</code>、それ以外では <code><フォルダ名>_<GOOS>_<GOARCH></code> です。ArozOS はサービスのフォルダ内でプロセスを起動するため、<code>./web</code> のような相対パスがそのまま使えます。"
- }
- }
- ]
- },
- {
- "type": "doc",
- "id": "startup",
- "title": {
- "en": "What happens at startup",
- "zh-tw": "啟動時會發生什麼事",
- "zh-cn": "启动时会发生什么",
- "ja": "起動時の流れ"
- },
- "items": [
- {
- "bullets": [
- {
- "en": "ArozOS looks for the executable of the current platform. A service without one is skipped.",
- "zh-tw": "ArozOS 尋找目前平台的執行檔;沒有的服務會被略過。",
- "zh-cn": "ArozOS 查找当前平台的可执行文件;没有的服务会被跳过。",
- "ja": "ArozOS が現在のプラットフォーム用の実行ファイルを探します。無い場合、そのサービスは読み飛ばされます。"
- },
- {
- "en": "It reads the module information from <code>moduleInfo.json</code> or, when there is none, runs <code><binary> -info</code>, which must print the JSON object described below and exit.",
- "zh-tw": "從 <code>moduleInfo.json</code> 讀取模組資訊;若沒有該檔案,則執行 <code><執行檔> -info</code>,它必須印出下方所述的 JSON 物件後結束。",
- "zh-cn": "从 <code>moduleInfo.json</code> 读取模块信息;若没有该文件,则运行 <code><可执行文件> -info</code>,它必须打印出下方所述的 JSON 对象后退出。",
- "ja": "モジュール情報を <code>moduleInfo.json</code> から読み込みます。無い場合は <code><実行ファイル> -info</code> を実行し、下記の JSON オブジェクトを出力して終了する必要があります。"
- },
- {
- "en": "It starts the binary again as a long-running server with the two flags below, and begins proxying to it.",
- "zh-tw": "再次以下列兩個參數啟動該執行檔,作為持續運行的伺服器,並開始對它做代理。",
- "zh-cn": "再次以下列两个参数启动该可执行文件,作为持续运行的服务器,并开始对它做代理。",
- "ja": "次の 2 つのフラグを付けてもう一度起動し、常駐サーバーとして動かして、プロキシを開始します。"
- }
- ]
- },
- {
- "code": "demo_linux_amd64 -port :12810 -rpt http://localhost:8080/api/ajgi/interface",
- "text": {
- "en": "<code>-port</code> is the next free port counting up from <code>12810</code>. <code>-rpt</code> is the AGI gateway of this ArozOS, the address a subservice calls back (see below).",
- "zh-tw": "<code>-port</code> 是從 <code>12810</code> 起算的下一個可用連接埠。<code>-rpt</code> 是這個 ArozOS 的 AGI 閘道,子服務透過它呼叫回 ArozOS(見下文)。",
- "zh-cn": "<code>-port</code> 是从 <code>12810</code> 起算的下一个可用端口。<code>-rpt</code> 是这个 ArozOS 的 AGI 网关,子服务通过它回调 ArozOS(见下文)。",
- "ja": "<code>-port</code> は <code>12810</code> から数えて最初に空いているポートです。<code>-rpt</code> はこの ArozOS の AGI ゲートウェイで、サブサービスが ArozOS を呼び返すときのアドレスです(後述)。"
- },
- "note": {
- "en": "At boot, a subservice whose module information cannot be read, or that asks for a reserved path, stops ArozOS from starting. When an admin starts a service later, the same problem only shows an error.",
- "zh-tw": "開機時,若某個子服務的模組資訊無法讀取,或要求使用保留路徑,ArozOS 將無法啟動。管理員之後再手動啟動服務時,同樣的問題只會顯示錯誤。",
- "zh-cn": "开机时,若某个子服务的模块信息无法读取,或请求使用保留路径,ArozOS 将无法启动。管理员之后再手动启动服务时,同样的问题只会显示错误。",
- "ja": "起動時にモジュール情報を読み取れないサブサービスや、予約済みのパスを要求するサブサービスがあると、ArozOS が起動しません。管理者があとから手動で起動した場合は、同じ問題でもエラーが表示されるだけです。"
- }
- }
- ]
- },
- {
- "type": "doc",
- "id": "module-info",
- "title": {
- "en": "Describing the module",
- "zh-tw": "描述模組",
- "zh-cn": "描述模块",
- "ja": "モジュールの記述"
- },
- "text": {
- "en": "The module information is one JSON object. It is the same <code>ModuleInfo</code> that every WebApp registers with, so a subservice appears on the desktop like any other app.",
- "zh-tw": "模組資訊是一個 JSON 物件,與每個 WebApp 註冊時使用的 <code>ModuleInfo</code> 相同,因此子服務會像其他應用程式一樣出現在桌面上。",
- "zh-cn": "模块信息是一个 JSON 对象,与每个 WebApp 注册时使用的 <code>ModuleInfo</code> 相同,因此子服务会像其他应用一样出现在桌面上。",
- "ja": "モジュール情報は 1 つの JSON オブジェクトです。すべての WebApp が登録に使うのと同じ <code>ModuleInfo</code> なので、サブサービスもほかのアプリと同じようにデスクトップに表示されます。"
- },
- "items": [
- {
- "code": "{\n \"Name\": \"Demo Subservice\",\n \"Desc\": \"A simple subservice showing how subservices work in ArozOS\",\n \"Group\": \"Development\",\n \"IconPath\": \"demo/icon.png\",\n \"Version\": \"0.0.1\",\n \"StartDir\": \"demo/home.html\",\n \"SupportFW\": true,\n \"LaunchFWDir\": \"demo/home.html\",\n \"SupportEmb\": true,\n \"LaunchEmb\": \"demo/embedded.html\",\n \"InitFWSize\": [720, 480],\n \"InitEmbSize\": [720, 480],\n \"SupportedExt\": [\".txt\", \".md\"]\n}",
- "note": {
- "en": "The folder part of <code>StartDir</code> (here <code>demo</code>) becomes the proxy endpoint. It must not be empty or one of the reserved paths <code>web</code>, <code>system</code>, <code>SystemAO</code>, <code>img</code>, <code>STDIN</code>, <code>STDOUT</code>, <code>STDERR</code>, <code>COM</code>, <code>ws</code>, <code>cluster</code> and <code>app</code>.",
- "zh-tw": "<code>StartDir</code> 的資料夾部分(此處為 <code>demo</code>)就是代理端點。它不可為空,也不可是保留路徑 <code>web</code>、<code>system</code>、<code>SystemAO</code>、<code>img</code>、<code>STDIN</code>、<code>STDOUT</code>、<code>STDERR</code>、<code>COM</code>、<code>ws</code>、<code>cluster</code> 與 <code>app</code>。",
- "zh-cn": "<code>StartDir</code> 的文件夹部分(此处为 <code>demo</code>)就是代理端点。它不可为空,也不可是保留路径 <code>web</code>、<code>system</code>、<code>SystemAO</code>、<code>img</code>、<code>STDIN</code>、<code>STDOUT</code>、<code>STDERR</code>、<code>COM</code>、<code>ws</code>、<code>cluster</code> 与 <code>app</code>。",
- "ja": "<code>StartDir</code> のフォルダ部分(ここでは <code>demo</code>)がプロキシのエンドポイントになります。空にはできず、予約済みの <code>web</code>、<code>system</code>、<code>SystemAO</code>、<code>img</code>、<code>STDIN</code>、<code>STDOUT</code>、<code>STDERR</code>、<code>COM</code>、<code>ws</code>、<code>cluster</code>、<code>app</code> も使えません。"
- }
- }
- ]
- },
- {
- "type": "specs",
- "tone": "alt",
- "title": {
- "en": "Module fields",
- "zh-tw": "模組欄位",
- "zh-cn": "模块字段",
- "ja": "モジュールのフィールド"
- },
- "items": [
- {
- "title": "Name",
- "text": {
- "en": "Shown on the desktop. Access is granted by this name, so keep it unique.",
- "zh-tw": "顯示在桌面上。權限依此名稱授予,請確保它不重複。",
- "zh-cn": "显示在桌面上。权限依此名称授予,请确保它不重复。",
- "ja": "デスクトップに表示される名前です。権限はこの名前で付与されるため、重複しないようにしてください。"
- }
- },
- {
- "title": "Desc",
- "text": {
- "en": "A short description.",
- "zh-tw": "簡短說明。",
- "zh-cn": "简短说明。",
- "ja": "短い説明文です。"
- }
- },
- {
- "title": "Group",
- "text": {
- "en": "Start menu category: <code>Media</code>, <code>Office</code>, <code>Internet</code>, <code>Engineering</code>, <code>Development</code>, <code>System Tools</code> or <code>Utilities</code>; anything else is listed under Other. <code>Utilities</code> and <code>System Tools</code> are open to every user, every other group needs a permission group grant.",
- "zh-tw": "開始選單分類:<code>Media</code>、<code>Office</code>、<code>Internet</code>、<code>Engineering</code>、<code>Development</code>、<code>System Tools</code> 或 <code>Utilities</code>;其他值會列在「其他」。<code>Utilities</code> 與 <code>System Tools</code> 對所有使用者開放,其他分類需由權限群組授權。",
- "zh-cn": "开始菜单分类:<code>Media</code>、<code>Office</code>、<code>Internet</code>、<code>Engineering</code>、<code>Development</code>、<code>System Tools</code> 或 <code>Utilities</code>;其他值会列在“其他”。<code>Utilities</code> 与 <code>System Tools</code> 对所有用户开放,其他分类需由权限组授权。",
- "ja": "スタートメニューの分類:<code>Media</code>、<code>Office</code>、<code>Internet</code>、<code>Engineering</code>、<code>Development</code>、<code>System Tools</code>、<code>Utilities</code>。それ以外は「その他」に入ります。<code>Utilities</code> と <code>System Tools</code> は全ユーザーに開放され、ほかの分類は権限グループへの付与が必要です。"
- }
- },
- {
- "title": "IconPath",
- "text": {
- "en": "The icon, as a path the service serves, such as <code>demo/icon.png</code>.",
- "zh-tw": "圖示,為服務所提供的路徑,例如 <code>demo/icon.png</code>。",
- "zh-cn": "图标,为服务所提供的路径,例如 <code>demo/icon.png</code>。",
- "ja": "アイコン。サービスが配信するパスで指定します(例:<code>demo/icon.png</code>)。"
- }
- },
- {
- "title": "Version",
- "text": {
- "en": "A version string such as <code>0.0.1</code>.",
- "zh-tw": "版本字串,例如 <code>0.0.1</code>。",
- "zh-cn": "版本字符串,例如 <code>0.0.1</code>。",
- "ja": "<code>0.0.1</code> のようなバージョン文字列です。"
- }
- },
- {
- "title": "StartDir",
- "text": {
- "en": "The page that opens in a full page window. Its folder is the proxy endpoint.",
- "zh-tw": "以整頁視窗開啟的頁面。其資料夾即為代理端點。",
- "zh-cn": "以整页窗口打开的页面。其文件夹即为代理端点。",
- "ja": "フルページで開くページです。そのフォルダがプロキシのエンドポイントになります。"
- }
- },
- {
- "title": "SupportFW, LaunchFWDir, InitFWSize",
- "text": {
- "en": "Open in a floating window: whether it is supported, the page to load and the starting size as <code>[width, height]</code>.",
- "zh-tw": "以浮動視窗開啟:是否支援、要載入的頁面,以及起始大小 <code>[寬, 高]</code>。",
- "zh-cn": "以浮动窗口打开:是否支持、要加载的页面,以及起始大小 <code>[宽, 高]</code>。",
- "ja": "フローティングウィンドウで開く設定です。対応するかどうか、読み込むページ、開始サイズ <code>[幅, 高さ]</code> を指定します。"
- }
- },
- {
- "title": "SupportEmb, LaunchEmb, InitEmbSize",
- "text": {
- "en": "Embedded mode, which is what loads when a file is opened with the module. Same three settings.",
- "zh-tw": "嵌入模式,也就是以此模組開啟檔案時載入的模式。設定項目相同。",
- "zh-cn": "嵌入模式,也就是以此模块打开文件时加载的模式。设置项相同。",
- "ja": "埋め込みモードです。このモジュールでファイルを開くときに読み込まれます。設定項目は同じ 3 つです。"
- }
- },
- {
- "title": "SupportedExt",
- "text": {
- "en": "File extensions the module can open, such as <code>[\".txt\", \".md\"]</code>. They let it become a default opener.",
- "zh-tw": "模組可開啟的副檔名,例如 <code>[\".txt\", \".md\"]</code>,讓它能成為預設開啟程式。",
- "zh-cn": "模块可打开的扩展名,例如 <code>[\".txt\", \".md\"]</code>,让它能成为默认打开程序。",
- "ja": "モジュールが開ける拡張子です(例:<code>[\".txt\", \".md\"]</code>)。既定のアプリとして設定できるようになります。"
- }
- }
- ]
- },
- {
- "type": "doc",
- "id": "proxy",
- "title": {
- "en": "How requests reach the service",
- "zh-tw": "請求如何送達服務",
- "zh-cn": "请求如何送达服务",
- "ja": "リクエストがサービスに届くまで"
- },
- "items": [
- {
- "bullets": [
- {
- "en": "Only signed in users who have permission for the module get through. Everyone else receives a 404.",
- "zh-tw": "只有已登入且擁有該模組權限的使用者能通過,其他人會收到 404。",
- "zh-cn": "只有已登录且拥有该模块权限的用户能通过,其他人会收到 404。",
- "ja": "ログイン済みで、そのモジュールの権限を持つユーザーだけが通れます。それ以外は 404 になります。"
- },
- {
- "en": "The endpoint folder is removed from the path: <code>/demo/api/list?a=1</code> reaches the service as <code>/api/list?a=1</code> and <code>/demo/</code> as <code>/</code>. Pages should therefore use relative links, or links that begin with the endpoint folder: a link to <code>/api/list</code> would hit ArozOS itself.",
- "zh-tw": "代理端點資料夾會從路徑中移除:<code>/demo/api/list?a=1</code> 送達服務時是 <code>/api/list?a=1</code>,<code>/demo/</code> 則是 <code>/</code>。因此頁面應使用相對連結,或以端點資料夾開頭的連結;指向 <code>/api/list</code> 的連結會打到 ArozOS 本身。",
- "zh-cn": "代理端点文件夹会从路径中移除:<code>/demo/api/list?a=1</code> 送达服务时是 <code>/api/list?a=1</code>,<code>/demo/</code> 则是 <code>/</code>。因此页面应使用相对链接,或以端点文件夹开头的链接;指向 <code>/api/list</code> 的链接会打到 ArozOS 本身。",
- "ja": "エンドポイントのフォルダはパスから取り除かれます。<code>/demo/api/list?a=1</code> はサービスには <code>/api/list?a=1</code>、<code>/demo/</code> は <code>/</code> として届きます。そのためページ内のリンクは相対パスか、エンドポイントのフォルダで始まるパスにしてください。<code>/api/list</code> へのリンクは ArozOS 自身に届いてしまいます。"
- },
- {
- "en": "ArozOS adds three request headers: <code>aouser</code> (the user name), <code>aotoken</code> (a token for that user) and <code>X-Forwarded-Host</code> (the host the browser used).",
- "zh-tw": "ArozOS 會加上三個請求標頭:<code>aouser</code>(使用者名稱)、<code>aotoken</code>(該使用者的權杖)與 <code>X-Forwarded-Host</code>(瀏覽器使用的主機)。",
- "zh-cn": "ArozOS 会加上三个请求头:<code>aouser</code>(用户名)、<code>aotoken</code>(该用户的令牌)与 <code>X-Forwarded-Host</code>(浏览器使用的主机)。",
- "ja": "ArozOS は 3 つのリクエストヘッダーを付けます。<code>aouser</code>(ユーザー名)、<code>aotoken</code>(そのユーザーのトークン)、<code>X-Forwarded-Host</code>(ブラウザが使ったホスト)です。"
- },
- {
- "en": "WebSocket connections are proxied as well. Those requests also carry <code>A-Upgrade: websocket</code>.",
- "zh-tw": "WebSocket 連線同樣會被代理,這類請求還會帶有 <code>A-Upgrade: websocket</code>。",
- "zh-cn": "WebSocket 连接同样会被代理,这类请求还会带有 <code>A-Upgrade: websocket</code>。",
- "ja": "WebSocket 接続もプロキシされます。その場合は <code>A-Upgrade: websocket</code> も付きます。"
- },
- {
- "en": "If the service stops answering, ArozOS logs it, kills the process and starts it again after 10 seconds.",
- "zh-tw": "若服務停止回應,ArozOS 會記錄下來、終止該行程,並在 10 秒後重新啟動。",
- "zh-cn": "若服务停止响应,ArozOS 会记录下来、终止该进程,并在 10 秒后重新启动。",
- "ja": "サービスが応答しなくなると、ArozOS はログに記録してプロセスを終了し、10 秒後に再起動します。"
- }
- ],
- "note": {
- "en": "The headers are only as trustworthy as the port. A service that listens on all interfaces lets anyone who can reach the port send <code>aouser</code> themselves, so bind to <code>127.0.0.1</code> or block the ports from <code>12810</code> upward from outside.",
- "zh-tw": "這些標頭的可信度取決於連接埠。若服務監聽所有網路介面,任何連得到該連接埠的人都能自行送出 <code>aouser</code>,因此請綁定到 <code>127.0.0.1</code>,或從外部封鎖 <code>12810</code> 起的連接埠。",
- "zh-cn": "这些请求头的可信度取决于端口。若服务监听所有网络接口,任何连得到该端口的人都能自行发送 <code>aouser</code>,因此请绑定到 <code>127.0.0.1</code>,或从外部封锁 <code>12810</code> 起的端口。",
- "ja": "これらのヘッダーの信頼性はポート次第です。すべてのインターフェースで待ち受けると、そのポートに届く人なら誰でも <code>aouser</code> を自分で送れてしまいます。<code>127.0.0.1</code> にバインドするか、<code>12810</code> 以降のポートを外部から遮断してください。"
- }
- }
- ]
- },
- {
- "type": "doc",
- "id": "agi",
- "title": {
- "en": "Calling back into ArozOS",
- "zh-tw": "回呼 ArozOS",
- "zh-cn": "回调 ArozOS",
- "ja": "ArozOS を呼び返す"
- },
- "text": {
- "en": "A subservice reaches ArozOS functions through the AGI gateway, the address it received in <code>-rpt</code>. POST the user's token and a script. The script runs in the AGI runtime with that user's permissions, and whatever it sends with <code>sendJSONResp</code> is the response body.",
- "zh-tw": "子服務透過 AGI 閘道(即 <code>-rpt</code> 收到的位址)使用 ArozOS 的功能。以 POST 送出使用者的權杖與一段腳本,腳本會以該使用者的權限在 AGI 執行環境中執行,並將 <code>sendJSONResp</code> 送出的內容作為回應。",
- "zh-cn": "子服务通过 AGI 网关(即 <code>-rpt</code> 收到的地址)使用 ArozOS 的功能。以 POST 发送用户的令牌与一段脚本,脚本会以该用户的权限在 AGI 运行环境中执行,并将 <code>sendJSONResp</code> 发出的内容作为响应。",
- "ja": "サブサービスは、<code>-rpt</code> で受け取った AGI ゲートウェイ経由で ArozOS の機能を使います。ユーザーのトークンとスクリプトを POST すると、スクリプトはそのユーザーの権限で AGI ランタイム内で実行され、<code>sendJSONResp</code> で送った内容がレスポンスになります。"
- },
- "items": [
- {
- "code": "func listDesktop(w http.ResponseWriter, r *http.Request) {\n\ttoken := r.Header.Get(\"aotoken\")\n\tscript := `\n\t\trequirelib(\"filelib\");\n\t\tvar list = filelib.glob(\"user:/Desktop/*\");\n\t\tsendJSONResp(JSON.stringify(list));\n\t`\n\t// rpt is the value of the -rpt flag\n\tresp, err := http.PostForm(rpt, url.Values{\n\t\t\"token\": {token},\n\t\t\"script\": {script},\n\t})\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadGateway)\n\t\treturn\n\t}\n\tdefer resp.Body.Close()\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tio.Copy(w, resp.Body)\n}",
- "note": {
- "en": "The form fields are <code>token</code> (the <code>aotoken</code> header of the request) and <code>script</code>. The status code of the reply is not enough to know the script worked, so check what it returned.",
- "zh-tw": "表單欄位為 <code>token</code>(請求中的 <code>aotoken</code> 標頭)與 <code>script</code>。僅憑回應的狀態碼無法確定腳本是否成功,請檢查它回傳的內容。",
- "zh-cn": "表单字段为 <code>token</code>(请求中的 <code>aotoken</code> 请求头)与 <code>script</code>。仅凭响应的状态码无法确定脚本是否成功,请检查它返回的内容。",
- "ja": "フォームのフィールドは <code>token</code>(リクエストの <code>aotoken</code> ヘッダー)と <code>script</code> です。ステータスコードだけではスクリプトが成功したか分からないので、返ってきた内容を確認してください。"
- }
- }
- ]
- },
- {
- "type": "doc",
- "id": "example",
- "title": {
- "en": "A minimal service",
- "zh-tw": "最精簡的服務",
- "zh-cn": "最精简的服务",
- "ja": "最小のサービス"
- },
- "text": {
- "en": "This Go program answers <code>-info</code>, serves a <code>web/</code> folder and has one API that greets the signed in user.",
- "zh-tw": "這支 Go 程式會回應 <code>-info</code>、提供 <code>web/</code> 資料夾的內容,並有一個向已登入使用者問好的 API。",
- "zh-cn": "这个 Go 程序会响应 <code>-info</code>、提供 <code>web/</code> 文件夹的内容,并有一个向已登录用户问好的 API。",
- "ja": "この Go プログラムは <code>-info</code> に応答し、<code>web/</code> フォルダを配信し、ログイン中のユーザーに挨拶する API を 1 つ持っています。"
- },
- "items": [
- {
- "code": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tinfo := flag.Bool(\"info\", false, \"print the module information and exit\")\n\tport := flag.String(\"port\", \":8000\", \"listen address chosen by ArozOS\")\n\tflag.String(\"rpt\", \"\", \"AGI gateway of ArozOS\")\n\tflag.Parse()\n\n\tif *info {\n\t\tb, _ := json.Marshal(map[string]any{\n\t\t\t\"Name\": \"Demo Subservice\",\n\t\t\t\"Desc\": \"A simple subservice\",\n\t\t\t\"Group\": \"Development\",\n\t\t\t\"IconPath\": \"demo/icon.png\",\n\t\t\t\"Version\": \"0.0.1\",\n\t\t\t\"StartDir\": \"demo/home.html\",\n\t\t\t\"SupportFW\": true,\n\t\t\t\"LaunchFWDir\": \"demo/home.html\",\n\t\t\t\"InitFWSize\": []int{720, 480},\n\t\t})\n\t\tfmt.Println(string(b))\n\t\treturn\n\t}\n\n\thttp.HandleFunc(\"/whoami\", func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprintln(w, \"Hello\", r.Header.Get(\"aouser\"))\n\t})\n\thttp.Handle(\"/\", http.FileServer(http.Dir(\"./web\")))\n\tlog.Println(\"demo listening on\", *port)\n\tlog.Fatal(http.ListenAndServe(*port, nil))\n}",
- "text": {
- "en": "The complete example, with a web page, an AGI call, an icon and build scripts for every platform, is in the example repository.",
- "zh-tw": "完整的範例包含網頁、AGI 呼叫、圖示,以及各平台的建置腳本,放在範例儲存庫中。",
- "zh-cn": "完整的示例包含网页、AGI 调用、图标,以及各平台的构建脚本,放在示例仓库中。",
- "ja": "Web ページ、AGI 呼び出し、アイコン、各プラットフォーム向けのビルドスクリプトを含む完全なサンプルは、サンプルリポジトリにあります。"
- },
- "buttons": [
- {
- "href": "https://github.com/aroz-online/ArozOS-Subservice-Example",
- "style": "secondary",
- "icon": "github",
- "label": {
- "en": "Subservice example",
- "zh-tw": "子服務範例",
- "zh-cn": "子服务示例",
- "ja": "サブサービスのサンプル"
- }
- }
- ]
- }
- ]
- },
- {
- "type": "specs",
- "tone": "alt",
- "id": "marker-files",
- "title": {
- "en": "Marker files",
- "zh-tw": "標記檔案",
- "zh-cn": "标记文件",
- "ja": "マーカーファイル"
- },
- "text": {
- "en": "Empty files placed in the service folder change how it is started. They are read each time the service starts.",
- "zh-tw": "放在服務資料夾中的空檔案會改變它的啟動方式,每次服務啟動時都會讀取。",
- "zh-cn": "放在服务文件夹中的空文件会改变它的启动方式,每次服务启动时都会读取。",
- "ja": "サービスのフォルダに置く空のファイルで、起動方法を変えられます。サービスの起動のたびに読み込まれます。"
- },
- "items": [
- {
- "title": ".disabled",
- "text": {
- "en": "Skip this service at boot. ArozOS writes it itself when an admin stops the service, and removes it when the service is started again.",
- "zh-tw": "開機時略過此服務。管理員停止服務時 ArozOS 會自行寫入此檔,再次啟動服務時則會移除。",
- "zh-cn": "开机时跳过此服务。管理员停止服务时 ArozOS 会自行写入此文件,再次启动服务时则会移除。",
- "ja": "起動時にこのサービスを読み飛ばします。管理者がサービスを停止すると ArozOS が自分で作成し、再び起動すると削除します。"
- }
- },
- {
- "title": ".noproxy",
- "text": {
- "en": "Compatibility mode. The program is started without arguments and no proxy is set up, for software that was not written for ArozOS.",
- "zh-tw": "相容模式。程式不帶參數啟動,也不建立代理,適用於並非為 ArozOS 而寫的軟體。",
- "zh-cn": "兼容模式。程序不带参数启动,也不建立代理,适用于并非为 ArozOS 而写的软件。",
- "ja": "互換モードです。引数なしでプログラムを起動し、プロキシは設定しません。ArozOS 向けに作られていないソフトウェア用です。"
- }
- },
- {
- "title": ".startscript",
- "text": {
- "en": "Start <code>start.sh</code> (<code>start.bat</code> on Windows) from the service folder instead of the binary, for example to wrap a program that needs more arguments. The script receives <code>-port</code> and <code>-rpt</code> like a binary would.",
- "zh-tw": "改為啟動服務資料夾中的 <code>start.sh</code>(Windows 為 <code>start.bat</code>),而不是執行檔,例如用來包裝需要更多參數的程式。腳本會像執行檔一樣收到 <code>-port</code> 與 <code>-rpt</code>。",
- "zh-cn": "改为启动服务文件夹中的 <code>start.sh</code>(Windows 为 <code>start.bat</code>),而不是可执行文件,例如用来包装需要更多参数的程序。脚本会像可执行文件一样收到 <code>-port</code> 与 <code>-rpt</code>。",
- "ja": "バイナリの代わりに、サービスのフォルダにある <code>start.sh</code>(Windows では <code>start.bat</code>)を起動します。追加の引数が必要なプログラムを包むときなどに使います。スクリプトにも、バイナリと同じく <code>-port</code> と <code>-rpt</code> が渡されます。"
- }
- },
- {
- "title": ".intport",
- "text": {
- "en": "Pass the port as <code>12810</code> instead of <code>:12810</code>, for programs that do not accept a leading colon.",
- "zh-tw": "以 <code>12810</code> 而非 <code>:12810</code> 傳遞連接埠,適用於不接受前置冒號的程式。",
- "zh-cn": "以 <code>12810</code> 而非 <code>:12810</code> 传递端口,适用于不接受前置冒号的程序。",
- "ja": "ポートを <code>:12810</code> ではなく <code>12810</code> として渡します。先頭のコロンを受け付けないプログラム用です。"
- }
- },
- {
- "title": "moduleInfo.json",
- "text": {
- "en": "The module information as a file. When it exists, ArozOS does not run the binary with <code>-info</code>.",
- "zh-tw": "以檔案提供的模組資訊。存在時,ArozOS 不會以 <code>-info</code> 執行該執行檔。",
- "zh-cn": "以文件提供的模块信息。存在时,ArozOS 不会以 <code>-info</code> 运行该可执行文件。",
- "ja": "ファイルで用意したモジュール情報です。存在する場合、ArozOS はバイナリを <code>-info</code> 付きで実行しません。"
- }
- }
- ]
- },
- {
- "type": "doc",
- "id": "runtime",
- "title": {
- "en": "Managing services",
- "zh-tw": "管理服務",
- "zh-cn": "管理服务",
- "ja": "サービスの管理"
- },
- "text": {
- "en": "Admins start and stop services from System Settings, which uses these endpoints:",
- "zh-tw": "管理員可在系統設定中啟動與停止服務,該頁面使用以下端點:",
- "zh-cn": "管理员可在系统设置中启动与停止服务,该页面使用以下端点:",
- "ja": "管理者はシステム設定からサービスを起動・停止できます。その画面は次のエンドポイントを使っています。"
- },
- "items": [
- {
- "bullets": [
- {
- "en": "<code>/system/subservice/list</code> lists the running and the disabled services.",
- "zh-tw": "<code>/system/subservice/list</code> 列出執行中與已停用的服務。",
- "zh-cn": "<code>/system/subservice/list</code> 列出运行中与已停用的服务。",
- "ja": "<code>/system/subservice/list</code> は、動作中と無効化されたサービスを一覧します。"
- },
- {
- "en": "<code>/system/subservice/kill</code> stops a service. Admin only, with the form field <code>serviceDir</code> set to its folder name.",
- "zh-tw": "<code>/system/subservice/kill</code> 停止服務。僅限管理員,表單欄位 <code>serviceDir</code> 為其資料夾名稱。",
- "zh-cn": "<code>/system/subservice/kill</code> 停止服务。仅限管理员,表单字段 <code>serviceDir</code> 为其文件夹名称。",
- "ja": "<code>/system/subservice/kill</code> はサービスを停止します。管理者のみで、フォームのフィールド <code>serviceDir</code> にフォルダ名を指定します。"
- },
- {
- "en": "<code>/system/subservice/start</code> starts one. Admin only, same field.",
- "zh-tw": "<code>/system/subservice/start</code> 啟動服務。僅限管理員,欄位相同。",
- "zh-cn": "<code>/system/subservice/start</code> 启动服务。仅限管理员,字段相同。",
- "ja": "<code>/system/subservice/start</code> はサービスを起動します。管理者のみで、フィールドは同じです。"
- }
- ],
- "note": {
- "en": "Start ArozOS with <code>-disable_subservice</code> to turn the whole feature off.",
- "zh-tw": "以 <code>-disable_subservice</code> 啟動 ArozOS 即可完全關閉此功能。",
- "zh-cn": "以 <code>-disable_subservice</code> 启动 ArozOS 即可完全关闭此功能。",
- "ja": "ArozOS を <code>-disable_subservice</code> 付きで起動すると、この機能全体を無効にできます。"
- }
- }
- ]
- },
- {
- "type": "cta",
- "title": {
- "en": "Already running a subservice?",
- "zh-tw": "已經在使用子服務?",
- "zh-cn": "已经在使用子服务?",
- "ja": "すでにサブサービスを使っていますか?"
- },
- "text": {
- "en": "The example repository is the best reference for how one is built. Keep in mind that the infrastructure is no longer maintained.",
- "zh-tw": "範例儲存庫是了解子服務如何建置的最佳參考。請記得,此架構已不再維護。",
- "zh-cn": "示例仓库是了解子服务如何构建的最佳参考。请记住,此架构已不再维护。",
- "ja": "サンプルリポジトリは、サブサービスの作り方を知る最良の資料です。ただし、この基盤はもうメンテナンスされていないことにご注意ください。"
- },
- "buttons": [
- {
- "href": "https://github.com/aroz-online/ArozOS-Subservice-Example",
- "style": "primary",
- "icon": "github",
- "label": {
- "en": "Subservice example",
- "zh-tw": "子服務範例",
- "zh-cn": "子服务示例",
- "ja": "サブサービスのサンプル"
- }
- },
- {
- "href": "@makers",
- "style": "secondary",
- "label": {
- "en": "Build a WebApp instead",
- "zh-tw": "改為開發 WebApp",
- "zh-cn": "改为开发 WebApp",
- "ja": "代わりに WebApp を作る"
- }
- }
- ]
- }
- ]
- }
|