Skip to content

Commit

Permalink
Merge pull request #20 from CppComet/alfa
Browse files Browse the repository at this point in the history
3.23
  • Loading branch information
VictorTrapenok authored Aug 28, 2017
2 parents af5db2d + 909696a commit 14db15e
Show file tree
Hide file tree
Showing 24 changed files with 675 additions and 136 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ FEATURES:
IMPROVEMENTS:
BUG FIXES:

## v3.23

IMPROVEMENTS:

* added parametr `allow` to section `statistics` in .ini file
* added ini file documentation in to file ./docs/comet.ini.md

## v3.22

BUG FIXES:
Expand Down
15 changes: 14 additions & 1 deletion comet.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
; CppComet https://github.com/CppComet/comet-server
;
; docs for this file ./docs/comet.ini.md
; docs for CppComet https://comet-server.com/wiki/doku.php
;

[main]

; Password for accessing comet server api
Expand All @@ -8,7 +14,7 @@ host = localhost
user = root
password = root
name = comet_db
port = 3305
port = 3306

[ws]
ip = 0.0.0.0
Expand All @@ -27,6 +33,13 @@ port = 3300
uptimeTestInterval = 600
maxUptime = 0

[statistics]
allow = true ; https://comet-server.com/wiki/doku.php/en:comet:ini-file#section_statistics


[content-type]
js = application/javascript

[log]
level = 200; Logging level (600 output all, 200 errors only)

Expand Down
30 changes: 22 additions & 8 deletions db.sql
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

--
-- База данных: `comet_db`
-- Database: `comet_db`
--

-- --------------------------------------------------------

--
-- Структура таблицы `log_event`
-- Table structure `log_event`
--

CREATE TABLE IF NOT EXISTS `log_event` (
Expand All @@ -18,7 +18,7 @@ CREATE TABLE IF NOT EXISTS `log_event` (
-- --------------------------------------------------------

--
-- Структура таблицы `log_query`
-- Table structure `log_query`
--

CREATE TABLE IF NOT EXISTS `log_query` (
Expand All @@ -30,7 +30,7 @@ CREATE TABLE IF NOT EXISTS `log_query` (
-- --------------------------------------------------------

--
-- Структура таблицы `pipes_settings`
-- Table structure `pipes_settings`
--

CREATE TABLE IF NOT EXISTS `pipes_settings` (
Expand All @@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS `pipes_settings` (
-- --------------------------------------------------------

--
-- Структура таблицы `pipe_messages`
-- Table structure `pipe_messages`
--

CREATE TABLE IF NOT EXISTS `pipe_messages` (
Expand All @@ -61,7 +61,7 @@ CREATE TABLE IF NOT EXISTS `pipe_messages` (
-- --------------------------------------------------------

--
-- Структура таблицы `users_auth`
-- Table structure `users_auth`
--

CREATE TABLE IF NOT EXISTS `users_auth` (
Expand All @@ -73,7 +73,7 @@ CREATE TABLE IF NOT EXISTS `users_auth` (
-- --------------------------------------------------------

--
-- Структура таблицы `users_messages`
-- Table structure `users_messages`
--

CREATE TABLE IF NOT EXISTS `users_messages` (
Expand All @@ -88,11 +88,25 @@ CREATE TABLE IF NOT EXISTS `users_messages` (
-- --------------------------------------------------------

--
-- Структура таблицы `users_time`
-- Table structure `users_time`
--

CREATE TABLE IF NOT EXISTS `users_time` (
`user_id` int(11) NOT NULL,
`time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


-- --------------------------------------------------------

--
-- Table structure `options`
--

CREATE TABLE IF NOT EXISTS `options` (
`section` varbinary(250) NOT NULL,
`name` varbinary(250) NOT NULL,
`value` varbinary(250) NOT NULL,
PRIMARY KEY (`section`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
139 changes: 139 additions & 0 deletions docs/comet.ini.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Configuring the comet.ini file

* Parameters can be specified in any order.
* Register is important
* The comment begins with the `;`

# Section [main]

Password for access from cometQL
```password = 0000000000000000000000000000000000000000000000000000000000000000```

The maximum size of the buffer in bytes for working with messages
```buf_size = 10384```

Buffer size in bytes for storing fragmented messages
```fragment_buf_size = 600```

The maximum size of the fragmented messages storage buffer
```fragment_buf_max_size = 10384```

To output in a log queries coming through cometQL
```useQueryLoger = false```

The maximum size of the buffer to respond to a request
```answer_buf_size = 1000000```

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
```base_dir = /var/www/html```
# Section [statistics]

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 )
To disable sending statistics, set the value to false
```allow = true```

# Section [db]
Connecting to mysql
```host = localhost
user = root
password = root
name = comet_db
port = 3305```
# Section [ws]
ip address for receiving connections from websockets
```ip = 0.0.0.0```
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
```thread_num = 4```
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
```statistics = 10```
Port for listening to connections on websockets
```port = 8087```
The interval in seconds to check uptime for connections, 0 do not run the check
```uptimeTestInterval = 600```
The maximum uptime connection after which the connection is terminated forcibly
```maxUptime = 0```
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
```host = *```
# Section [cometql]
```ip = 0.0.0.0
thread_num = 3 ; number of threads for receive message from cometql
statistics = 10
port = 3300
uptimeTestInterval = 600
maxUptime = 0 ```
# Section [content-type]
Allows you to set the content-type and file type.
For example:
```js = text/javascript
css = text/css```
# Section [log]
Setting the Logging Level The higher the number the more logs are added.
  * 0 - do not output
  * 100 - Critical Errors
  * 200 errors
  * 300 - Warnings
  * 400 - log
  * 500 - debugging mode
The parameter sets the maximum level of logging common for all subsystems
```level = 200; ```
Logging levels for individual subsystems, in order to be able to watch the log separately for different events, is used for debugging convenience
```Any = 500```
Events from class logger
```TagLoger = 500```
Class storage events
```appConf = 500```
Events from the interaction class via pipe (in the operating system)
```pipeCommands = 500```
Statistics module
```statistics = 500```
Disabling overtime connections
```removeOldConnections = 500```
Working with mysql
```MySqlServer = 500```
Class of work with user data (authorization, the last time online)
```UserIndex = 500```
User class (authorization, last online time)
```UserItem = 500```
Working with websockets
```ClientServer = 500```
Outdated section with php api
```ServerServer = 500```
Working with radishes (obsolete section)
```SimpleRedisClient = 500```
Reception and distribution of network connections
```tcpServer = 500```
Blanks of clustering are not all ready
```CometQLCluster = 500```
Working with authorization from cometql connections
```devManager = 500```
Sending requests to the mysql database
```dbLink = 500```
7 changes: 4 additions & 3 deletions docs/dokuwiki/data/pages/comet/building-from-source.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<rst>RU::004-Администрирование</rst>
<rst>RU::004-Администрирование::004-Установка</rst>

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

Expand Down Expand Up @@ -37,6 +37,8 @@ port = 3305
password = 0000000000000000000000000000000000000000000000000000000000000000
</code>
Остальные настройки из файла [[https://github.com/CppComet/comet-server/blob/master/comet.ini|comet.ini]] можно не менять.

<note>Весь перечень настроек в статье [[comet:ini-file|Настройка файла comet.ini]] </note>

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



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



Expand Down
Loading

0 comments on commit 14db15e

Please sign in to comment.