pyinstaller updater with github / bitbucket private repos

孤者浪人 提交于 2019-11-29 17:03:39

问题


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://git@bitbucket.org/Tysondogerz/ssh/download']
    MAX_DOWNLOAD_RETRIES = 3

Creating an ssh is easy enough:

ssh-keygen -t rsa -C "youremail@example.com"

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()

回答1:


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.)



来源:https://stackoverflow.com/questions/48047296/pyinstaller-updater-with-github-bitbucket-private-repos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!