Browse Source

Update to version 68.0.0

master
Daniel Berteaud 10 months ago
parent
commit
bbf9100a58
8 changed files with 84 additions and 73 deletions
  1. +14
    -8
      WAPT/control
  2. +8
    -24
      WAPT/wapt.psproj
  3. +2
    -7
      extensions.rdf.j2
  4. +14
    -0
      reset_addons.bat.j2
  5. +43
    -28
      setup.py
  6. BIN
      sogo-connector-60.0.0.xpi
  7. BIN
      sogo-connector-68.0.0-demo.xpi
  8. BIN
      sogo-integrator-60.0.0-sogo-demo.xpi

+ 14
- 8
WAPT/control View File

@@ -1,13 +1,15 @@
package : fws-thunderbird-sogo-addons
version : 60.0.0-6
version : 68.0.0-23
architecture : all
section : base
priority : optional
name :
categories :
maintainer : Daniel Berteaud <daniel@firewall-services.com>
description : SOGo addons for Thunderbird
depends : fws-thunderbird-config
depends : fws-thunderbird(>=68),fws-thunderbird-config,fws-7zip
conflicts :
maturity : PROD
maturity : RC
locale :
target_os : windows
min_os_version :
@@ -20,13 +22,17 @@ description_fr : Plugins SOGo pour le client Mozilla Thunderbird
description_pl :
description_de :
description_es :
audit_schedule : 2d
audit_schedule : 4w
editor : Inverse
keywords : caldav,carddav,sogo
licence :
homepage : https://sogo.nu
package_uuid :
package_uuid : d93ba764-d8c8-4354-a493-1edbaf64c740
valid_from :
valid_until :
forced_install_on :
signer : Daniel Berteaud
signer_fingerprint:
signature_date :
signed_attributes :
signer_fingerprint: 3c9415559e2dedbc4390e3faa2c28d3b67265baa5b35902d2764d9e41c3b3f0a
signature : JIdRCzu3kUMflqCOqjhubHMsEaTHj8Re+rHuu1C4MZTH3gpLdjh3zqvDWjkP1euLUIlfo1I/eh3LiwaBxYAKmbe5v0JL+lL+39tobK9UMRwDzb2ElX7W6G87lnmvuJBqWCCVge+A4e248T4t/4nFz2iAwSGIpT+DDVoxQFOdZ0duqJqKvRtmg5J21rf1mL4Vyf0uQiH3PEcw1n/Nunf0+i1YOCQvQItDO6I+wQEOIh4BnZBmAcD2l5orIaHwZlHEGEuChAUaj6T91rdIKUWH6uX6JN9KDGc14XNfHIr0qqL7jt2wrQVn5rfRhH2Cmc/TcWjGnPyKdx8Ni+Stj04yQA==
signature_date : 2019-12-12T18:39:31.100000
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,signer,signer_fingerprint,signature_date,signed_attributes

+ 8
- 24
WAPT/wapt.psproj View File

