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
972d4f23
Commit
972d4f23
authored
Dec 25, 2024
by
jinliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add vps feature
parent
c04edc45
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
15 deletions
+31
-15
scp-staging-server.sh
scp-staging-server.sh
+3
-0
Vendor.java
.../java/com/edgec/browserbackend/browser/domain/Vendor.java
+1
-0
BrowserTask.java
...va/com/edgec/browserbackend/browser/task/BrowserTask.java
+2
-2
AliEcsRemoteClient.java
...dgec/browserbackend/common/client/AliEcsRemoteClient.java
+24
-12
RegionMappingEnum.java
.../edgec/browserbackend/common/enums/RegionMappingEnum.java
+1
-1
No files found.
scp-staging-server.sh
0 → 100755
View file @
972d4f23
scp ./target/browser-backend-0.0.1-SNAPSHOT.jar root@47.119.25.86:/opt/project/
# pwd: i54EDNbD#ehbnl$4
src/main/java/com/edgec/browserbackend/browser/domain/Vendor.java
View file @
972d4f23
...
@@ -16,6 +16,7 @@ public enum Vendor {
...
@@ -16,6 +16,7 @@ public enum Vendor {
awscn
(
"亚马逊中国"
),
awscn
(
"亚马逊中国"
),
tencent
(
"腾讯云"
),
tencent
(
"腾讯云"
),
isp
(
"住宅"
),
isp
(
"住宅"
),
remote
(
"远程设备"
),
/**
/**
* 本地ip,即 ip 地址没有设置任何代理
* 本地ip,即 ip 地址没有设置任何代理
...
...
src/main/java/com/edgec/browserbackend/browser/task/BrowserTask.java
View file @
972d4f23
...
@@ -303,7 +303,7 @@ public class BrowserTask {
...
@@ -303,7 +303,7 @@ public class BrowserTask {
return
;
return
;
}
}
CloudPlatformConfig
config
=
cloudPlatformConfigRepository
.
findByPlatformAndRegionId
(
CloudPlatformConfig
config
=
cloudPlatformConfigRepository
.
findByPlatformAndRegionId
(
"
ali
"
,
"
remote
"
,
aliRegion
);
aliRegion
);
if
(
Objects
.
isNull
(
config
))
{
if
(
Objects
.
isNull
(
config
))
{
log
.
error
(
log
.
error
(
...
@@ -766,7 +766,7 @@ public class BrowserTask {
...
@@ -766,7 +766,7 @@ public class BrowserTask {
cloudPlatformOrder
.
getPlatformOrderId
(),
cloudPlatformOrder
.
getPlatformOrderId
(),
cloudPlatformOrder
.
getRegionId
());
cloudPlatformOrder
.
getRegionId
());
CloudPlatformConfig
config
=
cloudPlatformConfigRepository
.
findByPlatformAndRegionId
(
CloudPlatformConfig
config
=
cloudPlatformConfigRepository
.
findByPlatformAndRegionId
(
"
ali
"
,
"
remote
"
,
cloudPlatformOrder
.
getRegionId
());
cloudPlatformOrder
.
getRegionId
());
RunInstancesResponse
response1
=
AliEcsRemoteClient
.
runInstances
(
RunInstancesResponse
response1
=
AliEcsRemoteClient
.
runInstances
(
ipResource
.
getOwner
(),
ipResource
.
getUsername
(),
ipResource
.
getOwner
(),
ipResource
.
getUsername
(),
...
...
src/main/java/com/edgec/browserbackend/common/client/AliEcsRemoteClient.java
View file @
972d4f23
...
@@ -35,28 +35,40 @@ public class AliEcsRemoteClient {
...
@@ -35,28 +35,40 @@ public class AliEcsRemoteClient {
//access_key_id
//access_key_id
private
static
String
getAccessKeyId
()
{
private
static
String
getAccessKeyId
()
{
return
"LTAI5t
Edz1DY4A4oYUawUuNH
"
;
return
"LTAI5t
KAfESNNtYqtnE3FRvf
"
;
}
}
//access_key_secret
//access_key_secret
private
static
String
getAccessKeySecret
()
{
private
static
String
getAccessKeySecret
()
{
return
"
8KWmYgO0QIicZpyulhEwUhZqStrTwe
"
;
return
"
mcYJAxCHqMAWKRlY3dZs55AUqOpXIb
"
;
}
}
//launch_template_id
//launch_template_id
//
脚本userData
//
PowerShell UserData for Windows ECS
private
static
String
getUserData
()
{
private
static
String
getUserData
()
{
return
"#!/bin/sh\n"
return
"$script = @\"\n"
+
"echo \"users %s:CL:%s\n"
+
"Set-ExecutionPolicy Bypass -Scope Process -Force;\n"
+
"allow %s *\n"
+
"$ErrorActionPreference = 'Stop';\n"
+
"auth strong\n"
+
"# Configure 3proxy\n"
+
"proxy -p8880\n"
+
"$configContent = @\"\n"
+
"proxy -p8881 -a\n"
+
"users %s:CL:%s\n"
+
"socks -p8882\n"
+
"allow %s *\n"
+
"flush\" | tee /etc/3proxy.cfg\n"
+
"auth strong\n"
+
"systemctl restart 3proxy"
;
+
"proxy -p8880\n"
+
"proxy -p8881 -a\n"
+
"socks -p8882\n"
+
"flush\n"
+
"\";\n"
+
"Set-Content -Path 'C:\\3proxy-0.9.4-x64\\bin64\\3proxy.cfg' -Value $configContent -Force;\n"
+
"\n"
+
"# Start 3proxy service\n"
+
"Start-Process 'net' -ArgumentList 'start 3proxy' -NoNewWindow -Wait;\n"
+
"\"@;\n"
+
"$script | Out-File -FilePath 'C:\\Windows\\Temp\\userdata.ps1' -Force;\n"
+
"Start-Process PowerShell -ArgumentList 'C:\\Windows\\Temp\\userdata.ps1' -NoNewWindow -Wait;"
;
}
}
/*
/*
* @Description //创建链接
* @Description //创建链接
* @Date 2024/7/25 10:32
* @Date 2024/7/25 10:32
...
...
src/main/java/com/edgec/browserbackend/common/enums/RegionMappingEnum.java
View file @
972d4f23
...
@@ -82,7 +82,7 @@ public enum RegionMappingEnum {
...
@@ -82,7 +82,7 @@ public enum RegionMappingEnum {
Random
random
=
new
Random
();
Random
random
=
new
Random
();
int
randomNumber
=
random
.
nextInt
(
2
);
int
randomNumber
=
random
.
nextInt
(
2
);
if
(
randomNumber
==
0
){
if
(
randomNumber
==
0
){
return
RegionMappingEnum
.
US_CALIFORNIA
;
return
RegionMappingEnum
.
SILICON
;
}
else
{
}
else
{
return
RegionMappingEnum
.
US_VIRGINIA
;
return
RegionMappingEnum
.
US_VIRGINIA
;
}
}
...
...
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