Skip to content

Commit

Permalink
Merge pull request #49 from CppComet/alfa
Browse files Browse the repository at this point in the history
3.38
  • Loading branch information
VictorTrapenok authored Mar 27, 2018
2 parents fd67f34 + 997abaa commit 9b32e20
Show file tree
Hide file tree
Showing 41 changed files with 1,548 additions and 498 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ FEATURES:
IMPROVEMENTS:
BUG FIXES:

## v3.38
BUG FIXES:
* add make install instruction

## v3.37
BUG FIXES:
* bug fix for dev_id=0
Expand Down
27 changes: 25 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,35 @@ set_property(TARGET libjwta PROPERTY


# Создает исполняемый файл с именем cpp_comet из исходников
add_executable(cpp_comet ${HASHLIB2PLUS_EXE} ${SOURCE_EXE} ${TINYXML2_EXE} ${ESL_EXE} )
add_executable(cppcomet ${HASHLIB2PLUS_EXE} ${SOURCE_EXE} ${TINYXML2_EXE} ${ESL_EXE} )

# Подключение библиотеки pthreads
target_link_libraries (cpp_comet ${CMAKE_THREAD_LIBS_INIT} ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES} crypt uuid libjwta)
target_link_libraries (cppcomet ${CMAKE_THREAD_LIBS_INIT} ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES} crypt uuid libjwta)


#cmake ./ && make

#INSTALL( DIRECTORY <directory> DESTINATION usr/myproject )

#mkdir /etc/comet-server
#cp ./comet-service.sh /etc/comet-server/comet-service.sh
#cp ./comet.ini /etc/comet-server/comet.ini
#cp ./cpp_comet /etc/comet-server/cpp_comet
# https://mirkokiefer.com/cmake-by-example-f95eb47d45b1

set(INSTALL_CONF_DIR
/etc/comet-server)

set(INSTALL_BIN_DIR
/usr/bin)

set(INSTALL_SYSTEMD_DIR
/etc/systemd/system)

install(FILES comet.service DESTINATION ${INSTALL_SYSTEMD_DIR})
install(FILES comet.ini DESTINATION ${INSTALL_CONF_DIR})
install(FILES comet-service.sh DESTINATION ${INSTALL_CONF_DIR})
install(TARGETS cppcomet DESTINATION ${INSTALL_BIN_DIR})

# https://cmake.org/pipermail/cmake/2009-September/031887.html
# INSTALL(SCRIPT CopyIfNotExists.cmake)
6 changes: 3 additions & 3 deletions comet-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
echo "CppComet"

PATH=/sbin:/usr/sbin:/bin:/usr/bin
RUNDIR=/etc/comet-server/
RUNDIR=/usr/bin
EXTRAOPTS=
PIDFILE=/var/run/cppcomet.pid

Expand All @@ -17,7 +17,7 @@ case "$1" in
echo "CppComet already run"
else
echo "Starting CppComet"
./cpp_comet > /var/log/cpp_comet.log 2>/var/log/cpp_comet.log &
/usr/bin/cppcomet --conf /etc/comet-server/comet.ini > /var/log/cpp_comet.log 2>/var/log/cpp_comet.log &
fi
;;
stop)
Expand All @@ -41,7 +41,7 @@ case "$1" in
echo "pid file does not exist"
fi
echo "Starting CppComet"
./cpp_comet > /var/log/cpp_comet.log 2>/var/log/cpp_comet.log &
/usr/bin/cppcomet > /var/log/cpp_comet.log 2>/var/log/cpp_comet.log &
;;
esac

Expand Down
5 changes: 2 additions & 3 deletions comet.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

[main]
isTest = false; включение тестов

dev_index_size = 100000

node_name = n1
useQueryLoger = false
mono_password = false
mono_password = false # EE_VERSION

base_dir = static

Expand Down
59 changes: 31 additions & 28 deletions db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@
-- version 3.4.11.1deb2+deb7u8
-- http://www.phpmyadmin.net
--
-- Хост: test.comet.su:3305
-- Время создания: Янв 24 2018 г., 14:56
-- Версия сервера: 5.5.57
-- Хост: db-n1.comet.su:3306
-- Время создания: Янв 09 2018 г., 02:24
-- Версия сервера: 5.5.58
-- Версия PHP: 5.6.31-1~dotdeb+7.1

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

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

-- --------------------------------------------------------
Expand All @@ -41,6 +35,21 @@ CREATE TABLE IF NOT EXISTS `conference` (

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

--
-- Структура таблицы `dev_config`
--

CREATE TABLE IF NOT EXISTS `dev_config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` char(64) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
`url` char(255) CHARACTER SET ascii NOT NULL DEFAULT '*',
`active_time` int(11) NOT NULL DEFAULT '0' COMMENT 'Время последней активности',
PRIMARY KEY (`id`),
KEY `key` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=500001 ;

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

--
-- Структура таблицы `log_event`
--
Expand All @@ -49,7 +58,7 @@ CREATE TABLE IF NOT EXISTS `log_event` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` varchar(250) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1661 ;
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1637 ;

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

Expand Down Expand Up @@ -102,19 +111,6 @@ CREATE TABLE IF NOT EXISTS `pipe_messages` (

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

--
-- Структура таблицы `revoked_tokens`
--

CREATE TABLE IF NOT EXISTS `revoked_tokens` (
`dev_id` int(11) NOT NULL,
`token` varbinary(600) NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`dev_id`,`token`)
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin;

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

--
-- Структура таблицы `users_auth`
--
Expand All @@ -137,7 +133,7 @@ CREATE TABLE IF NOT EXISTS `users_auth` (
CREATE TABLE IF NOT EXISTS `users_data` (
`dev_id` int(9) NOT NULL,
`user_id` int(11) NOT NULL,
`data` varbinary(600) NOT NULL,
`data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
PRIMARY KEY (`dev_id`,`user_id`),
KEY `dev_id` (`dev_id`),
KEY `user_id` (`user_id`)
Expand Down Expand Up @@ -178,6 +174,13 @@ CREATE TABLE IF NOT EXISTS `users_time` (
KEY `user_id` (`user_id`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
--
-- Структура таблицы `revoked_tokens`
--

CREATE TABLE IF NOT EXISTS `revoked_tokens` (
`dev_id` int(11) NOT NULL,
`token` varbinary(600) NOT NULL,
`time` int(11) NOT NULL,
PRIMARY KEY (`dev_id`,`token`)
) ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin;
Loading

0 comments on commit 9b32e20

Please sign in to comment.