Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
16f3bb72
Unverified
Commit
16f3bb72
authored
Sep 22, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
Fix #12913
parent
d84cffd9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
6 deletions
+23
-6
src/main/java/org/b3log/solo/Starter.java
src/main/java/org/b3log/solo/Starter.java
+11
-1
src/main/java/org/b3log/solo/util/Markdowns.java
src/main/java/org/b3log/solo/util/Markdowns.java
+3
-3
src/main/java/org/b3log/solo/util/Solos.java
src/main/java/org/b3log/solo/util/Solos.java
+7
-1
src/main/resources/solo.properties
src/main/resources/solo.properties
+2
-1
No files found.
src/main/java/org/b3log/solo/Starter.java
View file @
16f3bb72
...
...
@@ -22,6 +22,7 @@ import org.b3log.latke.Latkes;
import
org.b3log.latke.logging.Level
;
import
org.b3log.latke.logging.Logger
;
import
org.b3log.latke.util.Strings
;
import
org.b3log.solo.util.Markdowns
;
import
org.eclipse.jetty.server.Server
;
import
org.eclipse.jetty.util.log.Log
;
import
org.eclipse.jetty.util.log.Slf4jLog
;
...
...
@@ -37,7 +38,7 @@ import java.io.File;
* </ul>
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.
0, Mar 29
, 2019
* @version 1.1.1.
1, Sep 22
, 2019
* @since 1.2.0
*/
public
final
class
Starter
{
...
...
@@ -92,9 +93,14 @@ public final class Starter {
hasArg
().
desc
(
"runtime mode (DEVELOPMENT/PRODUCTION), default is DEVELOPMENT"
).
build
();
options
.
addOption
(
runtimeModeOpt
);
final
Option
luteHttpOpt
=
Option
.
builder
(
"lute"
).
longOpt
(
"lute_http"
).
argName
(
"LUTE_HTTP"
).
hasArg
().
desc
(
"lute http URL, default is http://localhost:8249, see https://github.com/b3log/lute-http for more details"
).
build
();
options
.
addOption
(
luteHttpOpt
);
options
.
addOption
(
"h"
,
"help"
,
false
,
"print help for the command"
);
final
HelpFormatter
helpFormatter
=
new
HelpFormatter
();
helpFormatter
.
setWidth
(
120
);
final
CommandLineParser
commandLineParser
=
new
DefaultParser
();
CommandLine
commandLine
;
...
...
@@ -158,6 +164,10 @@ public final class Starter {
if
(
null
!=
runtimeMode
)
{
Latkes
.
setRuntimeMode
(
Latkes
.
RuntimeMode
.
valueOf
(
runtimeMode
));
}
String
luteHttp
=
commandLine
.
getOptionValue
(
"lute"
);
if
(
null
!=
luteHttp
)
{
Markdowns
.
LUTE_ENGINE_URL
=
luteHttp
;
}
String
webappDirLocation
=
"src/main/webapp/"
;
// POM structure in dev env
final
File
file
=
new
File
(
webappDirLocation
);
...
...
src/main/java/org/b3log/solo/util/Markdowns.java
View file @
16f3bb72
...
...
@@ -101,9 +101,9 @@ public final class Markdowns {
private
static
final
HtmlRenderer
RENDERER
=
HtmlRenderer
.
builder
(
OPTIONS
).
build
();
/**
* Lute engine serve path. https://github.com/b3log/lute
* Lute engine serve path. https://github.com/b3log/lute
-http
*/
p
rivate
static
final
String
LUTE_ENGINE_URL
=
"http://localhost:8249"
;
p
ublic
static
String
LUTE_ENGINE_URL
=
"http://localhost:8249"
;
/**
* Whether Lute is available.
...
...
@@ -273,7 +273,7 @@ public final class Markdowns {
final
URL
url
=
new
URL
(
LUTE_ENGINE_URL
);
final
HttpURLConnection
conn
=
(
HttpURLConnection
)
url
.
openConnection
();
conn
.
setConnectTimeout
(
1000
);
conn
.
setReadTimeout
(
7
000
);
conn
.
setReadTimeout
(
2
000
);
conn
.
setDoOutput
(
true
);
try
(
final
OutputStream
outputStream
=
conn
.
getOutputStream
())
{
...
...
src/main/java/org/b3log/solo/util/Solos.java
View file @
16f3bb72
...
...
@@ -53,7 +53,7 @@ import java.util.ResourceBundle;
* Solo utilities.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.9.0.
1, May 9
, 2019
* @version 1.9.0.
2, Sep 22
, 2019
* @since 2.8.0
*/
public
final
class
Solos
{
...
...
@@ -102,6 +102,12 @@ public final class Solos {
}
FAVICON_API
=
solo
.
getString
(
"faviconAPI"
);
try
{
Markdowns
.
LUTE_ENGINE_URL
=
solo
.
getString
(
"luteHttp"
)
}
catch
(
final
Exception
e
)
{
// ignored
}
}
static
{
...
...
src/main/resources/solo.properties
View file @
16f3bb72
...
...
@@ -18,8 +18,9 @@
#
# Description: Solo configurations.
# Version: 2.
5.0.1, Apr
2, 2019
# Version: 2.
6.0.0, Sep 2
2, 2019
# Author: Liang Ding
#
faviconAPI
=
https://api.byi.pw/favicon?url=
luteHttp
=
http://localhost:8249
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment