tis-upsync-waptserver icon

tis-upsync-waptserver

Silent install package for tis-upsync-waptserver

0-0

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

package           : tis-upsync-waptserver
version           : 0-0
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      : 628eed4a-54f2-4a30-a59d-433da39cafd4
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10
max_os_version    : 
icon_sha256sum    : 
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-02-17T18:04:17.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         : X7RfG0XDW1ewgJnYych7oJ/BIT42LxIwlkNJzfR9tTQOXi9tzutdE5/jg5q2G6zZTYUqcWOkORV9v07dZOINnURznD+0rsFkAsxiKU++TNjKcmYxq5RVUZ1OeqsRsWHgEac3MqR11RaiOQcDHL+eI9+LVs62hveU033x9KWI7X7/J5oaCrpM2z9grvBFYLaovNycHiEN5jsmqsQLj1M33+ngV4ysySoAm53TZpupeE2HKNdxiIgoOgwjs6weu6qh/iWAbDptNC29HmW52Lpp8zReMBhqNWpWT8iggFiC2mfzOv1pxH/s9hxfow4f19HMP84J08q3dpKBlhwmmCTJTw==

# -*- 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')

    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
2aa6403fca23620d909d4bfbf4d16fdb01e0e4b87bbfae90ae19302bf4fc6044 : WAPT/control
74817ec1004c49994031bdcf8196cbcb667e03d4bdc8731c2db1f3d748eb4200 : luti.json
f2ac3afd4330555225f0174e592222496b0422b076a704966c54c01241d67f3f : setup.py
f3f411f77ae22357dc2c82d1e9c2b5458834aab523ea9522811412643f967b53 : upsync.service