diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index e49420b..80f1b50 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -11,7 +11,7 @@ jobs: should-run: ${{ steps.check-version.outputs.should-run }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Fetches all history for all branches and tags @@ -49,26 +49,26 @@ jobs: name: EdgeNodeLauncher-WIN32 platformDependencies: "" - - os: ubuntu-24.04 - build: | - chmod +x build_scripts/unix_build.sh - ./build_scripts/unix_build.sh - name: EdgeNodeLauncher-LINUX_Ubuntu-24.04 - platformDependencies: sudo apt-get update && sudo apt install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing - - - os: ubuntu-22.04 - build: | - chmod +x build_scripts/unix_build.sh - ./build_scripts/unix_build.sh - name: EdgeNodeLauncher-LINUX_Ubuntu-22.04 - platformDependencies: sudo apt-get update && sudo apt install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing - - - os: ubuntu-20.04 - build: | - chmod +x build_scripts/unix_build.sh - ./build_scripts/unix_build.sh - name: EdgeNodeLauncher-LINUX_Ubuntu-20.04 - platformDependencies: sudo apt-get update && sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing +# - os: ubuntu-24.04 +# build: | +# chmod +x build_scripts/unix_build.sh +# ./build_scripts/unix_build.sh +# name: EdgeNodeLauncher-LINUX_Ubuntu-24.04 +# platformDependencies: sudo apt-get update && sudo apt install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing +# +# - os: ubuntu-22.04 +# build: | +# chmod +x build_scripts/unix_build.sh +# ./build_scripts/unix_build.sh +# name: EdgeNodeLauncher-LINUX_Ubuntu-22.04 +# platformDependencies: sudo apt-get update && sudo apt install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing +# +# - os: ubuntu-20.04 +# build: | +# chmod +x build_scripts/unix_build.sh +# ./build_scripts/unix_build.sh +# name: EdgeNodeLauncher-LINUX_Ubuntu-20.04 +# platformDependencies: sudo apt-get update && sudo apt-get install -y '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev --fix-missing name: Build installers ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -86,26 +86,90 @@ jobs: pip install -r requirements.txt pip3 install --upgrade PyInstaller pyinstaller-hooks-contrib - - name: Replace placeholder in const.py (Windows) + - name: Build app + run: ${{ matrix.build }} + + # - name: Check path + # if: runner.os == 'Windows' + # run: | + # ls + # pwd + # ls dist + # ls build + # mkdir -p ./signed + # ls ${{ github.workspace }}/dist +# dir ${{ github.workspace }}/dist + +# - name: Unlock Windows Executable +# if: runner.os == 'Windows' +# run: | +# tasklist | findstr /I "EdgeNodeLauncher.exe" && taskkill /F /IM EdgeNodeLauncher.exe || echo "No process running" + +# - name: Set Permissions for Signing +# if: runner.os == 'Windows' +# run: | +# icacls build\EdgeNodeLauncher.exe /grant Everyone:F /T /C +# + +# - name: Wait for File Unlock +# if: runner.os == 'Windows' +# run: timeout /t 5 + +# - name: Debug File Path +# if: runner.os == 'Windows' +# run: | +# echo "Checking file path..." +# dir build +# dir ${{ github.workspace }}/build +# - name: Set Permissions for Signing +# if: runner.os == 'Windows' +# run: | +# icacls build\EdgeNodeLauncher.exe /grant Everyone:F /T /C +# attrib -r build\EdgeNodeLauncher.exe + - name: Sign Windows app + if: runner.os == 'Windows' + uses: sslcom/esigner-codesign@develop + with: + # Sign and timestamp code object. + command: sign + # SSL.com account username + username: ${{ secrets.SSL_USERNAME }} + # SSL.com account password. + password: ${{ secrets.SSL_PASSWORD }} + # Credential ID for signing certificate. + credential_id: ${{ secrets.SSL_CREDENTIAL_ID }} + # OAuth TOTP Secret (https://www.ssl.com/how-to/automate-esigner-ev-code-signing) + totp_secret: ${{ secrets.SSL_TOTP_SECRET }} + # Path of code object to be signed. (DLL, JAR, EXE, MSI files vb... ) + file_path: ${{ github.workspace }}/dist/EdgeNodeLauncher.exe + # Directory where signed code object(s) will be written. + output_path: ${{ github.workspace }}/signed + # Scan code before sign + malware_block: true + # Environment Name, For Production 'PROD' or For Staging 'TEST' + environment_name: PROD + + - name: Replace non-signed version with signed one if: runner.os == 'Windows' - env: - MQTT_K: ${{ secrets.MQTT_K }} run: | - $filePath = "utils/const.py" - (Get-Content $filePath) -replace '\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*', "${{ env.MQTT_K }}" | Set-Content $filePath + rm dist/EdgeNodeLauncher.exe + mv signed/EdgeNodeLauncher.exe dist/EdgeNodeLauncher.exe - - name: Replace placeholder in const.py (Linux) - if: runner.os == 'Linux' - env: - MQTT_K: ${{ secrets.MQTT_K }} - run: | - sed -i "s/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/${MQTT_K}/g" utils/const.py - - name: Build app - run: ${{ matrix.build }} +# env: +# ES_USERNAME: "Naeural999" +# ES_PASSWORD: "romaniaA1!@" +# CREDENTIAL_ID: "" +# ES_TOTP_SECRET: "" + + + +# run: | +# $filePath = "utils/const.py" +# (Get-Content $filePath) -replace '\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*', "${{ env.MQTT_K }}" | Set-Content $filePath - name: Save build artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.name }}-build-${{ github.event.pull_request.number }}-${{ github.sha }} path: dist/* @@ -117,25 +181,25 @@ jobs: steps: - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: EdgeNodeLauncher-WIN32-build-${{ github.event.pull_request.number }}-${{ github.sha }} - path: ./all-builds/EdgeNodeLauncher-WIN32 + path: ./all-builds/EdgeNodeLauncher-WIN32-signed - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: EdgeNodeLauncher-LINUX_Ubuntu-24.04-build-${{ github.event.pull_request.number }}-${{ github.sha }} path: ./all-builds/EdgeNodeLauncher-LINUX_Ubuntu-24.04 - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: EdgeNodeLauncher-LINUX_Ubuntu-22.04-build-${{ github.event.pull_request.number }}-${{ github.sha }} path: ./all-builds/EdgeNodeLauncher-LINUX_Ubuntu-22.04 - name: Download build artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: EdgeNodeLauncher-LINUX_Ubuntu-20.04-build-${{ github.event.pull_request.number }}-${{ github.sha }} path: ./all-builds/EdgeNodeLauncher-LINUX_Ubuntu-20.04 diff --git a/utils/const.py b/utils/const.py index 5be088d..74d6421 100644 --- a/utils/const.py +++ b/utils/const.py @@ -46,10 +46,6 @@ AUTO_UPDATE_CHECK_INTERVAL = 60 -DEFAULT_MQTT_HOST = 'cjkwOTIxMTguYWxhLmV1LWNlbnRyYWwtMS5lbXF4c2wuY29t' -DEFAULT_MQTT_USER = 'Y29yZW5hZXVyYWw=' -DEFAULT_MQTT_PASSWORD = '****************' - ENV_TEMPLATE = ''' # LOCAL FILE TEMPLATE diff --git a/utils/docker.py b/utils/docker.py index 95f2eb7..b07c727 100644 --- a/utils/docker.py +++ b/utils/docker.py @@ -155,10 +155,7 @@ def __init__(self): self.docker_container_name = DOCKER_CONTAINER_NAME self.docker_tag = DOCKER_TAG self.node_id = self.get_node_id() - self.mqtt_host = base64.b64decode(DEFAULT_MQTT_HOST).decode("utf-8") - self.mqtt_user = base64.b64decode(DEFAULT_MQTT_USER).decode("utf-8") - self.mqtt_password = base64.b64decode(DEFAULT_MQTT_PASSWORD).decode("utf-8") - self._dev_mode = False + self._dev_mode = False self.run_with_sudo = False @@ -227,9 +224,6 @@ def __setup_docker_run(self): self.__CMD += [ '--rm', # remove the container when it exits '--env-file', '.env', #f'"{str(self.env_file)}"', # pass the .env file to the container - '-e', f'EE_MQTT_HOST={self.mqtt_host}', # pass the MQTT host to the container - '-e', f'EE_MQTT_USER={self.mqtt_user}', # pass the MQTT user to the container - '-e', f'EE_MQTT={self.mqtt_password}', # pass the MQTT password to the container '-v', f'{DOCKER_VOLUME}:/edge_node/_local_cache', # mount the volume '--name', self.docker_container_name, '-d', ] @@ -248,10 +242,9 @@ def __setup_docker_run(self): self.__CMD_INSPECT.insert(0, 'sudo') run_cmd = " ".join(self.get_cmd()) - obfuscated_cmd = run_cmd.replace(self.mqtt_password, '*' * len(self.mqtt_password)) self.add_log('Docker run command setup complete:') - self.add_log(' - Run: {}'.format(obfuscated_cmd)) + self.add_log(' - Run: {}'.format(run_cmd)) self.add_log(' - Clean: {}'.format(" ".join(self.__CMD_CLEAN))) self.add_log(' - Stop: {}'.format(" ".join(self.__CMD_STOP))) self.add_log(' - Inspect: {}'.format(" ".join(self.__CMD_INSPECT))) @@ -323,9 +316,6 @@ def __generate_env_file(self): else: str_env = ENV_TEMPLATE.format( self.node_id, - self.mqtt_host, - self.mqtt_user, - self.mqtt_password ) with open(self.env_file, 'w') as f: f.write(str_env)