Compare commits

..

No commits in common. "b1cee0e64309b3354523a17b6b538b59d30362a2" and "5cd7ccb055c0fe7e69ed4e8398159245d0537a37" have entirely different histories.

32 changed files with 292 additions and 84 deletions

View File

@ -0,0 +1,25 @@
# /usr/share/doc/lighttpd/authentication.txt.gz
server.modules += ( "mod_auth" )
# auth.backend = "plain"
# auth.backend.plain.userfile = "lighttpd.user"
# auth.backend.plain.groupfile = "lighttpd.group"
# auth.backend.ldap.hostname = "localhost"
# auth.backend.ldap.base-dn = "dc=my-domain,dc=com"
# auth.backend.ldap.filter = "(uid=$)"
# auth.require = ( "/server-status" =>
# (
# "method" => "digest",
# "realm" => "download archiv",
# "require" => "group=www|user=jan|host=192.168.2.10"
# ),
# "/server-info" =>
# (
# "method" => "digest",
# "realm" => "download archiv",
# "require" => "group=www|user=jan|host=192.168.2.10"
# )
# )

View File

@ -0,0 +1,3 @@
server.modules += ( "mod_accesslog" )
accesslog.filename = "/var/log/lighttpd/access.log"

View File

@ -0,0 +1,15 @@
# /usr/share/doc/lighttpd/cgi.txt
server.modules += ( "mod_cgi" )
$HTTP["url"] =~ "^/cgi-bin/" {
cgi.assign = ( "" => "" )
}
## Warning this represents a security risk, as it allow to execute any file
## with a .pl/.py even outside of /usr/lib/cgi-bin.
#
#cgi.assign = (
# ".pl" => "/usr/bin/perl",
# ".py" => "/usr/bin/python",
#)

View File

@ -0,0 +1,2 @@
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"

View File

@ -0,0 +1 @@
server.modules += ( "mod_evasive" )

View File

@ -0,0 +1,5 @@
# http://redmine.lighttpd.net/wiki/1/Docs:ModEVhost
server.modules += ( "mod_evhost" )
evhost.path-pattern = "/srv/%_/htdocs"

View File

@ -0,0 +1,3 @@
# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModExpire
server.modules += ( "mod_expire" )

View File

@ -0,0 +1,4 @@
# /usr/share/doc/lighttpd/fastcgi.txt.gz
# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi
server.modules += ( "mod_fastcgi" )

View File

@ -0,0 +1 @@
server.modules += ( "mod_flv_streaming" )

View File

@ -0,0 +1,3 @@
$HTTP["host"] =~ "^www\.(.*)" {
url.redirect = ( "^/(.*)" => "http://%1/$1" )
}

View File

@ -0,0 +1,25 @@
# /usr/share/doc/lighttpd/proxy.txt
server.modules += ( "mod_proxy" )
## Balance algorithm, possible values are: "hash", "round-robin" or "fair" (default)
# proxy.balance = "hash"
## Redirect all queries to files ending with ".php" to 192.168.0.101:80
#proxy.server = ( ".php" =>
# (
# ( "host" => "192.168.0.101",
# "port" => 80
# )
# )
# )
## Redirect all connections on www.example.com to 10.0.0.1{0,1,2,3}
#$HTTP["host"] == "www.example.com" {
# proxy.balance = "hash"
# proxy.server = ( "" => ( ( "host" => "10.0.0.10" ),
# ( "host" => "10.0.0.11" ),
# ( "host" => "10.0.0.12" ),
# ( "host" => "10.0.0.13" ) ) )
#}

View File

@ -0,0 +1,10 @@
# /usr/share/doc/lighttpd/rrdtool.txt
server.modules += ( "mod_rrdtool" )
## path to the rrdtool binary
rrdtool.binary = "/usr/bin/rrdtool"
## file to store the rrd database, will be created by lighttpd
rrdtool.db-name = "/var/www/lighttpd.rrd"

View File

@ -0,0 +1,11 @@
# /usr/share/doc/lighttpd/simple-vhost.txt
server.modules += ( "mod_simple_vhost" )
## The document root of a virtual host is document-root =
## simple-vhost.server-root + $HTTP["host"] + simple-vhost.document-root
simple-vhost.server-root = "/srv"
simple-vhost.document-root = "htdocs"
## the default host if no host is sent
simple-vhost.default-host = "www.example.com"

View File

@ -0,0 +1,5 @@
# /usr/share/doc/lighttpd/ssi.txt
server.modules += ( "mod_ssi" )
ssi.extension = ( ".shtml" )

