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
65e954e1
Unverified
Commit
65e954e1
authored
Mar 01, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
Fix #12683
parent
73829b83
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
28 deletions
+41
-28
src/main/java/org/b3log/solo/SoloServletListener.java
src/main/java/org/b3log/solo/SoloServletListener.java
+6
-1
src/main/java/org/b3log/solo/Starter.java
src/main/java/org/b3log/solo/Starter.java
+32
-20
src/main/java/org/b3log/solo/service/InitService.java
src/main/java/org/b3log/solo/service/InitService.java
+1
-1
src/main/resources/latke.properties
src/main/resources/latke.properties
+2
-6
No files found.
src/main/java/org/b3log/solo/SoloServletListener.java
View file @
65e954e1
...
...
@@ -37,6 +37,8 @@ import org.b3log.latke.util.Strings;
import
org.b3log.solo.event.*
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Skin
;
import
org.b3log.solo.processor.InitCheckHandler
;
import
org.b3log.solo.processor.PermalinkHandler
;
import
org.b3log.solo.processor.console.*
;
import
org.b3log.solo.repository.OptionRepository
;
import
org.b3log.solo.service.*
;
...
...
@@ -77,6 +79,9 @@ public final class SoloServletListener extends AbstractServletListener {
public
void
contextInitialized
(
final
ServletContextEvent
servletContextEvent
)
{
Latkes
.
setScanPath
(
"org.b3log.solo"
);
super
.
contextInitialized
(
servletContextEvent
);
DispatcherServlet
.
HANDLERS
.
add
(
0
,
new
InitCheckHandler
());
DispatcherServlet
.
HANDLERS
.
add
(
1
,
new
PermalinkHandler
());
beanManager
=
BeanManager
.
getInstance
();
routeConsoleProcessors
();
Stopwatchs
.
start
(
"Context Initialized"
);
...
...
@@ -116,7 +121,7 @@ public final class SoloServletListener extends AbstractServletListener {
pluginManager
.
load
();
if
(
initService
.
isInited
())
{
LOGGER
.
info
(
"Solo is running
["
+
Latkes
.
getServePath
()
+
"]
"
);
LOGGER
.
info
(
"Solo is running"
);
}
Stopwatchs
.
end
();
...
...
src/main/java/org/b3log/solo/Starter.java
View file @
65e954e1
...
...
@@ -27,9 +27,7 @@ import org.eclipse.jetty.util.log.Log;
import
org.eclipse.jetty.util.log.Slf4jLog
;
import
org.eclipse.jetty.webapp.WebAppContext
;
import
java.awt.*
;
import
java.io.File
;
import
java.net.URI
;
/**
* Solo with embedded Jetty, <a href="https://github.com/b3log/solo/issues/12037">standalone mode</a>.
...
...
@@ -131,18 +129,32 @@ public final class Starter {
portArg
=
"8080"
;
}
Latkes
.
init
();
String
serverScheme
=
commandLine
.
getOptionValue
(
"server_scheme"
);
Latkes
.
setServerScheme
(
serverScheme
);
if
(
null
!=
serverScheme
)
{
Latkes
.
setLatkeProperty
(
"serveScheme"
,
serverScheme
);
}
String
serverHost
=
commandLine
.
getOptionValue
(
"server_host"
);
Latkes
.
setServerHost
(
serverHost
);
if
(
null
!=
serverHost
)
{
Latkes
.
setLatkeProperty
(
"serverHost"
,
serverHost
);
}
String
serverPort
=
commandLine
.
getOptionValue
(
"server_port"
);
Latkes
.
setServerPort
(
serverPort
);
if
(
null
!=
serverPort
)
{
Latkes
.
setLatkeProperty
(
"serverPort"
,
serverPort
);
}
String
staticServerScheme
=
commandLine
.
getOptionValue
(
"static_server_scheme"
);
Latkes
.
setStaticServerScheme
(
staticServerScheme
);
if
(
null
!=
staticServerScheme
)
{
Latkes
.
setLatkeProperty
(
"staticServerScheme"
,
staticServerScheme
);
}
String
staticServerHost
=
commandLine
.
getOptionValue
(
"static_server_host"
);
Latkes
.
setStaticServerHost
(
staticServerHost
);
if
(
null
!=
staticServerHost
)
{
Latkes
.
setLatkeProperty
(
"staticServerHost"
,
staticServerHost
);
}
String
staticServerPort
=
commandLine
.
getOptionValue
(
"static_server_port"
);
Latkes
.
setStaticServerPort
(
staticServerPort
);
if
(
null
!=
staticServerPort
)
{
Latkes
.
setLatkeProperty
(
"staticServerPort"
,
staticServerPort
);
}
String
runtimeMode
=
commandLine
.
getOptionValue
(
"runtime_mode"
);
if
(
null
!=
runtimeMode
)
{
Latkes
.
setRuntimeMode
(
Latkes
.
RuntimeMode
.
valueOf
(
runtimeMode
));
...
...
@@ -170,18 +182,18 @@ public final class Starter {
System
.
exit
(-
1
);
}
serverScheme
=
Latkes
.
getServerScheme
();
serverHost
=
Latkes
.
getServerHost
();
serverPort
=
Latkes
.
getServerPort
();
final
String
contextPath
=
Latkes
.
getContextPath
();
try
{
if
(!
commandLine
.
hasOption
(
"no"
))
{
Desktop
.
getDesktop
().
browse
(
new
URI
(
serverScheme
+
"://"
+
serverHost
+
":"
+
serverPort
+
contextPath
));
}
}
catch
(
final
Throwable
e
)
{
// Ignored
}
//
serverScheme = Latkes.getServerScheme();
//
serverHost = Latkes.getServerHost();
//
serverPort = Latkes.getServerPort();
//
final String contextPath = Latkes.getContextPath();
//
//
try {
//
if (!commandLine.hasOption("no")) {
//
Desktop.getDesktop().browse(new URI(serverScheme + "://" + serverHost + ":" + serverPort + contextPath));
//
}
//
} catch (final Throwable e) {
//
// Ignored
//
}
Runtime
.
getRuntime
().
addShutdownHook
(
new
Thread
(()
->
{
try
{
...
...
src/main/java/org/b3log/solo/service/InitService.java
View file @
65e954e1
...
...
@@ -162,7 +162,7 @@ public class InitService {
try
{
inited
=
!
optionRepository
.
getList
(
new
Query
()).
isEmpty
();
if
(!
inited
&&
!
printedInitMsg
)
{
LOGGER
.
log
(
Level
.
WARN
,
"Solo has not been initialized, please open your browser
and visit ["
+
Latkes
.
getServePath
()
+
"]
to init Solo"
);
LOGGER
.
log
(
Level
.
WARN
,
"Solo has not been initialized, please open your browser to init Solo"
);
printedInitMsg
=
true
;
}
...
...
src/main/resources/latke.properties
View file @
65e954e1
...
...
@@ -17,18 +17,14 @@
#
#
# Description: B3log Latke configurations.
Configures the section "Server" carefully.
# Version: 1.
5.3.10, Sep 22, 2018
# Description: B3log Latke configurations.
# Version: 1.
6.0.0, Mar 1, 2019
# Author: Liang Ding
#
#### Server ####
# Browser visit protocol
serverScheme
=
http
# Browser visit domain name
serverHost
=
localhost
# Browser visit port, 80 as usual, THIS IS NOT SERVER LISTEN PORT!
serverPort
=
8080
#### Cookie ####
cookieName
=
solo
...
...
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