]> git.netwichtig.de Git - user/henk/code/shell/rif.git/blob - README.md
Update all files to use RI6F instead of RIF
[user/henk/code/shell/rif.git] / README.md
1 Hello!
2
3 Are you a real IPv6 friend?
4
5 ## Introduction
6
7 People like you and me don't want or need Facebook. However, we do
8 want to securely communicate with our friends. And chat with them. And
9 know when they are online. Let's solve this problem once-and-for-all
10 in a decentralised, sustainable and future proof way.
11
12 ## Here comes the real IPv6 friend
13
14 Instead of using a single system or server, we use IPv6 to connect to
15 our friends directly. Because each of our friends is reachable by IPv6
16 if they are online (otherwise they would not be a real IPv6 friend),
17 we can easily verify if they are online. To find out who is online,
18 just connect to their computer!
19
20 ## How it works
21
22 It's a bit geeky, but it works actually rather simple.
23 To become a real IPv6 friend, you need to do the following things:
24
25 - Generate a GPG key with a comment named **RI6F** following the URL of
26   your computer (f.i. **RI6F https://nico.ungleich.cloud**)
27 - Ensure that the URL points to the IPv6 address of your computer
28 - Setup a webserver on your computer
29 - Export your key and all real IPv6 friend keys to your webserver as
30   "rifkeys.txt
31 - For each of your friends, check whether they are online
32 - Import the friends of your friends and check whether they are
33   online, too!
34 - Send friend requests (like other platforms!)
35
36 ### Example: Generating a key with the right comment
37
38 In this example I choose to create an ECC based key that requires the
39 export option in gpg:
40
41 ```
42 [1:24] line:~% gpg --expert --full-gen-key
43 gpg (GnuPG) 2.2.12; Copyright (C) 2018 Free Software Foundation, Inc.
44 This is free software: you are free to change and redistribute it.
45 There is NO WARRANTY, to the extent permitted by law.
46
47 Please select what kind of key you want:
48    (1) RSA and RSA (default)
49    (2) DSA and Elgamal
50    (3) DSA (sign only)
51    (4) RSA (sign only)
52    (7) DSA (set your own capabilities)
53    (8) RSA (set your own capabilities)
54    (9) ECC and ECC
55   (10) ECC (sign only)
56   (11) ECC (set your own capabilities)
57   (13) Existing key
58 Your selection? 9
59 Please select which elliptic curve you want:
60    (1) Curve 25519
61    (3) NIST P-256
62    (4) NIST P-384
63    (5) NIST P-521
64    (6) Brainpool P-256
65    (7) Brainpool P-384
66    (8) Brainpool P-512
67    (9) secp256k1
68 Your selection? 1
69 Please specify how long the key should be valid.
70          0 = key does not expire
71       <n>  = key expires in n days
72       <n>w = key expires in n weeks
73       <n>m = key expires in n months
74       <n>y = key expires in n years
75 Key is valid for? (0) 0
76 Key does not expire at all
77 Is this correct? (y/N) y
78
79 GnuPG needs to construct a user ID to identify your key.
80
81 Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? c
82 Comment: RI6F https://nico.ungleich.cloud
83 You selected this USER-ID:
84     "Nico Schottelius (RI6F https://nico.ungleich.cloud) <ipv6@nico.ungleich.cloud>"
85
86 Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
87 We need to generate a lot of random bytes. It is a good idea to perform
88 some other action (type on the keyboard, move the mouse, utilize the
89 disks) during the prime generation; this gives the random number
90 generator a better chance to gain enough entropy.
91 We need to generate a lot of random bytes. It is a good idea to perform
92 some other action (type on the keyboard, move the mouse, utilize the
93 disks) during the prime generation; this gives the random number
94 generator a better chance to gain enough entropy.
95 gpg: key 27541E11E73F288D marked as ultimately trusted
96 gpg: directory '/home/nico/.gnupg/openpgp-revocs.d' created
97 gpg: revocation certificate stored as '/home/nico/.gnupg/openpgp-revocs.d/B982A8BABC030C66DEF5984527541E11E73F288D.rev'
98 public and secret key created and signed.
99
100 pub   ed25519 2019-09-09 [SC]
101       B982A8BABC030C66DEF5984527541E11E73F288D
102 uid                      Nico Schottelius (RI6F https://nico.ungleich.cloud) <ipv6@nico.ungleich.cloud>
103 sub   cv25519 2019-09-09 [E]
104
105
106 ```
107
108 ### Example: Setting up a webserver
109
110 On a Debian/Devuan based distro:
111
112 ```
113 apt install nginx
114 sudo chown $(whoami) /var/www/html
115 ```
116
117
118 ### Exporting all keys
119
120 To make yourself accessible and expose who your real IPv6 friends are.
121
122 ```
123 gpg -a --export RI6F > /var/www/html/rifkeys
124 ```
125
126 ### Example: List your friends
127
128 You can use the included rif-listfriends.sh or directly gpg:
129
130 ```
131 [1:40] line:~% gpg --list-keys --with-colons | grep RI6F | awk -F: '{ print $10 }' | sed 's/\\x3a/:/'
132 Nico Schottelius (RI6F https://nico.ungleich.cloud) <ipv6@nico.ungleich.cloud>
133 Nico Schottelius (myself) (RI6F https://nico2.ungleich.cloud) <nico@nico.ungleich.cloud>
134 ```
135
136
137 ### Example: Checking which friends are online
138
139 Use the included rif-checkfriends.sh script or iterate yourself over
140 above output.
141
142 ```
143 [1:54] line:realipv6friend% sh rif-checkfriends.sh
144 Checking Nico Schottelius  on https://nico.ungleich.cloud ...
145 Nico Schottelius is online
146 Checking Nico Schottelius (myself)  on https://nico2.ungleich.cloud ...
147 Nico Schottelius (myself) is offline
148 [1:54] line:realipv6friend%
149
150 ```
151
152 ### Example: Importing friends of my friend
153
154 Importing friends of a friend is as simple as importing all the
155 exported keys! We import friends directly from the URL of a friend:
156
157 ```
158 curl -6 -s https://nico.ungleich.cloud/rifkeys | gpg --import
159 ```
160
161 You can also use the included rif-importfriends.sh.
162
163
164 ### Example: Updating your friends
165
166 Now that you have imported the friends of your friends, they have
167 automatically also become your friends!
168
169 Obviously, you will want to check whether you even want to sign some
170 of the friends (keys) that you downloaded, but clearly you want to
171 show off with the biggest amount of friends (that's what is most
172 important anyway, isn't it?).
173
174 In any case, to update your friend list, simply repeat the command you
175 ran above already in the beginning:
176
177 ```
178 gpg -a --export RI6F > /var/www/html/rifkeys
179 ```
180
181 Or use the included `rif-exportfriends.sh`
182
183 ### Example: Importing friends of all friends and exporting them
184
185 From time to time you might want to checkup on which friends gained
186 new friends and add them to your friend list. This is as easy as
187 iterating over all your friends and importing their friends into your
188 friends list. And because you are a good friend, you might want to
189 export all friends again.
190
191 To make things easy, the included a script `rif-friendimportexport.sh`
192 automates this process.
193
194
195 ### Example: Sending a message to a friend
196
197 You can probably just use your mail program for that - and you might
198 even be able to send it IPv6 only!
199
200 ### Example: Invite a friend
201
202 Live is not great without friends! Let's invite a friend! This is as
203 easy is this:
204
205 ```
206 printf 'Hello yournamehere!\n I am looking for real IPv6 friends.\n You find my friends on https://nico.ungleich.cloud/rifkeys.\nHow real IPv6 friends find each other is explained on https://code.ungleich.ch/nico/rif.\n Looking forward to befriend you!' | mail -s "friend request" ipv6@your.friend.example.com
207 ```
208
209 And obviously this is waaaaaaaaay to long to type. That's why
210 `rif-invitefriends.sh` puts this nicely into a script.
211
212 Attention: this requires a working mail setup on your computer
213 (i.e. outgoing emails sending by `mail` works).
214
215 ## Finding friends
216
217 As real IPv6 friends are decentralised, there is no central registry
218 of friends. Just startup the webserver on your machine, export your
219 key(s) and ping your friend.
220
221 With every friend that is added to your network, the reach grows in
222 the chain of all friends of every friend!
223
224 So just start in your small cycle and forward your friend URL to your
225 friends!
226
227
228 ## About
229
230 Real IPv6 friend is a project launched by Nico Schottelius on 2019-09-10.
231 If you want to become my friend, my friend URL is https://nico.ungleich.cloud.