-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
238 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# UTF-8 | ||
VSVersionInfo( | ||
ffi=FixedFileInfo( | ||
filevers=(1,2,3,0), | ||
prodvers=(1,2,3,0), | ||
mask=0x3f, | ||
flags=0x0, | ||
OS=0x4, | ||
fileType=0x1, | ||
subtype=0x0, | ||
date=(0, 0) | ||
), | ||
kids=[ | ||
StringFileInfo( | ||
[ | ||
StringTable( | ||
'000004b0', | ||
[StringStruct('CompanyName', 'ocv.me'), | ||
StringStruct('FileDescription', 'up2k uploader / filesearch command'), | ||
StringStruct('FileVersion', '1.2.3'), | ||
StringStruct('InternalName', 'up2k'), | ||
StringStruct('LegalCopyright', '2019, ed'), | ||
StringStruct('OriginalFilename', 'up2k.exe'), | ||
StringStruct('ProductName', 'up2k client'), | ||
StringStruct('ProductVersion', '1.2.3')]) | ||
]), | ||
VarFileInfo([VarStruct('Translation', [0, 1200])]) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
curl -k https://192.168.123.1:3923/cpp/scripts/pyinstaller/up2k.sh | | ||
tee up2k2.sh | cmp up2k.sh && rm up2k2.sh || { | ||
[ -s up2k2.sh ] || exit 1 | ||
echo "new up2k script; upgrade y/n:" | ||
while true; do read -u1 -n1 -r r; [[ $r =~ [yYnN] ]] && break; done | ||
[[ $r =~ [yY] ]] && mv up2k{2,}.sh && exec ./up2k.sh | ||
} | ||
|
||
uname -s | grep -E 'WOW64|NT-10' && echo need win7-32 && exit 1 | ||
|
||
dl() { curl -fkLO "$1"; } | ||
cd ~/Downloads | ||
|
||
dl https://192.168.123.1:3923/cpp/bin/up2k.py | ||
dl https://192.168.123.1:3923/cpp/scripts/pyinstaller/up2k.ico | ||
dl https://192.168.123.1:3923/cpp/scripts/pyinstaller/up2k.rc | ||
dl https://192.168.123.1:3923/cpp/scripts/pyinstaller/up2k.spec | ||
|
||
# $LOCALAPPDATA/programs/python/python37-32/python -m pip install --user -U pyinstaller requests | ||
|
||
grep -E '^from .ssl_ import' $APPDATA/python/python37/site-packages/urllib3/util/proxy.py && { | ||
echo golfing | ||
echo > $APPDATA/python/python37/site-packages/requests/certs.py | ||
sed -ri 's/^(DEFAULT_CA_BUNDLE_PATH = ).*/\1""/' $APPDATA/python/python37/site-packages/requests/utils.py | ||
sed -ri '/^import zipfile$/d' $APPDATA/python/python37/site-packages/requests/utils.py | ||
sed -ri 's/"idna"//' $APPDATA/python/python37/site-packages/requests/packages.py | ||
sed -ri 's/import charset_normalizer.*/pass/' $APPDATA/python/python37/site-packages/requests/compat.py | ||
sed -ri 's/raise.*charset_normalizer.*/pass/' $APPDATA/python/python37/site-packages/requests/__init__.py | ||
sed -ri 's/import charset_normalizer.*//' $APPDATA/python/python37/site-packages/requests/packages.py | ||
sed -ri 's/chardet.__name__/"\\roll\\tide"/' $APPDATA/python/python37/site-packages/requests/packages.py | ||
sed -ri 's/chardet,//' $APPDATA/python/python37/site-packages/requests/models.py | ||
for n in util/__init__.py connection.py; do awk -i inplace '/^from (\.util)?\.ssl_ /{s=1} !s; /^\)/{s=0}' $APPDATA/python/python37/site-packages/urllib3/$n; done | ||
sed -ri 's/^from .ssl_ import .*//' $APPDATA/python/python37/site-packages/urllib3/util/proxy.py | ||
echo golfed | ||
} | ||
|
||
read a b _ < <(awk -F\" '/^S_VERSION =/{$0=$2;sub(/\./," ");print}' < up2k.py) | ||
sed -r 's/1,2,3,0/'$a,$b,0,0'/;s/1\.2\.3/'$a.$b.0/ <up2k.rc >up2k.rc2 | ||
|
||
#python uncomment.py up2k.py | ||
$APPDATA/python/python37/scripts/pyinstaller -y --clean --upx-dir=. up2k.spec | ||
|
||
./dist/up2k.exe --version | ||
|
||
curl -fkT dist/up2k.exe -HPW:wark https://192.168.123.1:3923/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
|
||
block_cipher = None | ||
|
||
|
||
a = Analysis( | ||
['up2k.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=[], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[ | ||
'ftplib', | ||
'lzma', | ||
'pickle', | ||
'ssl', | ||
'tarfile', | ||
'bz2', | ||
'zipfile', | ||
'tracemalloc', | ||
'zlib', | ||
'urllib3.util.ssl_', | ||
'urllib3.contrib.pyopenssl', | ||
'urllib3.contrib.socks', | ||
'certifi', | ||
'idna', | ||
'chardet', | ||
'charset_normalizer', | ||
'email.contentmanager', | ||
'email.policy', | ||
'encodings.zlib_codec', | ||
'encodings.base64_codec', | ||
'encodings.bz2_codec', | ||
'encodings.charmap', | ||
'encodings.hex_codec', | ||
'encodings.palmos', | ||
'encodings.punycode', | ||
'encodings.rot_13', | ||
], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False, | ||
) | ||
|
||
# this is the only change to the autogenerated specfile: | ||
xdll = ["libcrypto-1_1.dll"] | ||
a.binaries = TOC([x for x in a.binaries if x[0] not in xdll]) | ||
|
||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
[], | ||
name='up2k', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=True, | ||
disable_windowed_traceback=False, | ||
argv_emulation=False, | ||
target_arch=None, | ||
codesign_identity=None, | ||
entitlements_file=None, | ||
version='up2k.rc2', | ||
icon=['up2k.ico'], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# grep '">encodings.cp' C:/Users/ed/dev/copyparty/bin/dist/xref-up2k.html | sed -r 's/.*encodings.cp//;s/<.*//' | sort -n | uniq | tr '\n' , | ||
# grep -i encodings -A1 build/up2k/xref-up2k.html | sed -r 's/.*(Missing|Excluded)Module.*//' | grep moduletype -B1 | grep -v moduletype | ||
|
||
ex=( | ||
ftplib lzma pickle ssl tarfile bz2 zipfile tracemalloc zlib | ||
urllib3.util.ssl_ urllib3.contrib.pyopenssl urllib3.contrib.socks certifi idna chardet charset_normalizer | ||
email.contentmanager email.policy | ||
encodings.{zlib_codec,base64_codec,bz2_codec,charmap,hex_codec,palmos,punycode,rot_13} | ||
); | ||
cex=(); for a in "${ex[@]}"; do cex+=(--exclude "$a"); done | ||
$APPDATA/python/python37/scripts/pyi-makespec --version-file up2k.rc2 -i up2k.ico -n up2k -c -F up2k.py "${cex[@]}" |