{"id":15564245,"url":"https://github.com/hatamiarash7/go-chat","last_synced_at":"2025-04-23T23:21:50.184Z","repository":{"id":61988539,"uuid":"556904691","full_name":"hatamiarash7/Go-Chat","owner":"hatamiarash7","description":"Simple \u0026 Encrypted Chat","archived":false,"fork":false,"pushed_at":"2025-02-12T20:28:03.000Z","size":107,"stargazers_count":3,"open_issues_count":17,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T04:31:44.464Z","etag":null,"topics":["chat","chat-application","chatapp","go","golang","gpg","gpg-encryption"],"latest_commit_sha":null,"homepage":"","language":"Go","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/hatamiarash7.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-24T18:33:08.000Z","updated_at":"2024-12-09T07:57:45.000Z","dependencies_parsed_at":"2024-06-21T16:26:47.991Z","dependency_job_id":"d1e87970-efd2-48d8-b85f-342c61e4d31d","html_url":"https://github.com/hatamiarash7/Go-Chat","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatamiarash7%2FGo-Chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatamiarash7%2FGo-Chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatamiarash7%2FGo-Chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatamiarash7%2FGo-Chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hatamiarash7","download_url":"https://codeload.github.com/hatamiarash7/Go-Chat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250529902,"owners_count":21445692,"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":["chat","chat-application","chatapp","go","golang","gpg","gpg-encryption"],"created_at":"2024-10-02T16:40:21.531Z","updated_at":"2025-04-23T23:21:50.161Z","avatar_url":"https://github.com/hatamiarash7.png","language":"Go","funding_links":["https://ko-fi.com/D1D1WGU9"],"categories":[],"sub_categories":[],"readme":"# Go Chat\n\n[![Release version][badge_release_version]][link_releases]\n![Project language][badge_language]\n[![Release][release_badge]][release_link]\n[![License][badge_license]][link_license]\n[![Image size][badge_size_latest]][link_docker_hub]\n\nIt's a simple chat system using a **PUB/SUB** single channel and **GPG encryption**. Any message sent from a client ( publisher ) is routed to each other client ( subscriber ) on demand.\n\n- [Go Chat](#go-chat)\n  - [How-to](#how-to)\n  - [Configure](#configure)\n  - [Usage](#usage)\n    - [Binaries](#binaries)\n    - [Docker](#docker)\n    - [Build from source](#build-from-source)\n  - [Support 💛](#support-)\n  - [Contributing 🤝](#contributing-)\n  - [Issues](#issues)\n\n## How-to\n\nAll messages are encrypted using GPG and the public key of the recipient. The encrypted message is then sent to the server and routed to the recipient. The recipient then decrypts the message using their private key.\n\n```text\n             ┌────────┐                  ┌────────┐\nMessage ─────► Client │                  │ Client ├──Decrypt──►\n             └───┬────┘                  └────▲───┘\n                 │                            │\n                 │           ┌────────┐       │\n                 └─Encrypt───► Server ├───────┘\n                             └────────┘\n```\n\n## Configure\n\nYou need to have some environment variables set up. You can do this by creating a `.env` file in the root of the project. See the example:\n\n```env\nPORT=\nHOST=\nPUBLIC_KEY_FILE=\nPRIVATE_KEY_FILE=\nPASSPHRASE=\n```\n\n| Variable         | Description                         | Default     |\n| ---------------- | ----------------------------------- | ----------- |\n| START_MODE       | The mode to start the application   | `server`    |\n| PORT             | The port the server will listen on. | `12345`     |\n| HOST             | The host the server will listen on. | `localhost` |\n| PUBLIC_KEY_FILE  | The path to the public key file.    |             |\n| PRIVATE_KEY_FILE | The path to the private key file.   |             |\n| PASSPHRASE       | The passphrase for the private key. |             |\n\nTo separate the server from the client, you can use the `START_MODE` variable. This can be set to either `server` or `client`. If it is set to `server`, the server will start. If it is set to `client`, the client will start.\n\n\u003e **Note**: You should escape any special characters for the `PASSPHRASE`.\n\n## Usage\n\n### Binaries\n\nDownload the latest release from the [releases page](https://github.com/hatamiarash7/Go-Chat/releases/latest) based on your operating system and architecture.\n\n**Server:**\n\n```bash\nSTART_MODE=server ./go-chat-linux-amd64\n```\n\n**Client:**\n\nConfigure your `.env` file and then run the following command:\n\n```bash\nSTART_MODE=client ./go-chat-linux-amd64\n```\n\n\u003e **Note**: For MacOS, you should allow the application to run. You can do this by going to `System Preferences \u003e Security \u0026 Privacy \u003e General` and then click `Open Anyway`.\n\n### Docker\n\nI think we don't need a Docker image for the **Client**. But if you want to run the **Server** in a Docker container, you can use the published image.\n\n```bash\ndocker run -it hatamiarash7/go-chat-server\n```\n\nUse `PORT` and `HOST` environment variables to configure the server.\n\n```bash\ndocker run -it -e PORT=1234 -e HOST=0.0.0.0 hatamiarash7/go-chat-server\n```\n\n\u003e **Note**: Default `PORT` is `12345` and default `HOST` is `0.0.0.0` for Docker.\n\n### Build from source\n\nTo build the application from source, run the `build` target:\n\n```bash\nmake build\n```\n\nFirst, you should build you need to start the server. You can do this by running the following command:\n\n```bash\nmake server\n```\n\nThen, you can run any number of clients. You can do this by running the following command:\n\n```bash\nmake client\n```\n\nNote that you should set required environment variables before running the client.\n\n---\n\n## Support 💛\n\n[![Donate with Bitcoin](https://en.cryptobadges.io/badge/micro/bc1qmmh6vt366yzjt3grjxjjqynrrxs3frun8gnxrz)](https://en.cryptobadges.io/donate/bc1qmmh6vt366yzjt3grjxjjqynrrxs3frun8gnxrz) [![Donate with Ethereum](https://en.cryptobadges.io/badge/micro/0x0831bD72Ea8904B38Be9D6185Da2f930d6078094)](https://en.cryptobadges.io/donate/0x0831bD72Ea8904B38Be9D6185Da2f930d6078094)\n\n[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/D1D1WGU9)\n\n\u003cdiv\u003e\u003ca href=\"https://payping.ir/@hatamiarash7\"\u003e\u003cimg src=\"https://cdn.payping.ir/statics/Payping-logo/Trust/blue.svg\" height=\"128\" width=\"128\"\u003e\u003c/a\u003e\u003c/div\u003e\n\n## Contributing 🤝\n\nDon't be shy and reach out to us if you want to contribute 😉\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request\n\n## Issues\n\nEach project may have many problems. Contributing to the better development of this project by reporting them. 👍\n\n[release_badge]: https://github.com/hatamiarash7/Go-Chat/actions/workflows/release.yaml/badge.svg\n[release_link]: https://github.com/hatamiarash7/Go-Chat/actions/workflows/release.yaml\n[link_license]: https://github.com/hatamiarash7/go-chat/blob/master/LICENSE\n[badge_license]: https://img.shields.io/github/license/hatamiarash7/go-chat.svg?longCache=true\n[badge_size_latest]: https://img.shields.io/docker/image-size/hatamiarash7/go-chat-server/latest?maxAge=30\n[link_docker_hub]: https://hub.docker.com/r/hatamiarash7/go-chat-server/\n[badge_release_version]: https://img.shields.io/github/release/hatamiarash7/go-chat.svg?maxAge=30\u0026label=Release\n[link_releases]: https://github.com/hatamiarash7/go-chat/releases\n[badge_language]: https://img.shields.io/github/go-mod/go-version/hatamiarash7/go-chat?longCache=true\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhatamiarash7%2Fgo-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhatamiarash7%2Fgo-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhatamiarash7%2Fgo-chat/lists"}