From 55bd72467ca8da75a5571103f67cc9b02fe91b5d Mon Sep 17 00:00:00 2001 From: icyleaf Date: Sat, 28 Apr 2018 10:11:17 +0800 Subject: [PATCH] doc: append run server in cli --- docs/api.md | 5 ++--- docs/cli.md | 15 +++++++++++++++ docs/en/api.md | 2 +- docs/en/cli.md | 15 +++++++++++++++ docs/en/quickstart.md | 2 ++ docs/quickstart.md | 2 ++ 6 files changed, 37 insertions(+), 4 deletions(-) diff --git a/docs/api.md b/docs/api.md index 054a865..c3051fc 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,10 +1,10 @@ # API 接口 -hpr 运行后会提供 Web API 接口,端口号 `8848`。 +hpr 运行后会提供 Web API 接口,默认端口 `8848`。 ## 认证 -接口请求目前仅支持 Basic Auth,通过配置文件 `config/hpr.json` 进行配置,详情参见[配置文件](configuration?id=basic_auth-接口认证)说明。 +接口请求目前仅支持 Basic Auth,通过配置文件 `config/hpr.json` 进行配置是否开启(默认关闭),详情参见[配置文件](configuration?id=basic_auth-接口认证)说明。 ```bash $ curl -u user@password http://hpr-ip:8848/info @@ -55,7 +55,6 @@ GET /repositores } ``` - ### 单个镜像仓库信息 ``` diff --git a/docs/cli.md b/docs/cli.md index f05d031..ed231d3 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -2,6 +2,21 @@ hpr 本身是一个命令行工具,因此也提供了一个临时可用的辅助命令来管理镜像仓库。 +## 运行 Web API 服务器 + +```bash +$ hpr -s +# 或者更改端口号 +$ hpr -s --port 8848 + _ + | |__ _ __ _ __ + | '_ \| '_ \| '__| + | | | | |_) | | + |_| |_| .__/|_| + |_| +2018-04-28 10:06:42 +08:00 INFO API Server now listening at localhost:8848, press Ctrl-C to stop +``` + ## 显示已镜像的仓库列表 ```bash diff --git a/docs/en/api.md b/docs/en/api.md index 6c1e51d..ddd8c15 100644 --- a/docs/en/api.md +++ b/docs/en/api.md @@ -4,7 +4,7 @@ hpr support a web api service (port `8848`) by default. ## Authentication -Only support Basic Auth for now. Configure from `config/hpr.json` file,View detail in [Configuration](/en/configuration?id=basic_auth-接口认证). +Only support Basic Auth for now. Configure to enable or not from `config/hpr.json` file,View detail in [Configuration](/en/configuration?id=basic_auth). ```bash $ curl -u user@password http://hpr-ip:8848/info diff --git a/docs/en/cli.md b/docs/en/cli.md index b79f293..6b8df29 100644 --- a/docs/en/cli.md +++ b/docs/en/cli.md @@ -2,6 +2,21 @@ hpr is a command line tool, it also support some commands to manage mirror repositories temporary. +## Run Web API server + +```bash +$ hpr -s +# Or customize server port +$ hpr -s --port 8848 + _ + | |__ _ __ _ __ + | '_ \| '_ \| '__| + | | | | |_) | | + |_| |_| .__/|_| + |_| +2018-04-28 10:06:42 +08:00 INFO API Server now listening at localhost:8848, press Ctrl-C to stop +``` + ## List repositories ```bash diff --git a/docs/en/quickstart.md b/docs/en/quickstart.md index 8d02dfa..ebf49ef 100644 --- a/docs/en/quickstart.md +++ b/docs/en/quickstart.md @@ -47,6 +47,8 @@ Here has 4 places to change your own. - `group_name`: all mirrored project will be in this group, **MAKE SUER YOU ACCOUNT HAS CREATE GROUP ROLE** (ignore if has admin role) - `ssh_port`: change it if you use custom ssh port +> About more params check [Configuration](configuration?id=basic_auth-接口认证) page. + Then set some optional `ENV` variables if you need in `docker-compose.yml`: ```yaml diff --git a/docs/quickstart.md b/docs/quickstart.md index 51d01ab..9cbed18 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -47,6 +47,8 @@ $ mv hpr.json.example.yml config/hpr.json - `group_name`: 项目镜像的项目都会归属到这个组内,**务必确保你的账户拥有创建组的权限** (如果是管理员请忽略加粗字样) - `ssh_port`: 如果 SSH 不是 22 端口的话需要根据你的实际情况修改 +> 更多参数详情参见[配置文件](configuration?id=basic_auth-接口认证)。 + 配置文件修改保存后还需要在 `docker-compose.yml` 文件中配置下: ```yaml