lhttp=ucs.taboption('general',form.DynamicList,'listen_http',_('HTTP listeners (address:port)'),_('Bind to specific interface:port (by specifying interface address)'));
lhttps=ucs.taboption('general',form.DynamicList,'listen_https',_('HTTPS listener (address:port)'),_('Bind to specific interface:port (by specifying interface address)'));
return[null,'must listen on at least one address:port'];
}
returntrue;
};
lhttps.depends({cert,key});
varhttptoHttps=ucs.taboption('general',form.Flag,'redirect_https',_('Redirect all HTTP to HTTPS'));
httptoHttps.default=httptoHttps.enabled;
httptoHttps.rmempty=false;
varrfc1918Filter=ucs.taboption('general',form.Flag,'rfc1918_filter',_('Ignore private IPs on public interface'),_('Prevent access from private (RFC1918) IPs on an interface if it has an public IP address'));
cert_file=ucs.taboption('general',form.FileUpload,'cert',_('HTTPS Certificate (DER or PEM format)'),_('Files can only be uploaded and saved to the /etc/luci-uploads directory.'));
key_file=ucs.taboption('general',form.FileUpload,'key',_('HTTPS Private Key (DER or PEM format)'),_('Files can only be uploaded and saved to the /etc/luci-uploads directory.'));
varremoveOld=ucs.taboption('general',form.Button,'remove_old',_('Remove old certificate and key'),_('uHTTPd will generate a new self-signed certificate using the configuration shown below.'));
varremoveConf=ucs.taboption('general',form.Button,'remove_conf',_('Remove configuration for certificate and key'),_('This permanently deletes the cert, key, and configuration to use same.'));
varindexPage=ucs.taboption('server',form.DynamicList,'index_page',_('Index page(s)'),_('E.g specify with index.html and index.php when using PHP'));
indexPage.optional=true;
indexPage.placeholder='index.html';
varinterpreter=ucs.taboption('server',form.DynamicList,'interpreter',_('CGI filetype handler'),_("Interpreter to associate with file endings ('suffix=handler', e.g. '.php=/usr/bin/php-cgi')"));
interpreter.optional=true;
varnoSymlinks=ucs.taboption('server',form.Flag,'no_symlinks',_('Do not follow symlinks outside document root'));
noSymlinks.optional=true;
varnoDirlists=ucs.taboption('server',form.Flag,'no_dirlists',_('Do not generate directory listings.'));
noDirlists.default=noDirlists.disabled;
varalias=ucs.taboption('server',form.DynamicList,'alias',_('Aliases'),_('(/old/path=/new/path) or (just /old/path which becomes /cgi-prefix/old/path)'));
alias.optional=true;
varrealm=ucs.taboption('server',form.Value,'realm',_('Realm for Basic Auth'));
varhttpconfig=ucs.taboption('server',form.Value,'config',_('Config file (e.g. for credentials for Basic Auth)'),_('Will not use HTTP authentication if not present'));
httpconfig.optional=true;
varerrorPage=ucs.taboption('server',form.Value,'error_page',_('404 Error'),_("Virtual URL or CGI script to display on status '404 Not Found'. Must begin with '/'"));
errorPage.optional=true;
vardocRoot=ucs.taboption('advanced',form.Value,'home',_('Document root'),_('Base directory for files to be served'));
docRoot.default='/www';
docRoot.datatype='directory';
varcgiPrefix=ucs.taboption('advanced',form.Value,'cgi_prefix',_('Path prefix for CGI scripts'),_('CGI is disabled if not present.'));
cgiPrefix.optional=true;
varluaPrefix=ucs.taboption('advanced',form.Value,'lua_prefix',_('Virtual path prefix for Lua scripts'));
luaPrefix.placeholder='/lua';
luaPrefix.optional=true;
varluaHandler=ucs.taboption('advanced',form.Value,'lua_handler',_('Full real path to handler for Lua scripts'),_('Embedded Lua interpreter is disabled if not present.'));
luaHandler.optional=true;
varubusPrefix=ucs.taboption('advanced',form.Value,'ubus_prefix',_('Virtual path prefix for ubus via JSON-RPC integration'),_('ubus integration is disabled if not present'));
ubusPrefix.optional=true;
varubusSocket=ucs.taboption('advanced',form.Value,'ubus_socket',_('Override path for ubus socket'));