{"id":14984934,"url":"https://github.com/wuespace/deno-asn-generator","last_synced_at":"2026-02-04T07:38:16.149Z","repository":{"id":255745459,"uuid":"853328358","full_name":"wuespace/deno-asn-generator","owner":"wuespace","description":"A Deno based system for generating / managing ASNs for documentat management systems in a collaborative environment.","archived":false,"fork":false,"pushed_at":"2024-12-12T14:02:07.000Z","size":444,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T22:54:16.285Z","etag":null,"topics":["asn","cli","deno","dms","docker","document-management","numbering","numbering-system","reference-number","web"],"latest_commit_sha":null,"homepage":"","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/wuespace.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2024-09-06T12:46:48.000Z","updated_at":"2024-12-12T14:01:48.000Z","dependencies_parsed_at":"2024-12-10T15:19:34.581Z","dependency_job_id":"49f9ce47-8698-431a-a916-14774c9d44d8","html_url":"https://github.com/wuespace/deno-asn-generator","commit_stats":{"total_commits":122,"total_committers":3,"mean_commits":"40.666666666666664","dds":"0.024590163934426257","last_synced_commit":"49c5ae99545dea8f9ea70b9410881fa8520f7e9b"},"previous_names":["wuespace/deno-asn-generator"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fdeno-asn-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fdeno-asn-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fdeno-asn-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wuespace%2Fdeno-asn-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wuespace","download_url":"https://codeload.github.com/wuespace/deno-asn-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312172,"owners_count":21082638,"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","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":["asn","cli","deno","dms","docker","document-management","numbering","numbering-system","reference-number","web"],"created_at":"2024-09-24T14:09:53.442Z","updated_at":"2026-02-04T07:38:16.142Z","avatar_url":"https://github.com/wuespace.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deno ASN Generator\n\n[![JSR Scope](https://jsr.io/badges/@wuespace)](https://jsr.io/@wuespace)\n[![JSR](https://jsr.io/badges/@wuespace/asn-generator)](https://jsr.io/@wuespace/asn-generator)\n[![JSR Score](https://jsr.io/badges/@wuespace/asn-generator/score)](https://jsr.io/badges/@wuespace/asn-generator/score)\n[![Deno CI](https://github.com/wuespace/deno-asn-generator/actions/workflows/deno-ci.yml/badge.svg)](https://github.com/wuespace/deno-asn-generator/actions/workflows/deno-ci.yml)\n[![Docker](https://github.com/wuespace/deno-asn-generator/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/wuespace/deno-asn-generator/actions/workflows/docker-publish.yml)\n\n[Deployment](DEPLOY.md) · [Configuration](env.md) · [License (MIT)](./LICENSE) ·\n[Contributing](./CONTRIBUTING.md)\n\n---\n\nAn environment for collaboratively creating ASN numbers to be used in the\nPaperless-NGX based document management system at WüSpace e. V.\n\n\u003cfigure\u003e\n\u003cimg src=\"screenshot.png\" alt=\"Screenshot. UI in the center. At the top, there are buttons to copy, regenerate, print, and download the ASN barcode. Below that, there is a search bar. Below that, text: New ASN. A barcode with an ASN.\" /\u003e\n\u003cfigcaption\u003eScreenshot of the Web UI.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n\u003cfigure\u003e\n\u003cimg src=\"static/asn-generator-logo.png\" alt=\"Diagonal purple ellipse. In it, a page with a barcode on the top-right hand corner and the letters A S N in the middle.\" /\u003e\n\u003cfigcaption\u003eApplication Logo.\u003c/figcaption\u003e\n\u003c/figure\u003e\n\n## Core Requirements\n\n- **REQ-1**: The system must be able to generate unique ASN numbers.\n- **REQ-2**: The system must be able to be used by multiple users at the same\n  time.\n- **REQ-3**: The system must allow reserving a range of ASNs for manual\n  assignment (e.g., for pre-printed barcodes).\n- **REQ-4**: The system must be able to be configured to use a specific prefix\n  for the ASN numbers.\n- **REQ-5**: The system must be easy to deploy and maintain.\n\n## Concept / ASN Format\n\n\u003e [!NOTE]\n\u003e The exact format of the ASN is configurable through environment variables. See\n\u003e [ASN_FORMAT_EXAMPLES.md](./ASN_FORMAT_EXAMPLES.md) for a list of examples with\n\u003e different configurations.\n\n```text\nWUE  - 100  - 001\n(1)  - (2)  - (3)\n\n(1) Prefix specified in configuration (WUE).\n(2) Numeric Namespace, whereas\n    - 100-599 is reserved for automatic generation, and\n    - 600-999 is reserved for user defined namespaces.\n    The user defined namespace can be used for pre-printed ASN barcodes and the like.\n(3) Counter, starting from 001, incrementing with each new ASN in the namespace.\n```\n\n### Calculation of the Namespace\n\nFor this example, we'll define $100$ to $599$ as the automatic namespace and\n$600$ to $999$ as the user defined namespace. We notate this as\n\n$$ r:=600 $$\n\nNote that the minimum and maximum overall namespace values $r_{min}$ and\n$r_{max}$ can be derived as they have to be the minimum and maximum numeric\nvalues with the same number of digits as $r$ to avoid collisions.\n\nFurthermore, let $t$ be the number of milliseconds since the Unix epoch. We can\ncalculate the current namespace $n$ as follows:\n\n$$ n \\in [r_{min}, r]; n = r_{min} + t \\mod (r - r_{min}) $$\n\n## OpenID Connect / Authentication\n\nThe system can optionally be configured to use OpenID Connect for\nauthentication. In this case, only authenticated users can generate ASNs.\nRead-only and lookup routes will still be available to all users.\n\nOpenID Connect is enabled when the `OIDC_ISSUER` environment variable is set.\n\nTo configure the system to use OpenID Connect, set the following environment\nvariables:\n\n- `OIDC_ISSUER`: The issuer URL of the OpenID Connect provider.\n- `OIDC_CLIENT_ID`: The client ID of the application.\n- `OIDC_CLIENT_SECRET`: The client secret of the application.\n- `OIDC_REDIRECT_URI`: The redirect URI of the application\n  (`https://your-domain/oidc/callback`).\n- `OIDC_SCOPES`: The scopes to request from the OpenID Connect provider.\n- `OIDC_AUTH_SECRET`: A secret used to sign the session cookie. Must be at least\n  32 characters long.\n\nOptionally, you can set the following environment variables:\n\n- `OIDC_UID_CLAIM`: The claim in the ID token that contains the user's unique\n  identifier. Defaults to `sub`.\n- `OIDC_NAME_CLAIM`: The claim in the ID token that contains the user's name.\n  Defaults to `name`.\n- `OIDC_ROLES_CLAIM`: The claim in the ID token that contains the user's roles.\n  Defaults to `groups`. While roles are currently not used by the generator,\n  they may in the future be used for RBAC.\n\n## Ideas / Roadmap\n\n- [x] Configurability through environment variables\n- [x] Log generated ASNs to the file system\n- [x] Connection to a database\n- [x] REST API\n- [x] Visual Web Interface\n- [x] CLI\n  - [x] Bump counter to avoid collissions after restoring backups (where ASNs\n        could have been generated after the time of the backup)\n  - [x] Analyze time between ASNs, providing the possibility to specify a\n        duration and a maximum collision probability for the bump (e.g. 1 hour,\n        0.1%), which calculates the bump counter accordingly\n- [x] Documentation\n- [x] Publish on JSR\n- [ ] Publish on Docker Hub\n- [x] Publish on GitHub Container Registry\n- [x] UI for quickly searching for ASNs in a DMS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuespace%2Fdeno-asn-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwuespace%2Fdeno-asn-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwuespace%2Fdeno-asn-generator/lists"}