Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
LINUX_DO_TOKEN_ENDPOINT=https://connect.linux.do/oauth2/token
LINUX_DO_USER_ENDPOINT=https://connect.linux.do/api/user

# NodeLoc相关配置
NODELOC_TOKEN_ENDPOINT=https://www.nodeloc.com/oauth-provider/token
NODELOC_USER_ENDPOINT=https://www.nodeloc.com/oauth-provider/userinfo

# 节点类型
# 如果是主节点则为master
# NODE_TYPE=master
18 changes: 9 additions & 9 deletions .github/workflows/docker-image-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
calciumion/new-api
nodeloc/new-api
ghcr.io/${{ env.GHCR_REPOSITORY }}

- name: Build & push single-arch (to both registries)
Expand All @@ -76,8 +76,8 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: |
calciumion/new-api:alpha-${{ matrix.arch }}
calciumion/new-api:${{ steps.version.outputs.value }}-${{ matrix.arch }}
nodeloc/new-api:alpha-${{ matrix.arch }}
nodeloc/new-api:${{ steps.version.outputs.value }}-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:alpha-${{ matrix.arch }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ steps.version.outputs.value }}-${{ matrix.arch }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down Expand Up @@ -118,16 +118,16 @@ jobs:
- name: Create & push manifest (Docker Hub - alpha)
run: |
docker buildx imagetools create \
-t calciumion/new-api:alpha \
calciumion/new-api:alpha-amd64 \
calciumion/new-api:alpha-arm64
-t nodeloc/new-api:alpha \
nodeloc/new-api:alpha-amd64 \
nodeloc/new-api:alpha-arm64

- name: Create & push manifest (Docker Hub - versioned alpha)
run: |
docker buildx imagetools create \
-t calciumion/new-api:${VERSION} \
calciumion/new-api:${VERSION}-amd64 \
calciumion/new-api:${VERSION}-arm64
-t nodeloc/new-api:${VERSION} \
nodeloc/new-api:${VERSION}-amd64 \
nodeloc/new-api:${VERSION}-arm64

- name: Log in to GHCR
uses: docker/login-action@v3
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/docker-image-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
calciumion/new-api
nodeloc/new-api
# ghcr.io/${{ env.GHCR_REPOSITORY }}

- name: Build & push single-arch (to both registries)
Expand All @@ -73,8 +73,8 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: |
calciumion/new-api:${{ env.TAG }}-${{ matrix.arch }}
calciumion/new-api:latest-${{ matrix.arch }}
nodeloc/new-api:${{ env.TAG }}-${{ matrix.arch }}
nodeloc/new-api:latest-${{ matrix.arch }}
# ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}-${{ matrix.arch }}
# ghcr.io/${{ env.GHCR_REPOSITORY }}:latest-${{ matrix.arch }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down Expand Up @@ -104,16 +104,16 @@ jobs:
- name: Create & push manifest (Docker Hub - version)
run: |
docker buildx imagetools create \
-t calciumion/new-api:${TAG} \
calciumion/new-api:${TAG}-amd64 \
calciumion/new-api:${TAG}-arm64
-t nodeloc/new-api:${TAG} \
nodeloc/new-api:${TAG}-amd64 \
nodeloc/new-api:${TAG}-arm64

- name: Create & push manifest (Docker Hub - latest)
run: |
docker buildx imagetools create \
-t calciumion/new-api:latest \
calciumion/new-api:latest-amd64 \
calciumion/new-api:latest-arm64
-t nodeloc/new-api:latest \
nodeloc/new-api:latest-amd64 \
nodeloc/new-api:latest-arm64

# ---- GHCR ----
# - name: Log in to GHCR
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.3
4 changes: 4 additions & 0 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var PasswordRegisterEnabled = true
var EmailVerificationEnabled = false
var GitHubOAuthEnabled = false
var LinuxDOOAuthEnabled = false
var NodeLocOAuthEnabled = false
var WeChatAuthEnabled = false
var TelegramOAuthEnabled = false
var TurnstileCheckEnabled = false
Expand Down Expand Up @@ -85,6 +86,9 @@ var GitHubClientSecret = ""
var LinuxDOClientId = ""
var LinuxDOClientSecret = ""
var LinuxDOMinimumTrustLevel = 0
var NodeLocClientId = ""
var NodeLocClientSecret = ""
var NodeLocMinimumTrustLevel = 0

var WeChatServerAddress = ""
var WeChatServerToken = ""
Expand Down
29 changes: 15 additions & 14 deletions controller/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,21 @@ func GetStatus(c *gin.Context) {
"discord_client_id": system_setting.GetDiscordSettings().ClientId,
"linuxdo_oauth": common.LinuxDOOAuthEnabled,
"linuxdo_client_id": common.LinuxDOClientId,
"linuxdo_minimum_trust_level": common.LinuxDOMinimumTrustLevel,
"telegram_oauth": common.TelegramOAuthEnabled,
"telegram_bot_name": common.TelegramBotName,
"system_name": common.SystemName,
"logo": common.Logo,
"footer_html": common.Footer,
"wechat_qrcode": common.WeChatAccountQRCodeImageURL,
"wechat_login": common.WeChatAuthEnabled,
"server_address": system_setting.ServerAddress,
"turnstile_check": common.TurnstileCheckEnabled,
"turnstile_site_key": common.TurnstileSiteKey,
"top_up_link": common.TopUpLink,
"docs_link": operation_setting.GetGeneralSetting().DocsLink,
"quota_per_unit": common.QuotaPerUnit,
"linuxdo_minimum_trust_level": common.LinuxDOMinimumTrustLevel, "nodeloc_oauth": common.NodeLocOAuthEnabled,
"nodeloc_client_id": common.NodeLocClientId,
"nodeloc_minimum_trust_level": common.NodeLocMinimumTrustLevel, "telegram_oauth": common.TelegramOAuthEnabled,
"telegram_bot_name": common.TelegramBotName,
"system_name": common.SystemName,
"logo": common.Logo,
"footer_html": common.Footer,
"wechat_qrcode": common.WeChatAccountQRCodeImageURL,
"wechat_login": common.WeChatAuthEnabled,
"server_address": system_setting.ServerAddress,
"turnstile_check": common.TurnstileCheckEnabled,
"turnstile_site_key": common.TurnstileSiteKey,
"top_up_link": common.TopUpLink,
"docs_link": operation_setting.GetGeneralSetting().DocsLink,
"quota_per_unit": common.QuotaPerUnit,
// 兼容旧前端:保留 display_in_currency,同时提供新的 quota_display_type
"display_in_currency": operation_setting.IsCurrencyDisplay(),
"quota_display_type": operation_setting.GetQuotaDisplayType(),
Expand Down
Loading