From 22229ec6ebe73b323c6b4f47588be00a52808b07 Mon Sep 17 00:00:00 2001 From: "black.box (Unzoner) team@belodetek.io" Date: Sun, 3 Dec 2023 09:41:33 -0800 Subject: [PATCH] correct library paths --- unzoner/Dockerfile.template | 6 +++--- unzoner/src/main.py | 25 +++++++++---------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/unzoner/Dockerfile.template b/unzoner/Dockerfile.template index 26673ac..73383de 100644 --- a/unzoner/Dockerfile.template +++ b/unzoner/Dockerfile.template @@ -45,7 +45,7 @@ WORKDIR /data RUN useradd openssl && (passwd -d openssl || true) -ENV LD_LIBRARY_PATH="/usr/local/lib64:$LD_LIBRARY_PATH" +ENV LD_LIBRARY_PATH="/usr/local/ssl/lib64:$LD_LIBRARY_PATH" RUN if [ "$BUILD_OPENSSL" = '1' ]; then \ set -x; git clone --depth 1 --branch openssl-$BUILD_OPENSSL_VERSION https://github.com/openssl/openssl \ @@ -64,7 +64,7 @@ USER root RUN (deluser --remove-home openssl && delgroup openssl) || true RUN if [ "$BUILD_OPENSSL" = '1' ]; then \ - set -x; cd openssl && id && make install_sw && ldconfig /usr/local/lib64/ \ + set -x; cd openssl && id && make install_sw && ldconfig /usr/local/ssl/lib64 \ && /usr/local/ssl/bin/openssl version && ldd /usr/local/ssl/bin/openssl; fi # https://stackoverflow.com/a/39006247/1559300 @@ -179,7 +179,7 @@ ENV VIRTUAL_ENV /root/venv3 ENV PATH "$VIRTUAL_ENV/bin:$PATH" -ENV LD_LIBRARY_PATH="/usr/local/lib64:$LD_LIBRARY_PATH" +ENV LD_LIBRARY_PATH="/usr/local/ssl/lib64:$LD_LIBRARY_PATH" ENV DEBIAN_FRONTEND noninteractive diff --git a/unzoner/src/main.py b/unzoner/src/main.py index 348cd08..1c9d71c 100755 --- a/unzoner/src/main.py +++ b/unzoner/src/main.py @@ -136,8 +136,7 @@ def main(): if not started[idx] and not starting[idx]: if i == 1: # once per loop (start) starting[idx] = True - log('{}: cycle={} starting={} proto={}'.format( - this, + log('vpn-server-state: cycle={} starting={} proto={}'.format( i, starting[idx], proto @@ -177,7 +176,7 @@ def main(): )) if i == 1 or i % LOOP_CYCLE == 0: # twice per loop (start and end) - if DEBUG: log('event-loop-status: cycle={} proto={} status={}'.format( + if DEBUG: log('vpn-server-state: cycle={} proto={} status={}'.format( i, proto, get_status(proto=proto) @@ -195,7 +194,7 @@ def main(): shell_check_output_cmd('ip link | grep {}'.format(TUN_IFACE)) geo_result = get_geo_location() assert geo_result, '{}: double-vpn not ready'.format(this) - print('double-vpn: {}'.format(geo_result)) + print('double-vpn-geo: {}'.format(geo_result)) log_server_stats(status=started) # server up only if double-vpn is up except: print('exception-handler in {}: {}'.format(this, repr(e))) @@ -232,8 +231,7 @@ def main(): if DEVICE_TYPE in [2, 3, 5]: # iperf timeout if c_stp and now - c_stimer > (LOOP_TIMER * LOOP_CYCLE * 5): - log('{}: pid={} elapsed={}'.format( - this, + log('iperf-status: pid={} elapsed={}'.format( c_stp.pid, now - c_stimer )) @@ -258,8 +256,7 @@ def main(): # hdparm or dd timeout if c_iotp and now - c_iotimer > (LOOP_TIMER * LOOP_CYCLE * 3): - log('{}: pid={} elapsed={} test={}'.format( - this, + log('iotest-status: pid={} elapsed={} test={}'.format( c_iotp.pid, now - c_iotimer, c_iott @@ -272,10 +269,7 @@ def main(): } log('run_iotest: result={}'.format(result)) res = update_iotest(data=result) - log('update_iotest({}): {}'.format( - res[0], - res[1] - )) + log('update_iotest({}): {}'.format(res[0], res[1])) except Exception as e: print('exception-handler in {}: {}'.format(this, repr(e))) if DEBUG: print_exc() @@ -394,7 +388,7 @@ def main(): m3 = p2.search(c_msg).groups() c_remote = m3[0] c_country = m3[1] - log('{}: remote={} country={}'.format( + log('vpn-client-state: remote={} country={}'.format( this, c_remote, c_country @@ -405,8 +399,7 @@ def main(): if not connected and not connecting: if i == 1: connecting = True - log('{}: cycle={} connecting={} family={}'.format( - this, + log('vpn-client-state: cycle={} connecting={} family={}'.format( i, connecting, AF @@ -466,7 +459,7 @@ def main(): shell_check_output_cmd('ip link | grep {}'.format(TUN_IFACE)) geo_result = get_geo_location() assert geo_result, '{}: client tunnel down'.format(this) - print('client-vpn: {}'.format(geo_result)) + print('client-vpn-geo: {}'.format(geo_result)) except AssertionError as e: print('exception-handler in {}: {}'.format(this, repr(e))) if DEBUG: print_exc()