diff --git a/development/lighttpd_extra.conf b/development/lighttpd_extra.conf new file mode 100644 index 0000000..3a0741b --- /dev/null +++ b/development/lighttpd_extra.conf @@ -0,0 +1,99 @@ +## Configuration for Piratebox + +server.modules = ( +# "mod_access", not needed! + "mod_alias", +# "mod_compress", Disabled, fixing reload Problem?? + "mod_redirect", +# "mod_rewrite", + "mod_setenv", +) + +var.basedir=env.HOME + /tmp + +server.document-root = basedir + "/www" + + +## Locate the tmp storage into tmp. It is in most cases the ram +## Limit the uploads to 4MB to save - especially on small devices +## the device from dieing because OUT-OF-RAM exceptions +## in KB => 4MB +server.upload-dirs = ( "/tmp" ) +server.max-request-size = 4048 + +server.errorlog = "/tmp/error.log" +server.breakagelog = "/tmp/break.log" +server.pid-file = "/tmp/lighttpd.pid" + + +index-file.names = ( "index.php", "index.html", + "index.htm", "default.htm", + " index.lighttpd.html" ) + +url.access-deny = ( "~", ".inc" ) + +# added .cgi .py +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) + + +# Enable lighttpd on ipv6 +$SERVER["socket"] == "[::]:8001" { } +server.port = 8001 + +dir-listing.encoding = "utf-8" +server.dir-listing = "enable" + +# Grabs main css +dir-listing.external-css = "/css/page_style.css" + +# Header +# Enables header section +dir-listing.show-header = "enable" +dir-listing.encode-header = "disable" +# Hides HEADER.txt from listing +dir-listing.hide-header-file = "enable" + +# Footer +# Enables footer section +dir-listing.show-readme = "enable" +dir-listing.encode-readme = "disable" +# Hides README.txt from listing +dir-listing.hide-readme-file = "enable" +# Diables default footer text +dir-listing.set-footer = " " + +## custom MIME-Type support +include "piratebox/piratebox/conf/lighttpd/mime.types" + +#----------- cgi.conf -------------- +server.modules += ( "mod_cgi" ) + +$HTTP["url"] =~ "^/cgi-bin/" { + cgi.assign = ( ".py" => "/usr/bin/python2" ) +} + +$HTTP["url"] =~ "^/board/" { + cgi.assign = ( ".pl" => "/usr/bin/perl" , ) +} +#------------------------------------- + + + +# 404 Error Page with redirect +# +#server.error-handler-404 = "/redirect.html" + +## for better debugging +#server.modules += ( "mod_accesslog" ) +#accesslog.filename = "/tmp/access.log" + + + +include "piratebox/piratebox/conf/lighttpd/fastcgi.conf" + + +setenv.add-environment = ( + "SHOUTBOX_GEN_HTMLFILE" => basedir "/chat_content.html" , + "SHOUTBOX_CHATFILE" => basedir + "/cgi-bin/data.pso" , + "SHOUTBOX_CLIENT_TIMESTAMP" => "yes" +) diff --git a/development/lighttpd_inside.conf b/development/lighttpd_inside.conf new file mode 100644 index 0000000..2e0ce8f --- /dev/null +++ b/development/lighttpd_inside.conf @@ -0,0 +1,100 @@ +## Configuration for Piratebox + +server.modules = ( +# "mod_access", not needed! + "mod_alias", +# "mod_compress", Disabled, fixing reload Problem?? + "mod_redirect", +# "mod_rewrite", + "mod_setenv", +) + +var.basedir=env.PWD + +server.document-root = basedir + "/piratebox/piratebox/www" + + +## Locate the tmp storage into tmp. It is in most cases the ram +## Limit the uploads to 4MB to save - especially on small devices +## the device from dieing because OUT-OF-RAM exceptions +## in KB => 4MB +server.upload-dirs = ( "/tmp" ) +server.max-request-size = 4048 + +server.errorlog = "/tmp/error.log" +server.breakagelog = "/tmp/break.log" +server.pid-file = "/tmp/lighttpd.pid" + + +index-file.names = ( "index.php", "index.html", + "index.htm", "default.htm", + " index.lighttpd.html" ) + +url.access-deny = ( "~", ".inc" ) + +# added .cgi .py +static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" , ".cgi" , ".py" ) + + +# Enable lighttpd on ipv6 +$SERVER["socket"] == "[::]:8001" { } +server.port = 8001 + +dir-listing.encoding = "utf-8" +server.dir-listing = "enable" + +# Grabs main css +dir-listing.external-css = "/css/page_style.css" + +# Header +# Enables header section +dir-listing.show-header = "enable" +dir-listing.encode-header = "disable" +# Hides HEADER.txt from listing +dir-listing.hide-header-file = "enable" + +# Footer +# Enables footer section +dir-listing.show-readme = "enable" +dir-listing.encode-readme = "disable" +# Hides README.txt from listing +dir-listing.hide-readme-file = "enable" +# Diables default footer text +dir-listing.set-footer = " " + +## custom MIME-Type support +include basedir + "/piratebox/piratebox/conf/lighttpd/mime.types" + +#----------- cgi.conf -------------- +server.modules += ( "mod_cgi" ) + +$HTTP["url"] =~ "^/cgi-bin/" { + cgi.assign = ( ".py" => "/usr/bin/python2" ) +} + +$HTTP["url"] =~ "^/board/" { + cgi.assign = ( ".pl" => "/usr/bin/perl" , ) +} +#------------------------------------- + + + +# 404 Error Page with redirect +# +#server.error-handler-404 = "/redirect.html" + +## for better debugging +#server.modules += ( "mod_accesslog" ) +#accesslog.filename = "/tmp/access.log" + + + +include basedir + "/piratebox/piratebox/conf/lighttpd/fastcgi.conf" + + +setenv.add-environment = ( + "PYTHONPATH" => basedir + "/piratebox/piratebox/python_lib" , + "SHOUTBOX_GEN_HTMLFILE" => basedir + "/piratebox/piratebox/www/chat_content.html" , + "SHOUTBOX_CHATFILE" => basedir + "/piratebox/piratebox/www/cgi-bin/data.pso" , + "SHOUTBOX_CLIENT_TIMESTAMP" => "yes" +) diff --git a/piratebox/piratebox/www/cgi-bin/data.pso b/piratebox/piratebox/www/cgi-bin/data.pso index e69de29..7fe930e 100644 --- a/piratebox/piratebox/www/cgi-bin/data.pso +++ b/piratebox/piratebox/www/cgi-bin/data.pso @@ -0,0 +1,3 @@ +
09:52:54 Anonymous:ttttttttt
+
09:52:25 Anonymous:ttt
+
09:32:38 Anonymous:test
diff --git a/piratebox/piratebox/www/upload_handler/UploadHandler.php b/piratebox/piratebox/www/upload_handler/UploadHandler.php index d9713cc..885ea28 100755 --- a/piratebox/piratebox/www/upload_handler/UploadHandler.php +++ b/piratebox/piratebox/www/upload_handler/UploadHandler.php @@ -46,8 +46,8 @@ class UploadHandler // This is a failsafe function, if the web-UI runs in an // non-piratebox script environment. That should help // developing the website more easier. - $t_upload_dir = dirname($this->get_server_var('SCRIPT_FILENAME')).'/../Shared/', - if ( isset ( $this->get_server_var('UPLOAD_PATH') ) ) { + $t_upload_dir = dirname($this->get_server_var('SCRIPT_FILENAME')).'/../Shared/'; + if ( $this->get_server_var('UPLOAD_PATH') <> "" ) { $t_upload_dir = $this->get_server_var('UPLOAD_PATH') ; }