@@ -1,5 +1,5 @@
[PyScripter]
Version=3.3.2.0
Version=3.6.1.0
[Project]
ClassName=TProjectRootNode
@@ -23,11 +23,11 @@ FileName=C:\Program Files (x86)\wapt\setuphelpers.py
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2]
ClassName=TProjectFileNode
FileName=C:\Program Files (x86)\wapt\wapt-get.ini
FileName=C:\Program Files (x86)\wapt\wapt-get.py
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3]
ClassName=TProjectFileNode
FileName=C:\Program Files (x86)\wapt\wapt-get.py
FileName=C:\Program Files (x86)\wapt\wapt-get.ini
[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4]
ClassName=TProjectFileNode
@@ -46,10 +46,14 @@ FileName=$[Project-Path]control
[Project\ChildNodes\Node0\ChildNodes\Node3]
ClassName=TProjectFileNode
FileName=C:\waptdev\wapt-thunderbird-sogo-addons\reset_addons.bat.j2
[Project\ChildNodes\Node0\ChildNodes\Node4]
ClassName=TProjectFileNode
FileName=$[Project-Path]..\setup.py
[Project\ChildNodes\Node0\ChildNodes]
Count=4
Count=5
[Project\ChildNodes\Node1]
ClassName=TProjectRunConfiguationsNode
@@ -74,8 +78,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node1]
ClassName=TProjectRunConfiguationNode
@@ -97,8 +99,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node2]
ClassName=TProjectRunConfiguationNode
@@ -120,8 +120,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node3]
ClassName=TProjectRunConfiguationNode
@@ -143,8 +141,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node4]
ClassName=TProjectRunConfiguationNode
@@ -166,8 +162,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node5]
ClassName=TProjectRunConfiguationNode
@@ -189,8 +183,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node6]
ClassName=TProjectRunConfiguationNode
@@ -212,8 +204,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node7]
ClassName=TProjectRunConfiguationNode
@@ -235,8 +225,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[Project-Path]..
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node8]
ClassName=TProjectRunConfiguationNode
@@ -258,8 +246,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes\Node9]
ClassName=TProjectRunConfiguationNode
@@ -281,8 +267,6 @@ Description=Run script using an external Python Interpreter
ApplicationName=$[PythonExe-Short]
Parameters=$[ActiveScript-Short]
WorkingDirectory=$[ActiveScript-Dir]
ShortCut=0
MessagesFormat=$[FileName] $[LineNumber]
[Project\ChildNodes\Node1\ChildNodes]
Count=10


+ 2
- 7
extensions.rdf.j2 View File

@@ -1,18 +1,13 @@
<?xml version="1.0"?>
<!DOCTYPE RDF>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:isi="http://inverse.ca/sogo-integrator/"
xmlns:isi="http://inverse.ca/sogo-connector/"
xmlns:em="http://www.mozilla.org/2004/em-rdf#"
xmlns:NC="http://home.netscape.com/NC-rdf#">
<Seq about="http://inverse.ca/sogo-integrator/extensions"
<Seq about="http://inverse.ca/sogo-connector/extensions"
isi:updateURL="https://{{ sogo_server }}/plugins/updates.php?plugin=%ITEM_ID%&amp;version=%ITEM_VERSION%&amp;platform=%PLATFORM%">
<li>
<Description
em:id="sogo-integrator@inverse.ca"
em:name="SOGo Integrator"/>
</li>
<li>
<Description
em:id="sogo-connector@inverse.ca"
em:name="SOGo Connector"/>
</li>


+ 14
- 0
reset_addons.bat.j2 View File

@@ -0,0 +1,14 @@
for /f %%a in ('dir /b "%APPDATA%\Thunderbird\Profiles\*.default"') do SET TBPROFILE=%APPDATA%\Thunderbird\Profiles\%%a
IF NOT EXIST "%TBPROFILE%" GOTO :EOF
IF EXIST "%TBPROFILE%\extensions.json" (
IF NOT EXIST "%TBPROFILE%\extensions.{{ tb_major_version }}.json" (
rename "%TBPROFILE%\extensions.json" extensions.{{ tb_major_version }}.json
)
)
IF EXIST "%TBPROFILE%\addonStartup.json.lz4" (
IF NOT EXIST "%TBPROFILE%\addonStartup.{{ tb_major_version }}.json.lz4" (
rename "%TBPROFILE%\addonStartup.json.lz4" addonStartup.{{ tb_major_version }}.json.lz4
)
)

+ 43
- 28
setup.py View File

@@ -9,57 +9,72 @@ variables = {
'sogo_server': 'mail.server.local'
}

# Read local variables file if available
if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')):
print('Reading local encrypted variables file')
from cryptography.fernet import Fernet
import yaml
f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read())
variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())))

def install():
# Read local variables file if available
if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')):
print('Reading local encrypted variables file')
from cryptography.fernet import Fernet
import yaml
f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read())
variables.update(yaml.safe_load(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())))

connector_version = control['version'].split('-',1)[0]
integrator_version = connector_version
for extension in ['connector','integrator']:
if isdir(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension)):
remove_tree(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension))
mkdirs(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension))
major_version = control['version'].split('.',1)[0]
extension_dir = makepath(programfiles,'Mozilla Thunderbird','distribution','extensions')

