{"id":14973024,"url":"https://github.com/rocketbase-io/commons-asset","last_synced_at":"2025-08-27T05:17:48.864Z","repository":{"id":57736135,"uuid":"133913951","full_name":"rocketbase-io/commons-asset","owner":"rocketbase-io","description":"Adds a flexible asset service with a bunch of features to your spring-boot applications","archived":false,"fork":false,"pushed_at":"2024-08-08T11:06:16.000Z","size":7476,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-18T04:45:34.443Z","etag":null,"topics":["asset","file-upload","gridfs-storage","image-processing","s3-bucket","spring-boot","spring-mvc"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rocketbase-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-05-18T06:41:36.000Z","updated_at":"2025-05-15T12:25:04.000Z","dependencies_parsed_at":"2024-08-08T13:06:11.045Z","dependency_job_id":null,"html_url":"https://github.com/rocketbase-io/commons-asset","commit_stats":null,"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"purl":"pkg:github/rocketbase-io/commons-asset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Fcommons-asset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Fcommons-asset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Fcommons-asset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Fcommons-asset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rocketbase-io","download_url":"https://codeload.github.com/rocketbase-io/commons-asset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rocketbase-io%2Fcommons-asset/sbom","scorecard":{"id":781822,"data":{"date":"2025-08-11","repo":{"name":"github.com/rocketbase-io/commons-asset","commit":"d7208567d09dc2a02ae5d20a3afe03ff68cccee6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/boot.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/release-to-maven-central.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/boot.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/rocketbase-io/commons-asset/boot.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/boot.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/rocketbase-io/commons-asset/boot.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/rocketbase-io/commons-asset/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/rocketbase-io/commons-asset/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-to-maven-central.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/rocketbase-io/commons-asset/release-to-maven-central.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-to-maven-central.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/rocketbase-io/commons-asset/release-to-maven-central.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release-to-maven-central.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/rocketbase-io/commons-asset/release-to-maven-central.yml/master?enable=pin","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release-to-maven-central.yml:11"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-h46c-h94j-95f3","Warn: Project is vulnerable to: GHSA-4gc7-5j7h-4qph","Warn: Project is vulnerable to: GHSA-4wp7-92pw-q264","Warn: Project is vulnerable to: GHSA-9cmq-m9j5-mvww","Warn: Project is vulnerable to: GHSA-2rmj-mq67-h97g","Warn: Project is vulnerable to: GHSA-2wrp-6fg6-hmc5","Warn: Project is vulnerable to: GHSA-4wrc-f8pq-fpqp","Warn: Project is vulnerable to: GHSA-ccgv-vj62-xf9h","Warn: Project is vulnerable to: GHSA-hgjh-9rj2-g67j"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T05:05:18.762Z","repository_id":57736135,"created_at":"2025-08-23T05:05:18.762Z","updated_at":"2025-08-23T05:05:18.762Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272294433,"owners_count":24908819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asset","file-upload","gridfs-storage","image-processing","s3-bucket","spring-boot","spring-mvc"],"created_at":"2024-09-24T13:47:57.785Z","updated_at":"2025-08-27T05:17:48.842Z","avatar_url":"https://github.com/rocketbase-io.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# commons-asset\n\n![logo](assets/commons-logo.svg)\n\n![build](https://github.com/rocketbase-io/commons-asset/actions/workflows/ci.yml/badge.svg)\n[![Maven Central](https://badgen.net/maven/v/maven-central/io.rocketbase.commons/commons-asset)](https://mvnrepository.com/artifact/io.rocketbase.commons/commons-asset)\n\nAdd a flexible asset service with a bunch of features to your spring-boot applications.\n\nI've added a swagger api-documentation. You can find it within [src](./commons-asset-api/src/doc/swagger)\nof [swaggerHub](https://app.swaggerhub.com/apis-docs/melistik/commons-asset)\n\n**Features:**\n\n* api and controller to handle asset-uploads\n* works with images: jpeg, gif, png, tiff, svg, webp, heic/heif and documents like: pdf, excel, word, powerpoint and zip\n  *(with 4.6 upwards a long list of other types like videos, audio and docs has been added)*\n* you can configure the allowed contentTypes via property *(\"asset.api.types\")*\n* 4 different storage implementations (mongo-grid-fs / aws-s3 / jpa-blob / local-file)\n* embedded thumb service with different implementations (java / command-line ImageMagick or extermal services like\n  imgproxy/thumbor)\n* java resource to communicate with api\n* batch downloading urls and storing them / analyzing\n* integrated [color-thief](https://github.com/SvenWoltmann/color-thief-java) in order to get primary and other colors\n  from photo\n* optional LIQP (Low Quality Image Placeholder) option to have a placeholder for images in base64 encoded in ultra low\n  resolution\n* optional preview calculation after upload\n* configure available preview-sizes\n\n***module-structure-tree:***\n\n![project-structure](assets/module-tree.svg?v=2)\n\n## commons-asset-api\n\nThis module provides the DTOs and a client to communicate with the asset endpoints.\nThe main Objects are: **AssetReference** that is used to store in MongoDb in case of refrencing and **AssetRead**\ncontaining also the different preview urls.\n\n***AssetReference sample:***\n\n\u003cimg src=\"/commons-asset-server/src/test/resources/assets/photo-1595776430819-9aa35f06830b.jpeg\" align=\"left\" height=\"100\" width=\"150\" \u003e\n\n```json\n{\n  \"id\": \"5fc6076bb8f6921c45eedae5\",\n  \"urlPath\": \"5fc6076bb8f6921c45eedae5\",\n  \"type\": \"JPEG\",\n  \"meta\": {\n    \"created\": \"2020-12-01T09:05:47.039Z\",\n    \"originalFilename\": \"photo-1595776430819-9aa35f06830b.jpeg\",\n    \"fileSize\": 183740,\n    \"resolution\": {\n      \"width\": 1950,\n      \"height\": 1300\n    },\n    \"colorPalette\": {\n      \"primary\": \"#b0b2b5\",\n      \"colors\": [\n        \"#302f2a\",\n        \"#4a5355\"\n      ]\n    }\n  },\n  \"lqip\": \"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAKBueIx4ZKCMgoy0qqC+8P//8Nzc8P//////////////////////////////////////////////////////////2wBDAaq0tPDS8P//////////////////////////////////////////////////////////////////////////////wAARCAAhADIDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCSiohL7Uvme1AElGaj8wUhegB5YDvTS57VHmjNAC5PqaKbRQBJtP8Aepdp9acKWgBm0+pppDe9S0lAEXPqaTn1qVlBphQigBtFGKKAJRS0UUAFLRRQAUhoooASiiigD//Z\",\n  \"previews\": {\n    \"s\": \"http://localhost:51857/api/asset/5fc6076bb8f6921c45eedae5/s\",\n    \"m\": \"http://localhost:51857/api/asset/5fc6076bb8f6921c45eedae5/m\",\n    \"l\": \"http://localhost:51857/api/asset/5fc6076bb8f6921c45eedae5/l\",\n    \"responsive\": {\n      \"sizes\": \"(max-width: 1200px) 100vw, 1200px\",\n      \"srcset\": \"http://localhost:51857/api/asset/5fc6076bb8f6921c45eedae5/s 300w, http://localhost:51857/api/asset/5fc6076bb8f6921c45eedae5/m 600w, http://localhost:51857/api/asset/5fc6076bb8f6921c45eedae5/l 1200w\",\n      \"src\": \"http://localhost:51857/api/asset/5fc6076bb8f6921c45eedae5/l\"\n    }\n  },\n  \"download\": \"http://localhost:51857/api/asset/5fc6076bb8f6921c45eedae5/b\",\n  \"keyValues\": {}\n}\n```\n\nWith urlPath you can calculate your preview url. The logic is been implemented in AssetConverter.toRead(...)\n\nDuring upload process the file is getting read so that some meta information get stored. In case of image also the\nresolution is getting stored...\n\n## commons-asset-tooling\n\nContaining Thumbnail-Service, ColorThief, Download-Service, ImageHandler (for download images and on the fly\nthumbnailing + base64 converting)...\n\n## commons-asset-core\n\nContaining an implementation for storing asset references...\n\n| property                    | default                                                     | explanation                                                                                                                                                                                        |\n|-----------------------------|-------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| asset.api.path              | /api/asset                                                  | base path of assetController                                                                                                                                                                       |\n| asset.api.types             | *All*                                                       | you can shrink allowed Types (is a list property)                                                                                                                                                  |\n| asset.imagemagick.enabled   | false                                                       | you can active imagemagick command-line use otherwise java-processor will get used                                                                                                                 |\n| asset.api.download          | true                                                        | you can disable endpoint                                                                                                                                                                           |\n| asset.api.delete            | true                                                        | when false no delete is possible                                                                                                                                                                   |\n| asset.api.copy              | true                                                        | when false no copy is possible                                                                                                                                                                     |\n| asset.api.batch             | true                                                        | you can disable batch endpoint                                                                                                                                                                     |\n| asset.api.analyse           | true                                                        | you can disable analyse endpoint                                                                                                                                                                   |\n| asset.api.preview           | true                                                        | should only been taken in case of mongo-storage\u003cbr /\u003eplease consider also using outside caching                                                                                                    |\n| asset.api.detect-resolution | true                                                        | you can disable image resolution detection                                                                                                                                                         |\n| asset.api.detect-colors     | true                                                        | you can disable image colorThief                                                                                                                                                                   |\n| asset.api.base-url          | \"\"                                                          | used for previewUrls in case of mongo-storage, will get used as fallback                                                                                                                           |\n| asset.api.preview-quality   | XS: 0.7\u003cbr /\u003eS: 0.75\u003cbr /\u003eM: 0.8\u003cbr /\u003eL: 0.85\u003cbr /\u003eXL: 0.85 | configure quality of image preview via java-code. Its a Map\u003cString, Float\u003e Configuration and the key needs to match the enum PreviewSize\u003cbr /\u003e\u003cbr /\u003eValueRange is between 0 - 1.\u003cbr /\u003e1 means 100% |\n| asset.api.preview-sizes     | XS, S, M, L, XL                                             | configure possible preview-sizes (will limit precalcuation + assetRead previewSizes)                                                                                                               |\n| asset.api.precalculate      | false                                                       | when enabled the configured previews of configured sizes will get generated directly after store of original file                                                                                  |\n\n**LQIP** (Low Quality Image Placeholder) since 3.1.x there is an option to allow adding base64 thumb as a placeholder to\nthe assetReference. During upload process the system adds it to the entity and the small thumb get stored in db as well.\nIt should be used as placeholder before loading the main preview. To lower http calls the \"binary\" is already containing\nwithin the rest response.\n\n|                       | default | explanation                   |\n|-----------------------|---------|-------------------------------|\n| asset.lqip.enabled    | false   | by default disabled feature   |\n| asset.lqip.max-width  | 50      | max with of the image         |\n| asset.lqip.max-height | 50      | max height of the image       |\n| asset.lqip.quality    | 0.05    | ultra low res of the image 5% |\n\nAn usecase example could be found here [codepen - low quality image placeholder](https://codepen.io/alxdr/pen/oNgKNGY)\n\n**Shrink-options** in some cases it's useful not to store the original imagesize. Therefore some new options had been\nadded sine 3.5.x\n\n|                         | default | explanation                         |\n|-------------------------|---------|-------------------------------------|\n| asset.shrink.enabled    | false   | by default disabled feature         |\n| asset.shrink.max-width  | 2560    | max with of the image               |\n| asset.shrink.max-height | 2560    | max height of the image             |\n| asset.shrink.quality    | 0.9     | quality of image - default mean 90% |\n\n### custom preview service\n\nFrom version 2.2.x on we've removed our thumbor integration to open our project to multiple thumb providers. In case you\nwould like to use your own you need to provide a custom bean within you application.\n\n````java\n/*\n * \u003cdependency\u003e\n *     \u003cgroupId\u003ecom.squareup\u003c/groupId\u003e\n *     \u003cartifactId\u003epollexor\u003c/artifactId\u003e\n *     \u003cversion\u003e2.0.4\u003c/version\u003e\n * \u003c/dependency\u003e\n */\n@Service\n@RequiredArgsConstructor\npublic abstract class ThumborPreviewService implements AssetPreviewService {\n\n    protected final ThumborProperties thumborProperties;\n\n    public String getPreviewUrl(AssetReference assetReference, PreviewSize size) {\n        return getThumbor().buildImage(assetReference.getUrlPath())\n                .resize(size.getMaxWidth(), size.getMaxHeight())\n                .fitIn()\n                .toUrl();\n    }\n\n    protected Thumbor getThumbor() {\n        if (thumbor == null) {\n            String thumborKey = thumborProperties.getKey();\n            if (thumborKey.isEmpty()) {\n                thumbor = Thumbor.create(thumborProperties.getHost());\n            } else {\n                thumbor = Thumbor.create(thumborProperties.getHost(), thumborKey);\n            }\n        }\n        return thumbor;\n    }\n\n}\n````\n\n## commons-asset-entity-mongo\n\nImplementation for MongoRepository + Mongo Entity...\n\n## commons-asset-entity-jpa\n\nImplementation for JpaRepository + Jpa Entity...\n\n**If you want to see sql-create statements or liquibase changeLogs take a look in schema-generation/dist**\n\n## commons-asset-storage-fs\n\nLocal-FileStorageService\n\n|                    | default      | explanation                             |\n|--------------------|--------------|-----------------------------------------|\n| asset.fs.base-path | **required** | required base start path to store files |\n\n## commons-asset-storage-jpa\n\nStores files as blob in database.\n\n## commons-asset-storage-mongo\n\nStore files in mongo-database with grid-fs\n\n## commons-asset-storage-s3\n\nContaining a communication layer with s3 in order to use it as file storage. Uses the\nofficial [aws-java-sdk-s3](https://aws.amazon.com/de/sdk-for-java/)\n\n| property                           | default                                                                                                                                                                                                                                      | explanation                                                                                                                 |\n|------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| asset.s3.bucket                    | **required**                                                                                                                                                                                                                                 | bucket name where files should get stored                                                                                   |\n| asset.s3.access-key                | **required**                                                                                                                                                                                                                                 |                                                                                                                             |\n| asset.s3.secret-key                | **required**                                                                                                                                                                                                                                 |                                                                                                                             |\n| asset.s3.region                    | **required**                                                                                                                                                                                                                                 |                                                                                                                             |\n| asset.s3.endpoint                  | *optional*                                                                                                                                                                                                                                   | allow to connect to replacements of aws s3\u003cbr /\u003eby for example  [minio](https://www.minio.io/) you can specify the endpoint |\n| asset.s3.path-style-access-enabled | *optional*                                                                                                                                                                                                                                   | property to configure aws-java-sdk                                                                                          |\n| asset.s3.signer-override           | *optional*                                                                                                                                                                                                                                   | property to configure aws-java-sdk                                                                                          |   |\n| asset.s3.download-expire           | \"3d\" *(3 days)* \u003cbr /\u003e (max 7 for AWS and Minio) \u003cbr /\u003e [simple duration layout](https://docs.spring.io/spring-boot/docs/2.1.12.RELEASE/reference/html/boot-features-external-config.html#boot-features-external-config-conversion-duration) | property to configure expiration of presigned urls in case no public-url                                                    |\n| asset.s3.public-read-object        | false                                                                                                                                                                                                                                        | property to configure how original file is accessable                                                                       |   |\n\n### example configs\n\n```yaml\n## minio\nasset:\n  s3:\n    access-key: XXX\n    secret-key: XXX\n    region: us-east-1\n    bucket: sample\n    path-style-access-enabled: true\n    signer-override: AWSS3V4SignerType\n    endpoint: \"https://minio.example.com\"\n## aws\nasset:\n  s3:\n    access-key: XXX\n    secret-key: XXX\n    region: eu-central-1\n    bucket: sample\n```\n\n### multiple buckets\n\nYou can provide your custom BucketResolver bean to allow support for multiple buckets. An sample implementation could\nbe.\n\n````java\n\n@Service\npublic class CustomBucketResolver implements BucketResolver {\n\n    @Override\n    public String resolveBucketName(AssetReference assetReference) {\n        if (\"profile\".equalsIgnoreCase(assetReference.getContext())) {\n            return \"profile_bucket\";\n        }\n        return \"default_bucket\";\n    }\n}\n````\n\n## commons-asset-rest\n\nContaining an all controllers for the rest implementation...\n\n**Hint:** The maximum fileupload size within a spring-boot application is by default just 1Mb you can change this via a\nproperty: **spring.servlet.multipart.max-file-size=5MB**\n\n## commons-asset-imgproxy\n\nSimple preconfiguration to use imgproxy for rendering thumbs via [imgproxy](https://imgproxy.net/) and currently only\nconfigured for s3 use...\n\n|                         | default      | explanation                             |\n|-------------------------|--------------|-----------------------------------------|\n| asset.imgproxy.base-url | **required** | required base start path to store files |\n| asset.imgproxy.key      | optional     |                                         |\n| asset.imgproxy.salt     | optional     |                                         |\n| asset.imgproxy.enlarge  | false        | should img-proxy return enlarged thumbs |\n\n## commons-asset-server-filepond\n\nAdd **/api/asset/filepond** endpoint to handle uploads. It is similar to base upload but is more flexible with\nproperties and also returns required assetId instead of AssetRead...\n\n### The MIT License (MIT)\n\nCopyright (c) 2020 rocketbase.io\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\nrights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit\npersons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the\nSoftware.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE\nWARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\nOTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocketbase-io%2Fcommons-asset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frocketbase-io%2Fcommons-asset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frocketbase-io%2Fcommons-asset/lists"}