Skip to content

Commit

Permalink
Merge pull request #31 from CppComet/alfa
Browse files Browse the repository at this point in the history
3.29
  • Loading branch information
VictorTrapenok authored Nov 3, 2017
2 parents 73d45de + e074ef0 commit 5d0a65c
Show file tree
Hide file tree
Showing 85 changed files with 225 additions and 535,471 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ FEATURES:
IMPROVEMENTS:
BUG FIXES:

## v3.29

BUG FIXES:

* fix bug in star scripts

IMPROVEMENTS:

* add parametr connection_attempts to section db
* rebild docs in .md files and impruve links in docs


## v3.28

BUG FIXES:
Expand Down
6 changes: 3 additions & 3 deletions docs/API/Authorization on the CppComet.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mysql> INSERT INTO users_auth (id, hash )VALUES (1, 'auth_hash1');

* Here the line with auth_hash1 – an authorization text key. You can generate it by yourself on your server and send it to comet-server via insert query in table users_auth, then you pass on JavaScript to authorization a certain user on the comet-server;
* Numeric_user’s_id – it is user’s ID on your site, any positive number not longer than 9 digits;
* dev_id – it’s a [public developer’s identifier](/docs/EN/Connection%20settings.md).
* dev_id – it’s a [public developer’s identifier](/docs/API/Connection%20settings).

```
Expand All @@ -28,7 +28,7 @@ And now user can be successfully authorized on the comet-server.

# Sending messages for authorized users

While messages from authorized users are sending by its ID ([insert query to table users_messages](/docs/EN/API/CometQL/CometQL%20API.md)), messages is sending to all user’s devices (up to 16), where he is authorizing at this moment. It’s very convenient when some user has visited your site and has authorized here by more than one device.
While messages from authorized users are sending by its ID ([insert query to table users_messages](/docs/API/CometQL/CometQL%20API)), messages is sending to all user’s devices (up to 16), where he is authorizing at this moment. It’s very convenient when some user has visited your site and has authorized here by more than one device.

If some user at that moment is offline, than sent message is placed into a queue of messages and would be delivered when it user will be online.

Expand All @@ -42,7 +42,7 @@ CometServer().subscription("msg.event1", function(e){ console.log(e)})
```


The msg channel refers to [channels list with special properties](/docs/EN/API/Reserved%20channel%20names.md).
The msg channel refers to [channels list with special properties](/docs/API/Reserved%20channel%20names).

# Determining the authorization status

Expand Down
30 changes: 15 additions & 15 deletions docs/API/CometQL/CometQL API.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ mysql -h app.comet-server.ru -u15 -plPXBFPqNg3f661JcegBY0N0dPXqUBdHXqj2cHf04PZgL
```


Else you can use [online command prompt](/docs/EN/Online%20CometQL%20CLI.md). You can find it on the bottom of the right corner on all of the pages.
Else you can use [online command prompt](/docs/Examples/Online%20CometQL%20CLI). You can find it on the bottom of the right corner on all of the pages.


___
[Here you can test source code based on PHP with CometQL](/docs/EN/Online%20CometQL%20CLI.md) using for online command prompt implementation.
[Here you can test source code based on PHP with CometQL](/docs/Examples/Online%20CometQL%20CLI) using for online command prompt implementation.
___


Expand Down Expand Up @@ -99,12 +99,12 @@ ___

Notes of current implementation of CometSQL:
* CometSQL doesn’t implement all methods of SQL. A part of functions planned to realize in future. But some notes were applied in order to optimize inner structure of Comet server.
* To [optimize internal logics](/docs/EN/API/Optimization%20delete%2C%20and%20insert%20in%20CometQL.md), such operations like delete and insert doesn’t return amount of used lines (it belongs to CometQL v.1.0).
* To [optimize internal logics](/docs/API/Optimization%20delete%2C%20and%20insert%20in%20CometQL), such operations like delete and insert doesn’t return amount of used lines (it belongs to CometQL v.1.0).
* Supporting such operators like AND, OR and ORDER BY in queries will be realize soon.


___
Some of hosting providers determine forbiddance (или ban) on external connections – you can face with this on some free or half-free hosting services. In order to check ability to use CometQL, you can take advantage of [hosting verification script](/docs/EN/Checking%20the%20hosting%20for%20possible%20connect%20to%20the%20comet%20server.md).
Some of hosting providers determine forbiddance (или ban) on external connections – you can face with this on some free or half-free hosting services. In order to check ability to use CometQL, you can take advantage of [hosting verification script](/docs/Troubleshooting/Checking%20the%20hosting%20for%20possible%20connect%20to%20the%20comet%20server).
___

# Table pipes_messages
Expand Down Expand Up @@ -200,7 +200,7 @@ Input channel name “web_admins” and click “subscribe”.
</html>
Now perform query again and you will see that amount of subscribers are increase.
# Table users_in_pipes
The table “users_in_pipes” contains data about [authorized users](/docs/EN/API/Authorization%20on%20the%20CppComet.md) which subscribe on channel. This table is available only for reading.
The table “users_in_pipes” contains data about [authorized users](/docs/API/Authorization%20on%20the%20CppComet) which subscribe on channel. This table is available only for reading.

```
Expand All @@ -220,7 +220,7 @@ mysql> select * from users_in_pipes where name = "web_admins";


