Armadra

使用

自托管部署与远程访问

在局域网或互联网上访问 Armadra:桌面对外服务、常开的服务器壳、中转、配对、浏览器访问与共享工作空间。


想从手机、另一台电脑或浏览器用上这台机器上的 Armadra,或者把工作空间共享给别人,看这一页。无窗口、常开的部署方式在下文称为服务器壳。终端、Git 与 Agent 始终在运行 Armadra 的那台机器上执行,访问端只是客户端。

先选一种方式

桌面「允许其他设备访问」 服务器壳
跑在哪 你的桌面,开着桌面应用才在 服务器或 NAS,常开
证书 本地 CA,手机装一次 自签名;对公网用 ACME 或自有证书
适合 自己的手机、局域网里临时给别人看 多人长期共享、离开桌面也要用、对公网
Agent 在哪跑 桌面上 服务器上,CLI 要在服务器里装好并登录

只给自己的手机用,开桌面的就够;要多人、常开或对公网,用服务器壳。

桌面:允许其他设备访问

  1. 打开「设置 → 远程访问」,在「这台电脑」下打开「允许其他设备访问这台电脑」。开着时,同一局域网内的设备可以访问。
  2. 点「连接手机」。出现一张配对卡:二维码、「复制链接」、两分钟倒计时与证书指纹;局域网与互联网两条路都装在同一张码里。
  3. 手机相机扫码,在浏览器里按引导安装证书,再点「连接」。原生 App 在 App 内扫码,详见手机 App。
  4. 配对码过期后点「新配对码」重新生成。局域网内的配对卡还会给一个 8 位「配对码」(形如 XXXX-XXXX),手机在连接页输入即可,一次性、与二维码同时过期。
  5. 关闭开关即断开经它进来的所有连接。

已配对的设备在「设置 → 账号与设备」里按名称、平台、添加时间、最近访问和权限列出,可以随时「撤销」。

「设置 → 远程访问」里「高级」折叠着这些选项:

  • 「监听地址」:「仅本机」「局域网」或「所有网络」,缺省是局域网。
  • 「证书」:「本地 CA」(缺省)、「指定文件」或「ACME」。用本地 CA 时,手机要先装一次 CA(「下载 CA」,iOS 与 Android 的步骤在配对页上),换地址后证书会自动重签。
  • 「中转账号」、分享链接与流量。

互联网访问

「设置 → 远程访问」里的「互联网访问」一行缺省走 Armadra 云:已登记会显示「Armadra 云」与所在空间,可以「更换」(原空间里的授予与分享链接会失效);还没登录或登记的,点开后按提示登录再登记。步骤见团队与控制台。只有中转账号的,也可以用中转账号一键启用。

也可以不用 Armadra 云,自己准备:

  • 中转账号:在「高级」点「添加中转账号」,填中转的地址、账号与口令,核对证书指纹后登录。电脑经中转出站连接,不开入站端口。经中转的连接是端到端加密的,中转只转发密文。
  • 自己的网络方案:Tailscale、WireGuard、Cloudflare Tunnel 等,服务器壳的 --public-origin 写用户实际访问的地址。

要从这台电脑用你的另一台电脑,在「我的其他电脑」下点「配对另一台我的电脑」,填对方的地址或配对链接(或配对码)后「连接」。侧栏里工作空间按「这台电脑」「我的其他电脑」「他人分享」分组,点哪个工作空间就打开哪块画布。

服务器壳

推荐用容器:

mkdir -p /srv/armadra && cd /srv/armadra
curl -fsSLO https://raw.githubusercontent.com/AMA-Link/Armadra/main/apps/server/docker/compose.yml
# 改 compose.yml 里的 ARMADRA_PUBLIC_ORIGIN 与 ARMADRA_ACME_EMAIL
docker compose up -d
docker compose logs armadra | grep "armadra-server pairing"

ARMADRA_PUBLIC_ORIGIN 必须和浏览器地址栏里的地址一致。桌面安装包里也带着服务器壳,可以用 serve 子命令直接起服务,不需要 Node 与源码:

# macOS
/Applications/Armadra.app/Contents/MacOS/Armadra serve --data-dir ~/.armadra-server --listen 127.0.0.1:8443

服务器壳上的远程访问页是只读的,监听、证书与来源由命令行和环境变量设置。浏览器节点需要服务器上有 Chromium,缺省镜像不带,找不到时页面不提供「新建浏览器」。

