Commit ab279576 authored by Liang Ding's avatar Liang Ding

🔖 发布 v3.6.8

parent 731c869a
{
"name": "Solo",
"version": "3.6.7",
"version": "3.6.8",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "Solo",
"version": "3.6.7",
"version": "3.6.8",
"description": " 一款小而美的博客系统,专为程序员设计。",
"homepage": "https://github.com/88250/solo",
"repository": {
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Description: Solo POM.
Version: 3.18.3.76, Nov 22, 2019
Version: 3.18.3.77, Jan 3, 2020
Author: <a href="http://88250.b3log.org">Liang Ding</a>
Author: <a href="http://www.annpeter.cn">Ann Peter</a>
Author: <a href="http://vanessa.b3log.org">Vanessa</a>
......@@ -16,7 +16,7 @@
<artifactId>solo</artifactId>
<packaging>jar</packaging>
<name>Solo</name>
<version>3.6.7</version>
<version>3.6.8</version>
<description>
一款小而美的博客系统,专为程序员设计。
</description>
......
......@@ -46,7 +46,7 @@ import org.json.JSONObject;
* Server.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.0.0.5, Nov 18, 2019
* @version 2.0.0.6, Jan 3, 2020
* @since 1.2.0
*/
public final class Server extends BaseServer {
......@@ -59,7 +59,7 @@ public final class Server extends BaseServer {
/**
* Solo version.
*/
public static final String VERSION = "3.6.7";
public static final String VERSION = "3.6.8";
/**
* Main.
......
......@@ -18,6 +18,7 @@
package org.b3log.solo.processor;
import freemarker.template.Template;
import org.apache.commons.io.IOUtils;
import org.b3log.latke.Keys;
import org.b3log.latke.http.HttpMethod;
import org.b3log.latke.http.Request;
......@@ -26,6 +27,7 @@ import org.b3log.latke.http.Response;
import org.b3log.latke.http.annotation.RequestProcessing;
import org.b3log.latke.http.annotation.RequestProcessor;
import org.b3log.latke.http.renderer.AbstractFreeMarkerRenderer;
import org.b3log.latke.http.renderer.TextHtmlRenderer;
import org.b3log.latke.ioc.Inject;
import org.b3log.latke.logging.Level;
import org.b3log.latke.logging.Logger;
......@@ -35,9 +37,12 @@ import org.b3log.solo.model.Option;
import org.b3log.solo.service.DataModelService;
import org.b3log.solo.service.OptionQueryService;
import org.b3log.solo.service.StatisticMgmtService;
import org.b3log.solo.util.Markdowns;
import org.b3log.solo.util.Skins;
import org.json.JSONObject;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.Map;
/**
......@@ -48,7 +53,7 @@ import java.util.Map;
* </p>
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.10, Jan 5, 2019
* @version 1.0.0.12, Jan 3, 2020
* @since 0.4.5
*/
@RequestProcessor
......@@ -92,6 +97,21 @@ public class UserTemplateProcessor {
public void showPage(final RequestContext context) {
final String requestURI = context.requestURI();
final String templateName = context.pathVar("name") + ".ftl";
if ("/CHANGE_LOGS.html".equals(requestURI)) {
try {
final TextHtmlRenderer renderer = new TextHtmlRenderer();
context.setRenderer(renderer);
try (final InputStream resourceAsStream = UserTemplateProcessor.class.getResourceAsStream("/CHANGE_LOGS.md")) {
final String content = IOUtils.toString(resourceAsStream, StandardCharsets.UTF_8);
renderer.setContent(Markdowns.toHTML(content));
}
} catch (final Exception e) {
LOGGER.log(Level.ERROR, "Renders CHANGE_LOGS failed", e);
}
return;
}
LOGGER.log(Level.DEBUG, "Shows page [requestURI={0}, templateName={1}]", requestURI, templateName);
final Request request = context.getRequest();
......
......@@ -30,7 +30,7 @@ import org.json.JSONObject;
* Upgrade service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.1.13, Nov 11, 2019
* @version 1.2.1.14, Jan 3, 2020
* @since 1.2.0
*/
@Service
......@@ -93,6 +93,8 @@ public class UpgradeService {
V365_366.perform();
case "3.6.6":
V366_367.perform();
case "3.6.7":
V367_368.perform();
break;
default:
......@@ -100,8 +102,7 @@ public class UpgradeService {
System.exit(-1);
}
} catch (final Exception e) {
LOGGER.log(Level.ERROR, "Upgrade failed, please contact the Solo developers or reports this "
+ "issue: https://github.com/88250/solo/issues/new", e);
LOGGER.log(Level.ERROR, "Upgrade failed, please contact the Solo developers or reports this issue: https://github.com/88250/solo/issues/new", e);
System.exit(-1);
}
}
......
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.b3log.solo.upgrade;
import org.b3log.latke.Latkes;
import org.b3log.latke.ioc.BeanManager;
import org.b3log.latke.logging.Level;
import org.b3log.latke.logging.Logger;
import org.b3log.latke.repository.*;
import org.b3log.solo.model.Option;
import org.b3log.solo.repository.ArchiveDateArticleRepository;
import org.b3log.solo.repository.OptionRepository;
import org.json.JSONObject;
import java.util.List;
/**
* Upgrade script from v3.6.7 to v3.6.8.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, Jan 3, 2020
* @since 3.6.8
*/
public final class V367_368 {
/**
* Logger.
*/
private static final Logger LOGGER = Logger.getLogger(V367_368.class);
/**
* Performs upgrade from v3.6.7 to v3.6.8.
*
* @throws Exception upgrade fails
*/
public static void perform() throws Exception {
final String fromVer = "3.6.7";
final String toVer = "3.6.8";
LOGGER.log(Level.INFO, "Upgrading from version [" + fromVer + "] to version [" + toVer + "]....");
final BeanManager beanManager = BeanManager.getInstance();
final OptionRepository optionRepository = beanManager.getReference(OptionRepository.class);
try {
final Transaction transaction = optionRepository.beginTransaction();
final JSONObject versionOpt = optionRepository.get(Option.ID_C_VERSION);
versionOpt.put(Option.OPTION_VALUE, toVer);
optionRepository.update(Option.ID_C_VERSION, versionOpt);
transaction.commit();
LOGGER.log(Level.INFO, "Upgraded from version [" + fromVer + "] to version [" + toVer + "] successfully");
} catch (final Exception e) {
LOGGER.log(Level.ERROR, "Upgrade failed!", e);
throw new Exception("Upgrade failed from version [" + fromVer + "] to version [" + toVer + "]");
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment