Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ./start.sh (or bash scripts/configure.sh) generates .env with unique local database/session secrets.
# Platform image: empty uses the GHCR release pinned in compose.yaml. Prefer an @sha256: digest when overriding.
# Slow ghcr.io links: MIRROR=ghcr.nju.edu.cn ./start.sh replaces the ghcr.io host and tags the image back. See README.zh-CN.md.
# ./start.sh times ghcr.io and ghcr.nju.edu.cn. MIRROR=ghcr.io or MIRROR=ghcr.nju.edu.cn forces one host. See README.zh-CN.md.
LOOPFORGE_IMAGE=
# Source build of this checkout (./start.sh dev writes this line; ./start.sh release removes it):
# COMPOSE_FILE=compose.yaml:compose.dev.yaml
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

Platform releases use `vX.Y.Z` tags and publish `ghcr.io/tencent/loopforge`. LoopForge Local packages use `local-vX.Y.Z` tags and are published by manually running the `release-local` workflow.

## Unreleased

- On macOS `/bin/bash` 3.2, a missing local image or a failed automatic mirror pull no longer aborts `./start.sh` before the official image pull.
- `./start.sh` and `./start.sh pull` time `ghcr.io` and `ghcr.nju.edu.cn`. Nanjing is used only when the ghcr.io manifest digest was verified and the mirror returned the same digest; the pull is that digest, then tagged back to the name pinned in `compose.yaml`. A missing official digest, a digest mismatch, or a failed mirror pull stays on `ghcr.io`. `MIRROR=ghcr.io` forces the upstream registry; `MIRROR=<host>` still forces that host and does not fall back. Accepting Nanjing, or setting `MIRROR`, trusts that host. The choice is not saved in `.env`. `registry-mirrors` such as `https://docker.nju.edu.cn` only accelerates Docker Hub.

## 0.4.0 — scheduled task history, an MR node in delivery SOPs and agent CLIs in conversation workspaces