View File

@ -0,0 +1,9 @@
# /usr/share/doc/lighttpd/ssl.txt
$SERVER["socket"] == "0.0.0.0:443" {
ssl.engine = "enable"
ssl.pemfile = "/etc/lighttpd/server.pem"
ssl.cipher-list = "ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!AESGCM"
ssl.honor-cipher-order = "enable"
}

View File

@ -0,0 +1,15 @@
# /usr/share/doc/lighttpd/status.txt
# http://trac.lighttpd.net/trac/wiki/Docs%3AModStatus
server.modules += ( "mod_status" )
# status.status-url = "/server-status"
# status.config-url = "/server-config"
## relative URL for a plain-text page containing the internal statistics
# status.statistics-url = "/server-statistics"
## add JavaScript which allows client-side sorting for the connection overview
## default: enable
# status.enable-sort = "disable"

View File

@ -0,0 +1,13 @@
## The userdir module provides a simple way to link user-based directories into
## the global namespace of the webserver.
##
# /usr/share/doc/lighttpd/userdir.txt
server.modules += ( "mod_userdir" )
## the subdirectory of a user's home dir which should be accessible
## under http://$host/~$user
userdir.path = "public_html"
## The users whose home directories should not be accessible
userdir.exclude-user = ( "root", "postmaster" )

View File

@ -0,0 +1 @@
server.modules += ( "mod_usertrack" )

View File

@ -0,0 +1,6 @@
# -*- depends: accesslog -*-
server.modules += ( "mod_extforward" )
# extforward.headers = ("X-Cluster-Client-Ip")
# extforward.forwarder = ("10.0.0.232" => "trust")

View File

@ -0,0 +1,20 @@
# -*- depends: fastcgi -*-
# /usr/share/doc/lighttpd/fastcgi.txt.gz
# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi
## Start an FastCGI server for php (needs the php5-cgi package)
fastcgi.server += ( ".php" =>
((
"bin-path" => "/usr/bin/php-cgi",
"socket" => "/var/run/lighttpd/php.socket",
"max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "4",
"PHP_FCGI_MAX_REQUESTS" => "10000"
),
"bin-copy-environment" => (
"PATH", "SHELL", "USER"
),
"broken-scriptfilename" => "enable"
))
)

View File

@ -0,0 +1,15 @@
#### handle Debian Policy Manual, Section 11.5. urls
## by default allow them only from localhost
$HTTP["remoteip"] =~ "^127\.0\.0\.1$|^::1$" {
alias.url += (
"/cgi-bin/" => "/usr/lib/cgi-bin/",
"/doc/" => "/usr/share/doc/",
"/images/" => "/usr/share/images/"
)
$HTTP["url"] =~ "^/doc/|^/images/" {
dir-listing.activate = "enable"
}
$HTTP["url"] =~ "^/cgi-bin/" {
cgi.assign = ( "" => "" )
}
}

View File

@ -0,0 +1 @@
alias.url += ("/javascript" => "/usr/share/javascript")

View File

@ -0,0 +1,14 @@
# disable php exec #
$HTTP["url"] =~ "^/ul/upload0911/uploads" {
fastcgi.server = ()
}
# disable php excec 2#
$HTTP["url"] =~ "^/ul/sfpg/images" {
fastcgi.server = ()
}
# disable url post
#$HTTP["request-method"] =~ "^(PUT|POST|HEAD|PATCH|DELETE)$" {
# url.access-deny = ("")
#}

View File

@ -0,0 +1,22 @@
ligghttpd Configuration under Debian GNU/Linux
==============================================
Files and Directories in /etc/lighttpd:
---------------------------------------
lighttpd.conf:
main configuration file
conf-available/
This directory contains a series of .conf files. These files contain
configuration directives necessary to load and run webserver modules.
If you want to create your own files they names should be
build as nn-name.conf where "nn" is two digit number (number
is used to find order for loading files)
conf-enabled/
To actually enable a module for lighttpd, it is necessary to create a
symlink in this directory to the .conf file in conf-available/.
Enabling and disabling modules could be done by provided
/usr/sbin/lighty-enable-mod and /usr/sbin/lighty-disable-mod scripts.

View File

