Yash commited on
Commit
ce2e1eb
·
verified ·
1 Parent(s): cac4b0b

Update explore_fs.sh

Browse files
Files changed (1) hide show
  1. explore_fs.sh +46 -60
explore_fs.sh CHANGED
@@ -1,71 +1,57 @@
1
  #!/bin/bash
2
- set -eu
3
 
4
- echo "=== START: build-inspection ==="
5
- TS=$(date -Iseconds)
6
- echo "Timestamp: $TS"
7
- echo
8
-
9
- # helper
10
- sep(){ printf "\n===== %s =====\n\n" "$1"; }
11
 
12
- # scan a directory: existence, total size, file count, top 50 by size, sample file types
13
- scan_dir() {
14
- local dir="$1"
15
- sep "SCAN $dir"
16
- if [ -d "$dir" ]; then
17
- echo "Path exists: $dir"
18
- echo "Total disk usage (du -sh):"
19
- du -sh "$dir" 2>/dev/null || true
20
- echo
21
- echo "File count:"
22
- find "$dir" -type f 2>/dev/null | wc -l
23
  echo
24
- echo "Top 50 largest files under $dir (size, path):"
25
- find "$dir" -type f -printf "%s\t%p\n" 2>/dev/null | sort -rn | awk 'NR<=50{printf "%10.1fMB\t%s\n",$1/1024/1024,$2}'
26
- echo
27
- echo "Sample file types (up to 40 files):"
28
- find "$dir" -type f 2>/dev/null | head -n 40 | xargs -r file --brief --mime-type || true
 
 
29
  echo
30
- echo "List of files (flat) with sizes (limit 500):"
31
- find "$dir" -type f -printf "%p\t%k KB\n" 2>/dev/null | sort | head -n 500
32
- else
33
- echo "Directory not found: $dir"
34
- fi
35
- echo
36
- }
37
 
38
- # directories to inspect
39
- scan_dir "/app/build/static"
40
- scan_dir "/app/build/assets"
41
- scan_dir "/app/build/assets/images"
 
 
 
 
 
 
 
 
 
 
42
 
43
- # find all favicon files under /app (and more broadly)
44
- sep "FIND ALL FAVICON FILES (/app and root)"
45
- echo "Searching for files named favicon* (case-insensitive) under /app and /"
46
- find /app / -type f -iname "favicon*.png" -o -iname "favicon*.ico" -o -iname "favicon*.svg" 2>/dev/null | \
47
- while IFS= read -r f; do
48
- [ -z "$f" ] && continue
49
- printf "\nFILE: %s\n" "$f"
50
- ls -lh "$f" 2>/dev/null || true
51
- echo "mime/type: $(file --brief --mime-type "$f" 2>/dev/null || true)"
52
- echo "sha256:"
53
- sha256sum "$f" 2>/dev/null || md5sum "$f" 2>/dev/null || true
54
- done || true
55
 
56
- # also search for any file references to favicon inside build HTML/JS to find which path is used
57
- sep "SEARCH SOURCE FOR FAVICON REFERENCES IN /app/build"
58
- grep -R --line-number -i "favicon" /app/build 2>/dev/null | head -n 200 || echo "No references found in /app/build (or grep suppressed errors)."
59
 
60
- # quick summary of build root
61
- sep "SUMMARY /app/build (top-level)"
62
- if [ -d "/app/build" ]; then
63
- ls -alh /app/build
64
- echo
65
- echo "Total du of /app/build:"
66
- du -sh /app/build 2>/dev/null || true
67
  else
68
- echo "/app/build not found"
69
  fi
70
-
71
- sep "END: build-inspection"
 
1
  #!/bin/bash
 
2
 
3
+ echo "=== Checking / directory ==="
 
 
 
 
 
 
4
 
5
+ if [ -d "/" ]; then
6
+ ls -alh /
 
 
 
 
 
 
 
 
 
7
  echo
8
+ echo "=== Directory tree of / (up to 3 levels) ==="
9
+ if command -v tree >/dev/null 2>&1; then
10
+ tree -a -L 3 / 2>/dev/null
11
+ else
12
+ find / -maxdepth 3 -type d 2>/dev/null
13
+ fi
14
+
15
  echo
16
+ echo "=== Disk usage of / ==="
17
+ du -sh / 2>/dev/null
18
+ else
19
+ echo "/ not found"
20
+ fi
 
 
21
 
22
+ echo
23
+ echo "=== Checking /app/backend/open_webui/static ==="
24
+ if [ -d "/app/backend/open_webui/static" ]; then
25
+ ls -alh /app/backend/open_webui/static
26
+ if [ -f "/app/backend/open_webui/static/favicon.png" ]; then
27
+ echo
28
+ echo "=== favicon.png size ==="
29
+ du -h /app/backend/open_webui/static/favicon.png
30
+ else
31
+ echo "favicon.png not found in static folder"
32
+ fi
33
+ else
34
+ echo "/app/backend/open_webui/static directory not found"
35
+ fi
36
 
37
+ echo
38
+ echo "=== Inspecting /app/build directory ==="
39
+ if [ -d "/app/build" ]; then
40
+ echo
41
+ echo "Top-level contents of /app/build:"
42
+ ls -alh /app/build
 
 
 
 
 
 
43
 
44
+ echo
45
+ echo "Subdirectories (up to 3 levels):"
46
+ find /app/build -maxdepth 3 -type d 2>/dev/null
47
 
48
+ echo
49
+ echo "Frontend favicon and image files found:"
50
+ find /app/build -type f \( -iname "favicon*.png" -o -iname "*.ico" -o -iname "logo*.png" \) -exec ls -lh {} \; 2>/dev/null
51
+
52
+ echo
53
+ echo "HTML files that reference favicons:"
54
+ grep -Hn "favicon" /app/build/*.html 2>/dev/null || echo "No favicon references found in HTML files."
55
  else
56
+ echo "/app/build directory not found"
57
  fi