├── .gitignore
├── .gitmodules
├── README.md
├── UNLICENSE
├── data-default
└── users
│ └── content-default.json
├── dbschema.json
├── index.html
└── js
├── ZeroChat.coffee
├── all.js
├── lib
└── ZeroFrame.coffee
└── utils
├── Text.coffee
└── Time.coffee
/.gitignore:
--------------------------------------------------------------------------------
1 | # Hidden files
2 | .*
3 | !/.gitignore
4 |
5 | # Data dir
6 | data/*
7 |
8 | # ZeroNet content list
9 | content.json
10 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "frontend"]
2 | path = frontend
3 | url = git@github.com:xaxes/zeronet-relay-chat.git
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 0rc - 0net Relay Chat
2 | ===================
3 |
4 |
5 | An IRC-like internet chatroom hosted on [ZeroNet](https://github.com/hellozeronet/zeronet), a distributed network. 0rc is a fully distributed website, and messages are shared through peers using the ZeroNet stack. In addition, making a new chatroom website is a simple as downloading the files and cloning the site.
6 |
7 | ----------
8 |
9 |
10 | Development Heading Forward
11 | ------------
12 | In the issues of this repository are a list of things we plan to get done. Any help on them would be greatly appreciated.
13 |
14 |
15 | Installing / Hosting 0rc
16 | -------------
17 | In order to start hosting 0rc, you must install ZeroNet. Instructions for doing that are available on its repository. However, once hosting the site once and getting enough peers, the site should forever be available through ZeroNet regardless of whether or not your node is running.
18 |
19 | There are two ways to start hosting 0rc. The first is visiting the 0rc dev chatroom (must have ZeroNet running) and cloning it directly through the ZeroHello homepage UI. The second includes downloading the files from GitHub and creating a new site through the ZeroNet command line.
20 |
21 | ### Using ZeroHello
22 | Make sure that ZeroNet is running and your client is able to contact other peers and visit sites.
23 |
24 | Visit the [0rc dev chatroom](http://127.0.0.1:43110/dev.0rc.bit) to cause ZeroNet to download the latest version of 0rc. This will download all of the needed files.
25 |
26 | Once the site is downloaded, head back to the ZeroNet homepage and scroll down on the site list until you find dev.0rc.bit, the site you just visited. Click on the ellipses on the right hand side of the site's entry, then click 'Clone'. This will create a new version of the chatroom entirely for you.
27 |
28 | All of the files for this site will be in `zeronet/data/[site address]/`, and you can edit them to change the site. However, after every edit, you must resign the site and publish it. More information is available on the [ZeroNet documentation](https://zeronet.readthedocs.org/en/latest/using_zeronet/create_new_site/#2-buildmodify-site).
29 |
30 | Editing the `content.json` file and changing the name, domain name, and description is recommended.
31 |
32 | ### Using git and a new, custom site
33 | This way is more complicated, but also allows easy integration with the latest versions of 0rc. In addition, it gives you more complete control over the site from the get go.
34 |
35 | Same as the previous method, make sure that ZeroNet is running and your client is able to contact other peers and visit sites.
36 |
37 | Follow the instructions on the ZeroNet documentation on how to [create a new site](https://zeronet.readthedocs.org/en/latest/using_zeronet/create_new_site/).
38 |
39 | > **Note:**
40 | >
41 | > - Make sure to save your private key, and also keep it safe.
42 | > - With this, anyone can sign a new version of your site and put it in place of yours.
43 | > - Without this, you will not be able to sign your site or make any changes to it.
44 |
45 | Next, download the files from this repository, either by using the [zip link](https://github.com/cgm616/0rc/archive/master.zip), or cloning it with git. Find the site folder, which will be in `zeronet/data/[site address]/`, and copy all of the files just downloaded or cloned into that directory.
46 |
47 | Next, edit the `content.json` file to have a personalized description and name of the site, and add a few lines to make 0rc work properly and not seed things it doesn't have to. Directly beneath:
48 | ```
49 | "files": {
50 | "index.html": {
51 | "sha512": "f8557901b15e...e7d038f86c7b57",
52 | "size": 87836
53 | },
54 | ...
55 | },
56 | ```
57 | add a new section with the following:
58 | ```
59 | "ignore": ".git/|data/.*",
60 | "includes": {
61 | "data/users/content.json": {
62 | "signers": [],
63 | "signers_required": 1
64 | }
65 | },
66 | ```
67 | This will clean up the site and reduce the number of unneeded files seeded.
68 |
69 | Next, we have to establish a `data/` directory for user data. Rename `data-default/` to `data/`. Then, rename `data/content-default.json` to `data/content.json`.
70 |
71 | At this point, you should be all done. All that's left is to [sign and publish](https://zeronet.readthedocs.org/en/latest/using_zeronet/create_new_site/#2-buildmodify-site) your site, and then everyone on ZeroNet who has the address will be able to visit it.
72 |
73 |
74 | License for 0rc
75 | -------------
76 | Due to the unique nature of ZeroNet and how it so tightly couples sharing site source code, and due to how this codebase evolved from the work of both nofish and meow, we chose to use the Unlicense for our work. Any contributions after commit cd03ba9 are under this license.
77 |
78 | The complete license can be found in the file `UNLICENSE` at the root of the repository.
79 |
80 |
81 | Contributors
82 | -------------
83 | All of the contributors in this list with an @zeroid.bit name are referenced by their ZeroNet usernames.
84 |
85 | - nofish@zeroid.bit
86 | - meow@zeroid.bit
87 | - cgm616@zeroid.bit
88 | - hhes@zeroid.bit
89 | - whowaswho@zeroid.bit
90 |
--------------------------------------------------------------------------------
/UNLICENSE:
--------------------------------------------------------------------------------
1 | This is free and unencumbered software released into the public domain.
2 |
3 | Anyone is free to copy, modify, publish, use, compile, sell, or
4 | distribute this software, either in source code form or as a compiled
5 | binary, for any purpose, commercial or non-commercial, and by any
6 | means.
7 |
8 | In jurisdictions that recognize copyright laws, the author or authors
9 | of this software dedicate any and all copyright interest in the
10 | software to the public domain. We make this dedication for the benefit
11 | of the public at large and to the detriment of our heirs and
12 | successors. We intend this dedication to be an overt act of
13 | relinquishment in perpetuity of all present and future rights to this
14 | software under copyright law.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 | OTHER DEALINGS IN THE SOFTWARE.
23 |
24 | For more information, please refer to
25 |
--------------------------------------------------------------------------------
/data-default/users/content-default.json:
--------------------------------------------------------------------------------
1 | {
2 | "files": {},
3 | "ignore": ".*",
4 | "modified": 1437647722.815,
5 | "signs": {
6 | "1AvF5TpcaamRNtqvN1cnDEWzNmUtD47Npg": "G40E/+sEab6xpHg85q0VfNcJfn5LRBWUZoUR0ZAjSqLwpppSjFquUVbBoHQe5u+Wa1USioF5O8SqLkIdyP+O5PM="
7 | },
8 | "user_contents": {
9 | "cert_signers": {
10 | "zeroid.bit": [ "1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz" ]
11 | },
12 | "permission_rules": {
13 | ".*": {
14 | "files_allowed": "data.json",
15 | "max_size": 100000
16 | },
17 | "bitmsg/.*@zeroid.bit": { "max_size": 100000 }
18 | },
19 | "permissions": {
20 | "bad@zeroid.bit": false,
21 | "cgm616@zeroid.bit": { "max_size": 100000 }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/dbschema.json:
--------------------------------------------------------------------------------
1 | {
2 | "db_name": "ZeroChat",
3 | "db_file": "data/zerochat.db",
4 | "version": 2,
5 | "maps": {
6 | "users/.+/data.json": {
7 | "to_table": [ "message" ]
8 | },
9 | "users/.+/content.json": {
10 | "to_keyvalue": [ "cert_user_id" ]
11 | }
12 | },
13 | "tables": {
14 | "message": {
15 | "cols": [
16 | ["room", "TEXT"],
17 | ["type", "TEXT"],
18 | ["body", "TEXT"],
19 | ["date_added", "INTEGER"],
20 | ["json_id", "INTEGER REFERENCES json (json_id)"]
21 | ],
22 | "indexes": ["CREATE UNIQUE INDEX message_key ON message(json_id, date_added)"],
23 | "schema_changed": 1
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
36 | Try typing: /me action for irc styled actions, more coming later
37 | Try typing: @username typeyourmessage to highlight your message for that user
38 | Type: /r typeyourmessage to reply to the last person to mention @you
39 |