Skip to content

Commit 14db15e

Browse files
Merge pull request #20 from CppComet/alfa
3.23
2 parents af5db2d + 909696a commit 14db15e

24 files changed

+675
-136
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ FEATURES:
55
IMPROVEMENTS:
66
BUG FIXES:
77

8+
## v3.23
9+
10+
IMPROVEMENTS:
11+
12+
* added parametr `allow` to section `statistics` in .ini file
13+
* added ini file documentation in to file ./docs/comet.ini.md
14+
815
## v3.22
916

1017
BUG FIXES:

comet.ini

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
; CppComet https://github.com/CppComet/comet-server
2+
;
3+
; docs for this file ./docs/comet.ini.md
4+
; docs for CppComet https://comet-server.com/wiki/doku.php
5+
;
6+
17
[main]
28

39
; Password for accessing comet server api
@@ -8,7 +14,7 @@ host = localhost
814
user = root
915
password = root
1016
name = comet_db
11-
port = 3305
17+
port = 3306
1218

1319
[ws]
1420
ip = 0.0.0.0
@@ -27,6 +33,13 @@ port = 3300
2733
uptimeTestInterval = 600
2834
maxUptime = 0
2935

36+
[statistics]
37+
allow = true ; https://comet-server.com/wiki/doku.php/en:comet:ini-file#section_statistics
38+
39+
40+
[content-type]
41+
js = application/javascript
42+
3043
[log]
3144
level = 200; Logging level (600 output all, 200 errors only)
3245

db.sql

+22-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
--
3-
-- База данных: `comet_db`
3+
-- Database: `comet_db`
44
--
55

66
-- --------------------------------------------------------
77

88
--
9-
-- Структура таблицы `log_event`
9+
-- Table structure `log_event`
1010
--
1111