for extension in ['connector', 'integrator']:
if isdir(makepath(extension_dir, 'sogo-%s@inverse.ca' % extension)):
remove_tree(makepath(extension_dir, 'sogo-%s@inverse.ca' % extension))
if isfile(makepath(extension_dir, 'sogo-%s@inverse.ca.xpi' % extension)):
remove_file(makepath(extension_dir, 'sogo-%s@inverse.ca.xpi' % extension))
mkdirs(makepath(extension_dir, 'sogo-connector@inverse.ca'))

# connector can be extracted as is
unzip('sogo-connector-%s.xpi' % connector_version, makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-connector@inverse.ca'))
# The extension must be customized, so first extract it
print('Extraction demo extension')
unzip('sogo-connector-%s-demo.xpi' % connector_version, makepath(extension_dir,'sogo-connector@inverse.ca'))

# Integrator must be customized, so first extract it
unzip('sogo-integrator-%s-sogo-demo.xpi' % integrator_version, makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca'))
# And replace the extensions.rdf content
print('Customizing extension')
jinja2 = Environment(
loader=FileSystemLoader(os.path.dirname(os.path.abspath(__file__))),
trim_blocks=True
)
open(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','chrome','content','extensions.rdf'),'w').write(
open(makepath(extension_dir,'sogo-connector@inverse.ca','chrome','content','sogo-connector','global','extensions.rdf'),'w').write(
jinja2.get_template('extensions.rdf.j2').render(
sogo_server = variables['sogo_server']
)
)
# Also remove custom settings
os.unlink(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','defaults','preferences','site.js'))
os.unlink(makepath(extension_dir,'sogo-connector@inverse.ca','defaults','preferences','site.js'))

# Now create an XPI
print('Creating XPI')
run(r'"%s" a -tzip "%s" "%s"' %(makepath(programfiles, '7-Zip', '7z.exe'), makepath(extension_dir, 'sogo-connector@inverse.ca.xpi'), makepath(extension_dir, 'sogo-connector@inverse.ca', '*')))

# Note : we could remove the extension directory, but we keep it for easier auditing

# Script to reset extensions.json and addonStartup.json.lz4, those files need to be removed
# for sogo-connector to be correctly loaded. At least for the 60.x -> 68.x upgrade
print('Deploy reset_addons.bat script')
open(makepath(programfiles,'Mozilla Thunderbird','reset_addons.bat'),'w').write(
jinja2.get_template('reset_addons.bat.j2').render(
tb_major_version = major_version
)
)

def uninstall():
print('Removing SOGo extensions for Thunderbird')
for extension in ['connector','integrator']:
remove_tree(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension))
print('Removing SOGo connector for Thunderbird')
remove_tree(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-connector@inverse.ca' % extension))

def session_setup():
print('Reset Thunderbird addons settings on major upgrades')
run(makepath(programfiles,'Mozilla Thunderbird','reset_addons.bat'))

def audit():
connector_version = control['version'].split('-',1)[0]
integrator_version = connector_version
try:
run('type "%s" | find /I "em:version=" | find "%s"' % (makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-connector@inverse.ca','install.rdf'), connector_version))
except:
print('SOGO connector version check failed')
return "ERROR"
try:
run('type "%s" | find /I "em:version=" | find "%s"' % (makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','install.rdf'), integrator_version))
except:
print('SOGO integrator version check failed')
return "ERROR"
return "OK"

BIN
sogo-connector-60.0.0.xpi (Stored with Git LFS) View File

oid sha256:f860c9c69827c44376851db704d1c77a2f2778fb48222e9fa10b5206ddfb9ccd
size 265848

BIN
sogo-connector-68.0.0-demo.xpi (Stored with Git LFS) View File

oid sha256:609a41d9ebd040e6c7fef95590f49721aea0956a698d6768e1e2e3b820cb442f
size 388712

BIN
sogo-integrator-60.0.0-sogo-demo.xpi (Stored with Git LFS) View File

oid sha256:3efa5ffbe46cc4d832b80e3ff787dba4fd793d113d7f36fc1ac680f694490363
size 166014

Loading…
Cancel
Save