From 2e14b32ccd28e00a4328b9910926db7511bb101c Mon Sep 17 00:00:00 2001 From: houseme Date: Wed, 2 Jul 2025 15:07:47 +0800 Subject: [PATCH] chore: Add copyright and license headers (#23) * chore: Add copyright and license headers This commit adds the Apache 2.0 license and a copyright notice to the header of all source files. This ensures that the licensing and copyright information is clearly stated within the codebase. * cargo fmt * fix * fmt * fix clippy --- .docker/cargo.config.toml | 14 ++++++++++++++ .docker/mqtt/docker-compose-more.yml | 14 ++++++++++++++ .docker/mqtt/docker-compose.yml | 14 ++++++++++++++ .docker/observability/docker-compose.yml | 14 ++++++++++++++ .docker/observability/jaeger-config.yaml | 14 ++++++++++++++ .docker/observability/loki-config.yaml | 14 ++++++++++++++ .../observability/otel-collector-config.yaml | 14 ++++++++++++++ .docker/observability/prometheus.yml | 14 ++++++++++++++ .docker/openobserve-otel/docker-compose.yml | 14 ++++++++++++++ .../otel-collector-config.yaml | 14 ++++++++++++++ .github/actions/setup/action.yml | 14 ++++++++++++++ .github/dependabot.yml | 14 ++++++++++++++ .github/workflows/audit.yml | 14 ++++++++++++++ .github/workflows/build.yml | 14 ++++++++++++++ .github/workflows/ci.yml | 14 ++++++++++++++ .github/workflows/docker.yml | 14 ++++++++++++++ .github/workflows/samply.yml | 14 ++++++++++++++ Cargo.toml | 14 ++++++++++++++ Dockerfile | 14 ++++++++++++++ appauth/Cargo.toml | 14 ++++++++++++++ appauth/src/lib.rs | 14 ++++++++++++++ appauth/src/token.rs | 14 ++++++++++++++ build_rustfs.sh | 14 ++++++++++++++ cli/rustfs-gui/Cargo.toml | 14 ++++++++++++++ cli/rustfs-gui/assets/js/sts.js | 16 ++++++++++++++++ cli/rustfs-gui/assets/styling/navbar.css | 16 ++++++++++++++++ cli/rustfs-gui/assets/tailwind.css | 16 ++++++++++++++++ cli/rustfs-gui/input.css | 16 ++++++++++++++++ cli/rustfs-gui/src/components/home.rs | 14 ++++++++++++++ cli/rustfs-gui/src/components/mod.rs | 14 ++++++++++++++ cli/rustfs-gui/src/components/navbar.rs | 14 ++++++++++++++ cli/rustfs-gui/src/components/setting.rs | 14 ++++++++++++++ cli/rustfs-gui/src/main.rs | 14 ++++++++++++++ cli/rustfs-gui/src/route/mod.rs | 14 ++++++++++++++ cli/rustfs-gui/src/route/router.rs | 14 ++++++++++++++ cli/rustfs-gui/src/utils/config.rs | 14 ++++++++++++++ cli/rustfs-gui/src/utils/helper.rs | 14 ++++++++++++++ cli/rustfs-gui/src/utils/logger.rs | 14 ++++++++++++++ cli/rustfs-gui/src/utils/mod.rs | 14 ++++++++++++++ cli/rustfs-gui/src/views/app.rs | 14 ++++++++++++++ cli/rustfs-gui/src/views/home.rs | 14 ++++++++++++++ cli/rustfs-gui/src/views/mod.rs | 14 ++++++++++++++ cli/rustfs-gui/src/views/setting.rs | 14 ++++++++++++++ cli/rustfs-gui/tailwind.config.js | 16 ++++++++++++++++ common/common/Cargo.toml | 14 ++++++++++++++ common/common/src/bucket_stats.rs | 14 ++++++++++++++ common/common/src/error.rs | 14 ++++++++++++++ common/common/src/globals.rs | 14 ++++++++++++++ common/common/src/last_minute.rs | 14 ++++++++++++++ common/common/src/lib.rs | 14 ++++++++++++++ common/lock/Cargo.toml | 14 ++++++++++++++ common/lock/src/drwmutex.rs | 14 ++++++++++++++ common/lock/src/lib.rs | 13 +++++++++++++ common/lock/src/local_locker.rs | 14 ++++++++++++++ common/lock/src/lock_args.rs | 14 ++++++++++++++ common/lock/src/lrwmutex.rs | 14 ++++++++++++++ common/lock/src/namespace_lock.rs | 14 ++++++++++++++ common/lock/src/remote_client.rs | 14 ++++++++++++++ common/protos/Cargo.toml | 14 ++++++++++++++ .../src/generated/flatbuffers_generated/mod.rs | 14 ++++++++++++++ .../generated/flatbuffers_generated/models.rs | 14 ++++++++++++++ common/protos/src/generated/mod.rs | 13 +++++++++++++ common/protos/src/generated/proto_gen/mod.rs | 14 ++++++++++++++ .../src/generated/proto_gen/node_service.rs | 14 ++++++++++++++ common/protos/src/lib.rs | 14 ++++++++++++++ common/protos/src/main.rs | 14 ++++++++++++++ common/protos/src/node.proto | 14 ++++++++++++++ common/workers/Cargo.toml | 14 ++++++++++++++ common/workers/src/lib.rs | 14 ++++++++++++++ common/workers/src/workers.rs | 14 ++++++++++++++ crates/config/Cargo.toml | 14 ++++++++++++++ crates/config/src/constants/app.rs | 14 ++++++++++++++ crates/config/src/constants/env.rs | 14 ++++++++++++++ crates/config/src/constants/mod.rs | 14 ++++++++++++++ crates/config/src/lib.rs | 14 ++++++++++++++ crates/config/src/notify/arn.rs | 14 ++++++++++++++ crates/config/src/notify/mod.rs | 14 ++++++++++++++ crates/config/src/notify/mqtt.rs | 14 ++++++++++++++ crates/config/src/notify/store.rs | 14 ++++++++++++++ crates/config/src/notify/webhook.rs | 14 ++++++++++++++ crates/config/src/observability/config.rs | 14 ++++++++++++++ crates/config/src/observability/file.rs | 14 ++++++++++++++ crates/config/src/observability/kafka.rs | 14 ++++++++++++++ crates/config/src/observability/logger.rs | 14 ++++++++++++++ crates/config/src/observability/mod.rs | 14 ++++++++++++++ crates/config/src/observability/otel.rs | 14 ++++++++++++++ crates/config/src/observability/sink.rs | 14 ++++++++++++++ crates/config/src/observability/webhook.rs | 14 ++++++++++++++ crates/filemeta/Cargo.toml | 14 ++++++++++++++ crates/filemeta/benches/xl_meta_bench.rs | 14 ++++++++++++++ crates/filemeta/src/error.rs | 14 ++++++++++++++ crates/filemeta/src/fileinfo.rs | 14 ++++++++++++++ crates/filemeta/src/filemeta.rs | 14 ++++++++++++++ crates/filemeta/src/filemeta_inline.rs | 14 ++++++++++++++ crates/filemeta/src/headers.rs | 14 ++++++++++++++ crates/filemeta/src/lib.rs | 14 ++++++++++++++ crates/filemeta/src/metacache.rs | 14 ++++++++++++++ crates/filemeta/src/test_data.rs | 14 ++++++++++++++ crates/notify/Cargo.toml | 14 ++++++++++++++ crates/notify/examples/full_demo.rs | 14 ++++++++++++++ crates/notify/examples/full_demo_one.rs | 14 ++++++++++++++ crates/notify/examples/webhook.rs | 14 ++++++++++++++ crates/notify/src/arn.rs | 14 ++++++++++++++ crates/notify/src/error.rs | 14 ++++++++++++++ crates/notify/src/event.rs | 14 ++++++++++++++ crates/notify/src/factory.rs | 14 ++++++++++++++ crates/notify/src/global.rs | 14 ++++++++++++++ crates/notify/src/integration.rs | 14 ++++++++++++++ crates/notify/src/lib.rs | 14 ++++++++++++++ crates/notify/src/notifier.rs | 14 ++++++++++++++ crates/notify/src/registry.rs | 14 ++++++++++++++ crates/notify/src/rules/config.rs | 14 ++++++++++++++ crates/notify/src/rules/mod.rs | 14 ++++++++++++++ crates/notify/src/rules/pattern.rs | 14 ++++++++++++++ crates/notify/src/rules/pattern_rules.rs | 14 ++++++++++++++ crates/notify/src/rules/rules_map.rs | 14 ++++++++++++++ crates/notify/src/rules/target_id_set.rs | 14 ++++++++++++++ crates/notify/src/rules/xml_config.rs | 14 ++++++++++++++ crates/notify/src/store.rs | 14 ++++++++++++++ crates/notify/src/stream.rs | 14 ++++++++++++++ crates/notify/src/target/mod.rs | 14 ++++++++++++++ crates/notify/src/target/mqtt.rs | 14 ++++++++++++++ crates/notify/src/target/webhook.rs | 14 ++++++++++++++ crates/obs/Cargo.toml | 14 ++++++++++++++ crates/obs/examples/config.toml | 14 ++++++++++++++ crates/obs/examples/server.rs | 14 ++++++++++++++ crates/obs/src/config.rs | 14 ++++++++++++++ crates/obs/src/entry/args.rs | 14 ++++++++++++++ crates/obs/src/entry/audit.rs | 14 ++++++++++++++ crates/obs/src/entry/base.rs | 14 ++++++++++++++ crates/obs/src/entry/mod.rs | 14 ++++++++++++++ crates/obs/src/entry/unified.rs | 14 ++++++++++++++ crates/obs/src/global.rs | 14 ++++++++++++++ crates/obs/src/lib.rs | 14 ++++++++++++++ crates/obs/src/logger.rs | 14 ++++++++++++++ crates/obs/src/metrics/audit.rs | 14 ++++++++++++++ crates/obs/src/metrics/bucket.rs | 14 ++++++++++++++ crates/obs/src/metrics/bucket_replication.rs | 14 ++++++++++++++ crates/obs/src/metrics/cluster_config.rs | 14 ++++++++++++++ crates/obs/src/metrics/cluster_erasure_set.rs | 14 ++++++++++++++ crates/obs/src/metrics/cluster_health.rs | 14 ++++++++++++++ crates/obs/src/metrics/cluster_iam.rs | 14 ++++++++++++++ crates/obs/src/metrics/cluster_notification.rs | 14 ++++++++++++++ crates/obs/src/metrics/cluster_usage.rs | 14 ++++++++++++++ crates/obs/src/metrics/entry/descriptor.rs | 14 ++++++++++++++ crates/obs/src/metrics/entry/metric_name.rs | 14 ++++++++++++++ crates/obs/src/metrics/entry/metric_type.rs | 14 ++++++++++++++ crates/obs/src/metrics/entry/mod.rs | 14 ++++++++++++++ crates/obs/src/metrics/entry/namespace.rs | 14 ++++++++++++++ crates/obs/src/metrics/entry/path_utils.rs | 14 ++++++++++++++ crates/obs/src/metrics/entry/subsystem.rs | 14 ++++++++++++++ crates/obs/src/metrics/ilm.rs | 14 ++++++++++++++ crates/obs/src/metrics/logger_webhook.rs | 14 ++++++++++++++ crates/obs/src/metrics/mod.rs | 14 ++++++++++++++ crates/obs/src/metrics/replication.rs | 14 ++++++++++++++ crates/obs/src/metrics/request.rs | 14 ++++++++++++++ crates/obs/src/metrics/scanner.rs | 14 ++++++++++++++ crates/obs/src/metrics/system_cpu.rs | 14 ++++++++++++++ crates/obs/src/metrics/system_drive.rs | 14 ++++++++++++++ crates/obs/src/metrics/system_memory.rs | 14 ++++++++++++++ crates/obs/src/metrics/system_network.rs | 14 ++++++++++++++ crates/obs/src/metrics/system_process.rs | 14 ++++++++++++++ crates/obs/src/sinks/file.rs | 14 ++++++++++++++ crates/obs/src/sinks/kafka.rs | 18 ++++++++++++++++-- crates/obs/src/sinks/mod.rs | 14 ++++++++++++++ crates/obs/src/sinks/webhook.rs | 18 ++++++++++++++++-- crates/obs/src/system/attributes.rs | 14 ++++++++++++++ crates/obs/src/system/collector.rs | 14 ++++++++++++++ crates/obs/src/system/gpu.rs | 14 ++++++++++++++ crates/obs/src/system/metrics.rs | 14 ++++++++++++++ crates/obs/src/system/mod.rs | 14 ++++++++++++++ crates/obs/src/telemetry.rs | 14 ++++++++++++++ crates/obs/src/worker.rs | 14 ++++++++++++++ crates/rio/Cargo.toml | 14 ++++++++++++++ crates/rio/src/compress_index.rs | 14 ++++++++++++++ crates/rio/src/compress_reader.rs | 14 ++++++++++++++ crates/rio/src/encrypt_reader.rs | 14 ++++++++++++++ crates/rio/src/etag.rs | 14 ++++++++++++++ crates/rio/src/etag_reader.rs | 14 ++++++++++++++ crates/rio/src/hardlimit_reader.rs | 14 ++++++++++++++ crates/rio/src/hash_reader.rs | 14 ++++++++++++++ crates/rio/src/http_reader.rs | 14 ++++++++++++++ crates/rio/src/lib.rs | 14 ++++++++++++++ crates/rio/src/limit_reader.rs | 14 ++++++++++++++ crates/rio/src/reader.rs | 14 ++++++++++++++ crates/rio/src/writer.rs | 14 ++++++++++++++ crates/signer/Cargo.toml | 14 ++++++++++++++ crates/signer/src/constants.rs | 14 ++++++++++++++ crates/signer/src/lib.rs | 14 ++++++++++++++ .../signer/src/request_signature_streaming.rs | 14 ++++++++++++++ ...est_signature_streaming_unsigned_trailer.rs | 14 ++++++++++++++ crates/signer/src/request_signature_v2.rs | 14 ++++++++++++++ crates/signer/src/request_signature_v4.rs | 14 ++++++++++++++ crates/signer/src/utils.rs | 14 ++++++++++++++ crates/utils/Cargo.toml | 14 ++++++++++++++ crates/utils/src/certs.rs | 14 ++++++++++++++ crates/utils/src/compress.rs | 14 ++++++++++++++ crates/utils/src/crypto.rs | 14 ++++++++++++++ crates/utils/src/dirs.rs | 14 ++++++++++++++ crates/utils/src/hash.rs | 14 ++++++++++++++ crates/utils/src/hasher.rs | 14 ++++++++++++++ crates/utils/src/io.rs | 14 ++++++++++++++ crates/utils/src/ip.rs | 14 ++++++++++++++ crates/utils/src/lib.rs | 14 ++++++++++++++ crates/utils/src/net.rs | 14 ++++++++++++++ crates/utils/src/notify/mod.rs | 14 ++++++++++++++ crates/utils/src/os/linux.rs | 16 +++++++++++++++- crates/utils/src/os/mod.rs | 14 ++++++++++++++ crates/utils/src/os/unix.rs | 14 ++++++++++++++ crates/utils/src/os/windows.rs | 13 +++++++++++++ crates/utils/src/path.rs | 14 ++++++++++++++ crates/utils/src/retry.rs | 14 ++++++++++++++ crates/utils/src/string.rs | 14 ++++++++++++++ crates/utils/src/sys/mod.rs | 14 ++++++++++++++ crates/utils/src/sys/user_agent.rs | 14 ++++++++++++++ crates/zip/Cargo.toml | 14 ++++++++++++++ crates/zip/src/lib.rs | 14 ++++++++++++++ crypto/Cargo.toml | 14 ++++++++++++++ crypto/src/encdec.rs | 14 ++++++++++++++ crypto/src/encdec/aes.rs | 14 ++++++++++++++ crypto/src/encdec/decrypt.rs | 14 ++++++++++++++ crypto/src/encdec/encrypt.rs | 14 ++++++++++++++ crypto/src/encdec/id.rs | 14 ++++++++++++++ crypto/src/encdec/tests.rs | 14 ++++++++++++++ crypto/src/error.rs | 14 ++++++++++++++ crypto/src/jwt.rs | 14 ++++++++++++++ crypto/src/jwt/decode.rs | 14 ++++++++++++++ crypto/src/jwt/encode.rs | 14 ++++++++++++++ crypto/src/jwt/tests.rs | 14 ++++++++++++++ crypto/src/lib.rs | 13 +++++++++++++ docker-compose-obs.yaml | 14 ++++++++++++++ docker-compose.yaml | 14 ++++++++++++++ docker-compose.yml | 14 ++++++++++++++ e2e_test/Cargo.toml | 14 ++++++++++++++ e2e_test/src/lib.rs | 14 ++++++++++++++ e2e_test/src/reliant/lock.rs | 13 +++++++++++++ e2e_test/src/reliant/mod.rs | 14 ++++++++++++++ e2e_test/src/reliant/node_interact_test.rs | 13 +++++++++++++ ecstore/Cargo.toml | 14 ++++++++++++++ ecstore/benches/comparison_benchmark.rs | 14 ++++++++++++++ ecstore/benches/erasure_benchmark.rs | 14 ++++++++++++++ ecstore/build.rs | 14 ++++++++++++++ ecstore/run_benchmarks.sh | 14 ++++++++++++++ ecstore/src/admin_server_info.rs | 14 ++++++++++++++ ecstore/src/bitrot.rs | 14 ++++++++++++++ ecstore/src/bucket/error.rs | 14 ++++++++++++++ .../bucket/lifecycle/bucket_lifecycle_audit.rs | 14 ++++++++++++++ .../bucket/lifecycle/bucket_lifecycle_ops.rs | 13 +++++++++++++ ecstore/src/bucket/lifecycle/lifecycle.rs | 13 +++++++++++++ ecstore/src/bucket/lifecycle/mod.rs | 14 ++++++++++++++ ecstore/src/bucket/lifecycle/rule.rs | 13 +++++++++++++ .../bucket/lifecycle/tier_last_day_stats.rs | 13 +++++++++++++ ecstore/src/bucket/lifecycle/tier_sweeper.rs | 13 +++++++++++++ ecstore/src/bucket/metadata.rs | 14 ++++++++++++++ ecstore/src/bucket/metadata_sys.rs | 14 ++++++++++++++ ecstore/src/bucket/mod.rs | 14 ++++++++++++++ ecstore/src/bucket/object_lock/mod.rs | 14 ++++++++++++++ ecstore/src/bucket/object_lock/objectlock.rs | 14 ++++++++++++++ .../src/bucket/object_lock/objectlock_sys.rs | 14 ++++++++++++++ ecstore/src/bucket/policy_sys.rs | 14 ++++++++++++++ ecstore/src/bucket/quota/mod.rs | 14 ++++++++++++++ ecstore/src/bucket/replication/datatypes.rs | 14 ++++++++++++++ ecstore/src/bucket/replication/mod.rs | 14 ++++++++++++++ ecstore/src/bucket/tagging/mod.rs | 14 ++++++++++++++ ecstore/src/bucket/target/mod.rs | 14 ++++++++++++++ ecstore/src/bucket/utils.rs | 14 ++++++++++++++ ecstore/src/bucket/versioning/mod.rs | 14 ++++++++++++++ ecstore/src/bucket/versioning_sys.rs | 14 ++++++++++++++ ecstore/src/cache_value/cache.rs | 14 ++++++++++++++ ecstore/src/cache_value/metacache_set.rs | 14 ++++++++++++++ ecstore/src/cache_value/mod.rs | 14 ++++++++++++++ ecstore/src/checksum.rs | 13 +++++++++++++ ecstore/src/chunk_stream.rs | 14 ++++++++++++++ ecstore/src/client/admin_handler_utils.rs | 14 ++++++++++++++ ecstore/src/client/api_bucket_policy.rs | 13 +++++++++++++ ecstore/src/client/api_error_response.rs | 13 +++++++++++++ ecstore/src/client/api_get_object.rs | 13 +++++++++++++ ecstore/src/client/api_get_options.rs | 13 +++++++++++++ ecstore/src/client/api_list.rs | 13 +++++++++++++ ecstore/src/client/api_put_object.rs | 13 +++++++++++++ ecstore/src/client/api_put_object_common.rs | 13 +++++++++++++ ecstore/src/client/api_put_object_multipart.rs | 13 +++++++++++++ ecstore/src/client/api_put_object_streaming.rs | 13 +++++++++++++ ecstore/src/client/api_remove.rs | 13 +++++++++++++ ecstore/src/client/api_s3_datatypes.rs | 13 +++++++++++++ ecstore/src/client/bucket_cache.rs | 13 +++++++++++++ ecstore/src/client/constants.rs | 13 +++++++++++++ ecstore/src/client/credentials.rs | 13 +++++++++++++ ecstore/src/client/hook_reader.rs | 14 ++++++++++++++ ecstore/src/client/mod.rs | 14 ++++++++++++++ ecstore/src/client/object_api_utils.rs | 13 +++++++++++++ ecstore/src/client/object_handlers_common.rs | 14 ++++++++++++++ ecstore/src/client/transition_api.rs | 13 +++++++++++++ ecstore/src/client/utils.rs | 14 ++++++++++++++ ecstore/src/cmd/bucket_replication.rs | 13 +++++++++++++ ecstore/src/cmd/bucket_replication_utils.rs | 14 ++++++++++++++ ecstore/src/cmd/bucket_targets.rs | 13 +++++++++++++ ecstore/src/cmd/bucketreplicationhandler.rs | 14 ++++++++++++++ ecstore/src/cmd/mod.rs | 14 ++++++++++++++ ecstore/src/compress.rs | 14 ++++++++++++++ ecstore/src/config/com.rs | 14 ++++++++++++++ ecstore/src/config/heal.rs | 14 ++++++++++++++ ecstore/src/config/mod.rs | 14 ++++++++++++++ ecstore/src/config/notify.rs | 14 ++++++++++++++ ecstore/src/config/storageclass.rs | 14 ++++++++++++++ ecstore/src/disk/endpoint.rs | 14 ++++++++++++++ ecstore/src/disk/error.rs | 14 ++++++++++++++ ecstore/src/disk/error_conv.rs | 14 ++++++++++++++ ecstore/src/disk/error_reduce.rs | 14 ++++++++++++++ ecstore/src/disk/format.rs | 14 ++++++++++++++ ecstore/src/disk/fs.rs | 14 ++++++++++++++ ecstore/src/disk/local.rs | 14 ++++++++++++++ ecstore/src/disk/mod.rs | 14 ++++++++++++++ ecstore/src/disk/os.rs | 14 ++++++++++++++ ecstore/src/disks_layout.rs | 14 ++++++++++++++ ecstore/src/endpoints.rs | 14 ++++++++++++++ ecstore/src/erasure.rs | 14 ++++++++++++++ ecstore/src/erasure_coding/bitrot.rs | 14 ++++++++++++++ ecstore/src/erasure_coding/decode.rs | 14 ++++++++++++++ ecstore/src/erasure_coding/encode.rs | 14 ++++++++++++++ ecstore/src/erasure_coding/erasure.rs | 14 ++++++++++++++ ecstore/src/erasure_coding/heal.rs | 14 ++++++++++++++ ecstore/src/erasure_coding/mod.rs | 14 ++++++++++++++ ecstore/src/error.rs | 14 ++++++++++++++ ecstore/src/event/mod.rs | 14 ++++++++++++++ ecstore/src/event/name.rs | 13 +++++++++++++ ecstore/src/event/targetid.rs | 13 +++++++++++++ ecstore/src/event/targetlist.rs | 14 ++++++++++++++ ecstore/src/event_notification.rs | 13 +++++++++++++ ecstore/src/global.rs | 14 ++++++++++++++ ecstore/src/heal/background_heal_ops.rs | 14 ++++++++++++++ ecstore/src/heal/data_scanner.rs | 14 ++++++++++++++ ecstore/src/heal/data_scanner_metric.rs | 14 ++++++++++++++ ecstore/src/heal/data_usage.rs | 14 ++++++++++++++ ecstore/src/heal/data_usage_cache.rs | 14 ++++++++++++++ ecstore/src/heal/error.rs | 14 ++++++++++++++ ecstore/src/heal/heal_commands.rs | 14 ++++++++++++++ ecstore/src/heal/heal_ops.rs | 14 ++++++++++++++ ecstore/src/heal/mod.rs | 14 ++++++++++++++ ecstore/src/heal/mrf.rs | 14 ++++++++++++++ ecstore/src/lib.rs | 13 +++++++++++++ ecstore/src/metrics_realtime.rs | 14 ++++++++++++++ ecstore/src/notification_sys.rs | 14 ++++++++++++++ ecstore/src/pools.rs | 14 ++++++++++++++ ecstore/src/rebalance.rs | 14 ++++++++++++++ ecstore/src/rpc/http_auth.rs | 14 ++++++++++++++ ecstore/src/rpc/mod.rs | 14 ++++++++++++++ ecstore/src/rpc/peer_rest_client.rs | 14 ++++++++++++++ ecstore/src/rpc/peer_s3_client.rs | 14 ++++++++++++++ ecstore/src/rpc/remote_disk.rs | 14 ++++++++++++++ ecstore/src/rpc/tonic_service.rs | 14 ++++++++++++++ ecstore/src/set_disk.rs | 13 +++++++++++++ ecstore/src/sets.rs | 14 ++++++++++++++ ecstore/src/store.rs | 13 +++++++++++++ ecstore/src/store_api.rs | 14 ++++++++++++++ ecstore/src/store_init.rs | 14 ++++++++++++++ ecstore/src/store_list_objects.rs | 14 ++++++++++++++ ecstore/src/store_utils.rs | 14 ++++++++++++++ ecstore/src/tier/mod.rs | 14 ++++++++++++++ ecstore/src/tier/tier.rs | 13 +++++++++++++ ecstore/src/tier/tier_admin.rs | 13 +++++++++++++ ecstore/src/tier/tier_config.rs | 14 ++++++++++++++ ecstore/src/tier/tier_gen.rs | 14 ++++++++++++++ ecstore/src/tier/tier_handlers.rs | 14 ++++++++++++++ ecstore/src/tier/warm_backend.rs | 13 +++++++++++++ ecstore/src/tier/warm_backend_minio.rs | 13 +++++++++++++ ecstore/src/tier/warm_backend_rustfs.rs | 13 +++++++++++++ ecstore/src/tier/warm_backend_s3.rs | 13 +++++++++++++ iam/Cargo.toml | 14 ++++++++++++++ iam/src/cache.rs | 14 ++++++++++++++ iam/src/error.rs | 14 ++++++++++++++ iam/src/lib.rs | 14 ++++++++++++++ iam/src/manager.rs | 14 ++++++++++++++ iam/src/store.rs | 14 ++++++++++++++ iam/src/store/object.rs | 14 ++++++++++++++ iam/src/sys.rs | 14 ++++++++++++++ iam/src/utils.rs | 14 ++++++++++++++ madmin/Cargo.toml | 14 ++++++++++++++ madmin/src/group.rs | 14 ++++++++++++++ madmin/src/heal_commands.rs | 14 ++++++++++++++ madmin/src/health.rs | 14 ++++++++++++++ madmin/src/info_commands.rs | 14 ++++++++++++++ madmin/src/lib.rs | 14 ++++++++++++++ madmin/src/metrics.rs | 14 ++++++++++++++ madmin/src/net/mod.rs | 14 ++++++++++++++ madmin/src/policy.rs | 14 ++++++++++++++ madmin/src/service_commands.rs | 14 ++++++++++++++ madmin/src/trace.rs | 14 ++++++++++++++ madmin/src/user.rs | 14 ++++++++++++++ madmin/src/utils.rs | 14 ++++++++++++++ policy/Cargo.toml | 14 ++++++++++++++ policy/src/arn.rs | 14 ++++++++++++++ policy/src/auth.rs | 14 ++++++++++++++ policy/src/auth/credentials.rs | 14 ++++++++++++++ policy/src/error.rs | 14 ++++++++++++++ policy/src/format.rs | 14 ++++++++++++++ policy/src/lib.rs | 14 ++++++++++++++ policy/src/policy.rs | 14 ++++++++++++++ policy/src/policy/action.rs | 14 ++++++++++++++ policy/src/policy/doc.rs | 14 ++++++++++++++ policy/src/policy/effect.rs | 14 ++++++++++++++ policy/src/policy/function.rs | 14 ++++++++++++++ policy/src/policy/function/addr.rs | 14 ++++++++++++++ policy/src/policy/function/binary.rs | 14 ++++++++++++++ policy/src/policy/function/bool_null.rs | 14 ++++++++++++++ policy/src/policy/function/condition.rs | 14 ++++++++++++++ policy/src/policy/function/date.rs | 14 ++++++++++++++ policy/src/policy/function/func.rs | 14 ++++++++++++++ policy/src/policy/function/key.rs | 14 ++++++++++++++ policy/src/policy/function/key_name.rs | 14 ++++++++++++++ policy/src/policy/function/number.rs | 14 ++++++++++++++ policy/src/policy/function/string.rs | 14 ++++++++++++++ policy/src/policy/id.rs | 14 ++++++++++++++ policy/src/policy/policy.rs | 14 ++++++++++++++ policy/src/policy/principal.rs | 14 ++++++++++++++ policy/src/policy/resource.rs | 14 ++++++++++++++ policy/src/policy/statement.rs | 14 ++++++++++++++ policy/src/policy/utils.rs | 14 ++++++++++++++ policy/src/policy/utils/path.rs | 14 ++++++++++++++ policy/src/policy/utils/wildcard.rs | 14 ++++++++++++++ policy/src/service_type.rs | 14 ++++++++++++++ policy/src/utils.rs | 14 ++++++++++++++ policy/tests/policy_is_allowed.rs | 14 ++++++++++++++ rustfmt.toml | 14 ++++++++++++++ rustfs/Cargo.toml | 14 ++++++++++++++ rustfs/build.rs | 14 ++++++++++++++ rustfs/src/admin/handlers.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/bucket_meta.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/event.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/group.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/policys.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/pools.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/rebalance.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/service_account.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/sts.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/tier.rs | 13 +++++++++++++ rustfs/src/admin/handlers/trace.rs | 14 ++++++++++++++ rustfs/src/admin/handlers/user.rs | 14 ++++++++++++++ rustfs/src/admin/mod.rs | 14 ++++++++++++++ rustfs/src/admin/router.rs | 14 ++++++++++++++ rustfs/src/admin/rpc.rs | 14 ++++++++++++++ rustfs/src/admin/utils.rs | 14 ++++++++++++++ rustfs/src/auth.rs | 14 ++++++++++++++ rustfs/src/config/mod.rs | 14 ++++++++++++++ rustfs/src/console.rs | 14 ++++++++++++++ rustfs/src/error.rs | 14 ++++++++++++++ rustfs/src/event.rs | 14 ++++++++++++++ rustfs/src/license.rs | 14 ++++++++++++++ rustfs/src/logging/mod.rs | 14 +++++++++++++- rustfs/src/main.rs | 14 ++++++++++++++ rustfs/src/server/mod.rs | 14 ++++++++++++++ rustfs/src/server/service_state.rs | 14 ++++++++++++++ rustfs/src/service.rs | 14 ++++++++++++++ rustfs/src/storage/access.rs | 14 ++++++++++++++ rustfs/src/storage/ecfs.rs | 14 ++++++++++++++ rustfs/src/storage/error.rs | 14 ++++++++++++++ rustfs/src/storage/mod.rs | 14 ++++++++++++++ rustfs/src/storage/options.rs | 14 ++++++++++++++ rustfs/src/update_checker.rs | 14 ++++++++++++++ s3select/api/Cargo.toml | 14 ++++++++++++++ s3select/api/src/lib.rs | 14 ++++++++++++++ s3select/api/src/object_store.rs | 14 ++++++++++++++ s3select/api/src/query/analyzer.rs | 14 ++++++++++++++ s3select/api/src/query/ast.rs | 14 ++++++++++++++ s3select/api/src/query/datasource/mod.rs | 14 +++++++++++++- s3select/api/src/query/dispatcher.rs | 14 ++++++++++++++ s3select/api/src/query/execution.rs | 14 ++++++++++++++ s3select/api/src/query/function.rs | 14 ++++++++++++++ s3select/api/src/query/logical_planner.rs | 14 ++++++++++++++ s3select/api/src/query/mod.rs | 14 ++++++++++++++ s3select/api/src/query/optimizer.rs | 14 ++++++++++++++ s3select/api/src/query/parser.rs | 14 ++++++++++++++ s3select/api/src/query/physical_planner.rs | 14 ++++++++++++++ s3select/api/src/query/scheduler.rs | 14 ++++++++++++++ s3select/api/src/query/session.rs | 14 ++++++++++++++ s3select/api/src/server/dbms.rs | 14 ++++++++++++++ s3select/api/src/server/mod.rs | 14 ++++++++++++++ s3select/query/Cargo.toml | 14 ++++++++++++++ s3select/query/src/data_source/mod.rs | 14 ++++++++++++++ s3select/query/src/data_source/table_source.rs | 14 ++++++++++++++ s3select/query/src/dispatcher/manager.rs | 14 ++++++++++++++ s3select/query/src/dispatcher/mod.rs | 14 ++++++++++++++ s3select/query/src/execution/factory.rs | 14 ++++++++++++++ s3select/query/src/execution/mod.rs | 14 ++++++++++++++ s3select/query/src/execution/query.rs | 14 ++++++++++++++ .../query/src/execution/scheduler/local.rs | 14 ++++++++++++++ s3select/query/src/execution/scheduler/mod.rs | 14 ++++++++++++++ s3select/query/src/function/mod.rs | 14 ++++++++++++++ .../query/src/function/simple_func_manager.rs | 14 ++++++++++++++ s3select/query/src/instance.rs | 14 ++++++++++++++ s3select/query/src/lib.rs | 14 ++++++++++++++ s3select/query/src/metadata/base_table.rs | 14 ++++++++++++++ s3select/query/src/metadata/mod.rs | 14 ++++++++++++++ s3select/query/src/sql/analyzer.rs | 14 ++++++++++++++ s3select/query/src/sql/dialect.rs | 14 ++++++++++++++ s3select/query/src/sql/logical/mod.rs | 14 ++++++++++++++ s3select/query/src/sql/logical/optimizer.rs | 14 ++++++++++++++ s3select/query/src/sql/logical/planner.rs | 14 ++++++++++++++ s3select/query/src/sql/mod.rs | 14 ++++++++++++++ s3select/query/src/sql/optimizer.rs | 14 ++++++++++++++ s3select/query/src/sql/parser.rs | 14 ++++++++++++++ s3select/query/src/sql/physical/mod.rs | 14 ++++++++++++++ s3select/query/src/sql/physical/optimizer.rs | 14 ++++++++++++++ s3select/query/src/sql/physical/planner.rs | 14 ++++++++++++++ s3select/query/src/sql/planner.rs | 14 ++++++++++++++ scripts/build-docker-multiarch.sh | 14 ++++++++++++++ scripts/dev_clear.sh | 14 ++++++++++++++ scripts/dev_deploy.sh | 14 ++++++++++++++ scripts/dev_rustfs.sh | 14 ++++++++++++++ scripts/e2e-run.sh | 14 ++++++++++++++ scripts/notify.sh | 14 ++++++++++++++ scripts/probe.sh | 14 ++++++++++++++ scripts/run.ps1 | 16 ++++++++++++++++ scripts/run.sh | 14 ++++++++++++++ scripts/static.sh | 14 ++++++++++++++ scripts/test.sh | 14 ++++++++++++++ 516 files changed, 7196 insertions(+), 7 deletions(-) diff --git a/.docker/cargo.config.toml b/.docker/cargo.config.toml index fc6904fe4..74debc4e4 100644 --- a/.docker/cargo.config.toml +++ b/.docker/cargo.config.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [source.crates-io] registry = "https://github.com/rust-lang/crates.io-index" diff --git a/.docker/mqtt/docker-compose-more.yml b/.docker/mqtt/docker-compose-more.yml index 16128ab16..527d750e7 100644 --- a/.docker/mqtt/docker-compose-more.yml +++ b/.docker/mqtt/docker-compose-more.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + services: emqx: image: emqx/emqx:latest diff --git a/.docker/mqtt/docker-compose.yml b/.docker/mqtt/docker-compose.yml index 040b76846..8b913563e 100644 --- a/.docker/mqtt/docker-compose.yml +++ b/.docker/mqtt/docker-compose.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + services: emqx: image: emqx/emqx:latest diff --git a/.docker/observability/docker-compose.yml b/.docker/observability/docker-compose.yml index d0aef65b0..618f543c0 100644 --- a/.docker/observability/docker-compose.yml +++ b/.docker/observability/docker-compose.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + services: otel-collector: image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.127.0 diff --git a/.docker/observability/jaeger-config.yaml b/.docker/observability/jaeger-config.yaml index 619ada1c9..41e103415 100644 --- a/.docker/observability/jaeger-config.yaml +++ b/.docker/observability/jaeger-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + service: extensions: [ jaeger_storage, jaeger_query, remote_sampling, healthcheckv2 ] pipelines: diff --git a/.docker/observability/loki-config.yaml b/.docker/observability/loki-config.yaml index 4aff8772a..caf00ba6e 100644 --- a/.docker/observability/loki-config.yaml +++ b/.docker/observability/loki-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + auth_enabled: false server: diff --git a/.docker/observability/otel-collector-config.yaml b/.docker/observability/otel-collector-config.yaml index 24d67dc3c..3d5942d45 100644 --- a/.docker/observability/otel-collector-config.yaml +++ b/.docker/observability/otel-collector-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + receivers: otlp: protocols: diff --git a/.docker/observability/prometheus.yml b/.docker/observability/prometheus.yml index 8d3a031ef..0082481d7 100644 --- a/.docker/observability/prometheus.yml +++ b/.docker/observability/prometheus.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + global: scrape_interval: 5s # 刮取间隔 diff --git a/.docker/openobserve-otel/docker-compose.yml b/.docker/openobserve-otel/docker-compose.yml index a4083bca8..354e9343f 100644 --- a/.docker/openobserve-otel/docker-compose.yml +++ b/.docker/openobserve-otel/docker-compose.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + services: openobserve: image: public.ecr.aws/zinclabs/openobserve:latest diff --git a/.docker/openobserve-otel/otel-collector-config.yaml b/.docker/openobserve-otel/otel-collector-config.yaml index 561692ad7..6394308c9 100644 --- a/.docker/openobserve-otel/otel-collector-config.yaml +++ b/.docker/openobserve-otel/otel-collector-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + receivers: otlp: protocols: diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index a90ca472c..e3deae4c2 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + name: "setup" description: "setup environment for rustfs" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e522013ad..74d1ffaa0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + # To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index bbf164650..58e2407d4 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + name: Audit on: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 904ad1dec..85a99314e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + name: Build RustFS And GUI on: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cdabf6a0..7c7bb208e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + name: CI on: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bbe3dfedb..8fa6868da 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + name: Build and Push Docker Images on: diff --git a/.github/workflows/samply.yml b/.github/workflows/samply.yml index 7ae200ff9..9ab96f834 100644 --- a/.github/workflows/samply.yml +++ b/.github/workflows/samply.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + name: Profile with Samply on: push: diff --git a/Cargo.toml b/Cargo.toml index 740686b92..55532bca9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [workspace] members = [ "appauth", # Application authentication and authorization diff --git a/Dockerfile b/Dockerfile index 1c428a7cd..71e07e968 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + FROM alpine:latest # Install runtime dependencies diff --git a/appauth/Cargo.toml b/appauth/Cargo.toml index 1f807c69b..c587b3733 100644 --- a/appauth/Cargo.toml +++ b/appauth/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "appauth" edition.workspace = true diff --git a/appauth/src/lib.rs b/appauth/src/lib.rs index 79c66ba63..a17997f48 100644 --- a/appauth/src/lib.rs +++ b/appauth/src/lib.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod token; diff --git a/appauth/src/token.rs b/appauth/src/token.rs index 85c5b2b2a..ab6407dd8 100644 --- a/appauth/src/token.rs +++ b/appauth/src/token.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use rsa::Pkcs1v15Encrypt; use rsa::{ RsaPrivateKey, RsaPublicKey, diff --git a/build_rustfs.sh b/build_rustfs.sh index a082abdae..535a7f766 100755 --- a/build_rustfs.sh +++ b/build_rustfs.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2024 RustFS Team +# +# 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. + clear # Get the current platform architecture diff --git a/cli/rustfs-gui/Cargo.toml b/cli/rustfs-gui/Cargo.toml index 218c8d104..c783d35a8 100644 --- a/cli/rustfs-gui/Cargo.toml +++ b/cli/rustfs-gui/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-gui" edition.workspace = true diff --git a/cli/rustfs-gui/assets/js/sts.js b/cli/rustfs-gui/assets/js/sts.js index 5600f0d07..13d4ed907 100644 --- a/cli/rustfs-gui/assets/js/sts.js +++ b/cli/rustfs-gui/assets/js/sts.js @@ -1,3 +1,19 @@ +/** + * Copyright 2024 RustFS Team + * + * 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. + */ + window.switchTab = function (tabId) { // Hide everything document.querySelectorAll('.tab-content').forEach(content => { diff --git a/cli/rustfs-gui/assets/styling/navbar.css b/cli/rustfs-gui/assets/styling/navbar.css index e9722278a..d5e63e64a 100644 --- a/cli/rustfs-gui/assets/styling/navbar.css +++ b/cli/rustfs-gui/assets/styling/navbar.css @@ -1,3 +1,19 @@ +/** + * Copyright 2024 RustFS Team + * + * 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. + */ + #navbar { display: flex; flex-direction: row; diff --git a/cli/rustfs-gui/assets/tailwind.css b/cli/rustfs-gui/assets/tailwind.css index 4b65c5b83..ae7ca53b8 100644 --- a/cli/rustfs-gui/assets/tailwind.css +++ b/cli/rustfs-gui/assets/tailwind.css @@ -1,3 +1,19 @@ +/** + * Copyright 2024 RustFS Team + * + * 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. + */ + *, ::before, ::after { --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; diff --git a/cli/rustfs-gui/input.css b/cli/rustfs-gui/input.css index bd6213e1d..06106e066 100644 --- a/cli/rustfs-gui/input.css +++ b/cli/rustfs-gui/input.css @@ -1,3 +1,19 @@ +/** + * Copyright 2024 RustFS Team + * + * 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. + */ + @tailwind base; @tailwind components; @tailwind utilities; \ No newline at end of file diff --git a/cli/rustfs-gui/src/components/home.rs b/cli/rustfs-gui/src/components/home.rs index eae9c511e..e25f7237b 100644 --- a/cli/rustfs-gui/src/components/home.rs +++ b/cli/rustfs-gui/src/components/home.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::components::navbar::LoadingSpinner; use crate::route::Route; use crate::utils::{RustFSConfig, ServiceManager}; diff --git a/cli/rustfs-gui/src/components/mod.rs b/cli/rustfs-gui/src/components/mod.rs index e273baa7b..69c026bce 100644 --- a/cli/rustfs-gui/src/components/mod.rs +++ b/cli/rustfs-gui/src/components/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod home; pub use home::Home; mod navbar; diff --git a/cli/rustfs-gui/src/components/navbar.rs b/cli/rustfs-gui/src/components/navbar.rs index 98726b7ab..5e99ecd43 100644 --- a/cli/rustfs-gui/src/components/navbar.rs +++ b/cli/rustfs-gui/src/components/navbar.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::route::Route; use dioxus::logger::tracing::debug; use dioxus::prelude::*; diff --git a/cli/rustfs-gui/src/components/setting.rs b/cli/rustfs-gui/src/components/setting.rs index 220be1fe1..a31a19374 100644 --- a/cli/rustfs-gui/src/components/setting.rs +++ b/cli/rustfs-gui/src/components/setting.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::components::navbar::LoadingSpinner; use dioxus::logger::tracing::{debug, error}; use dioxus::prelude::*; diff --git a/cli/rustfs-gui/src/main.rs b/cli/rustfs-gui/src/main.rs index 6a8e1644f..7d1f373bf 100644 --- a/cli/rustfs-gui/src/main.rs +++ b/cli/rustfs-gui/src/main.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod components; mod route; mod utils; diff --git a/cli/rustfs-gui/src/route/mod.rs b/cli/rustfs-gui/src/route/mod.rs index afff5bc63..b9b1699d3 100644 --- a/cli/rustfs-gui/src/route/mod.rs +++ b/cli/rustfs-gui/src/route/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod router; pub use router::Route; diff --git a/cli/rustfs-gui/src/route/router.rs b/cli/rustfs-gui/src/route/router.rs index 4c17d60c4..93a7be036 100644 --- a/cli/rustfs-gui/src/route/router.rs +++ b/cli/rustfs-gui/src/route/router.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::components::Navbar; use crate::views::{HomeViews, SettingViews}; use dioxus::prelude::*; diff --git a/cli/rustfs-gui/src/utils/config.rs b/cli/rustfs-gui/src/utils/config.rs index 154e26e04..2edc9404f 100644 --- a/cli/rustfs-gui/src/utils/config.rs +++ b/cli/rustfs-gui/src/utils/config.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use keyring::Entry; use serde::{Deserialize, Serialize}; use std::error::Error; diff --git a/cli/rustfs-gui/src/utils/helper.rs b/cli/rustfs-gui/src/utils/helper.rs index 353671c9c..73c300145 100644 --- a/cli/rustfs-gui/src/utils/helper.rs +++ b/cli/rustfs-gui/src/utils/helper.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::utils::RustFSConfig; use dioxus::logger::tracing::{debug, error, info}; use lazy_static::lazy_static; diff --git a/cli/rustfs-gui/src/utils/logger.rs b/cli/rustfs-gui/src/utils/logger.rs index edd25fb7b..a712b0fe4 100644 --- a/cli/rustfs-gui/src/utils/logger.rs +++ b/cli/rustfs-gui/src/utils/logger.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use dioxus::logger::tracing::debug; use tracing_appender::non_blocking::WorkerGuard; use tracing_appender::rolling::{RollingFileAppender, Rotation}; diff --git a/cli/rustfs-gui/src/utils/mod.rs b/cli/rustfs-gui/src/utils/mod.rs index fe795568d..b9c303bce 100644 --- a/cli/rustfs-gui/src/utils/mod.rs +++ b/cli/rustfs-gui/src/utils/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod config; mod helper; mod logger; diff --git a/cli/rustfs-gui/src/views/app.rs b/cli/rustfs-gui/src/views/app.rs index 708a8974d..5fc3924bc 100644 --- a/cli/rustfs-gui/src/views/app.rs +++ b/cli/rustfs-gui/src/views/app.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::route::Route; use dioxus::logger::tracing::info; use dioxus::prelude::*; diff --git a/cli/rustfs-gui/src/views/home.rs b/cli/rustfs-gui/src/views/home.rs index d669f9e60..7096c8db0 100644 --- a/cli/rustfs-gui/src/views/home.rs +++ b/cli/rustfs-gui/src/views/home.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::components::Home; use dioxus::prelude::*; diff --git a/cli/rustfs-gui/src/views/mod.rs b/cli/rustfs-gui/src/views/mod.rs index 5da74ee41..3dadb94f6 100644 --- a/cli/rustfs-gui/src/views/mod.rs +++ b/cli/rustfs-gui/src/views/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod app; mod home; mod setting; diff --git a/cli/rustfs-gui/src/views/setting.rs b/cli/rustfs-gui/src/views/setting.rs index f7cb4f898..e646ae35f 100644 --- a/cli/rustfs-gui/src/views/setting.rs +++ b/cli/rustfs-gui/src/views/setting.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::components::Setting; use dioxus::prelude::*; diff --git a/cli/rustfs-gui/tailwind.config.js b/cli/rustfs-gui/tailwind.config.js index 222d1be46..289dc04d9 100644 --- a/cli/rustfs-gui/tailwind.config.js +++ b/cli/rustfs-gui/tailwind.config.js @@ -1,3 +1,19 @@ +/** + * Copyright 2024 RustFS Team + * + * 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. + */ + module.exports = { mode: "all", content: ["./src/**/*.{rs,html,css}", "./dist/**/*.html"], diff --git a/common/common/Cargo.toml b/common/common/Cargo.toml index 10900f333..3d490752b 100644 --- a/common/common/Cargo.toml +++ b/common/common/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "common" version.workspace = true diff --git a/common/common/src/bucket_stats.rs b/common/common/src/bucket_stats.rs index 43970e8c0..4685e1e8c 100644 --- a/common/common/src/bucket_stats.rs +++ b/common/common/src/bucket_stats.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use crate::last_minute::{self}; diff --git a/common/common/src/error.rs b/common/common/src/error.rs index 1f8f52d6e..c06c380a8 100644 --- a/common/common/src/error.rs +++ b/common/common/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use tracing_error::{SpanTrace, SpanTraceStatus}; pub type StdError = Box; diff --git a/common/common/src/globals.rs b/common/common/src/globals.rs index 43bd6cddf..56eaf057a 100644 --- a/common/common/src/globals.rs +++ b/common/common/src/globals.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use lazy_static::lazy_static; diff --git a/common/common/src/last_minute.rs b/common/common/src/last_minute.rs index 1f7f6fe2f..b5b22eb3a 100644 --- a/common/common/src/last_minute.rs +++ b/common/common/src/last_minute.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::time::{Duration, SystemTime, UNIX_EPOCH}; #[allow(dead_code)] diff --git a/common/common/src/lib.rs b/common/common/src/lib.rs index 3b39fd086..16de991db 100644 --- a/common/common/src/lib.rs +++ b/common/common/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod bucket_stats; // pub mod error; pub mod globals; diff --git a/common/lock/Cargo.toml b/common/lock/Cargo.toml index a657f7dca..8e6a7c5d3 100644 --- a/common/lock/Cargo.toml +++ b/common/lock/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "lock" version.workspace = true diff --git a/common/lock/src/drwmutex.rs b/common/lock/src/drwmutex.rs index cd4d9332e..deb7b91d9 100644 --- a/common/lock/src/drwmutex.rs +++ b/common/lock/src/drwmutex.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::time::{Duration, Instant}; use tokio::{sync::mpsc::Sender, time::sleep}; diff --git a/common/lock/src/lib.rs b/common/lock/src/lib.rs index 91f26d937..396f3b005 100644 --- a/common/lock/src/lib.rs +++ b/common/lock/src/lib.rs @@ -1,4 +1,17 @@ #![allow(dead_code)] +// Copyright 2024 RustFS Team +// +// 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. use std::sync::Arc; diff --git a/common/lock/src/local_locker.rs b/common/lock/src/local_locker.rs index 678a585e4..ef9676c5c 100644 --- a/common/lock/src/local_locker.rs +++ b/common/lock/src/local_locker.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use async_trait::async_trait; use std::io::{Error, Result}; use std::{ diff --git a/common/lock/src/lock_args.rs b/common/lock/src/lock_args.rs index c41cf1b58..868509622 100644 --- a/common/lock/src/lock_args.rs +++ b/common/lock/src/lock_args.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::fmt::Display; use serde::{Deserialize, Serialize}; diff --git a/common/lock/src/lrwmutex.rs b/common/lock/src/lrwmutex.rs index bddb84e77..5f0779b12 100644 --- a/common/lock/src/lrwmutex.rs +++ b/common/lock/src/lrwmutex.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::time::{Duration, Instant}; use rand::Rng; diff --git a/common/lock/src/namespace_lock.rs b/common/lock/src/namespace_lock.rs index b5145fae1..c2fe424ee 100644 --- a/common/lock/src/namespace_lock.rs +++ b/common/lock/src/namespace_lock.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{collections::HashMap, path::Path, sync::Arc, time::Duration}; use async_trait::async_trait; diff --git a/common/lock/src/remote_client.rs b/common/lock/src/remote_client.rs index ddd547ad5..10fd0a5a8 100644 --- a/common/lock/src/remote_client.rs +++ b/common/lock/src/remote_client.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use async_trait::async_trait; use protos::{node_service_time_out_client, proto_gen::node_service::GenerallyLockRequest}; use std::io::{Error, Result}; diff --git a/common/protos/Cargo.toml b/common/protos/Cargo.toml index 2041375c4..dfc97a060 100644 --- a/common/protos/Cargo.toml +++ b/common/protos/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "protos" version.workspace = true diff --git a/common/protos/src/generated/flatbuffers_generated/mod.rs b/common/protos/src/generated/flatbuffers_generated/mod.rs index c446ac883..ee15f5c7c 100644 --- a/common/protos/src/generated/flatbuffers_generated/mod.rs +++ b/common/protos/src/generated/flatbuffers_generated/mod.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod models; diff --git a/common/protos/src/generated/flatbuffers_generated/models.rs b/common/protos/src/generated/flatbuffers_generated/models.rs index d55f1a98d..9d1d3d7cc 100644 --- a/common/protos/src/generated/flatbuffers_generated/models.rs +++ b/common/protos/src/generated/flatbuffers_generated/models.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + // automatically generated by the FlatBuffers compiler, do not modify // @generated diff --git a/common/protos/src/generated/mod.rs b/common/protos/src/generated/mod.rs index 4ab5a438a..c32d004a4 100644 --- a/common/protos/src/generated/mod.rs +++ b/common/protos/src/generated/mod.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(clippy::all)] pub mod proto_gen; diff --git a/common/protos/src/generated/proto_gen/mod.rs b/common/protos/src/generated/proto_gen/mod.rs index 35d3fe1b2..fd0a96266 100644 --- a/common/protos/src/generated/proto_gen/mod.rs +++ b/common/protos/src/generated/proto_gen/mod.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod node_service; diff --git a/common/protos/src/generated/proto_gen/node_service.rs b/common/protos/src/generated/proto_gen/node_service.rs index f536dfbff..f7e54d2eb 100644 --- a/common/protos/src/generated/proto_gen/node_service.rs +++ b/common/protos/src/generated/proto_gen/node_service.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + // This file is @generated by prost-build. /// -------------------------------------------------------------------- #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/common/protos/src/lib.rs b/common/protos/src/lib.rs index 4d6acb4a5..8cffdb18d 100644 --- a/common/protos/src/lib.rs +++ b/common/protos/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[allow(unsafe_code)] mod generated; diff --git a/common/protos/src/main.rs b/common/protos/src/main.rs index a971b4865..e8900eb55 100644 --- a/common/protos/src/main.rs +++ b/common/protos/src/main.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{cmp, env, fs, io::Write, path::Path, process::Command}; type AnyError = Box; diff --git a/common/protos/src/node.proto b/common/protos/src/node.proto index d77dd01a9..7e61b331f 100644 --- a/common/protos/src/node.proto +++ b/common/protos/src/node.proto @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + syntax = "proto3"; package node_service; diff --git a/common/workers/Cargo.toml b/common/workers/Cargo.toml index f5b6f25fc..4c9991897 100644 --- a/common/workers/Cargo.toml +++ b/common/workers/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "workers" edition.workspace = true diff --git a/common/workers/src/lib.rs b/common/workers/src/lib.rs index 3719b10aa..1512b3655 100644 --- a/common/workers/src/lib.rs +++ b/common/workers/src/lib.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod workers; diff --git a/common/workers/src/workers.rs b/common/workers/src/workers.rs index f6a6a94ef..eecd15dd5 100644 --- a/common/workers/src/workers.rs +++ b/common/workers/src/workers.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use tokio::sync::{Mutex, Notify}; use tracing::info; diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index 1e9556b89..ea6637e80 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-config" edition.workspace = true diff --git a/crates/config/src/constants/app.rs b/crates/config/src/constants/app.rs index 12f584821..f397203b4 100644 --- a/crates/config/src/constants/app.rs +++ b/crates/config/src/constants/app.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use const_str::concat; /// Application name diff --git a/crates/config/src/constants/env.rs b/crates/config/src/constants/env.rs index 12efd1a55..490a747e7 100644 --- a/crates/config/src/constants/env.rs +++ b/crates/config/src/constants/env.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub const DEFAULT_DELIMITER: &str = "_"; pub const ENV_PREFIX: &str = "RUSTFS_"; pub const ENV_WORD_DELIMITER: &str = "_"; diff --git a/crates/config/src/constants/mod.rs b/crates/config/src/constants/mod.rs index 2df1ffdc9..6e990e6b9 100644 --- a/crates/config/src/constants/mod.rs +++ b/crates/config/src/constants/mod.rs @@ -1,2 +1,16 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub(crate) mod app; pub(crate) mod env; diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index e63a22218..558b56a65 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[cfg(feature = "constants")] pub mod constants; #[cfg(feature = "constants")] diff --git a/crates/config/src/notify/arn.rs b/crates/config/src/notify/arn.rs index ceaf09707..a349230af 100644 --- a/crates/config/src/notify/arn.rs +++ b/crates/config/src/notify/arn.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub const DEFAULT_ARN_PARTITION: &str = "rustfs"; pub const DEFAULT_ARN_SERVICE: &str = "sqs"; diff --git a/crates/config/src/notify/mod.rs b/crates/config/src/notify/mod.rs index fd7625f2b..ca0e24b99 100644 --- a/crates/config/src/notify/mod.rs +++ b/crates/config/src/notify/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod arn; mod mqtt; mod store; diff --git a/crates/config/src/notify/mqtt.rs b/crates/config/src/notify/mqtt.rs index 8177b3d52..b949f5675 100644 --- a/crates/config/src/notify/mqtt.rs +++ b/crates/config/src/notify/mqtt.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + // MQTT Keys pub const MQTT_BROKER: &str = "broker"; pub const MQTT_TOPIC: &str = "topic"; diff --git a/crates/config/src/notify/store.rs b/crates/config/src/notify/store.rs index 604987f1c..5e3dd51cb 100644 --- a/crates/config/src/notify/store.rs +++ b/crates/config/src/notify/store.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub const DEFAULT_DIR: &str = "/opt/rustfs/events"; // Default directory for event store pub const DEFAULT_LIMIT: u64 = 100000; // Default store limit pub const DEFAULT_EXT: &str = ".unknown"; // Default file extension diff --git a/crates/config/src/notify/webhook.rs b/crates/config/src/notify/webhook.rs index 8b9d938b6..0e6770b68 100644 --- a/crates/config/src/notify/webhook.rs +++ b/crates/config/src/notify/webhook.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + // Webhook Keys pub const WEBHOOK_ENDPOINT: &str = "endpoint"; pub const WEBHOOK_AUTH_TOKEN: &str = "auth_token"; diff --git a/crates/config/src/observability/config.rs b/crates/config/src/observability/config.rs index 43f6adef3..d7b836f3e 100644 --- a/crates/config/src/observability/config.rs +++ b/crates/config/src/observability/config.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::observability::logger::LoggerConfig; use crate::observability::otel::OtelConfig; use crate::observability::sink::SinkConfig; diff --git a/crates/config/src/observability/file.rs b/crates/config/src/observability/file.rs index 6a000103c..1a6f3f4bf 100644 --- a/crates/config/src/observability/file.rs +++ b/crates/config/src/observability/file.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; use std::env; diff --git a/crates/config/src/observability/kafka.rs b/crates/config/src/observability/kafka.rs index 104ab1da4..051d11cf0 100644 --- a/crates/config/src/observability/kafka.rs +++ b/crates/config/src/observability/kafka.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; /// Kafka sink configuration diff --git a/crates/config/src/observability/logger.rs b/crates/config/src/observability/logger.rs index 68a0bff45..fc8c0bb33 100644 --- a/crates/config/src/observability/logger.rs +++ b/crates/config/src/observability/logger.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; /// Logger configuration diff --git a/crates/config/src/observability/mod.rs b/crates/config/src/observability/mod.rs index 216c074e2..fff1f5b92 100644 --- a/crates/config/src/observability/mod.rs +++ b/crates/config/src/observability/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub(crate) mod config; pub(crate) mod file; pub(crate) mod kafka; diff --git a/crates/config/src/observability/otel.rs b/crates/config/src/observability/otel.rs index 77785c687..5ef32231a 100644 --- a/crates/config/src/observability/otel.rs +++ b/crates/config/src/observability/otel.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::constants::app::{ENVIRONMENT, METER_INTERVAL, SAMPLE_RATIO, SERVICE_VERSION, USE_STDOUT}; use crate::{APP_NAME, DEFAULT_LOG_LEVEL}; use serde::{Deserialize, Serialize}; diff --git a/crates/config/src/observability/sink.rs b/crates/config/src/observability/sink.rs index 9339e06ee..b769604dd 100644 --- a/crates/config/src/observability/sink.rs +++ b/crates/config/src/observability/sink.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::observability::file::FileSink; use crate::observability::kafka::KafkaSink; use crate::observability::webhook::WebhookSink; diff --git a/crates/config/src/observability/webhook.rs b/crates/config/src/observability/webhook.rs index 8e1d32f82..bd6404f80 100644 --- a/crates/config/src/observability/webhook.rs +++ b/crates/config/src/observability/webhook.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/crates/filemeta/Cargo.toml b/crates/filemeta/Cargo.toml index 03e2310e0..b96d22747 100644 --- a/crates/filemeta/Cargo.toml +++ b/crates/filemeta/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-filemeta" edition.workspace = true diff --git a/crates/filemeta/benches/xl_meta_bench.rs b/crates/filemeta/benches/xl_meta_bench.rs index 20993dedb..09355c784 100644 --- a/crates/filemeta/benches/xl_meta_bench.rs +++ b/crates/filemeta/benches/xl_meta_bench.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use criterion::{Criterion, black_box, criterion_group, criterion_main}; use rustfs_filemeta::{FileMeta, test_data::*}; diff --git a/crates/filemeta/src/error.rs b/crates/filemeta/src/error.rs index 974c80424..a156cad6d 100644 --- a/crates/filemeta/src/error.rs +++ b/crates/filemeta/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub type Result = core::result::Result; #[derive(thiserror::Error, Debug)] diff --git a/crates/filemeta/src/fileinfo.rs b/crates/filemeta/src/fileinfo.rs index 0851ed887..9c9f0fea6 100644 --- a/crates/filemeta/src/fileinfo.rs +++ b/crates/filemeta/src/fileinfo.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use crate::headers::RESERVED_METADATA_PREFIX_LOWER; use crate::headers::RUSTFS_HEALING; diff --git a/crates/filemeta/src/filemeta.rs b/crates/filemeta/src/filemeta.rs index 677749c55..3c6a0e147 100644 --- a/crates/filemeta/src/filemeta.rs +++ b/crates/filemeta/src/filemeta.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use crate::fileinfo::{ErasureAlgo, ErasureInfo, FileInfo, FileInfoVersions, ObjectPartInfo, RawFileInfo}; use crate::filemeta_inline::InlineData; diff --git a/crates/filemeta/src/filemeta_inline.rs b/crates/filemeta/src/filemeta_inline.rs index 47fb9233b..447c2ad48 100644 --- a/crates/filemeta/src/filemeta_inline.rs +++ b/crates/filemeta/src/filemeta_inline.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use serde::{Deserialize, Serialize}; use std::io::{Cursor, Read}; diff --git a/crates/filemeta/src/headers.rs b/crates/filemeta/src/headers.rs index 6f731c272..9f687f7e3 100644 --- a/crates/filemeta/src/headers.rs +++ b/crates/filemeta/src/headers.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub const AMZ_META_UNENCRYPTED_CONTENT_LENGTH: &str = "X-Amz-Meta-X-Amz-Unencrypted-Content-Length"; pub const AMZ_META_UNENCRYPTED_CONTENT_MD5: &str = "X-Amz-Meta-X-Amz-Unencrypted-Content-Md5"; diff --git a/crates/filemeta/src/lib.rs b/crates/filemeta/src/lib.rs index 552370012..32719fdce 100644 --- a/crates/filemeta/src/lib.rs +++ b/crates/filemeta/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod error; pub mod fileinfo; mod filemeta; diff --git a/crates/filemeta/src/metacache.rs b/crates/filemeta/src/metacache.rs index a457eec8d..5c451fbb2 100644 --- a/crates/filemeta/src/metacache.rs +++ b/crates/filemeta/src/metacache.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use crate::{FileInfo, FileInfoVersions, FileMeta, FileMetaShallowVersion, VersionType, merge_file_meta_versions}; use rmp::Marker; diff --git a/crates/filemeta/src/test_data.rs b/crates/filemeta/src/test_data.rs index ca2402c6f..e2ce3953d 100644 --- a/crates/filemeta/src/test_data.rs +++ b/crates/filemeta/src/test_data.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::Result; use crate::filemeta::*; use std::collections::HashMap; diff --git a/crates/notify/Cargo.toml b/crates/notify/Cargo.toml index ac3e84643..e7fc12667 100644 --- a/crates/notify/Cargo.toml +++ b/crates/notify/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-notify" edition.workspace = true diff --git a/crates/notify/examples/full_demo.rs b/crates/notify/examples/full_demo.rs index 6723a4b52..872c5f02a 100644 --- a/crates/notify/examples/full_demo.rs +++ b/crates/notify/examples/full_demo.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::config::{Config, ENABLE_KEY, ENABLE_ON, KV, KVS}; use rustfs_config::notify::{ DEFAULT_LIMIT, DEFAULT_TARGET, MQTT_BROKER, MQTT_PASSWORD, MQTT_QOS, MQTT_QUEUE_DIR, MQTT_QUEUE_LIMIT, MQTT_TOPIC, diff --git a/crates/notify/examples/full_demo_one.rs b/crates/notify/examples/full_demo_one.rs index 265398602..e3e756e8e 100644 --- a/crates/notify/examples/full_demo_one.rs +++ b/crates/notify/examples/full_demo_one.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::config::{Config, ENABLE_KEY, ENABLE_ON, KV, KVS}; // Using Global Accessories use rustfs_config::notify::{ diff --git a/crates/notify/examples/webhook.rs b/crates/notify/examples/webhook.rs index a672ba7f8..514f75767 100644 --- a/crates/notify/examples/webhook.rs +++ b/crates/notify/examples/webhook.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use axum::routing::get; use axum::{ Router, diff --git a/crates/notify/src/arn.rs b/crates/notify/src/arn.rs index 52ce08b91..4b0297828 100644 --- a/crates/notify/src/arn.rs +++ b/crates/notify/src/arn.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::TargetError; use rustfs_config::notify::{ARN_PREFIX, DEFAULT_ARN_PARTITION, DEFAULT_ARN_SERVICE}; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/crates/notify/src/error.rs b/crates/notify/src/error.rs index 6fd7460f2..a6e2aea14 100644 --- a/crates/notify/src/error.rs +++ b/crates/notify/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::arn::TargetID; use std::io; use thiserror::Error; diff --git a/crates/notify/src/event.rs b/crates/notify/src/event.rs index 147db1d12..21d425104 100644 --- a/crates/notify/src/event.rs +++ b/crates/notify/src/event.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/crates/notify/src/factory.rs b/crates/notify/src/factory.rs index 414cff014..01fd496ef 100644 --- a/crates/notify/src/factory.rs +++ b/crates/notify/src/factory.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{ error::TargetError, target::{Target, mqtt::MQTTArgs, webhook::WebhookArgs}, diff --git a/crates/notify/src/global.rs b/crates/notify/src/global.rs index 3014a0963..68b1f23e4 100644 --- a/crates/notify/src/global.rs +++ b/crates/notify/src/global.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{Event, EventArgs, NotificationError, NotificationSystem}; use ecstore::config::Config; use once_cell::sync::Lazy; diff --git a/crates/notify/src/integration.rs b/crates/notify/src/integration.rs index 50066c628..3c78597fd 100644 --- a/crates/notify/src/integration.rs +++ b/crates/notify/src/integration.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::arn::TargetID; use crate::store::{Key, Store}; use crate::{ diff --git a/crates/notify/src/lib.rs b/crates/notify/src/lib.rs index da069849d..837020ca9 100644 --- a/crates/notify/src/lib.rs +++ b/crates/notify/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + //! RustFS Notify - A flexible and extensible event notification system for object storage. //! //! This library provides a Rust implementation of a storage bucket notification system. diff --git a/crates/notify/src/notifier.rs b/crates/notify/src/notifier.rs index ed44d7a7d..24a765fd0 100644 --- a/crates/notify/src/notifier.rs +++ b/crates/notify/src/notifier.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::arn::TargetID; use crate::{EventName, error::NotificationError, event::Event, rules::RulesMap, target::Target}; use dashmap::DashMap; diff --git a/crates/notify/src/registry.rs b/crates/notify/src/registry.rs index 71d73646e..77df09634 100644 --- a/crates/notify/src/registry.rs +++ b/crates/notify/src/registry.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::target::ChannelTargetType; use crate::{ error::TargetError, diff --git a/crates/notify/src/rules/config.rs b/crates/notify/src/rules/config.rs index c2c6cda4a..c9e929539 100644 --- a/crates/notify/src/rules/config.rs +++ b/crates/notify/src/rules/config.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::rules_map::RulesMap; use super::xml_config::ParseConfigError as BucketNotificationConfigError; use crate::EventName; diff --git a/crates/notify/src/rules/mod.rs b/crates/notify/src/rules/mod.rs index 62d909635..69b141f47 100644 --- a/crates/notify/src/rules/mod.rs +++ b/crates/notify/src/rules/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod pattern; pub mod pattern_rules; pub mod rules_map; diff --git a/crates/notify/src/rules/pattern.rs b/crates/notify/src/rules/pattern.rs index 8d1bfc808..4faceaeed 100644 --- a/crates/notify/src/rules/pattern.rs +++ b/crates/notify/src/rules/pattern.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use wildmatch::WildMatch; /// Create new pattern string based on prefix and suffix。 diff --git a/crates/notify/src/rules/pattern_rules.rs b/crates/notify/src/rules/pattern_rules.rs index 215f3c0c9..01ad800c9 100644 --- a/crates/notify/src/rules/pattern_rules.rs +++ b/crates/notify/src/rules/pattern_rules.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::pattern; use super::target_id_set::TargetIdSet; use crate::arn::TargetID; diff --git a/crates/notify/src/rules/rules_map.rs b/crates/notify/src/rules/rules_map.rs index bf3d990ff..9be138431 100644 --- a/crates/notify/src/rules/rules_map.rs +++ b/crates/notify/src/rules/rules_map.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::pattern_rules::PatternRules; use super::target_id_set::TargetIdSet; use crate::arn::TargetID; diff --git a/crates/notify/src/rules/target_id_set.rs b/crates/notify/src/rules/target_id_set.rs index 4f3a7b196..129d0dc36 100644 --- a/crates/notify/src/rules/target_id_set.rs +++ b/crates/notify/src/rules/target_id_set.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::arn::TargetID; use std::collections::HashSet; diff --git a/crates/notify/src/rules/xml_config.rs b/crates/notify/src/rules/xml_config.rs index ea995ca9e..5925a66ee 100644 --- a/crates/notify/src/rules/xml_config.rs +++ b/crates/notify/src/rules/xml_config.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::pattern; use crate::arn::{ARN, ArnError, TargetIDError}; use crate::event::EventName; diff --git a/crates/notify/src/store.rs b/crates/notify/src/store.rs index ec3e7df8a..bf54e1e2d 100644 --- a/crates/notify/src/store.rs +++ b/crates/notify/src/store.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::StoreError; use rustfs_config::notify::{COMPRESS_EXT, DEFAULT_EXT, DEFAULT_LIMIT}; use serde::{Serialize, de::DeserializeOwned}; diff --git a/crates/notify/src/stream.rs b/crates/notify/src/stream.rs index f02001ce2..0d3d5255b 100644 --- a/crates/notify/src/stream.rs +++ b/crates/notify/src/stream.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{ Event, StoreError, error::TargetError, diff --git a/crates/notify/src/target/mod.rs b/crates/notify/src/target/mod.rs index b40042802..c47a11d33 100644 --- a/crates/notify/src/target/mod.rs +++ b/crates/notify/src/target/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::arn::TargetID; use crate::store::{Key, Store}; use crate::{Event, StoreError, TargetError}; diff --git a/crates/notify/src/target/mqtt.rs b/crates/notify/src/target/mqtt.rs index 594a2f2a7..9beda90bb 100644 --- a/crates/notify/src/target/mqtt.rs +++ b/crates/notify/src/target/mqtt.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::store::Key; use crate::target::ChannelTargetType; use crate::{ diff --git a/crates/notify/src/target/webhook.rs b/crates/notify/src/target/webhook.rs index 330f8b8d4..0b3f93ded 100644 --- a/crates/notify/src/target/webhook.rs +++ b/crates/notify/src/target/webhook.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::target::ChannelTargetType; use crate::{ StoreError, Target, diff --git a/crates/obs/Cargo.toml b/crates/obs/Cargo.toml index be4e76751..88726df96 100644 --- a/crates/obs/Cargo.toml +++ b/crates/obs/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-obs" edition.workspace = true diff --git a/crates/obs/examples/config.toml b/crates/obs/examples/config.toml index 3a398bc38..74e79cabf 100644 --- a/crates/obs/examples/config.toml +++ b/crates/obs/examples/config.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [observability] endpoint = "http://localhost:4317" # Default is "http://localhost:4317" if not specified use_stdout = false # Output with stdout, true output, false no output diff --git a/crates/obs/examples/server.rs b/crates/obs/examples/server.rs index ed2f74c17..fc413957a 100644 --- a/crates/obs/examples/server.rs +++ b/crates/obs/examples/server.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use opentelemetry::global; use rustfs_obs::{BaseLogEntry, ServerLogEntry, SystemObserver, get_logger, init_obs, log_info}; use std::collections::HashMap; diff --git a/crates/obs/src/config.rs b/crates/obs/src/config.rs index bfe874839..0ddeab57a 100644 --- a/crates/obs/src/config.rs +++ b/crates/obs/src/config.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use rustfs_config::{ APP_NAME, DEFAULT_LOG_DIR, DEFAULT_LOG_FILENAME, DEFAULT_LOG_KEEP_FILES, DEFAULT_LOG_LEVEL, DEFAULT_LOG_ROTATION_SIZE_MB, DEFAULT_LOG_ROTATION_TIME, ENVIRONMENT, METER_INTERVAL, SAMPLE_RATIO, SERVICE_VERSION, USE_STDOUT, diff --git a/crates/obs/src/entry/args.rs b/crates/obs/src/entry/args.rs index 1099398ac..d0e4df38f 100644 --- a/crates/obs/src/entry/args.rs +++ b/crates/obs/src/entry/args.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::entry::ObjectVersion; use serde::{Deserialize, Serialize}; use std::collections::HashMap; diff --git a/crates/obs/src/entry/audit.rs b/crates/obs/src/entry/audit.rs index 0aba2bac3..47017a1fd 100644 --- a/crates/obs/src/entry/audit.rs +++ b/crates/obs/src/entry/audit.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{BaseLogEntry, LogRecord, ObjectVersion}; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; diff --git a/crates/obs/src/entry/base.rs b/crates/obs/src/entry/base.rs index 422646e09..23c05c3f6 100644 --- a/crates/obs/src/entry/base.rs +++ b/crates/obs/src/entry/base.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_json::Value; diff --git a/crates/obs/src/entry/mod.rs b/crates/obs/src/entry/mod.rs index 6718e5050..9c319ffdf 100644 --- a/crates/obs/src/entry/mod.rs +++ b/crates/obs/src/entry/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub(crate) mod args; pub(crate) mod audit; pub(crate) mod base; diff --git a/crates/obs/src/entry/unified.rs b/crates/obs/src/entry/unified.rs index 877b2f8fc..6248f1500 100644 --- a/crates/obs/src/entry/unified.rs +++ b/crates/obs/src/entry/unified.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{AuditLogEntry, BaseLogEntry, LogKind, LogRecord, SerializableLevel}; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; diff --git a/crates/obs/src/global.rs b/crates/obs/src/global.rs index 3d5405c47..56fa50491 100644 --- a/crates/obs/src/global.rs +++ b/crates/obs/src/global.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::logger::InitLogStatus; use crate::telemetry::{OtelGuard, init_telemetry}; use crate::{AppConfig, Logger, get_global_logger, init_global_logger}; diff --git a/crates/obs/src/lib.rs b/crates/obs/src/lib.rs index 58013ae2a..4b7775fa2 100644 --- a/crates/obs/src/lib.rs +++ b/crates/obs/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + //! # RustFS Observability //! //! provides tools for system and service monitoring diff --git a/crates/obs/src/logger.rs b/crates/obs/src/logger.rs index 9a29f67c6..0cd4e885a 100644 --- a/crates/obs/src/logger.rs +++ b/crates/obs/src/logger.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::sinks::Sink; use crate::{ AppConfig, AuditLogEntry, BaseLogEntry, ConsoleLogEntry, GlobalError, OtelConfig, ServerLogEntry, UnifiedLogEntry, sinks, diff --git a/crates/obs/src/metrics/audit.rs b/crates/obs/src/metrics/audit.rs index 5bc3ee398..064b5c659 100644 --- a/crates/obs/src/metrics/audit.rs +++ b/crates/obs/src/metrics/audit.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// audit related metric descriptors /// /// This module contains the metric descriptors for the audit subsystem. diff --git a/crates/obs/src/metrics/bucket.rs b/crates/obs/src/metrics/bucket.rs index d008e89ba..77d21a32d 100644 --- a/crates/obs/src/metrics/bucket.rs +++ b/crates/obs/src/metrics/bucket.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// bucket level s3 metric descriptor use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, new_histogram_md, subsystems}; diff --git a/crates/obs/src/metrics/bucket_replication.rs b/crates/obs/src/metrics/bucket_replication.rs index 53872ebc6..0987ee18f 100644 --- a/crates/obs/src/metrics/bucket_replication.rs +++ b/crates/obs/src/metrics/bucket_replication.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Bucket copy metric descriptor use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/cluster_config.rs b/crates/obs/src/metrics/cluster_config.rs index b9bc8ea71..85f93305b 100644 --- a/crates/obs/src/metrics/cluster_config.rs +++ b/crates/obs/src/metrics/cluster_config.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Metric descriptors related to cluster configuration use crate::metrics::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/cluster_erasure_set.rs b/crates/obs/src/metrics/cluster_erasure_set.rs index 9f129cf7f..7164aaca2 100644 --- a/crates/obs/src/metrics/cluster_erasure_set.rs +++ b/crates/obs/src/metrics/cluster_erasure_set.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Erasure code set related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/cluster_health.rs b/crates/obs/src/metrics/cluster_health.rs index 964176016..d4ac51993 100644 --- a/crates/obs/src/metrics/cluster_health.rs +++ b/crates/obs/src/metrics/cluster_health.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Cluster health-related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/cluster_iam.rs b/crates/obs/src/metrics/cluster_iam.rs index 29a15cf87..2c04f32c3 100644 --- a/crates/obs/src/metrics/cluster_iam.rs +++ b/crates/obs/src/metrics/cluster_iam.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// IAM related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, subsystems}; diff --git a/crates/obs/src/metrics/cluster_notification.rs b/crates/obs/src/metrics/cluster_notification.rs index 9db517c1a..8b7845228 100644 --- a/crates/obs/src/metrics/cluster_notification.rs +++ b/crates/obs/src/metrics/cluster_notification.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Notify the relevant metric descriptor use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, subsystems}; diff --git a/crates/obs/src/metrics/cluster_usage.rs b/crates/obs/src/metrics/cluster_usage.rs index 351e23d54..633c51333 100644 --- a/crates/obs/src/metrics/cluster_usage.rs +++ b/crates/obs/src/metrics/cluster_usage.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Descriptors of metrics related to cluster object and bucket usage use crate::metrics::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/entry/descriptor.rs b/crates/obs/src/metrics/entry/descriptor.rs index 30d1cdc03..a80861f07 100644 --- a/crates/obs/src/metrics/entry/descriptor.rs +++ b/crates/obs/src/metrics/entry/descriptor.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::metrics::{MetricName, MetricNamespace, MetricSubsystem, MetricType}; use std::collections::HashSet; diff --git a/crates/obs/src/metrics/entry/metric_name.rs b/crates/obs/src/metrics/entry/metric_name.rs index 0da80692a..1acc6aed2 100644 --- a/crates/obs/src/metrics/entry/metric_name.rs +++ b/crates/obs/src/metrics/entry/metric_name.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// The metric name is the individual name of the metric #[allow(dead_code)] #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/crates/obs/src/metrics/entry/metric_type.rs b/crates/obs/src/metrics/entry/metric_type.rs index d9a4a9498..33d8a78dd 100644 --- a/crates/obs/src/metrics/entry/metric_type.rs +++ b/crates/obs/src/metrics/entry/metric_type.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// MetricType - Indicates the type of indicator #[allow(dead_code)] #[derive(Debug, Clone, Copy, PartialEq, Eq)] diff --git a/crates/obs/src/metrics/entry/mod.rs b/crates/obs/src/metrics/entry/mod.rs index 937435538..b632769fc 100644 --- a/crates/obs/src/metrics/entry/mod.rs +++ b/crates/obs/src/metrics/entry/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::metrics::{MetricDescriptor, MetricName, MetricNamespace, MetricSubsystem, MetricType}; pub(crate) mod descriptor; diff --git a/crates/obs/src/metrics/entry/namespace.rs b/crates/obs/src/metrics/entry/namespace.rs index 0f4db1183..31c3ce590 100644 --- a/crates/obs/src/metrics/entry/namespace.rs +++ b/crates/obs/src/metrics/entry/namespace.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// The metric namespace, which represents the top-level grouping of the metric #[derive(Debug, Clone, PartialEq, Eq)] pub enum MetricNamespace { diff --git a/crates/obs/src/metrics/entry/path_utils.rs b/crates/obs/src/metrics/entry/path_utils.rs index 1275a826a..f8b63da28 100644 --- a/crates/obs/src/metrics/entry/path_utils.rs +++ b/crates/obs/src/metrics/entry/path_utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Format the path to the metric name format /// Replace '/' and '-' with '_' #[allow(dead_code)] diff --git a/crates/obs/src/metrics/entry/subsystem.rs b/crates/obs/src/metrics/entry/subsystem.rs index eeaad997f..0b081ae51 100644 --- a/crates/obs/src/metrics/entry/subsystem.rs +++ b/crates/obs/src/metrics/entry/subsystem.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::metrics::entry::path_utils::format_path_to_metric_name; /// The metrics subsystem is a subgroup of metrics within a namespace diff --git a/crates/obs/src/metrics/ilm.rs b/crates/obs/src/metrics/ilm.rs index d9a5b9a90..fa79758d6 100644 --- a/crates/obs/src/metrics/ilm.rs +++ b/crates/obs/src/metrics/ilm.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// ILM-related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/logger_webhook.rs b/crates/obs/src/metrics/logger_webhook.rs index 985642a65..9d5d496a5 100644 --- a/crates/obs/src/metrics/logger_webhook.rs +++ b/crates/obs/src/metrics/logger_webhook.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// A descriptor for metrics related to webhook logs use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/mod.rs b/crates/obs/src/metrics/mod.rs index 150b3daf1..97c6a1583 100644 --- a/crates/obs/src/metrics/mod.rs +++ b/crates/obs/src/metrics/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub(crate) mod audit; pub(crate) mod bucket; pub(crate) mod bucket_replication; diff --git a/crates/obs/src/metrics/replication.rs b/crates/obs/src/metrics/replication.rs index c688ff56b..4734c93d5 100644 --- a/crates/obs/src/metrics/replication.rs +++ b/crates/obs/src/metrics/replication.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Copy the relevant metric descriptor use crate::metrics::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/request.rs b/crates/obs/src/metrics/request.rs index b96e66dfa..f90f2a4e8 100644 --- a/crates/obs/src/metrics/request.rs +++ b/crates/obs/src/metrics/request.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::metrics::{MetricDescriptor, MetricName, MetricSubsystem, new_counter_md, new_gauge_md, subsystems}; lazy_static::lazy_static! { diff --git a/crates/obs/src/metrics/scanner.rs b/crates/obs/src/metrics/scanner.rs index e91369032..7be4ac5b1 100644 --- a/crates/obs/src/metrics/scanner.rs +++ b/crates/obs/src/metrics/scanner.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Scanner-related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/system_cpu.rs b/crates/obs/src/metrics/system_cpu.rs index b75b4552b..51d0d5f1a 100644 --- a/crates/obs/src/metrics/system_cpu.rs +++ b/crates/obs/src/metrics/system_cpu.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// CPU system-related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/system_drive.rs b/crates/obs/src/metrics/system_drive.rs index 09eaa7c65..8815e8d5f 100644 --- a/crates/obs/src/metrics/system_drive.rs +++ b/crates/obs/src/metrics/system_drive.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Drive-related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/system_memory.rs b/crates/obs/src/metrics/system_memory.rs index 4e062a95b..85538fca1 100644 --- a/crates/obs/src/metrics/system_memory.rs +++ b/crates/obs/src/metrics/system_memory.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Memory-related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/system_network.rs b/crates/obs/src/metrics/system_network.rs index b3657e727..635a21a2f 100644 --- a/crates/obs/src/metrics/system_network.rs +++ b/crates/obs/src/metrics/system_network.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// Network-related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; diff --git a/crates/obs/src/metrics/system_process.rs b/crates/obs/src/metrics/system_process.rs index f021aabe9..9cb637460 100644 --- a/crates/obs/src/metrics/system_process.rs +++ b/crates/obs/src/metrics/system_process.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /// process related metric descriptors use crate::metrics::{MetricDescriptor, MetricName, new_counter_md, new_gauge_md, subsystems}; diff --git a/crates/obs/src/sinks/file.rs b/crates/obs/src/sinks/file.rs index e79c62ab9..1bbcdf02b 100644 --- a/crates/obs/src/sinks/file.rs +++ b/crates/obs/src/sinks/file.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::sinks::Sink; use crate::{LogRecord, UnifiedLogEntry}; use async_trait::async_trait; diff --git a/crates/obs/src/sinks/kafka.rs b/crates/obs/src/sinks/kafka.rs index e4ef34199..3dd9ad5a6 100644 --- a/crates/obs/src/sinks/kafka.rs +++ b/crates/obs/src/sinks/kafka.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::sinks::Sink; use crate::{LogRecord, UnifiedLogEntry}; use async_trait::async_trait; @@ -83,7 +97,7 @@ impl KafkaSink { let payload = match serde_json::to_string(&entry) { Ok(p) => p, Err(e) => { - eprintln!("Failed to serialize log entry: {}", e); + eprintln!("Failed to serialize log entry: {e}"); continue; } }; @@ -160,6 +174,6 @@ impl Drop for KafkaSink { } }); - eprintln!("Dropping KafkaSink with topic: {}", self.topic); + eprintln!("Dropping KafkaSink with topic: {0}", self.topic); } } diff --git a/crates/obs/src/sinks/mod.rs b/crates/obs/src/sinks/mod.rs index 3abafd3fe..5ff5a7fa6 100644 --- a/crates/obs/src/sinks/mod.rs +++ b/crates/obs/src/sinks/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{AppConfig, SinkConfig, UnifiedLogEntry}; use async_trait::async_trait; use std::sync::Arc; diff --git a/crates/obs/src/sinks/webhook.rs b/crates/obs/src/sinks/webhook.rs index 82d4df410..8350b016a 100644 --- a/crates/obs/src/sinks/webhook.rs +++ b/crates/obs/src/sinks/webhook.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::UnifiedLogEntry; use crate::sinks::Sink; use async_trait::async_trait; @@ -57,7 +71,7 @@ impl Sink for WebhookSink { } } - eprintln!("Failed to send log to webhook after {} retries", self.max_retries); + eprintln!("Failed to send log to webhook after {0} retries", self.max_retries); } } @@ -65,6 +79,6 @@ impl Drop for WebhookSink { fn drop(&mut self) { // Perform any necessary cleanup here // For example, you might want to log that the sink is being dropped - eprintln!("Dropping WebhookSink with URL: {}", self.endpoint); + eprintln!("Dropping WebhookSink with URL: {0}", self.endpoint); } } diff --git a/crates/obs/src/system/attributes.rs b/crates/obs/src/system/attributes.rs index 289b4b66a..9cd34fcec 100644 --- a/crates/obs/src/system/attributes.rs +++ b/crates/obs/src/system/attributes.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::GlobalError; use opentelemetry::KeyValue; use sysinfo::{Pid, System}; diff --git a/crates/obs/src/system/collector.rs b/crates/obs/src/system/collector.rs index 0d1cac5a3..ecaa05101 100644 --- a/crates/obs/src/system/collector.rs +++ b/crates/obs/src/system/collector.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::GlobalError; use crate::system::attributes::ProcessAttributes; use crate::system::gpu::GpuCollector; diff --git a/crates/obs/src/system/gpu.rs b/crates/obs/src/system/gpu.rs index 735af335d..edb33a2f0 100644 --- a/crates/obs/src/system/gpu.rs +++ b/crates/obs/src/system/gpu.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[cfg(feature = "gpu")] use crate::GlobalError; #[cfg(feature = "gpu")] diff --git a/crates/obs/src/system/metrics.rs b/crates/obs/src/system/metrics.rs index 114c285ea..3e1e86093 100644 --- a/crates/obs/src/system/metrics.rs +++ b/crates/obs/src/system/metrics.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub const PROCESS_CPU_USAGE: &str = "process.cpu.usage"; pub const PROCESS_CPU_UTILIZATION: &str = "process.cpu.utilization"; pub const PROCESS_MEMORY_USAGE: &str = "process.memory.usage"; diff --git a/crates/obs/src/system/mod.rs b/crates/obs/src/system/mod.rs index c89206126..4e71ba603 100644 --- a/crates/obs/src/system/mod.rs +++ b/crates/obs/src/system/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::GlobalError; pub(crate) mod attributes; diff --git a/crates/obs/src/telemetry.rs b/crates/obs/src/telemetry.rs index fe71e343e..fe82bfccf 100644 --- a/crates/obs/src/telemetry.rs +++ b/crates/obs/src/telemetry.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::OtelConfig; use flexi_logger::{Age, Cleanup, Criterion, DeferredNow, FileSpec, LogSpecification, Naming, Record, WriteMode, style}; use nu_ansi_term::Color; diff --git a/crates/obs/src/worker.rs b/crates/obs/src/worker.rs index 7dec8a11d..144ecd7c5 100644 --- a/crates/obs/src/worker.rs +++ b/crates/obs/src/worker.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{UnifiedLogEntry, sinks::Sink}; use std::sync::Arc; use tokio::sync::mpsc::Receiver; diff --git a/crates/rio/Cargo.toml b/crates/rio/Cargo.toml index 54d9ad675..f4f65db2b 100644 --- a/crates/rio/Cargo.toml +++ b/crates/rio/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-rio" edition.workspace = true diff --git a/crates/rio/src/compress_index.rs b/crates/rio/src/compress_index.rs index 7d49619d0..d1f6c0156 100644 --- a/crates/rio/src/compress_index.rs +++ b/crates/rio/src/compress_index.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use bytes::Bytes; use serde::{Deserialize, Serialize}; use std::io::{self, Read, Seek, SeekFrom}; diff --git a/crates/rio/src/compress_reader.rs b/crates/rio/src/compress_reader.rs index 47061ec14..be8d7fd8c 100644 --- a/crates/rio/src/compress_reader.rs +++ b/crates/rio/src/compress_reader.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::compress_index::{Index, TryGetIndex}; use crate::{EtagResolvable, HashReaderDetector}; use crate::{HashReaderMut, Reader}; diff --git a/crates/rio/src/encrypt_reader.rs b/crates/rio/src/encrypt_reader.rs index a1b814c35..e3a3cf5b7 100644 --- a/crates/rio/src/encrypt_reader.rs +++ b/crates/rio/src/encrypt_reader.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::HashReaderDetector; use crate::HashReaderMut; use crate::compress_index::{Index, TryGetIndex}; diff --git a/crates/rio/src/etag.rs b/crates/rio/src/etag.rs index 81bfd24ef..bebcacd18 100644 --- a/crates/rio/src/etag.rs +++ b/crates/rio/src/etag.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + /*! # AsyncRead Wrapper Types with ETag Support diff --git a/crates/rio/src/etag_reader.rs b/crates/rio/src/etag_reader.rs index f76f9fdd6..f999e0b7c 100644 --- a/crates/rio/src/etag_reader.rs +++ b/crates/rio/src/etag_reader.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::compress_index::{Index, TryGetIndex}; use crate::{EtagResolvable, HashReaderDetector, HashReaderMut, Reader}; use md5::{Digest, Md5}; diff --git a/crates/rio/src/hardlimit_reader.rs b/crates/rio/src/hardlimit_reader.rs index e18d46833..183f81616 100644 --- a/crates/rio/src/hardlimit_reader.rs +++ b/crates/rio/src/hardlimit_reader.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::compress_index::{Index, TryGetIndex}; use crate::{EtagResolvable, HashReaderDetector, HashReaderMut, Reader}; use pin_project_lite::pin_project; diff --git a/crates/rio/src/hash_reader.rs b/crates/rio/src/hash_reader.rs index d00721d1d..2f591cd7c 100644 --- a/crates/rio/src/hash_reader.rs +++ b/crates/rio/src/hash_reader.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + //! HashReader implementation with generic support //! //! This module provides a generic `HashReader` that can wrap any type implementing diff --git a/crates/rio/src/http_reader.rs b/crates/rio/src/http_reader.rs index b842d5852..3bea4099b 100644 --- a/crates/rio/src/http_reader.rs +++ b/crates/rio/src/http_reader.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use bytes::Bytes; use futures::{Stream, TryStreamExt as _}; use http::HeaderMap; diff --git a/crates/rio/src/lib.rs b/crates/rio/src/lib.rs index 7f961cc16..a36b95125 100644 --- a/crates/rio/src/lib.rs +++ b/crates/rio/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod limit_reader; pub use limit_reader::LimitReader; diff --git a/crates/rio/src/limit_reader.rs b/crates/rio/src/limit_reader.rs index 4e2ac18b1..c95e98b14 100644 --- a/crates/rio/src/limit_reader.rs +++ b/crates/rio/src/limit_reader.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + //! LimitReader: a wrapper for AsyncRead that limits the total number of bytes read. //! //! # Example diff --git a/crates/rio/src/reader.rs b/crates/rio/src/reader.rs index 147a315c3..e2a83e28e 100644 --- a/crates/rio/src/reader.rs +++ b/crates/rio/src/reader.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::pin::Pin; use std::task::{Context, Poll}; use tokio::io::{AsyncRead, ReadBuf}; diff --git a/crates/rio/src/writer.rs b/crates/rio/src/writer.rs index d81bf015d..a67880d33 100644 --- a/crates/rio/src/writer.rs +++ b/crates/rio/src/writer.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::io::Cursor; use std::pin::Pin; use tokio::io::AsyncWrite; diff --git a/crates/signer/Cargo.toml b/crates/signer/Cargo.toml index c7a0f0aa0..42831a33e 100644 --- a/crates/signer/Cargo.toml +++ b/crates/signer/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-signer" edition.workspace = true diff --git a/crates/signer/src/constants.rs b/crates/signer/src/constants.rs index 54229fef5..a2338235e 100644 --- a/crates/signer/src/constants.rs +++ b/crates/signer/src/constants.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use time::{format_description::FormatItem, macros::format_description}; pub const UNSIGNED_PAYLOAD: &str = "UNSIGNED-PAYLOAD"; diff --git a/crates/signer/src/lib.rs b/crates/signer/src/lib.rs index a82865151..c13f33db9 100644 --- a/crates/signer/src/lib.rs +++ b/crates/signer/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod constants; pub mod request_signature_streaming; pub mod request_signature_streaming_unsigned_trailer; diff --git a/crates/signer/src/request_signature_streaming.rs b/crates/signer/src/request_signature_streaming.rs index a96796bac..b82fe7d09 100644 --- a/crates/signer/src/request_signature_streaming.rs +++ b/crates/signer/src/request_signature_streaming.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use http::{HeaderMap, HeaderValue, request}; use lazy_static::lazy_static; use std::collections::HashMap; diff --git a/crates/signer/src/request_signature_streaming_unsigned_trailer.rs b/crates/signer/src/request_signature_streaming_unsigned_trailer.rs index f26ca4bc4..a68650029 100644 --- a/crates/signer/src/request_signature_streaming_unsigned_trailer.rs +++ b/crates/signer/src/request_signature_streaming_unsigned_trailer.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use http::{HeaderValue, request}; use time::{OffsetDateTime, macros::format_description}; diff --git a/crates/signer/src/request_signature_v2.rs b/crates/signer/src/request_signature_v2.rs index 04a647f60..49d7a1912 100644 --- a/crates/signer/src/request_signature_v2.rs +++ b/crates/signer/src/request_signature_v2.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use bytes::BytesMut; use http::request; use hyper::Uri; diff --git a/crates/signer/src/request_signature_v4.rs b/crates/signer/src/request_signature_v4.rs index e3ef97e27..21f482abc 100644 --- a/crates/signer/src/request_signature_v4.rs +++ b/crates/signer/src/request_signature_v4.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use bytes::BytesMut; use http::HeaderMap; use http::Uri; diff --git a/crates/signer/src/utils.rs b/crates/signer/src/utils.rs index 90052ff30..d1121287a 100644 --- a/crates/signer/src/utils.rs +++ b/crates/signer/src/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use http::request; pub fn get_host_addr(req: &request::Builder) -> String { diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index c4f9f13ea..17384238f 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-utils" edition.workspace = true diff --git a/crates/utils/src/certs.rs b/crates/utils/src/certs.rs index d5528b293..c89b9cfd1 100644 --- a/crates/utils/src/certs.rs +++ b/crates/utils/src/certs.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use rustfs_config::{RUSTFS_TLS_CERT, RUSTFS_TLS_KEY}; use rustls::server::{ClientHello, ResolvesServerCert, ResolvesServerCertUsingSni}; use rustls::sign::CertifiedKey; diff --git a/crates/utils/src/compress.rs b/crates/utils/src/compress.rs index e1ad1c725..2c2612787 100644 --- a/crates/utils/src/compress.rs +++ b/crates/utils/src/compress.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::io::Write; use tokio::io; diff --git a/crates/utils/src/crypto.rs b/crates/utils/src/crypto.rs index 7c298215b..d29011a20 100644 --- a/crates/utils/src/crypto.rs +++ b/crates/utils/src/crypto.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::mem::MaybeUninit; use hex_simd::{AsOut, AsciiCase}; diff --git a/crates/utils/src/dirs.rs b/crates/utils/src/dirs.rs index 58287bf98..f56af1925 100644 --- a/crates/utils/src/dirs.rs +++ b/crates/utils/src/dirs.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::env; use std::path::{Path, PathBuf}; diff --git a/crates/utils/src/hash.rs b/crates/utils/src/hash.rs index a2b503a02..d770bb297 100644 --- a/crates/utils/src/hash.rs +++ b/crates/utils/src/hash.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use highway::{HighwayHash, HighwayHasher, Key}; use md5::{Digest, Md5}; use serde::{Deserialize, Serialize}; diff --git a/crates/utils/src/hasher.rs b/crates/utils/src/hasher.rs index 06e39ec85..26a02f80d 100644 --- a/crates/utils/src/hasher.rs +++ b/crates/utils/src/hasher.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use md5::{Digest as Md5Digest, Md5}; use sha2::{ Sha256 as sha_sha256, diff --git a/crates/utils/src/io.rs b/crates/utils/src/io.rs index 36f794258..8a4fe43ce 100644 --- a/crates/utils/src/io.rs +++ b/crates/utils/src/io.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; /// Write all bytes from buf to writer, returning the total number of bytes written. diff --git a/crates/utils/src/ip.rs b/crates/utils/src/ip.rs index 5c73b5fe2..ed7fea3ee 100644 --- a/crates/utils/src/ip.rs +++ b/crates/utils/src/ip.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::net::{IpAddr, Ipv4Addr}; /// Get the IP address of the machine diff --git a/crates/utils/src/lib.rs b/crates/utils/src/lib.rs index 234c94429..0e1e8a9cc 100644 --- a/crates/utils/src/lib.rs +++ b/crates/utils/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[cfg(feature = "tls")] pub mod certs; #[cfg(feature = "ip")] diff --git a/crates/utils/src/net.rs b/crates/utils/src/net.rs index 2882f9cae..4fb78c3a1 100644 --- a/crates/utils/src/net.rs +++ b/crates/utils/src/net.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use bytes::Bytes; use futures::pin_mut; use futures::{Stream, StreamExt}; diff --git a/crates/utils/src/notify/mod.rs b/crates/utils/src/notify/mod.rs index 7fb5771d9..f5a7dcb93 100644 --- a/crates/utils/src/notify/mod.rs +++ b/crates/utils/src/notify/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use hyper::HeaderMap; use s3s::{S3Request, S3Response}; use std::collections::HashMap; diff --git a/crates/utils/src/os/linux.rs b/crates/utils/src/os/linux.rs index a1ea8fb4d..e2c6d46e5 100644 --- a/crates/utils/src/os/linux.rs +++ b/crates/utils/src/os/linux.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use nix::sys::stat::{self, stat}; use nix::sys::statfs::{self, FsType, statfs}; use std::fs::File; @@ -163,6 +177,6 @@ mod test { let major = 7; let minor = 11; let s = get_drive_stats(major, minor).unwrap(); - println!("{:?}", s); + println!("{s:?}"); } } diff --git a/crates/utils/src/os/mod.rs b/crates/utils/src/os/mod.rs index 29bfb3166..72142bd66 100644 --- a/crates/utils/src/os/mod.rs +++ b/crates/utils/src/os/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[cfg(target_os = "linux")] mod linux; #[cfg(all(unix, not(target_os = "linux")))] diff --git a/crates/utils/src/os/unix.rs b/crates/utils/src/os/unix.rs index 40206f2a3..05273ecf3 100644 --- a/crates/utils/src/os/unix.rs +++ b/crates/utils/src/os/unix.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{DiskInfo, IOStats}; use nix::sys::{stat::stat, statfs::statfs}; use std::io::Error; diff --git a/crates/utils/src/os/windows.rs b/crates/utils/src/os/windows.rs index 0791c8ae7..3c4c17fe9 100644 --- a/crates/utils/src/os/windows.rs +++ b/crates/utils/src/os/windows.rs @@ -1,4 +1,17 @@ #![allow(unsafe_code)] // TODO: audit unsafe code +// Copyright 2024 RustFS Team +// +// 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. use super::{DiskInfo, IOStats}; use std::io::Error; diff --git a/crates/utils/src/path.rs b/crates/utils/src/path.rs index 8871f2328..dd1401d8e 100644 --- a/crates/utils/src/path.rs +++ b/crates/utils/src/path.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::path::Path; use std::path::PathBuf; diff --git a/crates/utils/src/retry.rs b/crates/utils/src/retry.rs index d78b754bf..ce07253af 100644 --- a/crates/utils/src/retry.rs +++ b/crates/utils/src/retry.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::time::Duration; pub const MAX_RETRY: i64 = 10; diff --git a/crates/utils/src/string.rs b/crates/utils/src/string.rs index 6139436d3..171238420 100644 --- a/crates/utils/src/string.rs +++ b/crates/utils/src/string.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use lazy_static::*; use rand::{Rng, RngCore}; use regex::Regex; diff --git a/crates/utils/src/sys/mod.rs b/crates/utils/src/sys/mod.rs index 93d3cdad0..a4144db7d 100644 --- a/crates/utils/src/sys/mod.rs +++ b/crates/utils/src/sys/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod user_agent; pub use user_agent::ServiceType; diff --git a/crates/utils/src/sys/user_agent.rs b/crates/utils/src/sys/user_agent.rs index 00be57942..e50b6f65e 100644 --- a/crates/utils/src/sys/user_agent.rs +++ b/crates/utils/src/sys/user_agent.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use rustfs_config::VERSION; use std::env; use std::fmt; diff --git a/crates/zip/Cargo.toml b/crates/zip/Cargo.toml index cd66794e3..5c5b6324b 100644 --- a/crates/zip/Cargo.toml +++ b/crates/zip/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs-zip" edition.workspace = true diff --git a/crates/zip/src/lib.rs b/crates/zip/src/lib.rs index 44f00f1f9..fba9a01ae 100644 --- a/crates/zip/src/lib.rs +++ b/crates/zip/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use async_compression::tokio::bufread::{BzDecoder, GzipDecoder, XzDecoder, ZlibDecoder, ZstdDecoder}; use async_compression::tokio::write::{BzEncoder, GzipEncoder, XzEncoder, ZlibEncoder, ZstdEncoder}; // use async_zip::tokio::read::seek::ZipFileReader; diff --git a/crypto/Cargo.toml b/crypto/Cargo.toml index 2a7e4f325..7d341ffe2 100644 --- a/crypto/Cargo.toml +++ b/crypto/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "crypto" edition.workspace = true diff --git a/crypto/src/encdec.rs b/crypto/src/encdec.rs index 0aec217c2..134eb3079 100644 --- a/crypto/src/encdec.rs +++ b/crypto/src/encdec.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[cfg(not(feature = "fips"))] mod aes; diff --git a/crypto/src/encdec/aes.rs b/crypto/src/encdec/aes.rs index e1a3649a1..aa5d9ddaf 100644 --- a/crypto/src/encdec/aes.rs +++ b/crypto/src/encdec/aes.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub fn native_aes() -> bool { cfg_if::cfg_if! { if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { diff --git a/crypto/src/encdec/decrypt.rs b/crypto/src/encdec/decrypt.rs index 8c46ab469..314c6472f 100644 --- a/crypto/src/encdec/decrypt.rs +++ b/crypto/src/encdec/decrypt.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[cfg(any(test, feature = "crypto"))] pub fn decrypt_data(password: &[u8], data: &[u8]) -> Result, crate::Error> { use crate::encdec::id::ID; diff --git a/crypto/src/encdec/encrypt.rs b/crypto/src/encdec/encrypt.rs index 7483161b4..622910c4e 100644 --- a/crypto/src/encdec/encrypt.rs +++ b/crypto/src/encdec/encrypt.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[cfg(any(test, feature = "crypto"))] pub fn encrypt_data(password: &[u8], data: &[u8]) -> Result, crate::Error> { use crate::encdec::id::ID; diff --git a/crypto/src/encdec/id.rs b/crypto/src/encdec/id.rs index 1c1321408..956e8fbb6 100644 --- a/crypto/src/encdec/id.rs +++ b/crypto/src/encdec/id.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use argon2::{Algorithm, Argon2, Params, Version}; use pbkdf2::pbkdf2_hmac; use sha2::Sha256; diff --git a/crypto/src/encdec/tests.rs b/crypto/src/encdec/tests.rs index 6d2df36f6..03b4ace07 100644 --- a/crypto/src/encdec/tests.rs +++ b/crypto/src/encdec/tests.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{decrypt_data, encrypt_data}; const PASSWORD: &[u8] = "test_password".as_bytes(); diff --git a/crypto/src/error.rs b/crypto/src/error.rs index d75ddde63..189ca09ed 100644 --- a/crypto/src/error.rs +++ b/crypto/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[derive(thiserror::Error, Debug)] pub enum Error { #[error("unexpected header")] diff --git a/crypto/src/jwt.rs b/crypto/src/jwt.rs index e8d4e0f9f..80e44a7d8 100644 --- a/crypto/src/jwt.rs +++ b/crypto/src/jwt.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod decode; pub mod encode; pub use serde_json::Value as Claims; diff --git a/crypto/src/jwt/decode.rs b/crypto/src/jwt/decode.rs index e221d1d4f..2c5218203 100644 --- a/crypto/src/jwt/decode.rs +++ b/crypto/src/jwt/decode.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use jsonwebtoken::{Algorithm, DecodingKey, TokenData, Validation}; use crate::Error; diff --git a/crypto/src/jwt/encode.rs b/crypto/src/jwt/encode.rs index e2d314834..86cf4c419 100644 --- a/crypto/src/jwt/encode.rs +++ b/crypto/src/jwt/encode.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use jsonwebtoken::{Algorithm, EncodingKey, Header}; use crate::Error; diff --git a/crypto/src/jwt/tests.rs b/crypto/src/jwt/tests.rs index 49730ff22..d0adf5c12 100644 --- a/crypto/src/jwt/tests.rs +++ b/crypto/src/jwt/tests.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde_json::json; use time::OffsetDateTime; diff --git a/crypto/src/lib.rs b/crypto/src/lib.rs index 311828049..8969f9cae 100644 --- a/crypto/src/lib.rs +++ b/crypto/src/lib.rs @@ -1,4 +1,17 @@ #![deny(clippy::unwrap_used)] +// Copyright 2024 RustFS Team +// +// 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. mod encdec; mod error; diff --git a/docker-compose-obs.yaml b/docker-compose-obs.yaml index bafefe57d..8878574de 100644 --- a/docker-compose-obs.yaml +++ b/docker-compose-obs.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + services: otel-collector: image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.127.0 diff --git a/docker-compose.yaml b/docker-compose.yaml index b26b84a63..d34b0df26 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + services: node0: image: rustfs:v1 # 替换为你的镜像名称和标签 diff --git a/docker-compose.yml b/docker-compose.yml index 1b528a416..76fcd047c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + version: '3.8' services: diff --git a/e2e_test/Cargo.toml b/e2e_test/Cargo.toml index 811980056..442963916 100644 --- a/e2e_test/Cargo.toml +++ b/e2e_test/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "e2e_test" version.workspace = true diff --git a/e2e_test/src/lib.rs b/e2e_test/src/lib.rs index 07abfb171..f555fd80f 100644 --- a/e2e_test/src/lib.rs +++ b/e2e_test/src/lib.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod reliant; diff --git a/e2e_test/src/reliant/lock.rs b/e2e_test/src/reliant/lock.rs index a957b14a3..078d9aef0 100644 --- a/e2e_test/src/reliant/lock.rs +++ b/e2e_test/src/reliant/lock.rs @@ -1,4 +1,17 @@ #![cfg(test)] +// Copyright 2024 RustFS Team +// +// 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. use std::{error::Error, sync::Arc, time::Duration}; diff --git a/e2e_test/src/reliant/mod.rs b/e2e_test/src/reliant/mod.rs index 897f8ffc6..e3d11ebc2 100644 --- a/e2e_test/src/reliant/mod.rs +++ b/e2e_test/src/reliant/mod.rs @@ -1,2 +1,16 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod lock; mod node_interact_test; diff --git a/e2e_test/src/reliant/node_interact_test.rs b/e2e_test/src/reliant/node_interact_test.rs index 341270ca9..88d34f707 100644 --- a/e2e_test/src/reliant/node_interact_test.rs +++ b/e2e_test/src/reliant/node_interact_test.rs @@ -1,4 +1,17 @@ #![cfg(test)] +// Copyright 2024 RustFS Team +// +// 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. use ecstore::disk::{VolumeInfo, WalkDirOptions}; diff --git a/ecstore/Cargo.toml b/ecstore/Cargo.toml index e3cc7f8e7..29f40b2b0 100644 --- a/ecstore/Cargo.toml +++ b/ecstore/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "ecstore" version.workspace = true diff --git a/ecstore/benches/comparison_benchmark.rs b/ecstore/benches/comparison_benchmark.rs index 9fd16c648..102a57c9b 100644 --- a/ecstore/benches/comparison_benchmark.rs +++ b/ecstore/benches/comparison_benchmark.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + //! Reed-Solomon SIMD performance analysis benchmarks //! //! This benchmark analyzes the performance characteristics of the SIMD Reed-Solomon implementation diff --git a/ecstore/benches/erasure_benchmark.rs b/ecstore/benches/erasure_benchmark.rs index 2d980aee9..08ce46935 100644 --- a/ecstore/benches/erasure_benchmark.rs +++ b/ecstore/benches/erasure_benchmark.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + //! Reed-Solomon SIMD erasure coding performance benchmarks. //! //! This benchmark tests the performance of the high-performance SIMD Reed-Solomon implementation. diff --git a/ecstore/build.rs b/ecstore/build.rs index 7969b7826..26e301fef 100644 --- a/ecstore/build.rs +++ b/ecstore/build.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + fn main() -> shadow_rs::SdResult<()> { shadow_rs::ShadowBuilder::builder().build()?; Ok(()) diff --git a/ecstore/run_benchmarks.sh b/ecstore/run_benchmarks.sh index ddf58fb92..42fe04c29 100755 --- a/ecstore/run_benchmarks.sh +++ b/ecstore/run_benchmarks.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2024 RustFS Team +# +# 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. + # Reed-Solomon SIMD 性能基准测试脚本 # 使用高性能 SIMD 实现进行纠删码性能测试 diff --git a/ecstore/src/admin_server_info.rs b/ecstore/src/admin_server_info.rs index 503abe728..01fc157f7 100644 --- a/ecstore/src/admin_server_info.rs +++ b/ecstore/src/admin_server_info.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use crate::{ disk::endpoint::Endpoint, diff --git a/ecstore/src/bitrot.rs b/ecstore/src/bitrot.rs index 6bbde8a99..8088cfd53 100644 --- a/ecstore/src/bitrot.rs +++ b/ecstore/src/bitrot.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::disk::error::DiskError; use crate::disk::{self, DiskAPI as _, DiskStore}; use crate::erasure_coding::{BitrotReader, BitrotWriterWrapper, CustomWriter}; diff --git a/ecstore/src/bucket/error.rs b/ecstore/src/bucket/error.rs index df098153a..287aef64b 100644 --- a/ecstore/src/bucket/error.rs +++ b/ecstore/src/bucket/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::Error; #[derive(Debug, thiserror::Error)] diff --git a/ecstore/src/bucket/lifecycle/bucket_lifecycle_audit.rs b/ecstore/src/bucket/lifecycle/bucket_lifecycle_audit.rs index 565d99758..18945a08d 100644 --- a/ecstore/src/bucket/lifecycle/bucket_lifecycle_audit.rs +++ b/ecstore/src/bucket/lifecycle/bucket_lifecycle_audit.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::lifecycle; #[derive(Debug, Clone, Default)] diff --git a/ecstore/src/bucket/lifecycle/bucket_lifecycle_ops.rs b/ecstore/src/bucket/lifecycle/bucket_lifecycle_ops.rs index 535b34ac0..14cfe9985 100644 --- a/ecstore/src/bucket/lifecycle/bucket_lifecycle_ops.rs +++ b/ecstore/src/bucket/lifecycle/bucket_lifecycle_ops.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/bucket/lifecycle/lifecycle.rs b/ecstore/src/bucket/lifecycle/lifecycle.rs index e7964907f..a0ac8c1b6 100644 --- a/ecstore/src/bucket/lifecycle/lifecycle.rs +++ b/ecstore/src/bucket/lifecycle/lifecycle.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/bucket/lifecycle/mod.rs b/ecstore/src/bucket/lifecycle/mod.rs index 689f49ed8..6189d6c63 100644 --- a/ecstore/src/bucket/lifecycle/mod.rs +++ b/ecstore/src/bucket/lifecycle/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod bucket_lifecycle_audit; pub mod bucket_lifecycle_ops; pub mod lifecycle; diff --git a/ecstore/src/bucket/lifecycle/rule.rs b/ecstore/src/bucket/lifecycle/rule.rs index 4bf9f53e8..eaa24acfa 100644 --- a/ecstore/src/bucket/lifecycle/rule.rs +++ b/ecstore/src/bucket/lifecycle/rule.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/bucket/lifecycle/tier_last_day_stats.rs b/ecstore/src/bucket/lifecycle/tier_last_day_stats.rs index 64f41dffe..78e3e8ed0 100644 --- a/ecstore/src/bucket/lifecycle/tier_last_day_stats.rs +++ b/ecstore/src/bucket/lifecycle/tier_last_day_stats.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/bucket/lifecycle/tier_sweeper.rs b/ecstore/src/bucket/lifecycle/tier_sweeper.rs index 68d7fc2bd..333fed978 100644 --- a/ecstore/src/bucket/lifecycle/tier_sweeper.rs +++ b/ecstore/src/bucket/lifecycle/tier_sweeper.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/bucket/metadata.rs b/ecstore/src/bucket/metadata.rs index 8d3b105d1..13f2ca6dc 100644 --- a/ecstore/src/bucket/metadata.rs +++ b/ecstore/src/bucket/metadata.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{quota::BucketQuota, target::BucketTargets}; use super::object_lock::ObjectLockApi; diff --git a/ecstore/src/bucket/metadata_sys.rs b/ecstore/src/bucket/metadata_sys.rs index a9efd66d5..5343511e8 100644 --- a/ecstore/src/bucket/metadata_sys.rs +++ b/ecstore/src/bucket/metadata_sys.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::StorageAPI; use crate::bucket::metadata::{BUCKET_LIFECYCLE_CONFIG, load_bucket_metadata_parse}; use crate::bucket::utils::{deserialize, is_meta_bucketname}; diff --git a/ecstore/src/bucket/mod.rs b/ecstore/src/bucket/mod.rs index bbe4bdaac..f98c35c6f 100644 --- a/ecstore/src/bucket/mod.rs +++ b/ecstore/src/bucket/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod error; pub mod lifecycle; pub mod metadata; diff --git a/ecstore/src/bucket/object_lock/mod.rs b/ecstore/src/bucket/object_lock/mod.rs index 64b834c94..cb562dfc4 100644 --- a/ecstore/src/bucket/object_lock/mod.rs +++ b/ecstore/src/bucket/object_lock/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod objectlock; pub mod objectlock_sys; diff --git a/ecstore/src/bucket/object_lock/objectlock.rs b/ecstore/src/bucket/object_lock/objectlock.rs index 4fd2fb596..beb4d151e 100644 --- a/ecstore/src/bucket/object_lock/objectlock.rs +++ b/ecstore/src/bucket/object_lock/objectlock.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use time::{OffsetDateTime, format_description}; diff --git a/ecstore/src/bucket/object_lock/objectlock_sys.rs b/ecstore/src/bucket/object_lock/objectlock_sys.rs index 1e9c6de26..56efd5f3c 100644 --- a/ecstore/src/bucket/object_lock/objectlock_sys.rs +++ b/ecstore/src/bucket/object_lock/objectlock_sys.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use time::OffsetDateTime; diff --git a/ecstore/src/bucket/policy_sys.rs b/ecstore/src/bucket/policy_sys.rs index 5f6e15ed9..68995135c 100644 --- a/ecstore/src/bucket/policy_sys.rs +++ b/ecstore/src/bucket/policy_sys.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{error::BucketMetadataError, metadata_sys::get_bucket_metadata_sys}; use crate::error::Result; use policy::policy::{BucketPolicy, BucketPolicyArgs}; diff --git a/ecstore/src/bucket/quota/mod.rs b/ecstore/src/bucket/quota/mod.rs index 71f72f17d..c2588d870 100644 --- a/ecstore/src/bucket/quota/mod.rs +++ b/ecstore/src/bucket/quota/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::Result; use rmp_serde::Serializer as rmpSerializer; use serde::{Deserialize, Serialize}; diff --git a/ecstore/src/bucket/replication/datatypes.rs b/ecstore/src/bucket/replication/datatypes.rs index 26c7c005e..274c0dfe4 100644 --- a/ecstore/src/bucket/replication/datatypes.rs +++ b/ecstore/src/bucket/replication/datatypes.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + // Replication status type for x-amz-replication-status header #[derive(Debug, Clone, PartialEq, Eq)] pub enum StatusType { diff --git a/ecstore/src/bucket/replication/mod.rs b/ecstore/src/bucket/replication/mod.rs index 0d8681dc4..7dbb177b0 100644 --- a/ecstore/src/bucket/replication/mod.rs +++ b/ecstore/src/bucket/replication/mod.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod datatypes; diff --git a/ecstore/src/bucket/tagging/mod.rs b/ecstore/src/bucket/tagging/mod.rs index 538f8e64a..bcce23777 100644 --- a/ecstore/src/bucket/tagging/mod.rs +++ b/ecstore/src/bucket/tagging/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use s3s::dto::Tag; use url::form_urlencoded; diff --git a/ecstore/src/bucket/target/mod.rs b/ecstore/src/bucket/target/mod.rs index 5576a951c..fc3a0b9ef 100644 --- a/ecstore/src/bucket/target/mod.rs +++ b/ecstore/src/bucket/target/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::Result; use rmp_serde::Serializer as rmpSerializer; use serde::{Deserialize, Serialize}; diff --git a/ecstore/src/bucket/utils.rs b/ecstore/src/bucket/utils.rs index d4ed414a8..98e0b119c 100644 --- a/ecstore/src/bucket/utils.rs +++ b/ecstore/src/bucket/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::disk::RUSTFS_META_BUCKET; use crate::error::{Error, Result}; use s3s::xml; diff --git a/ecstore/src/bucket/versioning/mod.rs b/ecstore/src/bucket/versioning/mod.rs index 4816a6c68..23c3ee103 100644 --- a/ecstore/src/bucket/versioning/mod.rs +++ b/ecstore/src/bucket/versioning/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use s3s::dto::{BucketVersioningStatus, VersioningConfiguration}; use rustfs_utils::string::match_simple; diff --git a/ecstore/src/bucket/versioning_sys.rs b/ecstore/src/bucket/versioning_sys.rs index b56c331d6..960b0a9e8 100644 --- a/ecstore/src/bucket/versioning_sys.rs +++ b/ecstore/src/bucket/versioning_sys.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{metadata_sys::get_bucket_metadata_sys, versioning::VersioningApi}; use crate::disk::RUSTFS_META_BUCKET; use crate::error::Result; diff --git a/ecstore/src/cache_value/cache.rs b/ecstore/src/cache_value/cache.rs index 5d460d5ae..bf5a97462 100644 --- a/ecstore/src/cache_value/cache.rs +++ b/ecstore/src/cache_value/cache.rs @@ -1,4 +1,18 @@ #![allow(unsafe_code)] // TODO: audit unsafe code +// Copyright 2024 RustFS Team +// +// 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. + use std::{ fmt::Debug, diff --git a/ecstore/src/cache_value/metacache_set.rs b/ecstore/src/cache_value/metacache_set.rs index 7f6e895c3..996590b69 100644 --- a/ecstore/src/cache_value/metacache_set.rs +++ b/ecstore/src/cache_value/metacache_set.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::disk::error::DiskError; use crate::disk::{self, DiskAPI, DiskStore, WalkDirOptions}; use futures::future::join_all; diff --git a/ecstore/src/cache_value/mod.rs b/ecstore/src/cache_value/mod.rs index fa176baa7..328444a05 100644 --- a/ecstore/src/cache_value/mod.rs +++ b/ecstore/src/cache_value/mod.rs @@ -1,2 +1,16 @@ +// Copyright 2024 RustFS Team +// +// 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. + // pub mod cache; pub mod metacache_set; diff --git a/ecstore/src/checksum.rs b/ecstore/src/checksum.rs index d04ac5d78..e9920eca0 100644 --- a/ecstore/src/checksum.rs +++ b/ecstore/src/checksum.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/chunk_stream.rs b/ecstore/src/chunk_stream.rs index c08aa2f79..2584b992a 100644 --- a/ecstore/src/chunk_stream.rs +++ b/ecstore/src/chunk_stream.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + // use crate::error::StdError; // use bytes::Bytes; // use futures::pin_mut; diff --git a/ecstore/src/client/admin_handler_utils.rs b/ecstore/src/client/admin_handler_utils.rs index 42037dd48..35436b0ef 100644 --- a/ecstore/src/client/admin_handler_utils.rs +++ b/ecstore/src/client/admin_handler_utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use http::status::StatusCode; use std::fmt::{self, Display, Formatter}; diff --git a/ecstore/src/client/api_bucket_policy.rs b/ecstore/src/client/api_bucket_policy.rs index 1cde30fef..d9adbfe0f 100644 --- a/ecstore/src/client/api_bucket_policy.rs +++ b/ecstore/src/client/api_bucket_policy.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_error_response.rs b/ecstore/src/client/api_error_response.rs index 96896ef01..6dbcbfb04 100644 --- a/ecstore/src/client/api_error_response.rs +++ b/ecstore/src/client/api_error_response.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_get_object.rs b/ecstore/src/client/api_get_object.rs index cf001272b..80759b2cc 100644 --- a/ecstore/src/client/api_get_object.rs +++ b/ecstore/src/client/api_get_object.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_get_options.rs b/ecstore/src/client/api_get_options.rs index bf67e111e..324d3006f 100644 --- a/ecstore/src/client/api_get_options.rs +++ b/ecstore/src/client/api_get_options.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_list.rs b/ecstore/src/client/api_list.rs index 4586eaf03..bd5259e99 100644 --- a/ecstore/src/client/api_list.rs +++ b/ecstore/src/client/api_list.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_put_object.rs b/ecstore/src/client/api_put_object.rs index e71e6d0ee..18e9bae60 100644 --- a/ecstore/src/client/api_put_object.rs +++ b/ecstore/src/client/api_put_object.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_put_object_common.rs b/ecstore/src/client/api_put_object_common.rs index ef5125785..0fbec8f45 100644 --- a/ecstore/src/client/api_put_object_common.rs +++ b/ecstore/src/client/api_put_object_common.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_put_object_multipart.rs b/ecstore/src/client/api_put_object_multipart.rs index 25215f9cf..d3a84c77a 100644 --- a/ecstore/src/client/api_put_object_multipart.rs +++ b/ecstore/src/client/api_put_object_multipart.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_put_object_streaming.rs b/ecstore/src/client/api_put_object_streaming.rs index 4c8e42191..82ad9fea9 100644 --- a/ecstore/src/client/api_put_object_streaming.rs +++ b/ecstore/src/client/api_put_object_streaming.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_remove.rs b/ecstore/src/client/api_remove.rs index 83549ca30..b3f75e727 100644 --- a/ecstore/src/client/api_remove.rs +++ b/ecstore/src/client/api_remove.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/api_s3_datatypes.rs b/ecstore/src/client/api_s3_datatypes.rs index 110bfdc4b..a026c7312 100644 --- a/ecstore/src/client/api_s3_datatypes.rs +++ b/ecstore/src/client/api_s3_datatypes.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/bucket_cache.rs b/ecstore/src/client/bucket_cache.rs index e291984e8..12e38d785 100644 --- a/ecstore/src/client/bucket_cache.rs +++ b/ecstore/src/client/bucket_cache.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/constants.rs b/ecstore/src/client/constants.rs index 181c5e0a5..5324e159c 100644 --- a/ecstore/src/client/constants.rs +++ b/ecstore/src/client/constants.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/client/credentials.rs b/ecstore/src/client/credentials.rs index 77971f998..456847ce2 100644 --- a/ecstore/src/client/credentials.rs +++ b/ecstore/src/client/credentials.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/client/hook_reader.rs b/ecstore/src/client/hook_reader.rs index c8351e4dd..38d2c3f88 100644 --- a/ecstore/src/client/hook_reader.rs +++ b/ecstore/src/client/hook_reader.rs @@ -1,4 +1,18 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. + use std::{collections::HashMap, sync::Arc}; use crate::{ diff --git a/ecstore/src/client/mod.rs b/ecstore/src/client/mod.rs index 7d2990cb0..25892d2fd 100644 --- a/ecstore/src/client/mod.rs +++ b/ecstore/src/client/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod admin_handler_utils; pub mod api_bucket_policy; pub mod api_error_response; diff --git a/ecstore/src/client/object_api_utils.rs b/ecstore/src/client/object_api_utils.rs index c0cc9cc90..b88713ffd 100644 --- a/ecstore/src/client/object_api_utils.rs +++ b/ecstore/src/client/object_api_utils.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/object_handlers_common.rs b/ecstore/src/client/object_handlers_common.rs index 7c1053cbd..6aa988990 100644 --- a/ecstore/src/client/object_handlers_common.rs +++ b/ecstore/src/client/object_handlers_common.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::StorageAPI; use crate::bucket::lifecycle::lifecycle; use crate::bucket::versioning::VersioningApi; diff --git a/ecstore/src/client/transition_api.rs b/ecstore/src/client/transition_api.rs index f33b8ad42..656641166 100644 --- a/ecstore/src/client/transition_api.rs +++ b/ecstore/src/client/transition_api.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_imports)] #![allow(unused_variables)] #![allow(unused_mut)] diff --git a/ecstore/src/client/utils.rs b/ecstore/src/client/utils.rs index 964f4a8d9..ee7d020ee 100644 --- a/ecstore/src/client/utils.rs +++ b/ecstore/src/client/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use lazy_static::lazy_static; use std::collections::HashMap; diff --git a/ecstore/src/cmd/bucket_replication.rs b/ecstore/src/cmd/bucket_replication.rs index fb27da75b..e30a56db2 100644 --- a/ecstore/src/cmd/bucket_replication.rs +++ b/ecstore/src/cmd/bucket_replication.rs @@ -1,4 +1,17 @@ #![allow(unused_variables)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(dead_code)] // use error::Error; use crate::StorageAPI; diff --git a/ecstore/src/cmd/bucket_replication_utils.rs b/ecstore/src/cmd/bucket_replication_utils.rs index 7c4564275..fa76aa9f8 100644 --- a/ecstore/src/cmd/bucket_replication_utils.rs +++ b/ecstore/src/cmd/bucket_replication_utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use chrono::{DateTime, Utc}; diff --git a/ecstore/src/cmd/bucket_targets.rs b/ecstore/src/cmd/bucket_targets.rs index d6dc407f4..a356d797a 100644 --- a/ecstore/src/cmd/bucket_targets.rs +++ b/ecstore/src/cmd/bucket_targets.rs @@ -1,4 +1,17 @@ #![allow(unused_variables)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(dead_code)] use crate::{ StorageAPI, diff --git a/ecstore/src/cmd/bucketreplicationhandler.rs b/ecstore/src/cmd/bucketreplicationhandler.rs index e69de29bb..8e170c05d 100644 --- a/ecstore/src/cmd/bucketreplicationhandler.rs +++ b/ecstore/src/cmd/bucketreplicationhandler.rs @@ -0,0 +1,14 @@ +// Copyright 2024 RustFS Team +// +// 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. + diff --git a/ecstore/src/cmd/mod.rs b/ecstore/src/cmd/mod.rs index da274f394..d58a08a9e 100644 --- a/ecstore/src/cmd/mod.rs +++ b/ecstore/src/cmd/mod.rs @@ -1,2 +1,16 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod bucket_replication; pub mod bucket_targets; diff --git a/ecstore/src/compress.rs b/ecstore/src/compress.rs index efbad5027..a5285f3ce 100644 --- a/ecstore/src/compress.rs +++ b/ecstore/src/compress.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use rustfs_utils::string::has_pattern; use rustfs_utils::string::has_string_suffix_in_slice; use std::env; diff --git a/ecstore/src/config/com.rs b/ecstore/src/config/com.rs index 19cab9bdc..11b45cbca 100644 --- a/ecstore/src/config/com.rs +++ b/ecstore/src/config/com.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{Config, GLOBAL_StorageClass, storageclass}; use crate::disk::RUSTFS_META_BUCKET; use crate::error::{Error, Result}; diff --git a/ecstore/src/config/heal.rs b/ecstore/src/config/heal.rs index 642410607..08ebaf008 100644 --- a/ecstore/src/config/heal.rs +++ b/ecstore/src/config/heal.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use rustfs_utils::string::parse_bool; use std::time::Duration; diff --git a/ecstore/src/config/mod.rs b/ecstore/src/config/mod.rs index 3cf810cac..34dbfee19 100644 --- a/ecstore/src/config/mod.rs +++ b/ecstore/src/config/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod com; #[allow(dead_code)] pub mod heal; diff --git a/ecstore/src/config/notify.rs b/ecstore/src/config/notify.rs index 72f42123f..71e239cbd 100644 --- a/ecstore/src/config/notify.rs +++ b/ecstore/src/config/notify.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::config::{ENABLE_KEY, ENABLE_OFF, KV, KVS}; use lazy_static::lazy_static; use rustfs_config::notify::{ diff --git a/ecstore/src/config/storageclass.rs b/ecstore/src/config/storageclass.rs index 61cb53eb0..81e7370b6 100644 --- a/ecstore/src/config/storageclass.rs +++ b/ecstore/src/config/storageclass.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::KVS; use crate::config::KV; use crate::error::{Error, Result}; diff --git a/ecstore/src/disk/endpoint.rs b/ecstore/src/disk/endpoint.rs index 6c38aec0d..f1de59e1c 100644 --- a/ecstore/src/disk/endpoint.rs +++ b/ecstore/src/disk/endpoint.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::error::{Error, Result}; use path_absolutize::Absolutize; use rustfs_utils::{is_local_host, is_socket_addr}; diff --git a/ecstore/src/disk/error.rs b/ecstore/src/disk/error.rs index 7a5a15128..9d53ef9bb 100644 --- a/ecstore/src/disk/error.rs +++ b/ecstore/src/disk/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + // use crate::quorum::CheckErrorFn; use std::hash::{Hash, Hasher}; use std::io::{self}; diff --git a/ecstore/src/disk/error_conv.rs b/ecstore/src/disk/error_conv.rs index e9fb4d696..ed8487a92 100644 --- a/ecstore/src/disk/error_conv.rs +++ b/ecstore/src/disk/error_conv.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::error::DiskError; pub fn to_file_error(io_err: std::io::Error) -> std::io::Error { diff --git a/ecstore/src/disk/error_reduce.rs b/ecstore/src/disk/error_reduce.rs index 72a9ddf74..956b57c44 100644 --- a/ecstore/src/disk/error_reduce.rs +++ b/ecstore/src/disk/error_reduce.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::error::Error; pub static OBJECT_OP_IGNORED_ERRS: &[Error] = &[ diff --git a/ecstore/src/disk/format.rs b/ecstore/src/disk/format.rs index e128a9719..aca63c7d2 100644 --- a/ecstore/src/disk/format.rs +++ b/ecstore/src/disk/format.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::error::{Error, Result}; use super::{DiskInfo, error::DiskError}; use serde::{Deserialize, Serialize}; diff --git a/ecstore/src/disk/fs.rs b/ecstore/src/disk/fs.rs index f083e6d32..1d13ef965 100644 --- a/ecstore/src/disk/fs.rs +++ b/ecstore/src/disk/fs.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{fs::Metadata, path::Path}; use tokio::{ diff --git a/ecstore/src/disk/local.rs b/ecstore/src/disk/local.rs index 2a04034cc..51dd9310c 100644 --- a/ecstore/src/disk/local.rs +++ b/ecstore/src/disk/local.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::error::{Error, Result}; use super::os::{is_root_disk, rename_all}; use super::{ diff --git a/ecstore/src/disk/mod.rs b/ecstore/src/disk/mod.rs index 0763de5bf..541100b25 100644 --- a/ecstore/src/disk/mod.rs +++ b/ecstore/src/disk/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod endpoint; pub mod error; pub mod error_conv; diff --git a/ecstore/src/disk/os.rs b/ecstore/src/disk/os.rs index 37f583d0b..1605d8ce5 100644 --- a/ecstore/src/disk/os.rs +++ b/ecstore/src/disk/os.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{ io, path::{Component, Path}, diff --git a/ecstore/src/disks_layout.rs b/ecstore/src/disks_layout.rs index 79040a918..8598b8172 100644 --- a/ecstore/src/disks_layout.rs +++ b/ecstore/src/disks_layout.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use rustfs_utils::string::{ArgPattern, find_ellipses_patterns, has_ellipses}; use serde::Deserialize; use std::collections::HashSet; diff --git a/ecstore/src/endpoints.rs b/ecstore/src/endpoints.rs index eac4ecb04..2c2f3b15b 100644 --- a/ecstore/src/endpoints.rs +++ b/ecstore/src/endpoints.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use rustfs_utils::{XHost, check_local_server_addr, get_host_ip, is_local_host}; use tracing::{instrument, warn}; diff --git a/ecstore/src/erasure.rs b/ecstore/src/erasure.rs index 268ecbf92..e8b13749f 100644 --- a/ecstore/src/erasure.rs +++ b/ecstore/src/erasure.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::bitrot::{BitrotReader, BitrotWriter}; use crate::disk::error::{Error, Result}; use crate::disk::error_reduce::{OBJECT_OP_IGNORED_ERRS, reduce_write_quorum_errs}; diff --git a/ecstore/src/erasure_coding/bitrot.rs b/ecstore/src/erasure_coding/bitrot.rs index a020711ed..587b127c8 100644 --- a/ecstore/src/erasure_coding/bitrot.rs +++ b/ecstore/src/erasure_coding/bitrot.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use bytes::Bytes; use pin_project_lite::pin_project; use rustfs_utils::HashAlgorithm; diff --git a/ecstore/src/erasure_coding/decode.rs b/ecstore/src/erasure_coding/decode.rs index ae00edbdb..4af48cd2c 100644 --- a/ecstore/src/erasure_coding/decode.rs +++ b/ecstore/src/erasure_coding/decode.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::BitrotReader; use super::Erasure; use crate::disk::error::Error; diff --git a/ecstore/src/erasure_coding/encode.rs b/ecstore/src/erasure_coding/encode.rs index 0786f1eb3..90d6e973f 100644 --- a/ecstore/src/erasure_coding/encode.rs +++ b/ecstore/src/erasure_coding/encode.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::BitrotWriterWrapper; use super::Erasure; use crate::disk::error::Error; diff --git a/ecstore/src/erasure_coding/erasure.rs b/ecstore/src/erasure_coding/erasure.rs index daccd6553..1af3685a9 100644 --- a/ecstore/src/erasure_coding/erasure.rs +++ b/ecstore/src/erasure_coding/erasure.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + //! Erasure coding implementation using Reed-Solomon SIMD backend. //! //! This module provides erasure coding functionality with high-performance SIMD diff --git a/ecstore/src/erasure_coding/heal.rs b/ecstore/src/erasure_coding/heal.rs index 8bd775a09..68268dcac 100644 --- a/ecstore/src/erasure_coding/heal.rs +++ b/ecstore/src/erasure_coding/heal.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::BitrotReader; use super::BitrotWriterWrapper; use super::decode::ParallelReader; diff --git a/ecstore/src/erasure_coding/mod.rs b/ecstore/src/erasure_coding/mod.rs index c9987ef42..947bf4da7 100644 --- a/ecstore/src/erasure_coding/mod.rs +++ b/ecstore/src/erasure_coding/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod decode; pub mod encode; pub mod erasure; diff --git a/ecstore/src/error.rs b/ecstore/src/error.rs index c99a90b91..c9dc2c1fd 100644 --- a/ecstore/src/error.rs +++ b/ecstore/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use s3s::{S3Error, S3ErrorCode}; use rustfs_utils::path::decode_dir_object; diff --git a/ecstore/src/event/mod.rs b/ecstore/src/event/mod.rs index fc878d340..d63a61cf1 100644 --- a/ecstore/src/event/mod.rs +++ b/ecstore/src/event/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod name; pub mod targetid; pub mod targetlist; diff --git a/ecstore/src/event/name.rs b/ecstore/src/event/name.rs index 7b61f3c53..486d018da 100644 --- a/ecstore/src/event/name.rs +++ b/ecstore/src/event/name.rs @@ -1,4 +1,17 @@ #![allow(unused_variables)] +// Copyright 2024 RustFS Team +// +// 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. #[derive(Default)] pub enum EventName { diff --git a/ecstore/src/event/targetid.rs b/ecstore/src/event/targetid.rs index 2ab2c07e4..d41f1e956 100644 --- a/ecstore/src/event/targetid.rs +++ b/ecstore/src/event/targetid.rs @@ -1,4 +1,17 @@ #![allow(clippy::all)] +// Copyright 2024 RustFS Team +// +// 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. pub struct TargetID { id: String, diff --git a/ecstore/src/event/targetlist.rs b/ecstore/src/event/targetlist.rs index 30602c09e..f45b2cbc0 100644 --- a/ecstore/src/event/targetlist.rs +++ b/ecstore/src/event/targetlist.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::atomic::AtomicI64; use super::targetid::TargetID; diff --git a/ecstore/src/event_notification.rs b/ecstore/src/event_notification.rs index 74ad9dc04..3d909542f 100644 --- a/ecstore/src/event_notification.rs +++ b/ecstore/src/event_notification.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] use std::collections::HashMap; diff --git a/ecstore/src/global.rs b/ecstore/src/global.rs index dcd260a82..329ed5ebf 100644 --- a/ecstore/src/global.rs +++ b/ecstore/src/global.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::heal::mrf::MRFState; use crate::{ bucket::lifecycle::bucket_lifecycle_ops::LifecycleSys, diff --git a/ecstore/src/heal/background_heal_ops.rs b/ecstore/src/heal/background_heal_ops.rs index 6b80338eb..757272633 100644 --- a/ecstore/src/heal/background_heal_ops.rs +++ b/ecstore/src/heal/background_heal_ops.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use futures::future::join_all; use madmin::heal_commands::HealResultItem; use rustfs_utils::path::{SLASH_SEPARATOR, path_join}; diff --git a/ecstore/src/heal/data_scanner.rs b/ecstore/src/heal/data_scanner.rs index cd2fae95a..0b17e3a26 100644 --- a/ecstore/src/heal/data_scanner.rs +++ b/ecstore/src/heal/data_scanner.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{ collections::{HashMap, HashSet}, fs, diff --git a/ecstore/src/heal/data_scanner_metric.rs b/ecstore/src/heal/data_scanner_metric.rs index f2024e734..a69be8755 100644 --- a/ecstore/src/heal/data_scanner_metric.rs +++ b/ecstore/src/heal/data_scanner_metric.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use chrono::Utc; use common::last_minute::{AccElem, LastMinuteLatency}; use lazy_static::lazy_static; diff --git a/ecstore/src/heal/data_usage.rs b/ecstore/src/heal/data_usage.rs index 1d8de5d74..a6d569971 100644 --- a/ecstore/src/heal/data_usage.rs +++ b/ecstore/src/heal/data_usage.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use crate::{ bucket::metadata_sys::get_replication_config, diff --git a/ecstore/src/heal/data_usage_cache.rs b/ecstore/src/heal/data_usage_cache.rs index bbc9d58ad..70b509cf6 100644 --- a/ecstore/src/heal/data_usage_cache.rs +++ b/ecstore/src/heal/data_usage_cache.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::config::com::save_config; use crate::disk::{BUCKET_META_PREFIX, RUSTFS_META_BUCKET}; use crate::error::{Error, Result}; diff --git a/ecstore/src/heal/error.rs b/ecstore/src/heal/error.rs index eb092ec90..dd2db424e 100644 --- a/ecstore/src/heal/error.rs +++ b/ecstore/src/heal/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub const ERR_IGNORE_FILE_CONTRIB: &str = "ignore this file's contribution toward data-usage"; pub const ERR_SKIP_FILE: &str = "skip this file"; pub const ERR_HEAL_STOP_SIGNALLED: &str = "heal stop signaled"; diff --git a/ecstore/src/heal/heal_commands.rs b/ecstore/src/heal/heal_commands.rs index 7dd798a9a..37f9bf8bc 100644 --- a/ecstore/src/heal/heal_commands.rs +++ b/ecstore/src/heal/heal_commands.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{ collections::{HashMap, HashSet}, path::Path, diff --git a/ecstore/src/heal/heal_ops.rs b/ecstore/src/heal/heal_ops.rs index 7b571982a..b162d2d2e 100644 --- a/ecstore/src/heal/heal_ops.rs +++ b/ecstore/src/heal/heal_ops.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{ background_heal_ops::HealTask, data_scanner::HEAL_DELETE_DANGLING, diff --git a/ecstore/src/heal/mod.rs b/ecstore/src/heal/mod.rs index 47e000860..a92bfc33b 100644 --- a/ecstore/src/heal/mod.rs +++ b/ecstore/src/heal/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod background_heal_ops; pub mod data_scanner; pub mod data_scanner_metric; diff --git a/ecstore/src/heal/mrf.rs b/ecstore/src/heal/mrf.rs index 3db89a832..106dde7ef 100644 --- a/ecstore/src/heal/mrf.rs +++ b/ecstore/src/heal/mrf.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::disk::{BUCKET_META_PREFIX, RUSTFS_META_BUCKET}; use crate::heal::background_heal_ops::{heal_bucket, heal_object}; use crate::heal::heal_commands::{HEAL_DEEP_SCAN, HEAL_NORMAL_SCAN}; diff --git a/ecstore/src/lib.rs b/ecstore/src/lib.rs index 9b14d888e..15552987b 100644 --- a/ecstore/src/lib.rs +++ b/ecstore/src/lib.rs @@ -1,4 +1,17 @@ #![allow(dead_code)] +// Copyright 2024 RustFS Team +// +// 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. extern crate core; diff --git a/ecstore/src/metrics_realtime.rs b/ecstore/src/metrics_realtime.rs index 91b70f50b..628e22a33 100644 --- a/ecstore/src/metrics_realtime.rs +++ b/ecstore/src/metrics_realtime.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::{HashMap, HashSet}; use chrono::Utc; diff --git a/ecstore/src/notification_sys.rs b/ecstore/src/notification_sys.rs index 054c66cbf..469b25450 100644 --- a/ecstore/src/notification_sys.rs +++ b/ecstore/src/notification_sys.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::StorageAPI; use crate::admin_server_info::get_commit_id; use crate::error::{Error, Result}; diff --git a/ecstore/src/pools.rs b/ecstore/src/pools.rs index 7975319b4..1eb1640df 100644 --- a/ecstore/src/pools.rs +++ b/ecstore/src/pools.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::bucket::versioning_sys::BucketVersioningSys; use crate::cache_value::metacache_set::{ListPathRawOptions, list_path_raw}; use crate::config::com::{CONFIG_PREFIX, read_config, save_config}; diff --git a/ecstore/src/rebalance.rs b/ecstore/src/rebalance.rs index 4e302f6e2..1d05dc696 100644 --- a/ecstore/src/rebalance.rs +++ b/ecstore/src/rebalance.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::StorageAPI; use crate::cache_value::metacache_set::{ListPathRawOptions, list_path_raw}; use crate::config::com::{read_config_with_metadata, save_config_with_opts}; diff --git a/ecstore/src/rpc/http_auth.rs b/ecstore/src/rpc/http_auth.rs index 3d59baf0f..95894d15b 100644 --- a/ecstore/src/rpc/http_auth.rs +++ b/ecstore/src/rpc/http_auth.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::global::get_global_action_cred; use base64::Engine as _; use base64::engine::general_purpose; diff --git a/ecstore/src/rpc/mod.rs b/ecstore/src/rpc/mod.rs index e95032aba..5c56b8fc1 100644 --- a/ecstore/src/rpc/mod.rs +++ b/ecstore/src/rpc/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod http_auth; mod peer_rest_client; mod peer_s3_client; diff --git a/ecstore/src/rpc/peer_rest_client.rs b/ecstore/src/rpc/peer_rest_client.rs index 425413c3c..4dabf4a67 100644 --- a/ecstore/src/rpc/peer_rest_client.rs +++ b/ecstore/src/rpc/peer_rest_client.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use crate::{ endpoints::EndpointServerPools, diff --git a/ecstore/src/rpc/peer_s3_client.rs b/ecstore/src/rpc/peer_s3_client.rs index a9d54ce83..9edea5c25 100644 --- a/ecstore/src/rpc/peer_s3_client.rs +++ b/ecstore/src/rpc/peer_s3_client.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::bucket::metadata_sys; use crate::disk::error::{Error, Result}; use crate::disk::error_reduce::{BUCKET_OP_IGNORED_ERRS, is_all_buckets_not_found, reduce_write_quorum_errs}; diff --git a/ecstore/src/rpc/remote_disk.rs b/ecstore/src/rpc/remote_disk.rs index e3d36133a..3aa2b1b3a 100644 --- a/ecstore/src/rpc/remote_disk.rs +++ b/ecstore/src/rpc/remote_disk.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::path::PathBuf; use bytes::Bytes; diff --git a/ecstore/src/rpc/tonic_service.rs b/ecstore/src/rpc/tonic_service.rs index 2c18c5923..9e883a348 100644 --- a/ecstore/src/rpc/tonic_service.rs +++ b/ecstore/src/rpc/tonic_service.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{collections::HashMap, io::Cursor, pin::Pin}; // use common::error::Error as EcsError; diff --git a/ecstore/src/set_disk.rs b/ecstore/src/set_disk.rs index 103da9497..1d2f07d59 100644 --- a/ecstore/src/set_disk.rs +++ b/ecstore/src/set_disk.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] use crate::bitrot::{create_bitrot_reader, create_bitrot_writer}; diff --git a/ecstore/src/sets.rs b/ecstore/src/sets.rs index 2b0f31be1..f50744541 100644 --- a/ecstore/src/sets.rs +++ b/ecstore/src/sets.rs @@ -1,4 +1,18 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. + use std::{collections::HashMap, sync::Arc}; use crate::disk::error_reduce::count_errs; diff --git a/ecstore/src/store.rs b/ecstore/src/store.rs index e6e315eec..b30d16e8e 100644 --- a/ecstore/src/store.rs +++ b/ecstore/src/store.rs @@ -1,4 +1,17 @@ #![allow(clippy::map_entry)] +// Copyright 2024 RustFS Team +// +// 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. use crate::bucket::lifecycle::bucket_lifecycle_ops::init_background_expiry; use crate::bucket::metadata_sys::{self, set_bucket_metadata}; diff --git a/ecstore/src/store_api.rs b/ecstore/src/store_api.rs index 1ff2a79b2..64ede69dd 100644 --- a/ecstore/src/store_api.rs +++ b/ecstore/src/store_api.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::bucket::metadata_sys::get_versioning_config; use crate::bucket::versioning::VersioningApi as _; use crate::cmd::bucket_replication::{ReplicationStatusType, VersionPurgeStatusType}; diff --git a/ecstore/src/store_init.rs b/ecstore/src/store_init.rs index b2efe19d5..873b8b65b 100644 --- a/ecstore/src/store_init.rs +++ b/ecstore/src/store_init.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::config::{KVS, storageclass}; use crate::disk::error_reduce::{count_errs, reduce_write_quorum_errs}; use crate::disk::{self, DiskAPI}; diff --git a/ecstore/src/store_list_objects.rs b/ecstore/src/store_list_objects.rs index 3a6474825..b7b88f351 100644 --- a/ecstore/src/store_list_objects.rs +++ b/ecstore/src/store_list_objects.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::StorageAPI; use crate::bucket::metadata_sys::get_versioning_config; use crate::bucket::versioning::VersioningApi; diff --git a/ecstore/src/store_utils.rs b/ecstore/src/store_utils.rs index 5ba5b1f45..7cbcb6d0f 100644 --- a/ecstore/src/store_utils.rs +++ b/ecstore/src/store_utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::config::storageclass::STANDARD; use crate::disk::RUSTFS_META_BUCKET; use regex::Regex; diff --git a/ecstore/src/tier/mod.rs b/ecstore/src/tier/mod.rs index 8c54e1690..88d520313 100644 --- a/ecstore/src/tier/mod.rs +++ b/ecstore/src/tier/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod tier; pub mod tier_admin; pub mod tier_config; diff --git a/ecstore/src/tier/tier.rs b/ecstore/src/tier/tier.rs index d05374cd2..3d034f699 100644 --- a/ecstore/src/tier/tier.rs +++ b/ecstore/src/tier/tier.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/tier/tier_admin.rs b/ecstore/src/tier/tier_admin.rs index 08c9d89a6..1b3519c02 100644 --- a/ecstore/src/tier/tier_admin.rs +++ b/ecstore/src/tier/tier_admin.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/tier/tier_config.rs b/ecstore/src/tier/tier_config.rs index dd17a01ee..7963e1d3e 100644 --- a/ecstore/src/tier/tier_config.rs +++ b/ecstore/src/tier/tier_config.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; use std::fmt::Display; use tracing::info; diff --git a/ecstore/src/tier/tier_gen.rs b/ecstore/src/tier/tier_gen.rs index e7e8cd63d..3efe1891e 100644 --- a/ecstore/src/tier/tier_gen.rs +++ b/ecstore/src/tier/tier_gen.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::tier::tier::TierConfigMgr; #[allow(dead_code)] diff --git a/ecstore/src/tier/tier_handlers.rs b/ecstore/src/tier/tier_handlers.rs index 289799259..07768c7ae 100644 --- a/ecstore/src/tier/tier_handlers.rs +++ b/ecstore/src/tier/tier_handlers.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::client::admin_handler_utils::AdminError; use http::status::StatusCode; use lazy_static::lazy_static; diff --git a/ecstore/src/tier/warm_backend.rs b/ecstore/src/tier/warm_backend.rs index ac5f43c48..0b7dd86c5 100644 --- a/ecstore/src/tier/warm_backend.rs +++ b/ecstore/src/tier/warm_backend.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/tier/warm_backend_minio.rs b/ecstore/src/tier/warm_backend_minio.rs index ae9e928a6..73da4acf4 100644 --- a/ecstore/src/tier/warm_backend_minio.rs +++ b/ecstore/src/tier/warm_backend_minio.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/tier/warm_backend_rustfs.rs b/ecstore/src/tier/warm_backend_rustfs.rs index 40e291f4a..8bc8142b3 100644 --- a/ecstore/src/tier/warm_backend_rustfs.rs +++ b/ecstore/src/tier/warm_backend_rustfs.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/ecstore/src/tier/warm_backend_s3.rs b/ecstore/src/tier/warm_backend_s3.rs index a7684573d..93095d95b 100644 --- a/ecstore/src/tier/warm_backend_s3.rs +++ b/ecstore/src/tier/warm_backend_s3.rs @@ -1,4 +1,17 @@ #![allow(unused_imports)] +// Copyright 2024 RustFS Team +// +// 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. #![allow(unused_variables)] #![allow(unused_mut)] #![allow(unused_assignments)] diff --git a/iam/Cargo.toml b/iam/Cargo.toml index f61329966..1813afc72 100644 --- a/iam/Cargo.toml +++ b/iam/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "iam" edition.workspace = true diff --git a/iam/src/cache.rs b/iam/src/cache.rs index 6935054eb..dd5fd7b8c 100644 --- a/iam/src/cache.rs +++ b/iam/src/cache.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{ collections::{HashMap, HashSet}, ops::{Deref, DerefMut}, diff --git a/iam/src/error.rs b/iam/src/error.rs index 5247183ab..94a47d476 100644 --- a/iam/src/error.rs +++ b/iam/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use policy::policy::Error as PolicyError; pub type Result = core::result::Result; diff --git a/iam/src/lib.rs b/iam/src/lib.rs index 8f3fd6b08..b1d9e7221 100644 --- a/iam/src/lib.rs +++ b/iam/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use ecstore::store::ECStore; use manager::IamCache; diff --git a/iam/src/manager.rs b/iam/src/manager.rs index 53d81436c..6535367a7 100644 --- a/iam/src/manager.rs +++ b/iam/src/manager.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result, is_err_config_not_found}; use crate::{ cache::{Cache, CacheEntity}, diff --git a/iam/src/store.rs b/iam/src/store.rs index 04650ca68..d8ddb0e54 100644 --- a/iam/src/store.rs +++ b/iam/src/store.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod object; use crate::cache::Cache; diff --git a/iam/src/store/object.rs b/iam/src/store/object.rs index 533ef6f0c..9802fc798 100644 --- a/iam/src/store/object.rs +++ b/iam/src/store/object.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{GroupInfo, MappedPolicy, Store, UserType}; use crate::error::{Error, Result, is_err_config_not_found}; use crate::{ diff --git a/iam/src/sys.rs b/iam/src/sys.rs index 00fc2302a..d5a5e375c 100644 --- a/iam/src/sys.rs +++ b/iam/src/sys.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::Error as IamError; use crate::error::is_err_no_such_account; use crate::error::is_err_no_such_temp_account; diff --git a/iam/src/utils.rs b/iam/src/utils.rs index 2095aef63..14edd7351 100644 --- a/iam/src/utils.rs +++ b/iam/src/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use jsonwebtoken::{Algorithm, DecodingKey, EncodingKey, Header}; use rand::{Rng, RngCore}; use serde::{Serialize, de::DeserializeOwned}; diff --git a/madmin/Cargo.toml b/madmin/Cargo.toml index 18bea2bae..be7779f11 100644 --- a/madmin/Cargo.toml +++ b/madmin/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "madmin" edition.workspace = true diff --git a/madmin/src/group.rs b/madmin/src/group.rs index c86760d4c..64aad6813 100644 --- a/madmin/src/group.rs +++ b/madmin/src/group.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::Deserialize; use serde::Serialize; use time::OffsetDateTime; diff --git a/madmin/src/heal_commands.rs b/madmin/src/heal_commands.rs index eec724acf..24562c12b 100644 --- a/madmin/src/heal_commands.rs +++ b/madmin/src/heal_commands.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; pub type HealItemType = String; diff --git a/madmin/src/health.rs b/madmin/src/health.rs index 40ae80ba8..7b4fecd2b 100644 --- a/madmin/src/health.rs +++ b/madmin/src/health.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use serde::{Deserialize, Serialize}; diff --git a/madmin/src/info_commands.rs b/madmin/src/info_commands.rs index 96cc9c32e..76c94ecaa 100644 --- a/madmin/src/info_commands.rs +++ b/madmin/src/info_commands.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{collections::HashMap, time::SystemTime}; use serde::{Deserialize, Serialize}; diff --git a/madmin/src/lib.rs b/madmin/src/lib.rs index f21f3c764..688152721 100644 --- a/madmin/src/lib.rs +++ b/madmin/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod group; pub mod heal_commands; pub mod health; diff --git a/madmin/src/metrics.rs b/madmin/src/metrics.rs index f8c6948c9..b2eb5b1a4 100644 --- a/madmin/src/metrics.rs +++ b/madmin/src/metrics.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use chrono::{DateTime, Utc}; diff --git a/madmin/src/net/mod.rs b/madmin/src/net/mod.rs index 3a538af43..93819ba22 100644 --- a/madmin/src/net/mod.rs +++ b/madmin/src/net/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; use crate::health::NodeCommon; diff --git a/madmin/src/policy.rs b/madmin/src/policy.rs index 512a6ecb0..ab2b0fb6a 100644 --- a/madmin/src/policy.rs +++ b/madmin/src/policy.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::Deserialize; use serde::Serialize; use serde_json::Value; diff --git a/madmin/src/service_commands.rs b/madmin/src/service_commands.rs index 30eabdb13..d5ee29e85 100644 --- a/madmin/src/service_commands.rs +++ b/madmin/src/service_commands.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{collections::HashMap, time::Duration}; use hyper::Uri; diff --git a/madmin/src/trace.rs b/madmin/src/trace.rs index cd08fd080..1ebb80b71 100644 --- a/madmin/src/trace.rs +++ b/madmin/src/trace.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{collections::HashMap, time::Duration}; use chrono::{DateTime, Utc}; diff --git a/madmin/src/user.rs b/madmin/src/user.rs index 9a4fdbc58..3f02f8683 100644 --- a/madmin/src/user.rs +++ b/madmin/src/user.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_json::value::RawValue; use std::collections::HashMap; diff --git a/madmin/src/utils.rs b/madmin/src/utils.rs index f0ae5387b..ad0bd831f 100644 --- a/madmin/src/utils.rs +++ b/madmin/src/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::time::Duration; pub fn parse_duration(s: &str) -> Result { diff --git a/policy/Cargo.toml b/policy/Cargo.toml index 046e89e04..59ed9c7cc 100644 --- a/policy/Cargo.toml +++ b/policy/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "policy" edition.workspace = true diff --git a/policy/src/arn.rs b/policy/src/arn.rs index 7a3059703..0ed153130 100644 --- a/policy/src/arn.rs +++ b/policy/src/arn.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use regex::Regex; diff --git a/policy/src/auth.rs b/policy/src/auth.rs index 79d8eaa31..22e3db847 100644 --- a/policy/src/auth.rs +++ b/policy/src/auth.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod credentials; pub use credentials::Credentials; diff --git a/policy/src/auth/credentials.rs b/policy/src/auth/credentials.rs index 017c75613..64c42c085 100644 --- a/policy/src/auth/credentials.rs +++ b/policy/src/auth/credentials.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::Error as IamError; use crate::error::{Error, Result}; use crate::policy::{INHERITED_POLICY_TYPE, Policy, Validator, iam_policy_claim_name_sa}; diff --git a/policy/src/error.rs b/policy/src/error.rs index afc3a9ce2..90d5fd032 100644 --- a/policy/src/error.rs +++ b/policy/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::policy; pub type Result = core::result::Result; diff --git a/policy/src/format.rs b/policy/src/format.rs index 4c95f0b6b..0c6ee77c6 100644 --- a/policy/src/format.rs +++ b/policy/src/format.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; #[derive(Deserialize, Serialize, Default)] diff --git a/policy/src/lib.rs b/policy/src/lib.rs index 270aaa317..471f386e7 100644 --- a/policy/src/lib.rs +++ b/policy/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod arn; pub mod auth; pub mod error; diff --git a/policy/src/policy.rs b/policy/src/policy.rs index 3685fca79..3dce8d501 100644 --- a/policy/src/policy.rs +++ b/policy/src/policy.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod action; mod doc; mod effect; diff --git a/policy/src/policy/action.rs b/policy/src/policy/action.rs index e54012249..cb47dec7c 100644 --- a/policy/src/policy/action.rs +++ b/policy/src/policy/action.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use serde::{Deserialize, Serialize}; use std::{collections::HashSet, ops::Deref}; diff --git a/policy/src/policy/doc.rs b/policy/src/policy/doc.rs index 372424a7c..cd9a08173 100644 --- a/policy/src/policy/doc.rs +++ b/policy/src/policy/doc.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; use time::OffsetDateTime; diff --git a/policy/src/policy/effect.rs b/policy/src/policy/effect.rs index 985e25cff..3c642772c 100644 --- a/policy/src/policy/effect.rs +++ b/policy/src/policy/effect.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use serde::{Deserialize, Serialize}; use strum::{EnumString, IntoStaticStr}; diff --git a/policy/src/policy/function.rs b/policy/src/policy/function.rs index 542774942..c092906df 100644 --- a/policy/src/policy/function.rs +++ b/policy/src/policy/function.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::policy::function::condition::Condition; use serde::ser::SerializeMap; use serde::{Deserialize, Serialize, Serializer, de}; diff --git a/policy/src/policy/function/addr.rs b/policy/src/policy/function/addr.rs index 6c5e529ea..aa0894801 100644 --- a/policy/src/policy/function/addr.rs +++ b/policy/src/policy/function/addr.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::func::InnerFunc; use ipnetwork::IpNetwork; use serde::{Deserialize, Serialize, de::Visitor}; diff --git a/policy/src/policy/function/binary.rs b/policy/src/policy/function/binary.rs index 0c6e25f29..6da39c89d 100644 --- a/policy/src/policy/function/binary.rs +++ b/policy/src/policy/function/binary.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use serde::{Deserialize, Serialize}; diff --git a/policy/src/policy/function/bool_null.rs b/policy/src/policy/function/bool_null.rs index 0bf793ada..cb2940d3f 100644 --- a/policy/src/policy/function/bool_null.rs +++ b/policy/src/policy/function/bool_null.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::func::InnerFunc; use serde::de::{Error, IgnoredAny, SeqAccess}; use serde::{Deserialize, Deserializer, Serialize, de}; diff --git a/policy/src/policy/function/condition.rs b/policy/src/policy/function/condition.rs index 1f5f545aa..85c0db36f 100644 --- a/policy/src/policy/function/condition.rs +++ b/policy/src/policy/function/condition.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::Deserialize; use serde::de::{Error, MapAccess}; use serde::ser::SerializeMap; diff --git a/policy/src/policy/function/date.rs b/policy/src/policy/function/date.rs index 78abeefe5..9c8dd5981 100644 --- a/policy/src/policy/function/date.rs +++ b/policy/src/policy/function/date.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::func::InnerFunc; use serde::{Deserialize, Deserializer, Serialize, de}; use std::{collections::HashMap, fmt}; diff --git a/policy/src/policy/function/func.rs b/policy/src/policy/function/func.rs index 8017d5584..bae6194a5 100644 --- a/policy/src/policy/function/func.rs +++ b/policy/src/policy/function/func.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::marker::PhantomData; use serde::{ diff --git a/policy/src/policy/function/key.rs b/policy/src/policy/function/key.rs index 61aa92703..a225f7d79 100644 --- a/policy/src/policy/function/key.rs +++ b/policy/src/policy/function/key.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::key_name::KeyName; use crate::error::Error; use crate::policy::{Error as PolicyError, Validator}; diff --git a/policy/src/policy/function/key_name.rs b/policy/src/policy/function/key_name.rs index 57cbae43d..685c12555 100644 --- a/policy/src/policy/function/key_name.rs +++ b/policy/src/policy/function/key_name.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::policy::Error::{self, InvalidKeyName}; use serde::{Deserialize, Serialize}; use strum::{EnumString, IntoStaticStr}; diff --git a/policy/src/policy/function/number.rs b/policy/src/policy/function/number.rs index d0d6cb385..7666e4a86 100644 --- a/policy/src/policy/function/number.rs +++ b/policy/src/policy/function/number.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use super::func::InnerFunc; diff --git a/policy/src/policy/function/string.rs b/policy/src/policy/function/string.rs index 7fdc9ca3b..29e098c42 100644 --- a/policy/src/policy/function/string.rs +++ b/policy/src/policy/function/string.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[cfg(test)] use std::collections::BTreeSet as Set; #[cfg(not(test))] diff --git a/policy/src/policy/id.rs b/policy/src/policy/id.rs index 1e38abdc3..a915eaa4d 100644 --- a/policy/src/policy/id.rs +++ b/policy/src/policy/id.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use serde::{Deserialize, Serialize}; use std::ops::Deref; diff --git a/policy/src/policy/policy.rs b/policy/src/policy/policy.rs index 78ce19c4c..1a3f5ef2f 100644 --- a/policy/src/policy/policy.rs +++ b/policy/src/policy/policy.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{Effect, Error as IamError, ID, Statement, action::Action, statement::BPStatement}; use crate::error::{Error, Result}; use serde::{Deserialize, Serialize}; diff --git a/policy/src/policy/principal.rs b/policy/src/policy/principal.rs index 5b642870b..d530c1431 100644 --- a/policy/src/policy/principal.rs +++ b/policy/src/policy/principal.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{Validator, utils::wildcard}; use crate::error::{Error, Result}; use serde::{Deserialize, Serialize}; diff --git a/policy/src/policy/resource.rs b/policy/src/policy/resource.rs index 31b53d357..a275293ed 100644 --- a/policy/src/policy/resource.rs +++ b/policy/src/policy/resource.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::{Error, Result}; use serde::{Deserialize, Serialize}; use std::{ diff --git a/policy/src/policy/statement.rs b/policy/src/policy/statement.rs index 37b617a1d..8b7218ac8 100644 --- a/policy/src/policy/statement.rs +++ b/policy/src/policy/statement.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::{ ActionSet, Args, BucketPolicyArgs, Effect, Error as IamError, Functions, ID, Principal, ResourceSet, Validator, action::Action, diff --git a/policy/src/policy/utils.rs b/policy/src/policy/utils.rs index a396c1549..832f6f5a6 100644 --- a/policy/src/policy/utils.rs +++ b/policy/src/policy/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use serde_json::Value; diff --git a/policy/src/policy/utils/path.rs b/policy/src/policy/utils/path.rs index bac9f7b62..21cc296ec 100644 --- a/policy/src/policy/utils/path.rs +++ b/policy/src/policy/utils/path.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + struct LazyBuf<'a> { s: &'a str, buf: Option>, diff --git a/policy/src/policy/utils/wildcard.rs b/policy/src/policy/utils/wildcard.rs index dc2d47b54..915cb153e 100644 --- a/policy/src/policy/utils/wildcard.rs +++ b/policy/src/policy/utils/wildcard.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + #[allow(dead_code)] pub fn is_simple_match(pattern: P, name: N) -> bool where diff --git a/policy/src/service_type.rs b/policy/src/service_type.rs index fd14ea0c9..7e5f18a5c 100644 --- a/policy/src/service_type.rs +++ b/policy/src/service_type.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::error::Error; #[derive(PartialEq, Eq, Debug)] diff --git a/policy/src/utils.rs b/policy/src/utils.rs index 9c833d631..103c7c500 100644 --- a/policy/src/utils.rs +++ b/policy/src/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use jsonwebtoken::{Algorithm, DecodingKey, EncodingKey, Header}; use rand::{Rng, RngCore}; use serde::{Serialize, de::DeserializeOwned}; diff --git a/policy/tests/policy_is_allowed.rs b/policy/tests/policy_is_allowed.rs index 44471d078..674ea6ad4 100644 --- a/policy/tests/policy_is_allowed.rs +++ b/policy/tests/policy_is_allowed.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use policy::policy::ActionSet; use policy::policy::Effect::*; use policy::policy::action::Action; diff --git a/rustfmt.toml b/rustfmt.toml index 207a782d2..479ba5439 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + max_width = 130 fn_call_width = 90 single_line_let_else_max_width = 100 diff --git a/rustfs/Cargo.toml b/rustfs/Cargo.toml index 862986de5..82af0cb2f 100644 --- a/rustfs/Cargo.toml +++ b/rustfs/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "rustfs" version.workspace = true diff --git a/rustfs/build.rs b/rustfs/build.rs index 7969b7826..26e301fef 100644 --- a/rustfs/build.rs +++ b/rustfs/build.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + fn main() -> shadow_rs::SdResult<()> { shadow_rs::ShadowBuilder::builder().build()?; Ok(()) diff --git a/rustfs/src/admin/handlers.rs b/rustfs/src/admin/handlers.rs index b0f9acca0..6797169bf 100644 --- a/rustfs/src/admin/handlers.rs +++ b/rustfs/src/admin/handlers.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::router::Operation; use crate::auth::check_key_valid; use crate::auth::get_condition_values; diff --git a/rustfs/src/admin/handlers/bucket_meta.rs b/rustfs/src/admin/handlers/bucket_meta.rs index 716a31037..9eccef93d 100644 --- a/rustfs/src/admin/handlers/bucket_meta.rs +++ b/rustfs/src/admin/handlers/bucket_meta.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{ collections::HashMap, io::{Cursor, Read as _, Write as _}, diff --git a/rustfs/src/admin/handlers/event.rs b/rustfs/src/admin/handlers/event.rs index 04b82a1b7..1e07655ed 100644 --- a/rustfs/src/admin/handlers/event.rs +++ b/rustfs/src/admin/handlers/event.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::admin::router::Operation; use crate::auth::{check_key_valid, get_session_token}; use http::{HeaderMap, StatusCode}; diff --git a/rustfs/src/admin/handlers/group.rs b/rustfs/src/admin/handlers/group.rs index e0f17e67d..457ae5fc1 100644 --- a/rustfs/src/admin/handlers/group.rs +++ b/rustfs/src/admin/handlers/group.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::global::get_global_action_cred; use http::{HeaderMap, StatusCode}; use iam::error::{is_err_no_such_group, is_err_no_such_user}; diff --git a/rustfs/src/admin/handlers/policys.rs b/rustfs/src/admin/handlers/policys.rs index 2c575c8df..f4c6db469 100644 --- a/rustfs/src/admin/handlers/policys.rs +++ b/rustfs/src/admin/handlers/policys.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::admin::{router::Operation, utils::has_space_be}; use ecstore::global::get_global_action_cred; use http::{HeaderMap, StatusCode}; diff --git a/rustfs/src/admin/handlers/pools.rs b/rustfs/src/admin/handlers/pools.rs index 66f85c1e9..b3286cbe1 100644 --- a/rustfs/src/admin/handlers/pools.rs +++ b/rustfs/src/admin/handlers/pools.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::{GLOBAL_Endpoints, new_object_layer_fn}; use http::{HeaderMap, StatusCode}; use matchit::Params; diff --git a/rustfs/src/admin/handlers/rebalance.rs b/rustfs/src/admin/handlers/rebalance.rs index e9c3507a7..ee0c032f7 100644 --- a/rustfs/src/admin/handlers/rebalance.rs +++ b/rustfs/src/admin/handlers/rebalance.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::{ StorageAPI, error::StorageError, diff --git a/rustfs/src/admin/handlers/service_account.rs b/rustfs/src/admin/handlers/service_account.rs index c0e2013dc..ab29d4585 100644 --- a/rustfs/src/admin/handlers/service_account.rs +++ b/rustfs/src/admin/handlers/service_account.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::admin::utils::has_space_be; use crate::auth::{get_condition_values, get_session_token}; use crate::{admin::router::Operation, auth::check_key_valid}; diff --git a/rustfs/src/admin/handlers/sts.rs b/rustfs/src/admin/handlers/sts.rs index 819b776f8..327c81d83 100644 --- a/rustfs/src/admin/handlers/sts.rs +++ b/rustfs/src/admin/handlers/sts.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{ admin::router::Operation, auth::{check_key_valid, get_session_token}, diff --git a/rustfs/src/admin/handlers/tier.rs b/rustfs/src/admin/handlers/tier.rs index 278be9e8a..569aebcde 100644 --- a/rustfs/src/admin/handlers/tier.rs +++ b/rustfs/src/admin/handlers/tier.rs @@ -1,4 +1,17 @@ #![allow(unused_variables, unused_mut, unused_must_use)] +// Copyright 2024 RustFS Team +// +// 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. use http::{HeaderMap, StatusCode}; use time::OffsetDateTime; diff --git a/rustfs/src/admin/handlers/trace.rs b/rustfs/src/admin/handlers/trace.rs index a2d340871..af580f89f 100644 --- a/rustfs/src/admin/handlers/trace.rs +++ b/rustfs/src/admin/handlers/trace.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::{GLOBAL_Endpoints, rpc::PeerRestClient}; use http::StatusCode; use hyper::Uri; diff --git a/rustfs/src/admin/handlers/user.rs b/rustfs/src/admin/handlers/user.rs index d8f601517..1b9815291 100644 --- a/rustfs/src/admin/handlers/user.rs +++ b/rustfs/src/admin/handlers/user.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::{ admin::{router::Operation, utils::has_space_be}, auth::{check_key_valid, get_condition_values, get_session_token}, diff --git a/rustfs/src/admin/mod.rs b/rustfs/src/admin/mod.rs index 17046522d..cbb74ec14 100644 --- a/rustfs/src/admin/mod.rs +++ b/rustfs/src/admin/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod handlers; pub mod router; mod rpc; diff --git a/rustfs/src/admin/router.rs b/rustfs/src/admin/router.rs index 0ebfeb0be..e0b01dc2c 100644 --- a/rustfs/src/admin/router.rs +++ b/rustfs/src/admin/router.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::rpc::verify_rpc_signature; use hyper::HeaderMap; use hyper::Method; diff --git a/rustfs/src/admin/rpc.rs b/rustfs/src/admin/rpc.rs index 5f471f963..45048bc0c 100644 --- a/rustfs/src/admin/rpc.rs +++ b/rustfs/src/admin/rpc.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::router::AdminOperation; use super::router::Operation; use super::router::S3Router; diff --git a/rustfs/src/admin/utils.rs b/rustfs/src/admin/utils.rs index 98f3b8415..68bf40146 100644 --- a/rustfs/src/admin/utils.rs +++ b/rustfs/src/admin/utils.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub fn has_space_be(s: &str) -> bool { s.trim().len() != s.len() } diff --git a/rustfs/src/auth.rs b/rustfs/src/auth.rs index fa1b03d9e..5cdad22ef 100644 --- a/rustfs/src/auth.rs +++ b/rustfs/src/auth.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::global::get_global_action_cred; use http::HeaderMap; use http::Uri; diff --git a/rustfs/src/config/mod.rs b/rustfs/src/config/mod.rs index 15b3981a8..fc8699374 100644 --- a/rustfs/src/config/mod.rs +++ b/rustfs/src/config/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use clap::Parser; use const_str::concat; use std::string::ToString; diff --git a/rustfs/src/console.rs b/rustfs/src/console.rs index 1aa9304a7..bc119b5ff 100644 --- a/rustfs/src/console.rs +++ b/rustfs/src/console.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::license::get_license; use axum::{ Router, diff --git a/rustfs/src/error.rs b/rustfs/src/error.rs index cf4b27dd9..b18c85630 100644 --- a/rustfs/src/error.rs +++ b/rustfs/src/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::error::StorageError; use s3s::{S3Error, S3ErrorCode}; diff --git a/rustfs/src/event.rs b/rustfs/src/event.rs index 24617fb49..90310510e 100644 --- a/rustfs/src/event.rs +++ b/rustfs/src/event.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::config::GLOBAL_ServerConfig; use rustfs_config::DEFAULT_DELIMITER; use tracing::{error, info, instrument}; diff --git a/rustfs/src/license.rs b/rustfs/src/license.rs index 43b893d03..d47329f6b 100644 --- a/rustfs/src/license.rs +++ b/rustfs/src/license.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use appauth::token::Token; use std::io::{Error, Result}; use std::sync::OnceLock; diff --git a/rustfs/src/logging/mod.rs b/rustfs/src/logging/mod.rs index 8b1378917..6238cfff4 100644 --- a/rustfs/src/logging/mod.rs +++ b/rustfs/src/logging/mod.rs @@ -1 +1,13 @@ - +// Copyright 2024 RustFS Team +// +// 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. diff --git a/rustfs/src/main.rs b/rustfs/src/main.rs index 34f907d05..e8ac26682 100644 --- a/rustfs/src/main.rs +++ b/rustfs/src/main.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod admin; mod auth; mod config; diff --git a/rustfs/src/server/mod.rs b/rustfs/src/server/mod.rs index 15f851e53..1309ad1d5 100644 --- a/rustfs/src/server/mod.rs +++ b/rustfs/src/server/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + mod service_state; pub(crate) use service_state::SHUTDOWN_TIMEOUT; pub(crate) use service_state::ServiceState; diff --git a/rustfs/src/server/service_state.rs b/rustfs/src/server/service_state.rs index a19afb822..8a05a5691 100644 --- a/rustfs/src/server/service_state.rs +++ b/rustfs/src/server/service_state.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use atomic_enum::atomic_enum; use std::sync::Arc; use std::sync::atomic::Ordering; diff --git a/rustfs/src/service.rs b/rustfs/src/service.rs index d04729e25..fe614c4c8 100644 --- a/rustfs/src/service.rs +++ b/rustfs/src/service.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use futures::Future; use http_body::Frame; use hyper::body::Incoming; diff --git a/rustfs/src/storage/access.rs b/rustfs/src/storage/access.rs index a5fc863cf..a9e155f9e 100644 --- a/rustfs/src/storage/access.rs +++ b/rustfs/src/storage/access.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::ecfs::FS; use crate::auth::{check_key_valid, get_condition_values, get_session_token}; use crate::license::license_check; diff --git a/rustfs/src/storage/ecfs.rs b/rustfs/src/storage/ecfs.rs index 8f3d2b8aa..a9ee25ad6 100644 --- a/rustfs/src/storage/ecfs.rs +++ b/rustfs/src/storage/ecfs.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use super::access::authorize_request; use super::options::del_opts; use super::options::extract_metadata; diff --git a/rustfs/src/storage/error.rs b/rustfs/src/storage/error.rs index fd4c95c5c..2416550b5 100644 --- a/rustfs/src/storage/error.rs +++ b/rustfs/src/storage/error.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use common::error::Error; use ecstore::error::StorageError; use s3s::{S3Error, S3ErrorCode, s3_error}; diff --git a/rustfs/src/storage/mod.rs b/rustfs/src/storage/mod.rs index 902618038..7f4ab2038 100644 --- a/rustfs/src/storage/mod.rs +++ b/rustfs/src/storage/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod access; pub mod ecfs; // pub mod error; diff --git a/rustfs/src/storage/options.rs b/rustfs/src/storage/options.rs index 2618bba6a..755b2c7b2 100644 --- a/rustfs/src/storage/options.rs +++ b/rustfs/src/storage/options.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use ecstore::bucket::versioning_sys::BucketVersioningSys; use ecstore::error::Result; use ecstore::error::StorageError; diff --git a/rustfs/src/update_checker.rs b/rustfs/src/update_checker.rs index 6ce34219d..19cd0d992 100644 --- a/rustfs/src/update_checker.rs +++ b/rustfs/src/update_checker.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use serde::{Deserialize, Serialize}; use std::time::Duration; use thiserror::Error; diff --git a/s3select/api/Cargo.toml b/s3select/api/Cargo.toml index 125849cdc..783e415dc 100644 --- a/s3select/api/Cargo.toml +++ b/s3select/api/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "api" version.workspace = true diff --git a/s3select/api/src/lib.rs b/s3select/api/src/lib.rs index 52c923f97..24722bd78 100644 --- a/s3select/api/src/lib.rs +++ b/s3select/api/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::fmt::Display; use datafusion::{common::DataFusionError, sql::sqlparser::parser::ParserError}; diff --git a/s3select/api/src/object_store.rs b/s3select/api/src/object_store.rs index e83be3053..68d549407 100644 --- a/s3select/api/src/object_store.rs +++ b/s3select/api/src/object_store.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use async_trait::async_trait; use bytes::Bytes; use chrono::Utc; diff --git a/s3select/api/src/query/analyzer.rs b/s3select/api/src/query/analyzer.rs index db849566c..7d0eff609 100644 --- a/s3select/api/src/query/analyzer.rs +++ b/s3select/api/src/query/analyzer.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use datafusion::logical_expr::LogicalPlan; diff --git a/s3select/api/src/query/ast.rs b/s3select/api/src/query/ast.rs index dbe9b4b2a..af234ed75 100644 --- a/s3select/api/src/query/ast.rs +++ b/s3select/api/src/query/ast.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use datafusion::sql::sqlparser::ast::Statement; #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/s3select/api/src/query/datasource/mod.rs b/s3select/api/src/query/datasource/mod.rs index 8b1378917..6238cfff4 100644 --- a/s3select/api/src/query/datasource/mod.rs +++ b/s3select/api/src/query/datasource/mod.rs @@ -1 +1,13 @@ - +// Copyright 2024 RustFS Team +// +// 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. diff --git a/s3select/api/src/query/dispatcher.rs b/s3select/api/src/query/dispatcher.rs index 3799e067c..7ee78b52e 100644 --- a/s3select/api/src/query/dispatcher.rs +++ b/s3select/api/src/query/dispatcher.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use async_trait::async_trait; diff --git a/s3select/api/src/query/execution.rs b/s3select/api/src/query/execution.rs index 018497795..c4ca5a3bd 100644 --- a/s3select/api/src/query/execution.rs +++ b/s3select/api/src/query/execution.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::fmt::Display; use std::pin::Pin; use std::sync::Arc; diff --git a/s3select/api/src/query/function.rs b/s3select/api/src/query/function.rs index 3a8c67619..7f3675e1b 100644 --- a/s3select/api/src/query/function.rs +++ b/s3select/api/src/query/function.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use datafusion::logical_expr::{AggregateUDF, ScalarUDF, WindowUDF}; diff --git a/s3select/api/src/query/logical_planner.rs b/s3select/api/src/query/logical_planner.rs index cef844b37..55da1f941 100644 --- a/s3select/api/src/query/logical_planner.rs +++ b/s3select/api/src/query/logical_planner.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use async_trait::async_trait; use datafusion::arrow::datatypes::SchemaRef; use datafusion::logical_expr::LogicalPlan as DFPlan; diff --git a/s3select/api/src/query/mod.rs b/s3select/api/src/query/mod.rs index 93736be2b..f21da83a0 100644 --- a/s3select/api/src/query/mod.rs +++ b/s3select/api/src/query/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use s3s::dto::SelectObjectContentInput; diff --git a/s3select/api/src/query/optimizer.rs b/s3select/api/src/query/optimizer.rs index c2392eb92..1d576014c 100644 --- a/s3select/api/src/query/optimizer.rs +++ b/s3select/api/src/query/optimizer.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use async_trait::async_trait; diff --git a/s3select/api/src/query/parser.rs b/s3select/api/src/query/parser.rs index 76d7e723f..ad487e6e6 100644 --- a/s3select/api/src/query/parser.rs +++ b/s3select/api/src/query/parser.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::VecDeque; use super::ast::ExtStatement; diff --git a/s3select/api/src/query/physical_planner.rs b/s3select/api/src/query/physical_planner.rs index c71787e9c..2feb85de6 100644 --- a/s3select/api/src/query/physical_planner.rs +++ b/s3select/api/src/query/physical_planner.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use async_trait::async_trait; diff --git a/s3select/api/src/query/scheduler.rs b/s3select/api/src/query/scheduler.rs index 3dd49c225..71a7a7c48 100644 --- a/s3select/api/src/query/scheduler.rs +++ b/s3select/api/src/query/scheduler.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use async_trait::async_trait; diff --git a/s3select/api/src/query/session.rs b/s3select/api/src/query/session.rs index 6e739bb94..e96bc6384 100644 --- a/s3select/api/src/query/session.rs +++ b/s3select/api/src/query/session.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use datafusion::{ diff --git a/s3select/api/src/server/dbms.rs b/s3select/api/src/server/dbms.rs index ee908634b..2186fe31d 100644 --- a/s3select/api/src/server/dbms.rs +++ b/s3select/api/src/server/dbms.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use async_trait::async_trait; use crate::{ diff --git a/s3select/api/src/server/mod.rs b/s3select/api/src/server/mod.rs index c2e7c7b5c..4268150bb 100644 --- a/s3select/api/src/server/mod.rs +++ b/s3select/api/src/server/mod.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod dbms; diff --git a/s3select/query/Cargo.toml b/s3select/query/Cargo.toml index 0240b8808..98cde2794 100644 --- a/s3select/query/Cargo.toml +++ b/s3select/query/Cargo.toml @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + [package] name = "query" version.workspace = true diff --git a/s3select/query/src/data_source/mod.rs b/s3select/query/src/data_source/mod.rs index b0704130e..c47b8900f 100644 --- a/s3select/query/src/data_source/mod.rs +++ b/s3select/query/src/data_source/mod.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod table_source; diff --git a/s3select/query/src/data_source/table_source.rs b/s3select/query/src/data_source/table_source.rs index 1fc06de6f..55bb73432 100644 --- a/s3select/query/src/data_source/table_source.rs +++ b/s3select/query/src/data_source/table_source.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::any::Any; use std::borrow::Cow; use std::fmt::Display; diff --git a/s3select/query/src/dispatcher/manager.rs b/s3select/query/src/dispatcher/manager.rs index 20e8bb139..e840f0a24 100644 --- a/s3select/query/src/dispatcher/manager.rs +++ b/s3select/query/src/dispatcher/manager.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{ ops::Deref, pin::Pin, diff --git a/s3select/query/src/dispatcher/mod.rs b/s3select/query/src/dispatcher/mod.rs index ff8de9eb9..097451bcc 100644 --- a/s3select/query/src/dispatcher/mod.rs +++ b/s3select/query/src/dispatcher/mod.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod manager; diff --git a/s3select/query/src/execution/factory.rs b/s3select/query/src/execution/factory.rs index 4f9ba343c..43deeebe1 100644 --- a/s3select/query/src/execution/factory.rs +++ b/s3select/query/src/execution/factory.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::{ diff --git a/s3select/query/src/execution/mod.rs b/s3select/query/src/execution/mod.rs index 807faf3ea..12af326ae 100644 --- a/s3select/query/src/execution/mod.rs +++ b/s3select/query/src/execution/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod factory; pub mod query; pub mod scheduler; diff --git a/s3select/query/src/execution/query.rs b/s3select/query/src/execution/query.rs index 15d6ef837..b49b4ba4b 100644 --- a/s3select/query/src/execution/query.rs +++ b/s3select/query/src/execution/query.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::query::execution::{Output, QueryExecution, QueryStateMachineRef}; diff --git a/s3select/query/src/execution/scheduler/local.rs b/s3select/query/src/execution/scheduler/local.rs index 43b5adfe2..e5edd9daa 100644 --- a/s3select/query/src/execution/scheduler/local.rs +++ b/s3select/query/src/execution/scheduler/local.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::query::scheduler::{ExecutionResults, Scheduler}; diff --git a/s3select/query/src/execution/scheduler/mod.rs b/s3select/query/src/execution/scheduler/mod.rs index 27099624c..e1736e33e 100644 --- a/s3select/query/src/execution/scheduler/mod.rs +++ b/s3select/query/src/execution/scheduler/mod.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod local; diff --git a/s3select/query/src/function/mod.rs b/s3select/query/src/function/mod.rs index e76614a0b..dea81d55c 100644 --- a/s3select/query/src/function/mod.rs +++ b/s3select/query/src/function/mod.rs @@ -1 +1,15 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod simple_func_manager; diff --git a/s3select/query/src/function/simple_func_manager.rs b/s3select/query/src/function/simple_func_manager.rs index bb3d3852d..9bcafd269 100644 --- a/s3select/query/src/function/simple_func_manager.rs +++ b/s3select/query/src/function/simple_func_manager.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::collections::HashMap; use std::sync::Arc; diff --git a/s3select/query/src/instance.rs b/s3select/query/src/instance.rs index 5c5f9304c..a1ca7e4b9 100644 --- a/s3select/query/src/instance.rs +++ b/s3select/query/src/instance.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::{ diff --git a/s3select/query/src/lib.rs b/s3select/query/src/lib.rs index 0a0c12eb2..2f70e4b87 100644 --- a/s3select/query/src/lib.rs +++ b/s3select/query/src/lib.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod data_source; pub mod dispatcher; pub mod execution; diff --git a/s3select/query/src/metadata/base_table.rs b/s3select/query/src/metadata/base_table.rs index 38dc841ab..1a30b7ae1 100644 --- a/s3select/query/src/metadata/base_table.rs +++ b/s3select/query/src/metadata/base_table.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use datafusion::common::Result as DFResult; diff --git a/s3select/query/src/metadata/mod.rs b/s3select/query/src/metadata/mod.rs index fd7c215ad..78bc2e05e 100644 --- a/s3select/query/src/metadata/mod.rs +++ b/s3select/query/src/metadata/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::query::{function::FuncMetaManagerRef, session::SessionCtx}; diff --git a/s3select/query/src/sql/analyzer.rs b/s3select/query/src/sql/analyzer.rs index b68c55745..704b7e2f6 100644 --- a/s3select/query/src/sql/analyzer.rs +++ b/s3select/query/src/sql/analyzer.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use api::QueryResult; use api::query::analyzer::Analyzer; use api::query::session::SessionCtx; diff --git a/s3select/query/src/sql/dialect.rs b/s3select/query/src/sql/dialect.rs index ec668715f..ba7f8c71b 100644 --- a/s3select/query/src/sql/dialect.rs +++ b/s3select/query/src/sql/dialect.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use datafusion::sql::sqlparser::dialect::Dialect; #[derive(Debug, Default)] diff --git a/s3select/query/src/sql/logical/mod.rs b/s3select/query/src/sql/logical/mod.rs index 1ecfae43a..6d06fbeac 100644 --- a/s3select/query/src/sql/logical/mod.rs +++ b/s3select/query/src/sql/logical/mod.rs @@ -1,2 +1,16 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod optimizer; pub mod planner; diff --git a/s3select/query/src/sql/logical/optimizer.rs b/s3select/query/src/sql/logical/optimizer.rs index ed860bcc5..a0a6d7493 100644 --- a/s3select/query/src/sql/logical/optimizer.rs +++ b/s3select/query/src/sql/logical/optimizer.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::{ diff --git a/s3select/query/src/sql/logical/planner.rs b/s3select/query/src/sql/logical/planner.rs index bcdc59c07..417adf166 100644 --- a/s3select/query/src/sql/logical/planner.rs +++ b/s3select/query/src/sql/logical/planner.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use crate::sql::planner::SqlPlanner; pub type DefaultLogicalPlanner<'a, S> = SqlPlanner<'a, S>; diff --git a/s3select/query/src/sql/mod.rs b/s3select/query/src/sql/mod.rs index 151fc83de..bb765c1fe 100644 --- a/s3select/query/src/sql/mod.rs +++ b/s3select/query/src/sql/mod.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod analyzer; pub mod dialect; pub mod logical; diff --git a/s3select/query/src/sql/optimizer.rs b/s3select/query/src/sql/optimizer.rs index a77b1b1a7..c22a8c7da 100644 --- a/s3select/query/src/sql/optimizer.rs +++ b/s3select/query/src/sql/optimizer.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::{ diff --git a/s3select/query/src/sql/parser.rs b/s3select/query/src/sql/parser.rs index 08ed7f707..453d55f32 100644 --- a/s3select/query/src/sql/parser.rs +++ b/s3select/query/src/sql/parser.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::{collections::VecDeque, fmt::Display}; use api::{ diff --git a/s3select/query/src/sql/physical/mod.rs b/s3select/query/src/sql/physical/mod.rs index 1ecfae43a..6d06fbeac 100644 --- a/s3select/query/src/sql/physical/mod.rs +++ b/s3select/query/src/sql/physical/mod.rs @@ -1,2 +1,16 @@ +// Copyright 2024 RustFS Team +// +// 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. + pub mod optimizer; pub mod planner; diff --git a/s3select/query/src/sql/physical/optimizer.rs b/s3select/query/src/sql/physical/optimizer.rs index 840325822..dec176411 100644 --- a/s3select/query/src/sql/physical/optimizer.rs +++ b/s3select/query/src/sql/physical/optimizer.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::QueryResult; diff --git a/s3select/query/src/sql/physical/planner.rs b/s3select/query/src/sql/physical/planner.rs index eda5c4788..26927a372 100644 --- a/s3select/query/src/sql/physical/planner.rs +++ b/s3select/query/src/sql/physical/planner.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use std::sync::Arc; use api::QueryResult; diff --git a/s3select/query/src/sql/planner.rs b/s3select/query/src/sql/planner.rs index 1705294cf..4cc5d8e2b 100644 --- a/s3select/query/src/sql/planner.rs +++ b/s3select/query/src/sql/planner.rs @@ -1,3 +1,17 @@ +// Copyright 2024 RustFS Team +// +// 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. + use api::{ QueryError, QueryResult, query::{ diff --git a/scripts/build-docker-multiarch.sh b/scripts/build-docker-multiarch.sh index 789202daf..665b15389 100755 --- a/scripts/build-docker-multiarch.sh +++ b/scripts/build-docker-multiarch.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2024 RustFS Team +# +# 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. + set -euo pipefail # 多架构 Docker 构建脚本 diff --git a/scripts/dev_clear.sh b/scripts/dev_clear.sh index 095f1d4d2..57874b27d 100644 --- a/scripts/dev_clear.sh +++ b/scripts/dev_clear.sh @@ -1,3 +1,17 @@ +# Copyright 2024 RustFS Team +# +# 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. + for i in {0..3}; do DIR="/data/rustfs$i" echo "处理 $DIR" diff --git a/scripts/dev_deploy.sh b/scripts/dev_deploy.sh index 13cb3eb2e..c8d746256 100755 --- a/scripts/dev_deploy.sh +++ b/scripts/dev_deploy.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2024 RustFS Team +# +# 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. + # 脚本名称:scp_to_servers.sh diff --git a/scripts/dev_rustfs.sh b/scripts/dev_rustfs.sh index fcf2fb6d7..cb0c71737 100644 --- a/scripts/dev_rustfs.sh +++ b/scripts/dev_rustfs.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2024 RustFS Team +# +# 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. + # ps -ef | grep rustfs | awk '{print $2}'| xargs kill -9 diff --git a/scripts/e2e-run.sh b/scripts/e2e-run.sh index 9b4392e85..9127fd0ca 100755 --- a/scripts/e2e-run.sh +++ b/scripts/e2e-run.sh @@ -1,4 +1,18 @@ #!/bin/bash -ex +# Copyright 2024 RustFS Team +# +# 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. + BIN=$1 VOLUME=$2 diff --git a/scripts/notify.sh b/scripts/notify.sh index 18fb70d12..a46bce689 100755 --- a/scripts/notify.sh +++ b/scripts/notify.sh @@ -1,4 +1,18 @@ #!/bin/bash -e +# Copyright 2024 RustFS Team +# +# 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. + current_dir=$(pwd) echo "Current directory: $current_dir" diff --git a/scripts/probe.sh b/scripts/probe.sh index 2cda95912..c8942801d 100644 --- a/scripts/probe.sh +++ b/scripts/probe.sh @@ -1,4 +1,18 @@ #!/bin/sh +# Copyright 2024 RustFS Team +# +# 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. + # Please use POSIX Shell # https://www.grymoire.com/Unix/Sh.html diff --git a/scripts/run.ps1 b/scripts/run.ps1 index 845ed020c..c0a16a1f3 100644 --- a/scripts/run.ps1 +++ b/scripts/run.ps1 @@ -1,3 +1,19 @@ +<# + Copyright 2024 RustFS Team + + 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. +#> + # Check if static files need to be downloaded if (-not (Test-Path .\rustfs\static\index.html)) { Write-Host "Downloading rustfs-console-latest.zip" diff --git a/scripts/run.sh b/scripts/run.sh index 237fe7c66..34b08fec3 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,4 +1,18 @@ #!/bin/bash -e +# Copyright 2024 RustFS Team +# +# 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. + # check ./rustfs/static/index.html not exists if [ ! -f ./rustfs/static/index.html ]; then diff --git a/scripts/static.sh b/scripts/static.sh index 814762ecf..64142608c 100755 --- a/scripts/static.sh +++ b/scripts/static.sh @@ -1 +1,15 @@ +# Copyright 2024 RustFS Team +# +# 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. + curl -L "https://dl.rustfs.com/artifacts/console/rustfs-console-latest.zip" -o tempfile.zip && unzip -o tempfile.zip -d ./rustfs/static && rm tempfile.zip \ No newline at end of file diff --git a/scripts/test.sh b/scripts/test.sh index 1a3c8ecd5..b4e1c68aa 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,4 +1,18 @@ #!/bin/bash +# Copyright 2024 RustFS Team +# +# 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. + mkdir test