Browse code

nextgen

devnewton authored on 09/06/2017 05:49:42
Showing 5 changed files
1 1
deleted file mode 100644
... ...
@@ -1,3 +0,0 @@
1
-# New tribune
2
-
3
-TODO _Let's make tribune great again_
4 0
\ No newline at end of file
5 1
deleted file mode 100644
... ...
@@ -1,70 +0,0 @@
1
-# YAB
2
-
3
-[YAB](https://gitlab.com/Marotte/Yab) stands for "Yet Another Board".
4
-
5
-Like every board engine it’s intended to incubate excellence by sharing relevant content between everyone.
6
-
7
-The project tries to stick with the [KISS principle](https://en.wikipedia.org/wiki/KISS_principle) while being innovative. It also emancipates itself from some _de facto_ standards wildly used in the "mussel community" nowadays. One drawback of this approach is the difficulty for current clients to interoperate with Yab. On advantage is to permit to get rid of some debatable technical legacy and to come closer of today’s internet user habits. 
8
-
9
-Unlike traditional [tribunes](../ontology/tribune.md), which use the POST/GET mechanism, YAB uses websocket messages for communication between clients ([coincoins](../ontology/coincoin.md)) and server ([piling (aka bouchot)](../ontology/bouchot.md)).
10
-
11
-The server is written in Python3 and makes use of the [uWSGI project](https://uwsgi-docs.readthedocs.io/en/latest/).
12
-
13
-Nginx acts as a front-end to serve static content and to pass websocket requests to the [WSGI](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface) script.
14
-
15
-Yab uses SQLite3 to store posts. It only stores the most recent posts (200 by default) just to be able to serve them again if server restarts, nothing is archived. 
16
-
17
-The client (aka [coincoin](../ontology/coincoin.md)) is written in pure Javascript/CSS3, it relies on no external library (and preferably never will). It’s tested on the latest Firefox and Chromium and known to be incomaptible with Internet Explorer. Touchpad support is not implemented but it may be done in the future.
18
-
19
-## Authentication 
20
-
21
-Any visitor can post to the tribune but one can identify, to "sign" its posts, if he wants to do so.
22
-
23
-Yab uses a very simple cookie authentication : every visitor is given a unique visitor id (VID), he can associate a username of its choice. This username will then be used as "login" field instead of the default username associated with the visitor id (which is simply a hash of it). When a username has been set for a particular visitor id, only this visitor will be able to change it.
24
-
25
-The visitor id isn’t stored on the server (only a hash), so losing the cookie means losing the related identity. In other terms, there is no way to recover it, using a password or some other method. It may be an future feature but it’s not a priority. In case a user wants to use the same identity from different terminals he has to manually copy the cookie by himself.
26
-
27
-By default, visitor ids assigned to clients by the server are 2048 random alphanumeric strings, but there is no policy on what a client can send as its visitor id. As we’ll see in the next part, the only limitation that applies on messages is the total size of the post data (info+id+message).
28
-
29
-## Messages
30
-
31
-The server uses non blocking read on the socket. Every 300ms it sends new posts (if any) to the client. All messages have the same format : the first character is a capital letter which indicate the message type, the second character is ':' and the remaining of the message is a variable number of fields separated by null characters. In the descriptions below, messages from server to client are marked with ↓ and messages from client to server marked with ↑. NUL is noted '^@'
32
-
33
-Let’s detail:
34
-
35
-So… chronologically, on client first connection, if we consider the client has no VID cookie yet (it’s a new visitor), the server will start the chat by sending a "Cookie" message that looks like this (the value has been truncated in the following examples):
36
-
37
-↓    `C:4abfd94ec5835b98e4c5b210305f89c569b7a18…30c27aea2ddf624f2af89b72112bc6d2913fd^@Sat Apr 15 19:14:17 2119`
38
-
39
-no surprise here… it will make the client write a cookie, named 'VID', the value is a 2048 long random string and it expires in roughly hundred years.
40
-
41
-Now our client has a cookie. When a client has a cookie it sends a "Who" message to the server when it connects:
42
-
43
-↑    `W:4abfd94ec5835b98e4c5b210305f89c569b7a18…30c27aea2ddf624f2af89b72112bc6d2913fd`
44
-
45
-yes, it just sends the cookie value.
46
-
47
-If it’s the first client connection its 'last id' value is 0, so the server will send all posts it has and update 'last id' to the id of the last post sent. "Post" messages look like this:
48
-
49
-↓    `P:14^@20170608194433^@Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36^@d6bed91c9c95477d007b1c95df01f629023b6b4248241e09200b7e8e558ff27b^@plop`
50
-
51
-here coincoin’s developpers will recognize a standard post. We have the following fields:
52
-
53
- 1. ID is 14 (this is an integer primary key)
54
- 2. Time of the post is 20170608194433 (this is the historical "norloge" _(not a typo)_ format, a very convenient time representation, which combines facility to parse with facility for a human to read it)
55
- 3. Commonly referred as "info", it’s by tradition filled with the [UA string](https://en.wikipedia.org/wiki/User_agent) of the client
56
- 4. The "login" field. Here we can see this post was sent by an anonymous visitor because it’s a hash (registred usernames may not be longer than 32 characters…). If the post would have been posted by an authenticated user we would find its username in this field.
57
- 5. The actual message
58
- 
59
- When a client sends a post it sends this kind of message, the "New" message:
60
- 
61
- ↑    `N:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36^@4abfd94ec5835b98e4c5b210305f89c569b7a18…30c27aea2ddf624f2af89b72112bc6d2913fd^@Coucou`
62
-
63
-Of course the server would immediatly send back a "Post" message again with this post it just received, as it’s new (the post id is higher than last id).
64
-
65
-There are other kind of messages but those are the core ones.
66
-
67
-# Références
68
-
69
-    Horloge '(@[0-9]{1,16})'
70
-    User    '(@[A-zÀ-ÿ][A-zÀ-ÿ0-9_-]{1,32})'
71 0
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+# Nextgen
2
+
3
+Nextgen is a loosely associated international network of [moulactivists](../ontology/moules.md)
4
+with a decentralized command structure that operates on ideas rather than directives.
5
+
6
+Nextgen main goals are to reinvent the wheel, break standards and outperform
7
+old [tribunes](../ontology/tribune.md) with disruptive innovations.
8
+
9
+
10
+## Motto
11
+
12
+_Let's make tribune great again!_
0 13
\ No newline at end of file
1 14
new file mode 100644
... ...
@@ -0,0 +1,70 @@
1
+# YAB
2
+
3
+[YAB](https://gitlab.com/Marotte/Yab) stands for "Yet Another Board".
4
+
5
+Like every board engine it’s intended to incubate excellence by sharing relevant content between everyone.
6
+
7
+The project tries to stick with the [KISS principle](https://en.wikipedia.org/wiki/KISS_principle) while being innovative. It also emancipates itself from some _de facto_ standards wildly used in the "mussel community" nowadays. One drawback of this approach is the difficulty for current clients to interoperate with Yab. On advantage is to permit to get rid of some debatable technical legacy and to come closer of today’s internet user habits. 
8
+
9
+Unlike traditional [tribunes](../ontology/tribune.md), which use the POST/GET mechanism, YAB uses websocket messages for communication between clients ([coincoins](../ontology/coincoin.md)) and server ([piling (aka bouchot)](../ontology/bouchot.md)).
10
+
11
+The server is written in Python3 and makes use of the [uWSGI project](https://uwsgi-docs.readthedocs.io/en/latest/).
12
+
13
+Nginx acts as a front-end to serve static content and to pass websocket requests to the [WSGI](https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface) script.
14
+
15
+Yab uses SQLite3 to store posts. It only stores the most recent posts (200 by default) just to be able to serve them again if server restarts, nothing is archived. 
16
+
17
+The client (aka [coincoin](../ontology/coincoin.md)) is written in pure Javascript/CSS3, it relies on no external library (and preferably never will). It’s tested on the latest Firefox and Chromium and known to be incomaptible with Internet Explorer. Touchpad support is not implemented but it may be done in the future.
18
+
19
+## Authentication 
20
+
21
+Any visitor can post to the tribune but one can identify, to "sign" its posts, if he wants to do so.
22
+
23
+Yab uses a very simple cookie authentication : every visitor is given a unique visitor id (VID), he can associate a username of its choice. This username will then be used as "login" field instead of the default username associated with the visitor id (which is simply a hash of it). When a username has been set for a particular visitor id, only this visitor will be able to change it.
24
+
25
+The visitor id isn’t stored on the server (only a hash), so losing the cookie means losing the related identity. In other terms, there is no way to recover it, using a password or some other method. It may be an future feature but it’s not a priority. In case a user wants to use the same identity from different terminals he has to manually copy the cookie by himself.
26
+
27
+By default, visitor ids assigned to clients by the server are 2048 random alphanumeric strings, but there is no policy on what a client can send as its visitor id. As we’ll see in the next part, the only limitation that applies on messages is the total size of the post data (info+id+message).
28
+
29
+## Messages
30
+
31
+The server uses non blocking read on the socket. Every 300ms it sends new posts (if any) to the client. All messages have the same format : the first character is a capital letter which indicate the message type, the second character is ':' and the remaining of the message is a variable number of fields separated by null characters. In the descriptions below, messages from server to client are marked with ↓ and messages from client to server marked with ↑. NUL is noted '^@'
32
+
33
+Let’s detail:
34
+
35
+So… chronologically, on client first connection, if we consider the client has no VID cookie yet (it’s a new visitor), the server will start the chat by sending a "Cookie" message that looks like this (the value has been truncated in the following examples):
36
+
37
+↓    `C:4abfd94ec5835b98e4c5b210305f89c569b7a18…30c27aea2ddf624f2af89b72112bc6d2913fd^@Sat Apr 15 19:14:17 2119`
38
+
39
+no surprise here… it will make the client write a cookie, named 'VID', the value is a 2048 long random string and it expires in roughly hundred years.
40
+
41
+Now our client has a cookie. When a client has a cookie it sends a "Who" message to the server when it connects:
42
+
43
+↑    `W:4abfd94ec5835b98e4c5b210305f89c569b7a18…30c27aea2ddf624f2af89b72112bc6d2913fd`
44
+
45
+yes, it just sends the cookie value.
46
+
47
+If it’s the first client connection its 'last id' value is 0, so the server will send all posts it has and update 'last id' to the id of the last post sent. "Post" messages look like this:
48
+
49
+↓    `P:14^@20170608194433^@Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36^@d6bed91c9c95477d007b1c95df01f629023b6b4248241e09200b7e8e558ff27b^@plop`
50
+
51
+here coincoin’s developpers will recognize a standard post. We have the following fields:
52
+
53
+ 1. ID is 14 (this is an integer primary key)
54
+ 2. Time of the post is 20170608194433 (this is the historical "norloge" _(not a typo)_ format, a very convenient time representation, which combines facility to parse with facility for a human to read it)
55
+ 3. Commonly referred as "info", it’s by tradition filled with the [UA string](https://en.wikipedia.org/wiki/User_agent) of the client
56
+ 4. The "login" field. Here we can see this post was sent by an anonymous visitor because it’s a hash (registred usernames may not be longer than 32 characters…). If the post would have been posted by an authenticated user we would find its username in this field.
57
+ 5. The actual message
58
+ 
59
+ When a client sends a post it sends this kind of message, the "New" message:
60
+ 
61
+ ↑    `N:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36^@4abfd94ec5835b98e4c5b210305f89c569b7a18…30c27aea2ddf624f2af89b72112bc6d2913fd^@Coucou`
62
+
63
+Of course the server would immediatly send back a "Post" message again with this post it just received, as it’s new (the post id is higher than last id).
64
+
65
+There are other kind of messages but those are the core ones.
66
+
67
+# Références
68
+
69
+    Horloge '(@[0-9]{1,16})'
70
+    User    '(@[A-zÀ-ÿ][A-zÀ-ÿ0-9_-]{1,32})'
... ...
@@ -5,7 +5,7 @@ A tribune is web chat system used by [moules](./moules.md).
5 5
 Two tribune generations exist:
6 6
 
7 7
 - [legacy](../legacy/legacy_tribune.md)
8
-- [new](../new/new_tribune.md)
8
+- [nextgen](../nextgen/index.md)
9 9
 
10 10
 # Miscellaneous
11 11