___
Field user in table pipes contain aggregate amount of subscribers ([authorized and non-authorized](/docs/EN/API/Authorization%20on%20the%20CppComet.md)), besides of table users_in_pipes includes only authorized subscribers list.
Field user in table pipes contain aggregate amount of subscribers ([authorized and non-authorized](/docs/API/Authorization%20on%20the%20CppComet)), besides of table users_in_pipes includes only authorized subscribers list.
___


Expand Down Expand Up @@ -263,7 +263,7 @@ Query OK, 0 rows affected (0.00 sec)


# Table users_messages
The table “users_messages” intended sending messages to [authorized users](/docs/EN/API/Authorization%20on%20the%20CppComet.md) by their identifiers.
The table “users_messages” intended sending messages to [authorized users](/docs/API/Authorization%20on%20the%20CppComet) by their identifiers.

___
Sending messages by identifiers gives more powerful protection tools while data is transferring. Also it increases probability to deliver message to right user.
Expand Down Expand Up @@ -337,7 +337,7 @@ Here user with id=2 at that moment online, user with id=3 – was online at July

# Table users_auth

The table users_auth contains data of user’s [authorizing](/docs/EN/API/Authorization%20on%20the%20CppComet.md) on comet server.
The table users_auth contains data of user’s [authorizing](/docs/API/Authorization%20on%20the%20CppComet) on comet server.

```
Expand All @@ -361,7 +361,7 @@ ___
In field hash you can transmit only lines (strings) less than 32 symbols and it must match with regular term [0-9A-z=+/_].
___

To deleting data of [user’s authorizing](/docs/RU/API/%D0%90%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F%20%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D0%B5%D0%B9%20%D0%BD%D0%B0%20%D0%BA%D0%BE%D0%BC%D0%B5%D1%82%20%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B5.md), you can use “delete” query.
To deleting data of [user’s authorizing](/docs/API/%D0%90%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F%20%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D0%B5%D0%B9%20%D0%BD%D0%B0%20%D0%BA%D0%BE%D0%BC%D0%B5%D1%82%20%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80%D0%B5), you can use “delete” query.

```
Expand All @@ -378,15 +378,15 @@ ___

# Other information

* [Example of sending messages from bash.](/docs/EN/An%20example%20of%20sending%20a%20message%20from%20a%20bash%20script.md)
* [Error code in CometQL](/docs/EN/API/Error%20codes%20in%20CometQL.md)
* [Reserved channel names](/docs/EN/API/Reserved%20channel%20names.md)
* [JavaScript API](/docs/EN/API/JavaScript%20API/JavaScript%20API.md)
* [What it is and why do we need "A public developer token" and "Secret developer key?"](/docs/EN/Connection%20settings.md)
* [Example of sending messages from bash.](/docs/Examples/An%20example%20of%20sending%20a%20message%20from%20a%20bash%20script)
* [Error code in CometQL](/docs/API/Error%20codes%20in%20CometQL)
* [Reserved channel names](/docs/API/Reserved%20channel%20names)
* [JavaScript API](/docs/API/JavaScript%20API/JavaScript%20API)
* [What it is and why do we need "A public developer token" and "Secret developer key?"](/docs/API/Connection%20settings)

# Reserved channels names

Main article [Reserved channels names and channels with extra properties](/docs/EN/API/Reserved%20channel%20names.md).
Main article [Reserved channels names and channels with extra properties](/docs/API/Reserved%20channel%20names).

