You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ha...@apache.org on 2018/06/20 13:12:46 UTC

[incubator-skywalking] branch webapp/login updated (b40267c -> 98ad7f9)

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a change to branch webapp/login
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git.


    from b40267c  Add login filter
     new bf58b56  Modify startup script and add webapp.yml config file
     new 98ad7f9  Update quick-start document for default login username/password

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 apm-dist/bin/webappService.bat                        |  2 +-
 apm-dist/bin/webappService.sh                         |  3 +--
 apm-dist/src/main/assembly/binary.xml                 |  5 +++++
 .../src/main/assembly/webapp.yml                      | 19 +++++++++++--------
 .../skywalking/apm/webapp/security/ReaderAccount.java |  4 ++--
 apm-webapp/src/main/resources/application.yml         |  2 --
 .../skywalking/apm/webapp/security/LoginTest.java     |  4 ++--
 .../apm/webapp/security/ReaderAccountTest.java        |  2 +-
 docs/cn/Quick-start-CN.md                             |  3 ++-
 docs/en/Quick-start.md                                |  1 +
 10 files changed, 26 insertions(+), 19 deletions(-)
 copy apm-dist/bin/startup.sh => apm-webapp/src/main/assembly/webapp.yml (82%)


[incubator-skywalking] 01/02: Modify startup script and add webapp.yml config file

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch webapp/login
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git

commit bf58b56b144dcffb8aa62bed3c7b36450d4f3f57
Author: gaohongtao <ha...@gmail.com>
AuthorDate: Wed Jun 20 21:02:32 2018 +0800

    Modify startup script and add webapp.yml config file
---
 apm-dist/bin/webappService.bat                               |  2 +-
 apm-dist/bin/webappService.sh                                |  3 +--
 apm-dist/src/main/assembly/binary.xml                        |  5 +++++
 .../main/{resources/application.yml => assembly/webapp.yml}  | 12 ++----------
 .../apache/skywalking/apm/webapp/security/ReaderAccount.java |  4 ++--
 apm-webapp/src/main/resources/application.yml                |  2 --
 .../org/apache/skywalking/apm/webapp/security/LoginTest.java |  4 ++--
 .../skywalking/apm/webapp/security/ReaderAccountTest.java    |  2 +-
 8 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/apm-dist/bin/webappService.bat b/apm-dist/bin/webappService.bat
index 1627db4..049164a 100644
--- a/apm-dist/bin/webappService.bat
+++ b/apm-dist/bin/webappService.bat
@@ -37,5 +37,5 @@ if not defined JAVA_HOME (
  set _EXECJAVA=java
 )
 
-start "%WEBAPP_PROCESS_TITLE%" %_EXECJAVA%  -jar %JARPATH%/skywalking-webapp.jar --server.port=8080 --collector.ribbon.listOfServers=127.0.0.1:10800 --logging.file=%LOG_FILE_LOCATION% --collector.ribbon.ReadTimeout=10000
+start "%WEBAPP_PROCESS_TITLE%" %_EXECJAVA%  -jar %JARPATH%/skywalking-webapp.jar --spring.config.location=%JAR_PATH%/webapp.yml --logging.file=%LOG_FILE_LOCATION%
 endlocal
diff --git a/apm-dist/bin/webappService.sh b/apm-dist/bin/webappService.sh
index 194e8d9..df0040d 100644
--- a/apm-dist/bin/webappService.sh
+++ b/apm-dist/bin/webappService.sh
@@ -34,9 +34,8 @@ _RUNJAVA=${JAVA_HOME}/bin/java
 [ -z "$JAVA_HOME" ] && _RUNJAVA=java
 
 eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} -jar ${JAR_PATH}/skywalking-webapp.jar \
-         --server.port=8080 --collector.ribbon.listOfServers=127.0.0.1:10800 \
+         --spring.config.location=${JAR_PATH}/webapp.yml \
          --logging.file=${LOG_FILE_LOCATION} \
-         --collector.ribbon.ReadTimeout=10000 \
         2>${WEBAPP_LOG_DIR}/webapp-console.log 1> /dev/null &"
 
 if [ $? -eq 0 ]; then
diff --git a/apm-dist/src/main/assembly/binary.xml b/apm-dist/src/main/assembly/binary.xml
index afdb0c0..193e693 100644
--- a/apm-dist/src/main/assembly/binary.xml
+++ b/apm-dist/src/main/assembly/binary.xml
@@ -75,5 +75,10 @@
             <outputDirectory>/webapp</outputDirectory>
             <fileMode>0644</fileMode>
         </file>
+        <file>
+            <source>${project.basedir}/../apm-webapp/src/main/assembly/webapp.yml</source>
+            <outputDirectory>/webapp</outputDirectory>
+            <fileMode>0644</fileMode>
+        </file>
     </files>
 </assembly>
diff --git a/apm-webapp/src/main/resources/application.yml b/apm-webapp/src/main/assembly/webapp.yml
similarity index 79%
copy from apm-webapp/src/main/resources/application.yml
copy to apm-webapp/src/main/assembly/webapp.yml
index d63d17c..007f3f6 100644
--- a/apm-webapp/src/main/resources/application.yml
+++ b/apm-webapp/src/main/assembly/webapp.yml
@@ -16,22 +16,14 @@
 
 server:
   port: 8080
