Skip to content

Commit

Permalink
修改application.yml配置
Browse files Browse the repository at this point in the history
添加启动,停止服务脚本
更新readme
  • Loading branch information
atjiu committed Sep 11, 2018
1 parent 2a0b609 commit 20b19a9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
> 使用说明:请在醒目的地方标明 powered by pybbs
[接口文档](https://github.com/tomoya92/pybbs/blob/master/api.md)
[接口文档](https://github.com/tomoya92/pybbs/blob/master/api.md) | [在线地址](https://dev.yiiu.co/)

pybbs4.0 重新回归精简,请求全部以 restful 风格的接口提供,数据库使用内嵌的mongodb(可以通过简单的配置更改为外置数据库),并且提供release安装包,方便部署,相关配置见下文
前端项目开源地址: https://github.com/tomoya92/pybbs-front-react

pybbs4.0 重新回归精简,请求全部以接口提供,数据库使用内嵌的mongodb(可以通过简单的配置更改为外置数据库),并且提供release安装包,方便部署,相关配置见下文

## 部署

[下载安装包](https://github.com/tomoya92/pybbs/releases),解压,运行脚本(支持linux, mac)

- `sh start.sh` # 启动服务
- `sh shutdown.sh` # 停止服务

### 数据库文件在哪?
**启动之前,要装好mongodb数据库,如果数据库有用户名密码,请在解压出来的文件夹内的`application-prod.yml`文件内修改数据库连接信息**

数据库使用的是内嵌的mongodb,数据库文件在安装目录根目录下的 `data` 文件夹里,备份直接拷贝即可
- `sh start.sh` # 启动服务
- `sh shutdown.sh` # 停止服务
- `tail -200f log.file` # 查看日志

## 配置文件

Expand Down
9 changes: 9 additions & 0 deletions application-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server:
port: 8080
spring:
data:
mongodb:
database: pybbs #一般只用配置这一个就可以了,如果数据库有密码,还要配置下面几个配置
# uri:
# port:
# password:
5 changes: 4 additions & 1 deletion conf.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
site:
# 配置跨域域名
corsDomain: ["http://localhost:3000"]
corsDomain: []
# 每页显示条数
pageSize: 20
# 创建话题得到的积分
createTopicScore: 10
# 话题被加精得到的积分
goodTopicScore: 20
# 创建评论得到的积分
createCommentScore: 5
# 下面是话题的分类,可以自行增加删减
sections:
Expand Down
1 change: 1 addition & 0 deletions shutdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ps -ef | grep pybbs.jar | grep -v grep | cut -c 9-15 | xargs kill -s 9
11 changes: 4 additions & 7 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
server:
port: 8080
spring:
# 外置的mongodb服务配置
data:
mongodb:
database: pybbs #一般只用配置这一个就可以了,如果数据库有密码,还要配置下面几个配置
# 内置的mongodb服务配置
# mongodb:
# embedded:
# storage:
# database-dir: ./data
database: pybbs #一般只用配置这一个就可以了,如果数据库有密码,还要配置下面几个配置
# uri:
# port:
# password:
1 change: 1 addition & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java -jar pybbs.jar --spring.profiles.active=prod > log.file 2>&1 &

0 comments on commit 20b19a9

Please sign in to comment.