mirror of https://github.com/midoks/mdserver-web
parent
bc510782d3
commit
533ba65a4d
@ -0,0 +1,52 @@ |
||||
CREATE TABLE `search_hash` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`info_hash` varchar(40) NOT NULL, |
||||
`category` varchar(20) NOT NULL, |
||||
`data_hash` varchar(32) NOT NULL, |
||||
`name` varchar(255) NOT NULL, |
||||
`extension` varchar(20) NOT NULL, |
||||
`classified` tinyint(1) NOT NULL, |
||||
`source_ip` varchar(20) DEFAULT NULL, |
||||
`tagged` tinyint(1) NOT NULL, |
||||
`length` bigint(20) NOT NULL, |
||||
`create_time` datetime NOT NULL, |
||||
`last_seen` datetime NOT NULL, |
||||
`requests` int(10) unsigned NOT NULL, |
||||
`comment` varchar(255) DEFAULT NULL, |
||||
`creator` varchar(20) DEFAULT NULL, |
||||
PRIMARY KEY (`id`), |
||||
UNIQUE KEY `info_hash` (`info_hash`), |
||||
KEY `search_hash_tagged_50480647a28d03e1_uniq` (`tagged`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
||||
|
||||
CREATE TABLE `search_filelist` ( |
||||
`info_hash` varchar(40) NOT NULL, |
||||
`file_list` longtext NOT NULL, |
||||
PRIMARY KEY (`info_hash`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
||||
|
||||
CREATE TABLE `search_extra` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`hash_id` int(11) NOT NULL, |
||||
`update_time` datetime NOT NULL, |
||||
`status` varchar(20) NOT NULL, |
||||
PRIMARY KEY (`id`), |
||||
UNIQUE KEY `hash_id` (`hash_id`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
||||
|
||||
CREATE TABLE `search_statusreport` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`date` date NOT NULL, |
||||
`new_hashes` int(11) NOT NULL, |
||||
`total_requests` int(11) NOT NULL, |
||||
`valid_requests` int(11) NOT NULL, |
||||
PRIMARY KEY (`id`), |
||||
UNIQUE KEY `search_statusreport_date_625dc87b8a52c947_uniq` (`date`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
||||
|
||||
CREATE TABLE `search_reckeywords` ( |
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
||||
`keyword` varchar(20) NOT NULL, |
||||
`order` int(10) unsigned NOT NULL, |
||||
PRIMARY KEY (`id`) |
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
@ -0,0 +1,73 @@ |
||||
#!/bin/sh |
||||
# chkconfig: 2345 55 25 |
||||
# description: Redis Service |
||||
|
||||
### BEGIN INIT INFO |
||||
# Provides: Redis |
||||
# Required-Start: $all |
||||
# Required-Stop: $all |
||||
# Default-Start: 2 3 4 5 |
||||
# Default-Stop: 0 1 6 |
||||
# Short-Description: starts Redis |
||||
# Description: starts the MDW-Web |
||||
### END INIT INFO |
||||
|
||||
# Simple Redis init.d script conceived to work on Linux systems |
||||
# as it does use of the /proc filesystem. |
||||
|
||||
CONF="{$SERVER_PATH}/redis/redis.conf" |
||||
REDISPORT=$(cat $CONF |grep port|grep -v '#'|awk '{print $2}') |
||||
REDISPASS=$(cat $CONF |grep requirepass|grep -v '#'|awk '{print $2}') |
||||
if [ "$REDISPASS" != "" ];then |
||||
REDISPASS=" -a $REDISPASS" |
||||
fi |
||||
EXEC={$SERVER_PATH}/redis/bin/redis-server |
||||
CLIEXEC="{$SERVER_PATH}/redis/bin/redis-cli -p $REDISPORT$REDISPASS" |
||||
PIDFILE={$SERVER_PATH}/redis/redis_6379.pid |
||||
|
||||
mkdir -p {$SERVER_PATH}/redis/data |
||||
|
||||
redis_start(){ |
||||
if [ -f $PIDFILE ] |
||||
then |
||||
echo "$PIDFILE exists, process is already running or crashed" |
||||
else |
||||
echo "Starting Redis server..." |
||||
nohup $EXEC $CONF >> {$SERVER_PATH}/redis/logs.pl 2>&1 & |
||||
fi |
||||
} |
||||
redis_stop(){ |
||||
if [ ! -f $PIDFILE ] |
||||
then |
||||
echo "$PIDFILE does not exist, process is not running" |
||||
else |
||||
PID=$(cat $PIDFILE) |
||||
echo "Stopping ..." |
||||
$CLIEXEC shutdown |
||||
while [ -x /proc/${PID} ] |
||||
do |
||||
echo "Waiting for Redis to shutdown ..." |
||||
sleep 1 |
||||
done |
||||
echo "Redis stopped" |
||||
fi |
||||
} |
||||
|
||||
|
||||
case "$1" in |
||||
start) |
||||
redis_start |
||||
;; |
||||
stop) |
||||
redis_stop |
||||
;; |
||||
restart|reload) |
||||
redis_stop |
||||
sleep 0.3 |
||||
redis_start |
||||
;; |
||||
*) |
||||
echo "Please use start or stop as first argument" |
||||
;; |
||||
esac |
||||
|
@ -0,0 +1,6 @@ |
||||
[db] |
||||
DB_HOST = 127.0.0.1 |
||||
DB_USER = ssbc |
||||
DB_PORT = 33061 |
||||
DB_PASS = ssbc |
||||
DB_NAME = ssbc |
Loading…
Reference in new issue