From 9ab750650c9106e18415f84333bd5770022e8da2 Mon Sep 17 00:00:00 2001 From: kqjy Date: Sun, 4 Jan 2026 21:28:37 +0800 Subject: [PATCH] Update docs; Improve new panel icons --- static/css/main.css | 17 ++++++ templates/base.html | 14 +++-- templates/docs.html | 131 +++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 154 insertions(+), 8 deletions(-) diff --git a/static/css/main.css b/static/css/main.css index a338316..584ba93 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1204,6 +1204,23 @@ html.sidebar-will-collapse .sidebar-user { transition: opacity 0.2s ease, transform 0.2s ease; } +[data-bs-theme="light"] #themeToggleSun, +[data-bs-theme="light"] #themeToggleSunMobile { + display: none !important; +} +[data-bs-theme="light"] #themeToggleMoon, +[data-bs-theme="light"] #themeToggleMoonMobile { + display: inline-block !important; +} +[data-bs-theme="dark"] #themeToggleSun, +[data-bs-theme="dark"] #themeToggleSunMobile { + display: inline-block !important; +} +[data-bs-theme="dark"] #themeToggleMoon, +[data-bs-theme="dark"] #themeToggleMoonMobile { + display: none !important; +} + .config-copy { position: absolute; top: 0.5rem; diff --git a/templates/base.html b/templates/base.html index 44147be..c3363d1 100644 --- a/templates/base.html +++ b/templates/base.html @@ -48,7 +48,7 @@ - + @@ -83,13 +83,14 @@ - + Connections - + + Metrics @@ -167,13 +168,14 @@ - + Connections - + + Metrics @@ -196,7 +198,7 @@ - + diff --git a/templates/docs.html b/templates/docs.html index 7dd5bd6..43a47f5 100644 --- a/templates/docs.html +++ b/templates/docs.html @@ -38,6 +38,7 @@
  • Object Versioning
  • Bucket Quotas
  • Encryption
  • +
  • Lifecycle Rules
  • Troubleshooting
  • @@ -606,11 +607,49 @@ except Exception as e:
  • Follow the steps above to replicate A → B.
  • Repeat the process on Server B to replicate B → A (create a connection to A, enable rule).
  • -

    +

    Loop Prevention: The system automatically detects replication traffic using a custom User-Agent (S3ReplicationAgent). This prevents infinite loops where an object replicated from A to B is immediately replicated back to A.
    Deletes: Deleting an object on one server will propagate the deletion to the other server.

    + +

    Error Handling & Rate Limits

    +

    The replication system handles transient failures automatically:

    +
    + + + + + + + + + + + + + + + + + + + + + +
    BehaviorDetails
    Retry Logicboto3 automatically handles 429 (rate limit) errors using exponential backoff with max_attempts=2
    ConcurrencyUses a ThreadPoolExecutor with 4 parallel workers for replication tasks
    TimeoutsConnect: 5s, Read: 30s. Large files use streaming transfers
    +
    +
    +
    + + + + +
    + Large File Counts: When replicating buckets with many objects, the target server's rate limits may cause delays. There is no built-in pause mechanism. Consider increasing RATE_LIMIT_DEFAULT on the target server during bulk replication operations. +
    +
    +
    @@ -855,10 +894,92 @@ curl -X DELETE "{{ api_base }}/kms/keys/{key-id}?waiting_period_days=30" \

    -
    +
    12 +

    Lifecycle Rules

    +
    +

    Automatically delete expired objects, clean up old versions, and abort incomplete multipart uploads using time-based lifecycle rules.

    + +

    How It Works

    +

    + Lifecycle rules run on a background timer (Python threading.Timer), not a system cronjob. The enforcement cycle triggers every 3600 seconds (1 hour) by default. Each cycle scans all buckets with lifecycle configurations and applies matching rules. +

    + +

    Expiration Types

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    Expiration (Days)Delete current objects older than N days from their last modification
    Expiration (Date)Delete current objects after a specific date (ISO 8601 format)
    NoncurrentVersionExpirationDelete non-current (archived) versions older than N days from when they became non-current
    AbortIncompleteMultipartUploadAbort multipart uploads that have been in progress longer than N days
    +
    + +

    API Usage

    +
    # Set lifecycle rule (delete objects older than 30 days)
    +curl -X PUT "{{ api_base }}/<bucket>?lifecycle" \
    +  -H "Content-Type: application/json" \
    +  -H "X-Access-Key: <key>" -H "X-Secret-Key: <secret>" \
    +  -d '[{
    +    "ID": "expire-old-objects",
    +    "Status": "Enabled",
    +    "Prefix": "",
    +    "Expiration": {"Days": 30}
    +  }]'
    +
    +# Abort incomplete multipart uploads after 7 days
    +curl -X PUT "{{ api_base }}/<bucket>?lifecycle" \
    +  -H "Content-Type: application/json" \
    +  -H "X-Access-Key: <key>" -H "X-Secret-Key: <secret>" \
    +  -d '[{
    +    "ID": "cleanup-multipart",
    +    "Status": "Enabled",
    +    "AbortIncompleteMultipartUpload": {"DaysAfterInitiation": 7}
    +  }]'
    +
    +# Get current lifecycle configuration
    +curl "{{ api_base }}/<bucket>?lifecycle" \
    +  -H "X-Access-Key: <key>" -H "X-Secret-Key: <secret>"
    + +
    +
    + + + + +
    + Prefix Filtering: Use the Prefix field to scope rules to specific paths (e.g., "logs/"). Leave empty to apply to all objects in the bucket. +
    +
    +
    +
    +
    +
    +
    +
    + 13

    Troubleshooting & tips

    @@ -896,6 +1017,11 @@ curl -X DELETE "{{ api_base }}/kms/keys/{key-id}?waiting_period_days=30" \ Proxy headers missing or API_BASE_URL incorrect Ensure your proxy sends X-Forwarded-Host/Proto headers, or explicitly set API_BASE_URL to your public domain. + + Large folder uploads hitting rate limits (429) + RATE_LIMIT_DEFAULT exceeded (200/min) + Increase rate limit in env config, use Redis backend (RATE_LIMIT_STORAGE_URI=redis://host:port) for distributed setups, or upload in smaller batches. +
    @@ -918,6 +1044,7 @@ curl -X DELETE "{{ api_base }}/kms/keys/{key-id}?waiting_period_days=30" \
  • Object Versioning
  • Bucket Quotas
  • Encryption
  • +
  • Lifecycle Rules
  • Troubleshooting