@ -0,0 +1,38 @@
server.modules = (
"mod_access",
"mod_alias",
"mod_deflate",
"mod_redirect",
# "mod_rewrite",
)
server.document-root = "/var/www/html/pivilion/gen"
server.upload-dirs = ( "/tmp" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
deflate.cache-dir = "/var/cache/lighttpd/compress/"
deflate.mimetypes = ( "application/javascript", "text/css", "text/html", "text/plain" )
$SERVER["socket"] == ":81" {
server.document-root = "/var/www/html/pivilion/"
}
# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.conf.pl"
include "/etc/lighttpd/conf-enabled/*.conf"
#include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
#directory listing
#dir-listing.activate = "enable"
#dir-listing.hide-dotfiles = "enable"
#dir-listing.encoding = "utf-8"

View File

@ -1,25 +0,0 @@
#!/bin/bash
echo "Would you like to enable or disable the Static Generator Script?"
select stagen in "Enable" "Disable"; do
case $stagen in
Enable ) sudo a2ensite 000-upload.conf > /dev/null;
sudo systemctl reload apache2;
echo "Static Generator Script enabled, access it by adding :81 to your Rpi IP in your browser";
sudo rm -rf /var/www/html/piviliomn/gen/*
sudo chown -R pi:pi /home/pi
sudo chown -R www-data:www-data /var/www/;
sudo chmod -R 775 /var/www;
sudo mkdir /var/www/html/pivilion/gen/upload
sudo chmod -R 777 /var/www/html/pivilion/gen/upload
break;;
Disable ) sudo a2dissite 000-upload.conf > /dev/null;
sudo systemctl reload apache2;
echo "Static Generator Script disabled";
sudo chown -R pi:pi /home/pi
sudo chown -R www-data:www-data /var/www/;
sudo chmod -R 775 /var/www;
break;;
esac
done
exit 0

View File

@ -1,31 +1,25 @@
#!/bin/bash #!/bin/bash
echo "Would you like to install or restore Hotglue? Installing will overwrite any existing files in /var/www/html/pivilion/gen" FILE=/home/pi/pivilion/hotglue/hotglue-latest-dev.zip
select sres in "Install" "Restore"; do if [ -f "$FILE" ]; then
case $sres in echo "Hotglue already installed, restoring installation."
Install ) wget https://hotglue.org/download/hotglue-latest-dev.zip -P /home/pi/pivilion/hotglue/; sudo zip /home/pi/pivilion/hotglue/gen.backup.zip /var/www/html/pivilion/gen
unzip /home/pi/pivilion/hotglue/hotglue-latest-dev.zip -d /home/pi/pivilion/hotglue/; sudo rm -rf /var/www/html/gen/{,.[!.],..?}*
sudo mv /home/pi/pivilion/hotglue/k0a1a-*/* /home/pi/pivilion/hotglue/; sudo cp -rT /home/pi/pivilion/hotglue /var/www/html/pivilion/gen
echo "Enter Hotglue admin user"; sudo chmod 777 /var/www/html/pivilion/gen/content
read user; else
echo "Enter Hotglue admin password"; wget https://hotglue.org/download/hotglue-latest-dev.zip -P /home/pi/pivilion/hotglue/
read password; unzip /home/pi/pivilion/hotglue/hotglue-latest-dev.zip -d /home/pi/pivilion/hotglue/
sudo mv /home/pi/pivilion/hotglue/k0a1a-hotglue2-ff69c8d/{,.[!.],..?}* /home/pi/pivilion/hotglue/
echo "Enter admin user"
read user
echo "Enter password"
read password
echo -e "<?php\n@define('AUTH_USER', '$user');\n@define('AUTH_PASSWORD', '$password');" > /home/pi/pivilion/hotglue/user-config.inc.php echo -e "<?php\n@define('AUTH_USER', '$user');\n@define('AUTH_PASSWORD', '$password');" > /home/pi/pivilion/hotglue/user-config.inc.php
sudo rm -rf /var/www/html/pivilion/gen/{,.[!.],..?}*; sudo mv /home/pi/pivilion/hotglue/htaccess-dist /home/pi/pivilion/hotglue/.htaccess
sudo cp -rT /home/pi/pivilion/hotglue /var/www/html/pivilion/gen; sudo zip /home/pi/pivilion/hotglue/gen.backup.zip /var/www/html/pivilion/gen
sudo chmod 777 /var/www/html/pivilion/gen/content; sudo rm -rf /var/www/html/pivilion/gen/{,.[!.],..?}*
sudo chown -R pi:pi /home/pi; sudo cp -rT /home/pi/pivilion/hotglue /var/www/html/pivilion/gen
sudo chown -R www-data:www-data /var/www/; sudo chmod 777 /var/www/html/pivilion/gen/content
sudo chmod -R 775 /var/www; fi
break;;
Restore ) sudo rm -rf /var/www/html/pivilion/gen/{,.[!.],..?}*;
sudo cp -aR /home/pi/pivilion/hotglue/backup /var/www/html/pivilion/gen;
sudo mv /var/www/html/pivilion/gen/backup/* /var/www/html/pivilion/gen
sudo chmod -R 777 /var/www/html/pivilion/gen/content;
sudo chown -R pi:pi /home/pi;
sudo chown -R www-data:www-data /var/www/;
sudo chmod -R 775 /var/www;
break;;
esac
done
exit 0
exit 0

View File

@ -5,12 +5,11 @@ if [ $(dpkg-query -W -f='${Status}' apache2 2>/dev/null | grep -c "ok installed"
then then
sudo apt update sudo apt update
sudo apt -y install hostapd dnsmasq apache2 php sudo apt -y install hostapd dnsmasq apache2 php
sudo cp -rT /home/pi/pivilion/config/html /var/www/html/pivilion/gen
fi fi
echo "Configuring components..." echo "Configuring components..."
sudo cp -f /home/pi/pivilion/config/hostapd.hotspot /etc/hostapd/hostapd.conf sudo cp -f /home/pi/pivilion/config/hostapd.hotspot /etc/hostapd/hostapd.conf
sudo cp -f /home/pi/pivilion/config/dnsmasq.hotspot /etc/dnsmasq.conf sudo cp -f /home/pi/pivilion/config/dnsmasq.hotspot /etc/dnsmasq.conf
sudo cp /home/pi/pivilion/config/html/.htaccess /var/www/html/pivilion/gen/.htaccess sudo cp -rT /home/pi/pivilion/config/html /var/www/html/pivilion/gen
sudo chown -R www-data:www-data /var/www/html sudo chown -R www-data:www-data /var/www/html
sudo chown root:www-data /var/www/html/pivilion/gen/.htaccess sudo chown root:www-data /var/www/html/pivilion/gen/.htaccess
sudo cp -f /home/pi/pivilion/config/rc.hotspot /etc/rc.local sudo cp -f /home/pi/pivilion/config/rc.hotspot /etc/rc.local

View File

@ -1,9 +0,0 @@
#!/bin/bash
echo "Would you like to remove or reset htaccess redirection"
select hson in "Reset" "Remove"; do
case $hson in
Reset) sudo cp /home/pi/pivilion/config/html/.htaccess /var/www/html/pivilion/gen; break;;
Remove) sudo rm /var/www/html/pivilion/gen/.htaccess; break;;
esac
done

View File

@ -1,18 +0,0 @@
#!/bin/bash
sudo rm -rf /home/pi/pivilion/static/{,.[!.],..?}*
sudo cp -a -R /var/www/html/pivilion/gen /home/pi/pivilion/hotglue/backup
wget --mirror --convert-links --adjust-extension --page-requisites --restrict-file-names=ascii,windows http://127.0.0.1 -P /home/pi/pivilion/static
sudo rm -rf /var/www/html/pivilion/gen/{,.[!.],..?}*
sudo cp -rT /home/pi/pivilion/static/127.0.0.1 /var/www/html/pivilion/gen
sudo mv /var/www/html/pivilion/gen/index.html //var/www/html/pivilion/gen/index.php
sudo chown -R pi:pi /home/pi
sudo chown -R www-data:www-data /var/www/;
sudo chmod -R 775 /var/www;
echo "Are you using static HTML with hotspot or onion mode?"
select hson in "Hotspot" "Onion"; do
case $hson in
Hotspot ) sudo cp /home/pi/pivilion/config/html/.htaccess /var/www/html/pivilion/gen; break;;
Onion ) sudo rm /var/www/html/pivilion/gen/.htaccess; break;;
esac
done
exit 0

View File

@ -268,7 +268,7 @@ $torname = file_get_contents('/home/pi/pivilion/torname');
$tornamemode = preg_replace('/\s+/', '', $torname); $tornamemode = preg_replace('/\s+/', '', $torname);
$output = ob_get_contents(); // get contents of trapped output $output = ob_get_contents(); // get contents of trapped output
//write to file, e.g. //write to file, e.g.
$newfile = "/var/www/html/pivilion/gen/index.php"; $newfile = "/var/www/html/pivilion/gen/index.html";
$file = fopen($newfile, "w"); $file = fopen($newfile, "w");
fwrite($file, $output); fwrite($file, $output);
fclose($file); fclose($file);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB