Bug fixes

Unwriteable upload directory missed when running sanity check;
Access to MDE resources when running under Tomcat.
This commit is contained in:
Simon Brooke 2020-02-20 14:48:52 +00:00
parent c19580a23e
commit 9ac1ba1bba
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987
3 changed files with 28 additions and 6 deletions

View file

@ -81,6 +81,8 @@
;; Text introducing the link to an uploaded file
:file-upload-prompt "File to upload" ;; prompt string for the file upload widget
:file-upload-title "Upload a file" ;; title for the file upload page
:fix-and-restart "After fixing these problems you must restart Smeagol"
;; used in sanity check report
:is-admin-prompt "Is administrator?"
:here "here" ;; used in sanity check report
:history-link "History" ;; text of the history link on the content frame

View file

@ -4,8 +4,8 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/simplemde/1.11.2/simplemde.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/simplemde/1.11.2/simplemde.min.css" rel="stylesheet" type="text/css" />
{% else %}
{% style "vendor/simplemde/dist/simplemde.min.css" %}
{% script "vendor/simplemde/dist/simplemde.min.js" %}
{% style "/vendor/simplemde/dist/simplemde.min.css" %}
{% script "/vendor/simplemde/dist/simplemde.min.js" %}
{% endifequal %}
{% endblock %}

View file

@ -120,7 +120,6 @@
configured content directory."
([path]
(compound-check-results
(check-with-protection check-exists :file-or-directory path :content-dir-exists)
(check-with-protection check-is-dir :file-or-directory path :content-dir-is-dir)
(check-can-read-and-write path :content-dir)
(apply compound-check-results
@ -133,6 +132,25 @@
(check-content-dir util/content-dir)))
(defn check-upload-dir
"Check that the upload directory at `path` (defaults to configured upload path)
exists and is readable and writable; check that each of the configured
thumbnail subdirectories also exists and is writable."
([path]
(compound-check-results
(check-with-protection check-is-dir :file-or-directory path :upload-dir-is-dir)
(check-can-read-and-write path :upload-dir)
(apply
compound-check-results
(map
#(let [p (cjio/file path (name %))]
(compound-check-results
(check-with-protection check-is-dir :file-or-directory p :thumbnails)
(check-with-protection check-can-read-and-write :file-or-directory p :thumbnails)))
(keys (:thumbnails config))))))
([] (check-upload-dir util/upload-dir)))
(defn check-password-member-field
"Check that this `member` map, expected to be an entry from the passwd
file whose key was `user-key`, has this `field` and if not return a
@ -221,13 +239,14 @@
(defn check-everything
([content-dir config-path passwd-path]
([content-dir upload-dir config-path passwd-path]
(compound-check-results
(check-content-dir content-dir)
(check-upload-dir upload-dir)
(check-config config-path)
(check-password-file passwd-path)))
([]
(check-everything util/content-dir config-file-path password-file-path)))
(check-everything util/content-dir util/upload-dir config-file-path password-file-path)))
(defn- get-causes
@ -367,7 +386,8 @@
[:a
{:href
"https://github.com/journeyman-cc/smeagol/wiki/Deploying-Smeagol"}
(as-hiccup :here messages)] "."])
(as-hiccup :here messages)] ". "
(as-hiccup :fix-and-restart messages) "."])
(defn as-hiccup-footer