1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
billz 2021-03-04 11:36:36 +00:00
commit 82779b286e
5 changed files with 44 additions and 11 deletions

View File

@ -19,6 +19,8 @@ When backers were asked which feature they'd most like to see added to RaspAP, t
✅ Multiple OpenVPN client configs ✅ Multiple OpenVPN client configs
✅ OpenVPN service logging ✅ OpenVPN service logging
✅ Night mode toggle
✅ Restrict network to static clients
⚙️ Traffic shaping (in progress) ⚙️ Traffic shaping (in progress)
Look for the list above to grow as we add more exclusive features. Look for the list above to grow as we add more exclusive features.
@ -29,6 +31,8 @@ Below is a list of funding targets. When a funding target is reached, the featur
#### $500 #### $500
✅ Multiple OpenVPN client configs ✅ Multiple OpenVPN client configs
✅ OpenVPN service logging ✅ OpenVPN service logging
✅ Night mode toggle
✅ Restrict network to static clients
⚙️ Traffic shaping (in progress) ⚙️ Traffic shaping (in progress)
### Frequently asked questions ### Frequently asked questions

View File

@ -2,8 +2,8 @@ server.modules += (
"mod_rewrite", "mod_rewrite",
) )
$HTTP["url"] =~ "^/(?!(dist|app|ajax|config)).*" { $HTTP["url"] =~ "^/REPLACE_ME/(?!(dist|app|ajax|config)).*" {
url.rewrite-once = ( url.rewrite-once = ( "^/REPLACE_ME/(.*?)(\?.+)?$"=>"/REPLACE_ME/index.php/$1?$2" )
"^/[^\?]*(\?.*)?" => "/index.php$1" server.error-handler-404 = "/REPLACE_ME/index.php"
)
} }

View File

@ -49,7 +49,7 @@ require_once 'includes/torproxy.php';
$config = getConfig(); $config = getConfig();
$output = $return = 0; $output = $return = 0;
$page = $_SERVER['REQUEST_URI']; $page = $_SERVER['PATH_INFO'];
$theme_url = getThemeOpt(); $theme_url = getThemeOpt();
$toggleState = getSidebarState(); $toggleState = getSidebarState();

View File

