From 1681bb6fc12391061e478c767af95a47b83874e4 Mon Sep 17 00:00:00 2001 From: lxsang Date: Wed, 17 Oct 2018 19:48:31 +0200 Subject: [PATCH] minor fixes --- apps/router.lua | 8 ++++++-- blog/router.lua | 8 ++++++-- get/router.lua | 8 ++++++-- info/controllers/IndexController.lua | 2 +- info/router.lua | 8 ++++++-- info/style.css | 3 ++- os/router.lua | 8 ++++++-- 7 files changed, 33 insertions(+), 12 deletions(-) diff --git a/apps/router.lua b/apps/router.lua index 83247d0..7c37863 100644 --- a/apps/router.lua +++ b/apps/router.lua @@ -4,8 +4,12 @@ -- ^\/apps\/+(.*)$ = /apps/router.lua?r=<1>& -- some global variables DIR_SEP = "/" -WWW_ROOT = "/opt/www/htdocs/apps" -HTTP_ROOT = "https://apps.lxsang.me" +WWW_ROOT = __ROOT__.."/apps" +if HEADER.host then + HTTP_ROOT= "https://"..HEADER.host +else + HTTP_ROOT = "https://apps.lxsang.me" +end -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class diff --git a/blog/router.lua b/blog/router.lua index 9e4bbd3..d013efa 100644 --- a/blog/router.lua +++ b/blog/router.lua @@ -4,8 +4,12 @@ -- ^\/apps\/+(.*)$ = /apps/router.lua?r=<1>& -- some global variables DIR_SEP = "/" -WWW_ROOT = "/opt/www/htdocs/blog" -HTTP_ROOT = "https://blog.lxsang.me" +WWW_ROOT = __ROOT__.."/blog" +if HEADER.host then + HTTP_ROOT= "https://"..HEADER.host +else + HTTP_ROOT = "https://blog.lxsang.me" +end -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class diff --git a/get/router.lua b/get/router.lua index b76591c..cfb8e9c 100644 --- a/get/router.lua +++ b/get/router.lua @@ -4,8 +4,12 @@ -- ^\/apps\/+(.*)$ = /apps/router.lua?r=<1>& -- some global variables DIR_SEP = "/" -WWW_ROOT = "/opt/www/htdocs/get" -HTTP_ROOT = "https://get.makeand.run" +WWW_ROOT = __ROOT__.."/get" +if HEADER.host then + HTTP_ROOT= "https://"..HEADER.host +else + HTTP_ROOT = "https://get.makeand.run" +end -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class diff --git a/info/controllers/IndexController.lua b/info/controllers/IndexController.lua index aa7fcca..b8abdcb 100644 --- a/info/controllers/IndexController.lua +++ b/info/controllers/IndexController.lua @@ -52,7 +52,7 @@ function IndexController:actionnotfound(...) end function IndexController:pdf(...) - local tmp_file = "/tmp/lxsang_cv.pdf" + local tmp_file = WWW_ROOT.."/lxsang_cv.pdf" local cmd = "wkhtmltopdf "..HTTP_ROOT.."/index/notoc "..tmp_file local r = os.execute(cmd) if r then diff --git a/info/router.lua b/info/router.lua index a6ce24e..7c648ce 100644 --- a/info/router.lua +++ b/info/router.lua @@ -4,8 +4,12 @@ -- ^\/apps\/+(.*)$ = /apps/router.lua?r=<1>& -- some global variables DIR_SEP = "/" -WWW_ROOT = "/opt/www/htdocs/info" -HTTP_ROOT = "https://info.lxsang.me" +WWW_ROOT = __ROOT__.."/info" +if HEADER.host then + HTTP_ROOT= "https://"..HEADER.host +else + HTTP_ROOT = "https://info.lxsang.me" +end -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class diff --git a/info/style.css b/info/style.css index a6c892f..9ca3fa9 100644 --- a/info/style.css +++ b/info/style.css @@ -151,4 +151,5 @@ hr{ border: 0; border-top: 1px solid #878887; padding: 0; -} \ No newline at end of file +} +img {max-width:100%} \ No newline at end of file diff --git a/os/router.lua b/os/router.lua index ac8105c..32a58b6 100644 --- a/os/router.lua +++ b/os/router.lua @@ -4,8 +4,12 @@ -- ^\/apps\/+(.*)$ = /apps/router.lua?r=<1>& -- some global variables DIR_SEP = "/" -WWW_ROOT = "/opt/www/htdocs/os" -HTTP_ROOT = "https://os.lxsang.me" +WWW_ROOT = __ROOT__.."/os" +if HEADER.host then + HTTP_ROOT= "https://"..HEADER.host +else + HTTP_ROOT = "https://os.lxsang.me" +end -- class path: path.to.class BASE_FRW = "" -- class path: path.to.class