Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768156
D1132.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D1132.diff
View Options
diff --git a/roles/shellserver/userland-software/files/html-directories.sh b/roles/shellserver/userland-software/files/html-directories.sh
new file mode 100755
--- /dev/null
+++ b/roles/shellserver/userland-software/files/html-directories.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# Generates HTML directories listing, similar to nginx autoindex output
+#
+# Usage: html-directories [directory]
+
+DIR=$1
+[ -z "$DIR" ] && DIR="."
+TITLE="Index of $DIR"
+
+echo "<html>"
+echo "<head><title>$TITLE</title></head>"
+echo '<body bgcolor="white">'
+echo "<h1>$TITLE</h1><hr>"
+echo '<pre><a href="../">../</a>'
+find $DIR -type d -depth 1 -exec echo "<a href=\"{}\">$(basename "{}")/</a>" \;
+echo "</pre><hr></body>"
+echo "</html>"
diff --git a/roles/shellserver/userland-software/web.sls b/roles/shellserver/userland-software/web.sls
--- a/roles/shellserver/userland-software/web.sls
+++ b/roles/shellserver/userland-software/web.sls
@@ -6,7 +6,7 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% from "map.jinja" import packages with context %}
+{% from "map.jinja" import dirs, packages with context %}
# -------------------------------------------------------------
# nginx
@@ -34,3 +34,8 @@
pkg.installed:
- pkgs:
- igal2
+
+{{ dirs.bin }}/html-directories:
+ file.managed:
+ - source: salt://roles/shellserver/userland-software/files/html-directories.sh
+ - mode: 755
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 06:52 (13 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259638
Default Alt Text
D1132.diff (1 KB)
Attached To
Mode
D1132: Deploy html-directories tool on devservers
Attached
Detach File
Event Timeline
Log In to Comment