Compare commits

...

7 Commits

Author SHA1 Message Date
v3d
b1cee0e643 Update generator 2022-05-11 00:09:46 +00:00
v3d
63b8649e9a Update gen.php 2022-05-10 23:59:45 +00:00
v3d
4371e3d2f9 Update generator 2022-05-10 23:33:30 +00:00
v3d
189e079171 Upload New File 2022-05-10 23:19:00 +00:00
v3d
d543273fff Update hotglue 2022-05-10 22:48:54 +00:00
v3d
ebaa1345fe Deleted etc/lighttpd/conf-available/05-auth.conf, etc/lighttpd/conf-available/10-accesslog.conf, etc/lighttpd/conf-available/10-cgi.conf, etc/lighttpd/conf-available/10-dir-listing.conf, etc/lighttpd/conf-available/10-evasive.conf, etc/lighttpd/conf-available/10-evhost.conf, etc/lighttpd/conf-available/10-expire.conf, etc/lighttpd/conf-available/10-fastcgi.conf, etc/lighttpd/conf-available/10-flv-streaming.conf, etc/lighttpd/conf-available/10-no-www.conf, etc/lighttpd/conf-available/10-proxy.conf, etc/lighttpd/conf-available/10-rrdtool.conf, etc/lighttpd/conf-available/10-simple-vhost.conf, etc/lighttpd/conf-available/10-ssi.conf, etc/lighttpd/conf-available/10-ssl.conf, etc/lighttpd/conf-available/10-status.conf, etc/lighttpd/conf-available/10-userdir.conf, etc/lighttpd/conf-available/10-usertrack.conf, etc/lighttpd/conf-available/11-extforward.conf, etc/lighttpd/conf-available/15-fastcgi-php.conf, etc/lighttpd/conf-available/90-debian-doc.conf, etc/lighttpd/conf-available/90-javascript-alias.conf, etc/lighttpd/conf-available/91-phpexecdenial.conf, etc/lighttpd/conf-available/README, etc/lighttpd/lighttpd.conf 2022-05-10 22:08:58 +00:00
v3d
e1f5d4bb09 new scripts and sort /etc 2022-05-11 00:07:17 +02:00
32 changed files with 84 additions and 292 deletions

View File

@ -1,25 +0,0 @@
# /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

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

View File

@ -1,15 +0,0 @@
# /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

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

View File

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

View File

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

View File

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

View File

@ -1,4 +0,0 @@
# /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

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

View File

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

View File

@ -1,25 +0,0 @@
# /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

@ -1,10 +0,0 @@
# /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

@ -1,11 +0,0 @@
# /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

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

View File

@ -1,9 +0,0 @@
# /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

@ -1,15 +0,0 @@
# /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

@ -1,13 +0,0 @@
## 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

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

View File

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

View File

@ -1,20 +0,0 @@
# -*- 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

@ -1,15 +0,0 @@
#### 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

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

View File

@ -1,14 +0,0 @@
# 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

@ -1,22 +0,0 @@
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

@ -1,38 +0,0 @@
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"

25
usr/local/bin/generator Executable file
View File

@ -0,0 +1,25 @@
#!/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,25 +1,31 @@
#!/bin/bash
FILE=/home/pi/pivilion/hotglue/hotglue-latest-dev.zip
if [ -f "$FILE" ]; then
echo "Hotglue already installed, restoring installation."
sudo zip /home/pi/pivilion/hotglue/gen.backup.zip /var/www/html/pivilion/gen
sudo rm -rf /var/www/html/gen/{,.[!.],..?}*
sudo cp -rT /home/pi/pivilion/hotglue /var/www/html/pivilion/gen
sudo chmod 777 /var/www/html/pivilion/gen/content
else
wget https://hotglue.org/download/hotglue-latest-dev.zip -P /home/pi/pivilion/hotglue/
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
sudo mv /home/pi/pivilion/hotglue/htaccess-dist /home/pi/pivilion/hotglue/.htaccess
sudo zip /home/pi/pivilion/hotglue/gen.backup.zip /var/www/html/pivilion/gen
sudo rm -rf /var/www/html/pivilion/gen/{,.[!.],..?}*
sudo cp -rT /home/pi/pivilion/hotglue /var/www/html/pivilion/gen
sudo chmod 777 /var/www/html/pivilion/gen/content
fi
echo "Would you like to install or restore Hotglue? Installing will overwrite any existing files in /var/www/html/pivilion/gen"
select sres in "Install" "Restore"; do
case $sres in
Install ) wget https://hotglue.org/download/hotglue-latest-dev.zip -P /home/pi/pivilion/hotglue/;
unzip /home/pi/pivilion/hotglue/hotglue-latest-dev.zip -d /home/pi/pivilion/hotglue/;
sudo mv /home/pi/pivilion/hotglue/k0a1a-*/* /home/pi/pivilion/hotglue/;
echo "Enter Hotglue admin user";
read user;
echo "Enter Hotglue admin password";
read password;
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 cp -rT /home/pi/pivilion/hotglue /var/www/html/pivilion/gen;
sudo chmod 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;;
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

View File

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

9
usr/local/bin/htaccess Executable file
View File

@ -0,0 +1,9 @@
#!/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

18
usr/local/bin/static Executable file
View File

@ -0,0 +1,18 @@
#!/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);
$output = ob_get_contents(); // get contents of trapped output
//write to file, e.g.
$newfile = "/var/www/html/pivilion/gen/index.html";
$newfile = "/var/www/html/pivilion/gen/index.php";
$file = fopen($newfile, "w");
fwrite($file, $output);
fclose($file);

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB