Skip to content

Commit 5ddb2a3

Browse files
committed
chore: update readme
1 parent 93ca4fe commit 5ddb2a3

File tree

4 files changed

+91
-28
lines changed

4 files changed

+91
-28
lines changed

README.md

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,69 @@
22

33
This repository includes the following tools:
44

5-
- [Map Generation Tool](#map-generation-tool)
6-
- [Automated Data Copy Tool](#automated-data-copy-tool)
5+
- [http-server](#http-server)
6+
- [Automated Data Copy Tool (roadtest-archive)](#automated-data-copy-tool-roadtest-archive)
77

88
---
99

10-
## Map Generation Tool
10+
## Http Server
1111

12-
Generate various Apollo map formats based on a given `base_map`.
12+
Provides a simple HTTP server used by developer tooling and local testing.
1313

1414
### Quick Start
1515

16+
From the repository root:
17+
1618
```bash
17-
bash gen_all_map.sh <your_map_directory>
19+
cd http-server
20+
./manage.sh up
1821
```
1922

23+
See `http-server/README.md` for more details about the server and docker
24+
options.
25+
2026
---
2127

22-
## Automated Data Copy Tool
28+
## Automated Data Copy Tool (roadtest-archive)
2329

24-
Automatically copies data packages from the Apollo `data` directory to the `road_test` directory on a selected disk. After the copy process, a Feishu (Lark) notification is sent to the user.
30+
This component (now in `roadtest-archive/`) installs a udev rule and a
31+
systemd template to automatically archive data from an Apollo workspace to a
32+
removable device when it is plugged in. It creates a per-instance environment
33+
file under `/etc/road_test_archive/<UUID>.env` so each device instance gets the
34+
correct configuration.
2535

26-
### Quick Start
36+
### Quick Start (install)
2737

28-
Run the following command:
38+
Run the interactive installer as root:
2939

3040
```bash
31-
bash setup_host/road_test_env.sh
41+
sudo bash roadtest-archive/road_test_env.sh
3242
```
3343

34-
Follow the interactive prompts:
44+
The installer will:
45+
46+
- check required commands (`rsync`, `curl`, `logger`, `flock`, `mountpoint`, `mount`, `udevadm`, `systemctl`)
47+
- install the runtime script to `/usr/local/bin/road_test_archive.sh`
48+
- install the systemd unit to `/etc/systemd/system/road_test_archive@.service`
49+
- install the udev rule to `/etc/udev/rules.d/99-roadtest.rules`
50+
- create `/etc/road_test_archive/<UUID>.env` and enable the per-UUID unit
51+
52+
### Runtime/example
53+
54+
Run the installer and follow prompts. Example interactive output:
3555

3656
```shell
37-
zero@zero:~/01code/whl-tools$ bash setup_host/road_test_env.sh
57+
$ sudo bash roadtest-archive/road_test_env.sh
3858
Enter Apollo workspace path [/home/zero/01code/apollo]:
3959
Enter notification Webhook URL [https://www.feishu.cn/flow/api/trigger-webhook/xxx]:
4060
[INFO] Available filesystems:
41-
1) /dev/nvme0n1p6 (UUID: f9ab690d-5e04-44d9-b9f8-c024016d8245)
42-
2) /dev/nvme0n1p5 (UUID: DE2411AE24118AA3)
43-
3) /dev/nvme0n1p3 (UUID: 560446550446386F)
44-
4) /dev/nvme0n1p1 (UUID: CA41-1B79)
45-
5) /dev/nvme0n1p4 (UUID: D62817D52817B389)
46-
Select an entry [2]:
61+
1) /dev/sdb1 (UUID: 0123-ABCD)
62+
2) /dev/sdc1 (UUID: 9f8e7d6c-...)
63+
Select an entry [1]:
4764
[INFO] Configuration complete.
4865
Apollo Workspace : /home/zero/01code/apollo
4966
Webhook URL : https://www.feishu.cn/flow/api/trigger-webhook/xxx
50-
Disk UUID : DE2411AE24118AA3
67+
Disk UUID : 0123-ABCD
5168
```
5269

5370
🔗 [How to Create a Feishu Webhook](https://www.feishu.cn/hc/zh-CN/articles/807992406756-webhook-%E8%A7%A6%E5%8F%91%E5%99%A8)

http-server/README.md

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,65 @@ This repository provides a quick Docker-based setup to host an offline-capable B
2222

2323
---
2424

25+
2526
## 3. Deployment & Startup
2627

27-
### 3.1 Run the initializer
28+
This repository includes a convenience manager script `manage.sh` which wraps
29+
initialization and docker-compose operations. The script will detect whether
30+
`docker-compose` or the Docker CLI's `docker compose` subcommand is available
31+
and use the detected command.
32+
33+
### 3.1 Quick deploy (recommended)
34+
35+
From this directory run:
36+
37+
```bash
38+
chmod +x manage.sh
39+
sudo ./manage.sh deploy
40+
```
41+
42+
`deploy` will:
43+
44+
- create necessary directories (`share`, `registry`, `filebrowser`, `squid/cache`)
45+
- initialize the filebrowser database
46+
- update registry `source.json` entries to point at the detected LAN IP
47+
- start the compose stack (file-server, bazel-registry, squid-proxy, filebrowser)
48+
49+
After `deploy` completes it prints access instructions with the detected LAN
50+
IP.
51+
52+
### 3.2 Troubleshooting & status
53+
54+
Check stack health and endpoints:
2855

29-
The `init.sh` script fixes directory permissions and updates any `source.json` entries in the `registry/` to point at the detected LAN IP.
56+
```bash
57+
./manage.sh status
58+
```
59+
60+
Restart a single service or the entire stack:
61+
62+
```bash
63+
./manage.sh restart file-server
64+
./manage.sh restart all
65+
```
66+
67+
If you prefer to run compose manually the script supports `docker-compose` or
68+
`docker compose` — it will auto-detect which command to use.
69+
70+
### 3.3 Optional: run initializer manually
71+
72+
If you wish to run the low-level initializer directly (not required when using
73+
`manage.sh deploy`), you can run:
3074

3175
```bash
3276
chmod +x init.sh
3377
./init.sh
34-
3578
```
3679

37-
### 3.2 Verify access
80+
This fixes permissions and updates registry URLs, similar to what `deploy`
81+
performs.
82+
83+
### 3.4 Verify access (endpoints)
3884

3985
- **File Browser (admin UI)**: `http://<IP>:8082` (default admin/admin) — upload files to `share/`.
4086
- **File Server (downloads)**: `http://<IP>:8080` — serves `.tar.gz` source archives.

http-server/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.8'
22

33
services:
4-
# 1. 源码包文件服务器
4+
# 1. Source code package file server
55
file-server:
66
image: nginx:latest
77
container_name: bazel-file-server
@@ -12,7 +12,7 @@ services:
1212
- ./nginx-conf/autoindex.conf:/etc/nginx/conf.d/default.conf:ro
1313
restart: unless-stopped
1414

15-
# 2. Bzlmod 注册表服务器
15+
# 2. Bzlmod registry server
1616
bazel-registry:
1717
image: nginx:latest
1818
container_name: bazel-registry
@@ -23,7 +23,7 @@ services:
2323
- ./nginx-conf/autoindex.conf:/etc/nginx/conf.d/default.conf:ro
2424
restart: unless-stopped
2525

26-
# 3. Squid 缓存代理
26+
# 3. Squid caching proxy
2727
squid-proxy:
2828
image: ubuntu/squid:latest
2929
container_name: bazel-proxy
@@ -34,7 +34,7 @@ services:
3434
- ./squid/squid.conf:/etc/squid/squid.conf
3535
restart: unless-stopped
3636

37-
# 4. 可视化管理
37+
# 4. Visual management
3838
filebrowser:
3939
image: filebrowser/filebrowser:latest
4040
container_name: filebrowser

http-server/nginx-conf/autoindex.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ server {
55
location / {
66
root /usr/share/nginx/html;
77
index index.html index.htm;
8-
autoindex on; # The magic line!
8+
autoindex on;
99
autoindex_exact_size off;
1010
autoindex_localtime on;
1111
}

0 commit comments

Comments
 (0)