- Scheduled tasks keep an execution history with a session mode, keep conversations per job and gain row actions (#958). AI jobs run with the key of the user who saved them and fall back to the shared key (#966).
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ cd LoopForge

`./start.sh` pulls the GHCR release image pinned in `compose.yaml` without building locally (`bash scripts/install.sh` does the same). It creates the MySQL and platform services, generates configuration and session secrets, and installs the built-in sandboxes, starter SOPs and welcome project. Host Go and Node.js installations are not required. Configure model API keys and GitHub authorization after startup. Use `./start.sh logs`, `stop`, `restart` or `pull` to manage it, and `./start.sh dev` to build the checkout from source.

If downloads from `ghcr.io` stall, set `MIRROR` to a registry host that can stand in for `ghcr.io`. `./start.sh` pulls from that host and tags the image back to the name pinned in `compose.yaml`. Setting `MIRROR` trusts that host, because the download is tagged with the official name. The GitHub Release records the digest; `docker image inspect --format '{{index .RepoDigests 0}}' ghcr.io/tencent/loopforge:<pin>` should show the same digest after `@`. Without `MIRROR`, `./start.sh` still pulls `ghcr.io` directly, and `compose.yaml` stays unchanged. Upgrade with the same variable and `./start.sh pull`. [ghcr.nju.edu.cn](https://doc.nju.edu.cn/books/e1654/page/ghcr) is one such host. A Docker `registry-mirrors` entry such as `https://docker.nju.edu.cn` only accelerates Docker Hub and is not a value for `MIRROR`.
If downloads from `ghcr.io` stall, `./start.sh` and `./start.sh pull` time `ghcr.io` against the Nanjing University mirror [ghcr.nju.edu.cn](https://doc.nju.edu.cn/books/e1654/page/ghcr). Nanjing is used only when its manifest digest matches the digest just read from ghcr.io; the script pulls that digest and tags it back to the name pinned in `compose.yaml`, which trusts that host because the result is tagged with the official name. A missing official digest, a mismatch, or a failed mirror pull stays on `ghcr.io`. `MIRROR=ghcr.io` forces the upstream registry and `MIRROR=ghcr.nju.edu.cn` forces Nanjing; the choice is not written to `.env`. The GitHub Release records the digest; `docker image inspect --format '{{index .RepoDigests 0}}' ghcr.io/tencent/loopforge:<pin>` should show the same digest after `@`. `compose.yaml` stays unchanged. A Docker `registry-mirrors` entry such as `https://docker.nju.edu.cn` only accelerates Docker Hub and is not a value for `MIRROR`.

```bash
MIRROR=ghcr.nju.edu.cn ./start.sh
./start.sh
MIRROR=ghcr.io ./start.sh
MIRROR=ghcr.nju.edu.cn ./start.sh pull
```

Open the address printed by the installer and create your account; the first one becomes the administrator. The service listens on `0.0.0.0:8090` by default. On a cloud host, the installer reads the public IP from the provider's metadata service and prints it; allow the port in your security group, or put an HTTPS reverse proxy in front. Restrict access to your own IP until the administrator account exists. The home page's quick-access guide walks you through adding a model key, connecting a repository and choosing an SOP.
Expand Down
6 changes: 4 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ cd LoopForge

`./start.sh` 直接拉取 `compose.yaml` 中 pin 的 GHCR 发布镜像,不在本地构建(`bash scripts/install.sh` 效果相同)。安装流程会创建 MySQL 和平台服务,生成配置与会话密钥,并导入内置沙箱、通用 SOP 和体验项目;无需在宿主机安装 Go 或 Node.js。模型 API Key 和 GitHub 授权在启动后由用户配置。用 `./start.sh logs`、`stop`、`restart`、`pull` 管理服务;需要从源码构建时用 `./start.sh dev`。

国内拉取 `ghcr.io` 经常中断。把 `MIRROR` 设成可以替换 `ghcr.io` 的镜像站主机名,`./start.sh` 会用它拉取,再改回 `compose.yaml` 里的原名。设置 `MIRROR` 表示信任该主机,因为下载结果会被标成官方镜像名。发布说明里有 digest,可用 `docker image inspect --format '{{index .RepoDigests 0}}' ghcr.io/tencent/loopforge:<pin>` 核对,`@` 后面的摘要应一致。不设置时仍直接从 `ghcr.io` 拉取。`compose.yaml` 不用改。升级时带上同一个变量执行 `./start.sh pull`。南京大学的 GHCR 镜像站是 [ghcr.nju.edu.cn](https://doc.nju.edu.cn/books/e1654/page/ghcr)。Docker 引擎里的 `registry-mirrors`(包括 `https://docker.nju.edu.cn`)只加速 Docker Hub,不能填在这里。
国内拉取 `ghcr.io` 经常中断。`./start.sh` 和 `./start.sh pull` 会并行探测 `ghcr.io` 与南京大学镜像 [ghcr.nju.edu.cn](https://doc.nju.edu.cn/books/e1654/page/ghcr)。只有先从 ghcr.io 拿到 manifest 摘要,且南京返回同一摘要时,才按这个摘要拉取并改回 `compose.yaml` 里的原名;这表示信任该主机,因为下载结果会被标成官方镜像名。拿不到官方摘要、摘要不一致,或镜像拉取失败时,仍走 `ghcr.io`。`MIRROR=ghcr.io` 固定走官方源,`MIRROR=ghcr.nju.edu.cn` 固定走南京,选择不会写入 `.env`。发布说明里有 digest,可用 `docker image inspect --format '{{index .RepoDigests 0}}' ghcr.io/tencent/loopforge:<pin>` 核对,`@` 后面的摘要应一致。`compose.yaml` 不用改。Docker 引擎里的 `registry-mirrors`(包括 `https://docker.nju.edu.cn`)只加速 Docker Hub,不能填在 `MIRROR` 里。

```bash
MIRROR=ghcr.nju.edu.cn ./start.sh
./start.sh
MIRROR=ghcr.io ./start.sh
MIRROR=ghcr.nju.edu.cn ./start.sh pull
```

打开安装脚本输出的地址创建账号,第一个账号自动成为管理员。服务默认监听 `0.0.0.0:8090`;在云主机上,安装脚本会从云厂商的元数据服务读取公网 IP 并直接打印出来,放通安全组端口即可访问,或配置 HTTPS 反向代理;管理员账号创建前,建议只允许你的 IP 访问。首页的「快速接入」会带你配置模型凭据、绑定仓库并选好默认 SOP。
Expand Down
22 changes: 12 additions & 10 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ Use `AGENTFLOW_MYSQL_DSN` for your own MySQL deployment. A fresh account command
## Container installation

```bash
./start.sh # install or start in the background (same as bash scripts/install.sh)
./start.sh logs # follow platform logs
./start.sh stop # stop; ./start.sh down removes containers but keeps data volumes
./start.sh restart # restart the platform container
./start.sh pull # refresh images and recreate changed containers
MIRROR=ghcr.nju.edu.cn ./start.sh # same install; replace the ghcr.io host with this registry
./start.sh dev # build this checkout instead (compose.dev.yaml)
./start.sh release # switch a source build back to the published image
./start.sh # install or start in the background (same as bash scripts/install.sh)
./start.sh logs # follow platform logs
./start.sh stop # stop; ./start.sh down removes containers but keeps data volumes
./start.sh restart # restart the platform container
./start.sh pull # refresh images; times ghcr.io against ghcr.nju.edu.cn
MIRROR=ghcr.io ./start.sh # install from ghcr.io without the speed test
MIRROR=ghcr.nju.edu.cn ./start.sh # force that host instead of the speed test
./start.sh dev # build this checkout instead (compose.dev.yaml)
./start.sh release # switch a source build back to the published image
```

The installer checks Docker, Compose, Python 3 and curl. It offers to install missing Python/curl packages using apt, dnf or yum on Linux (Homebrew on macOS), Docker using its official installer, and the missing Linux x86_64/arm64 Compose plugin using the pinned official release with SHA-256 verification. A plugin is installed for the active Docker user, or system-wide when Docker requires sudo. macOS Compose comes from Docker Desktop. Set `LOOPFORGE_YES=1` to accept installation prompts; internet access and package-manager/administrator permissions are still required. The installer generates `.env` with unique secrets, pulls and starts the containers, installs the observability columns and applies `migrations/seed/*.sql`. It is safe to re-run. Set `AGENTFLOW_HTTP_PORT` or `LOOPFORGE_MYSQL_PORT` in the environment before the first run (or edit `.env` later) when the default ports are taken.
Expand All @@ -49,10 +50,11 @@ git fetch --tags && git checkout vX.Y.Z

The new `compose.yaml` brings the image pin and any new platform settings together, and `./start.sh pull` recreates the platform container when either changes. A source build from `./start.sh dev` is not rebuilt by `./start.sh pull`; run `./start.sh dev` again after updating the checkout. Running `./start.sh pull` alone keeps the pinned version. With `LOOPFORGE_IMAGE` saved in `.env`, change it to the checked-out release as well; a newer image with an older `compose.yaml` can miss settings that release needs.

Where `ghcr.io` downloads stall, set `MIRROR` to the registry host that replaces `ghcr.io`. `./start.sh` and `./start.sh pull` pull that reference and tag it back to the name in `compose.yaml`. Setting `MIRROR` trusts that host, because the result is tagged with the official name. The GitHub Release records the image digest; `docker image inspect --format '{{index .RepoDigests 0}}' ghcr.io/tencent/loopforge:<pin>` should show the same digest after `@`. The pull policy stays `missing` on install, so a local image is kept; `./start.sh pull` refreshes it from the same host. Leaving `MIRROR` unset preserves the direct `ghcr.io` pull. [ghcr.nju.edu.cn](https://doc.nju.edu.cn/books/e1654/page/ghcr) is one compatible host. Docker's `registry-mirrors` setting, including `https://docker.nju.edu.cn`, only applies to Docker Hub and cannot be used as `MIRROR`. A `LOOPFORGE_IMAGE` value that is not a `ghcr.io` name:tag is left unchanged.
Where `ghcr.io` downloads stall, `./start.sh` and `./start.sh pull` time `ghcr.io` against [ghcr.nju.edu.cn](https://doc.nju.edu.cn/books/e1654/page/ghcr). Nanjing is used only when its manifest digest matches the digest just read from ghcr.io; that digest is what gets pulled, then tagged back to the name in `compose.yaml`, which trusts that host. A missing official digest, a mismatch, or a failed mirror pull stays on `ghcr.io`. `MIRROR=ghcr.io` forces the upstream registry; any other `MIRROR` host forces that registry, skips the speed test, and does not fall back. The choice is not written to `.env`. The pull policy stays `missing` on install, so a local image is kept and is not timed again; `./start.sh pull` times the registries and refreshes from the winner. The GitHub Release records the image digest; `docker image inspect --format '{{index .RepoDigests 0}}' ghcr.io/tencent/loopforge:<pin>` should show the same digest after `@`. Docker's `registry-mirrors` setting, including `https://docker.nju.edu.cn`, only applies to Docker Hub and cannot be used as `MIRROR`. A `LOOPFORGE_IMAGE` value that is not a `ghcr.io` name:tag is left unchanged.

```bash
MIRROR=ghcr.nju.edu.cn ./start.sh
./start.sh
MIRROR=ghcr.io ./start.sh pull
MIRROR=ghcr.nju.edu.cn ./start.sh pull
```

Expand Down
8 changes: 6 additions & 2 deletions scripts/docker-access.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/usr/bin/env bash

docker_access() {
# macOS /bin/bash 3.2 does not inherit an if/&& caller into a function.
# A failing command there aborts set -e before the caller can see the status.
# A subshell returns Docker's status instead, including to a cold install's
# image inspect and to the automatic mirror pull fallback.
if [[ "${LOOPFORGE_DOCKER_USE_SUDO:-0}" == 1 ]]; then
require_sudo
command sudo -n docker "$@"
( command sudo -n docker "$@" )
else
command docker "$@"
( command docker "$@" )
fi
}

Expand Down
Loading
Loading