Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web UI: Use vsftpd webmin module #1396

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions easyinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,9 @@ function installSamba() {
# Installs and configures Webmin
function installWebmin() {
WEBMIN_PATH="/usr/share/webmin"
WEBMIN_MODULE_CONFIG="/etc/webmin/netatalk2/config"
WEBMIN_MODULE_VERSION="1.0"
WEBMIN_NETATALK_MODULE_CONFIG="/etc/webmin/netatalk2/config"
WEBMIN_NETATALK_MODULE_VERSION="1.0"
WEBMIN_VSFTPD_MODULE_VERSION="2023-12-10"

if [ -d "$WEBMIN_PATH" ]; then
echo
Expand All @@ -971,21 +972,26 @@ function installWebmin() {
rm setup-repos.sh
sudo apt-get install webmin --no-install-recommends --assume-yes </dev/null
echo
echo "Downloading and installing Webmin module..."
if [[ -f "$WEBMIN_MODULE_CONFIG" ]]; then
echo "$WEBMIN_MODULE_CONFIG already exists; will not modify..."
WEBMIN_MODULE_FLAG=1
echo "Downloading and installing Webmin modules..."
if [[ -f "$WEBMIN_NETATALK_MODULE_CONFIG" ]]; then
echo "$WEBMIN_NETATALK_MODULE_CONFIG already exists; will not modify..."
WEBMIN_MODULE_FLAG=1
fi

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

if [[ ! $WEBMIN_MODULE_FLAG ]]; then
echo "Modifying $WEBMIN_MODULE_CONFIG..."
sudo sed -i 's@/usr/sbin@/usr/local/sbin@' "$WEBMIN_MODULE_CONFIG"
echo "Modifying $WEBMIN_NETATALK_MODULE_CONFIG..."
sudo sed -i 's@/usr/sbin@/usr/local/sbin@' "$WEBMIN_NETATALK_MODULE_CONFIG"
fi
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
Expand Down Expand Up @@ -1465,7 +1471,8 @@ function runChoice() {
echo "This script will make the following changes to your system:"
echo "- Add a 3rd party apt repository"
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
echo "Install Webmin - Complete!"
echo "The Webmin webapp should now be listening to port 10000 on this system"
Expand Down Expand Up @@ -1537,7 +1544,7 @@ function showMenu() {
echo "EXPERIMENTAL FEATURES"
echo " 15) Share the images dir over AppleShare (requires Netatalk)"
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
Expand Down
9 changes: 8 additions & 1 deletion python/web/src/templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
{% if webmin_configured %}
<ul>
<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>
</ul>
{% endif %}
Expand All @@ -158,6 +158,13 @@
{{ _("FTP file sharing is disabled.") }}
{% endif %}
</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 %}
<li class="service-item enabled">
{{ _("Vintage web proxy is running at %(ip_addr)s (default port 5000)", ip_addr=env['ip_addr']) }}
Expand Down