Skip to content

Commit

Permalink
fix: remove OpenSSL from Windows runtime (#3242)
Browse files Browse the repository at this point in the history
Description
---
- Removed OpenSSL installers and dependencies from Windows runtime
- Removed stdout as appender from console wallet's log4rs logger

Motivation and Context
---
- OpenSSL is not a Windows runtime dependency anymore
- The console wallet cannot handle log4rs logger messages to its stdout as it breaks the TUI

How Has This Been Tested?
---
Build the installer, ran an installer, ran all the executable components
  • Loading branch information
stringhandler committed Aug 26, 2021
2 parents d39029d + 5624c25 commit 0048c3b
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 219 deletions.
14 changes: 0 additions & 14 deletions applications/tari_base_node/windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ The Tari applications have the following dependencies, which can be
installed automatically if selected:

- SQLite
- OpenSSL
- Tor Services
- Redistributable for Microsoft Visual Studio 2019
- XMRig
Expand Down Expand Up @@ -45,9 +44,7 @@ Notes:
|---config
| config.toml
|---runtime
get_openssl_win.ps1
get_xmrig_win.ps1
install_openssl.bat
install_sqlite.bat
install_tor_services.bat
install_vs2019_redist.bat
Expand Down Expand Up @@ -152,17 +149,6 @@ depending on the choices you make when prompted:
- Ensure folder containing `sqlite3.dll`, is in the user or system path
environment variable (hint: type `path` in a command console to verify).

- OpenSSL:
- Download full version of the 64bit Precompiled Binaries for Windows for
[OpenSSL](https://slproweb.com/products/Win32OpenSSL.html)
- Install using all the default prompts

**Note**: It is important that the dlls are available in the path. To test:
```
where libcrypto-1_1-x64.dll
where libssl-1_1-x64.dll
```

- Tor Services
- Donwload
[Tor Windows Expert Bundle](https://www.torproject.org/download/tor/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ if ["%sqlite_runtime%"]==[""] (
pause
exit /b 10101
)
if ["%openssl_runtime_1%"]==[""] (
echo Problem with "sopenssl_runtime" environment variable: '%openssl_runtime_1%'
pause
exit /b 10101
)
if ["%openssl_runtime_2%"]==[""] (
echo Problem with "sopenssl_runtime" environment variable: '%openssl_runtime_2%'
pause
exit /b 10101
)

rem Verify SQLite's location and prepend the default location to the system path if it exist
if exist "%TARI_SQLITE_DIR%\%sqlite_runtime%" (
Expand Down Expand Up @@ -72,38 +62,6 @@ if exist "%TARI_SQLITE_DIR%\%sqlite_runtime%" (
)
)

rem Verify OpenSSL's location
set FOUND_OPENSSL=
if exist "%my_exe_path%\%openssl_runtime_1%" (
if exist "%my_exe_path%\%openssl_runtime_2%" (
echo.
echo Using OpenSSL dlls found in "%my_exe_path%"
echo.
set FOUND_OPENSSL=true
)
)
if not defined FOUND_OPENSSL (
set FOUND_1=
set FOUND_2=
for %%X in (%openssl_runtime_1%) do (set FOUND_1=%%~$PATH:X)
for %%X in (%openssl_runtime_2%) do (set FOUND_2=%%~$PATH:X)
if defined FOUND_1 (
if defined FOUND_2 (
set FOUND_OPENSSL=true
echo.
echo OpenSSL dlls found in system path:
where "%openssl_runtime_1%"
where "%openssl_runtime_2%"
)
)
)
if not defined FOUND_OPENSSL (
echo.
echo Note: OpenSSL dlls not found in "%my_exe_path%" or in the system path; this may be a problem
echo.
pause
)

rem Find the base node executable
if exist "%my_exe_path%\%my_exe%" (
set base_node=%my_exe_path%\%my_exe%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ echo ----------------------------
rem These are the base node executable and SQLite dynamic link library names
set my_exe=tari_base_node.exe
set sqlite_runtime=sqlite3.dll
set openssl_runtime_1=libcrypto-1_1-x64.dll
set openssl_runtime_2=libssl-1_1-x64.dll

rem This is the location of the configuration and identity files
set config_path=%~dp0..\config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ if ["%sqlite_runtime%"]==[""] (
pause
exit /b 10101
)
if ["%openssl_runtime_1%"]==[""] (
echo Problem with "sopenssl_runtime" environment variable: '%openssl_runtime_1%'
pause
exit /b 10101
)
if ["%openssl_runtime_2%"]==[""] (
echo Problem with "sopenssl_runtime" environment variable: '%openssl_runtime_2%'
pause
exit /b 10101
)

rem Verify SQLite's location and prepend the default location to the system path if it exist
if exist "%TARI_SQLITE_DIR%\%sqlite_runtime%" (
Expand Down Expand Up @@ -72,38 +62,6 @@ if exist "%TARI_SQLITE_DIR%\%sqlite_runtime%" (
)
)

rem Verify OpenSSL's location
set FOUND_OPENSSL=
if exist "%my_exe_path%\%openssl_runtime_1%" (
if exist "%my_exe_path%\%openssl_runtime_2%" (
echo.
echo Using OpenSSL dlls found in "%my_exe_path%"
echo.
set FOUND_OPENSSL=true
)
)
if not defined FOUND_OPENSSL (
set FOUND_1=
set FOUND_2=
for %%X in (%openssl_runtime_1%) do (set FOUND_1=%%~$PATH:X)
for %%X in (%openssl_runtime_2%) do (set FOUND_2=%%~$PATH:X)
if defined FOUND_1 (
if defined FOUND_2 (
set FOUND_OPENSSL=true
echo.
echo OpenSSL dlls found in system path:
where "%openssl_runtime_1%"
where "%openssl_runtime_2%"
)
)
)
if not defined FOUND_OPENSSL (
echo.
echo Note: OpenSSL dlls not found in "%my_exe_path%" or in the system path; this may be a problem
echo.
pause
)

rem Find the console wallet executable
if exist "%my_exe_path%\%my_exe%" (
set console_wallet=%my_exe_path%\%my_exe%
Expand Down Expand Up @@ -150,7 +108,8 @@ cd "%base_path%"
rem check if Windows Terminal is in path, if so, run it there, to see emojis properly.
where /q wt
if errorlevel 1 (
"%console_wallet%" %INIT_FLAG% --config "%config_path%\config.toml" --log_config "%config_path%\log4rs_console_wallet.yml" --base-path "%base_path%"
"%console_wallet%" %INIT_FLAG% --config "%config_path%\config.toml" --log_config "%config_path%\log4rs_console_wallet.yml" --base-path "%base_path%"
) else (
wt "%console_wallet%" %INIT_FLAG% --config "%config_path%\config.toml" --log_config "%config_path%\log4rs_console_wallet.yml" --base-path "%base_path%"
wt "%console_wallet%" %INIT_FLAG% --config "%config_path%\config.toml" --log_config "%config_path%\log4rs_console_wallet.yml" --base-path "%base_path%"
exit
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ echo ----------------------------
rem These are the console wallet executable and SQLite dynamic link library names
set my_exe=tari_console_wallet.exe
set sqlite_runtime=sqlite3.dll
set openssl_runtime_1=libcrypto-1_1-x64.dll
set openssl_runtime_2=libssl-1_1-x64.dll

rem This is the location of the configuration and identity files
set config_path=%~dp0..\config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,6 @@ if ["%my_exe%"]==[""] (
exit /b 10101
)

rem Verify OpenSSL's location
set FOUND_OPENSSL=
if exist "%my_exe_path%\%openssl_runtime_1%" (
if exist "%my_exe_path%\%openssl_runtime_2%" (
echo.
echo Using OpenSSL dlls found in "%my_exe_path%"
echo.
set FOUND_OPENSSL=true
)
)
if not defined FOUND_OPENSSL (
set FOUND_1=
set FOUND_2=
for %%X in (%openssl_runtime_1%) do (set FOUND_1=%%~$PATH:X)
for %%X in (%openssl_runtime_2%) do (set FOUND_2=%%~$PATH:X)
if defined FOUND_1 (
if defined FOUND_2 (
set FOUND_OPENSSL=true
echo.
echo OpenSSL dlls found in system path:
where "%openssl_runtime_1%"
where "%openssl_runtime_2%"
)
)
)
if not defined FOUND_OPENSSL (
echo.
echo Note: OpenSSL dlls not found in "%my_exe_path%" or in the system path; this may be a problem
echo.
pause
)

rem Find the merge mining proxy executable
if exist "%my_exe_path%\%my_exe%" (
set merge_mining_proxy=%my_exe_path%\%my_exe%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ echo Set up environment variables
echo ----------------------------
rem These is the merge mining proxy executable name
set my_exe=tari_merge_mining_proxy.exe
set openssl_runtime_1=libcrypto-1_1-x64.dll
set openssl_runtime_2=libssl-1_1-x64.dll

rem This is the location of the configuration and identity files
set config_path=%~dp0..\config
Expand Down
10 changes: 0 additions & 10 deletions buildtools/get_openssl_win.ps1

This file was deleted.

33 changes: 0 additions & 33 deletions buildtools/install_openssl.bat

This file was deleted.

7 changes: 2 additions & 5 deletions buildtools/windows_inno_installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,9 @@ Source: "..\common\config\presets\tari_config_example.toml"; DestDir: "{app}\con
Source: "tari_logo_purple.ico"; DestDir: "{userdocs}\..\temp\tari_icons"; Flags: ignoreversion
Source: "tor.ico"; DestDir: "{userdocs}\..\temp\tari_icons"; Flags: ignoreversion
Source: "xmr_logo.ico"; DestDir: "{userdocs}\..\temp\tari_icons"; Flags: ignoreversion
;Source: "install_sqlite.bat"; DestDir: "{app}\runtime"; Flags: ignoreversion
Source: "install_sqlite.bat"; DestDir: "{app}\runtime"; Flags: ignoreversion
Source: "install_tor_services.bat"; DestDir: "{app}\runtime"; Flags: ignoreversion
Source: "install_vs2019_redist.bat"; DestDir: "{app}\runtime"; Flags: ignoreversion
;Source: "install_openssl.bat"; DestDir: "{app}\runtime"; Flags: ignoreversion
;Source: "get_openssl_win.ps1"; DestDir: "{app}\runtime"; Flags: ignoreversion
Source: "install_xmrig.bat"; DestDir: "{app}\runtime"; Flags: ignoreversion
Source: "get_xmrig_win.ps1"; DestDir: "{app}\runtime"; Flags: ignoreversion
Source: "..\common\xmrig_config\config_example_stagenet.json"; DestDir: "{app}\config"; DestName: "xmrig_config_example_stagenet.json"; Flags: ignoreversion
Expand Down Expand Up @@ -151,9 +149,8 @@ Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#BaseNodeName}";
;PrivilegesRequired=admin

[Run]
;Filename: "{app}\runtime\install_sqlite.bat"; Parameters: "NO_PAUSE"; Flags: runascurrentuser postinstall; Description: "Install SQLite"
Filename: "{app}\runtime\install_sqlite.bat"; Parameters: "NO_PAUSE"; Flags: runascurrentuser postinstall; Description: "Install SQLite"
Filename: "{app}\runtime\install_tor_services.bat"; Parameters: "NO_PAUSE"; Flags: runascurrentuser postinstall; Description: "Install Tor Services"
;Filename: "{app}\runtime\install_openssl.bat"; Parameters: "NO_PAUSE"; Flags: runascurrentuser postinstall; Description: "Install OpenSSL"
Filename: "{app}\runtime\install_xmrig.bat"; Parameters: "NO_PAUSE"; Flags: runascurrentuser postinstall; Description: "Install XMRig"
Filename: "{app}\runtime\install_vs2019_redist.bat"; Parameters: "NO_PAUSE"; Flags: runascurrentuser postinstall; Description: "Install Redistributable for Visual Studio 2019"

Expand Down
63 changes: 30 additions & 33 deletions common/logging/log4rs_sample_wallet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@
# timestamp [target] LEVEL message
refresh_rate: 30 seconds
appenders:
# An appender named "stdout" that writes to stdout
stdout:
kind: console
encoder:
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] {h({l}):5} {m}{n}"
filters:
- kind: threshold
level: warn

# An appender named "network" that writes to a file with a custom pattern encoder
network:
kind: rolling_file
Expand Down Expand Up @@ -71,57 +62,63 @@ appenders:
encoder:
pattern: "{d(%Y-%m-%d %H:%M:%S.%f)} [{t}] [Thread:{I}] {l:5} {m}{n}"

# Set the default logging level to "warn" and attach the "stdout" appender to the root
# root (to base_layer)
root:
level: info
appenders:
- stdout
- base_layer

loggers:
# Route log events common to every application to all appenders
tari::application:
# base_layer
wallet:
level: info
appenders:
- base_layer
- network
- other
additive: false
# Route log events sent to the "core" logger to the "base_layer" appender
c:
# other
h2:
level: info
appenders:
- base_layer
# Route log events sent to the "wallet" logger to the "base_layer" appender
wallet:
- other
additive: false
hyper:
level: info
appenders:
- base_layer
# Route log events sent to the "comms" logger to the "network" appender
- other
additive: false
tokio_util:
level: error
appenders:
- other
additive: false
# network
comms:
level: info
appenders:
- network
p2p:
level: info
additive: false
comms::noise:
level: error
appenders:
- network
# Route log events sent to the "p2p" logger to the "network" appender
yamux:
additive: false
p2p:
level: info
appenders:
- network
# Route log events sent to the "mio" logger to the "other" appender
additive: false
mio:
level: error
appenders:
- network
# Route log events sent to the "rustyline" logger to the "other" appender
rustyline:
additive: false
yamux:
level: error
appenders:
- other
# Route log events sent to the "tokio_util" logger to the "other" appender
tokio_util:
- network
additive: false
tracing:
level: error
appenders:
- other
- network
additive: false

0 comments on commit 0048c3b

Please sign in to comment.