Skip to content

Commit 8e5e55e

Browse files
authored
Merge pull request #37 from Coding/tanhehe/update_readme
update readme
2 parents e06c247 + 8859984 commit 8e5e55e

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

README-zh.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ git submodule update
6464
./ide.sh run # 启动项目
6565
```
6666

67+
### 修改默认配置
68+
69+
`backend/src/main/resources/application.properties` 包括用户、项目、数据库等配置,可以通过修改配置定制服务:
70+
71+
* **SPACE_HOME:** 存放 workspace 的目录,默认为 ${"user.home"}/.workspace
72+
* **server.port:** 应用启动的端口
73+
* **USERNAME:** 用户名,git 提交时会使用该值作为 user.name,默认为 coding。
74+
* **EMAIL:** 用户邮箱,git 提交时会使用该值作为 user.email,默认为 coding@coding.net
75+
* **AVATAR:** 用户头像
76+
* **CODING_IDE_HOME:** 应用数据存放目录
77+
78+
修改配置后,需要重启应用。另外如果修改了 `USERNAME``EMAIL` 的值,会在创建新的 Workspace 时生效。
79+
6780
## docker 版
6881

6982
```

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ We provide a shell script `ide.sh` to ease the process for you.
6868
```
6969
Server runs on port 8080 by default, visit localhost:8080 to check it out.
7070

71+
72+
### Configurations
73+
74+
`backend/src/main/resources/application.properties` contains configurations of user, project, database, etc., you can change these parameters to meet your need:
75+
76+
* **SPACE_HOME:** path to your workspace directory, default to `${"user.home"}/.workspace`
77+
* **server.port:** backend server port
78+
* **USERNAME:** username, used by git as its `user.name` config when commit, defaults to "coding"
79+
* **EMAIL:** email, used by git as its `user.email` config when commit, defaults to "coding@coding.net"
80+
* **AVATAR:** user's avatar
81+
* **CODING_IDE_HOME:** path to store WebIDE application's data
82+
83+
If changed, restart the application to let your configurations take effect. Note that changes on `USERNAME`, `EMAIL` *WILL NOT* apply to workspaces that are already created.
84+
85+
7186
## Docker Server
7287

7388
```

ide.sh

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ valid_last_cmd() {
1717
}
1818

1919
sub_help(){
20-
echo "Usage: $PROG_NAME [-e <subcommand>"
20+
echo "Usage: $PROG_NAME <subcommand>"
2121
echo ""
2222
echo "Subcommands:"
23-
echo " build"
23+
echo " build [-t tag]"
2424
echo " run [-p port]"
2525
echo " docker [build|run|attach|stop|logs|exec]"
2626
echo ""
@@ -151,6 +151,8 @@ create_dir_if_not_exist() {
151151

152152
sub_docker() {
153153

154+
local OPTIND opt
155+
154156
check_docker() {
155157
if ! docker ps > /dev/null 2>&1; then
156158
output=$(docker ps)
@@ -164,12 +166,25 @@ sub_docker() {
164166

165167
check_docker
166168

169+
# process options
170+
while getopts ":t:" opt; do
171+
case $opt in
172+
t)
173+
EXTRA_VARS="-t ${OPTARG}"
174+
;;
175+
\?)
176+
docker_usage
177+
exit 1
178+
;;
179+
esac
180+
done
181+
167182
case $1 in
168183
"-h" | "--help")
169184
docker_usage
170185
;;
171186
"build")
172-
docker build -t webide/webide .
187+
docker build $EXTRA_VARS .
173188
;;
174189
"run")
175190
RUNNING=$(docker inspect --format="{{ .State.Running }}" $CONTAINER 2> /dev/null)
@@ -238,7 +253,7 @@ sub_run() {
238253
EXTRA_VARS=-Drun.arguments="--server.port=${OPTARG}"
239254
;;
240255
\?)
241-
build_usage
256+
run_usage
242257
exit 1
243258
;;
244259
esac

0 commit comments

Comments
 (0)