diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index a76d8359b5..a37234d007 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -3,7 +3,7 @@ name: FlowCrypt Android App agent: machine: type: e2-standard-2 - os_image: ubuntu2004 + os_image: ubuntu2404 execution_time_limit: minutes: 60 @@ -30,9 +30,11 @@ global_job_config: - sudo apt install -y dnsmasq resolvconf - echo "#added by flowcrypt" | sudo tee -a /etc/dnsmasq.conf - echo "listen-address=127.0.0.1" | sudo tee -a /etc/dnsmasq.conf - - echo "address=/flowcrypt.test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf - - echo "address=/wrongssl.test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf + - echo "address=/test/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf - echo "address=/localhost/127.0.0.1" | sudo tee -a /etc/dnsmasq.conf + - echo "server=8.8.8.8" | sudo tee -a /etc/dnsmasq.conf + # redirect the systemd-resolved to use the localhost as the primary nameserver + - sudo sed -i '1inameserver 127.0.0.1\' /etc/resolv.conf - sudo systemctl restart dnsmasq # print some debug info - ping fel.localhost -c 1 diff --git a/script/ci-wait-for-emulator.sh b/script/ci-wait-for-emulator.sh index c91a189fb8..6e622f6437 100755 --- a/script/ci-wait-for-emulator.sh +++ b/script/ci-wait-for-emulator.sh @@ -1,4 +1,9 @@ #!/bin/bash +# +# © 2016-present FlowCrypt a.s. Limitations apply. Contact human@flowcrypt.com +# Contributors: denbond7 +# + set -o xtrace adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done;' adb shell wm dismiss-keyguard @@ -18,5 +23,13 @@ adb shell "iptables -t nat -A PREROUTING -s 127.0.0.1 -p tcp --dport 443 -j REDI adb shell "iptables -t nat -A OUTPUT -s 127.0.0.1 -p tcp --dport 443 -j REDIRECT --to 1212" ################################################################################################### +# https://developer.android.com/tools/adb#forwardports +# forwards requests on a specific host port to a different port on a device. +# It can be helpful for debugging a mock web server +adb forward tcp:1212 tcp:1212 + +#check the emulator has internet connection +adb shell "ping -c 1 www.google.com" + echo "Emulator is ready" set +o xtrace