Install and use the vsftpd webmin module

This commit is contained in:
Daniel Markstedt 2023-12-11 09:29:37 +09:00 committed by Daniel Markstedt
parent 6d88932b85
commit 24e60faed6
2 changed files with 26 additions and 12 deletions

View File

@ -948,8 +948,9 @@ function installSamba() {
# Installs and configures Webmin # Installs and configures Webmin
function installWebmin() { function installWebmin() {
WEBMIN_PATH="/usr/share/webmin" WEBMIN_PATH="/usr/share/webmin"
WEBMIN_MODULE_CONFIG="/etc/webmin/netatalk2/config" WEBMIN_NETATALK_MODULE_CONFIG="/etc/webmin/netatalk2/config"
WEBMIN_MODULE_VERSION="1.0" WEBMIN_NETATALK_MODULE_VERSION="1.0"
WEBMIN_VSFTPD_MODULE_VERSION="2023-12-10"
if [ -d "$WEBMIN_PATH" ]; then if [ -d "$WEBMIN_PATH" ]; then
echo echo
@ -971,21 +972,26 @@ function installWebmin() {
rm setup-repos.sh rm setup-repos.sh
sudo apt-get install webmin --no-install-recommends --assume-yes </dev/null sudo apt-get install webmin --no-install-recommends --assume-yes </dev/null
echo echo
echo "Downloading and installing Webmin module..." echo "Downloading and installing Webmin modules..."
if [[ -f "$WEBMIN_MODULE_CONFIG" ]]; then if [[ -f "$WEBMIN_NETATALK_MODULE_CONFIG" ]]; then
echo "$WEBMIN_MODULE_CONFIG already exists; will not modify..." echo "$WEBMIN_NETATALK_MODULE_CONFIG already exists; will not modify..."
WEBMIN_MODULE_FLAG=1 WEBMIN_MODULE_FLAG=1
fi fi
rm netatalk2-wbm.tgz 2> /dev/null || true rm netatalk2-wbm.tgz 2> /dev/null || true
wget -O netatalk2-wbm.tgz "https://github.com/Netatalk/netatalk-webmin/releases/download/netatalk2-$WEBMIN_MODULE_VERSION/netatalk2-wbm-$WEBMIN_MODULE_VERSION.tgz" </dev/null wget -O netatalk2-wbm.tgz "https://github.com/Netatalk/netatalk-webmin/releases/download/netatalk2-$WEBMIN_NETATALK_MODULE_VERSION/netatalk2-wbm-$WEBMIN_NETATALK_MODULE_VERSION.tgz" </dev/null
sudo "$WEBMIN_PATH/install-module.pl" netatalk2-wbm.tgz sudo "$WEBMIN_PATH/install-module.pl" netatalk2-wbm.tgz
if [[ ! $WEBMIN_MODULE_FLAG ]]; then if [[ ! $WEBMIN_MODULE_FLAG ]]; then
echo "Modifying $WEBMIN_MODULE_CONFIG..." echo "Modifying $WEBMIN_NETATALK_MODULE_CONFIG..."
sudo sed -i 's@/usr/sbin@/usr/local/sbin@' "$WEBMIN_MODULE_CONFIG" sudo sed -i 's@/usr/sbin@/usr/local/sbin@' "$WEBMIN_NETATALK_MODULE_CONFIG"
fi fi
rm netatalk2-wbm.tgz || true rm netatalk2-wbm.tgz || true
rm vsftpd.wbm.gz 2> /dev/null || true
wget -O vsftpd.wbm.tgz "https://github.com/rdmark/vsftpd-webmin/releases/download/$WEBMIN_VSFTPD_MODULE_VERSION/vsftpd-$WEBMIN_VSFTPD_MODULE_VERSION.wbm.gz" </dev/null
sudo "$WEBMIN_PATH/install-module.pl" vsftpd.wbm.tgz
rm vsftpd.wbm.tgz || true
} }
# updates configuration files and installs packages needed for the OLED screen script # updates configuration files and installs packages needed for the OLED screen script
@ -1465,7 +1471,8 @@ function runChoice() {
echo "This script will make the following changes to your system:" echo "This script will make the following changes to your system:"
echo "- Add a 3rd party apt repository" echo "- Add a 3rd party apt repository"
echo "- Install and start the Webmin webapp" echo "- Install and start the Webmin webapp"
echo "- Install the netatalk2 Webmin module" echo "- Install the netatalk2 Webmin module"
echo "- Install the vsftpd Webmin module"
installWebmin installWebmin
echo "Install Webmin - Complete!" echo "Install Webmin - Complete!"
echo "The Webmin webapp should now be listening to port 10000 on this system" echo "The Webmin webapp should now be listening to port 10000 on this system"
@ -1537,7 +1544,7 @@ function showMenu() {
echo "EXPERIMENTAL FEATURES" echo "EXPERIMENTAL FEATURES"
echo " 15) Share the images dir over AppleShare (requires Netatalk)" echo " 15) Share the images dir over AppleShare (requires Netatalk)"
echo " 16) Compile PiSCSI binaries" echo " 16) Compile PiSCSI binaries"
echo " 17) Install Webmin to manage Netatalk and Samba" echo " 17) Install Webmin to manage the system and companion apps"
} }
# parse arguments passed to the script # parse arguments passed to the script

View File

@ -146,7 +146,7 @@
{% if webmin_configured %} {% if webmin_configured %}
<ul> <ul>
<li class="service-item extlink"> <li class="service-item extlink">
<a href="https://{{ env["ip_addr"] }}:10000/webmin/samba/" target=\"_blank\">{{ _("Manage the SMB server") }}</a> <a href="https://{{ env["ip_addr"] }}:10000/samba/" target=\"_blank\">{{ _("Manage the SMB server") }}</a>
</li> </li>
</ul> </ul>
{% endif %} {% endif %}
@ -158,6 +158,13 @@
{{ _("FTP file sharing is disabled.") }} {{ _("FTP file sharing is disabled.") }}
{% endif %} {% endif %}
</li> </li>
{% if webmin_configured %}
<ul>
<li class="service-item extlink">
<a href="https://{{ env["ip_addr"] }}:10000/vsftpd/" target=\"_blank\">{{ _("Manage the FTP server") }}</a>
</li>
</ul>
{% endif %}
{% if macproxy_configured %} {% if macproxy_configured %}
<li class="service-item enabled"> <li class="service-item enabled">
{{ _("Vintage web proxy is running at %(ip_addr)s (default port 5000)", ip_addr=env['ip_addr']) }} {{ _("Vintage web proxy is running at %(ip_addr)s (default port 5000)", ip_addr=env['ip_addr']) }}