首个管理员与成员

  1. 启动日志里有一行配对链接 armadra-server pairing …,两分钟内有效、只能用一次。过期了:docker compose kill -s SIGUSR2 armadra 再生成一张。
  2. 第一个兑换的人成为管理员。
  3. 之后在「设置 → 成员与共享」「添加成员」,或「生成邀请」发邀请链接、建「组」,再按工作空间共享。共享时选对象、范围(整台、工作空间或会话)与角色。
角色 能做什么
查看 看画布与终端画面
编辑 再加上编辑画布
执行 再加上开自己的终端、启动 Agent、读写文件与 Git
接管 再加上向他人的终端与 Agent 输入、答复审批

撤销共享会立即断开对方的连接。成员忘了口令,管理员可以在成员行的菜单里签发一次性重置链接,也可以「重置两步验证」。

账号安全

服务器壳支持口令、通行密钥(passkey)、两步验证(TOTP 与恢复码)、GitHub / OIDC 登录,带限流与锁定。

从浏览器访问

在任何设备的浏览器里打开服务器壳的地址(ARMADRA_PUBLIC_ORIGIN),或登记到 Armadra 云后在控制台点主机的「打开」,就是同一份画布页面;手机浏览器上是底部导航加单节点焦点页,见手机 App。第一次进入用配对链接或邀请链接,之后按账号登录。没有登录会话时显示整页登录。

共享工作空间

把一块画布共享给别人,对方以访客身份加入:

  1. 在画布右上角点「分享」(或工作空间菜单里的「分享」),选范围:「此工作空间」或「仅此会话」,选权限与有效期。权限有「只读」(缺省)、「可编辑」与「可执行」,有效期缺省 7 天,可选 1 天或 30 天;「可接管」只能在设置里授予。
  2. 互联网路线还没开启时,弹层里就地开启,没有账号先登录。
  3. 点「创建链接」,复制链接或让对方扫二维码。
  4. 对方打开链接,点「加入」,画布出现在他侧栏的「他人分享」里,上面标着主人、权限与到期时间;不想要了点「退出」。

在「设置 → 远程访问」的链接列表里,可以「新建链接」、设「备注」与「可用次数」、「撤销」,也能看到已过期或用尽的历史。撤销链接后,经它加入的人一并断开。

完整步骤(证书、反向代理、备份、升级回滚、推送)见 Armadra 仓库的服务器部署指南。

Guides

Self-hosting and remote access

Reach Armadra over the local network or the internet, with desktop sharing, an always-on server shell, relays, pairing, browser access and shared workspaces.


Read this page when you want to use the Armadra on one machine from a phone, another computer or a browser, or share a workspace with other people. The windowless, always-on deployment is called the server shell below. Terminals, Git and agents always run on the machine that runs Armadra; the device you connect from is only a client.

Choose a way first

Desktop “Allow other devices” Server shell
Where it runs Your desktop, only while the app is open A server or NAS, always on
Certificate Local CA, installed once on the phone Self-signed; ACME or your own certificate for the public internet
Good for Your own phone, showing someone on the local network Long-term sharing among several people, use away from the desktop, the public internet
Where agents run On the desktop On the server; the CLIs must be installed and signed in there

For your own phone only, the desktop option is enough; for several people, always-on or the public internet, use the server shell.

Desktop: allow other devices

  1. Open Settings → Remote access and, under “This computer”, turn on “Allow other devices to access this computer”. While it is on, devices on the same local network can reach it.
  2. Choose “Connect a phone”. A pairing card appears with a QR code, “Copy link”, a two-minute countdown and the certificate fingerprint; the local-network and internet routes are both in the same code.
  3. Scan the code with the phone camera, follow the prompts in the browser to install the certificate, then choose “Connect”. The native app scans inside the app; see Mobile app.
  4. After the code expires choose “New pairing code”. On the local network the card also shows an 8-character “Pairing code” (like XXXX-XXXX) that the phone can enter on its connect page; it is single-use and expires with the QR code.
  5. Turning the switch off disconnects everything that came in through it.

Paired devices are listed under Settings → Account & devices with name, platform, when added, last access and role, and you can “Revoke” any of them.

“Advanced” in Settings → Remote access folds these options:

  • “Listen on”: “This computer only”, “Local network” or “All networks”; the default is the local network.
  • “Certificate”: “Local CA” (default), “Certificate files” or “ACME”. With the local CA the phone must install the CA once (“Download CA”; the iOS and Android steps are on the pairing page), and the certificate is reissued automatically when the address changes.
  • “Remote access accounts”, share links and traffic.

