{"id":21531918,"url":"https://github.com/matrixai/polykey-network-dashboard","last_synced_at":"2025-04-10T00:29:01.286Z","repository":{"id":212035066,"uuid":"727020182","full_name":"MatrixAI/Polykey-Network-Dashboard","owner":"MatrixAI","description":"Polykey Network Dashboard","archived":false,"fork":false,"pushed_at":"2024-09-18T03:51:34.000Z","size":895,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"staging","last_synced_at":"2024-09-18T06:56:14.997Z","etag":null,"topics":["cybersecurity","dashboard","peer-to-peer","visualization"],"latest_commit_sha":null,"homepage":"https://mainnet.polykey.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MatrixAI.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}},"created_at":"2023-12-04T02:33:03.000Z","updated_at":"2024-06-25T02:08:42.000Z","dependencies_parsed_at":"2023-12-21T04:27:40.985Z","dependency_job_id":"6a88fae6-d7ec-43af-af1b-c3e4613febc1","html_url":"https://github.com/MatrixAI/Polykey-Network-Dashboard","commit_stats":null,"previous_names":["matrixai/polykey-network-dashboard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FPolykey-Network-Dashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FPolykey-Network-Dashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FPolykey-Network-Dashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MatrixAI%2FPolykey-Network-Dashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MatrixAI","download_url":"https://codeload.github.com/MatrixAI/Polykey-Network-Dashboard/tar.gz/refs/heads/staging","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226116124,"owners_count":17575948,"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":["cybersecurity","dashboard","peer-to-peer","visualization"],"created_at":"2024-11-24T02:18:11.671Z","updated_at":"2024-11-24T02:18:22.749Z","avatar_url":"https://github.com/MatrixAI.png","language":"TypeScript","readme":"# Polykey-Network-Dashboard\n\nNetwork dashboard for Polykey.\n\n## About\n\nThis uses Docusaurus as a CMS.\n\nGitHub builds this site via the CI/CD into static pages, rendering the markdown files.\n\nThe CI/CD then pushes it to [testnet.polykey.com](https://testnet.polykey.com) and [mainnet.polykey.com](https://mainnet.polykey.com) which is hosted by Cloudflare's worker system.\n\n## Development\n\nRun `nix develop`, and once you're inside, you can use:\n\n```sh\n# starts a local version\nnpm run start\n# build the the static site\nnpm run build\n# deploy to cloudflare\nnpm run deploy\n# lint the source code\nnpm run lint\n# automatically fix the source\nnpm run lintfix\n```\n\nYou need to do setup the `.env` from `.env.example` if you want to successfully deploy to Cloudflare.\n\nWe use Git LFS to store all media in `images/**`. It's important to ensure that `git-lfs` is installed on your system before you contribute anything (on NixOS, it is installed as a separate package to `git`). By default anything put under `images/**` when using `git add` (after LFS is setup) will be uploaded to LFS, and thus the repository will only have links. Because LFS is enabled, it is used on GitHub.\n\nIf this is the first time you cloned the repository, you must use `git lfs install` to ensure your local repository has LFS setup. It may be automatically setup if you already had it installed prior to cloning.\n\nPro-tip, if we need to make sure files that were accidentally not put into LFS must be put into LFS, the command to use is:\n\n```sh\ngit lfs migrate import --include=\"images/**\" --everything\n```\n\n## Contributing\n\nBecause we use docusaurus, we can choose to write in markdown, TSX or MDX.\n\n### Pages\n\nCreate a new markdown file in `/pages`. See the other files for formatting.\n\nNote that some pages were not able to be put into `/pages` due to to more complex coding. These are in the `/src`.\n\n### HTML Syntax\n\nSometimes markdown syntax just doesn't cut it, and HTML syntax needs to be used.\n\nWhile `docusaurus` is flexible, GitHub is not.\n\nGitHub will process the markdown and then sanitizes the HTML: https://github.com/github/markup#github-markup.\n\nThere is a limited set of HTML tags are here: https://github.com/gjtorikian/html-pipeline/blob/03ae30d713199c2562951d627b98b75dc16939e4/lib/html/pipeline/sanitization_filter.rb#L40-L49\n\nFurthermore not all attributes are kept. The `style` attribute for example is filtered out.\n\nThe most common styling attributes to be used will most likely be `align`, `width`, and `height`. See:  https://davidwells.io/snippets/how-to-align-images-in-markdown\n\n### Linking Assets (files, images)\n\nMarkdown supports 2 ways of referencing images:\n\n```md\n![](/images/foobar.png)\n\u003cimg src=\"/images/foobar.png\" /\u003e\n```\n\nThe former is markdown syntax, the latter is HTML tag.\n\nIn order to maintain portability, we always use absolute paths. This works on both GitHub markdown rendering and also for `docusaurus`.\n\nOn GitHub, which renders the markdown directly, the relative paths are considered relative to the location of the markdown file referencing the path. The absolute paths are considered relative to the root of the project repository. Therefore because `images` directory is located at the project root, it ends up being routable.\n\nWith `docusaurus`, the absolute paths are looked up relative to `static` directory. Inside the `static` directory we have created symlinks pointing back to `../images`. This allows `docusaurus` to also resolve these paths which will be copied into the `/build/` directory.\n\nNote that `docusaurus` doesn't do any special rendering for HTML tags, it uses the `src` as is. While markdown references will be further processed with webpack. It is therefore preferable to use markdown syntax instead. The `docusaurus` does support a variant of the HTML tag:\n\n```md\n\u003cimg src={require('/images/foobar.png').default} /\u003e\n```\n\nHowever this does not work in GitHub. So this is not recommended to use.\n\nTherefore if you want to add inline styles to an image and still use markdown syntax so you get the benefit of `docusaurus` asset processing, the styles must be applied outside the image reference in a surrounding tag:\n\n```md\n\u003cdiv align=\"center\"\u003e\n\n  ![](/images/foobar.png)\n\n\u003c/div\u003e\n```\n\nTake note of the whitespace newlines between, if no newlines are used, GitHub will interpret this as all HTML. Also note that `\u003cp\u003e\u003c/p\u003e` will not work.\n\nNote that this won't work for resizing the images unfortunately. You have to apply the `width` attribute directly to the `\u003cimg /\u003e` tag. See: https://github.com/facebook/docusaurus/discussions/6465 for more information.\n\n### Linking\n\nIn the navigation in Docusaurus, there are several properties that controls how the routing works. Because `polykey.com` is composed of separate cloudflare workers stitched together into a single domain, we have to hack around client side routing even for what looks like relative links.\n\n```js\n{\n  to: 'pathname:///docs/',\n  target: '_self'\n}\n```\n\nThe `to` ensures it shows up as a relative link.\n\nThe `pathname://` bypasses the client side routing forcing server side routing.\n\nThe `target: '_self'` ensures that the same frame is used instead of creating a new frame.\n\n## Deployment\n\nYou need to setup `.env` from `.env.example`.\n\nThen you can build `npm run build`.\n\nFinally run `npm run deploy`.\n\nThis will deploy the development workers first.\n\nIf you want to deploy production workers, you have to `npm run deploy -- --env production`.\n\n### DNS\n\nDNS is managed by cloudflare. The `wrangler.toml` specifies the usage of a custom domain for the worker that runs this static site.\n\nThe entire built `public` directory gets uploaded to cloudflare's KV system.\n\nThe custom domain is then added as a special record on the `testnet.polykey.com` and `mainnet.polykey.com` zone which routes directly to the worker service.\n\nFinally HTTPS is always on, so there's a redirection from `http` to `https` too.\n\nTraditionally without the custom domain, you would have to use worker routes. However this only works if you also create a A record for the root with the proxy-mode turned on. The actual address doesn't matter, you can point it to a private or reserved IP, maybe even `127.0.0.1` because once the proxy is activated, the worker routes take effect.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Fpolykey-network-dashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrixai%2Fpolykey-network-dashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrixai%2Fpolykey-network-dashboard/lists"}