Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ab5b4b3
draft
lizk886 Dec 1, 2025
d1abbd0
clean up
lizk886 Dec 1, 2025
46b8852
[CI Pipeline] Released Snapshot version: 5.61.28-alpha-559-SNAPSHOT
Dec 1, 2025
7862aa8
[CI Pipeline] Released Snapshot version: 5.61.29-alpha-196-SNAPSHOT
Dec 2, 2025
6d1cf06
Merge branch 'wzh-UID2-5843-auto-detect-network-interface' of https:/…
lizk886 Dec 2, 2025
0b512ec
vulnerability
lizk886 Dec 2, 2025
21d971c
simplify
lizk886 Dec 2, 2025
a4220c7
[CI Pipeline] Released Snapshot version: 5.61.30-alpha-562-SNAPSHOT
Dec 2, 2025
7099922
add r7 instances
lizk886 Dec 2, 2025
2ca8b05
start fresh
lizk886 Dec 3, 2025
8cd9b97
[CI Pipeline] Released Snapshot version: 5.61.31-alpha-197-SNAPSHOT
Dec 3, 2025
2d5badd
Merge branch 'wzh-UID2-5843-auto-detect-network-interface' of https:/…
lizk886 Dec 3, 2025
2c98e70
[CI Pipeline] Released Snapshot version: 5.61.32-alpha-198-SNAPSHOT
Dec 3, 2025
c0fe87b
allow more time for auxiliaries to stabilize
lizk886 Dec 3, 2025
db4aa57
[CI Pipeline] Released Snapshot version: 5.61.33-alpha-564-SNAPSHOT
Dec 3, 2025
c31424b
update network interface retriever function naming, instead of sleep …
lizk886 Dec 3, 2025
728a93b
Merge branch 'wzh-UID2-5843-auto-detect-network-interface' of https:/…
lizk886 Dec 3, 2025
3ca2074
remove redundant logics
lizk886 Dec 3, 2025
5fa4963
remove redundant logics
lizk886 Dec 3, 2025
88f4968
log existing/defualt network interface
lizk886 Dec 3, 2025
48d9bd3
[CI Pipeline] Released Snapshot version: 5.61.34-alpha-565-SNAPSHOT
Dec 3, 2025
7756e9a
Guarantees cleanup AFTER stopping
lizk886 Dec 3, 2025
46192f9
Guarantees cleanup AFTER stopping
lizk886 Dec 3, 2025
fd2fc81
roll back retyr logics
lizk886 Dec 3, 2025
09f6a4b
resolve pom conflict
lizk886 Dec 3, 2025
6ac3a15
[CI Pipeline] Released Snapshot version: 5.62.35-alpha-566-SNAPSHOT
Dec 3, 2025
631975f
update pom conflict
lizk886 Dec 3, 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
2 changes: 2 additions & 0 deletions scripts/aws/UID_CloudFormation.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Parameters:
- m6i.4xlarge
- r6i.2xlarge
- r6i.4xlarge
- r7i.2xlarge
- r7i.4xlarge
ConstraintDescription: must be a valid EC2 instance type.
RootVolumeSize:
Description: Instance root volume size
Expand Down
39 changes: 39 additions & 0 deletions scripts/aws/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,47 @@ def __run_config_server(self) -> None:

self.run_service([command, command], "flask_config_server", separate_process=True)

def __configure_sockd_network_interface(self) -> None:
"""
Auto-detects the primary network interface and configures sockd.conf.
This ensures compatibility with R7i instances which use 'enp39s0' instead of 'ens5'.
"""
logging.info("Auto-detecting network interface for SOCKS proxy configuration")

try:
with open('/etc/sockd.conf', 'r') as f:
config = f.read()

# Extract current interface from config
current_match = re.search(r'external:\s+(\S+)', config)
current_interface = current_match.group(1) if current_match else "unknown"

# Detect primary network interface
result = subprocess.run(
["ip", "-o", "route", "get", "1"],
capture_output=True, text=True, check=True
)
match = re.search(r'dev\s+(\S+)', result.stdout)
primary_interface = match.group(1) if match else "ens5"

logging.info(f"Detected primary network interface: {primary_interface} (default in config: {current_interface})")

new_config = re.sub(r'external:\s+\S+', f'external: {primary_interface}', config)

with open('/etc/sockd.conf', 'w') as f:
f.write(new_config)

logging.info(f"/etc/sockd.conf configured with interface: {primary_interface}")

except Exception as e:
logging.error(f"Failed to auto-detect network interface: {e}")
logging.info("Continuing with existing /etc/sockd.conf configuration")

def __run_socks_proxy(self) -> None:
logging.info("Starts the SOCKS proxy service")

self.__configure_sockd_network_interface()

command = ["sockd", "-D"]

# -d specifies debug level
Expand Down
Loading