Skip to content

Commit

Permalink
🔖 发布 2.3.4,增加 CDN 文件的后台配置
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyd-c committed May 22, 2022
1 parent a4583e5 commit b711a2d
Show file tree
Hide file tree
Showing 17 changed files with 396 additions and 141 deletions.
2 changes: 1 addition & 1 deletion blog-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.zyd</groupId>
<artifactId>blog</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</parent>

<dependencies>
Expand Down
364 changes: 298 additions & 66 deletions blog-admin/src/main/resources/templates/config.ftl

Large diffs are not rendered by default.

38 changes: 18 additions & 20 deletions blog-admin/src/main/resources/templates/include/macros.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,24 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>${config.siteName}后台管理系统</title>
<link href="/assets/images/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/toastr.js/2.0.3/css/toastr.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/skins/square/green.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-daterangepicker/2.1.25/daterangepicker.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@ztree/[email protected]/css/metroStyle/metroStyle.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/switchery/0.8.2/switchery.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput-typeahead.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@adactive/[email protected]/dist/bootstrap-tagsinput.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/index.min.css" rel="stylesheet">
<#--
<link href="https://cdnjs.cloudflare.com/ajax/libs/pnotify/3.2.1/pnotify.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/pnotify/3.2.1/pnotify.buttons.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/pnotify/3.2.1/pnotify.nonblock.css" rel="stylesheet">-->

<#if config.adminCssCdn?? && (config.adminCssCdn?length > 0)>
${config.adminCssCdn!}
<#else >
<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/toastr.js/2.0.3/css/toastr.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/iCheck/1.0.2/skins/square/green.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-daterangepicker/2.1.25/daterangepicker.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/zTree.v3/3.5.29/css/metroStyle/metroStyle.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/switchery/0.8.2/switchery.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput-typeahead.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput.css" rel="stylesheet">
</#if>
<link href="/assets/css/bootstrap-treetable.css" rel="stylesheet" type="text/css" />
<link href="/assets/css/zhyd.core.css" rel="stylesheet">
<#nested>
Expand Down
48 changes: 25 additions & 23 deletions blog-admin/src/main/resources/templates/layout/footer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,33 @@
staticPath: '${config.staticWebSite}'
}
</script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery_lazyload/1.9.3/jquery.lazyload.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/mustache.js/2.3.0/mustache.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/js-xss/0.3.3/xss.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.js"></script>
<script src="https://cdn.staticfile.org/toastr.js/2.0.3/js/toastr.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/iCheck/1.0.2/icheck.min.js"></script>
<script src="https://cdn.staticfile.org/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>
<script src="https://cdn.staticfile.org/bootstrap-table/1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/moment.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-daterangepicker/2.1.25/daterangepicker.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/bootstrap-progressbar/0.9.0/bootstrap-progressbar.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/zTree.v3/3.5.37/js/jquery.ztree.core.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/zTree.v3/3.5.37/js/jquery.ztree.excheck.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/wangEditor.min.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/@adactive/[email protected]/dist/bootstrap-tagsinput.min.js"></script>
<#if config.adminJsCdn?? && (config.adminJsCdn?length > 0)>
${config.adminJsCdn!}
<#else >
<script type="text/javascript" src="https://cdn.staticfile.org/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/mustache.js/2.3.0/mustache.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/js-xss/0.3.3/xss.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/toastr.js/2.0.3/js/toastr.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/iCheck/1.0.2/icheck.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/bootstrap-table/1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>

