summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2a27191)
- Updated publish.lua to display meaningful message if links are not created
- If no links generated in publish.sh, return empty string instead of nonce
- Updated readme with more explicit httpd auth instructions
- image: cjpalmer/public:1.2.2
+ image: cjpalmer/public:1.2.3
volumes:
- ${SHARE_ROOT}:/storage
- public_data:/usr/local/apache2/htdocs
volumes:
- ${SHARE_ROOT}:/storage
- public_data:/usr/local/apache2/htdocs
if pattern then
local nonce = publish(r.context_document_root, pattern)
if pattern then
local nonce = publish(r.context_document_root, pattern)
-
- -- if FQDN override is set,
- -- use override instead of my own server name and port number
- local fqdn = os.getenv('PUBLIC_FQDN_OVERRIDE')
- fqdn = fqdn or (r.is_https and "https" or "http") .. "://" .. r.server_name .. ":" ..r.port
-
- local uri = ("%s/%s/"):format(fqdn, nonce)
- r:puts( ([[<a href="%s">%s</a>]]):format(uri, uri) )
+ if nonce == "" then
+ r:puts( "No links created" )
+ else
+ -- if FQDN override is set,
+ -- use override instead of my own server name and port number
+ local fqdn = os.getenv('PUBLIC_FQDN_OVERRIDE')
+ fqdn = fqdn or
+ (r.is_https and "https" or "http") ..
+ "://" .. r.server_name .. ":" ..r.port
+
+ local uri = ("%s/%s/"):format(fqdn, nonce)
+ r:puts( ([[<a href="%s">%s</a>]]):format(uri, uri) )
+ end
else
local template = get_form(r.context_document_root)
r:puts( template )
else
local template = get_form(r.context_document_root)
r:puts( template )
ln -s $fname $symlink_dir/$(echo $fname | sed 's|^.*/||')
done
ln -s $fname $symlink_dir/$(echo $fname | sed 's|^.*/||')
done
-# print nonce directory
-echo $nonce
+# if nonce directory has been created,
+# print nonce
+# else no links generated, print nothing
+if [[ -d "$symlink_dir" ]]
+then
+ echo -n "$nonce"
+else
+ echo -n ""
+fi
### reaching the services
### reaching the services
-Must authorize self through ```$hostname```/lua/publish.lua and set up valid users on first deployment
+Must authorize self through ```$hostname```/lua/publish.lua and set up valid users on first deployment. Right now you gotta ```docker exec -it``` the container to do that.
+
-htpasswd -c passwords $username
+htpasswd -c ${HTTPD_PREFIX}/auth/passwords $username
-
-## todo
-
-* clean up temporary public directories
- ```
- 0 * * * * find /var/www/html/public/* -depth -mtime +7 -delete
- ```