Skip to content

Commit 2a1dbb9

Browse files
committed
release version to v2.6.1
1 parent 2dff1a4 commit 2a1dbb9

12 files changed

Lines changed: 182 additions & 112 deletions

File tree

.github/workflows/release-builder.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ jobs:
2929
- name: Prepare
3030
id: prep
3131
run: |
32-
TAG=$(echo $GITHUB_REF | cut -d / -f 3)
3332
IMAGE="tangcuyu/bolo-solo"
3433
echo ::set-output name=image::${IMAGE}
35-
echo ::set-output name=tag::${TAG}
36-
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
3734
- name: Set up QEMU
3835
uses: docker/setup-qemu-action@v1
3936
with:

src/main/java/org/b3log/solo/SoloServletListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void contextInitialized(final ServletContextEvent servletContextEvent) {
173173
"█ ██╔══██╗██╔═══██╗██║ ██╔═══██╗ █ Welcome to Bolo :) █\n" +
174174
"█ ██████╔╝██║ ██║██║ ██║ ██║ █ █\n" +
175175
"█ ██╔══██╗██║ ██║██║ ██║ ██║ █ github.com/adlered/bolo-solo █\n" +
176-
"█ ██████╔╝╚██████╔╝███████╗╚██████╔╝ █ Current Version: " + BOLO_VERSION_EN + " \n" +
176+
"█ ██████╔╝╚██████╔╝███████╗╚██████╔╝ █ CurrentVersion: " + BOLO_VERSION_EN + "█\n" +
177177
"█ ╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ █ █\n" +
178178
"█ █ █\n" +
179179
"████✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩✩████\n" +

src/main/java/org/b3log/solo/bolo/prop/BackupService.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.b3log.solo.SoloServletListener;
4242
import org.b3log.solo.bolo.tool.DeleteFolder;
4343
import org.b3log.solo.model.Article;
44+
import org.b3log.solo.model.Option;
4445
import org.b3log.solo.repository.UserRepository;
4546
import org.b3log.solo.service.ArticleMgmtService;
4647
import org.b3log.solo.service.ExportService;
@@ -136,8 +137,15 @@ public void uploadBackupToGithub(final RequestContext context) {
136137
}
137138

138139
try {
139-
exportService.exportGitHub();
140-
140+
boolean enableAutoFlushGitHubProfile;
141+
try {
142+
enableAutoFlushGitHubProfile = optionQueryService
143+
.getOptionById(Option.ID_C_ENABLE_AUTO_FLUSH_BLOG_TO_GITHUB_PROFILE)
144+
.optBoolean(Option.OPTION_VALUE);
145+
} catch (Exception e) {
146+
enableAutoFlushGitHubProfile = false;
147+
}
148+
exportService.exportGitHub(enableAutoFlushGitHubProfile);
141149
context.renderJSON().renderCode(200);
142150
context.renderJSON().renderMsg("Exported backup to GitHub manual successfully.");
143151

src/main/java/org/b3log/solo/bolo/prop/Options.java

Lines changed: 105 additions & 67 deletions
Large diffs are not rendered by default.

src/main/java/org/b3log/solo/model/Option.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,17 @@ public final class Option {
5454
// oId constants
5555

5656
/**
57-
* Key of code block line num show flag. 支持代码块行号显示 https://github.com/88250/solo/issues/4
57+
* Key of code block line num show flag. 支持代码块行号显示
58+
* https://github.com/88250/solo/issues/4
5859
*/
5960
public static final String ID_C_SHOW_CODE_BLOCK_LN = "showCodeBlockLn";
6061

6162
/**
6263
* Key of editor mode. 支持配置编辑器模式 https://github.com/88250/solo/issues/95
6364
* <ul>
64-
* <li>wysiwyg:所见即所得</li>
65-
* <li>ir:即时渲染</li>
66-
* <li>sv:分屏预览</li>
65+
* <li>wysiwyg:所见即所得</li>
66+
* <li>ir:即时渲染</li>
67+
* <li>sv:分屏预览</li>
6768
* </ul>
6869
* 模式细节介绍详见 <a href="https://github.com/Vanessa219/vditor">Vditor</a> 编辑器文档。
6970
*/
@@ -75,12 +76,14 @@ public final class Option {
7576
public static final String ID_C_HLJS_THEME = "hljsTheme";
7677

7778
/**
78-
* Key of enable backup public articles to HacPai. 备份公开文章到社区 https://ld246.com/article/1557238327458
79+
* Key of enable backup public articles to HacPai. 备份公开文章到社区
80+
* https://ld246.com/article/1557238327458
7981
*/
8082
public static final String ID_C_SYNC_GITHUB = "syncGitHub";
8183

8284
/**
83-
* Key of enable sync (pull) GitHub. 拉取并展示仓库 https://ld246.com/article/1557238327458
85+
* Key of enable sync (pull) GitHub. 拉取并展示仓库
86+
* https://ld246.com/article/1557238327458
8487
* https://github.com/b3log/solo/issues/12825
8588
*/
8689
public static final String ID_C_PULL_GITHUB = "pullGitHub";
@@ -228,7 +231,6 @@ public final class Option {
228231
*/
229232
public static final String ID_C_THUMB_COMPRESS = "thumbCompress";
230233

231-
232234
/**
233235
* Key of article/page comment-able.
234236
*/
@@ -415,6 +417,11 @@ public final class Option {
415417
*/
416418
public static final String ID_C_ENABLE_AUTO_FLUSH_GITHUB = "enableAutoFlushGitHub";
417419

420+
/**
421+
* Key of enable auto flush blog to github profile repo.
422+
*/
423+
public static final String ID_C_ENABLE_AUTO_FLUSH_BLOG_TO_GITHUB_PROFILE = "enableAutoFlushGitHubProfile";
424+
418425
/**
419426
* Key of my github id.
420427
*/
@@ -623,10 +630,8 @@ public static final class DefaultPreference {
623630
*/
624631
public static final String DEFAULT_MAX_ARCHIVE = "-1";
625632

626-
627633
public static final String DEFAULT_IMAGE_UPLOAD_COMPRESS = "10";
628634

629-
630635
public static final String DEFAULT_THUMB_COMPRESS = "10";
631636

632637
/**

src/main/java/org/b3log/solo/service/CronMgmtService.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
*/
1818
package org.b3log.solo.service;
1919

20+
import java.util.concurrent.Executors;
21+
import java.util.concurrent.ScheduledExecutorService;
22+
import java.util.concurrent.TimeUnit;
23+
2024
import org.b3log.latke.ioc.Inject;
2125
import org.b3log.latke.logging.Level;
2226
import org.b3log.latke.logging.Logger;
@@ -26,10 +30,6 @@
2630
import org.json.JSONException;
2731
import org.json.JSONObject;
2832

29-
import java.util.concurrent.Executors;
30-
import java.util.concurrent.ScheduledExecutorService;
31-
import java.util.concurrent.TimeUnit;
32-
3333
/**
3434
* Cron management service.
3535
*
@@ -101,6 +101,7 @@ public void start() {
101101
SCHEDULED_EXECUTOR_SERVICE.scheduleAtFixedRate(() -> {
102102
try {
103103
boolean enableAutoFlushGitHub;
104+
boolean enableAutoFlushGitHubProfile;
104105
String myGitHubID;
105106
try {
106107
enableAutoFlushGitHub = preference.getBoolean(Option.ID_C_ENABLE_AUTO_FLUSH_GITHUB);
@@ -114,7 +115,13 @@ public void start() {
114115
articleMgmtService.refreshGitHub(myGitHubID);
115116
}
116117
}
117-
exportService.exportGitHub();
118+
try {
119+
enableAutoFlushGitHubProfile = preference
120+
.getBoolean(Option.ID_C_ENABLE_AUTO_FLUSH_BLOG_TO_GITHUB_PROFILE);
121+
} catch (NullPointerException | JSONException e) {
122+
enableAutoFlushGitHubProfile = false;
123+
}
124+
exportService.exportGitHub(enableAutoFlushGitHubProfile);
118125
} catch (final Exception e) {
119126
LOGGER.log(Level.ERROR, "Executes cron failed", e);
120127
} finally {

src/main/java/org/b3log/solo/service/ExportService.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public byte[] exportSQL() {
300300
* Exports public articles to GitHub repo "bolo-blog and user index repo".
301301
*
302302
*/
303-
public void exportGitHub() {
303+
public void exportGitHub(final boolean enableAutoFlushGitHubProfile) {
304304
final JSONObject preference = optionQueryService.getPreference();
305305
if (null == preference) {
306306
return;
@@ -328,7 +328,8 @@ public void exportGitHub() {
328328
return;
329329
}
330330
exportGitHubBlog(recentArticles, preference, gitHubUser);
331-
exportGitHubProfile(recentArticles, preference, gitHubUser);
331+
if (enableAutoFlushGitHubProfile)
332+
exportGitHubProfile(recentArticles, preference, gitHubUser);
332333
}
333334

334335
/**
@@ -413,7 +414,7 @@ private boolean diffUploadReadme(final String pat, final String repoName, final
413414
final String readme,
414415
final String cacheName) throws IOException {
415416
final String tmpDir = System.getProperty("java.io.tmpdir");
416-
LOGGER.info("begin get README.md");
417+
LOGGER.info(String.format("begin get %s README.md:", repoName));
417418
String tmpFilePath = tmpDir + File.separator + cacheName;
418419
File file = FileUtils.getFile(tmpFilePath);
419420

@@ -430,7 +431,7 @@ private boolean diffUploadReadme(final String pat, final String repoName, final
430431

431432
if (!firstTimeRun) {
432433
if (oldReadme != null && oldReadme.equals(readme)) {
433-
LOGGER.info("not need update readme.");
434+
LOGGER.info(String.format("not need update %s readme.", repoName));
434435
return true;
435436
}
436437
}

src/main/resources/lang_en_US.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ myGitHubLabel=My GitHub
431431
selectedKanBanNiangLabel=fixedKanbanNiang:
432432
randomLabel=Random
433433
autoFlushGitHubLabel=Enable and auto flush my github contributes
434+
autoFlushGitHubProfileLabel=Enable and auto flush blog to my github profile repo
434435
myGitHubIDLabel=My GitHub ID:
435436
mailRemindLabel=Mail Remind
436437
serverJiangRemindLabel=Server Jiang Remind
@@ -492,6 +493,7 @@ fishpi1Label=If you are not a member of the fishpi community, it is recommended
492493
fishpi2Label=<b>caution! This setting takes effect after restarting the server.</b><br><br>
493494
fishpi3Label=<summary>How to obtain B3log Key? </summary><ul><li>1. <a href=\"https://fishpi.cn/register?r=Gakkiyomi\" target=\"_blank\">here</a> register a FisPi user ( Check your username in <a href=\"https://fishpi.cn/settings/account\" target=\"_blank\">profile</a>)<br>2. <a href=\"https://fishpi.cn/settings/apikey\" target=\"_blank\">here</a> get and set your API Key<br></li></ul>
494495
myGitHub1Label=<h4>Show my GitHub contributions to visitors</h4><br><p>Bolo can automatically generate an \"My Open Source Project on GitHub\" article for you, recording your contribution data to the public warehouse on GitHub , And presented to the visitors of the blog. </p><p>Please fill in the correct GitHub ID. For example, if your GitHub profile address is https://github.com/adlered, then your GitHub ID is adlered. </p>
496+
myGitHubProfileLabel=<h4>Sync Blog Posts to GithubProfile Personal Homepage Repository</h4><br><p>bolo can automatically sync your latest 5 blog posts to the GithubProfile personal homepage repository and display them to visitors of your Github profile.</p>
495497
myGitHub2Label=Automatic refresh frequency: once every 24 hours; it can be refreshed manually through advanced functions.
496498
usite1Label=<label>The contact information will be displayed as an icon on your blog homepage, effective immediately. <br>The number of contact information displayed for each skin varies, and some of the less common contact information may not be displayed.</label>
497499
usite2Label=Platform

src/main/resources/lang_zh_CN.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ myGitHubLabel=\u6211\u7684 GitHub
433433
selectedKanBanNiangLabel=\u56FA\u5B9A\u770B\u677F\u5A18:
434434
randomLabel=\u968F\u673A
435435
autoFlushGitHubLabel=\u542F\u7528\u5E76\u81EA\u52A8\u5237\u65B0\u6211\u7684 GitHub \u8D21\u732E
436+
autoFlushGitHubProfileLabel=\u542f\u7528\u5e76\u81ea\u52a8\u5237\u65b0\u535a\u6587\u5230\u6211\u7684\u0067\u0069\u0074\u0068\u0075\u0062\u4e2a\u4eba\u8d44\u6599\u4ed3\u5e93
436437
myGitHubIDLabel=\u6211\u7684 GitHub ID:
437438
mailRemindLabel=\u90AE\u4EF6\u63D0\u9192
438439
serverJiangRemindLabel=Server\u9171\u63D0\u9192
@@ -494,6 +495,7 @@ fishpi1Label=\u5982\u679c\u60a8\u4e0d\u662f\u6478\u9c7c\u6d3e\u793e\u533a\u7684\
494495
fishpi2Label=<b>\u8bf7\u6ce8\u610f\uff01\u6b64\u9879\u8bbe\u7f6e\u9700\u8981\u91cd\u542f\u670d\u52a1\u7aef\u540e\u751f\u6548\u3002</b><br><br>
495496
fishpi3Label=<summary>\u5982\u4f55\u53d6\u5f97\u0041\u0050\u0049\u0020\u004b\u0045\u0059\u0020\uff1f</summary><ul><li>1. <a href=\"https://fishpi.cn/register?r=Gakkiyomi\" target=\"_blank\">\u5728\u8fd9\u91cc</a>\u6ce8\u518c\u4e00\u4e2a\u6478\u9c7c\u6d3e\u7528\u6237 <br>1. <a href=\"https://fishpi.cn/settings/api\" target=\"_blank\">\u5728\u8fd9\u91cc</a>\u83b7\u5f97\u5e76\u8bbe\u7f6e\u4f60\u7684\u0041\u0050\u0049\u0020\u004b\u0045\u0059<br></li></ul>
496497
myGitHub1Label=<h4>\u5411\u8BBF\u5BA2\u5C55\u793A\u6211\u7684 GitHub \u8D21\u732E</h4><br><p>Bolo \u53EF\u4EE5\u4E3A\u4F60\u81EA\u52A8\u751F\u6210\u4E00\u7BC7 \u201C\u6211\u5728 GitHub \u4E0A\u7684\u5F00\u6E90\u9879\u76EE\u201D \u6587\u7AE0\uFF0C\u8BB0\u8F7D\u4E86\u4F60\u5728 GitHub \u4E0A\u516C\u5F00\u4ED3\u5E93\u7684\u8D21\u732E\u6570\u636E\uFF0C\u5E76\u5448\u73B0\u7ED9\u535A\u5BA2\u7684\u8BBF\u5BA2\u3002</p><p>\u8BF7\u586B\u5199\u6B63\u786E\u7684 GitHub ID\uFF0C\u4F8B\u5982\u60A8\u7684 GitHub \u8D44\u6599\u5730\u5740\u662F https://github.com/adlered\uFF0C\u5219\u60A8\u7684 GitHub ID \u4E3A adlered\u3002</p>
498+
myGitHubProfileLabel=\u003c\u0068\u0034\u003e\u540c\u6b65\u535a\u6587\u0047\u0069\u0074\u0068\u0075\u0062\u0050\u0072\u006f\u0066\u0069\u006c\u0065\u4e2a\u4eba\u4e3b\u9875\u4ed3\u5e93\u003c\u002f\u0068\u0034\u003e\u003c\u0062\u0072\u003e\u003c\u0070\u003e\u0062\u006f\u006c\u006f\u0020\u53ef\u4ee5\u4e3a\u4f60\u81ea\u52a8\u540c\u6b65\u6700\u8fd1\u0035\u7bc7\u535a\u6587\u5230\u0047\u0069\u0074\u0068\u0075\u0062\u0050\u0072\u006f\u0066\u0069\u006c\u0065\u4e2a\u4eba\u4e3b\u9875\u4ed3\u5e93\uff0c\u5e76\u5448\u73b0\u7ed9\u4f60\u7684\u0047\u0069\u0074\u0068\u0075\u0062\u4e3b\u9875\u7684\u8bbf\u5ba2\u3002\u003c\u002f\u0070\u003e
497499
myGitHub2Label=\u81EA\u52A8\u5237\u65B0\u9891\u6B21\uFF1A\u6BCF24\u5C0F\u65F6\u4E00\u6B21\uFF1B\u53EF\u901A\u8FC7\u9AD8\u7EA7\u529F\u80FD\u624B\u52A8\u5237\u65B0\u3002
498500
usite1Label=<label>\u8054\u7CFB\u65B9\u5F0F\u5C06\u4EE5\u56FE\u6807\u7684\u65B9\u5F0F\u663E\u793A\u5728\u4F60\u7684\u535A\u5BA2\u4E3B\u9875\u4E2D\uFF0C\u7ACB\u5373\u751F\u6548\u3002<br>\u6BCF\u4E2A\u76AE\u80A4\u652F\u6301\u663E\u793A\u7684\u8054\u7CFB\u65B9\u5F0F\u6570\u91CF\u4E0D\u7B49\uFF0C\u90E8\u5206\u8F83\u5C11\u89C1\u7684\u8054\u7CFB\u65B9\u5F0F\u53EF\u80FD\u4E0D\u4F1A\u663E\u793A\u3002</label>
499501
usite2Label=\u5E73\u53F0

src/main/webapp/admin/admin-preference.ftl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,13 @@
628628
<input id="enableAutoFlushGitHub" type="checkbox" class="normalInput"/>
629629
<span>&nbsp;${autoFlushGitHubLabel}</span>
630630
</label>
631+
<div class="fn__clear"></div>
632+
${myGitHubProfileLabel}
633+
<br>
634+
<label class="checkbox">
635+
<input id="enableAutoFlushGitHubProfile" type="checkbox" class="normalInput"/>
636+
<span>&nbsp;${autoFlushGitHubProfileLabel}</span>
637+
</label>
631638
<br>
632639
<label for="myGitHubID">${myGitHubIDLabel}</label>
633640
<input id="myGitHubID" type="text"/>

0 commit comments

Comments
 (0)