{"id":15013941,"url":"https://github.com/wechaty/puppet-service","last_synced_at":"2025-04-12T05:53:27.979Z","repository":{"id":40012555,"uuid":"138837265","full_name":"wechaty/puppet-service","owner":"wechaty","description":"Wechaty Puppet Provider for providing/consuming the Wechaty Puppet Service","archived":false,"fork":false,"pushed_at":"2023-07-27T04:46:30.000Z","size":519,"stargazers_count":79,"open_issues_count":64,"forks_count":19,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-12T05:53:20.621Z","etag":null,"topics":["grpc","hostie","puppet","service","wechaty"],"latest_commit_sha":null,"homepage":"https://paka.dev/npm/wechaty-puppet-service","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wechaty.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}},"created_at":"2018-06-27T06:10:21.000Z","updated_at":"2025-03-16T03:08:36.000Z","dependencies_parsed_at":"2024-01-23T21:15:46.102Z","dependency_job_id":"9f5f6f9b-4f7e-4298-ab5b-009d31208c84","html_url":"https://github.com/wechaty/puppet-service","commit_stats":null,"previous_names":["wechaty/wechaty-puppet-service","chatie/wechaty-puppet-hostie"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wechaty%2Fpuppet-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wechaty","download_url":"https://codeload.github.com/wechaty/puppet-service/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525156,"owners_count":21118616,"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":["grpc","hostie","puppet","service","wechaty"],"created_at":"2024-09-24T19:44:58.978Z","updated_at":"2025-04-12T05:53:27.957Z","avatar_url":"https://github.com/wechaty.png","language":"TypeScript","readme":"# wechaty-puppet-service\n\n[![NPM Version](https://badge.fury.io/js/wechaty-puppet-service.svg)](https://www.npmjs.com/package/wechaty-puppet-service)\n[![NPM](https://github.com/wechaty/wechaty-puppet-service/workflows/NPM/badge.svg)](https://github.com/wechaty/wechaty-puppet-service/actions?query=workflow%3ANPM)\n[![ES Modules](https://img.shields.io/badge/ES-Modules-brightgreen)](https://github.com/Chatie/tsconfig/issues/16)\n\n![Wechaty Service](https://wechaty.github.io/wechaty-puppet-service/images/hostie.png)\n\nWechaty Puppet Service is gRPC for Wechaty Puppet Provider.\n\nFor example, we can cloudify the Wechaty Puppet Provider wechaty-puppet-padlocal\nto a Wechaty Puppet Service by running our Wechaty Puppet Service Token Gateway.\n\nIf you want to learn more about what is Wechaty Puppet and Wechaty Puppet Service,\nwe have a blog post to explain them in details at\n\u003chttps://wechaty.js.org/2021/01/14/wechaty-puppet-service/\u003e\n\n[![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-brightgreen.svg)](https://github.com/Wechaty/wechaty)\n\n## Features\n\n1. Consume Wechaty Puppet Service\n1. Provide Wechaty Puppet Service\n\n## Usage\n\n```ts\nimport { WechatyBuilder } from 'wechaty'\n\nconst wechaty = WechatyBuilder.build({\n  puppet: 'wechaty-puppet-service',\n  puppetOptions: {\n    token: `${TOKEN}`\n  }\n})\n\nwechaty.start()\n```\n\nLearn more about Wechaty Puppet Token from our official website: \u003chttp://wechaty.js.org/docs/puppet-services/\u003e\n\n## Environment Variables\n\n### 1 `WECHATY_PUPPET_SERVICE_TOKEN`\n\nThe token set to this environment variable will become the default value of `puppetOptions.token`\n\n```sh\nWECHATY_PUPPET_SERVICE_TOKEN=${WECHATY_PUPPET_SERVCIE_TOKEN} node bot.js\n```\n\n## gRPC Health Checking Protocol\n\nFrom version 0.37, Wechaty Puppet Service start\nsupporting the [GRPC Health Checking Protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md).\n\n```sh\n$ npm install --global wechaty-token\n$ go install github.com/grpc-ecosystem/grpc-health-probe@latest\n\n$ wechaty-token discovery uuid_12345678-1234-1234-1234-567812345678\n{\"host\": 1.2.3.4, \"port\": 5678}\n\n$ grpc-health-probe -tls -tls-no-verify -addr 1.2.3.4\nstatus: SERVING\n```\n\nSee:\n\n- [Add health checking API wechaty/grpc#151](https://github.com/wechaty/grpc/issues/151)\n\n## Resources\n\n### Authentication\n\n1. [Authentication and Security in gRPC Microservices - Jan Tattermusch, Google](https://youtu.be/_y-lzjdVEf0)\n1. [[gRPC #15] Implement gRPC interceptor + JWT authentication in Go](https://youtu.be/kVpB-uH6X-s)\n\n## History\n\n### master v0.31\n\n1. ES Modules supported.\n1. gRPC Health Checking Protocol support\n\n### v0.30 (Aug 25, 2021)\n\n1. Implemented TLS and server-side token authorization.\n1. Refactor the gRPC client code.\n1. Add local payload cache to reduce the cost of RPC.\n\n#### New environment variables\n\n\u003c!-- markdownlint-disable MD013 --\u003e\n\n1. `WECHATY_PUPPET_SERVICE_TLS_CA_CERT`: can be overwrite by `options.tlsRootCert`. Set Root CA Cert to verify the server or client.\n\nFor Puppet Server:\n\n| Environment Variable | Options | Description |\n| -------------------- | ------- | ----------- |\n| `WECHATY_PUPPET_SERVICE_TLS_SERVER_CERT` | `options.tls.serverCert` | Server CA Cert (string data) |\n| `WECHATY_PUPPET_SERVICE_TLS_SERVER_KEY` | `options.tls.serverKey` | Server CA Key (string data) |\n| `WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVER` | `options.tls.disable` | Set `true` to disable server TLS |\n\nFor Puppet Client:\n\n| Environment Variable | Options | Description |\n| -------------------- | ------- | ----------- |\n| `WECHATY_PUPPET_SERVICE_AUTHORITY` | `options.authority` | Service discovery host, default: `api.chatie.io` |\n| `WECHATY_PUPPET_SERVICE_TLS_CA_CERT` | `options.caCert` | Certification Authority Root Cert, default is using Wechaty Community root cert |\n| `WECHATY_PUPPET_SERVICE_TLS_SERVER_NAME` | `options.serverName` | Server Name (mast match for SNI) |\n| `WECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENT` | `options.tls.disable` | Set `true` to disable client TLS |\n\n## Changelog\n\n### main v1.0 (Oct 29, 2021)\n\nRelease v1.0 of Wechaty Puppet Service.\n\n1. use [wechaty-token](https://github.com/wechaty/token)\n  for gRPC service discovery with `wechaty` schema (xDS like)\n1. deprecated `WECHATY_SERVICE_DISCOVERY_ENDPOINT`,\n  replaced by `WECHATY_PUPPET_SERVICE_AUTHORITY`.\n  (See [#156](https://github.com/wechaty/wechaty-puppet-service/issues/156))\n1. enable TLS \u0026 Token Auth (See [#124](https://github.com/wechaty/wechaty-puppet-service/issues/124))\n\n### v0.14 (Jan 2021)\n\nRename from ~~wechaty-puppet-hostie~~ to [wechaty-puppet-service](https://www.npmjs.com/package/wechaty-puppet-service)\n(Issue [#118](https://github.com/wechaty/wechaty-puppet-service/issues/118))\n\n### v0.10.4 (Oct 2020)\n\n1. Add 'grpc.default_authority' to gRPC client option.  \n    \u003e See: [Issue #78: gRPC server can use the authority  to identify current user](https://github.com/wechaty/wechaty-puppet-hostie/pull/78)\n\n### v0.6 (Apr 2020)\n\nBeta Version\n\n1. Reconnect to Hostie Server with RxSJ Observables\n\n### v0.3 (Feb 2020)\n\n1. Publish the NPM module [wechaty-puppet-hostie](https://www.npmjs.com/package/wechaty-puppet-hostie)\n1. Implemented basic hostie features with gRPC module: [@chatie/grpc](https://github.com/Chatie/grpc)\n\n### v0.0.1 (Jun 2018)\n\nDesigning the puppet hostie with the following protocols:\n\n1. [gRPC](https://grpc.io/)\n1. [JSON RPC](https://www.jsonrpc.org/)\n1. [OpenAPI/Swagger](https://swagger.io/docs/specification/about/)\n\n## Maintainers\n\n- [@huan](https://github.com/huan) Huan\n- [@windmemory](https://github.com/windmemory) Yuan\n\n## Copyright \u0026 License\n\n- Code \u0026 Docs © 2018-now Huan LI \\\u003czixia@zixia.net\\\u003e\n- Code released under the Apache-2.0 License\n- Docs released under Creative Commons\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwechaty%2Fpuppet-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwechaty%2Fpuppet-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwechaty%2Fpuppet-service/lists"}