Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
console
Commits
330faac5
Commit
330faac5
authored
Jul 25, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add cdnUrLCn
parent
955068fb
Pipeline
#39492
passed with stages
in 3 minutes and 42 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
console-api/src/s3/s3.service.ts
console-api/src/s3/s3.service.ts
+1
-0
console-api/src/update/update.service.ts
console-api/src/update/update.service.ts
+6
-7
No files found.
console-api/src/s3/s3.service.ts
View file @
330faac5
...
@@ -41,6 +41,7 @@ export class S3Service extends ConsoleLogger {
...
@@ -41,6 +41,7 @@ export class S3Service extends ConsoleLogger {
public
readonly
cdnUrl
=
public
readonly
cdnUrl
=
this
.
getConfig
(
'
S3_CDN_URL
'
)
||
`
${
this
.
getConfig
(
'
S3_ENDPOINT
'
)}
/
${
this
.
bucket
}${
this
.
prefix
?
`/
${
this
.
prefix
}
`
:
''
}
`
;
this
.
getConfig
(
'
S3_CDN_URL
'
)
||
`
${
this
.
getConfig
(
'
S3_ENDPOINT
'
)}
/
${
this
.
bucket
}${
this
.
prefix
?
`/
${
this
.
prefix
}
`
:
''
}
`
;
public
readonly
cdnUrlOversize
=
this
.
getConfig
(
'
S3_CDN_URL_OVERSIZE
'
)
||
this
.
cdnUrl
;
public
readonly
cdnUrlOversize
=
this
.
getConfig
(
'
S3_CDN_URL_OVERSIZE
'
)
||
this
.
cdnUrl
;
public
readonly
cdNUrlCn
=
this
.
getConfig
(
'
S3_CDN_URL_CN
'
)
||
this
.
cdnUrl
;
private
readonly
s3Config
:
S3ClientConfig
=
{
private
readonly
s3Config
:
S3ClientConfig
=
{
credentials
:
{
credentials
:
{
accessKeyId
:
this
.
getConfig
(
'
S3_KEY
'
),
accessKeyId
:
this
.
getConfig
(
'
S3_KEY
'
),
...
...
console-api/src/update/update.service.ts
View file @
330faac5
...
@@ -16,18 +16,17 @@ import { ChnrouteService } from '../chnroute/chnroute.service';
...
@@ -16,18 +16,17 @@ import { ChnrouteService } from '../chnroute/chnroute.service';
@
Injectable
()
@
Injectable
()
export
class
UpdateService
extends
ConsoleLogger
{
export
class
UpdateService
extends
ConsoleLogger
{
private
readonly
cdnUrl
:
string
;
private
readonly
cdnUrl
=
this
.
packageS3
.
cdnUrl
;
private
readonly
cdnUrlOversize
:
string
;
private
readonly
cdnUrlOversize
=
this
.
packageS3
.
cdnUrlOversize
;
private
readonly
cdNUrlCn
=
this
.
packageS3
.
cdNUrlCn
;
constructor
(
constructor
(
@
InjectConnection
(
'
app
'
)
@
InjectConnection
(
'
app
'
)
private
db
:
Connection
,
private
db
:
Connection
,
packageS3
:
PackageS3Service
,
p
rivate
p
ackageS3
:
PackageS3Service
,
private
mirror
:
MirrorService
,
private
mirror
:
MirrorService
,
private
chnroute
:
ChnrouteService
private
chnroute
:
ChnrouteService
)
{
)
{
super
(
'
update
'
);
super
(
'
update
'
);
this
.
cdnUrl
=
packageS3
.
cdnUrl
;
this
.
cdnUrlOversize
=
packageS3
.
cdnUrlOversize
;
}
}
async
getAppsJson
()
{
async
getAppsJson
()
{
...
@@ -146,8 +145,8 @@ export class UpdateService extends ConsoleLogger {
...
@@ -146,8 +145,8 @@ export class UpdateService extends ConsoleLogger {
private
async
prepareUrl
(
archives
:
Archive
[],
ip
:
string
)
{
private
async
prepareUrl
(
archives
:
Archive
[],
ip
:
string
)
{
await
this
.
mirror
.
lookForArchivesMirror
(
archives
,
ip
);
await
this
.
mirror
.
lookForArchivesMirror
(
archives
,
ip
);
//
const isChina = this.chnroute.isChina(ip);
const
isChina
=
this
.
chnroute
.
isChina
(
ip
);
archives
.
forEach
((
a
)
=>
a
.
fillUrl
(
this
.
cdnUrl
,
this
.
cdnUrlOversize
,
false
));
archives
.
forEach
((
a
)
=>
a
.
fillUrl
(
isChina
?
this
.
cdNUrlCn
:
this
.
cdnUrl
,
this
.
cdnUrlOversize
,
false
));
return
archives
;
return
archives
;
}
}
...
...
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