Commit Graph

194 Commits (9d67ce60cc49b169a377c8c4a43266be21519f69)

Author SHA1 Message Date
John Niang 543bdc45b5
Support running Halo with MySQL and MariaDB database (#2512)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.0

#### What this PR does / why we need it:

Add MySQL script to support running Halo with MySQL database due to https://github.com/jasync-sql/jasync-sql/issues/311 has been resolved.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2464

#### Special notes for reviewers

Steps to test:

1. Start up MySQL. e.g.:

    ```yaml
    version: '3.1'
    
    services:
    
      db:
        image: mysql
        # NOTE: use of "mysql_native_password" is not recommended: https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password
        # (this is just an example, not intended to be a production configuration)
        command: --default-authentication-plugin=mysql_native_password
        restart: always
        environment:
          MYSQL_ROOT_PASSWORD: openmysql
        ports:
          - 3306:3306
    
      adminer:
        image: adminer
        restart: always
        ports:
          - 8080:8080
    ```
    
    ```bash
    docker-compose -f mysql.yaml up
    ```

2. Start Halo with `mysql` profile. e.g.:

    ```bash
    ./gradlew bootRun --args="--spring.profiles.active=mysql"
    ```

3. Validate the functionality of Halo

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-10-09 02:32:30 +00:00
John Niang b23ed2efcc
Bump version of Spring Boot & SpringDoc (#2511)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:

1. Upgrade Spring Boot to 3.0.0-M5. See https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0.0-M5-Release-Notes for more.
2. Upgrade SpringDoc to 2.0.0-M6. The version is compatible to Spring Boot 3.0.0-M5. See https://github.com/springdoc/springdoc-openapi/issues/1865 for more.

#### Special notes for your reviewer:

Please check the API documentation endpoint: <http://localhost:8090/swagger-ui.html>.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-10-08 02:04:27 +00:00
guqing 7de944f61d
chore: degrade springboot version from 3.0.0-M5 to 3.0.0-M4 (#2496)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
将 spring boot 的版本从 3.0.0-M5 降级到 3.0.0-M5 以解决 swragger 无法使用的问题
#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?


```release-note
None
```
2022-09-30 08:52:19 +00:00
John Niang 73c66289e0
Bump version of dependencies (#2466)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.0

#### What this PR does / why we need it:

This PR mainly upgrades version of dependencies and removes unused dependencies.

See the following references for more:

- https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0-M5
- https://github.com/jhy/jsoup/releases/tag/jsoup-1.15.3
- https://github.com/spring-projects/spring-security/issues/6613

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-25 11:22:14 +00:00
guqing ac8dd74211
feat: the ConfigMap named system to store user-defined configurations (#2415)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
将原来系统默认的系统配置 system 改名为 system-default, 并使用名为 system 的 ConfigMap 来存储用户自定义的系统配置。系统最终配置为用户自定义系统配置 Merge Patch 系统默认配置的结果。
see also #2304
#### Which issue(s) this PR fixes:

Fixes #2304

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-21 04:06:10 +00:00
guqing a0d55c58f6
feat: theme side provides variables for theme and some system settings (#2406)
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core

#### What this PR does / why we need it:
提供当前使用主题(预览或激活)的 configMap 变量和部分系统设置等变量。

提供了以下变量:
- `${theme}` 当前主题的信息,theme.yaml 
- `${theme.config}` 获取当前主题的设置项
- ~`${siteSetting}`~ `${site}` 提供必要系统变量

#### Which issue(s) this PR fixes:
Fixes #2389

#### Special notes for your reviewer:
how to test it?
再任意主题模板上使用表达式获取例如:`${theme}`,`${theme.config.sns?.email}`

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-15 06:52:13 +00:00
guqing b9957542f4
feat: add post module basic implementation (#2326)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind feature
/milestone 2.0
/area core
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
新增文章模块的基本实现
提供创建文章,更新草稿和发布文章三个 API
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
A part of #2322

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-08-22 07:32:11 +00:00
John Niang 9911ba927d
Replace JDBC to R2DBC (#2324)
#### What type of PR is this?

/kind feature
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:

1. Replace JDBC to R2DBC
2. Make our system fully reactive

#### Which issue(s) this PR fixes

Fixes #2308

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-08-17 02:56:11 +00:00
John Niang 86f9daf421
Replace JSON schema with OpenAPI 3.0 (#2300)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:

This PR introduces [openapi4j](https://github.com/openapi4j/openapi4j) to replace JSON schema. See #2294 for more.

#### Which issue(s) this PR fixes:

Fix #2294

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-08-03 03:34:14 +00:00
John Niang 3640dca0a1
Add label and field selector to Extension list API (#2279)
#### What type of PR is this?

/kind feature
/kind api-change
/area core
/milestone 2.0

#### What this PR does / why we need it:

Add label and field selector to Extension list API for filtering Extensions.

<img width="322" alt="image" src="https://user-images.githubusercontent.com/16865714/181462887-549162fd-5e8d-4cec-834c-24875ada4789.png">

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-07-29 05:22:14 +00:00
John Niang 4cb94d3752
Upgrade Spring Boot to 3.0.0-M4 (#2269)
#### What type of PR is this?

/kind flake
/area core
/milestone 2.0

#### What this PR does / why we need it:

Upgrade Spring Boot to 3.0.0-M4. Please see <https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0-M4>.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-07-22 03:13:50 +00:00
John Niang 5953d2201d
Refactor CICD for Halo next (#2236) 2022-07-12 11:01:00 +08:00
John Niang 1024f71635
Replace webmvc with webflux (#2138)
* Replace webmvc to webflux

Signed-off-by: johnniang <johnniang@fastmail.com>

* Remove jetty dependency

Signed-off-by: johnniang <johnniang@fastmail.com>

* Refactor authentication module

* Refactor authentication module

* Migrate authorization module

* Refactor Login components

* Fix broken imports

* Upgrade springdoc version

* Refine security matcher using pathMatchers utility
2022-06-07 02:20:12 +00:00
guqing 2c057f4fe1
feat: add plugin implementation (#2128) 2022-05-31 04:06:10 +00:00
guqing 3c856d04af
feat: add personal access token authentication mechanism (#2116)
* feat: add personal access token authentication

* fix: merge conflicts

* refactor: remove base62 codec

* refactor: remove deprecated method

* feat: add base64 test

* chore: add todo for test only methods
2022-05-27 06:26:37 +00:00
John Niang 9990fdd086
Upgrade to Spring Boot 3.0.0-M3 (#2102)
Please see https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0-M3
2022-05-20 03:35:34 +00:00
John Niang 5f9daf4735
Add JSON schema generator and validator (#2093)
Only validate the JSON schema when saving Extension into database.
2022-05-17 16:06:12 +00:00
John Niang 3cf2f9d7e1
Add support for API documentation (#2082) 2022-05-11 08:06:11 +00:00
John Niang 6db4f1105a
Upgrade Spring Boot to 3.0.0-M2 (#2071)
from 3.0.0-M1 to 3.0.0-M2, please refer to https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0-M2
2022-05-06 09:56:13 +00:00
guqing 90d61a27e9
feat: add token provider (#1841) 2022-04-13 11:38:34 +00:00
guqing b3c82396ac
feat: Add security config for halo (#1838)
* feat: Add security config for halo

* chore: delete file

* feat: add security config intergration test case

* refactor: use EnableWebSecurity annotation

* refactor: patch prefix

* Update src/test/java/run/halo/app/integration/security/AuthenticationTest.java

Co-authored-by: John Niang <johnniang@fastmail.com>

* refactor: mvc path prefix config

Co-authored-by: John Niang <johnniang@fastmail.com>
2022-04-13 09:08:34 +00:00
guqing e2843adbe7
Create basic project structure for halo 2.0 (#1699)
* feat: Add project structure

* feat: Add config

* feat: Add flyway migrate config for h2 and mysql and postgresql

* fix: checkstyle config

* chore: Upgrade springboot 2.6 to 3.0.0-m1

* feat: Add spring snapshot url for repositories

* refactor: Change jdk11 to jdk17 for github ci config

* refactor: update build.gradle config
2022-03-04 15:04:11 +08:00
Ryan Wang 641264ba5c chore: clean code for next major version
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-03-03 11:34:42 +08:00
Ryan Wang c306586778
chore: bump Spring Boot to 2.5.10 (#1677)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-02-26 12:30:34 +08:00
PONGSKY 4bfc3c0228
Revert dependency of minio-java to 7.1.4 (#1666)
* fix: 降低 minio 版本,回滚至与 springboot 相对应的 okhttp 依赖版本
2022-02-25 21:24:56 +08:00
guqing 923eb17577
Support post content version control (#1617)
* feat: split post content to new table and support content version control

* feat: Improve post version management

* feat: Add post content and version record deletion

* feat: Add isInProcess attribute for post list and detail api

* feat: Add migrate sql script

* fix: Add a sql of allow origin_content to null in posts table

* feat: Assign a value to the source of the post content version record
2022-02-20 20:34:56 +08:00
John Niang 2ff45600c4
Bump spring boot to 2.5.9 (#1635)
Signed-off-by: johnniang <johnniang@fastmail.com>
2022-01-23 23:31:27 +08:00
guqing 23b39519e4
chore: upgrade log4j dependencies (#1615) 2022-01-06 12:50:17 +08:00
John Niang 21de4d7e55
Bump version of dependencies (#1602)
* Bump versions of dependencies

* Bump spring boot to 2.5.8

Signed-off-by: John Niang <johnniang@fastmail.com>

* Revert dependency of bce sdk

Signed-off-by: John Niang <johnniang@fastmail.com>
2021-12-23 11:17:58 +08:00
Tang 201e93465c
fix: Log4j Security Vulnerabilities (#1604)
update Log4j version to 2.17.0
- CVE-2021-45105 Fixed in Log4j 2.17.0 (Java 8)
- CVE-2021-45046 Fixed in Log4j 2.16.0 (Java 8)
2021-12-22 16:41:03 +08:00
guqing f2395b7b5f
refactor: gradle config of log4j version (#1595) 2021-12-12 22:50:56 +08:00
guqing 90216d12c3
Fix security warning of log4j 0-day (#1588)
* fix: security warning of log4j 0-day

* refactor: log4j version

* feat: add a todo comment
2021-12-12 09:50:18 +08:00
John Niang a376dca4d5
Set the final version with tag name when releasing (#1511)
Signed-off-by: John Niang <johnniang@fastmail.com>
2021-11-01 23:16:41 +08:00
Ryan Wang 0a137136ce release: 1.4.13 2021-10-24 15:11:59 +08:00
guqing de71f40de6
refactor: remove use of hutool toolset (#1488)
* feat: Add date parse methods and test

* feat: Add utility methods of get the specified part of the given date

* refactor: Replace the use of dateutil in hutool

* refactor: Replace the StrUtil of hutool with StringUtils of commons-lang3

* refactor: Replace the use of Tuple in hutool

* refactor: Replace the use of ServltUtil in hutool

* refactor: Replace the use of PageUtil in hutool

* refactor: Replace the use of CollectionUtil in hutool

* refactor: Add QRcode generate method

* refactor: replace all hutool utility and add some utils

* fix: check style of tests

* refactor: add logging

* fix: logging

* fix: set default timezone

* fix: code style

* refactor: rename variable tfaKey to mfaKey

* refactor: Use commons-lang3's RandomStringUtils to replace some methods

* refactor: update javadoc

* refactor: update test

* refactor: reformat code

* feat: Add more test case

* feat: Add source
2021-10-01 17:55:58 +08:00
Ryan Wang c4008b9333 release: 1.4.12 2021-09-16 20:55:03 +08:00
Ryan Wang 84056cf9a0 release: 1.4.11 2021-07-24 12:26:12 +08:00
ryanwang 6eb8f32b85 release: 1.4.10 2021-07-20 14:09:48 +08:00
guqing 1ae186520e
fix: BytebuddyAgent Unable to use in the JRE environment so remove it (#1429)
* fix: BytebuddyAgent Unable to use in the JRE environment so remove it

* feat: Add package info
2021-07-20 09:39:08 +08:00
Ryan Wang b6527823e4 release: 1.4.9 2021-07-18 23:58:18 +08:00
guqing 5be4b83799
feat: markdown supports footnote rendering (#1406)
* feat: MarkDown supports footnote rendering

* fix: code style

* feat: Flexmark footnote rendering adapts to markdown-it

* feat: Adaptation markdown-it-footnote back-ref button rendering and add test

* fix: Fix doc

* refactor: FootnoteNodeRenderInterceptorTest

* fix: Fix test code style

* refactor: change footnote back ref string

* refactor: remove unicode
2021-06-29 13:27:58 +08:00
Ryan Wang f4807b5b56
chore(deps): upgrade spring-boot to 2.5.1 (#1401) 2021-06-20 16:35:49 +08:00
John Niang 1f89ba0ed2
Upgrade SpringBoot to 2.5.0 (#1389) 2021-05-28 08:41:07 +08:00
Ryan Wang 0dff0e9ce5
chore(deps): upgrade to spring boot 2.5.0-RC.1. (#1376) 2021-05-17 20:22:04 +08:00
Ryan Wang 25bb253e82 release: 1.4.8 2021-04-09 15:15:23 +08:00
Ryan Wang eed1ef379d
chore(deps): upgrade ali oss sdk dependency. (#1335) 2021-03-29 23:32:59 +08:00
Ryan Wang 9ba9dc40cc
chore: remove deprecated code. (#1334) 2021-03-29 16:57:21 +08:00
John Niang a3033f294e
Upgrade to Spring Boot 2.5.0-M3 (#1324) 2021-03-27 10:46:47 +08:00
Ryan Wang 30c50f61f8 release: 1.4.7 2021-03-14 12:53:07 +08:00
Ryan Wang a72131de85 release: 1.4.7-beta.1 2021-03-14 12:34:56 +08:00