Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8ff6d2e
Remove credentials from code
toderian Jan 24, 2025
d201784
Remove password set up from pr-build GH Action
toderian Jan 24, 2025
946cf4e
disable ubuntu builds
toderian Jan 30, 2025
feade67
add windows app signing
toderian Jan 30, 2025
95af22c
fix workflow
toderian Jan 30, 2025
f5deb1c
debugging workflow
toderian Jan 30, 2025
d32dfce
debugging workflow
toderian Jan 30, 2025
672d156
debugging workflow
toderian Jan 30, 2025
c03c47d
debugging workflow
toderian Jan 30, 2025
7257b6c
debugging workflow
toderian Jan 30, 2025
863b1f9
debugging workflow
toderian Jan 30, 2025
5fb17ee
debugging workflow
toderian Jan 30, 2025
0fa6781
debugging workflow
toderian Jan 30, 2025
f183981
debugging workflow
toderian Jan 30, 2025
2996f82
debugging workflow
toderian Jan 30, 2025
1ff04f1
debugging workflow
toderian Jan 30, 2025
f98bc78
debugging workflow
toderian Jan 30, 2025
3f7ae81
Update download-artifact to v4
toderian Jan 30, 2025
4dc90f2
Update path
toderian Jan 31, 2025
f05eb71
Update path
toderian Jan 31, 2025
0690682
debugging
toderian Jan 31, 2025
283dee4
debugging
toderian Jan 31, 2025
1109d6f
debugging
toderian Jan 31, 2025
a98340d
debugging
toderian Jan 31, 2025
3304ceb
debugging
toderian Jan 31, 2025
c5d5d1b
debugging
toderian Jan 31, 2025
2165787
debugging
toderian Jan 31, 2025
b44d4f7
debugging
toderian Jan 31, 2025
10dcd72
debugging
toderian Jan 31, 2025
66b4904
debugging
toderian Jan 31, 2025
9a42304
debugging
toderian Jan 31, 2025
3b3cafe
Use env vars
toderian Jan 31, 2025
d4e89e2
Update pr-build.yml
toderian Jan 31, 2025
f727fb6
Update pr-build.yml
toderian Jan 31, 2025
f6dd24a
Update pr-build.yml
toderian Jan 31, 2025
ca021ff
Debugging
toderian Jan 31, 2025
937d08c
Update pr-build.yml
toderian Jan 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 104 additions & 40 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 }}
Expand All @@ -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/*
Expand All @@ -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
4 changes: 0 additions & 4 deletions utils/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 2 additions & 12 deletions utils/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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',
]
Expand All @@ -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)))
Expand Down Expand Up @@ -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)
Expand Down
Loading