mirror of
https://github.com/PirateBox-Dev/PirateBoxScripts_Webserver.git
synced 2023-12-14 07:22:58 +01:00
239b449770
We want to get away from droopy and python2. Droopy does not support IPv6, which we want to support for upload as well. This series implements the following: - Generation of piratebox_config.php with the config settings of piratebox.conf - Customization of php.ini during start of piratebox This is needed to save the receiving file already on the USB stick. We need to do this to save costy IO, the later move into the upload folder is only a filesystem rename and no physically move anymore. - We add options to allow overwriting of uploaded files. - First raw set of default template engine, which will be enhanced with later features (directory listing). - Adjusted OpenWrt reconfiguration (CHMOD setting).
107 lines
2.8 KiB
Plaintext
107 lines
2.8 KiB
Plaintext
## Configuration for Piratebox
|
|
|
|
server.stream-request-body = 2
|
|
|
|
server.modules = (
|
|
# "mod_access", not needed!
|
|
"mod_alias",
|
|
# "mod_compress", Disabled, fixing reload Problem??
|
|
"mod_redirect",
|
|
# "mod_rewrite",
|
|
"mod_setenv",
|
|
"mod_fastcgi"
|
|
)
|
|
|
|
var.basedir=env.PWD
|
|
var.CONFDIR=basedir + "/piratebox/piratebox/conf"
|
|
|
|
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 = 4000000
|
|
|
|
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 = "/index.html"
|
|
|
|
## for better debugging
|
|
#server.modules += ( "mod_accesslog" )
|
|
#accesslog.filename = "/tmp/access.log"
|
|
|
|
|
|
|
|
include basedir + "/piratebox/piratebox/conf/lighttpd/fastcgi-php.conf"
|
|
|
|
|
|
setenv.add-environment = (
|
|
"CONFDIR" => basedir + "/piratebox/piratebox/conf/" ,
|
|
"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"
|
|
)
|
|
include basedir + "/piratebox/piratebox/conf/lighttpd/php-upload.conf"
|