@ -208,14 +208,30 @@ function _install_lighttpd_configs() {
# Copy config files # Copy config files
echo "Copying 50-raspap-router.conf to /etc/lighttpd/conf-available" echo "Copying 50-raspap-router.conf to /etc/lighttpd/conf-available"
sudo cp "$webroot_dir/config/50-raspap-router.conf" "/etc/lighttpd/conf-available" || _install_status 1 "Unable to copy lighttpd config file."
CONFSRC="$webroot_dir/config/50-raspap-router.conf"
LTROOT=$(grep "server.document-root" /etc/lighttpd/lighttpd.conf | awk -F '=' '{print $2}' | tr -d " \"")
# compare values and get difference
HTROOT=${webroot_dir/$LTROOT}
# remove trailing slash if present
HTROOT=$(echo "$HTROOT" | sed -e 's/\/$//')
# substitute values
awk "{gsub(\"/REPLACE_ME\",\"$HTROOT\")}1" $CONFSRC > /tmp/50-raspap-router.conf
# copy into place
sudo cp /tmp/50-raspap-router.conf /etc/lighttpd/conf-available/ || _install_status 1 "Unable to copy lighttpd config file into place."
# link into conf-enabled # link into conf-enabled
echo "Creating link to /etc/lighttpd/conf-enabled"|| _install_status 1 "Unable to copy lighttpd config file." echo "Creating link to /etc/lighttpd/conf-enabled"
sudo ln -s "/etc/lighttpd/conf-available/50-raspap-router.conf" "/etc/lighttpd/conf-enabled/50-raspap-router.conf" || _install_status 1 "Unable to symlink lighttpd config file." sudo ln -s "/etc/lighttpd/conf-available/50-raspap-router.conf" "/etc/lighttpd/conf-enabled/50-raspap-router.conf" || _install_status 1 "Unable to symlink lighttpd config file (this is normal if the link already exists)."
sudo systemctl restart lighttpd.service || _install_status 1 "Unable to restart lighttpd" sudo systemctl restart lighttpd.service || _install_status 1 "Unable to restart lighttpd"
_install_status 0 _install_status 0
} }
# Prompt to install ad blocking # Prompt to install ad blocking
function _prompt_install_adblock() { function _prompt_install_adblock() {
_install_log "Configure ad blocking (Beta)" _install_log "Configure ad blocking (Beta)"

View File

@ -17,9 +17,10 @@
# -a, --adblock <flag> Used with -y, --yes, sets Adblock install option (0=no install) # -a, --adblock <flag> Used with -y, --yes, sets Adblock install option (0=no install)
# -r, --repo, --repository <name> Overrides the default GitHub repo (raspap/raspap-webgui) # -r, --repo, --repository <name> Overrides the default GitHub repo (raspap/raspap-webgui)
# -b, --branch <name> Overrides the default git branch (master) # -b, --branch <name> Overrides the default git branch (master)
# -h, --help Outputs usage notes and exits
# -u, --upgrade Upgrades an existing installation to the latest release version # -u, --upgrade Upgrades an existing installation to the latest release version
# -i, --insiders Installs from the Insiders Edition (raspap/raspap-insiders)
# -v, --version Outputs release info and exits # -v, --version Outputs release info and exits
# -h, --help Outputs usage notes and exits
# #
# Depending on options passed to the installer, ONE of the following # Depending on options passed to the installer, ONE of the following
# additional shell scripts will be downloaded and sourced: # additional shell scripts will be downloaded and sourced:
@ -81,6 +82,9 @@ function _parse_params() {
-u|--upgrade) -u|--upgrade)
upgrade=1 upgrade=1
;; ;;
-i|--insiders)
repo="raspap/raspap-insiders"
;;
-v|--version) -v|--version)
_version _version
;; ;;
@ -126,6 +130,7 @@ OPTIONS:
-r, --repo, --repository <name> Overrides the default GitHub repo (raspap/raspap-webgui) -r, --repo, --repository <name> Overrides the default GitHub repo (raspap/raspap-webgui)
-b, --branch <name> Overrides the default git branch (latest release) -b, --branch <name> Overrides the default git branch (latest release)
-u, --upgrade Upgrades an existing installation to the latest release version -u, --upgrade Upgrades an existing installation to the latest release version
-i, --insiders Installs from the Insiders Edition (raspap/raspap-insiders)
-v, --version Outputs release info and exits -v, --version Outputs release info and exits
-h, --help Outputs usage notes and exits -h, --help Outputs usage notes and exits
@ -139,13 +144,16 @@ Examples:
Invoke installer remotely, run non-interactively with option flags: Invoke installer remotely, run non-interactively with option flags:
curl -sL https://install.raspap.com | bash -s -- --yes --openvpn 1 --adblock 0 curl -sL https://install.raspap.com | bash -s -- --yes --openvpn 1 --adblock 0
Invoke remotely, uprgrade an existing install to the Insiders Edition:
curl -sL https://install.raspap.com | bash -s -- --upgrade --insiders
EOF EOF
exit exit
} }
function _version() { function _version() {
_get_release _get_release
echo -e "RaspAP v${RASPAP_LATEST} - Simple AP setup & WiFi management for Debian-based devices" echo -e "RaspAP v${RASPAP_LATEST} - Simple wireless AP setup & management for Debian-based devices"
exit exit
} }
@ -166,7 +174,12 @@ function _display_welcome() {
# Fetch latest release from GitHub API # Fetch latest release from GitHub API
function _get_release() { function _get_release() {
if [ "$repo" == "raspap/raspap-insiders" ]; then
readonly RASPAP_LATEST="Insiders"
branch="master"
else
readonly RASPAP_LATEST=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' ) readonly RASPAP_LATEST=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' )
fi
} }
# Outputs a RaspAP Install log line # Outputs a RaspAP Install log line