From d05acd804fc57902667067ba0047c9fd63c05867 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 10 Jun 2026 11:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 2 +- NOTICE | 10 ++- internal/apps/admin/auth_source/routers.go | 17 +--- .../apps/admin/auth_source/routers_test.go | 19 +---- internal/apps/admin/errs.go | 19 +---- internal/apps/admin/logs/routers.go | 31 +++----- internal/apps/admin/logs/utils.go | 19 +---- internal/apps/admin/middlewares.go | 19 +---- internal/apps/admin/status/routers.go | 19 +---- internal/apps/admin/system_config/errs.go | 19 +---- internal/apps/admin/system_config/routers.go | 19 +---- .../apps/admin/system_config/routers_test.go | 19 +---- internal/apps/admin/task/errs.go | 19 +---- internal/apps/admin/task/routers.go | 19 +---- internal/apps/admin/task/routers_test.go | 19 +---- internal/apps/admin/template/errs.go | 17 +--- internal/apps/admin/template/routers.go | 17 +--- internal/apps/admin/template/routers_test.go | 17 +--- internal/apps/admin/user/errs.go | 19 +---- internal/apps/admin/user/routers.go | 19 +---- internal/apps/admin/user/routers_test.go | 19 +---- internal/apps/cap/errs.go | 17 +--- internal/apps/cap/middleware.go | 17 +--- internal/apps/cap/routers.go | 17 +--- internal/apps/cap/routers_test.go | 17 +--- internal/apps/config/routers.go | 19 +---- internal/apps/config/routers_test.go | 19 +---- internal/apps/health/routers.go | 19 +---- internal/apps/oauth/audit.go | 19 +---- internal/apps/oauth/constants.go | 19 +---- internal/apps/oauth/errs.go | 19 +---- internal/apps/oauth/middlewares.go | 19 +---- internal/apps/oauth/oauth_test.go | 19 +---- internal/apps/oauth/routers.go | 19 +---- internal/apps/oauth/sources.go | 17 +--- internal/apps/risk_control/logics.go | 17 +--- internal/apps/risk_control/middleware.go | 17 +--- internal/apps/risk_control/middleware_test.go | 17 +--- internal/apps/risk_control/model.go | 17 +--- internal/apps/upload/constants.go | 17 +--- internal/apps/upload/errs.go | 19 +---- internal/apps/upload/file_server.go | 19 +---- internal/apps/upload/routers.go | 19 +---- internal/apps/upload/routers_test.go | 19 +---- internal/apps/upload/tasks.go | 19 +---- internal/apps/upload/tasks_test.go | 19 +---- internal/apps/upload/utils.go | 19 +---- internal/apps/user/access_tokens.go | 19 +---- internal/apps/user/constants.go | 19 +---- internal/apps/user/errs.go | 19 +---- internal/apps/user/logics.go | 17 +--- internal/apps/user/routers.go | 17 +--- internal/apps/user/routers_test.go | 17 +--- internal/apps/user/tasks.go | 19 +---- internal/cmd/all.go | 19 +---- internal/cmd/api.go | 19 +---- internal/cmd/root.go | 19 +---- internal/cmd/scheduler.go | 19 +---- internal/cmd/worker.go | 19 +---- internal/common/constants.go | 19 +---- internal/common/errs.go | 19 +---- internal/config/config.go | 25 ++---- internal/config/model.go | 19 +---- internal/db/clickhouse.go | 23 ++---- internal/db/errs.go | 17 +--- internal/db/idgen/snowflake.go | 19 +---- internal/db/migrator/migrator.go | 19 +---- internal/db/migrator/migrator_test.go | 17 +--- internal/db/postgres.go | 19 +---- internal/db/postgres_logger.go | 19 +---- internal/db/redis.go | 19 +---- internal/logger/errs.go | 17 +--- internal/logger/logger.go | 19 +---- internal/logger/ringbuffer.go | 19 +---- internal/logger/ringbuffer_test.go | 19 +---- internal/logger/utils.go | 19 +---- internal/model/access_token.go | 19 +---- internal/model/auth_source.go | 17 +--- internal/model/errs.go | 17 +--- internal/model/system_configs.go | 19 +---- internal/model/task_execution.go | 19 +---- internal/model/task_execution_test.go | 19 +---- internal/model/templates.go | 17 +--- internal/model/uploads.go | 19 +---- internal/model/users.go | 19 +---- internal/otel_trace/propagator.go | 19 +---- internal/otel_trace/sampler.go | 19 +---- internal/otel_trace/trace.go | 19 +---- internal/otel_trace/trace_provider.go | 19 +---- internal/router/frontend.go | 19 +---- internal/router/frontend_embedded.go | 17 +--- internal/router/middlewares.go | 19 +---- internal/router/router.go | 19 +---- internal/storage/cache.go | 19 +---- internal/storage/errs.go | 17 +--- internal/storage/s3.go | 19 +---- internal/task/constants.go | 21 ++--- internal/task/errs.go | 17 +--- internal/task/executor.go | 19 +---- internal/task/executor_test.go | 19 +---- internal/task/handler.go | 20 +---- internal/task/handlers/register.go | 19 +---- internal/task/scheduler/errs.go | 17 +--- internal/task/scheduler/scheduler.go | 19 +---- internal/task/utils.go | 19 +---- internal/task/worker/middlewares.go | 19 +---- internal/task/worker/worker.go | 19 +---- internal/testhelper/test_helper.go | 19 +---- internal/util/cap/cap.go | 27 ++----- internal/util/cap/cap_test.go | 17 +--- internal/util/cap/errs.go | 17 +--- internal/util/cap/manager.go | 35 +++------ internal/util/cap/prng.go | 17 +--- internal/util/cap/store.go | 17 +--- internal/util/context.go | 19 +---- internal/util/crypto.go | 19 +---- internal/util/custom_types.go | 19 +---- internal/util/errs.go | 17 +--- internal/util/http_clients.go | 19 +---- internal/util/mail/errs.go | 17 +--- internal/util/mail/mail.go | 25 ++---- internal/util/mail/mail_test.go | 19 +---- internal/util/password.go | 17 +--- internal/util/response.go | 19 +---- internal/util/session.go | 19 +---- internal/util/strings.go | 19 +---- internal/util/uuid.go | 19 +---- main.go | 19 +---- scripts/update_go_license.sh | 77 +++++++++++-------- 129 files changed, 424 insertions(+), 2046 deletions(-) diff --git a/LICENSE b/LICENSE index 1b5e2d67..63e3cc2c 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 linux.do + Copyright 2025 Arctel.net Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/NOTICE b/NOTICE index c1f31f91..9401edbb 100644 --- a/NOTICE +++ b/NOTICE @@ -1,7 +1,9 @@ Wavelet -Copyright 2025 linux.do -Modifications Copyright 2026 Arctel.net +This product includes software derived from LinuxDO Credit. -This product includes software originally licensed under the Apache License, -Version 2.0. Portions of this work have been modified by Arctel.net in 2026. +LinuxDO Credit: +Copyright 2025 linux.do +Licensed under the Apache License, Version 2.0. + +This distribution includes modifications by Arctel.net. diff --git a/internal/apps/admin/auth_source/routers.go b/internal/apps/admin/auth_source/routers.go index a00966b3..0f43dac6 100644 --- a/internal/apps/admin/auth_source/routers.go +++ b/internal/apps/admin/auth_source/routers.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package auth_source 提供认证源管理功能 package auth_source diff --git a/internal/apps/admin/auth_source/routers_test.go b/internal/apps/admin/auth_source/routers_test.go index 00e59006..a108c195 100644 --- a/internal/apps/admin/auth_source/routers_test.go +++ b/internal/apps/admin/auth_source/routers_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package auth_source diff --git a/internal/apps/admin/errs.go b/internal/apps/admin/errs.go index cf4db141..8205df62 100644 --- a/internal/apps/admin/errs.go +++ b/internal/apps/admin/errs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package admin 提供管理后台功能 package admin diff --git a/internal/apps/admin/logs/routers.go b/internal/apps/admin/logs/routers.go index 052f16e1..39df5376 100644 --- a/internal/apps/admin/logs/routers.go +++ b/internal/apps/admin/logs/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package logs 提供日志查询与分析功能 package logs @@ -38,12 +25,12 @@ import ( ) const ( - defaultLimit = 200 - maxLimit = 500 - maxPageSize = 100 - hoursInDay = 24 - analyticsDays = 7 - queryExtraArgs = 2 // pageSize + offset + defaultLimit = 200 + maxLimit = 500 + maxPageSize = 100 + hoursInDay = 24 + analyticsDays = 7 + queryExtraArgs = 2 // pageSize + offset ) // logsResponse 历史日志查询响应 diff --git a/internal/apps/admin/logs/utils.go b/internal/apps/admin/logs/utils.go index 2c9e210e..a6371ebd 100644 --- a/internal/apps/admin/logs/utils.go +++ b/internal/apps/admin/logs/utils.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package logs diff --git a/internal/apps/admin/middlewares.go b/internal/apps/admin/middlewares.go index 62f88540..f03af851 100644 --- a/internal/apps/admin/middlewares.go +++ b/internal/apps/admin/middlewares.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package admin diff --git a/internal/apps/admin/status/routers.go b/internal/apps/admin/status/routers.go index 108bc700..617912f2 100644 --- a/internal/apps/admin/status/routers.go +++ b/internal/apps/admin/status/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package status 提供系统状态查询接口 package status diff --git a/internal/apps/admin/system_config/errs.go b/internal/apps/admin/system_config/errs.go index 9b7b5446..408142d3 100644 --- a/internal/apps/admin/system_config/errs.go +++ b/internal/apps/admin/system_config/errs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package system_config 提供系统配置管理功能 package system_config diff --git a/internal/apps/admin/system_config/routers.go b/internal/apps/admin/system_config/routers.go index 12f69a71..f66bf531 100644 --- a/internal/apps/admin/system_config/routers.go +++ b/internal/apps/admin/system_config/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package system_config diff --git a/internal/apps/admin/system_config/routers_test.go b/internal/apps/admin/system_config/routers_test.go index 69a65008..95ecc15b 100644 --- a/internal/apps/admin/system_config/routers_test.go +++ b/internal/apps/admin/system_config/routers_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package system_config diff --git a/internal/apps/admin/task/errs.go b/internal/apps/admin/task/errs.go index 03094ca0..92542746 100644 --- a/internal/apps/admin/task/errs.go +++ b/internal/apps/admin/task/errs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package task 提供任务管理接口 package task diff --git a/internal/apps/admin/task/routers.go b/internal/apps/admin/task/routers.go index 6dc1d786..fa604c9e 100644 --- a/internal/apps/admin/task/routers.go +++ b/internal/apps/admin/task/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package task diff --git a/internal/apps/admin/task/routers_test.go b/internal/apps/admin/task/routers_test.go index 5b9b8edb..b0a54f87 100644 --- a/internal/apps/admin/task/routers_test.go +++ b/internal/apps/admin/task/routers_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package task diff --git a/internal/apps/admin/template/errs.go b/internal/apps/admin/template/errs.go index 5ff787fa..d8dda622 100644 --- a/internal/apps/admin/template/errs.go +++ b/internal/apps/admin/template/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package template 提供模板管理功能 package template diff --git a/internal/apps/admin/template/routers.go b/internal/apps/admin/template/routers.go index 10e64fed..21d7971a 100644 --- a/internal/apps/admin/template/routers.go +++ b/internal/apps/admin/template/routers.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package template diff --git a/internal/apps/admin/template/routers_test.go b/internal/apps/admin/template/routers_test.go index a983fc30..9cc86686 100644 --- a/internal/apps/admin/template/routers_test.go +++ b/internal/apps/admin/template/routers_test.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package template diff --git a/internal/apps/admin/user/errs.go b/internal/apps/admin/user/errs.go index 19d3b7ab..fc1dffb7 100644 --- a/internal/apps/admin/user/errs.go +++ b/internal/apps/admin/user/errs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package user 提供用户管理功能 package user diff --git a/internal/apps/admin/user/routers.go b/internal/apps/admin/user/routers.go index 3247af92..b6289e84 100644 --- a/internal/apps/admin/user/routers.go +++ b/internal/apps/admin/user/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package user diff --git a/internal/apps/admin/user/routers_test.go b/internal/apps/admin/user/routers_test.go index 18fb725c..3590bd06 100644 --- a/internal/apps/admin/user/routers_test.go +++ b/internal/apps/admin/user/routers_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package user diff --git a/internal/apps/cap/errs.go b/internal/apps/cap/errs.go index 2a52506a..98dcf0f5 100644 --- a/internal/apps/cap/errs.go +++ b/internal/apps/cap/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package cap 提供人机验证中间件 package cap diff --git a/internal/apps/cap/middleware.go b/internal/apps/cap/middleware.go index e60231e5..527a4c1c 100644 --- a/internal/apps/cap/middleware.go +++ b/internal/apps/cap/middleware.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cap diff --git a/internal/apps/cap/routers.go b/internal/apps/cap/routers.go index eb096c35..5070975f 100644 --- a/internal/apps/cap/routers.go +++ b/internal/apps/cap/routers.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cap diff --git a/internal/apps/cap/routers_test.go b/internal/apps/cap/routers_test.go index e95dda22..07335a95 100644 --- a/internal/apps/cap/routers_test.go +++ b/internal/apps/cap/routers_test.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cap diff --git a/internal/apps/config/routers.go b/internal/apps/config/routers.go index 07b759eb..12355cd5 100644 --- a/internal/apps/config/routers.go +++ b/internal/apps/config/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package config 提供公开配置查询接口 package config diff --git a/internal/apps/config/routers_test.go b/internal/apps/config/routers_test.go index 030b4538..8e07c64d 100644 --- a/internal/apps/config/routers_test.go +++ b/internal/apps/config/routers_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package config diff --git a/internal/apps/health/routers.go b/internal/apps/health/routers.go index abe131ed..a6ede446 100644 --- a/internal/apps/health/routers.go +++ b/internal/apps/health/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package health 提供健康检查端点 package health diff --git a/internal/apps/oauth/audit.go b/internal/apps/oauth/audit.go index 1df2e2f9..f3f66bd2 100644 --- a/internal/apps/oauth/audit.go +++ b/internal/apps/oauth/audit.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package oauth 提供 OAuth/OIDC 认证与会话管理 package oauth diff --git a/internal/apps/oauth/constants.go b/internal/apps/oauth/constants.go index 4311e6e7..705a64be 100644 --- a/internal/apps/oauth/constants.go +++ b/internal/apps/oauth/constants.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package oauth diff --git a/internal/apps/oauth/errs.go b/internal/apps/oauth/errs.go index d4071f1c..31493ef9 100644 --- a/internal/apps/oauth/errs.go +++ b/internal/apps/oauth/errs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package oauth diff --git a/internal/apps/oauth/middlewares.go b/internal/apps/oauth/middlewares.go index d0a180f7..93941e56 100644 --- a/internal/apps/oauth/middlewares.go +++ b/internal/apps/oauth/middlewares.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package oauth diff --git a/internal/apps/oauth/oauth_test.go b/internal/apps/oauth/oauth_test.go index 142df680..5dcebee3 100644 --- a/internal/apps/oauth/oauth_test.go +++ b/internal/apps/oauth/oauth_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package oauth diff --git a/internal/apps/oauth/routers.go b/internal/apps/oauth/routers.go index e5e95678..8882d4e9 100644 --- a/internal/apps/oauth/routers.go +++ b/internal/apps/oauth/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package oauth diff --git a/internal/apps/oauth/sources.go b/internal/apps/oauth/sources.go index 7a645907..69042013 100644 --- a/internal/apps/oauth/sources.go +++ b/internal/apps/oauth/sources.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package oauth diff --git a/internal/apps/risk_control/logics.go b/internal/apps/risk_control/logics.go index 56bf445f..d1ef4d1f 100644 --- a/internal/apps/risk_control/logics.go +++ b/internal/apps/risk_control/logics.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package risk_control diff --git a/internal/apps/risk_control/middleware.go b/internal/apps/risk_control/middleware.go index 596f8755..010e1320 100644 --- a/internal/apps/risk_control/middleware.go +++ b/internal/apps/risk_control/middleware.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package risk_control 提供风险控制中间件 package risk_control diff --git a/internal/apps/risk_control/middleware_test.go b/internal/apps/risk_control/middleware_test.go index 7dfa68dd..b4f5652a 100644 --- a/internal/apps/risk_control/middleware_test.go +++ b/internal/apps/risk_control/middleware_test.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package risk_control diff --git a/internal/apps/risk_control/model.go b/internal/apps/risk_control/model.go index 5ca2ff19..728d7f6a 100644 --- a/internal/apps/risk_control/model.go +++ b/internal/apps/risk_control/model.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package risk_control diff --git a/internal/apps/upload/constants.go b/internal/apps/upload/constants.go index 370aeae0..ad1c41f3 100644 --- a/internal/apps/upload/constants.go +++ b/internal/apps/upload/constants.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package upload diff --git a/internal/apps/upload/errs.go b/internal/apps/upload/errs.go index f4687fe2..7bd57f2e 100644 --- a/internal/apps/upload/errs.go +++ b/internal/apps/upload/errs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package upload 提供文件上传与下载功能 package upload diff --git a/internal/apps/upload/file_server.go b/internal/apps/upload/file_server.go index b3d16a33..86bfa095 100644 --- a/internal/apps/upload/file_server.go +++ b/internal/apps/upload/file_server.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package upload diff --git a/internal/apps/upload/routers.go b/internal/apps/upload/routers.go index b8292525..e9549b0a 100644 --- a/internal/apps/upload/routers.go +++ b/internal/apps/upload/routers.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package upload diff --git a/internal/apps/upload/routers_test.go b/internal/apps/upload/routers_test.go index a3b34952..16b4b0d9 100644 --- a/internal/apps/upload/routers_test.go +++ b/internal/apps/upload/routers_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package upload diff --git a/internal/apps/upload/tasks.go b/internal/apps/upload/tasks.go index 7a5590cb..a9079074 100644 --- a/internal/apps/upload/tasks.go +++ b/internal/apps/upload/tasks.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package upload diff --git a/internal/apps/upload/tasks_test.go b/internal/apps/upload/tasks_test.go index 624ed080..bb3c8cd9 100644 --- a/internal/apps/upload/tasks_test.go +++ b/internal/apps/upload/tasks_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package upload diff --git a/internal/apps/upload/utils.go b/internal/apps/upload/utils.go index 4e74106b..6f38abc9 100644 --- a/internal/apps/upload/utils.go +++ b/internal/apps/upload/utils.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package upload diff --git a/internal/apps/user/access_tokens.go b/internal/apps/user/access_tokens.go index 7917dcde..c3d0415e 100644 --- a/internal/apps/user/access_tokens.go +++ b/internal/apps/user/access_tokens.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package user 提供用户认证与帐户管理功能 package user diff --git a/internal/apps/user/constants.go b/internal/apps/user/constants.go index 13a2f8b7..b3851f5b 100644 --- a/internal/apps/user/constants.go +++ b/internal/apps/user/constants.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package user diff --git a/internal/apps/user/errs.go b/internal/apps/user/errs.go index 059a9c3c..006e1874 100644 --- a/internal/apps/user/errs.go +++ b/internal/apps/user/errs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package user diff --git a/internal/apps/user/logics.go b/internal/apps/user/logics.go index d51cfbb1..2fb42954 100644 --- a/internal/apps/user/logics.go +++ b/internal/apps/user/logics.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package user diff --git a/internal/apps/user/routers.go b/internal/apps/user/routers.go index fe3d10c7..0e4f0d73 100644 --- a/internal/apps/user/routers.go +++ b/internal/apps/user/routers.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package user diff --git a/internal/apps/user/routers_test.go b/internal/apps/user/routers_test.go index 363a112e..50d46b7e 100644 --- a/internal/apps/user/routers_test.go +++ b/internal/apps/user/routers_test.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package user diff --git a/internal/apps/user/tasks.go b/internal/apps/user/tasks.go index e43b882d..efb3a149 100644 --- a/internal/apps/user/tasks.go +++ b/internal/apps/user/tasks.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package user diff --git a/internal/cmd/all.go b/internal/cmd/all.go index 1085c3c2..10dde12b 100644 --- a/internal/cmd/all.go +++ b/internal/cmd/all.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package cmd 提供 CLI 命令入口 package cmd diff --git a/internal/cmd/api.go b/internal/cmd/api.go index 229d90af..e4b745f0 100644 --- a/internal/cmd/api.go +++ b/internal/cmd/api.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cmd diff --git a/internal/cmd/root.go b/internal/cmd/root.go index dd33dc97..c90760c1 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cmd diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index 4a186080..48795533 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cmd diff --git a/internal/cmd/worker.go b/internal/cmd/worker.go index a36a872b..61f9d608 100644 --- a/internal/cmd/worker.go +++ b/internal/cmd/worker.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cmd diff --git a/internal/common/constants.go b/internal/common/constants.go index f614ed37..f317898a 100644 --- a/internal/common/constants.go +++ b/internal/common/constants.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package common 提供跨模块共享的常量、错误定义和通用工具函数。 package common diff --git a/internal/common/errs.go b/internal/common/errs.go index b3d6712d..20d9a8b1 100644 --- a/internal/common/errs.go +++ b/internal/common/errs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package common diff --git a/internal/config/config.go b/internal/config/config.go index 28f3e85b..a8d66241 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package config 负责应用配置的加载、解析与环境变量覆盖。 package config @@ -31,9 +18,9 @@ import ( // 默认队列优先级 const ( - webhookQueuePriority = 10 - whitelistQueuePriority = 5 - defaultQueuePriority = 3 + webhookQueuePriority = 10 + whitelistQueuePriority = 5 + defaultQueuePriority = 3 ) // Config 全局配置单例,初始化后不可变 diff --git a/internal/config/model.go b/internal/config/model.go index 7f8934d6..e9ada88e 100644 --- a/internal/config/model.go +++ b/internal/config/model.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package config diff --git a/internal/db/clickhouse.go b/internal/db/clickhouse.go index ec4a1ec7..b8783efb 100644 --- a/internal/db/clickhouse.go +++ b/internal/db/clickhouse.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package db 提供数据库连接与基础设施 package db @@ -29,8 +16,8 @@ import ( ) const ( - clickhouseMaxExecTime = 60 // ClickHouse 最大执行时间(秒) - clickhouseReadTimeoutFactor = 2 // ReadTimeout 为 DialTimeout 的倍数 + clickhouseMaxExecTime = 60 // ClickHouse 最大执行时间(秒) + clickhouseReadTimeoutFactor = 2 // ReadTimeout 为 DialTimeout 的倍数 ) var ( diff --git a/internal/db/errs.go b/internal/db/errs.go index b7c1f624..8d8e3f61 100644 --- a/internal/db/errs.go +++ b/internal/db/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package db diff --git a/internal/db/idgen/snowflake.go b/internal/db/idgen/snowflake.go index ddef14c7..51ceb053 100644 --- a/internal/db/idgen/snowflake.go +++ b/internal/db/idgen/snowflake.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package idgen 提供分布式 ID 生成器 package idgen diff --git a/internal/db/migrator/migrator.go b/internal/db/migrator/migrator.go index 0027417a..48244e99 100644 --- a/internal/db/migrator/migrator.go +++ b/internal/db/migrator/migrator.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package migrator 提供数据库迁移功能 package migrator diff --git a/internal/db/migrator/migrator_test.go b/internal/db/migrator/migrator_test.go index 525328ca..f57e1bd1 100644 --- a/internal/db/migrator/migrator_test.go +++ b/internal/db/migrator/migrator_test.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package migrator diff --git a/internal/db/postgres.go b/internal/db/postgres.go index 954900d8..70a93c3a 100644 --- a/internal/db/postgres.go +++ b/internal/db/postgres.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package db diff --git a/internal/db/postgres_logger.go b/internal/db/postgres_logger.go index ca880ada..c5314c26 100644 --- a/internal/db/postgres_logger.go +++ b/internal/db/postgres_logger.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package db diff --git a/internal/db/redis.go b/internal/db/redis.go index 74ddd9a1..f28bd01d 100644 --- a/internal/db/redis.go +++ b/internal/db/redis.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package db diff --git a/internal/logger/errs.go b/internal/logger/errs.go index 075690fb..e9fd7b54 100644 --- a/internal/logger/errs.go +++ b/internal/logger/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package logger 提供结构化日志封装 package logger diff --git a/internal/logger/logger.go b/internal/logger/logger.go index 51e4c577..21abda16 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package logger diff --git a/internal/logger/ringbuffer.go b/internal/logger/ringbuffer.go index f9e9c1cf..71a77f37 100644 --- a/internal/logger/ringbuffer.go +++ b/internal/logger/ringbuffer.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package logger diff --git a/internal/logger/ringbuffer_test.go b/internal/logger/ringbuffer_test.go index 67b7c43c..f3c7e787 100644 --- a/internal/logger/ringbuffer_test.go +++ b/internal/logger/ringbuffer_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package logger diff --git a/internal/logger/utils.go b/internal/logger/utils.go index 0e6b8738..7d5d0e9a 100644 --- a/internal/logger/utils.go +++ b/internal/logger/utils.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package logger diff --git a/internal/model/access_token.go b/internal/model/access_token.go index 8a8ffc9d..f98af807 100644 --- a/internal/model/access_token.go +++ b/internal/model/access_token.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package model 定义数据模型与 GORM 实体 package model diff --git a/internal/model/auth_source.go b/internal/model/auth_source.go index 3d2a6639..95687e99 100644 --- a/internal/model/auth_source.go +++ b/internal/model/auth_source.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package model diff --git a/internal/model/errs.go b/internal/model/errs.go index 83aa71c6..d72a5b1d 100644 --- a/internal/model/errs.go +++ b/internal/model/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package model diff --git a/internal/model/system_configs.go b/internal/model/system_configs.go index 7528263e..0e6c3dc3 100644 --- a/internal/model/system_configs.go +++ b/internal/model/system_configs.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package model diff --git a/internal/model/task_execution.go b/internal/model/task_execution.go index 5e2c4fbd..c6d5fa05 100644 --- a/internal/model/task_execution.go +++ b/internal/model/task_execution.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package model diff --git a/internal/model/task_execution_test.go b/internal/model/task_execution_test.go index c21da2aa..a7a08e95 100644 --- a/internal/model/task_execution_test.go +++ b/internal/model/task_execution_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package model diff --git a/internal/model/templates.go b/internal/model/templates.go index ed5ffaee..82bbd760 100644 --- a/internal/model/templates.go +++ b/internal/model/templates.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package model diff --git a/internal/model/uploads.go b/internal/model/uploads.go index e69ca252..480a8b17 100644 --- a/internal/model/uploads.go +++ b/internal/model/uploads.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package model diff --git a/internal/model/users.go b/internal/model/users.go index 3a521388..27d16675 100644 --- a/internal/model/users.go +++ b/internal/model/users.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package model diff --git a/internal/otel_trace/propagator.go b/internal/otel_trace/propagator.go index daa20e8d..27fa4d19 100644 --- a/internal/otel_trace/propagator.go +++ b/internal/otel_trace/propagator.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package otel_trace 提供 OpenTelemetry 链路追踪封装工具 package otel_trace diff --git a/internal/otel_trace/sampler.go b/internal/otel_trace/sampler.go index b02290d2..b3912f1b 100644 --- a/internal/otel_trace/sampler.go +++ b/internal/otel_trace/sampler.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package otel_trace diff --git a/internal/otel_trace/trace.go b/internal/otel_trace/trace.go index 95fc654e..2139a8f1 100644 --- a/internal/otel_trace/trace.go +++ b/internal/otel_trace/trace.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package otel_trace diff --git a/internal/otel_trace/trace_provider.go b/internal/otel_trace/trace_provider.go index 8a106552..a373c5b2 100644 --- a/internal/otel_trace/trace_provider.go +++ b/internal/otel_trace/trace_provider.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package otel_trace diff --git a/internal/router/frontend.go b/internal/router/frontend.go index b1bf08a8..7edeaa1b 100644 --- a/internal/router/frontend.go +++ b/internal/router/frontend.go @@ -1,21 +1,8 @@ //go:build !embed_frontend -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package router 提供 HTTP 路由注册与服务启动 package router diff --git a/internal/router/frontend_embedded.go b/internal/router/frontend_embedded.go index 657dbf60..4c4f81ee 100644 --- a/internal/router/frontend_embedded.go +++ b/internal/router/frontend_embedded.go @@ -1,20 +1,7 @@ //go:build embed_frontend -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package router diff --git a/internal/router/middlewares.go b/internal/router/middlewares.go index e44afc35..a6aea931 100644 --- a/internal/router/middlewares.go +++ b/internal/router/middlewares.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package router diff --git a/internal/router/router.go b/internal/router/router.go index 9a1586db..48edf444 100644 --- a/internal/router/router.go +++ b/internal/router/router.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package router diff --git a/internal/storage/cache.go b/internal/storage/cache.go index 8eabd01c..2d011db7 100644 --- a/internal/storage/cache.go +++ b/internal/storage/cache.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package storage diff --git a/internal/storage/errs.go b/internal/storage/errs.go index e9240506..4a72d5d5 100644 --- a/internal/storage/errs.go +++ b/internal/storage/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package storage 提供文件存储抽象层,包括 S3 兼容存储和本地缓存。 package storage diff --git a/internal/storage/s3.go b/internal/storage/s3.go index 2c57c47d..787cd7c8 100644 --- a/internal/storage/s3.go +++ b/internal/storage/s3.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package storage diff --git a/internal/task/constants.go b/internal/task/constants.go index ff6196af..d370c06f 100644 --- a/internal/task/constants.go +++ b/internal/task/constants.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package task 定义异步任务类型与调度常量 package task @@ -39,6 +26,7 @@ const ( const defaultMaxRetry = 3 // TaskParam 任务参数定义 +// //nolint:revive // TaskParam 保留完整名称以避免与通用 Param 混淆 type TaskParam struct { Name string `json:"Name"` // 参数键名 @@ -50,6 +38,7 @@ type TaskParam struct { } // TaskMeta 任务元数据 +// //nolint:revive // TaskMeta 保留完整名称以避免与通用 Meta 混淆 type TaskMeta struct { Type string diff --git a/internal/task/errs.go b/internal/task/errs.go index 153cd998..6e020ef3 100644 --- a/internal/task/errs.go +++ b/internal/task/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package task diff --git a/internal/task/executor.go b/internal/task/executor.go index 2e6bb852..b3449e21 100644 --- a/internal/task/executor.go +++ b/internal/task/executor.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package task diff --git a/internal/task/executor_test.go b/internal/task/executor_test.go index b9484872..0691f87d 100644 --- a/internal/task/executor_test.go +++ b/internal/task/executor_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package task diff --git a/internal/task/handler.go b/internal/task/handler.go index a368cbb3..2b9c628d 100644 --- a/internal/task/handler.go +++ b/internal/task/handler.go @@ -1,25 +1,13 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package task import "context" // TaskResult 任务执行结果 +// //nolint:revive // TaskResult 保留完整名称以避免与通用 Result 混淆 type TaskResult struct { Message string // 结果摘要,如 "共清理 120 个文件,耗时 3.2s" diff --git a/internal/task/handlers/register.go b/internal/task/handlers/register.go index 0ee9f4b5..94101cde 100644 --- a/internal/task/handlers/register.go +++ b/internal/task/handlers/register.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package handlers 注册异步任务处理器 package handlers diff --git a/internal/task/scheduler/errs.go b/internal/task/scheduler/errs.go index b2b8f858..ccb41465 100644 --- a/internal/task/scheduler/errs.go +++ b/internal/task/scheduler/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package scheduler 提供定时任务调度功能 package scheduler diff --git a/internal/task/scheduler/scheduler.go b/internal/task/scheduler/scheduler.go index 59bf82a4..c0b51c7e 100644 --- a/internal/task/scheduler/scheduler.go +++ b/internal/task/scheduler/scheduler.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package scheduler diff --git a/internal/task/utils.go b/internal/task/utils.go index 7ca88f49..bd8d004a 100644 --- a/internal/task/utils.go +++ b/internal/task/utils.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package task diff --git a/internal/task/worker/middlewares.go b/internal/task/worker/middlewares.go index a37dd8ec..587bb323 100644 --- a/internal/task/worker/middlewares.go +++ b/internal/task/worker/middlewares.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package worker 提供 Asynq 任务处理服务器与中间件 package worker diff --git a/internal/task/worker/worker.go b/internal/task/worker/worker.go index 7572baa0..7026afd3 100644 --- a/internal/task/worker/worker.go +++ b/internal/task/worker/worker.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package worker diff --git a/internal/testhelper/test_helper.go b/internal/testhelper/test_helper.go index d8cf1055..7a05e240 100644 --- a/internal/testhelper/test_helper.go +++ b/internal/testhelper/test_helper.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package testhelper 提供测试辅助工具 package testhelper diff --git a/internal/util/cap/cap.go b/internal/util/cap/cap.go index 813c9e7f..763046e3 100644 --- a/internal/util/cap/cap.go +++ b/internal/util/cap/cap.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package cap 提供人机验证(CAPTCHA)功能 package cap @@ -32,11 +19,11 @@ import ( const ( jwtHeaderB64 = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" - jwtPartsCount = 3 // JWT 三段结构 - defaultChallengeCount = 50 // 默认 PoW 难题数 - defaultChallengeSize = 32 // 默认盐值长度 - defaultDifficulty = 4 // 默认难度 - defaultNonceLength = 25 // 随机 Nonce 字节长度 + jwtPartsCount = 3 // JWT 三段结构 + defaultChallengeCount = 50 // 默认 PoW 难题数 + defaultChallengeSize = 32 // 默认盐值长度 + defaultDifficulty = 4 // 默认难度 + defaultNonceLength = 25 // 随机 Nonce 字节长度 defaultExpires = 10 * time.Minute // 默认过期时间 ) diff --git a/internal/util/cap/cap_test.go b/internal/util/cap/cap_test.go index 85cead21..0a55986f 100644 --- a/internal/util/cap/cap_test.go +++ b/internal/util/cap/cap_test.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cap diff --git a/internal/util/cap/errs.go b/internal/util/cap/errs.go index 7507c6af..9a3b85d2 100644 --- a/internal/util/cap/errs.go +++ b/internal/util/cap/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cap diff --git a/internal/util/cap/manager.go b/internal/util/cap/manager.go index 35d304cd..16e49e74 100644 --- a/internal/util/cap/manager.go +++ b/internal/util/cap/manager.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cap @@ -31,15 +18,15 @@ import ( ) const ( - managerDefaultChallengeCount = 1 - managerDefaultChallengeSize = 32 - defaultChallengeDifficulty = 4 - defaultChallengeTTL = 10 * time.Minute - defaultTokenTTL = 20 * time.Minute - redeemTokenIDLength = 8 // 兑换 Token ID 字节长度 - redeemVerTokenLength = 15 // 兑换验证 Token 字节长度 - tokenPartsCount = 2 // 兑换 Token 由两部分组成 - valuePartsCount = 2 // 存储值由 scope 和过期时间组成 + managerDefaultChallengeCount = 1 + managerDefaultChallengeSize = 32 + defaultChallengeDifficulty = 4 + defaultChallengeTTL = 10 * time.Minute + defaultTokenTTL = 20 * time.Minute + redeemTokenIDLength = 8 // 兑换 Token ID 字节长度 + redeemVerTokenLength = 15 // 兑换验证 Token 字节长度 + tokenPartsCount = 2 // 兑换 Token 由两部分组成 + valuePartsCount = 2 // 存储值由 scope 和过期时间组成 ) // Config holds settings for the CAPTCHA manager diff --git a/internal/util/cap/prng.go b/internal/util/cap/prng.go index b011e096..46df81dc 100644 --- a/internal/util/cap/prng.go +++ b/internal/util/cap/prng.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cap diff --git a/internal/util/cap/store.go b/internal/util/cap/store.go index 623cffd5..4e7b61f0 100644 --- a/internal/util/cap/store.go +++ b/internal/util/cap/store.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package cap diff --git a/internal/util/context.go b/internal/util/context.go index 7da4660d..5650f4d7 100644 --- a/internal/util/context.go +++ b/internal/util/context.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package util 提供通用工具函数 package util diff --git a/internal/util/crypto.go b/internal/util/crypto.go index eb357b75..d1904798 100644 --- a/internal/util/crypto.go +++ b/internal/util/crypto.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/internal/util/custom_types.go b/internal/util/custom_types.go index cf73a2cb..27f43580 100644 --- a/internal/util/custom_types.go +++ b/internal/util/custom_types.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/internal/util/errs.go b/internal/util/errs.go index 2793e7d3..bff6c4f9 100644 --- a/internal/util/errs.go +++ b/internal/util/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/internal/util/http_clients.go b/internal/util/http_clients.go index 72f0fa56..1a78f53c 100644 --- a/internal/util/http_clients.go +++ b/internal/util/http_clients.go @@ -1,19 +1,6 @@ -/* -Copyright 2025-2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/internal/util/mail/errs.go b/internal/util/mail/errs.go index 6affbbe6..87a6367e 100644 --- a/internal/util/mail/errs.go +++ b/internal/util/mail/errs.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package mail 提供 SMTP 邮件发送功能。 package mail diff --git a/internal/util/mail/mail.go b/internal/util/mail/mail.go index 5c4675ef..1037dbab 100644 --- a/internal/util/mail/mail.go +++ b/internal/util/mail/mail.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package mail @@ -28,9 +15,9 @@ import ( ) const ( - smtpSSLPort = 465 // SMTP SSL 端口 - smtpDialTimeout = 5 * time.Second // SMTP 连接超时 - smtpSessionDeadline = 10 * time.Second // SMTP 会话截止时间 + smtpSSLPort = 465 // SMTP SSL 端口 + smtpDialTimeout = 5 * time.Second // SMTP 连接超时 + smtpSessionDeadline = 10 * time.Second // SMTP 会话截止时间 ) // Config represents SMTP mail configuration diff --git a/internal/util/mail/mail_test.go b/internal/util/mail/mail_test.go index 26f0297f..b3d91c6b 100644 --- a/internal/util/mail/mail_test.go +++ b/internal/util/mail/mail_test.go @@ -1,19 +1,6 @@ -/* -Copyright 2026 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package mail diff --git a/internal/util/password.go b/internal/util/password.go index 38cc172d..1e0d4ec1 100644 --- a/internal/util/password.go +++ b/internal/util/password.go @@ -1,18 +1,5 @@ -/* -Copyright 2026 Arctel.net - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/internal/util/response.go b/internal/util/response.go index 16a69794..fd77a4df 100644 --- a/internal/util/response.go +++ b/internal/util/response.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/internal/util/session.go b/internal/util/session.go index 1d4cd784..7d3ee7ac 100644 --- a/internal/util/session.go +++ b/internal/util/session.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/internal/util/strings.go b/internal/util/strings.go index 2516ec1e..3bfad09d 100644 --- a/internal/util/strings.go +++ b/internal/util/strings.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/internal/util/uuid.go b/internal/util/uuid.go index 10fb314e..1c14b4cb 100644 --- a/internal/util/uuid.go +++ b/internal/util/uuid.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 package util diff --git a/main.go b/main.go index a957c042..045cff98 100644 --- a/main.go +++ b/main.go @@ -1,19 +1,6 @@ -/* -Copyright 2025 linux.do -Modified by Arctel.net, 2026 - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ +// Copyright 2025 linux.do +// Copyright 2026 Arctel.net +// SPDX-License-Identifier: Apache-2.0 // Package main 是 Wavelet 平台的程序入口 package main diff --git a/scripts/update_go_license.sh b/scripts/update_go_license.sh index 22a69c6f..1675b95b 100755 --- a/scripts/update_go_license.sh +++ b/scripts/update_go_license.sh @@ -9,14 +9,16 @@ usage() { Usage: scripts/update_go_license.sh [--check] -Updates Go source files with the project license header. +Updates Go source files with the project SPDX license header. Rules: - - Existing Apache license headers gain: - Modified by Arctel.net, 2026 - directly after the Copyright line. - - Go files without a license header receive an Arctel.net Apache header. - - //go:build and legacy // +build constraints stay at the top of the file. + - Files already carrying a correct SPDX header are left untouched. + - Legacy block-comment (/* ... */) Apache headers are converted to + the short SPDX form, preserving copyright attribution. + - Go files without any license header receive: + // Copyright 2026 Arctel.net + // SPDX-License-Identifier: Apache-2.0 + - //go:build and legacy // +build constraints stay at the top. Options: --check Report files that would change and exit non-zero if any are found. @@ -73,30 +75,20 @@ local $/; my $src = <$in>; close $in; -my $modified = 'Modified by Arctel.net, 2026'; -my $new_header = <<'HEADER'; -/* -Copyright 2026 Arctel.net +my $new_only_header = + "// Copyright 2026 Arctel.net\n" . + "// SPDX-License-Identifier: Apache-2.0"; -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -HEADER -chomp $new_header; +my $modified_header = + "// Copyright 2025 linux.do\n" . + "// Copyright 2026 Arctel.net\n" . + "// SPDX-License-Identifier: Apache-2.0"; my @lines = split /\n/, $src, -1; my @prefix; my $i = 0; +# Preserve //go:build and // +build constraint lines at the top. if (@lines && ($lines[0] =~ m{^//go:build } || $lines[0] =~ m{^// \+build })) { while ($i < @lines) { if ($lines[$i] =~ m{^//go:build } || $lines[$i] =~ m{^// \+build }) { @@ -116,22 +108,41 @@ my $prefix = @prefix ? join("\n", @prefix) . "\n" : ''; my $body = join "\n", @lines[$i .. $#lines]; my $result; -if ($body =~ m{\A(/\*.*?\*/)(\n*)}s) { +# --- Case 1: already has SPDX header (correct format, leave untouched) --- +if ($body =~ m{\A(// Copyright [^\x0a]+\x0a(?:// Copyright [^\x0a]+\x0a)?// SPDX-License-Identifier: Apache-2\.0)(\x0a?)}s) { + $result = $prefix . $body; +} +# --- Case 2: legacy block-comment header (/* ... */) --- +elsif ($body =~ m{\A(/\*.*?\*/)(\n*)}s) { my $block = $1; my $rest = substr($body, length($1) + length($2)); + $rest =~ s/\A\n+//; - if ($block =~ /Licensed under the Apache License, Version 2\.0/ && $block =~ /Copyright /) { - if ($block !~ /Copyright [^\n]*Arctel\.net/ && $block !~ /\Q$modified\E/) { - $block =~ s/^(Copyright [^\n]*)$/$1\n$modified/m; + if ($block =~ /Licensed under the Apache License/ && $block =~ /Copyright /) { + my $has_linux_do = ($block =~ /Copyright [^\n]*linux\.do/); + my $has_arctel = ($block =~ /Copyright [^\n]*Arctel\.net/); + my $has_modified = ($block =~ /Modified by Arctel\.net/); + + if ($has_linux_do && ($has_arctel || $has_modified)) { + $result = $prefix . $modified_header . "\n\n" . $rest; + } elsif ($has_arctel && !$has_linux_do) { + $result = $prefix . $new_only_header . "\n\n" . $rest; + } elsif ($has_linux_do && !$has_arctel && !$has_modified) { + my $h = "// Copyright 2025 linux.do\n" . + "// SPDX-License-Identifier: Apache-2.0"; + $result = $prefix . $h . "\n\n" . $rest; + } else { + $result = $prefix . $new_only_header . "\n\n" . $rest; } - $result = $prefix . $block . "\n\n" . $rest; } else { - $rest =~ s/\A\n+//; - $result = $prefix . $new_header . "\n\n" . $block . "\n\n" . $rest; + # Non-Apache block comment — prepend new header. + $result = $prefix . $new_only_header . "\n\n" . $block . "\n\n" . $rest; } -} else { +} +# --- Case 3: no header at all --- +else { $body =~ s/\A\n+//; - $result = $prefix . $new_header . "\n\n" . $body; + $result = $prefix . $new_only_header . "\n\n" . $body; } open my $fh, '>', $out or die "write $out: $!";