1212
CREATE TABLE IF NOT EXISTS `log_event` (
@@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `log_event` (
1818
-- --------------------------------------------------------
1919

2020
--
21-
-- Структура таблицы `log_query`
21+
-- Table structure `log_query`
2222
--
2323

2424
CREATE TABLE IF NOT EXISTS `log_query` (
@@ -30,7 +30,7 @@ CREATE TABLE IF NOT EXISTS `log_query` (
3030
-- --------------------------------------------------------
3131

3232
--
33-
-- Структура таблицы `pipes_settings`
33+
-- Table structure `pipes_settings`
3434
--
3535

3636
CREATE TABLE IF NOT EXISTS `pipes_settings` (
@@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS `pipes_settings` (
4343
-- --------------------------------------------------------
4444

4545
--
46-
-- Структура таблицы `pipe_messages`
46+
-- Table structure `pipe_messages`
4747
--
4848

4949
CREATE TABLE IF NOT EXISTS `pipe_messages` (
@@ -61,7 +61,7 @@ CREATE TABLE IF NOT EXISTS `pipe_messages` (
6161
-- --------------------------------------------------------
6262

6363
--
64-
-- Структура таблицы `users_auth`
64+
-- Table structure `users_auth`
6565
--
6666

6767
CREATE TABLE IF NOT EXISTS `users_auth` (
@@ -73,7 +73,7 @@ CREATE TABLE IF NOT EXISTS `users_auth` (
7373
-- --------------------------------------------------------
7474

7575
--
76-
-- Структура таблицы `users_messages`
76+
-- Table structure `users_messages`
7777
--
7878

7979
CREATE TABLE IF NOT EXISTS `users_messages` (
@@ -88,11 +88,25 @@ CREATE TABLE IF NOT EXISTS `users_messages` (
8888
-- --------------------------------------------------------
8989

9090
--
91-
-- Структура таблицы `users_time`
91+
-- Table structure `users_time`
9292
--
9393

9494
CREATE TABLE IF NOT EXISTS `users_time` (
9595
`user_id` int(11) NOT NULL,
9696
`time` int(11) NOT NULL DEFAULT '0',
9797
PRIMARY KEY (`user_id`)
9898
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
99+
100+
101+
-- --------------------------------------------------------
102+
103+
--
104+
-- Table structure `options`
105+
--
106+
107+
CREATE TABLE IF NOT EXISTS `options` (
108+
`section` varbinary(250) NOT NULL,
109+
`name` varbinary(250) NOT NULL,
110+
`value` varbinary(250) NOT NULL,
111+
PRIMARY KEY (`section`,`name`)
112+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

docs/comet.ini.md

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Configuring the comet.ini file
2+
3+
* Parameters can be specified in any order.
4+
* Register is important
5+
* The comment begins with the `;`
6+
7+
# Section [main]
8+
9+
Password for access from cometQL
10+
```password = 0000000000000000000000000000000000000000000000000000000000000000```
11+
12+
The maximum size of the buffer in bytes for working with messages
13+
```buf_size = 10384```
14+
15+
Buffer size in bytes for storing fragmented messages
16+
```fragment_buf_size = 600```
17+
18+
The maximum size of the fragmented messages storage buffer
19+
```fragment_buf_max_size = 10384```
20+
21+
To output in a log queries coming through cometQL
22+
```useQueryLoger = false```
23+
24+
The maximum size of the buffer to respond to a request
25+
```answer_buf_size = 1000000```
26+
27+
The comet server can give out static files. By default, this feature is disabled. But if you set the parameter base_dir, then it starts to give files by name from this directory as a primitive http server. Supports only get requests. In the [content-type] section, you can set the extension to the content-type header
28+
```base_dir = /var/www/html```
29+
# Section [statistics]
30+
31+
In the comet server, there is a mechanism to collect usage statistics and send them to the developer server (For what and what data is sent, see http://statistics.comet-server.ru/api/statistics )
32+
To disable sending statistics, set the value to false
33+
```allow = true```
34+
35+
# Section [db]
36+
Connecting to mysql
37+
```host = localhost
38+
user = root
39+
password = root
40+
name = comet_db
41+
port = 3305```
42+
43+
# Section [ws]
44+
ip address for receiving connections from websockets
45+
```ip = 0.0.0.0```
46+
47+
The number of streams into which connections from Web sites are processed, each thread increases the total memory consumption by approximately 10 - 15 mb so that for a low-loaded configuration one can call 1 stream
48+
```thread_num = 4```
49+
50+
The comet server takes into account the number of online connections and the number of network events, it is the interval in seconds between the measurements that the value 0 does not measure
51+
```statistics = 10```
52+
53+
Port for listening to connections on websockets
54+
```port = 8087```
55+
56+
The interval in seconds to check uptime for connections, 0 do not run the check
57+
```uptimeTestInterval = 600```
58+
59+
The maximum uptime connection after which the connection is terminated forcibly
60+
```maxUptime = 0```
61+
62+
A comma-separated list of hosts from which it is allowed to connect from javascript api (checked based on the http header), there is no limit by default
63+
```host = *```
64+
65+
# Section [cometql]
66+
```ip = 0.0.0.0
67+
thread_num = 3 ; number of threads for receive message from cometql
68+
statistics = 10
69+
port = 3300
70+
uptimeTestInterval = 600
71+
maxUptime = 0 ```
72+
73+
# Section [content-type]
74+
75+
Allows you to set the content-type and file type.
76+
For example:
77+
```js = text/javascript
78+
css = text/css```
79+
80+
# Section [log]
81+
Setting the Logging Level The higher the number the more logs are added.
82+
  * 0 - do not output
83+
  * 100 - Critical Errors
84+
  * 200 errors
85+
  * 300 - Warnings
86+
  * 400 - log
87+
  * 500 - debugging mode
88+
89+
The parameter sets the maximum level of logging common for all subsystems
90+
```level = 200; ```
91+
92+
Logging levels for individual subsystems, in order to be able to watch the log separately for different events, is used for debugging convenience
93+
```Any = 500```
94+
95+
Events from class logger
96+
```TagLoger = 500```
97+
98+
Class storage events
99+
```appConf = 500```
100+
101+
Events from the interaction class via pipe (in the operating system)
102+
```pipeCommands = 500```
103+
104+
Statistics module
105+
```statistics = 500```
106+
107+
Disabling overtime connections
108+
```removeOldConnections = 500```
109+
110+
Working with mysql
111+
```MySqlServer = 500```
112+
113+
Class of work with user data (authorization, the last time online)
114+
```UserIndex = 500```
115+
116+
User class (authorization, last online time)
117+
```UserItem = 500```
118+
119+
Working with websockets
120+
```ClientServer = 500```
121+
122+
Outdated section with php api
123+
```ServerServer = 500```
124+
125+
Working with radishes (obsolete section)
126+
```SimpleRedisClient = 500```
127+
128+
Reception and distribution of network connections
129+
```tcpServer = 500```
130+
131+
Blanks of clustering are not all ready
132+
```CometQLCluster = 500```
133+
134+
Working with authorization from cometql connections
135+
```devManager = 500```
136+
137+
Sending requests to the mysql database
138+
```dbLink = 500```
139+

docs/dokuwiki/data/pages/comet/building-from-source.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<rst>RU::004-Администрирование</rst>
1+
<rst>RU::004-Администрирование::004-Установка</rst>
22

33
====== Установка ======
44

@@ -37,6 +37,8 @@ port = 3305
3737
password = 0000000000000000000000000000000000000000000000000000000000000000
3838
</code>
3939
Остальные настройки из файла [[https://github.com/CppComet/comet-server/blob/master/comet.ini|comet.ini]] можно не менять.
40+
41+
<note>Весь перечень настроек в статье [[comet:ini-file|Настройка файла comet.ini]] </note>
4042

4143
====== Запуск ======
4244
Запуск в консольном режиме
@@ -159,8 +161,7 @@ server {
159161
Это значит что подключатся надо так:
160162
<code PHP>$link = mysqli_connect("example.ru", "root", "", "CometQL_v1", 3300);</code>
161163

162-
163-
164+
Так же обратите внимание на то что надо указывать имя базы данных CometQL_v1, оно символизирует версию апи и вероятно потом выйдет версия CometQL_v2 и можно будет при подключении выбирать версию для работы.
164165

165166

166167

0 commit comments

Comments
 (0)