Internet access

The “Internet access” row in Settings → Remote access uses Armadra Cloud by default: once registered it shows “Armadra Cloud” and the space, and you can “Change” it (grants and share links in the old space stop working); if you are not signed in or registered, follow the prompts to sign in and then register. The steps are in Teams and console. If you only have a remote access account, you can turn it on with that in one step.

You can also skip Armadra Cloud and arrange it yourself:

  • Remote access account: under “Advanced” choose “Add remote access account”, enter the relay’s address, account and password, and verify the certificate fingerprint before signing in. The computer connects out through the relay and opens no inbound port. Connections through a relay are end-to-end encrypted; the relay only forwards ciphertext.
  • Your own network setup: Tailscale, WireGuard, Cloudflare Tunnel and the like; give the server shell the address people actually use as --public-origin.

To use another computer of yours from this one, choose “Pair another computer of mine” under “My other computers”, enter its address or pairing link (or pairing code) and choose “Connect”. In the sidebar, workspaces are grouped as “This computer”, “My other computers” and “Shared with me”; choosing a workspace opens its canvas.

Server shell

A container is recommended:

mkdir -p /srv/armadra && cd /srv/armadra
curl -fsSLO https://raw.githubusercontent.com/AMA-Link/Armadra/main/apps/server/docker/compose.yml
# edit ARMADRA_PUBLIC_ORIGIN and ARMADRA_ACME_EMAIL in compose.yml
docker compose up -d
docker compose logs armadra | grep "armadra-server pairing"

ARMADRA_PUBLIC_ORIGIN must match the address in the browser’s address bar. The desktop installer also contains the server shell; start it directly with the serve subcommand, with no Node or source checkout needed:

# macOS
/Applications/Armadra.app/Contents/MacOS/Armadra serve --data-dir ~/.armadra-server --listen 127.0.0.1:8443

On a server shell the Remote access page is read-only; listening, certificates and the public origin are set on the command line and in environment variables. A browser node needs Chromium on the server; the default image does not include it, and without it the page does not offer “New browser”.

First administrator and members

  1. The startup log has a pairing link, armadra-server pairing …, valid for two minutes and usable once. If it expires, run docker compose kill -s SIGUSR2 armadra for a new one.
  2. Whoever redeems it first becomes the administrator.
  3. Then, under Settings → Members & sharing, choose “Add member”, or “Generate” an invitation link and create “Groups”, then share by workspace. When sharing, pick the subject, the scope (whole host, workspace or session) and the role.
Role What they can do
Viewer See the canvas and terminal output
Editor Also edit the canvas
Operator Also open their own terminals, launch agents, and read and write files and Git
Driver Also type into other people’s terminals and agents, and answer approvals

Revoking a share disconnects that person at once. If a member forgets their password, an administrator can issue a one-time reset link from the member’s menu, or “Reset two-step verification”.

Account security

The server shell supports passwords, passkeys, two-step verification (TOTP and recovery codes) and GitHub / OIDC sign-in, with rate limiting and lockout.

Browser access

Open the server shell’s address (ARMADRA_PUBLIC_ORIGIN) in any device’s browser, or, once registered with Armadra Cloud, choose “Open” on the host in the console; you get the same canvas page. On a phone browser it has bottom navigation and a single-node focus page; see Mobile app. The first visit uses a pairing or invitation link, after which you sign in with your account. With no sign-in session, a full-page sign-in is shown.

Sharing a workspace

To share a canvas with someone, who joins as a guest:

  1. On the canvas, choose “Share” at the top right (or “Share” in the workspace menu), then pick the scope, “This workspace” or “Only this session”, the role and the expiry. Roles are “View only” (default), “Can edit” and “Can run”, the expiry defaults to 7 days with 1 or 30 days as options; “Full control” can only be granted in settings.
  2. If the Internet route is not on yet, turn it on right in the popover; sign in first if you have no account.
  3. Choose “Create link”, then copy it or let them scan the QR code.
  4. They open the link and choose “Join”; the canvas appears under “Shared with me” in their sidebar, labelled with the owner, role and expiry. “Leave” removes it.

In the link list in Settings → Remote access you can create a “New link”, set a “Note” and “Uses”, “Revoke”, and see expired or used-up links in the history. Revoking a link also disconnects everyone who joined through it.

For the full steps (certificates, reverse proxies, backup, upgrade and rollback, push) see the server deployment guide in the Armadra repository.

在 GitHub 上编辑本页 Edit this page on GitHub