Skip to content

Commit

Permalink
Merge branch 'x/sqlx' into r/paopao-ce-plus
Browse files Browse the repository at this point in the history
  • Loading branch information
alimy committed Jan 7, 2024
2 parents ada0cb1 + d4cac5a commit 0393cb8
Show file tree
Hide file tree
Showing 140 changed files with 4,606 additions and 5,693 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

All notable changes to paopao-ce are documented in this file.
## 0.6.0+dev ([`dev`](https://github.com/rocboss/paopao-ce/tree/dev))
TODO;
### Added
- add all-in-one docker image build scripts.
- frontend: add tweets filter support use tag for home page and make it as default behavior.
- add pin topic support.

## 0.5.2
### Change
Expand Down
37 changes: 37 additions & 0 deletions Dockerfile.allinone
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# syntax=docker/dockerfile:experimental

# build frontend
FROM node:19-alpine as frontend
ARG API_HOST
ARG USE_API_HOST=yes
ARG EMBED_UI=yes
ARG USE_DIST=no
WORKDIR /web
COPY web/ ./
RUN [ $EMBED_UI != yes ] || [ $USE_API_HOST != yes ] || echo "VITE_HOST='$API_HOST'">.env.local
RUN [ $EMBED_UI != yes ] || [ $USE_DIST != no ] || (yarn && yarn build)
RUN [ $EMBED_UI = yes ] || mkdir dist || echo ""

# build backend
FROM bitbus/paopao-ce-backend-builder:latest AS backend
ARG API_HOST
ARG USE_API_HOST=yes
ARG EMBED_UI=yes
ARG USE_DIST=no

WORKDIR /paopao-ce
COPY . .
COPY --from=frontend /web/dist ./web/dist
ENV GOPROXY=https://goproxy.cn
RUN [ $EMBED_UI != yes ] || make build TAGS='go_json migration'
RUN [ $EMBED_UI = yes ] || make build TAGS='slim embed go_json migration'

FROM bitbus/paopao-ce-allinone-runner:latest
ARG API_HOST
ARG USE_API_HOST=yes
ARG EMBED_UI=yes
ARG USE_DIST=no
ENV TZ=Asia/Shanghai

WORKDIR /app
COPY --from=backend /paopao-ce/release/paopao .
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ pre-commit: fmt

.PHONY: install-protobuf-plugins
install-protobuf-plugins:
@go install github.com/bufbuild/buf/cmd/buf@v1.25.0
@go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@v1.25.0
@go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@v1.25.0
@go install github.com/bufbuild/connect-go/cmd/protoc-gen-connect-go@latest
@go install github.com/bufbuild/buf/cmd/buf@v1.28.1
@go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@v1.28.1
@go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@v1.28.1
@go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
@go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
@go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
Expand Down
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ PaoPao主要由以下优秀的开源项目/工具构建
* [Mir](https://github.com/alimy/mir 'go-mir')
* [Buf](https://github.com/bufbuild/buf 'buf')
* [gRPC](https://github.com/grpc/grpc-go 'grpc-go')
* [Zinc](https://zinclabs.io/ 'zinc')
* [Meilisearch](https://www.meilisearch.com/ 'meilisearch')

#### 前端:
* [Naive UI](https://www.naiveui.com/)
Expand All @@ -69,9 +69,7 @@ PaoPao主要由以下优秀的开源项目/工具构建
* Node.js (14+)
* MySQL (5.7+)
* Redis
* Zinc

> Zinc是一款轻量级全文搜索引擎,可以查阅 <https://zincsearch.com/> 安装
* Meilisearch

以上环境版本为PaoPao官方的开发版本,仅供参考,其他版本的环境未进行充分测试

Expand Down Expand Up @@ -221,6 +219,23 @@ PaoPao主要由以下优秀的开源项目/工具构建
docker run -d -p 8010:80 your/paopao-ce:web
```

* All-In-One:
```sh
# 构建Image
docker buildx build --build-arg USE_DIST="yes" -t your/paopao-ce:all-in-one-latest -f Dockerfile.allinone .
# 运行
docker run --name paopao-ce-allinone -d -p 8000:8008 -p 7700:7700 -v ./data/custom:/app/custom -v ./data/meili_data:/app/meili_data your/paopao-ce:all-in-one-latest
# 或者使用官方Image运行
docker run --name paopao-ce-allinone -d -p 8000:8008 -p 7700:7700 -v ./data/custom:/app/custom -v ./data/meili_data:/app/meili_data bitbus/paopao-ce:all-in-one-latest
# 或者使用官方Image运行 + 自定义config.yaml
docker run --name paopao-ce-allinone -d -p 8000:8008 -p 7700:7700 -v ./config.yaml:/app/config.yaml -v ./data/custom:/app/custom -v ./data/meili_data:/app/meili_data bitbus/paopao-ce:all-in-one-latest
```
> 注意在`config.yaml``Meili.ApiKey`的值必须与容器中meili启动时设定的`MEILI_MASTER_KEY`环境变量值相同,默认为`paopao-meilisearch`. 可以在docker启动容器时通过`-e MEILI_MASTER_KEY=<custom-key>`设置该值。


### 方式三. 使用 docker-compose 运行
```sh
git clone https://github.com/rocboss/paopao-ce.git
Expand Down
2 changes: 1 addition & 1 deletion auto/api/m/v1/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/r/v1/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/s/v1/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/admin.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/alipay_priv.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/alipay_pub.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/core.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/followship.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/friendship.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/loose.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion auto/api/v1/priv.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/pub.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/relax.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/site.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/v1/trends.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auto/api/x/v1/user.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0393cb8

Please sign in to comment.