-zuul:
-  ignoredServices: '*'
-  routes:
-    api:
-      path: /api/**
-      serviceId: collector
 
 collector:
   path: /graphql
   ribbon:
+    ReadTimeout: 10000
     listOfServers: 127.0.0.1:10800
-    NIWSServerListClassName: org.apache.skywalking.apm.webapp.tools.CollectorServerList
 
 security:
   user:
     admin:
-      password: admin
-    guest:
-      password:
+      password: 111
diff --git a/apm-webapp/src/main/java/org/apache/skywalking/apm/webapp/security/ReaderAccount.java b/apm-webapp/src/main/java/org/apache/skywalking/apm/webapp/security/ReaderAccount.java
index 8cd27c5..b72ca6c 100644
--- a/apm-webapp/src/main/java/org/apache/skywalking/apm/webapp/security/ReaderAccount.java
+++ b/apm-webapp/src/main/java/org/apache/skywalking/apm/webapp/security/ReaderAccount.java
@@ -14,7 +14,7 @@ class ReaderAccount implements Account {
     private final static Gson GSON = new GsonBuilder().disableHtmlEscaping()
         .setLenient().create();
     
-    private String username;
+    private String userName;
     
     private String password;
     
@@ -23,7 +23,7 @@ class ReaderAccount implements Account {
     }
     
     public String userName() {
-        return username;
+        return userName;
     }
     
     public String password() {
diff --git a/apm-webapp/src/main/resources/application.yml b/apm-webapp/src/main/resources/application.yml
index d63d17c..69e5c96 100644
--- a/apm-webapp/src/main/resources/application.yml
+++ b/apm-webapp/src/main/resources/application.yml
@@ -33,5 +33,3 @@ security:
   user:
     admin:
       password: admin
-    guest:
-      password:
diff --git a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginTest.java b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginTest.java
index 3e2dd57..972230b 100644
--- a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginTest.java
+++ b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/LoginTest.java
@@ -44,7 +44,7 @@ public class LoginTest {
 
     @Test
     public void assertSuccessLogin() throws IOException {
-        when(request.getReader()).thenReturn(new BufferedReader(new StringReader("{\"username\": \"admin\", \"password\":\"admin\"}")));
+        when(request.getReader()).thenReturn(new BufferedReader(new StringReader("{\"userName\": \"admin\", \"password\":\"admin\"}")));
         loginFilter.run();
         assertHeaderAndStatusCode();
         verify(ctx).setResponseBody("{\"status\":\"ok\",\"currentAuthority\":\"admin\"}");
@@ -52,7 +52,7 @@ public class LoginTest {
     
     @Test
     public void assertFailLogin() throws IOException {
-        when(request.getReader()).thenReturn(new BufferedReader(new StringReader("{\"username\": \"admin\", \"password\":\"888888\"}")));
+        when(request.getReader()).thenReturn(new BufferedReader(new StringReader("{\"userName\": \"admin\", \"password\":\"888888\"}")));
         loginFilter.run();
         assertHeaderAndStatusCode();
         verify(ctx).setResponseBody("{\"status\":\"error\",\"currentAuthority\":\"guest\"}");
diff --git a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/ReaderAccountTest.java b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/ReaderAccountTest.java
index 962e68b..00b9e1b 100644
--- a/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/ReaderAccountTest.java
+++ b/apm-webapp/src/test/java/org/apache/skywalking/apm/webapp/security/ReaderAccountTest.java
@@ -11,7 +11,7 @@ public class ReaderAccountTest {
 
     @Test
     public void assertNewReaderAccount() {
-        Account account = ReaderAccount.newReaderAccount(new BufferedReader(new StringReader("{\"username\": \"admin\", \"password\":\"888888\"}")));
+        Account account = ReaderAccount.newReaderAccount(new BufferedReader(new StringReader("{\"userName\": \"admin\", \"password\":\"888888\"}")));
         assertThat(account.userName(), is("admin"));
         assertThat(account.password(), is("888888"));
     }


[incubator-skywalking] 02/02: Update quick-start document for default login username/password

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch webapp/login
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git

commit 98ad7f968cf5e16154872e19e7c9e8c75e8e1213
Author: gaohongtao <ha...@gmail.com>
AuthorDate: Wed Jun 20 21:11:59 2018 +0800

    Update quick-start document for default login username/password
---
 docs/cn/Quick-start-CN.md | 3 ++-
 docs/en/Quick-start.md    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/docs/cn/Quick-start-CN.md b/docs/cn/Quick-start-CN.md
index a718cfb..1813bec 100644
--- a/docs/cn/Quick-start-CN.md
+++ b/docs/cn/Quick-start-CN.md
@@ -4,4 +4,5 @@
    1. [单机模式](Deploy-backend-in-standalone-mode-CN.md)
    1. [集群模式](Deploy-backend-in-cluster-mode-CN.md)
 1. 部署 Java Agent,[doc](Deploy-skywalking-agent-CN.md)
-1. 重启并访问系统功能,查看UI即可。
\ No newline at end of file
+1. 重启并访问系统功能,查看UI即可。
+1. 登录页面的默认用户名/密码是`admin/admin`。
\ No newline at end of file
diff --git a/docs/en/Quick-start.md b/docs/en/Quick-start.md
index e259d36..f553453 100644
--- a/docs/en/Quick-start.md
+++ b/docs/en/Quick-start.md
@@ -6,6 +6,7 @@ Quick start is for end users to start up the SkyWalking quickly in local.
 1. Install Java Agent. [Doc](Deploy-skywalking-agent.md)
 1. Set your OS time(include time zone) correct.
 1. Reboot your applications, and open UI.
+1. Default username/password for the login page is `admin/admin`.
 
 If you want to deploy SkyWalking in server or cloud as a cluster, please following these two documents:
 1. [Install javaagent](Deploy-skywalking-agent.md)