<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/bootstrap-daterangepicker/2.1.25/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/bootstrap-daterangepicker/2.1.25/daterangepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/bootstrap-progressbar/0.9.0/bootstrap-progressbar.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/zTree.v3/3.5.37/js/jquery.ztree.core.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/zTree.v3/3.5.37/js/jquery.ztree.excheck.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/switchery/0.8.2/switchery.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/wangEditor.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/bootstrap-tagsinput/0.8.0/bootstrap-tagsinput.min.js"></script>
</#if>
<script src="https://www.layuicdn.com/layui/layui.js"></script>
<#--<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js"></script>-->
<#if config.tinyMCEKey?exists>
<script src="https://cdn.tiny.cloud/1/${config.tinyMCEKey!}/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script>
<#else>
Expand Down
2 changes: 1 addition & 1 deletion blog-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.zyd</groupId>
<artifactId>blog</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</parent>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion blog-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.zyd</groupId>
<artifactId>blog</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</parent>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public void run(ApplicationArguments applicationArguments) {

@Override
public void contextInitialized(ServletContextEvent event) {
log.info("博客关键配置信息:");
log.info("current version:{}", appProperties.getVersion());
log.info("current oneblog version:{}", appProperties.getVersion());
if (appProperties.isEnabledPrintConfig()) {
log.info("博客关键配置信息:");
String[] activeProfiles = configurableApplicationContext.getEnvironment().getActiveProfiles();
if (ObjectUtils.isEmpty(activeProfiles)) {
String[] defaultProfiles = configurableApplicationContext.getEnvironment().getDefaultProfiles();
Expand Down
3 changes: 2 additions & 1 deletion blog-core/src/main/resources/config/application-center.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ spring:
druid:
connection-init-sqls: set names utf8mb4
driver-class-name: com.mysql.cj.jdbc.Driver
test-while-idle: false
type: com.alibaba.druid.pool.DruidDataSource
url: jdbc:mysql://${ONEBLOG_DATASOURCE_HOST:127.0.0.1}:${ONEBLOG_DATASOURCE_PORT:3306}/${ONEBLOG_DATASOURCE_DATABASE_NAME:dblog}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true&useLegacyDatetimeCode=false
username: ${ONEBLOG_DATASOURCE_USERNAME:root}
Expand Down Expand Up @@ -86,5 +87,5 @@ pagehelper:
params: count=countSql

app:
version: v2.3.3
version: v2.3.4
enableRedisCache: ${ONEBLOG_ENABLE_REDIS_CACHE:false}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void passwordTest() throws Exception {
public void encryptTest(String password, String salt) throws Exception {
String encrypt = PasswordUtil.encrypt(password, salt);
System.out.println(encrypt);
String decrypt = PasswordUtil.decrypt("VpavsFi6DaRqF5o3nziCgw==", "root");
String decrypt = PasswordUtil.decrypt("CGUx1FN++xS+4wNDFeN6DA==", "root");
System.out.println(decrypt);
}

Expand Down
2 changes: 1 addition & 1 deletion blog-file/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.zyd</groupId>
<artifactId>blog</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion blog-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<parent>
<groupId>com.zyd</groupId>
<artifactId>blog</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</parent>

<dependencies>
Expand Down
22 changes: 13 additions & 9 deletions blog-web/src/main/resources/templates/layout/footer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,19 @@
</div>
</footer>
<a class="to-top" title="点击返回顶部" data-toggle="tooltip" data-placement="bottom"></a>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/js-xss/0.3.3/xss.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/mustache.js/2.3.0/mustache.min.js"></script>
<#if config.webJsCdn?? && (config.webJsCdn?length > 0)>
${config.webJsCdn!}
<#else >
<script type="text/javascript" src="https://cdn.staticfile.org/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery.lazyload/1.9.1/jquery.lazyload.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/js-xss/0.3.3/xss.min.js"></script>
<script type="text/javascript" src="https://cdn.staticfile.org/mustache.js/2.3.0/mustache.min.js"></script>
</#if>
<script type="text/javascript">
var appConfig = {
siteName: "${config.siteName}",
Expand Down
18 changes: 11 additions & 7 deletions blog-web/src/main/resources/templates/layout/quote.ftl
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<link href="${config.siteFavicon}" rel="shortcut icon" type="image/x-icon">
<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/jquery.bootstrapvalidator/0.5.3/css/bootstrapValidator.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
<#if config.webCssCdn?? && (config.webCssCdn?length > 0)>
${config.webCssCdn!}
<#else >
<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/jquery.bootstrapvalidator/0.5.3/css/bootstrapValidator.min.css" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
</#if>
<link href="${config.staticWebSite}/css/zhyd.core.css" rel="stylesheet" type="text/css">
<link href="${config.staticWebSite}/css/zhyd.comment.css" rel="stylesheet" type="text/css">
<link href="${config.staticWebSite}/css/zhyd.comment.css" rel="stylesheet" type="text/css">
Binary file added docs/_media/customCdnConfig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/bin/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3
2.3.4
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.zyd</groupId>
<artifactId>blog</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
<packaging>pom</packaging>
<modules>
<module>blog-core</module>
Expand Down Expand Up @@ -59,27 +59,27 @@
<dependency>
<groupId>com.zyd</groupId>
<artifactId>blog-core</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</dependency>
<dependency>
<groupId>com.zyd</groupId>
<artifactId>blog-admin</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</dependency>
<dependency>
<groupId>com.zyd</groupId>
<artifactId>blog-web</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</dependency>
<dependency>
<groupId>com.zyd</groupId>
<artifactId>blog-file</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</dependency>
<dependency>
<groupId>com.zyd</groupId>
<artifactId>blog-codegen</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
14 changes: 14 additions & 0 deletions update.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@

----

### 2022-05-22

- 修改 CDN 资源
- 增加 CDN 资源引用文件的后台配置,当 CDN 不可用时,可以直接修改(如果没有则需添加)数据库中的下面四个配置:
- adminJsCdn(控制台 JS 文件的 CDN)
- adminCssCdn(控制台 CSS 文件的 CDN)
- webJsCdn(Web 端 JS 文件的 CDN)
- webCssCdn(Web 端 CSS 文件的 CDN)

注意:如果是手动操作数据库进行修改配置信息,则必须更改 `update_time`,并且更改后的 `update_time` 一定是晚于之前的 `update_time` 值。

关于如何配置以上四个属性,可以参考 blog-admin/src/main/resources/templates/config.ftl 文件中 `customJsCdnModal``customWebJsCdnModal``customCssCdnModal``customWebCssCdnModal` 提示框下的配置说明。 比如:
![img.png](./docs/_media/customCdnConfig.png)

### 2021-11-01

- 增加定时任务:“每晚凌晨12点自动检查友联,对于私自取消友联的网站实行自动封禁”
Expand Down

0 comments on commit b711a2d

Please sign in to comment.