___
We don’t recommend to use in our project such channels names as «bin_*», «big_*», «push_*», «comet_*» и «sys_*». These names could be used for new functions. And they can have some special properties besides of current channels names.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In the examples are usually referred as dev_id. Used only when connecting to [Sa

Secret Developer key, it is composed of 64 characters and is used for authentication to the comet server. No it does not tell anyone. In the examples, commonly referred to as dev_key.

If you use [comet.ini](https://github.com/CppComet/comet-server]], it is specified in the settings in the [[/docs/EN/Administration/file%20comet.ini.md) file, if you use [SaaS version of CppComet](https://comet-server.com) it is issued when you add a new service in your account.
If you use [comet.ini](https://github.com/CppComet/comet-server]], it is specified in the settings in the [[/docs/Administration/file%20comet.ini) file, if you use [SaaS version of CppComet](https://comet-server.com) it is issued when you add a new service in your account.

# Possible problems after installation

Expand Down
30 changes: 15 additions & 15 deletions docs/API/JavaScript API/JavaScript API.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ The function start accepts connection settings and opens new connection. Here op
cometApi.start({dev_id:15, user_id:1, user_key:"userHash", node:"app.comet-server.ru"})
```

* dev_id it’s a binding parameter – [public developers’ key](/docs/EN/Connection%20settings.md).
* user_id it’s a non-binding parameter – user’s identifier is necessary to [authorization on the comet server](/docs/EN/API/Authorization%20on%20the%20CppComet.md);
* user_key it’s non-binding parameter – it is an authorization hash which necessary to [authorize user on the comet server](/docs/EN/API/Authorization%20on%20the%20CppComet.md).
* dev_id it’s a binding parameter – [public developers’ key](/docs/API/Connection%20settings).
* user_id it’s a non-binding parameter – user’s identifier is necessary to [authorization on the comet server](/docs/API/Authorization%20on%20the%20CppComet);
* user_key it’s non-binding parameter – it is an authorization hash which necessary to [authorize user on the comet server](/docs/API/Authorization%20on%20the%20CppComet).
* node - If you deploy [CppComet](https://github.com/CppComet/comet-server) on your server, you must specify the address of your server

To reconnecting to server use the restart function.
Expand Down Expand Up @@ -67,7 +67,7 @@ cometApi.subscription(function(e){ console.log(e)})
```


An example with online demo [How to accept message from channel in JavaScript](/docs/EN/How%20to%20take%20a%20message%20out%20of%20the%20channel%20in%20JavaScript.md)
An example with online demo [How to accept message from channel in JavaScript](/docs/Examples/How%20to%20take%20a%20message%20out%20of%20the%20channel%20in%20JavaScript)

# Unsubscription of receiving messages from channel

Expand All @@ -87,7 +87,7 @@ cometApi.unsubscription(subscriptionId)

# Reserved channel names

The main article [reserved channel names](/docs/EN/API/Reserved%20channel%20names.md).
The main article [reserved channel names](/docs/API/Reserved%20channel%20names).

___
We don’t recommend to use in our project such channels names as «bin_*», «big_*», «push_*», «comet_*» и «sys_*». These names could be used for new functions. And they can have some special properties besides of current channels names.
Expand All @@ -99,7 +99,7 @@ Also we already have some channels with extra properties:
* user_status_* - used for automatic notification JS API about users’ status;
* web_* - channels which can receive messages from CometQL and JS API.
* track_* - automatic notification JS api about what someone has subscribed or unsubscribed from this channel
# The subscription on receiving private messages ( pipe msg )======
# The subscription on receiving private messages ( pipe msg )
The subscription on messages from server, delivered in order to authorization data (by user’s id):

```
Expand All @@ -115,11 +115,11 @@ cometApi.subscription("msg.event_name", function(e){ console.log(e)})


___
More details about authorization mechanism on comet server you and about private messages look in article “[User’s authorization on comet server](/docs/EN/API/Authorization%20on%20the%20CppComet.md)
More details about authorization mechanism on comet server you and about private messages look in article “[User’s authorization on comet server](/docs/API/Authorization%20on%20the%20CppComet)
___


# Subscription on changing user’s status ( pipes user_status_* )======
# Subscription on changing user’s status ( pipes user_status_* )

It is possible to subscribe from JS on notifications about some user’s activity on comet server.

Expand Down Expand Up @@ -165,7 +165,7 @@ cometApi.Subscription("track_online.unsubscription", function(msg)


This type of channel is designed specifically to facilitate the creation of dynamically updated lists of online users.
Main article [list of online users](/docs/en/comet/faq/realtime-users-list.md)
Main article [list of online users](/docs/comet/faq/realtime-users-list)
# Sending messages to channel from JS (pipes web_*)

The function web_pipe_send lets from JavaScript send messages to channel bypassing your server (directly calls comet server). It allows resending messages between clients without loading your server. Also owing to direct call to comet server, delivery time of message from client to client is minimal.
Expand Down Expand Up @@ -219,7 +219,7 @@ Field server_info.user_id in incoming message fills out by some information besi
The comet server includes possibility to activate storing the last N messages mechanism for some channels.

___
Logging of transferred messages may be activate by CometQL query to table “[pipes_settings](/docs/EN/API/CometQL/CometQL%20API.md)”.
Logging of transferred messages may be activate by CometQL query to table “[pipes_settings](/docs/API/CometQL/CometQL%20API)”.
___


Expand Down Expand Up @@ -247,11 +247,11 @@ cometApi.count_users_in_pipe("web_chat_pipe", function(res)
```


Besides of [CometQL query](/docs/EN/API/CometQL/CometQL%20API.md), this function can show a number of subscribers only for those channels which name begins with “web_” (for example, for “web_chat_pipe” it will work but for “chat_pipe” – will not work). This limitation entered in order to be able to create such a channel which a number of subscribers can’t be accessible for anyone via JS API.
Besides of [CometQL query](/docs/API/CometQL/CometQL%20API), this function can show a number of subscribers only for those channels which name begins with “web_” (for example, for “web_chat_pipe” it will work but for “chat_pipe” – will not work). This limitation entered in order to be able to create such a channel which a number of subscribers can’t be accessible for anyone via JS API.

# Determination of authorization status on comet server

The main article [An authorization on comet server](/docs/EN/API/Authorization%20on%20the%20CppComet.md)
The main article [An authorization on comet server](/docs/API/Authorization%20on%20the%20CppComet)

The comet server has an opportunity to authorize users. An authorizing can be useful for determination of sender, who create message.

Expand Down Expand Up @@ -313,6 +313,6 @@ To prevent this situation you can just only once download the file with CometSer

# Additional Information

* [Reserved channel names](/docs/EN/API/Reserved%20channel%20names.md)
* [CometQL API](/docs/EN/API/CometQL/CometQL%20API.md)
* [What is and why do we need "A public developer token" and "Secret developer key"](/docs/EN/Connection%20settings.md)
* [Reserved channel names](/docs/API/Reserved%20channel%20names)
* [CometQL API](/docs/API/CometQL/CometQL%20API)
* [What is and why do we need "A public developer token" and "Secret developer key"](/docs/API/Connection%20settings)
69 changes: 57 additions & 12 deletions docs/Administration/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ password = 0000000000000000000000000000000000000000000000000000000000000000
```


# Add to Startup


```
cp ./comet.service /etc/systemd/system
systemctl daemon-reload
systemctl enable comet.service
```


After successes run server we can begin create chat. If you get error create issue in [github repository](https://github.com/Levhav/comet-server/issues).

# Launch
Run in console mode

Expand All @@ -68,18 +80,6 @@ systemctl start comet.service
```


# Add to Startup


```
cp ./comet.service /etc/systemd/system
systemctl daemon-reload
systemctl enable comet.service
```


After successes run server we can begin create chat. If you get error create issue in [github repository](https://github.com/Levhav/comet-server/issues).

# Configuring nginx as a reverse proxy

In order to configure the operation of comets on one machine with a web server, or just have the ability to work not only on http but also on https, you need to configure the reverse proxy.
Expand Down Expand Up @@ -198,3 +198,48 @@ $link = mysqli_connect("example.ru", "root", "", "CometQL_v1", 3300);
```


# Unreadable file comet.ini

Some text editors add unprintable simbols to the utf8 file. After that, the file may look the same but the comet server will not parse it correctly. You can try using another editor or delete the old file and create a new one with the same text.

# Error while assembling in CentOS


```
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MYSQL_INCLUDE_DIR (ADVANCED)
```


Can not find the client's mysql header files. You can try installing the mysql-devel package


```
yum install mysql-devel
```


# Error while assembling in CentOS


```
/etc/comet-server/comet-server/src/mystring.cpp:15:51: fatal error: uuid / uuid.h: No such file or directory exists
 #include <uuid/uuid.h>
```


Can not find the file uuid.h. You can try installing the libuuid libuuid-devel package


```
yum install libuuid libuuid-devel
```
2 changes: 1 addition & 1 deletion docs/Administration/file comet.ini.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Section [main]

Password for access from cometQL
Password for access from cometQL, this parameter is synonym for dev_key from saas version.

```
password = 0000000000000000000000000000000000000000000000000000000000000000
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/Examples/PHP chat example.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ subscription Code to the pipe on comet server. This callback will be called when

# Links

* [JavaScript API](/docs/EN/API/JavaScript%20API/JavaScript%20API.md)
* [CometQL API](/docs/EN/API/CometQL/CometQL%20API.md)
* [JavaScript API](/docs/API/JavaScript%20API/JavaScript%20API)
* [CometQL API](/docs/API/CometQL/CometQL%20API)
* [Online demo](https://jsfiddle.net/o35kvmn2/5/)
* [CppComet](https://github.com/CppComet/comet-server)
* [Creating a simple chat using CppComet](https://www.codeproject.com/script/Articles/ArticleVersion.aspx?waid=235463&aid=1181698)

This file was deleted.

Loading

0 comments on commit 5d0a65c

Please sign in to comment.