diff --git a/client_software/0050_nextcloud_mozilla_pre/profiles.ini b/client_software/0050_nextcloud_mozilla_pre/profiles_ff.ini similarity index 100% rename from client_software/0050_nextcloud_mozilla_pre/profiles.ini rename to client_software/0050_nextcloud_mozilla_pre/profiles_ff.ini diff --git a/client_software/0050_nextcloud_mozilla_pre/thunderbird.tar.zst b/client_software/0050_nextcloud_mozilla_pre/thunderbird.tar.zst new file mode 100644 index 0000000..64b02eb Binary files /dev/null and b/client_software/0050_nextcloud_mozilla_pre/thunderbird.tar.zst differ diff --git a/client_software/0050_nextcloud_mozilla_pre/user_run.sh b/client_software/0050_nextcloud_mozilla_pre/user_run.sh index 930ea25..b59ace4 100755 --- a/client_software/0050_nextcloud_mozilla_pre/user_run.sh +++ b/client_software/0050_nextcloud_mozilla_pre/user_run.sh @@ -16,9 +16,10 @@ from os import environ from webdav3.client import Client #Variables +thunderbird_tar = os.path.dirname(__file__) + '/thunderbird.tar.zst' firefox_tar = os.path.dirname(__file__) + '/firefox.tar.zst' firefoxhome_path = environ['HOME'] + "/.config/mozilla/firefox" -firefoxhome_profile_src = os.path.dirname(__file__) + '/profiles.ini' +firefoxhome_profile_src = os.path.dirname(__file__) + '/profiles_ff.ini' firefoxhome_profile_dst = firefoxhome_path + '/profiles.ini' #Check Env @@ -47,6 +48,7 @@ if 'PROFILE_FIREFOX_RESET_LOCAL' in environ: shutil.copyfile(firefoxhome_profile_src, firefoxhome_profile_dst) # Copy initial profiles.ini to dir print("Done.") +#Firefox first profile setup if 'PROFILE_FIREFOX_SRC' in environ: # Check and setup mozilla pathstr = environ['PROFILE_FIREFOX_SRC'] + "/default" if not client.check(pathstr): @@ -75,4 +77,33 @@ if 'PROFILE_FIREFOX_SRC' in environ: # Check and setup mozilla print("Done.") #Next sync will be executed by logon script +#Thunderbird first profile setup +if 'PROFILE_TB_SRC' in environ: # Check and setup mozilla + pathstr = environ['PROFILE_TB_SRC'] + "/default" + if not client.check(pathstr): + print("Path " + pathstr + " was not found on Server. Creating it.") + i = 0 + while i >= 0: #Dive into subfolders of string + i = pathstr.find("/", i + 1) + if i >= 0: + #print("/" + pathstr[:i]) + if not client.check(pathstr[:i]): + client.execute_request("mkdir", "/" + pathstr[:i]) + #print("/" + pathstr) + client.execute_request("mkdir", "/" + pathstr) + print("Done.") + #Check and create local Folder + if not os.path.exists(environ['PROFILE_TB_DST'] + "/default"): + os.makedirs(environ['PROFILE_TB_DST'] + "/default") + #First sync to initialise sync-db + print("Call " + environ['SYSCONFIGPATH'] + "/system_setup/mozilla_starter.sh thunderbird sync") + retstr = subprocess.call(['sh', environ['SYSCONFIGPATH'] + '/system_setup/mozilla_starter.sh', 'thunderbird', 'sync']) + #Extract empty firefox profile to Folder + print("Extracting " + thunderbird_tar + " to " + environ['PROFILE_TB_DST']) + tar = tarfile.open(thunderbird_tar) + tar.extractall(path=environ['PROFILE_TB_DST'],filter='data') + tar.close() + print("Done.") + #Next sync will be executed by logon script + sys.exit(0)