remnantchat/README.md

299 lines
18 KiB
Markdown
Raw Normal View History

# RemnantChat
![RemnantChat logo](./public/logo/logo.svg)
RemnantChat is a free (as in both price and freedom) communication tool. Designed to be the simplest way to connect with others privately and securely, it is:
2022-09-06 00:18:54 +00:00
2022-09-06 02:45:41 +00:00
- Fully open source (licensed under [GPL v2](./LICENSE))
2022-09-06 00:18:54 +00:00
- Peer-to-peer
- Whenever possible, otherwise a TURN server is used to ensure reliable peer connection
2023-02-17 03:38:47 +00:00
- End-to-end encrypted (via [WebRTC](https://webrtc-security.github.io/))
2022-09-06 00:18:54 +00:00
- Ephemeral
2023-02-17 03:38:47 +00:00
- Message content is never persisted to disk on either the client or server
2022-09-06 00:18:54 +00:00
- Decentralized
- There is no API server. All that's required for RemnantChat to function is availability of GitHub for static assets, and public WebTorrent and STUN/TURN relay servers for establishing peer-to-peer communication.
- Embeddable
2022-09-12 01:52:47 +00:00
- [Self-hostable](#self-hosting)
2022-09-06 00:18:54 +00:00
<<<<<<< HEAD
chore: Migrate from Create React App to Vite (#231) * chore(vite): use vite * fix(vite): alias lib directory * chore(vite): set type: module * chore: update vite and MUI * fix(vite): make MUI components load * fix: use node path resolution * chore(vite): add svg support * fix(vite): polyfill global * fix(vite): use import.meta * fix(vite): use correct svg module resolution * chore(vite): migrate to vitest * fix(vite): remove PUBLIC_URL * fix(tests): mock audio service * chore(deps): upgrade to react test library 14 * refactor(tests): simplify room test setup * refactor(tests): make Date.now() mockable * refactor(vite): remove bootstrap shim * chore(deps): drop react-scripts * chore(deps): remove source-map-explorer Source maps do not currently work with MUI and Vite: https://github.com/vitejs/vite/issues/15012 Because of this, source map utilities are currently removed. * refactor(vite): use TypeScript for Vite config * chore(actions): update actions config for new paths * fix(service-worker): use VITE_HOMEPAGE for service worker resolution * fix(vercel): use quotes for build command * fix(vite): use import.meta.env.MODE * fix(service-worker): use correct definition for publicUrl * feat(vite): use vite-plugin-pwa * fix(pwa): make update prompt work * fix(types): use vite/client types * docs(readme): update building instructions * refactor(vite): simplify theme loading workaround * refactor(vite): use manifest object * docs(readme): update tool references * chore(deps): run `npm audit fix` * fix(vite): make syntax highlighter work consistently See: https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/513 * fix(pwa): remove manifest.json references * refactor(deps): remove jest references * refactor(types): remove react-scripts reference * chore(deps): use TypeScript 5 * refactor(tests): improve persisted storage mocking
2024-03-13 02:44:43 +00:00
Chitchatter uses [Vite](https://vitejs.dev/). The secure networking and streaming magic would not be possible without [Trystero](https://github.com/dmotz/trystero). File transfer functionality is powered by [`secure-file-transfer`](https://github.com/jeremyckahn/secure-file-transfer).
=======
RemnantChat uses the [Create React App](https://github.com/facebook/create-react-app) toolchain. The secure networking and streaming magic would not be possible without [Trystero](https://github.com/dmotz/trystero). File transfer functionality is powered by [`secure-file-transfer`](https://github.com/jeremyckahn/secure-file-transfer).
> > > > > > > 6003270 (Main: Begin derived app rewrite into remnantchat.)
2023-10-28 21:49:56 +00:00
## Status
- [![Known Vulnerabilities](https://snyk.io/test/github/jeremyckahn/RemnantChat/badge.svg?targetFile=package.json)](https://snyk.io/test/github/jeremyckahn/RemnantChat?targetFile=package.json)
2023-10-28 21:49:56 +00:00
2022-09-06 02:45:41 +00:00
## How to use it
Open https://RemnantChat.im/ and join a room to start chatting with anyone else who is in the room. By default, room names are random [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)s that are generated client-side. To privately communicate with someone, it is recommended to join one of these randomly-generated rooms and share the URL (via the "🔗" button at the top of the page) to whomever you wish to communicate with via a secure medium of your choosing (such as [Burner Note](https://burnernote.com/) or [Yopass](https://yopass.se/)). Your user name will be presented to you, and it would be good to share that with who you will be chatting with beforehand so they know they're talking to you.
2022-09-06 02:45:41 +00:00
## Features
2022-09-06 02:45:41 +00:00
- Multiple peers per room (limited only by the number of peer connections your browser supports).
2023-02-17 03:38:47 +00:00
- Public and private rooms.
- Video and audio chatting.
- Screen sharing.
- File sharing:
2023-02-22 03:23:32 +00:00
- Unlimited file size transfers.
- Files are encrypted prior to sending and decrypted by the receiver (the key is the room name).
- Embedding into other web apps via `iframe`.
- Markdown support via [`react-markdown`](https://github.com/remarkjs/react-markdown).
- Includes support for syntax highlighting of code.
2023-02-17 03:38:47 +00:00
- Conversation backfilling from peers when a new participant joins.
- Multiline message support (hold `shift` and press `enter`).
- Dark and light themes.
feat(verification): [closes #209] Verified peers (#216) * refactor(bootstrap): add BootstrapShim * feat(security): [#209] generate public/private keys * refactor(encryption): move encryption utils to a service * feat(encryption): [wip] implement convertCryptoKeyToString * fix(user-settings): serialize crypto keys to strings * feat(user-settings): deserialize user settings from IndexedDB * feat(user-settings): upgrade persisted settings on boot * feat(user-settings): automatically migrate persisted user settings * refactor(encryption): simplify CryptoKey stringification * refactor(encryption): DRY up EncryptionService * feat(verification): send public key to new peers * refactor(encryption): use class instance * refactor(serialization): use class instance * refactor(verification): [wip] create usePeerVerification hook * feat(verification): encrypt verification token * feat(verification): send encrypted token to peer * feat(verification): verify peer * refactor(verification): use enum for verification state * feat(verification): expire verification requests * fix(updatePeer): update with fresh state data * feat(verification): display verification state * refactor(usePeerVerification): store verification timer in Peer * feat(verification): present tooltips explaining verification state * feat(ui): show full page loading indicator * feat(init): present bootup failure reasons * refactor(init): move init to its own file * feat(verification): show errors upon verification failure * refactor(verification): move workaround to usePeerVerification * feat(verification): present peer public keys * refactor(verification): move peer public key rendering to its own component * refactor(verification): only pass publicKey into renderer * feat(verification): show user's own public key * refactor(naming): rename Username to UserInfo * refactor(loading): encapsulate height styling * feat(verification): improve user messaging * refactor(style): improve formatting and variable names * feat(verification): add user info tooltip * docs(verification): explain verification
2023-12-09 23:47:05 +00:00
- Automatic peer verification via client-side [public-key cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography).
## Anti-features
- Messages are never persisted to disk. When you leave a peer room, messages are cleared from memory and cannot be retrieved.
- RemnantChat is an entirely client-side communication app. It uses public WebTorrent servers to establish peer connections and STUN/TURN relay servers when direct peer-to-peer connections cannot be established, but there is no RemnantChat API server.
2023-02-17 03:38:47 +00:00
- No analytics, tracking, or telemetry of any kind.
2023-02-22 03:23:32 +00:00
- This is a community-driven and unfunded project that makes no money. The users come first and there is no corporate influence or financial interest involved.
2022-09-06 02:45:41 +00:00
## Why another chat app?
There is no shortage of user-friendly chat apps available, but they rely on a central service to facilitate communication. It is difficult to trust these central services, as commercial interests and [government pressure](https://www.npr.org/2022/08/12/1117092169/nebraska-cops-used-facebook-messages-to-investigate-an-alleged-illegal-abortion) can compel service operators to work against the best interest of the users. Even when user data is handled in good faith by service operators, the possibility remains that [encrypted data held at rest may be decrypted](https://www.cbsnews.com/news/fbi-may-have-found-way-to-unlock-san-bernardino-shooters-iphone/) against the user's will.
2022-09-06 02:45:41 +00:00
RemnantChat designs around these risks with a [web meshe architecture](https://dev.to/jeremyckahn/taking-the-power-back-with-web-meshes-omg). There is no central service operator that stores or potentially mishandles communication data. Some services are required to establish an initial connection between peers, but otherwise the app uses direct peer-to-peer communication for everything. Any services that are used by RemnantChat have no association with the project and are publicly available for all to use.
2022-11-24 18:22:31 +00:00
## Use cases
RemnantChat offers a private and secure solution for:
2022-09-06 02:45:41 +00:00
2022-11-24 18:22:31 +00:00
- Organizing groups of people, such as unions or political movements
2023-02-17 03:38:47 +00:00
- Conveniently moving text or data from one device to another
2022-11-24 18:22:31 +00:00
- Video chatting with friends and family across operating systems (such as Android and iOS)
2023-10-29 19:52:57 +00:00
- IT troubleshooting via screen sharing
2022-11-24 18:22:31 +00:00
- Livestreaming
2023-02-17 03:38:47 +00:00
- Sharing sensitive information such as passwords
2022-11-24 18:22:31 +00:00
- Much more!
2022-09-06 02:45:41 +00:00
---
## Note from the developer
### 💻️ Project status
I consider RemnantChat feature-complete inasmuch it does all the things I personally need it to do. I don't have specific plans to add significant functionality in the future, but I may do so if it seems fun to me at the time. **I am committed to fixing any significant bugs** that are reported, so please [open an issue](https://github.com/jeremyckahn/RemnantChat/issues/new) if you discover one! Aside from that, RemnantChat is effectively in maintenance mode for the foreseeable future.
If you would like a feature to be implemented and are willing to pay a development cost to ensure it gets done, please file a GitHub issue describing the feature and indicate that you are willing to compensate for the work. If you are not willing to pay, please open a GitHub issue regardless. I may implement it if it seems fun to do so, but other members of the community may also step up to implement it via Pull Requests.
I will always make time support Pull Requests from others. If you're willing to put in the work to improve RemnantChat, I am willing to help shepherd that work along and get it shipped.
If you don't agree with the direction of the project, you are welcome to fork RemnantChat and take it in another one.
### 🏗️ Support and custom development
I'm willing to do paid installations and customizations of RemnantChat for your needs. If you'd like to contract me to make a version of RemnantChat that is custom built for you, please email me at jeremyckahn@gmail.com and let me know what you have in mind to get started.
---
## Veracity
2022-09-06 02:45:41 +00:00
The core of RemnantChat's security model is the fact that it is fully open source. You are free (and encouraged) to fully audit the project source code and infrastructure. Not only is the source code available under the terms of the [GPL](./LICENSE), but [all build logs are publicly accessible](https://github.com/jeremyckahn/RemnantChat/actions/workflows/pages/pages-build-deployment) as well.
2022-09-06 02:45:41 +00:00
If you would like to verify that the app hosted at https://RemnantChat.im/ is the one that is hosted on GitHub, you can use `dig`:
2022-09-06 02:45:41 +00:00
```
$ dig RemnantChat.im
2022-09-06 02:45:41 +00:00
; <<>> DiG 9.18.1-1ubuntu1.1-Ubuntu <<>> RemnantChat.im
2022-09-06 02:45:41 +00:00
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61332
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;RemnantChat.im. IN A
2022-09-06 02:45:41 +00:00
;; ANSWER SECTION:
RemnantChat.im. 231 IN CNAME jeremyckahn.github.io.
2022-09-06 02:45:41 +00:00
jeremyckahn.github.io. 231 IN A 185.199.111.153
jeremyckahn.github.io. 231 IN A 185.199.110.153
jeremyckahn.github.io. 231 IN A 185.199.109.153
jeremyckahn.github.io. 231 IN A 185.199.108.153
```
To examine the static assets that are served to end users, you can audit the [`gh-pages` branch](https://github.com/jeremyckahn/RemnantChat/tree/gh-pages).
2022-09-06 02:45:41 +00:00
## Project roadmap
2022-09-15 02:21:22 +00:00
See the full ticket backlog [here](https://github.com/users/jeremyckahn/projects/1).
2022-09-17 16:12:08 +00:00
## Environments
- Production environment: https://RemnantChat.im/
- Mirror: https://RemnantChat.vercel.app/ (note that peers cannot connect across domains)
- Staging: https://RemnantChat-git-develop-jeremyckahn.vercel.app/
2022-09-17 16:12:08 +00:00
feat(sdk): Implement Chitchatter SDK (#183) * feat(sdk): render iframe in chat-room component * fix(ci): install optional dependencies * feat(sdk): allow subset of attributes * feat(sdk): accept root-domain attribute * feat(sdk): accept custom room name or use sane default * feat(sdk): set allowed features * feat(sdk): add sdk instructions to embed code dialog * fix(sdk): use dynamic rootUrl * fix(sdk): use static defaultRoot * feat(sdk): send config from SDK to chat * fix(sdk): expire poller * fix(sdk): pass parent domain to iframe via query param * refactor(sdk): type message event data * feat(sdk): send user id to chat frame * feat(sdk): handle some attribute updates * chore(package): add build:sdk:watch script * refactor(sdk): move more code to updateIframeAttributes * feat(sdk): support changing rooms * feat(sdk): support more user settings * docs(sdk): add SDK section to README * feat(sdk): render root-url in embed code if necessary * refactor(sdk): use map for chat room attributes * fix(sdk): unbind event listener when chat-room is disconnected * fix(sdk): properly tear down receipt listener * fix(sdk): send config when frame reloads * feat(sdk): listen for config updates * feat(sdk): request config from sdk instead of sending it repeatedly * refactor(sdk): use type guard for config message * fix(sdk): use settings from SDK when there is no preexisting persisted data * fix(sdk): observe all iframe attributes * refactor(sdk): simplify bootup logic * feat(sdk): improve embed code display
2023-10-28 16:42:58 +00:00
## SDK
You can use the official RemnantChat SDK to embed the app as a [Web Component](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) called `<chat-room />`.
feat(sdk): Implement Chitchatter SDK (#183) * feat(sdk): render iframe in chat-room component * fix(ci): install optional dependencies * feat(sdk): allow subset of attributes * feat(sdk): accept root-domain attribute * feat(sdk): accept custom room name or use sane default * feat(sdk): set allowed features * feat(sdk): add sdk instructions to embed code dialog * fix(sdk): use dynamic rootUrl * fix(sdk): use static defaultRoot * feat(sdk): send config from SDK to chat * fix(sdk): expire poller * fix(sdk): pass parent domain to iframe via query param * refactor(sdk): type message event data * feat(sdk): send user id to chat frame * feat(sdk): handle some attribute updates * chore(package): add build:sdk:watch script * refactor(sdk): move more code to updateIframeAttributes * feat(sdk): support changing rooms * feat(sdk): support more user settings * docs(sdk): add SDK section to README * feat(sdk): render root-url in embed code if necessary * refactor(sdk): use map for chat room attributes * fix(sdk): unbind event listener when chat-room is disconnected * fix(sdk): properly tear down receipt listener * fix(sdk): send config when frame reloads * feat(sdk): listen for config updates * feat(sdk): request config from sdk instead of sending it repeatedly * refactor(sdk): use type guard for config message * fix(sdk): use settings from SDK when there is no preexisting persisted data * fix(sdk): observe all iframe attributes * refactor(sdk): simplify bootup logic * feat(sdk): improve embed code display
2023-10-28 16:42:58 +00:00
```html
<script src="https://RemnantChat.im/sdk.js"></script>
feat(sdk): Implement Chitchatter SDK (#183) * feat(sdk): render iframe in chat-room component * fix(ci): install optional dependencies * feat(sdk): allow subset of attributes * feat(sdk): accept root-domain attribute * feat(sdk): accept custom room name or use sane default * feat(sdk): set allowed features * feat(sdk): add sdk instructions to embed code dialog * fix(sdk): use dynamic rootUrl * fix(sdk): use static defaultRoot * feat(sdk): send config from SDK to chat * fix(sdk): expire poller * fix(sdk): pass parent domain to iframe via query param * refactor(sdk): type message event data * feat(sdk): send user id to chat frame * feat(sdk): handle some attribute updates * chore(package): add build:sdk:watch script * refactor(sdk): move more code to updateIframeAttributes * feat(sdk): support changing rooms * feat(sdk): support more user settings * docs(sdk): add SDK section to README * feat(sdk): render root-url in embed code if necessary * refactor(sdk): use map for chat room attributes * fix(sdk): unbind event listener when chat-room is disconnected * fix(sdk): properly tear down receipt listener * fix(sdk): send config when frame reloads * feat(sdk): listen for config updates * feat(sdk): request config from sdk instead of sending it repeatedly * refactor(sdk): use type guard for config message * fix(sdk): use settings from SDK when there is no preexisting persisted data * fix(sdk): observe all iframe attributes * refactor(sdk): simplify bootup logic * feat(sdk): improve embed code display
2023-10-28 16:42:58 +00:00
<chat-room />
```
The `<chat-room />` component supports the following optional attributes:
- `room`: The name of the RemnantChat room the user should join. The default value is the URL of the embedding page.
feat(sdk): Implement Chitchatter SDK (#183) * feat(sdk): render iframe in chat-room component * fix(ci): install optional dependencies * feat(sdk): allow subset of attributes * feat(sdk): accept root-domain attribute * feat(sdk): accept custom room name or use sane default * feat(sdk): set allowed features * feat(sdk): add sdk instructions to embed code dialog * fix(sdk): use dynamic rootUrl * fix(sdk): use static defaultRoot * feat(sdk): send config from SDK to chat * fix(sdk): expire poller * fix(sdk): pass parent domain to iframe via query param * refactor(sdk): type message event data * feat(sdk): send user id to chat frame * feat(sdk): handle some attribute updates * chore(package): add build:sdk:watch script * refactor(sdk): move more code to updateIframeAttributes * feat(sdk): support changing rooms * feat(sdk): support more user settings * docs(sdk): add SDK section to README * feat(sdk): render root-url in embed code if necessary * refactor(sdk): use map for chat room attributes * fix(sdk): unbind event listener when chat-room is disconnected * fix(sdk): properly tear down receipt listener * fix(sdk): send config when frame reloads * feat(sdk): listen for config updates * feat(sdk): request config from sdk instead of sending it repeatedly * refactor(sdk): use type guard for config message * fix(sdk): use settings from SDK when there is no preexisting persisted data * fix(sdk): observe all iframe attributes * refactor(sdk): simplify bootup logic * feat(sdk): improve embed code display
2023-10-28 16:42:58 +00:00
- `user-name`: The friendly name of the user (which they can change).
- `user-id`: The static ID of the user. The default value is a random UUID.
- `root-url`: The URL of the RemnantChat instance to use. The default value is `https://RemnantChat.im/`.
feat(sdk): Implement Chitchatter SDK (#183) * feat(sdk): render iframe in chat-room component * fix(ci): install optional dependencies * feat(sdk): allow subset of attributes * feat(sdk): accept root-domain attribute * feat(sdk): accept custom room name or use sane default * feat(sdk): set allowed features * feat(sdk): add sdk instructions to embed code dialog * fix(sdk): use dynamic rootUrl * fix(sdk): use static defaultRoot * feat(sdk): send config from SDK to chat * fix(sdk): expire poller * fix(sdk): pass parent domain to iframe via query param * refactor(sdk): type message event data * feat(sdk): send user id to chat frame * feat(sdk): handle some attribute updates * chore(package): add build:sdk:watch script * refactor(sdk): move more code to updateIframeAttributes * feat(sdk): support changing rooms * feat(sdk): support more user settings * docs(sdk): add SDK section to README * feat(sdk): render root-url in embed code if necessary * refactor(sdk): use map for chat room attributes * fix(sdk): unbind event listener when chat-room is disconnected * fix(sdk): properly tear down receipt listener * fix(sdk): send config when frame reloads * feat(sdk): listen for config updates * feat(sdk): request config from sdk instead of sending it repeatedly * refactor(sdk): use type guard for config message * fix(sdk): use settings from SDK when there is no preexisting persisted data * fix(sdk): observe all iframe attributes * refactor(sdk): simplify bootup logic * feat(sdk): improve embed code display
2023-10-28 16:42:58 +00:00
- `color-mode`: `light` or `dark`. The default value is `dark`.
- `play-message-sound`: Whether or not to play a sound when a user receives a message while the window is not in focus. The default value is `false`.
As well as the following [standard `<iframe />` attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attributes):
- `height`
- `width`
- `style`
- `referrerpolicy`
- `sandbox`
## Developing Chitchatter
> [!IMPORTANT]
> Presently Chitchatter can only be developed on \*NIX systems such as Linux and macOS. If you are using Windows, you can use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) to set up a Linux environment.
To make changes to Chitchatter, clone the source code from GitHub. Ensure you have [Node and NPM](https://nodejs.org) installed. Then in the project directory, run:
```
npm install
```
This will install all of the dependencies.
### Available Scripts
In the project directory, you can run:
2024-04-22 02:06:19 +00:00
#### `npm dev`
Runs the entire stack (client + WebTorrent tracker) locally.
2024-04-22 02:06:19 +00:00
#### `npm start`
2024-04-22 02:06:19 +00:00
Runs the front end app in the development mode. Uses public WebTorrent trackers. Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
2022-09-06 02:45:41 +00:00
The page will reload when you make changes. You may also see any lint errors in the console.
2024-04-22 02:06:19 +00:00
#### `npm test`
chore: Migrate from Create React App to Vite (#231) * chore(vite): use vite * fix(vite): alias lib directory * chore(vite): set type: module * chore: update vite and MUI * fix(vite): make MUI components load * fix: use node path resolution * chore(vite): add svg support * fix(vite): polyfill global * fix(vite): use import.meta * fix(vite): use correct svg module resolution * chore(vite): migrate to vitest * fix(vite): remove PUBLIC_URL * fix(tests): mock audio service * chore(deps): upgrade to react test library 14 * refactor(tests): simplify room test setup * refactor(tests): make Date.now() mockable * refactor(vite): remove bootstrap shim * chore(deps): drop react-scripts * chore(deps): remove source-map-explorer Source maps do not currently work with MUI and Vite: https://github.com/vitejs/vite/issues/15012 Because of this, source map utilities are currently removed. * refactor(vite): use TypeScript for Vite config * chore(actions): update actions config for new paths * fix(service-worker): use VITE_HOMEPAGE for service worker resolution * fix(vercel): use quotes for build command * fix(vite): use import.meta.env.MODE * fix(service-worker): use correct definition for publicUrl * feat(vite): use vite-plugin-pwa * fix(pwa): make update prompt work * fix(types): use vite/client types * docs(readme): update building instructions * refactor(vite): simplify theme loading workaround * refactor(vite): use manifest object * docs(readme): update tool references * chore(deps): run `npm audit fix` * fix(vite): make syntax highlighter work consistently See: https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/513 * fix(pwa): remove manifest.json references * refactor(deps): remove jest references * refactor(types): remove react-scripts reference * chore(deps): use TypeScript 5 * refactor(tests): improve persisted storage mocking
2024-03-13 02:44:43 +00:00
Launches the test runner in the interactive watch mode.
2024-04-22 02:06:19 +00:00
#### `npm run build`
chore: Migrate from Create React App to Vite (#231) * chore(vite): use vite * fix(vite): alias lib directory * chore(vite): set type: module * chore: update vite and MUI * fix(vite): make MUI components load * fix: use node path resolution * chore(vite): add svg support * fix(vite): polyfill global * fix(vite): use import.meta * fix(vite): use correct svg module resolution * chore(vite): migrate to vitest * fix(vite): remove PUBLIC_URL * fix(tests): mock audio service * chore(deps): upgrade to react test library 14 * refactor(tests): simplify room test setup * refactor(tests): make Date.now() mockable * refactor(vite): remove bootstrap shim * chore(deps): drop react-scripts * chore(deps): remove source-map-explorer Source maps do not currently work with MUI and Vite: https://github.com/vitejs/vite/issues/15012 Because of this, source map utilities are currently removed. * refactor(vite): use TypeScript for Vite config * chore(actions): update actions config for new paths * fix(service-worker): use VITE_HOMEPAGE for service worker resolution * fix(vercel): use quotes for build command * fix(vite): use import.meta.env.MODE * fix(service-worker): use correct definition for publicUrl * feat(vite): use vite-plugin-pwa * fix(pwa): make update prompt work * fix(types): use vite/client types * docs(readme): update building instructions * refactor(vite): simplify theme loading workaround * refactor(vite): use manifest object * docs(readme): update tool references * chore(deps): run `npm audit fix` * fix(vite): make syntax highlighter work consistently See: https://github.com/react-syntax-highlighter/react-syntax-highlighter/issues/513 * fix(pwa): remove manifest.json references * refactor(deps): remove jest references * refactor(types): remove react-scripts reference * chore(deps): use TypeScript 5 * refactor(tests): improve persisted storage mocking
2024-03-13 02:44:43 +00:00
Builds the app for production to the `dist` folder. It correctly bundles React in production mode and optimizes the build for the best performance.
2022-09-06 00:18:54 +00:00
The build is minified and the filenames include the hashes.
2022-09-12 01:52:47 +00:00
### Self-hosting
<<<<<<< HEAD
Chitchatter is designed to be forked and self-hosted. If you would like to change pairing or relay server configuration or you prefer to control your own builds and versions, [fork this repo](https://github.com/jeremyckahn/chitchatter/fork) and follow the steps below.
2022-09-12 01:52:47 +00:00
> [!IMPORTANT]
> Chitchatter peer connections are bound to the instance's domain. So, a user of Chitchatter at https://chitchatter.im/ would not be able to connect to a user of a Chitchatter instance on another domain (such as a personal GitHub Pages-hosted fork).
> =======
> RemnantChat is designed to be forked and self-hosted. If you would like to change pairing or relay server configuration, or you simply prefer to control your own builds and versions, just [fork this repo](https://github.com/jeremyckahn/RemnantChat/fork) and follow the steps below.
#### Caveats
RemnantChat peer connections are bound to the instance's domain. So, a user of RemnantChat at https://RemnantChat.im/ would not be able to connect to a user of a RemnantChat instance on another domain (such as a personal GitHub Pages-hosted fork).
> > > > > > > 6003270 (Main: Begin derived app rewrite into remnantchat.)
#### Necessary steps after forking
2022-09-12 01:52:47 +00:00
Assuming you are hosting RemnantChat on [GitHub Pages](https://pages.github.com/):
<<<<<<< HEAD
2022-09-12 01:52:47 +00:00
1. Change the [`homepage` property in `package.json`](https://github.com/jeremyckahn/chitchatter/blob/1ea67e2c3a45115e054ebfe3457f2c3572c6213b/package.json#L4) to whatever URL your Chitchatter instance will be hosted from. This will be something like `https://github_user_or_org_name.github.io/chitchatter/`.
2. Define a [`DEPLOY_KEY` GitHub Action secret](https://github.com/jeremyckahn/chitchatter/blob/e2bac732cf1288f7b5d0bec151098f18e8b1d0d6/.github/workflows/deploy.yml#L28-L31) (at `https://github.com/github_user_or_org_name/chitchatter/settings/secrets/actions`). See the docs for [`peaceiris/actions-gh-pages`](https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-ssh-private-key-deploy_key) for more information.
3. If you're using GitHub Pages [without a custom domain](https://github.com/sitek94/vite-deploy-demo?tab=readme-ov-file#fix-assets-links), you'll need to define the repo name as the `base` property [in `vite.config.ts`](https://github.com/jeremyckahn/chitchatter/blob/df6d10868e12ad13036a44f959796f4da35adc28/vite.config.ts#L35-L38). Here's an example of how that might look:
```js
const config = () => {
return defineConfig({
base: '/chitchatter/',
build: {
...
}
```
2022-09-12 01:52:47 +00:00
=======
1. Change the [`homepage` property in `package.json`](https://github.com/jeremyckahn/RemnantChat/blob/1ea67e2c3a45115e054ebfe3457f2c3572c6213b/package.json#L4) to whatever URL your RemnantChat instance will be hosted from. This will be something like `https://github_user_or_org_name.github.io/RemnantChat/`.
2. Define a [`DEPLOY_KEY` GitHub Action secret](https://github.com/jeremyckahn/RemnantChat/blob/e2bac732cf1288f7b5d0bec151098f18e8b1d0d6/.github/workflows/deploy.yml#L28-L31) (at `https://github.com/github_user_or_org_name/RemnantChat/settings/secrets/actions`). See the docs for [`peaceiris/actions-gh-pages`](https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-set-ssh-private-key-deploy_key) for more information.
> > > > > > > 6003270 (Main: Begin derived app rewrite into remnantchat.)
2022-09-12 01:52:47 +00:00
#### Deployment
2022-09-20 02:32:43 +00:00
##### On GitHub
2023-02-17 03:38:47 +00:00
When hosted on GitHub Pages and the configuration above has been done, the Production environment is updated when the remote `main` branch is updated (once GitHub Actions are enabled).
2022-09-20 02:32:43 +00:00
##### On non-GitHub hosts
Build the app with `npm run build`, and then serve the `dist` directory. Any static file serving solution should work provided it is using a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).
2022-09-20 02:32:43 +00:00
#### Runtime configuration
Explore the files in `src/config` to modify pairing and relay server configuration.
#### Theme customization
Chitchatter utilizes the [MUI component library](https://mui.com/) which is [themeable](https://mui.com/material-ui/customization/theming/). You can customize Chitchatter's look and feel by modifying [the shell theme definition](https://github.com/jeremyckahn/chitchatter/blob/dc78137702bb9d6bf1be289e469e080cd7d5dc8b/src/components/Shell/useShellTheme.ts#L11-L18).
### Troubleshooting
If you run into any issues with a custom RemnantChat installation, first ensure that you are using [the latest version of the code](https://github.com/jeremyckahn/RemnantChat/tree/main). If you are hosting your installation with GitHub Pages, sync your `main` branch and _not_ your `gh-pages` branch. Updating your `main` branch will trigger a proper rebuild of your `gh-pages` branch.
- https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork
2022-10-10 01:39:29 +00:00
#### Peers won't connect
This could happen for a variety of reasons. The most likely of which is that one or more peers cannot connect directly and must use the configured STUN/TURN relay as a fallback. The standard relay is free and does not guarantee any level of service, so it may simply be unavailable for some time (or just not work at all for some users). There's not much to do other than wait until it becomes available again, or possibly try from another device or location.
##### Issues specific to browsers with ad blocking extensions
Some ad blockers (such as uBlock Origin) prevent connections to certain WebTorrent servers. This prevents RemnantChat peers from connecting. To work around this, you can either disable your ad blocker or [self-host your own RemnantChat instance](#self-hosting).
##### Issues specific to iOS Safari
2023-03-29 13:53:33 +00:00
RemnantChat works on iOS Safari, but browser-level bugs often prevent peers from rejoining the room when the browser is closed and later reopened (for instance, when switching applications). The suggested workaround for this issue is to refresh the page to rejoin the room.
2023-03-29 13:53:33 +00:00
##### Issues specific to Firefox
Per [#36](https://github.com/jeremyckahn/RemnantChat/issues/36), check your `about:config` settings and ensure that `media.peerconnection.enabled` is **enabled**.
2022-10-11 14:26:02 +00:00
#### Offered files can't be downloaded from peers
Chitchatter uses [StreamSaver.js](https://github.com/jimmywarting/StreamSaver.js) to facilitate large file transfers. Download managers such as [FDM](https://www.freedownloadmanager.org/) are [known to interfere with StreamSaver.js](https://github.com/jimmywarting/StreamSaver.js/issues/325), so it is recommended to disable such download managers when trying to receive files.
### Security
RemnantChat undergoes [weekly security audits](https://github.com/jeremyckahn/RemnantChat/blob/develop/.github/workflows/security.yml) to identify and address potential vulnerabilities. Reports from all audits can be found in [**Issues**](https://github.com/jeremyckahn/RemnantChat/issues?q=%22Security+Report+-+%22).
### Contributors
<p align="center">
<a href="https://github.com/jeremyckahn/RemnantChat/graphs/contributors">
<img src="https://contrib.rocks/image?repo=jeremyckahn/RemnantChat" />
</a>
</p>
## ⚠️ [Disclaimer](https://RemnantChat.im/disclaimer)
By using RemnantChat, you agree to accept **full responsibility** for your actions related to its use. Additionally, you agree **not** to hold any contributors to the RemnantChat project responsible for any result of your use of it. The developers of RemnantChat do not endorse illegal activity.