Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
browser-backend
Commits
235c5a35
Commit
235c5a35
authored
Dec 25, 2024
by
jinliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update userdata for windows
parent
972d4f23
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
20 deletions
+22
-20
AliEcsRemoteClient.java
...dgec/browserbackend/common/client/AliEcsRemoteClient.java
+22
-20
No files found.
src/main/java/com/edgec/browserbackend/common/client/AliEcsRemoteClient.java
View file @
235c5a35
...
@@ -47,26 +47,28 @@ public class AliEcsRemoteClient {
...
@@ -47,26 +47,28 @@ public class AliEcsRemoteClient {
// PowerShell UserData for Windows ECS
// PowerShell UserData for Windows ECS
private
static
String
getUserData
()
{
private
static
String
getUserData
()
{
return
"$script = @\"\n"
return
"[bat] \n"
+
"Set-ExecutionPolicy Bypass -Scope Process -Force;\n"
+
"rem Set Execution Policy (Note: Batch doesn't directly support this) \n"
+
"$ErrorActionPreference = 'Stop';\n"
+
"rem Set-ExecutionPolicy Bypass -Scope Process -Force; \n"
+
"# Configure 3proxy\n"
+
"rem The above line is not needed in batch since it can be controlled from the PowerShell session itself \n"
+
"$configContent = @\"\n"
+
"users %s:CL:%s\n"
+
"rem Set error action preference \n"
+
"allow %s *\n"
+
"set ErrorActionPreference=Stop \n"
+
"auth strong\n"
+
"proxy -p8880\n"
+
"rem Configure 3proxy settings \n"
+
"proxy -p8881 -a\n"
+
"echo users %s:CL:%s > C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg \n"
+
"socks -p8882\n"
+
"echo allow %s * >> C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg \n"
+
"flush\n"
+
"echo auth strong >> C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg \n"
+
"\";\n"
+
"echo proxy -p8880 >> C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg \n"
+
"Set-Content -Path 'C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg' -Value $configContent -Force;\n"
+
"echo proxy -p8881 -a >> C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg \n"
+
"\n"
+
"echo socks -p8882 >> C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg \n"
+
"# Start 3proxy service\n"
+
"echo flush >> C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg \n"
+
"Start-Process 'net' -ArgumentList 'start 3proxy' -NoNewWindow -Wait;\n"
+
"\"@;\n"
+
"rem Start the 3proxy service \n"
+
"$script | Out-File -FilePath 'C:\\Windows\\Temp\\userdata.ps1' -Force;\n"
+
"net start 3proxy \n"
+
"Start-Process PowerShell -ArgumentList 'C:\\Windows\\Temp\\userdata.ps1' -NoNewWindow -Wait;"
;
+
"rem End script \n"
+
"exit \n"
;
}
}
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment