]> Untitled Git - public.git/commitdiff
Updated to 1.3.0 1.3.0
authorClifton Palmer <clifton.james.palmer@protonmail.com>
Tue, 6 Aug 2024 08:18:23 +0000 (03:18 -0500)
committerClifton Palmer <clifton.james.palmer@protonmail.com>
Tue, 6 Aug 2024 08:18:23 +0000 (03:18 -0500)
* Handle spaces in pattern names

docker-compose-prod.yml
docker-compose.yml
lua/publish.lua
lua/publish.sh

index 6ecf00114aa9f2c92c0c5640ef10eca64017d5f7..d3846c158b4b97aa6585411a2a6e88e178ac9e41 100644 (file)
@@ -9,7 +9,7 @@ networks:
         external: true
 services:
     web:
-        image: cjpalmer/public:1.2.3
+        image: cjpalmer/public:1.3.0
         volumes:
         - ${LOCAL_ROOT_DIR}:/storage
         - ${LOCAL_LINK_DIR}:/usr/local/apache2/htdocs
index ac2dc3d9a4f60ccda04a36b3d35ae25559253c6a..73108228b847421595a24761d820beeedd8c677d 100644 (file)
@@ -2,7 +2,7 @@ version: '3'
 services:
     web:
         build: .
-        image: cjpalmer/public:1.2.3
+        image: cjpalmer/public:1.3.0
         volumes:
         - ${LOCAL_ROOT_DIR}:/storage
         - public_data:/usr/local/apache2/htdocs
index c0a4ff79347da9cb1fe0a92999a0dd9c63a27a81..afe2fed871cf46c3ffc98e4b0efbd073d014e42c 100644 (file)
@@ -1,7 +1,7 @@
 require "apache2"
 
 function publish(dir, pattern)
-    local cmd = ("%s/publish.sh %s"):format(dir, pattern)
+    local cmd = ("%s/publish.sh '%s'"):format(dir, pattern)
     local handle = io.popen(cmd)
     local output = handle:read('*a')
     handle:close()
@@ -21,7 +21,7 @@ function handle(r)
     r.content_type = "text/html"
 
     local args = r:parseargs()
-    local pattern = args.pattern 
+    local pattern = string.gsub(args.pattern, '+', ' ')
 
     if pattern then
         local nonce = publish(r.context_document_root, pattern)
index 337112697f0533ad9c2b7996e935512b356a840e..9c2a3a19f8f22e5cb7fdfa906ed311addc2e73f3 100755 (executable)
@@ -15,7 +15,8 @@ symlink_dir=$PUBLIC_LINK_DIR/$nonce
 find $PUBLIC_ROOT_DIR -type f -name "*$1*" | while read fname
 do
     [[ -d $symlink_dir ]] || mkdir -p $symlink_dir
-    ln -s $fname $symlink_dir/$(echo $fname | sed 's|^.*/||')
+    new_fname=$symlink_dir/$(echo $fname | sed 's|^.*/||')
+    ln -s "$fname" "$new_fname"
 done
 
 # if nonce directory has been created,