- ${SHARE_ROOT}:/storage
- public_data:/usr/local/apache2/htdocs
- httpd_users:/usr/local/apache2/auth
+ - ./lua:/usr/local/apache2/lua
environment:
- PUBLIC_ROOT_DIR=/storage
- PUBLIC_LINK_DIR=/usr/local/apache2/htdocs
+ - PUBLIC_FQDN_OVERRIDE=https://public.purplebirdman.com
ports:
- 80:80
volumes:
r.content_type = "text/plain"
if r.method == 'GET' then
+ -- get all local symlinks
local links = {}
dump_files(links, r, r.document_root)
+ -- 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.server_name .. ":" ..r.port
+
+ -- print each link
for filepath, info in pairs(links) do
r:puts( ("%s\n"):format(
- filepath:gsub(r.document_root, r.server_name .. ":" ..r.port)
+ filepath:gsub(r.document_root, fqdn)
))
end
else