tis-upsync-waptserver icon

tis-upsync-waptserver

Silent install package for tis-upsync-waptserver

2-10

  • package: tis-upsync-waptserver
  • version: 2-10
  • maintainer: sfonteneau
  • target_os: windows,debian
  • architecture: x64
  • signature_date:
  • size: 8.67 Ko
  • depends:

package           : tis-upsync-waptserver
version           : 2-10
architecture      : x64
section           : base
priority          : optional
name              : 
categories        : 
maintainer        : sfonteneau
description       : Package for tis-upsync-service
depends           : tis-upsync-metadata
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows,debian
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    : 1d
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : dc081593-cb45-486d-af09-f6ee5774b9e8
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10
max_os_version    : 
icon_sha256sum    : 84ea7df1dddebfac1a4fa0cd25703d6229d0c4728ea10a14f3fdea7976765c7f
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-02-18T00:18:54.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         : LIbGKugscRJX74Uo8zwuwcxPtnYsvWB4OglXfrIRd0rCoGbAOUU/SXGwwFkU9GuE8Toj/AGGe/bs0qnW7Zvuilsx70ZdSfaZuBJLj1KZIWP4mpsvm3Nq2D2/ItKGtAE1y3lUBYndoQMZ+JzSAXqBKj361Y8One/TWarcGADL9Poum/Cnr4Okzru8IlJgH0MjNYiud+FW/nbfYa9Nijc4gPI0lb+KBCpIG1kbBQAp9g8m0lvghii/1HxP4h8wF7H6Lv1eD8sSZgBzXz1g6keiuYEzr4mCn3qkGK6vT5na2q80bXylyYJ0oOnB/pn/h8za57bN5OURbG/CK+3kOQyZcw==

# -*- coding: utf-8 -*-
from setuphelpers import *
import platform


if platform.system() == 'Windows':
    binary = 'upsync.exe'
    bin_folder = makepath(programfiles(),'upsync')
    full_bin_path = makepath(bin_folder,binary)
else:
    bin_folder = '/opt/upsync'
    full_bin_path = makepath(bin_folder,'upsync')

store_path = makepath(bin_folder,'store')


def install():

    if not isdir(makepath( WAPT.wapt_base_dir,'waptserver')):
        if not params.get("install_with_luti", False):
            error('please install this package on waptserver')

    filecopyto("update-server-config.json",makepath(bin_folder,"update-server-config.json"))

    if platform.system() == 'Windows':
        nginxconf = makepath(install_location('WAPT Server_is1'),"waptserver""nginx","conf","nginx.conf")

        waptserver_ini = makepath(install_location('WAPT Server_is1'),"conf","waptserver.ini")
        config_service =  { 'Name': 'upsync',
                            'Description': 'upsync',
                            'Level': 10,
                            'StartWorkDir': bin_folder,
                            'Start': ['start:"%s" --metadata-store-path "%s"  --endpoint 127.0.0.1 --port 40080' % (full_bin_path,store_path)],
                            'StopRunAbortTimeoutSec': 0,
                            'RetryStableSec': 60,
                            'WatchDelaySec': 60,
                            'RedirectLogRotateFiles': 2,
                            'RedirectLogRotateBytes': 104857600,
                            'ConfigFilename': "%agl.base%conf\\waptserver.ini"}

        conf_service = makepath(install_location('WAPT Server_is1'),"waptserver","services","upsync.service")
        with open(conf_service,'w') as f:
            f.write(json.dumps(config_service))


    else:
        nginxconf = "/etc/nginx/sites-enabled/wapt.conf"
        filecopyto('upsync.service','/usr/lib/systemd/system/upsync.service')
        waptserver_ini = '/opt/wapt/conf/waptserver.ini'
        run("systemctl daemon-reload")
        run("systemctl enable upsync")
        systemd_restart_service('upsync')


    inifile_writestring(waptserver_ini,"options","wuserver","http://127.0.0.1:40080")

    data_nginx_migration = """
    location /upsync/ClientWebService {
      proxy_pass http://127.0.0.1:40080/ClientWebService;
    }

    location ^~ /.well-known/acme-challenge/ {"""


    with open(nginxconf,'r') as f:
         data = f.read()

    if not "/upsync/ClientWebService" in data:
        newdata = data.replace("location ^~ /.well-known/acme-challenge/ {",data_nginx_migration)

        with open(nginxconf,'w') as f:
             f.write(newdata)

    if platform.system() == 'Windows':
        run('net stop waptserver')
        run('net start waptserver')
    else:
        run('systemctl reload nginx')

def audit():

    data = run('"%s" pre-fetch --store-path "%s"' % (full_bin_path,makepath(basedir,'store')),timeout=86400)

    list_cassification = {
        #"5c9376ab-8ce6-464a-b136-22113dd69801": "Application",
        #"434de588-ed14-48f5-8eed-a15e09a991f6": "Connectors",
        "e6cf1350-c01b-414d-a61f-263d14d133b4": "CriticalUpdates",
        "e0789628-ce08-4437-be74-2495b842f43b": "DefinitionUpdates",
        #"e140075d-8433-45c3-ad87-e72345b36078": "DeveloperKits",
        "b54e7d24-7add-428f-8b75-90a396fa584f": "FeaturePacks",
        #"9511d615-35b2-47bb-927f-f73d8e9260bb": "Guidance",
        "0fa1201d-4330-4fa8-8ae9-b877473b6441": "SecurityUpdates",
        "68c5b0a3-d1a6-4553-ae49-01d3a7827828": "ServicePacks",
        "b4832bd8-e735-4761-8daf-37f882276dab": "Tools",
        "28bc880e-0592-4cbf-8f95-c79b17911d5f": "UpdateRollups",
        "cd5ffd1e-e932-4e3a-bf74-18bf0b1bbd83": "Updates"
    }

    for u in list_cassification:
        run('"%s" fetch --store-path "%s" --classification-filter %s' % (full_bin_path,makepath(basedir,'store'),u),timeout=86400)
    return "OK"

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
9d0027934559114f10a80fd7d9e051090296151777f9ceeb25496ba3304f89bf : WAPT/control
84ea7df1dddebfac1a4fa0cd25703d6229d0c4728ea10a14f3fdea7976765c7f : WAPT/icon.png
1a9f8c931dda5b74f2d0390d3bc5cc0ffd40732213be0c1517f0ffef4d9c07e1 : luti.json
831dbca7cb004f77fb58eb40a746017d70eeacdde3e8fd4c0ad0e3dace4870dc : setup.py
2afaaa61ce54f0a3e2487f4994656152a740fad3b24d7f41ad25c8ee9629d97b : update-server-config.json
f3f411f77ae22357dc2c82d1e9c2b5458834aab523ea9522811412643f967b53 : upsync.service