tis-remote-repo-tftp

2.3.0.13438-1
Package for installing WaptTFTPServer for remote repositories agents
4834 downloads
Download
See build result See VirusTotal scan
tis-remote-repo-tftp icon
  • package : tis-remote-repo-tftp
  • name : Remote Repository TFTP
  • version : 2.3.0.13438-1
  • categories : System and network
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • editor :
  • licence :
  • locale : all
  • target_os : windows
  • impacted_process :
  • architecture : all
  • signature_date : 2023-01-31 14:00
  • size : 485.90 Ko
  • homepage : https://www.wapt.fr/en/doc/wapt-wads
package           : tis-remote-repo-tftp
version           : 2.3.0.13438-1
architecture      : all
section           : base
priority          : optional
name              : Remote Repository TFTP
categories        : System and network
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : Package for installing WaptTFTPServer for remote repositories agents
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.2
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : https://www.wapt.fr/en/doc/wapt-wads
package_uuid      : fb6166fb-0569-498f-8a29-467d900ab040
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : acf25a5bf4648fb69b647251505df68019472da42a27876e373b9979f0fe1801
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : q0kQ7X9LXA61Fuo8Ka9SCAtw8V+yDfnwkPs4O0rVFkhoiOjqHgQ6K5jMUW0DnskncxODKfxzYgSuF7KXag8Y5QVzUKZlvRpqA5R4LYD1MPlVs8W+npasePUcef2KY1EPLYrf77VVsIPMgoANqPI7G6uVBsqttu89+4TU8i6U3q98duI+4omDbUT1EFSod1oPLKnko72rrEKSwX+VxNVf5g5CNRWNIofxc1cKlW/qBFkvoYFIaL/d0s/uG5+ExQ/3zK34oR/FCuwKs/POr66yGTbw8FGHo7Bz7n7c4+O+fs1MFwhiMPijCX4F6Fm3msCK13IcQ2KEejD17P7PJm1AaQ==
signature_date    : 2023-01-31T14:00:08.673824
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
# -*- coding: utf-8 -*-
from setuphelpers import *

bin_name = "wapttftpserver.exe"
service_name = "WaptTFTPServer"


def install():
    tftp_bin = os.path.join(WAPT.wapt_base_dir, bin_name)
    if service_installed(service_name):
        uninstall()
    killalltasks(bin_name)
    filecopyto(bin_name, tftp_bin)

    print("Apply WaptTFTPServer config")
    repo_path = inifile_readstring(WAPT.config_filename, "repo-sync", "local_repo_path") or makepath(WAPT.wapt_base_dir, "repository")
    tftp_path = makepath(repo_path, "wads", "pxe")
    mkdirs(tftp_path)
    server_conf_dir = makepath(WAPT.wapt_base_dir, "conf")
    server_ini = makepath(server_conf_dir, "waptserver.ini")
    mkdirs(server_conf_dir)
    inifile_writestring(server_ini, "tftpserver", "service_name", service_name)
    inifile_writestring(server_ini, "tftpserver", "root_dir", tftp_path)

    print("Add WaptTFTPServer firewall rule")
    run(f'netsh advfirewall firewall add rule name="{service_name}" dir=in action=allow program="{tftp_bin}" enable=yes')

    print("Create WaptTFTPServer service")
    if not service_installed(service_name):
        # run(rf'"{tftp_bin}" /install --service_name={service_name} --root_dir="{tftp_path}"')
        print(run(rf'"{tftp_bin}" /install'))
    if not service_is_running(service_name):
        service_start(service_name)


def uninstall():
    tftp_bin = os.path.join(WAPT.wapt_base_dir, bin_name)
    server_conf_dir = makepath(WAPT.wapt_base_dir, "conf")

    print("Remove WaptTFTPServer service")
    if service_installed(service_name):
        if service_is_running(service_name):
            service_stop(service_name)
        print(run(rf'"{tftp_bin}" /uninstall'))

    print("Remove WaptTFTPServer firewall rule")
    run(f'netsh advfirewall firewall delete rule name="{service_name}" program="{tftp_bin}"')

    remove_file(tftp_bin)
    if len(glob.glob(server_conf_dir + os.sep + "*")) <= 1:
        remove_tree(server_conf_dir)
# -*- coding: utf-8 -*-
from setuphelpers import *


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    download_url = "https://wapt.tranquil.it/wapt/releases/latest/binaries/windows/wapttftpserver.exe"
    latest_bin = download_url.split("/")[-1]

    # Deleting binaries
    for f in glob.glob("*.exe") + glob.glob("*.msi"):
        print("Removing: %s" % f)
        remove_file(f)

    # Downloading latest binaries
    print("Download URL is: %s" % download_url)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)
    else:
        print("Binary is present: %s" % latest_bin)

    # Changing version of the package
    version = get_version_from_binary(latest_bin , "FileVersion")
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        package_updated = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.set_software_version(version)
    control.save_control_to_wapt()

    # Validating or not update-package-sources
    return package_updated
22015730a4a00abcbbb8d0c31b1c6fec67e9c79fe9d360e55d6cb31674fbbc3c : setup.py
045d194973774ca4aaa4e951b264bc83a986af30460aa4c2232048a2d0702ca7 : update_package.py
acf25a5bf4648fb69b647251505df68019472da42a27876e373b9979f0fe1801 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
fc81eb94b18328ecd5ce55599465781e55978e21b44105526fa82dbfdcb0a85a : luti.json
aa218c750de7b30eafd3aa0c859a2f8c08d03f4159a2b8ad6b77df90be34dc23 : wapttftpserver.exe
dbaf7c7f9e8d0ee7b06a8f5775224c52910d0d4c1bd9f978fdd306f1d2f6bfbd : WAPT/control