Skip to content

Commit

Permalink
release: 1.2.0. (#467)
Browse files Browse the repository at this point in the history
release: 1.2.0.

Co-authored-by: Jiahuan Shen <[email protected]>
Co-authored-by: John Niang <[email protected]>
Co-authored-by: Ryan Wang <[email protected]>
Co-authored-by: null <[email protected]>
Co-authored-by: bobo <[email protected]>
Co-authored-by: Lei XinXin <[email protected]>
Co-authored-by: 寒山 <[email protected]>
Co-authored-by: IJKZEN <[email protected]>
  • Loading branch information
8 people authored Jan 5, 2020
2 parents 0e1163e + 753a3bc commit 2203889
Show file tree
Hide file tree
Showing 372 changed files with 7,880 additions and 2,048 deletions.
19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Bug Report
about: 事情不像预期的那样工作吗?
title: ''
labels: 'bug'
assignees: ''

---

<!--
你好!感谢你正在考虑为 Halo 提交一个 bug。请花一点点时间尽量详细地回答以下基础问题。
谢谢!
-->

<!--
请确认你已经做了下面这些事情,若 bug 还是未解决,那么请尽可详细地描述你的问题。
- 我已经安装了最新版的 Halo
- 我已经搜索了已有的 Issues 列表中有关的信息
- 我已经搜索了论坛中有关的信息:https://bbs.halo.run
- 我已经阅读了 Halo 的 FAQ:https://halo.run/guide/faq.html
-->

## 我的环境

<!--
请登录到博客后台,进入菜单 `系统->关于` 点击 `环境信息` 旁边的按钮即可复制环境信息。
-->

---

## 错误日志

<!--
请登录到博客后台,点击菜单栏中的 `Halo Dashboard` 10 次即可开启 `开发者选项`。进入开发者选项中的 `实时日志`。
你可以选择查找具体的错误日志,或者直接下载日志文件复制到下面即可。(注意:日志堆栈信息请用 Markdown 的代码块语法,以方便查看。)
-->

---

## 期望行为

<!--
你期望会发生什么?
-->

## 当前行为

<!--
描述 bug 细节,确认出现此问题的复现步骤,例如点击了哪里,发生了什么情况?
你可以粘贴截图或附件。
-->
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Feature Request
about: 想让我们为 Halo 增加什么功能吗?
title: 'feat: '
labels: 'Feature Request'
assignees: ''

---

<!--
你好!感谢你愿意考虑希望 Halo 增加某个新功能。请花一点点时间尽量详细地回答以下基础问题。
谢谢!
-->

## 概述

<!--
对这个新功能的一段描述
-->

## 动机

<!--
为什么你希望在 Halo 中使用这个功能?
-->

## 详细解释

<!--
详细描述这个新功能。
如果这是一个小功能,你可以忽略这部分。
-->
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Question
about: 对 Halo 有任何问题吗?
title: ''
labels: 'question'
assignees: ''

---

<!--
如果你有任何问题也可以通过此渠道来向我们反馈。
谢谢!
-->
17 changes: 17 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Java CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM openjdk:8-jre-alpine

FROM adoptopenjdk/openjdk8-openj9
VOLUME /tmp

ARG JAR_FILE=build/libs/halo.jar
Expand All @@ -13,4 +12,4 @@ COPY ${JAR_FILE} halo.jar

EXPOSE ${PORT}

ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -server -jar halo.jar
ENTRYPOINT java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -server -jar halo.jar
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

> Halo 是一款现代化的个人独立博客系统,给习惯写博客的同学多一个选择。


<p align="center">
<a href="#"><img alt="JDK" src="https://img.shields.io/badge/JDK-1.8-yellow.svg?style=flat-square"/></a>
<a href="https://github.com/halo-dev/halo/releases"><img alt="GitHub release" src="https://img.shields.io/github/release/halo-dev/halo.svg?style=flat-square"/></a>
Expand All @@ -21,20 +19,24 @@

轻快,简洁,功能强大,使用 Java 开发的博客系统。

> [官方社区](https://bbs.halo.run) | [QQ 交流群](https://jq.qq.com/?_wv=1027&k=5tnr930) | [Telegram 交流群](https://t.me/HaloBlog) | [Telegram 频道](https://t.me/halo_dev) | [WeHalo 小程序](https://github.com/aquanlerou/WeHalo)
> [官网](https://halo.run) | [社区](https://bbs.halo.run) | [QQ 交流群](https://jq.qq.com/?_wv=1027&k=5tnr930) | [Telegram 交流群](https://t.me/HaloBlog) | [Telegram 频道](https://t.me/halo_dev)
## 声明

> 本项目旨在创造一个好的产品以供人们使用(虽然现在并不是太好),并非一个所谓提供学习的项目。所以,不提供任何学习代码的帮助。所以,请不要在讨论群,issues,论坛发起任何有关代码学习的问题。当然,如果你是要参与代码贡献,我们非常欢迎。
## 快速开始

### 下载最新的 Halo 安装包

```bash
curl -L https://github.com/halo-dev/halo/releases/download/v1.1.1/halo-1.1.1.jar --output halo-latest.jar
curl -L https://github.com/halo-dev/halo/releases/download/v1.2.0/halo-1.2.0.jar --output halo-latest.jar
```

或者

```bash
wget https://github.com/halo-dev/halo/releases/download/v1.1.1/halo-1.1.1.jar -O halo-latest.jar
wget https://github.com/halo-dev/halo/releases/download/v1.2.0/halo-1.2.0.jar -O halo-latest.jar
```

### 启动 Halo
Expand All @@ -55,12 +57,13 @@ java -jar halo-latest.jar
- 独立评论模块(halo-comment):<https://github.com/halo-dev/halo-comment>
- 管理 APP(halo-app):<https://github.com/halo-dev/halo-app>
- 主题仓库:<https://halo.run/theme>
- WeHalo 小程序:<https://github.com/aquanlerou/WeHalo>

## 许可证

[![license](https://img.shields.io/github/license/halo-dev/halo.svg?style=flat-square)](https://github.com/halo-dev/halo/blob/master/LICENSE)

> Halo 使用 GPL-v3.0 协议开源,请尽量遵守开源协议,即便是在中国
> Halo 使用 GPL-v3.0 协议开源,请尽量遵守开源协议。
## 贡献
参考 [CONTRIBUTING](./CONTRIBUTING.md)
Expand All @@ -81,8 +84,6 @@ java -jar halo-latest.jar

![theme-icarus.png](https://i.loli.net/2019/09/11/4lO2wNCLiqyIJmR.png)

![theme-destiny.png](https://i.loli.net/2019/09/11/q4t86cCPUEwlGMn.png)

![install.png](https://i.loli.net/2019/09/11/Iu1eMzZDg6frw97.png)

![admin-login.png](https://i.loli.net/2019/09/11/3CahVJAvXngwiQu.png)
Expand Down
17 changes: 12 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.springframework.boot' version '2.1.7.RELEASE'
id 'org.springframework.boot' version '2.2.1.RELEASE'
id "io.freefair.lombok" version "3.6.6"
// id 'war'
id 'java'
Expand All @@ -9,7 +9,7 @@ apply plugin: 'io.spring.dependency-management'

group = 'run.halo.app'
archivesBaseName = 'halo'
version = '1.1.1'
version = '1.2.0'
sourceCompatibility = '1.8'
description = 'Halo, personal blog system developed in Java.'

Expand Down Expand Up @@ -43,7 +43,7 @@ bootJar {

ext {
ohMyEmailVersion = '0.0.4'
hutoolVersion = '4.6.3'
hutoolVersion = '5.0.3'
upyunSdkVersion = '4.0.1'
qiniuSdkVersion = '7.2.18'
aliyunSdkVersion = '3.4.2'
Expand All @@ -56,6 +56,9 @@ ext {
jgitVersion = '5.3.0.201903130848-r'
flexmarkVersion = '0.42.12'
thumbnailatorVersion = '0.4.8'
image4jVersion = '0.7zensight1'
flywayVersion = '6.1.0'
h2Version = '1.4.196'
}

dependencies {
Expand Down Expand Up @@ -93,17 +96,21 @@ dependencies {
implementation "com.vladsch.flexmark:flexmark-ext-tables:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-toc:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-yaml-front-matter:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-ext-gitlab:$flexmarkVersion"
implementation "com.vladsch.flexmark:flexmark-html-parser:$flexmarkVersion"

implementation "net.coobird:thumbnailator:$thumbnailatorVersion"
implementation "net.sf.image4j:image4j:$image4jVersion"
implementation "org.flywaydb:flyway-core:$flywayVersion"

runtimeOnly 'com.h2database:h2'
runtimeOnly "com.h2database:h2:$h2Version"
runtimeOnly 'mysql:mysql-connector-java'


compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

testImplementation 'org.springframework.boot:spring-boot-starter-test'

developmentOnly 'org.springframework.boot:spring-boot-devtools'
}
}
27 changes: 22 additions & 5 deletions src/main/java/run/halo/app/Application.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package run.halo.app;

import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import run.halo.app.repository.base.BaseRepositoryImpl;

/**
* <pre>
* Halo run!
* </pre>
* Halo main class.
*
* @author ryanwang
* @date : 2017/11/14
* @date 2017-11-14
*/
@SpringBootApplication
@EnableJpaAuditing
Expand All @@ -25,12 +25,29 @@
@EnableJpaRepositories(basePackages = "run.halo.app.repository", repositoryBaseClass = BaseRepositoryImpl.class)
public class Application extends SpringBootServletInitializer {

private static ConfigurableApplicationContext context;

public static void main(String[] args) {
// Customize the spring config location
System.setProperty("spring.config.additional-location", "file:${user.home}/.halo/,file:${user.home}/halo-dev/");

// Run application
SpringApplication.run(Application.class, args);
context = SpringApplication.run(Application.class, args);
}

/**
* Restart Application.
*/
public static void restart() {
ApplicationArguments args = context.getBean(ApplicationArguments.class);

Thread thread = new Thread(() -> {
context.close();
context = SpringApplication.run(Application.class, args.getSourceArgs());
});

thread.setDaemon(false);
thread.start();
}

@Override
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/run/halo/app/cache/InMemoryCacheStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ Boolean putInternalIfAbsent(String key, CacheWrapper<String> cacheWrapper) {

log.debug("Preparing to put key: [{}], value: [{}]", key, cacheWrapper);

lock.lock();
try {
lock.lock();
// Get the value before
Optional<String> valueOptional = get(key);

Expand Down Expand Up @@ -98,6 +98,11 @@ public void delete(String key) {
public void preDestroy() {
log.debug("Cancelling all timer tasks");
timer.cancel();
clear();
}

private void clear() {
CACHE_CONTAINER.clear();
}

/**
Expand Down
Loading

0 comments on commit 2203889

Please sign in to comment.