# Example file for specifying the configuration using environment variables.
#
# For use with the gcloud run deploy --env-vars-file parameter.
#
# The CONFIG_JSON variable contains the JSON configuration which will
# override any deployed config.json file. Literal Block Scaler style (|)
# is used to preserve quotes and newlines without needing escaping.
#
# The format of the JSON object is as follows:
#
# "buckets" is a list of objects specifying source/destination buckets for
# scanning, allowing the service to handle multiple buckets.
#
# Each object in the list must have the 3 properties "unscanned", "clean" and
# "quarantined" specifying the bucket names to use.
#
# "ClamCvdMirrorBucket" is a GCS bucket used to mirror the clamav database
# definition files to prevent overloading the Clam servers and being rate
# limited/blacklisted.
#
# This bucket's contents are maintained by the updateCvdMirror.sh script,
# and can be shared across multiple deployments with the appropriate
# permissions.
#
# "fileExclusionPatterns" is a list of regular expressions. Files matching any
# of these patterns will be skipped during scanning. NOTE: These files will remain
# in the "unscanned" bucket and will need to be tidied and/or managed separately.
#
# Regular expressions can be expressed as simple strings,
# or as an array of 2 strings,  the pattern and regexp flags, such as 'i' for case insensitive matching",
#
# Example:
#
#   "fileExclusionPatterns": [
#     "\\.filepart$",  (Ignore files ending in ".filepart")
#     "^ignore_me.*\\.txt$",  (Ignore files starting with "ignore_me" and ending with ".txt")
#    [ '\\.tmp$', 'i' ] (Case insensitive match for files ending in .TMP, .tmp, .TmP etc)",
#   ]
#
# Cheat sheet for regular expressions:
# https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions/Cheatsheet
#
# Shell environmental variable substitution is supported in this file.
# At runtime, JSON will be written to the file /etc/malware-scanner-config.json.
#
CONFIG_JSON: |
  {
    "buckets": [
      {
        "unscanned": "unscanned-${PROJECT_ID}",
        "clean": "clean-${PROJECT_ID}",
        "quarantined": "quarantined-${PROJECT_ID}"
      }
    ],
    "ClamCvdMirrorBucket": "cvd-mirror-${PROJECT_ID}",
    "fileExclusionPatterns": [],
    "ignoreZeroLengthFiles": false
  }
