{"id":23790021,"url":"https://github.com/blackglory/static","last_synced_at":"2026-04-14T03:32:34.147Z","repository":{"id":44955868,"uuid":"383876937","full_name":"BlackGlory/static","owner":"BlackGlory","description":"🌿","archived":false,"fork":false,"pushed_at":"2026-02-19T19:38:17.000Z","size":2276,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-19T22:27:24.694Z","etag":null,"topics":["docker-image","esm","microservice","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/blackglory/static","language":"TypeScript","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/BlackGlory.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2021-07-07T17:31:33.000Z","updated_at":"2026-02-19T19:38:20.000Z","dependencies_parsed_at":"2025-02-21T12:44:04.684Z","dependency_job_id":"4bfe9438-0b15-4b13-9c69-e343bfe2086a","html_url":"https://github.com/BlackGlory/static","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/BlackGlory/static","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BlackGlory","download_url":"https://codeload.github.com/BlackGlory/static/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BlackGlory%2Fstatic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31781292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker-image","esm","microservice","nodejs","typescript"],"created_at":"2025-01-01T17:18:07.660Z","updated_at":"2026-04-14T03:32:34.131Z","avatar_url":"https://github.com/BlackGlory.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Static\nA static file server inspired by [Serve].\n\nThe service considers static files to be immutable by default,\nyou can set environment variable `STATIC_FOUND_CACHE_CONTROL` to change it.\n\n[Serve]: https://github.com/vercel/serve\n\n## Install\nThe environment variables `STATIC_HOST` and `STATIC_PORT` can be used to set the address and port that the server listens to.\nThe default values are `localhost` and `8080`.\n\n```sh\ngit clone https://github.com/BlackGlory/static\ncd static\npip install --requirement requirements.txt\nnpm install\nnpm run build\nnpm run bundle\nnpm start\n```\n\n### Docker\n```sh\ndocker run \\\n  --detach \\\n  --publish 8080:8080 \\\n  blackglory/static\n```\n\n#### docker-compose.yml\n```yaml\nversion: '3.8'\n\nservices:\n  static:\n    image: 'blackglory/static'\n    restart: always\n    environment:\n      - 'STATIC_SECRET=secret'\n    volumes:\n      - 'static-database:/database'\n      - 'static-storage:/storage'\n    ports:\n      - '8080:8080'\n\nvolumes:\n  static-database:\n  static-storage:\n```\n\n## API\n### Public\n#### get file\n`GET /files/:location`\n\nReturn the file relative environment `STATIC_STORAGE/files` directory.\n\n## Cache\n### `STATIC_NOT_FOUND_CACHE_CONTROL`\nThis environment variable is the response header `Cache-Control` when the file is not found.\nDefault: `private, no-cache, no-store, max-age=0, must-revalidate`\n\n### `STATIC_FOUND_CACHE_CONTROL`\nThis environment variable is the response header `Cache-Control` when the file is found.\nDefault: `public, max-age=31536000, immutable`\n\n## Content-Type\nThe mime types of files are determined by file extensions,\nif fails, try to get mime types from file data.\n\nRequests can specify a contentType in querystring,\nwhich allows skip the above steps:\n```ts\n{\n  contentType?: string\n}\n```\n\n## Image processing\nStatic support image processing, so that users can create responsive images.\n\nThe image processing feature works through querystring:\n```ts\n{\n  signature: string\n  format: 'jpeg' | 'webp'\n  quality: integer // 1-100\n  maxWidth?: integer\n  maxHeight?: integer\n  multiple?: float\n  contentType?: string\n}\n```\n\nThe derived images will be cached in `STATIC_STORAGE/derived-images`.\n\nYou can disable direct access to images with `STATIC_DISABLE_ACCESS_TO_ORIGINAL_IMAGES=true`.\n\n## Font processing\nStatic support font processing, so that users can create subsets of fonts.\n\nThe font processing feature works throught querystring:\n```ts\n{\n  signature: string\n  format: 'woff' | 'woff2'\n  subset: string\n  contentType?: string\n}\n```\n\nThe derived fonts will be cached in `STATIC_STORAGE/derived-fonts`.\n\nYou can disable direct access to fonts with `STATIC_DISABLE_ACCESS_TO_ORIGINAL_FONTS=true`.\n\n## Signature\nOnly users with the `STATIC_SECRET` can create a signature.\n\nCreate a signature:\n```ts\nconst urlSearchParams = new URLSearchParams(params)\nurlSearchParams.sort()\nconst signature = hmacSHA256(secret, urlSearchParams.toString())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Fstatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblackglory%2Fstatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblackglory%2Fstatic/lists"}