Remote Repository WAPTHttpServer
Paquet d’installation silencieuse pour Remote Repository WAPTHttpServer
2.6.1.17765-11
- package: tis-remote-repo-http
- name: Remote Repository WAPTHttpServer
- version: 2.6.1.17765-11
- maintainer: WAPT Team,Tranquil IT
- target_os: windows
- architecture: x86
- signature_date:
- size: 2.33 Mo
- conflicts :
package : tis-remote-repo-http
version : 2.6.1.17765-11
architecture : x86
section : base
priority : optional
name : Remote Repository WAPTHttpServer
categories :
maintainer : WAPT Team,Tranquil IT
description : Package for installing WAPTHttpServer for remote repositories agents
depends :
conflicts : tis-remote-repo-nginx
maturity : PROD
locale :
target_os : windows
min_wapt_version : 2.5.5
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 : 9da435aa-e252-43d1-9ad9-4b2d0902906d
valid_from :
valid_until :
forced_install_on :
changelog :
min_os_version :
max_os_version :
icon_sha256sum : 7891f1ca19ac8a9e41cb2963c0833bb3424a1dcc3f89e6ae484b1841a67063b2
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date : 2026-04-24T14:02:23.000000
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
signature : eYYfQwnKfExx2rOnkFXsKVnHzu2XGv2ZP+9JYN5CrKKn5BAFsxjptmdOVNEAu8ZPV0WFeCQvpkT/zMAN7gqsRvyMdWidR2ap8kN/ZFwt0kiH4WvEvF8cDlusYTwzMU07ukEqE9EfmnY8I6gIswUrmQyq4dSIWKdpmSAZvQ/mlcedWq6ikw3X+DpQNfKTv1qsDV65w9OHgMhcsfnUkod0yaxw1mjso+g2bDWg2KY70N8FCUSUwrzaZGG7KGl70q3sQsnILE85T2jRnHql/eNlxDnDbsU2vZzDBXoHpRo7K5HT0JhfWyJdkwUSrURzMCeXYki/DxxSyyrRLptyLNj7zA==
# -*- coding: utf-8 -*-
from setuphelpers import *
import time
from waptcrypto import SSLPrivateKey, SSLCertificate
import datetime
bin_name = "wapthttpserver.exe"
service_name = "WAPTHttpServer"
def install():
if params.get("install_with_luti", False):
WAPT.install("tis-remote-repo-conf")
global service_name
waptconf_file = makepath(WAPT.wapt_base_dir, "wapt-get.ini")
is_default_repo_conf_enabled = inifile_readstring(waptconf_file, 'default_repo-sync', 'enable_remote_repo')
is_repo_conf_enabled = inifile_readstring(waptconf_file, 'repo-sync', 'enable_remote_repo')
if is_default_repo_conf_enabled == "True" or is_repo_conf_enabled == "True":
if installed_softwares('WAPT Server_is1'):
error('Wapt server installed on this host. Aborting')
def make_wapthttpserver_config(local_repo):
#moving certificate if allready exists
nginx_ssl_dir = makepath(WAPT.wapt_base_dir, "waptservice", "nginx", "ssl")
wapthttpserver_ssl_dir = makepath(WAPT.wapt_base_dir, "wapthttpserver", "ssl")
mkdirs(wapthttpserver_ssl_dir)
#moving certificate if allready exists
if os.path.isfile(nginx_ssl_dir) and not os.path.isfile(makepath(wapthttpserver_ssl_dir, "key.pem")):
filecopyto(makepath(nginx_ssl_dir, "key.pem"), wapthttpserver_ssl_dir)
#moving certificate if allready exists
if os.path.isfile(nginx_ssl_dir) and not os.path.isfile(makepath(wapthttpserver_ssl_dir, "cert.pem")):
filecopyto(makepath(nginx_ssl_dir, "cert.pem"), wapthttpserver_ssl_dir)
key_fn = makepath(wapthttpserver_ssl_dir, "key.pem")
key = SSLPrivateKey(key_fn)
if not os.path.isfile(key_fn):
print("Create SSL RSA Key %s" % key_fn)
key.create()
key.save_as_pem()
cert_fn = makepath(wapthttpserver_ssl_dir, "cert.pem")
if os.path.isfile(cert_fn):
crt = SSLCertificate(cert_fn)
if crt.cn != get_fqdn():
os.rename(cert_fn, "%s-%s.old" % (cert_fn, "{:%Y%m%d-%Hh%Mm%Ss}".format(datetime.datetime.now())))
crt = key.build_sign_certificate(cn=get_fqdn(), dnsname=get_fqdn(), is_server_auth=True, is_client_auth=False, is_code_signing=False, is_ca=False, key_usages=['digital_signature'])
print("Create X509 cert %s" % cert_fn)
crt.save_as_pem(cert_fn)
else:
crt = key.build_sign_certificate(cn=get_fqdn(), dnsname=get_fqdn(), is_server_auth=True, is_client_auth=False, is_code_signing=False, is_ca=False, key_usages=['digital_signature'])
print("Create X509 cert %s" % cert_fn)
crt.save_as_pem(cert_fn)
#create config
waptconf_file = makepath(WAPT.wapt_base_dir, "wapt-get.ini")
if os.path.isfile(waptconf_file):
inifile_writestring(waptconf_file, 'wapthttpserver', 'root_dir', local_repo)
inifile_writestring(waptconf_file, 'wapthttpserver', 'http_port', '80')
inifile_writestring(waptconf_file, 'wapthttpserver', 'https_port', '443')
inifile_writestring(waptconf_file, 'wapthttpserver', 'cert_file', cert_fn)
inifile_writestring(waptconf_file, 'wapthttpserver', 'private_key_file', key_fn)
inifile_writestring(waptconf_file, 'wapthttpserver', 'enable_logging', '1')
inifile_writestring(waptconf_file, 'wapthttpserver', 'lib_folder_path', makepath(WAPT.wapt_base_dir, "wapthttpserver"))
oldnginxbin = os.path.join(WAPT.wapt_base_dir, "waptservice", "nginx",'nginx.exe')
if isfile(oldnginxbin):
killalltasks('nginx.exe')
remove_file(oldnginxbin)
oldnginxpath = os.path.join(WAPT.wapt_base_dir, "waptservice", "nginx")
if isdir(oldnginxpath):
remove_tree(oldnginxpath)
servicenginxfile = os.path.join(WAPT.wapt_base_dir, "waptservice", "services",'waptnginx.service')
if isfile(servicenginxfile):
remove_file(servicenginxfile)
print("Checking if ports 80 and 443 are available")
try:
sortie_cmd=run(cmd="wapt-get checkport 0.0.0.0:80", timeout=10, accept_returncodes=[1003, 1004])
except:
print("Port 80 is not available")
raise
try:
sortie_cmd=run(cmd="wapt-get checkport 0.0.0.0:443", timeout=10, accept_returncodes=[1003, 1004])
except:
print("Port 443 is not available")
raise
def install_wapthttpserver_service(local_repo):
print("Register wapthttpserver frontend")
# rights
for repo_path in ("wapt", "wapt-host", "waptwua"):
p = makepath(local_repo, repo_path)
mkdirs(p)
run(r'icacls "%s" /grant "*S-1-5-20":(OI)(CI)(M)' % (p))
run(r'icacls "%s" /grant "*S-1-5-20":(OI)(CI)(M)' % makepath(WAPT.wapt_base_dir, "log"))
run(r'"%s" /install' % makepath(WAPT.wapt_base_dir, bin_name))
make_wapthttpserver_config(local_repo)
print("installing %s" % control.asrequirement())
print("Install wapthttpserver to permit WAPTAgent to become a repository")
local_repo = inifile_readstring(WAPT.config_filename, "repo-sync", "local_repo_path") or makepath(WAPT.wapt_base_dir, "repository")
mkdirs(makepath(WAPT.wapt_base_dir, "wapthttpserver", "ssl"))
if service_installed(service_name):
if service_is_running(service_name):
service_stop(service_name)
time.sleep(30)
service_delete(service_name)
print("Remove firewall rule")
run_notfatal(
'netsh advfirewall firewall delete rule name="%s" program="%s"'
% (service_name, makepath(WAPT.wapt_base_dir, bin_name))
)
print("Copy binary file for wapthttpserver")
if isfile(makepath(WAPT.wapt_base_dir, bin_name)):
remove_file(makepath(WAPT.wapt_base_dir, bin_name))
filecopyto(bin_name, makepath(WAPT.wapt_base_dir,bin_name))
print("Copy dlls for wapthttpserver")
mkdirs(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls"))
if isfile(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libcrypto-3-x64.dll")):
remove_file(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libcrypto-3-x64.dll"))
filecopyto(makepath(WAPT.wapt_base_dir, "dlls", "libcrypto-3-x64.dll"), makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libcrypto-3-x64.dll"))
if isfile(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libssl-3-x64.dll")):
remove_file(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libssl-3-x64.dll"))
filecopyto(makepath(WAPT.wapt_base_dir, "dlls", "libssl-3-x64.dll"), makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libssl-3-x64.dll"))
print("Install wapthttpserver")
install_wapthttpserver_service(local_repo)
service_start(service_name)
print("Add firewall rule for wapthttpserver")
run(
'netsh advfirewall firewall add rule name="%s" dir=in profile=private,domain,public protocol=tcp localport=80,443 action=allow program="%s" enable=yes'
% (service_name, makepath(WAPT.wapt_base_dir, bin_name))
)
else:
error(r'[ERROR]This package needs configuration : section "default_repo-sync" or section "repo-sync", key "enable_remote_repo" must be "True". Please install package tis-remote-repo-conf or your own configuration package before installing this one.')
# def install_wapthttpserver_service(local_repo):
# print("Register wapthttpserver frontend")
# # rights
# for repo_path in ("wapt", "wapt-host", "waptwua"):
# p = makepath(local_repo, repo_path)
# mkdirs(p)
# run(r'icacls "%s" /grant "*S-1-5-20":(OI)(CI)(M)' % (p))
# run(r'icacls "%s" /grant "*S-1-5-20":(OI)(CI)(M)' % makepath(WAPT.wapt_base_dir, "log"))
# run(r'"%s" /install' % makepath(WAPT.wapt_base_dir, bin_name))
# make_wapthttpserver_config(local_repo)
# print("installing %s" % control.asrequirement())
# print("Install wapthttpserver to permit WAPTAgent to become a repository")
# local_repo = inifile_readstring(WAPT.config_filename, "repo-sync", "local_repo_path") or makepath(WAPT.wapt_base_dir, "repository")
# mkdirs(makepath(WAPT.wapt_base_dir, "wapthttpserver", "ssl"))
# if service_installed(service_name):
# if service_is_running(service_name):
# service_stop(service_name)
# time.sleep(30)
# service_delete(service_name)
# print("Remove firewall rule")
# run_notfatal(
# 'netsh advfirewall firewall delete rule name="%s" program="%s"'
# % (service_name, makepath(WAPT.wapt_base_dir, bin_name))
# )
# print("Copy binary file for wapthttpserver")
# if isfile(makepath(WAPT.wapt_base_dir, bin_name)):
# remove_file(makepath(WAPT.wapt_base_dir, bin_name))
# filecopyto(bin_name, makepath(WAPT.wapt_base_dir,bin_name))
# print("Copy dlls for wapthttpserver")
# mkdirs(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls"))
# if isfile(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libcrypto-3-x64.dll")):
# remove_file(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libcrypto-3-x64.dll"))
# filecopyto(makepath(WAPT.wapt_base_dir, "dlls", "libcrypto-3-x64.dll"), makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libcrypto-3-x64.dll"))
# if isfile(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libssl-3-x64.dll")):
# remove_file(makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libssl-3-x64.dll"))
# filecopyto(makepath(WAPT.wapt_base_dir, "dlls", "libssl-3-x64.dll"), makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls", "libssl-3-x64.dll"))
# print("Install wapthttpserver")
# install_wapthttpserver_service(local_repo)
# service_start(service_name)
# print("Add firewall rule for wapthttpserver")
# run(
# 'netsh advfirewall firewall add rule name="%s" dir=in profile=private,domain,public protocol=tcp localport=80,443 action=allow program="%s" enable=yes'
# % (service_name, makepath(WAPT.wapt_base_dir, bin_name))
# )
def audit():
"""
Vérifie que tous les composants nécessaires pour WAPTHttpServer sont présents
et correctement configurés.
"""
errors = []
# 1. Vérification du binaire principal
http_bin = makepath(WAPT.wapt_base_dir, bin_name)
if not isfile(http_bin):
errors.append(f"Binaire manquant: {http_bin}")
# 2. Vérification du répertoire wapthttpserver
wapthttpserver_dir = makepath(WAPT.wapt_base_dir, "wapthttpserver")
if not isdir(wapthttpserver_dir):
errors.append(f"Répertoire manquant: {wapthttpserver_dir}")
# 3. Vérification du répertoire SSL
wapthttpserver_ssl_dir = makepath(WAPT.wapt_base_dir, "wapthttpserver", "ssl")
if not isdir(wapthttpserver_ssl_dir):
errors.append(f"Répertoire SSL manquant: {wapthttpserver_ssl_dir}")
else:
# Vérification des certificats SSL
key_fn = makepath(wapthttpserver_ssl_dir, "key.pem")
if not isfile(key_fn):
errors.append(f"Clé privée SSL manquante: {key_fn}")
cert_fn = makepath(wapthttpserver_ssl_dir, "cert.pem")
if not isfile(cert_fn):
errors.append(f"Certificat SSL manquant: {cert_fn}")
# 4. Vérification du répertoire des DLLs
dlls_dir = makepath(WAPT.wapt_base_dir, "wapthttpserver", "dlls")
if not isdir(dlls_dir):
errors.append(f"Répertoire des DLLs manquant: {dlls_dir}")
else:
# Vérification des DLLs OpenSSL
libcrypto = makepath(dlls_dir, "libcrypto-3-x64.dll")
if not isfile(libcrypto):
errors.append(f"DLL manquante: {libcrypto}")
libssl = makepath(dlls_dir, "libssl-3-x64.dll")
if not isfile(libssl):
errors.append(f"DLL manquante: {libssl}")
# 5. Vérification de la configuration dans wapt-get.ini
waptconf_file = makepath(WAPT.wapt_base_dir, "wapt-get.ini")
if not isfile(waptconf_file):
errors.append(f"Fichier de configuration manquant: {waptconf_file}")
else:
# Vérification des paramètres de configuration
root_dir = inifile_readstring(waptconf_file, 'wapthttpserver', 'root_dir')
if not root_dir:
errors.append(f"Paramètre 'root_dir' manquant dans: {waptconf_file}")
elif not isdir(root_dir):
errors.append(f"Répertoire root_dir manquant: {root_dir}")
http_port = inifile_readstring(waptconf_file, 'wapthttpserver', 'http_port')
if not http_port:
errors.append(f"Paramètre 'http_port' manquant dans: {waptconf_file}")
https_port = inifile_readstring(waptconf_file, 'wapthttpserver', 'https_port')
if not https_port:
errors.append(f"Paramètre 'https_port' manquant dans: {waptconf_file}")
cert_file = inifile_readstring(waptconf_file, 'wapthttpserver', 'cert_file')
if not cert_file:
errors.append(f"Paramètre 'cert_file' manquant dans: {waptconf_file}")
private_key_file = inifile_readstring(waptconf_file, 'wapthttpserver', 'private_key_file')
if not private_key_file:
errors.append(f"Paramètre 'private_key_file' manquant dans: {waptconf_file}")
# 6. Vérification du répertoire local_repo et ses sous-répertoires
local_repo = inifile_readstring(WAPT.config_filename, "repo-sync", "local_repo_path") or makepath(WAPT.wapt_base_dir, "repository")
if not isdir(local_repo):
errors.append(f"Répertoire local_repo manquant: {local_repo}")
else:
# Vérification des sous-répertoires du repository
for repo_path in ("wapt", "wapt-host", "waptwua"):
repo_subdir = makepath(local_repo, repo_path)
if not isdir(repo_subdir):
errors.append(f"Sous-répertoire manquant: {repo_subdir}")
# 7. Vérification du service Windows
if not service_installed(service_name):
errors.append(f"Service Windows non installé: {service_name}")
elif not service_is_running(service_name):
errors.append(f"Service Windows non démarré: {service_name}")
# Retour du résultat
if errors:
error_msg = "Erreurs détectées:\n" + "\n".join(f" - {err}" for err in errors)
print(error_msg)
return "ERROR"
else:
return "OK"
def uninstall():
print("Remove wapthttpserver service")
if service_installed(service_name):
if service_is_running(service_name):
service_stop(service_name)
time.sleep(30)
service_delete(service_name)
print("Remove firewall rule")
run(
'netsh advfirewall firewall delete rule name="%s" program="%s"'
% (service_name, makepath(WAPT.wapt_base_dir, bin_name))
)
print("Remove wapthttpserver files")
killalltasks('wapthttpserver.exe')
remove_tree(makepath(WAPT.wapt_base_dir, "wapthttpserver"))
remove_file(makepath(WAPT.wapt_base_dir, bin_name))
# -*- coding: utf-8 -*-
from setuphelpers import *
import re
def update_package():
# Declaring local variables
package_updated = False
proxies = get_proxies()
if not proxies:
proxies = get_proxies_from_wapt_console()
#todo wait new release
wget('https://wapt.tranquil.it/wapt/releases/latest/bin/win32/wapthttpserver.exe','wapthttpserver.exe',proxies=proxies)
version = get_version_from_binary('wapthttpserver.exe',property_name='FileVersion')
control.set_software_version(version)
control.save_control_to_wapt()
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
77277a87ceb51104c16e614c137e7c359a6b3602a899def65598b571c3e1f8d7 : WAPT/control
7891f1ca19ac8a9e41cb2963c0833bb3424a1dcc3f89e6ae484b1841a67063b2 : WAPT/icon.png
c6f492ead763364bf59374f12935a3e8d9dd77ff7b56a9dd273c7c5d3bc4f489 : luti.json
442dac21e8802d4a272c099966a2678f0646318a0adb1398080c7e641792c855 : setup.py
e75bc23116ca3e9a056731ad1687f885d2e3d509be5026ac05b456b22c2f1011 : update_package.py
6c5c5bf3e0fb25c4aef79e5ae3c0dff40f536d934f080be34c69c715d887e391 : wapthttpserver.exe