Use the 21.11 release tarball for Macproxy; allow you to specify port number (#450)

* Tweak UI strings

* Pull a stable macproxy release tarball

* Add option to customize port
This commit is contained in:
Daniel Markstedt 2021-11-13 17:45:40 -08:00 committed by GitHub
parent 1446664310
commit 133eab068c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 7 deletions

View File

@ -594,13 +594,29 @@ function installNetatalk() {
} }
function installMacproxy { function installMacproxy {
MACPROXY_DIR="$HOME/macproxy" PORT=5000
echo "Macproxy is a Web Proxy for all vintage Web Browsers -- not only for Macs!"
echo ""
echo "By default, Macproxy listens to port $PORT, but you can choose any other available port."
echo -n "Enter a port number 1024 - 65535, or press Enter to use the default port: "
read -r CHOICE
if [ $CHOICE -ge "1024" ] && [ $CHOICE -le "65535" ]; then
PORT=$CHOICE
else
echo "Using the default port $PORT"
fi
MACPROXY_VER="21.11"
MACPROXY_DIR="$HOME/macproxy-$MACPROXY_VER"
if [ -d "$MACPROXY_DIR" ]; then if [ -d "$MACPROXY_DIR" ]; then
echo "The $MACPROXY_DIR directory already exists. Delete it to proceed with the installation." echo "The $MACPROXY_DIR directory already exists. Delete it to proceed with the installation."
exit 1 exit 1
fi fi
cd "$HOME" || exit 1 cd "$HOME" || exit 1
git clone https://github.com/rdmark/macproxy.git </dev/null wget -O "macproxy-$MACPROXY_VER.tar.gz" "https://github.com/rdmark/macproxy/archive/refs/tags/v$MACPROXY_VER.tar.gz" </dev/null
tar -xzvf "macproxy-$MACPROXY_VER.tar.gz"
cd "$MACPROXY_DIR" || exit 1 cd "$MACPROXY_DIR" || exit 1
sudo cp "$MACPROXY_DIR/macproxy.service" /etc/systemd/system/ sudo cp "$MACPROXY_DIR/macproxy.service" /etc/systemd/system/
sudo sed -i /^ExecStart=/d /etc/systemd/system/macproxy.service sudo sed -i /^ExecStart=/d /etc/systemd/system/macproxy.service
@ -610,8 +626,10 @@ function installMacproxy {
sudo systemctl start macproxy sudo systemctl start macproxy
sudo systemctl status macproxy sudo systemctl status macproxy
echo "The macproxy server is now running on port 5000." echo -n "Macproxy is now running on IP "
echo "Configure your browser to use the Pi's IP address and this port as http proxy." echo -n `ip -4 addr show scope global | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`
echo " port $PORT"
echo "Configure your browser to use the above as http (and https) proxy."
echo "" echo ""
} }
@ -724,7 +742,7 @@ function showMenu() {
echo " 7) configure network bridge for WiFi (static IP + NAT)" echo " 7) configure network bridge for WiFi (static IP + NAT)"
echo "INSTALL COMPANION APPS" echo "INSTALL COMPANION APPS"
echo " 8) install AppleShare File Server (Netatalk)" echo " 8) install AppleShare File Server (Netatalk)"
echo " 9) install Web Proxy Server (macproxy)" echo " 9) install Web Proxy Server (Macproxy)"
} }
# parse arguments # parse arguments

View File

@ -335,9 +335,9 @@
</tr> </tr>
</table> </table>
{% if macproxy_configured %} {% if macproxy_configured %}
<p><small>macproxy is running at {{ ip_addr }} port 5000</small></p> <p><small>Macproxy is running at {{ ip_addr }} port 5000</small></p>
{% else %} {% else %}
<p><small>Install <a href="https://github.com/akuker/RASCSI/wiki/Vintage-Web-Proxy#macproxy">macproxy</a> to browse the Web with your vintage browser.</small></p> <p><small>Install <a href="https://github.com/akuker/RASCSI/wiki/Vintage-Web-Proxy#macproxy">Macproxy</a> to browse the Web with any vintage browser. It's not just for Macs!</small></p>
{% endif %} {% endif %}
<hr/> <hr/>