You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by zh...@apache.org on 2015/12/28 17:14:37 UTC

[1/2] storm git commit: [STORM-1407] fix authorize issue for daemon log link in UI

Repository: storm
Updated Branches:
  refs/heads/master e5de2558a -> 50c8f8360


[STORM-1407] fix authorize issue for daemon log link in UI


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/29c910ff
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/29c910ff
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/29c910ff

Branch: refs/heads/master
Commit: 29c910ff701c3b641a01a8a404ed1c4e9d207b31
Parents: a998c4e
Author: zhuol <zh...@yahoo-inc.com>
Authored: Mon Dec 21 15:36:25 2015 -0600
Committer: zhuol <zh...@yahoo-inc.com>
Committed: Mon Dec 21 15:36:25 2015 -0600

----------------------------------------------------------------------
 .../src/clj/backtype/storm/daemon/logviewer.clj | 78 +++++++++-----------
 1 file changed, 36 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/29c910ff/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
index 78adef6..b58e423 100644
--- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -439,49 +439,43 @@
       (unauthorized-user-html user))))
 
 (defn daemonlog-page [fname start length grep user root-dir]
-  (if (or (blank? (*STORM-CONF* UI-FILTER))
-        (authorized-log-user? user fname *STORM-CONF*))
-    (let [file (.getCanonicalFile (File. root-dir fname))
-          file-length (.length file)
-          path (.getCanonicalPath file)
-          zip-file? (.endsWith path ".gz")]
-      (if (and (= (.getCanonicalFile (File. root-dir))
-                 (.getParentFile file))
-            (.exists file))
-        (let [file-length (if zip-file? (Utils/zipFileSize (clojure.java.io/file path)) (.length (clojure.java.io/file path)))
-              length (if length
-                       (min 10485760 length)
-                       default-bytes-per-page)
-              log-files (into [] (filter #(.isFile %) (.listFiles (File. root-dir)))) ;all types of files included
-              files-str (for [file log-files]
-                          (.getName file))
-              reordered-files-str (conj (filter #(not= fname %) files-str) fname)
-              log-string (escape-html
-                           (if (is-txt-file fname)
-                             (if start
-                               (page-file path start length)
-                               (page-file path length))
-                             "This is a binary file and cannot display! You may download the full file."))
-              start (or start (- file-length length))]
-          (if grep
-            (html [:pre#logContent
-                   (if grep
-                     (->> (.split log-string "\n")
-                       (filter #(.contains % grep))
-                       (string/join "\n"))
-                     log-string)])
-            (let [pager-data (if (is-txt-file fname) (pager-links fname start length file-length) nil)]
-              (html (concat (log-file-selection-form reordered-files-str "daemonlog") ; list all daemon logs
-                      pager-data
-                      (daemon-download-link fname)
-                      [[:pre#logContent log-string]]
-                      pager-data)))))
-        (-> (resp/response "Page not found")
-          (resp/status 404))))
-    (if (nil? (get-log-user-group-whitelist fname))
+  (let [file (.getCanonicalFile (File. root-dir fname))
+        file-length (.length file)
+        path (.getCanonicalPath file)
+        zip-file? (.endsWith path ".gz")]
+    (if (and (= (.getCanonicalFile (File. root-dir))
+                (.getParentFile file))
+             (.exists file))
+      (let [file-length (if zip-file? (Utils/zipFileSize (clojure.java.io/file path)) (.length (clojure.java.io/file path)))
+            length (if length
+                     (min 10485760 length)
+                     default-bytes-per-page)
+            log-files (into [] (filter #(.isFile %) (.listFiles (File. root-dir)))) ;all types of files included
+            files-str (for [file log-files]
+                        (.getName file))
+            reordered-files-str (conj (filter #(not= fname %) files-str) fname)
+            log-string (escape-html
+                         (if (is-txt-file fname)
+                           (if start
+                             (page-file path start length)
+                             (page-file path length))
+                           "This is a binary file and cannot display! You may download the full file."))
+            start (or start (- file-length length))]
+        (if grep
+          (html [:pre#logContent
+                 (if grep
+                   (->> (.split log-string "\n")
+                        (filter #(.contains % grep))
+                        (string/join "\n"))
+                   log-string)])
+          (let [pager-data (if (is-txt-file fname) (pager-links fname start length file-length) nil)]
+            (html (concat (log-file-selection-form reordered-files-str "daemonlog") ; list all daemon logs
+                          pager-data
+                          (daemon-download-link fname)
+                          [[:pre#logContent log-string]]
+                          pager-data)))))
       (-> (resp/response "Page not found")
-        (resp/status 404))
-      (unauthorized-user-html user))))
+          (resp/status 404)))))
 
 (defn download-log-file [fname req resp user ^String root-dir]
   (let [file (.getCanonicalFile (File. root-dir fname))]


[2/2] storm git commit: Merge branch '1407' of https://github.com/zhuoliu/storm into Storm-1407-Merge

Posted by zh...@apache.org.
Merge branch '1407' of https://github.com/zhuoliu/storm into Storm-1407-Merge


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/50c8f836
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/50c8f836
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/50c8f836

Branch: refs/heads/master
Commit: 50c8f836079bb77e2c925e2ea54b05a5ddb85091
Parents: e5de255 29c910f
Author: zhuol <zh...@yahoo-inc.com>
Authored: Mon Dec 28 10:13:56 2015 -0600
Committer: zhuol <zh...@yahoo-inc.com>
Committed: Mon Dec 28 10:13:56 2015 -0600

----------------------------------------------------------------------
 .../src/clj/backtype/storm/daemon/logviewer.clj | 78 +++++++++-----------
 1 file changed, 36 insertions(+), 42 deletions(-)
----------------------------------------------------------------------