Thursday, April 14, 2022

[SOLVED] pyinstaller updater with github / bitbucket private repos

Issue

I'm attempting to integrate pyinstaller with updating feature for private repo’s. My question, is there a way to integrate pyupdater with free alternatives such as: bitbucket private repos? Pyupdater tends to work for public repo’s but I cannot workout how I can achieve this for private repo’s.

Config file:

class ClientConfig(object):
    PUBLIC_KEY = 'None'
    APP_NAME = 'dad123'
    COMPANY_NAME = 'dad123'
    UPDATE_URLS = ['ssh://[email protected]/Tysondogerz/ssh/download']
    MAX_DOWNLOAD_RETRIES = 3

Creating an ssh is easy enough:

ssh-keygen -t rsa -C "[email protected]"

So…

Main.py

#!/usr/bin/env python3
from __future__ import print_function
import time
import argparse
import os
import signal
import sys
import logging
from selenium import webdriver
 
logging.basicConfig(level=logging.DEBUG)
 
from client_config import ClientConfig
from pyupdater.client import Client, AppUpdate, LibUpdate
 
Ssh_key  = DWDJKWNADKJWANDJKWANDWJKDNAWJKDNWAKDNWAJDKWANDJKWANDWAJKDNWAKJDWNADKJWANDWAJKDNAWJKDNWAJKDNWAJKDWNADJKWANDJKWANDKJWADNWAJKDNWAJKNWQWQDWQNDJKQWNDJKWQNDWQJKDNWQJKDNWKJDNWKJANDWJKNDWJKNDWDUWDNWDHDUIWHDIUWHDUIWHDUIWHDIUWHDUIWHDWUDHWUIHDWUDHUhottyouremail@example.com
 
    client = Client(ClientConfig(), ssh={'ssh_key'})
     
    from pyupdater.client import Client
from client_config import ClientConfig


def print_status_info(info):
    total = info.get(u'total')
    downloaded = info.get(u'downloaded')
    status = info.get(u'status')
    print downloaded, total, status


client = Client(ClientConfig())
client.refresh()

client.add_progress_hook(print_status_info)


client = Client(ClientConfig(), refresh=True,
                        progress_hooks=[print_status_info])

lib_update = client.update_check(ASSET_NAME, ASSET_VERSION)

lib_update = client.update_check(ASSET_NAME, ASSET_VERSION, channel='beta')

if lib_update is not None:
    lib_update.download()
        driver = webdriver.Firefox()
        driver.get('http://stackoverflow.com')
 
 
if __name__ == "__main__":
    main()

Solution

The Downloads section is not accessible via SSH. You'll need to use other forms of authentication over HTTPS to retrieve those files. (Application passwords may be your best option here, since they can be scoped very specifically and discarded as necessary.)



Answered By - Jim Redmond
Answer Checked By - Clifford M. (WPSolving Volunteer)