Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56353146
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
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
index 0000000..87e8a64
--- /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
index e57afab..f27d8d4 100644
--- a/roles/shellserver/userland-software/web.sls
+++ b/roles/shellserver/userland-software/web.sls
@@ -1,36 +1,41 @@
# -------------------------------------------------------------
# Salt — Provision web software
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2016-06-12
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% from "map.jinja" import packages with context %}
+{% from "map.jinja" import dirs, packages with context %}
# -------------------------------------------------------------
# nginx
# -------------------------------------------------------------
nginx:
pkg.installed: []
service.running:
- require:
- pkg: nginx
# -------------------------------------------------------------
# SSL certificates
# -------------------------------------------------------------
letsencrypt:
pkg.installed:
- name: {{ packages.certbot }}
# -------------------------------------------------------------
# Web utilities
# -------------------------------------------------------------
web_utilities:
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/x-diff
Expires
Sat, Nov 7, 08:25 (22 h, 19 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4252073
Default Alt Text
(2 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment