From 934fe8f63a1fdc45b574743e2800a5ecfdf5f863 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 20 Sep 2016 12:32:13 +0200 Subject: [PATCH] inital commit for nntmux installer --- nntmux/Install.php | 156 +- .../{10-forum_posts.tsv => 10-forumpost.tsv} | 0 resources/db/schema/data/10-page_contents.tsv | 2 +- resources/db/schema/data/10-settings.tsv | 11 +- .../db/schema/innnodb_5.6_stopword_tbl.sql | 4 +- resources/db/schema/mysql-ddl.sql | 2306 +++++++++-------- www/install/.gitignore | 1 + www/install/config.php.tpl | 40 + www/install/index.php | 101 + www/install/install.php | 42 + www/install/step1.php | 201 ++ www/install/step2.php | 222 ++ www/install/step3.php | 80 + www/install/step4.php | 68 + www/install/step5.php | 36 + www/install/step6.php | 68 + www/install/step7.php | 113 + www/install/templates/install.css | 46 + www/install/templates/installpage.tpl | 21 + www/install/templates/step1.tpl | 254 ++ www/install/templates/step2.tpl | 78 + www/install/templates/step3.tpl | 82 + www/install/templates/step4.tpl | 98 + www/install/templates/step5.tpl | 17 + www/install/templates/step6.tpl | 54 + www/install/templates/step7.tpl | 58 + 26 files changed, 2933 insertions(+), 1226 deletions(-) rename resources/db/schema/data/{10-forum_posts.tsv => 10-forumpost.tsv} (100%) mode change 100644 => 100755 resources/db/schema/innnodb_5.6_stopword_tbl.sql mode change 100644 => 100755 resources/db/schema/mysql-ddl.sql create mode 100755 www/install/.gitignore create mode 100755 www/install/config.php.tpl create mode 100755 www/install/index.php create mode 100644 www/install/install.php create mode 100755 www/install/step1.php create mode 100755 www/install/step2.php create mode 100755 www/install/step3.php create mode 100755 www/install/step4.php create mode 100755 www/install/step5.php create mode 100755 www/install/step6.php create mode 100755 www/install/step7.php create mode 100755 www/install/templates/install.css create mode 100755 www/install/templates/installpage.tpl create mode 100755 www/install/templates/step1.tpl create mode 100755 www/install/templates/step2.tpl create mode 100755 www/install/templates/step3.tpl create mode 100755 www/install/templates/step4.tpl create mode 100755 www/install/templates/step5.tpl create mode 100755 www/install/templates/step6.tpl create mode 100755 www/install/templates/step7.tpl diff --git a/nntmux/Install.php b/nntmux/Install.php index 0a9f3eea9..087b92ebe 100644 --- a/nntmux/Install.php +++ b/nntmux/Install.php @@ -1,102 +1,118 @@ WWW_DIR = dirname(realpath('.')); - $this->SMARTY_DIR = $this->WWW_DIR.'/lib/smarty'; - $this->DB_DIR = dirname(realpath('..')).'/db'; - $this->MISC_DIR = dirname(realpath('..')).'/misc'; - $this->NZB_PATH = str_replace('\\', '/', dirname(realpath('..'))).'/nzbfiles/'; - $this->INSTALL_DIR = $this->WWW_DIR.'/install'; + $this->CONFIG_PATH = NN_CONFIGS; + $this->COVERS_PATH = NN_RES . 'covers' . DS; + $this->DB_DIR = NN_RES . 'db' . DS . 'schema' . DS; + $this->SMARTY_COMPILED_TEMPLATES = NN_RES . 'smarty' . DS . 'templates_c' . DS; + $this->INSTALL_DIR = NN_WWW . 'install'; + $this->NZB_PATH = NN_RES . 'nzb' . DS; + $this->TMP_PATH = NN_RES . 'tmp' . DS; + $this->UNRAR_PATH = $this->TMP_PATH . 'unrar' . DS; + $this->WWW_TOP = NN_WWW; } - /** - * Save this structure in session. - */ public function setSession() { $_SESSION['cfg'] = serialize($this); } - /** - * Return this structure from session. - */ public function getSession() { $tmpCfg = unserialize($_SESSION['cfg']); @@ -105,69 +121,65 @@ class Install return $tmpCfg; } - /** - * Determine if this structure has been populated. - */ public function isInitialized() { return (isset($_SESSION['cfg']) && is_object(unserialize($_SESSION['cfg']))); } - /** - * Determine if this installation has already been installed, and .lock file is present. - */ public function isLocked() { - return (file_exists($this->INSTALL_DIR.'/install.lock') ? true : false); + return (file_exists($this->INSTALL_DIR . '/install.lock') ? true : false); } - /** - * Populate default config values from provided string. - * - * @param $tmpCfg - */ public function setConfig($tmpCfg) { preg_match_all('/define\((.*?)\)/i', $tmpCfg, $matches); $defines = $matches[1]; - foreach ($defines as $define) - { + foreach ($defines as $define) { $define = str_replace('\'', '', $define); - list($defName,$defVal) = explode(',', $define); + list($defName, $defVal) = explode(',', $define); $this->{$defName} = trim($defVal); } } - /** - * Write the config file to disk. - */ public function saveConfig() { - $tmpCfg = file_get_contents($this->INSTALL_DIR.'/config.php.tpl'); + $tmpCfg = file_get_contents($this->INSTALL_DIR . DS . 'config.php.tpl'); + $tmpCfg = str_replace('%%DB_SYSTEM%%', $this->DB_SYSTEM, $tmpCfg); $tmpCfg = str_replace('%%DB_HOST%%', $this->DB_HOST, $tmpCfg); - $tmpCfg = str_replace('%%DB_USER%%', $this->DB_USER, $tmpCfg); $tmpCfg = str_replace('%%DB_PORT%%', $this->DB_PORT, $tmpCfg); + $tmpCfg = str_replace('%%DB_SOCKET%%', $this->DB_SOCKET, $tmpCfg); + $tmpCfg = str_replace('%%DB_USER%%', $this->DB_USER, $tmpCfg); $tmpCfg = str_replace('%%DB_PASSWORD%%', $this->DB_PASSWORD, $tmpCfg); $tmpCfg = str_replace('%%DB_NAME%%', $this->DB_NAME, $tmpCfg); - $tmpCfg = str_replace('%%DB_INNODB%%', $this->DB_INNODB, $tmpCfg); $tmpCfg = str_replace('%%NNTP_USERNAME%%', $this->NNTP_USERNAME, $tmpCfg); $tmpCfg = str_replace('%%NNTP_PASSWORD%%', $this->NNTP_PASSWORD, $tmpCfg); $tmpCfg = str_replace('%%NNTP_SERVER%%', $this->NNTP_SERVER, $tmpCfg); $tmpCfg = str_replace('%%NNTP_PORT%%', $this->NNTP_PORT, $tmpCfg); - $tmpCfg = str_replace('%%NNTP_SSLENABLED%%', ($this->NNTP_SSLENABLED?"true":"false"), $tmpCfg); + $tmpCfg = str_replace('%%NNTP_SSLENABLED%%', ($this->NNTP_SSLENABLED ? "true" : "false"), $tmpCfg); + $tmpCfg = str_replace('%%NNTP_SOCKET_TIMEOUT%%', $this->NNTP_SOCKET_TIMEOUT, $tmpCfg); - $tmpCfg = str_replace('%%CACHEOPT_METHOD%%', $this->CACHE_TYPE, $tmpCfg); + $tmpCfg = str_replace('%%NNTP_USERNAME_A%%', $this->NNTP_USERNAME_A, $tmpCfg); + $tmpCfg = str_replace('%%NNTP_PASSWORD_A%%', $this->NNTP_PASSWORD_A, $tmpCfg); + $tmpCfg = str_replace('%%NNTP_SERVER_A%%', $this->NNTP_SERVER_A, $tmpCfg); + $tmpCfg = str_replace('%%NNTP_PORT_A%%', $this->NNTP_PORT_A, $tmpCfg); + $tmpCfg = str_replace('%%NNTP_SSLENABLED_A%%', ($this->NNTP_SSLENABLED_A ? "true" : "false"), $tmpCfg); + $tmpCfg = str_replace('%%NNTP_SOCKET_TIMEOUT_A%%', $this->NNTP_SOCKET_TIMEOUT_A, $tmpCfg); + + $tmpCfg = str_replace('%%NN_SSL_CAFILE%%', $this->NN_SSL_CAFILE, $tmpCfg); + $tmpCfg = str_replace('%%NN_SSL_CAPATH%%', $this->NN_SSL_CAPATH, $tmpCfg); + $tmpCfg = str_replace('%%NN_SSL_VERIFY_PEER%%', $this->NN_SSL_VERIFY_PEER, $tmpCfg); + $tmpCfg = str_replace('%%NN_SSL_VERIFY_HOST%%', $this->NN_SSL_VERIFY_HOST, $tmpCfg); + $tmpCfg = str_replace('%%NN_SSL_ALLOW_SELF_SIGNED%%', $this->NN_SSL_ALLOW_SELF_SIGNED, $tmpCfg); $this->COMPILED_CONFIG = $tmpCfg; - return @file_put_contents($this->WWW_DIR.'/config.php', $tmpCfg); + return @file_put_contents(NN_CONFIGS . DS . 'config.php', $tmpCfg); } - /** - * Create the installation lock file. - */ public function saveInstallLock() { - return @file_put_contents($this->INSTALL_DIR.'/install.lock', ''); + return @file_put_contents($this->INSTALL_DIR . DS . 'install.lock', ''); } + } diff --git a/resources/db/schema/data/10-forum_posts.tsv b/resources/db/schema/data/10-forumpost.tsv similarity index 100% rename from resources/db/schema/data/10-forum_posts.tsv rename to resources/db/schema/data/10-forumpost.tsv diff --git a/resources/db/schema/data/10-page_contents.tsv b/resources/db/schema/data/10-page_contents.tsv index b9b6f8c7f..c61af0660 100755 --- a/resources/db/schema/data/10-page_contents.tsv +++ b/resources/db/schema/data/10-page_contents.tsv @@ -1,4 +1,4 @@ id, title, url, body, metadescription, metakeywords, contenttype, showinmenu, status, ordinal, role -1 Welcome to NNTmux. NULL

Since NNTmux is a fork of newznab/nZEDb, the API is compatible with sonarr, sickbeard, couchpotato, etc...

"" "" 3 0 1 0 0 +1 Welcome to NNTmux. NULL

Since NNTmux is a fork of newznab and nZEDb, the API is compatible with sonarr, sickbeard, couchpotato, etc...

"" "" 3 0 1 0 0 2 example content /great/seo/content/page/

this is an example content page

"" "" 1 2 1 1 0 3 another example /another/great/seo/content/page/

this is another example content page

"" "" 1 2 1 0 0 diff --git a/resources/db/schema/data/10-settings.tsv b/resources/db/schema/data/10-settings.tsv index 12e961d00..2cd776082 100755 --- a/resources/db/schema/data/10-settings.tsv +++ b/resources/db/schema/data/10-settings.tsv @@ -62,7 +62,7 @@ indexer ppa innerfileblacklist /setup\.exe|password\.url/i You can add a regex h newgroupmsgstoscan 100000 Posts newgroupmsgstoscan newgroupscanmethod 0 Scan back X (posts/days) for each new group? Use backfill to scan further. newgroupscanmethod nextppticket 0 nextppticket - nntpproxy 0 Using the NNTP Proxy for nntmux can improve performance of nntmux dramatically. It uses connection pooling which not only give more control over the number of connections to use but also reduces time for connection setup/teardown. The proxy also takes care of compressed headers for you. To use this featrure you will need to install pynntp (sudo pip install pynntp or sudo easy_install pynntp) and socketpool (sudo pip install socketpool or sudo easy_install socketpool) (ensure python2 is default) and edit the configuration file (nntpproxy.conf and nntpproxy_a.conf) in the update_scripts/python_scripts/lib (copy sample) directory and finally edit your www/config.php file to use the proxy (username and password are ignored by the proxy - make then anything you like - the proxy doesn't use ssl either). Make sure you turn off the use compressed headers option here in site preferences (the proxy uses compressed headers by default and passes on decompressed data). nntpproxy + nntpproxy 0 Using the NNTP Proxy for NNTmux can improve performance of NNTmux dramatically. It uses connection pooling which not only give more control over the number of connections to use but also reduces time for connection setup/teardown. The proxy also takes care of compressed headers for you. To use this featrure you will need to install pynntp (sudo pip install pynntp or sudo easy_install pynntp) and socketpool (sudo pip install socketpool or sudo easy_install socketpool) (ensure python2 is default) and edit the configuration file (nntpproxy.conf and nntpproxy_a.conf) in the update_scripts/python_scripts/lib (copy sample) directory and finally edit your www/config.php file to use the proxy (username and password are ignored by the proxy - make then anything you like - the proxy doesn't use ssl either). Make sure you turn off the use compressed headers option here in site preferences (the proxy uses compressed headers by default and passes on decompressed data). nntpproxy nntpretries 10 The maximum number of retry attmpts to connect to nntp provider. On error, each retry takes approximately 5 seconds nntp returns reply. (Default 10). nntpretries nzbpath /your/path/to/nzbs/ The directory where nzb files will be stored. nzbpath nzbsplitlevel 4 Levels deep to store the nzb Files. nzbsplitlevel @@ -84,11 +84,11 @@ indexer ppa innerfileblacklist /setup\.exe|password\.url/i You can add a regex h registerstatus 0 The status of registrations to the site. registerstatus releasecompletion 95 The minimum completion % to keep a release. Set to 0 to disable. releasecompletion releaseretentiondays 0 !!THIS IS NOT HEADER RETENTION!! The number of days releases will be retained for use throughout site. Set to 0 to disable. releaseretentiondays - releasethreads 1 The number of threads for update_releases. This is only for tablepergroup. releasethreads + releasesthreads 1 The number of threads for update_releases. This is only for tablepergroup. releasesthreads replacenzbs 0 NZBs that are crossposted, instead of deleting, replace with the nzb grabbed.(This is not necessary, was added before I understood how crossposted nzbs work). replacenzbs reqidthreads 1 The number of threads for local request id processing. reqidthreads request_hours 1 The maximum hours after a release is added to recheck for a Request ID match. request_hours - request_url http://reqid.newznab-tmux.pw/index.php Optional URL to lookup Request IDs. request_url + request_url http://reqid.nzedb.com/index.php Optional URL to lookup Request IDs. request_url safebackfilldate 2012-06-24 The target date for safe backfill. Format: YYYY-MM-DD safebackfilldate safepartrepair 0 Whether to put unreceived parts into partrepair table when running binaries(safe) or backfill scripts. safepartrepair segmentstodownload 2 The maximum number of segments to download to generate the sample video file. (Default 2) segmentstodownload @@ -139,7 +139,7 @@ site google adheader The banner slot in the header. adheader site google google_adsense_acc AdSense account: e.g. pub-123123123123123 google_adsense_acc site google google_adsense_search The ID of the google search ad panel displayed at the bottom of the left menu. google_adsense_search site google google_analytics_acc Analytic's account: e.g. UA-xxxxxx-x google_analytics_acc -site main code nntmux A just for fun value, shown in debug and not on public pages. code +site main code NNTmux A just for fun value, shown in debug and not on public pages. code site main coverspath /your/path/to/covers/ The absolute path to the place covers will be stored. coverspath site main dereferrer_link Optional URL to prepend to external links dereferrer_link site main email Shown in the contact us page, and where the contact html form is sent to. email @@ -152,7 +152,8 @@ site main metadescription A usenet indexing website Stem meta-description append site main metakeywords usenet,nzbs,cms,community Stem meta-keywords appended to all page meta keyword tags metakeywords site main metatitle An indexer Stem meta-tag appended to all page title tags. metatitle site main strapline A great usenet indexer Displayed in the header on every public page. strapline -site main style Alpha The theme folder which will be loaded for css and images. style +site main style Gentele The theme folder which will be loaded for css and images. style +site main userselstyle 0 Are users allowed to change site theme userselstyle site main tandc

All information within this database is indexed by an automated process, without any human intervention. It is obtained from global Usenet newsgroups over which this site has no control. We cannot prevent that you might find obscene or objectionable material by using this service. If you do come across obscene, incorrect or objectionable results, let us know by using the contact form.

Text displayed in the terms and conditions page. tandc site main title nntmux Displayed around the site and contact form as the name for the site. title site trailers trailers_display 1 Display trailers on the details page? trailers_display diff --git a/resources/db/schema/innnodb_5.6_stopword_tbl.sql b/resources/db/schema/innnodb_5.6_stopword_tbl.sql old mode 100644 new mode 100755 index 94efa48b5..5643c4d4f --- a/resources/db/schema/innnodb_5.6_stopword_tbl.sql +++ b/resources/db/schema/innnodb_5.6_stopword_tbl.sql @@ -3,9 +3,9 @@ has decided to code the Fulltext searching within the site for MyISAM due to its full text search implementation is the stop word table. MyISAM's (seen below) consists of 543 entries while InnoDB's consists of only 36. This leads to greatly disparate results when searching the same data between the two engines. If you prefer your results using InnoDB's default stop word table, then ignore this file. If you wish to keep your search in-line with the way it was coded simply import this file into MySQL. Using this import constitutes (in general) a major change to the entire MySQL instance as the change is Global to use the new stop word -table. Because of this, it is recommended you import this table into the mysql database, NOT nntmux. Do this with the following command (using an account that has access to the mysql database): +table. Because of this, it is recommended you import this table into the mysql database, NOT nzedb. Do this with the following command (using an account that has access to the mysql database): -mysql -uroot mysql < /var/www/nntmux/resources/db/schema/innodb_5.6_stopword_tbl.sql +mysql -uroot mysql < /var/www/nZEDb/resources/db/schema/innodb_5.6_stopword_tbl.sql Once imported, it is recommended to set: diff --git a/resources/db/schema/mysql-ddl.sql b/resources/db/schema/mysql-ddl.sql old mode 100644 new mode 100755 index 6fec045e3..8b14087bb --- a/resources/db/schema/mysql-ddl.sql +++ b/resources/db/schema/mysql-ddl.sql @@ -1,1309 +1,1323 @@ -DROP TABLE IF EXISTS site; -DROP TABLE IF EXISTS anidb; -DROP TABLE IF EXISTS animetitles; +DROP TABLE IF EXISTS allgroups; +CREATE TABLE allgroups ( + id INT(11) NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL DEFAULT '', + first_record BIGINT UNSIGNED NOT NULL DEFAULT '0', + last_record BIGINT UNSIGNED NOT NULL DEFAULT '0', + updated DATETIME DEFAULT NULL, + PRIMARY KEY (id), + INDEX ix_allgroups_name (name) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS anidb_episodes; -CREATE TABLE anidb_episodes -( - anidbid INT(10) unsigned NOT NULL COMMENT 'id of title from AniDB', - episodeid INT(10) unsigned DEFAULT '0' NOT NULL COMMENT 'anidb id for this episode', - episode_no SMALLINT(5) unsigned NOT NULL COMMENT 'Numeric version of episode (leave 0 for combined episodes).', - episode_title VARCHAR(255) NOT NULL COMMENT 'Title of the episode (en, x-jat)', - airdate DATE NOT NULL, - CONSTRAINT `PRIMARY` PRIMARY KEY (anidbid, episodeid) +CREATE TABLE anidb_episodes ( + anidbid INT(10) UNSIGNED NOT NULL + COMMENT 'ID of title from AniDB', + episodeid INT(10) UNSIGNED NOT NULL DEFAULT '0' + COMMENT 'anidb id for this episode', + episode_no SMALLINT(5) UNSIGNED NOT NULL + COMMENT 'Numeric version of episode (leave 0 for combined episodes).', + episode_title VARCHAR(255) + COLLATE utf8_unicode_ci NOT NULL + COMMENT 'Title of the episode (en, x-jat)', + airdate DATE NOT NULL, + PRIMARY KEY (anidbid, episodeid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; + ENGINE = MYISAM + DEFAULT CHARSET =utf8 + COLLATE =utf8_unicode_ci; + DROP TABLE IF EXISTS anidb_info; -CREATE TABLE anidb_info -( - anidbid INT(10) unsigned PRIMARY KEY NOT NULL COMMENT 'id of title from AniDB', - type VARCHAR(32), - startdate DATE, - enddate DATE, - updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, - related VARCHAR(1024), - similar VARCHAR(1024), - creators VARCHAR(1024), - description TEXT, - rating VARCHAR(5), - picture VARCHAR(255), - categories VARCHAR(1024), - characters VARCHAR(1024) +CREATE TABLE anidb_info ( + anidbid INT(10) UNSIGNED NOT NULL + COMMENT 'ID of title from AniDB', + type VARCHAR(32) + COLLATE utf8_unicode_ci DEFAULT NULL, + startdate DATE DEFAULT NULL, + enddate DATE DEFAULT NULL, + updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + related VARCHAR(1024) + COLLATE utf8_unicode_ci DEFAULT NULL, + similar VARCHAR(1024) + COLLATE utf8_unicode_ci DEFAULT NULL, + creators VARCHAR(1024) + COLLATE utf8_unicode_ci DEFAULT NULL, + description TEXT + COLLATE utf8_unicode_ci DEFAULT NULL, + rating VARCHAR(5) + COLLATE utf8_unicode_ci DEFAULT NULL, + picture VARCHAR(255) + COLLATE utf8_unicode_ci DEFAULT NULL, + categories VARCHAR(1024) + COLLATE utf8_unicode_ci DEFAULT NULL, + characters VARCHAR(1024) + COLLATE utf8_unicode_ci DEFAULT NULL, + PRIMARY KEY (anidbid), + KEY ix_anidb_info_datetime (startdate, enddate, updated) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; + ENGINE = MYISAM + DEFAULT CHARSET =utf8 + COLLATE =utf8_unicode_ci; -CREATE INDEX ix_anidb_info_datetime ON anidb_info (startdate, enddate, updated); DROP TABLE IF EXISTS anidb_titles; -CREATE TABLE anidb_titles -( - anidbid INT(10) unsigned NOT NULL COMMENT 'id of title from AniDB', - type VARCHAR(25) NOT NULL COMMENT 'type of title.', - lang VARCHAR(25) NOT NULL, - title VARCHAR(255) NOT NULL, - CONSTRAINT `PRIMARY` PRIMARY KEY (anidbid, type, lang, title) +CREATE TABLE anidb_titles ( + anidbid INT(10) UNSIGNED NOT NULL + COMMENT 'ID of title from AniDB', + type VARCHAR(25) + COLLATE utf8_unicode_ci NOT NULL + COMMENT 'type of title.', + lang VARCHAR(25) + COLLATE utf8_unicode_ci NOT NULL, + title VARCHAR(255) + COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (anidbid, type, lang, title) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + DROP TABLE IF EXISTS audio_data; -CREATE TABLE audio_data -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - releases_id INT(11) NOT NULL COMMENT 'FK to releases.id', - audioid INT(2) unsigned, - audioformat VARCHAR(255), - audiomode VARCHAR(255), - audiobitratemode VARCHAR(255), - audiobitrate VARCHAR(255), - audiochannels VARCHAR(255), - audiosamplerate VARCHAR(255), - audiolibrary VARCHAR(255), - audiolanguage VARCHAR(255), - audiotitle VARCHAR(255) +CREATE TABLE audio_data ( + id INT(11) UNSIGNED AUTO_INCREMENT, + releases_id INT(11) UNSIGNED NOT NULL COMMENT 'FK to releases.id', + audioid INT(2) UNSIGNED NOT NULL, + audioformat VARCHAR(50) DEFAULT NULL, + audiomode VARCHAR(50) DEFAULT NULL, + audiobitratemode VARCHAR(50) DEFAULT NULL, + audiobitrate VARCHAR(10) DEFAULT NULL, + audiochannels VARCHAR(25) DEFAULT NULL, + audiosamplerate VARCHAR(25) DEFAULT NULL, + audiolibrary VARCHAR(50) DEFAULT NULL, + audiolanguage VARCHAR(50) DEFAULT NULL, + audiotitle VARCHAR(50) DEFAULT NULL, + PRIMARY KEY (id), + UNIQUE INDEX ix_releaseaudio_releaseid_audioid (releases_id, audioid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; -CREATE UNIQUE INDEX releaseid ON audio_data (releases_id, audioid); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS binaries; -CREATE TABLE binaries -( - id BIGINT(20) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - name VARCHAR(1000) DEFAULT '' NOT NULL, - collection_id INT(11) unsigned DEFAULT '0' NOT NULL, - filenumber INT(10) unsigned DEFAULT '0' NOT NULL, - totalparts INT(11) unsigned DEFAULT '0' NOT NULL, - currentparts INT(10) unsigned DEFAULT '0' NOT NULL, - binaryhash BINARY(16) DEFAULT '0 ' NOT NULL, - partcheck TINYINT(1) unsigned DEFAULT '0' NOT NULL, - partsize BIGINT(20) unsigned DEFAULT '0' NOT NULL +CREATE TABLE binaries ( + id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + name VARCHAR(1000) NOT NULL DEFAULT '', + collection_id INT(11) UNSIGNED NOT NULL DEFAULT 0, + filenumber INT UNSIGNED NOT NULL DEFAULT '0', + totalparts INT(11) UNSIGNED NOT NULL DEFAULT 0, + currentparts INT UNSIGNED NOT NULL DEFAULT 0, + binaryhash BINARY(16) NOT NULL DEFAULT '0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', + partcheck TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + partsize BIGINT UNSIGNED NOT NULL DEFAULT 0, + PRIMARY KEY (id), + UNIQUE INDEX ix_binary_binaryhash (binaryhash), + INDEX ix_binary_partcheck (partcheck), + INDEX ix_binary_collection (collection_id) ) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; -ENGINE = MyISAM -DEFAULT CHARSET = utf8 -COLLATE = utf8_unicode_ci -AUTO_INCREMENT = 1; - -CREATE UNIQUE INDEX ix_binary_binaryhash ON binaries (binaryhash); -CREATE INDEX ix_binary_collection ON binaries (collection_id); -CREATE INDEX ix_binary_partcheck ON binaries (partcheck); DROP TABLE IF EXISTS binaryblacklist; -CREATE TABLE binaryblacklist -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - groupname VARCHAR(255), - regex VARCHAR(2000) NOT NULL, - msgcol INT(11) unsigned DEFAULT '1' NOT NULL, - optype INT(11) unsigned DEFAULT '1' NOT NULL, - status INT(11) unsigned DEFAULT '1' NOT NULL, - description VARCHAR(1000), - last_activity DATE +CREATE TABLE binaryblacklist ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + groupname VARCHAR(255) NULL, + regex VARCHAR(2000) NOT NULL, + msgcol INT(11) UNSIGNED NOT NULL DEFAULT '1', + optype INT(11) UNSIGNED NOT NULL DEFAULT '1', + status INT(11) UNSIGNED NOT NULL DEFAULT '1', + description VARCHAR(1000) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, + last_activity DATE NULL, + PRIMARY KEY (id), + INDEX ix_binaryblacklist_groupname (groupname), + INDEX ix_binaryblacklist_status (status) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 100001; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1000001; + DROP TABLE IF EXISTS bookinfo; -CREATE TABLE bookinfo -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - title VARCHAR(255) NOT NULL, - asin VARCHAR(255), - url VARCHAR(1000), - author VARCHAR(255), - publisher VARCHAR(255), - publishdate DATETIME, - review VARCHAR(10000), - genreid INT(10), - dewey VARCHAR(10), - ean VARCHAR(20), - isbn VARCHAR(20), - pages INT(10), - cover TINYINT(1) unsigned DEFAULT '0' NOT NULL, - createddate DATETIME NOT NULL, - updateddate DATETIME NOT NULL, - salesrank INT(10) unsigned, - overview VARCHAR(3000), - genre VARCHAR(255) NOT NULL +CREATE TABLE bookinfo ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + title VARCHAR(255) NOT NULL, + author VARCHAR(255) NOT NULL, + asin VARCHAR(128) DEFAULT NULL, + isbn VARCHAR(128) DEFAULT NULL, + ean VARCHAR(128) DEFAULT NULL, + url VARCHAR(1000) DEFAULT NULL, + salesrank INT(10) UNSIGNED DEFAULT NULL, + publisher VARCHAR(255) DEFAULT NULL, + publishdate DATETIME DEFAULT NULL, + pages VARCHAR(128) DEFAULT NULL, + overview VARCHAR(3000) DEFAULT NULL, + genre VARCHAR(255) NOT NULL, + cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + createddate DATETIME NOT NULL, + updateddate DATETIME NOT NULL, + PRIMARY KEY (id), + FULLTEXT INDEX ix_bookinfo_author_title_ft (author, title), + UNIQUE INDEX ix_bookinfo_asin (asin) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE FULLTEXT INDEX ix_bookinfo_author_title_ft ON bookinfo (author, title); -CREATE INDEX ix_bookinfo_title ON bookinfo (title); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS categories; -CREATE TABLE categories -( - id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - title VARCHAR(255) NOT NULL, - parentid INT(11), - status INT(11) DEFAULT '1' NOT NULL, - minsizetoformrelease BIGINT(20) unsigned DEFAULT '0' NOT NULL, - maxsizetoformrelease BIGINT(20) unsigned DEFAULT '0' NOT NULL, - description VARCHAR(255), - disablepreview TINYINT(1) DEFAULT '0' NOT NULL +CREATE TABLE categories ( + id INT(16) UNSIGNED NOT NULL AUTO_INCREMENT, + title VARCHAR(255) NOT NULL, + parentid INT NULL, + status INT NOT NULL DEFAULT '1', + description VARCHAR(255) NULL, + disablepreview TINYINT(1) NOT NULL DEFAULT '0', + minsize BIGINT UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (id), + INDEX ix_categories_status (status), + INDEX ix_categories_parentid (parentid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1000001; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1000001; + DROP TABLE IF EXISTS category_regexes; -CREATE TABLE category_regexes -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - group_regex VARCHAR(255) DEFAULT '' NOT NULL COMMENT 'This is a regex to match against usenet groups', - regex VARCHAR(5000) DEFAULT '' NOT NULL COMMENT 'Regex used to match a release name to categorize it', - status TINYINT(1) unsigned DEFAULT '1' NOT NULL COMMENT '1 = ON 0 = OFF', - description VARCHAR(1000) DEFAULT '' NOT NULL COMMENT 'Optional extra details on this regex', - ordinal INT(11) DEFAULT '0' NOT NULL COMMENT 'Order to run the regex in', - categories_id SMALLINT(5) unsigned DEFAULT '10' NOT NULL COMMENT 'Which category id to put the release in' +CREATE TABLE category_regexes ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT, + group_regex VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'This is a regex to match against usenet groups', + regex VARCHAR(5000) NOT NULL DEFAULT '' COMMENT 'Regex used to match a release name to categorize it', + status TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1=ON 0=OFF', + description VARCHAR(1000) NOT NULL DEFAULT '' COMMENT 'Optional extra details on this regex', + ordinal INT SIGNED NOT NULL DEFAULT '0' COMMENT 'Order to run the regex in', + categories_id SMALLINT UNSIGNED NOT NULL DEFAULT '0010' COMMENT 'Which categories id to put the release in', + PRIMARY KEY (id), + INDEX ix_category_regexes_group_regex (group_regex), + INDEX ix_category_regexes_status (status), + INDEX ix_category_regexes_ordinal (ordinal), + INDEX ix_category_regexes_categories_id (categories_id) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_category_regexes_category_id ON category_regexes (categories_id); -CREATE INDEX ix_category_regexes_group_regex ON category_regexes (group_regex); -CREATE INDEX ix_category_regexes_ordinal ON category_regexes (ordinal); -CREATE INDEX ix_category_regexes_status ON category_regexes (status); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 100000; -DROP TABLE IF EXISTS collection_regexes; -CREATE TABLE collection_regexes -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - group_regex VARCHAR(255) DEFAULT '' NOT NULL COMMENT 'This is a regex to match against usenet groups', - regex VARCHAR(5000) DEFAULT '' NOT NULL COMMENT 'Regex used for collection grouping', - status TINYINT(1) unsigned DEFAULT '1' NOT NULL COMMENT '1 = ON 0 = OFF', - description VARCHAR(1000), - ordinal INT(11) DEFAULT '0' NOT NULL COMMENT 'Order to run the regex in' -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 100001; -CREATE INDEX ix_collection_regexes_group_regex ON collection_regexes (group_regex); -CREATE INDEX ix_collection_regexes_ordinal ON collection_regexes (ordinal); -CREATE INDEX ix_collection_regexes_status ON collection_regexes (status); DROP TABLE IF EXISTS collections; -CREATE TABLE collections -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - subject VARCHAR(255) DEFAULT '' NOT NULL, - fromname VARCHAR(255) DEFAULT '' NOT NULL, - DATE DATETIME, - xref VARCHAR(255) DEFAULT '' NOT NULL, - totalfiles INT(11) unsigned DEFAULT '0' NOT NULL, - group_id INT(11) unsigned DEFAULT '0' NOT NULL, - collectionhash VARCHAR(255) DEFAULT '0' NOT NULL, - dateadded DATETIME, - filecheck TINYINT(3) unsigned DEFAULT '0' NOT NULL, - filesize BIGINT(20) unsigned DEFAULT '0' NOT NULL, - releaseid INT(11), - noise CHAR(32) DEFAULT '' NOT NULL, - added TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +CREATE TABLE collections ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + subject VARCHAR(255) NOT NULL DEFAULT '', + fromname VARCHAR(255) NOT NULL DEFAULT '', + date DATETIME DEFAULT NULL, + xref VARCHAR(255) NOT NULL DEFAULT '', + totalfiles INT(11) UNSIGNED NOT NULL DEFAULT '0', + group_id INT(11) UNSIGNED NOT NULL DEFAULT '0', + collectionhash VARCHAR(255) NOT NULL DEFAULT '0', + dateadded DATETIME DEFAULT NULL, + added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + filecheck TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + filesize BIGINT UNSIGNED NOT NULL DEFAULT '0', + releaseid INT NULL, + noise CHAR(32) NOT NULL DEFAULT '', + PRIMARY KEY (id), + INDEX fromname (fromname), + INDEX date (date), + INDEX group_id (group_id), + INDEX ix_collection_filecheck (filecheck), + INDEX ix_collection_dateadded (dateadded), + INDEX ix_collection_releaseid (releaseid), + UNIQUE INDEX ix_collection_collectionhash (collectionhash) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX DATE ON collections (DATE); -CREATE INDEX fromname ON collections (fromname); -CREATE INDEX group_id ON collections (group_id); -CREATE INDEX ix_collection_added ON collections (added); -CREATE UNIQUE INDEX ix_collection_collectionhash ON collections (collectionhash); -CREATE INDEX ix_collection_dateadded ON collections (dateadded); -CREATE INDEX ix_collection_filecheck ON collections (filecheck); -CREATE INDEX ix_collection_releaseid ON collections (releaseid); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + +DROP TABLE IF EXISTS collection_regexes; +CREATE TABLE collection_regexes ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT, + group_regex VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'This is a regex to match against usenet groups', + regex VARCHAR(5000) NOT NULL DEFAULT '' COMMENT 'Regex used for collection grouping', + status TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1=ON 0=OFF', + description VARCHAR(1000) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Optional extra details on this regex', + ordinal INT SIGNED NOT NULL DEFAULT '0' COMMENT 'Order to run the regex in', + PRIMARY KEY (id), + INDEX ix_collection_regexes_group_regex (group_regex), + INDEX ix_collection_regexes_status (status), + INDEX ix_collection_regexes_ordinal (ordinal) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 100000; + DROP TABLE IF EXISTS consoleinfo; -CREATE TABLE consoleinfo -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - title VARCHAR(255) NOT NULL, - asin VARCHAR(128), - url VARCHAR(1000), - salesrank INT(10) unsigned, - platform VARCHAR(255), - publisher VARCHAR(255), - genreid INT(10), - esrb VARCHAR(255), - releasedate DATETIME, - review VARCHAR(10000), - cover TINYINT(1) unsigned DEFAULT '0' NOT NULL, - createddate DATETIME NOT NULL, - updateddate DATETIME NOT NULL +CREATE TABLE consoleinfo ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + title VARCHAR(255) NOT NULL, + asin VARCHAR(128) DEFAULT NULL, + url VARCHAR(1000) DEFAULT NULL, + salesrank INT(10) UNSIGNED DEFAULT NULL, + platform VARCHAR(255) DEFAULT NULL, + publisher VARCHAR(255) DEFAULT NULL, + genre_id INT(10) NULL DEFAULT NULL, + esrb VARCHAR(255) NULL DEFAULT NULL, + releasedate DATETIME DEFAULT NULL, + review VARCHAR(3000) DEFAULT NULL, + cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + createddate DATETIME NOT NULL, + updateddate DATETIME NOT NULL, + PRIMARY KEY (id), + FULLTEXT INDEX ix_consoleinfo_title_platform_ft (title, platform), + UNIQUE INDEX ix_consoleinfo_asin (asin) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_consoleinfo_title ON consoleinfo (title); -CREATE FULLTEXT INDEX ix_consoleinfo_title_platform_ft ON consoleinfo (title, platform); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; -DROP TABLE IF EXISTS content; -CREATE TABLE content -( - id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - title VARCHAR(255) NOT NULL, - url VARCHAR(2000), - body TEXT, - metadescription VARCHAR(1000) NOT NULL, - metakeywords VARCHAR(1000) NOT NULL, - contenttype INT(11) NOT NULL, - showinmenu INT(11) NOT NULL, - status INT(11) NOT NULL, - ordinal INT(11), - role INT(11) DEFAULT '0' NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1000001; DROP TABLE IF EXISTS countries; -CREATE TABLE countries -( - id CHAR(2) PRIMARY KEY NOT NULL COMMENT '2 character code.', - iso3 CHAR(3) NOT NULL COMMENT '3 character code.', - country VARCHAR(180) NOT NULL COMMENT 'Name of the country.' +CREATE TABLE countries ( + id CHAR(2) COLLATE utf8_unicode_ci NOT NULL COMMENT '2 character code.', + iso3 CHAR(3) COLLATE utf8_unicode_ci NOT NULL COMMENT '3 character code.', + country VARCHAR(180) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Name of the country.', + PRIMARY KEY (id), + UNIQUE KEY code3 (iso3), + UNIQUE KEY country (country) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; -CREATE UNIQUE INDEX code3 ON countries (iso3); -CREATE UNIQUE INDEX country ON countries (country); + ENGINE = MyISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + DROP TABLE IF EXISTS dnzb_failures; -CREATE TABLE dnzb_failures -( - release_id INT(11) unsigned NOT NULL, - users_id INT(11) unsigned NOT NULL COMMENT 'FK to users.id', - failed INT(10) unsigned DEFAULT '0' NOT NULL, - CONSTRAINT `PRIMARY` PRIMARY KEY (release_id, users_id) +CREATE TABLE dnzb_failures ( + release_id INT(11) UNSIGNED NOT NULL, + userid INT(11) UNSIGNED NOT NULL, + failed INT UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (release_id, userid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; - -DROP TABLE IF EXISTS episodeinfo; + ENGINE =MYISAM + DEFAULT CHARSET =utf8 + COLLATE =utf8_unicode_ci; DROP TABLE IF EXISTS forumpost; -CREATE TABLE forumpost -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - forumid INT(11), - parentid INT(11), - users_id INT(11) unsigned NOT NULL COMMENT 'FK to users.id', - subject VARCHAR(255) NOT NULL, - message TEXT NOT NULL, - locked TINYINT(1) unsigned DEFAULT '0' NOT NULL, - sticky TINYINT(1) unsigned DEFAULT '0' NOT NULL, - replies INT(11) unsigned DEFAULT '0' NOT NULL, - createddate DATETIME NOT NULL, - updateddate DATETIME NOT NULL +CREATE TABLE forumpost ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + forumid INT(11) NOT NULL DEFAULT '1', + parentid INT(11) NOT NULL DEFAULT '0', + users_id INT(11) UNSIGNED NOT NULL, + subject VARCHAR(255) NOT NULL, + message TEXT NOT NULL, + locked TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + sticky TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + replies INT(11) UNSIGNED NOT NULL DEFAULT '0', + createddate DATETIME NOT NULL, + updateddate DATETIME NOT NULL, + PRIMARY KEY (id), + KEY parentid (parentid), + KEY userid (users_id), + KEY createddate (createddate), + KEY updateddate (updateddate) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX createddate ON forumpost (createddate); -CREATE INDEX parentid ON forumpost (parentid); -CREATE INDEX updateddate ON forumpost (updateddate); -CREATE INDEX userid ON forumpost (users_id); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS gamesinfo; -CREATE TABLE gamesinfo -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - title VARCHAR(255) NOT NULL, - asin VARCHAR(128), - url VARCHAR(1000), - platform VARCHAR(255), - publisher VARCHAR(255), - genre_id INT(10), - esrb VARCHAR(255), - releasedate DATETIME, - review VARCHAR(3000), - cover TINYINT(1) unsigned DEFAULT '0' NOT NULL, - backdrop TINYINT(1) DEFAULT '0', - trailer VARCHAR(1000) DEFAULT '', - classused VARCHAR(10) DEFAULT 'steam', - createddate DATETIME NOT NULL, - updateddate DATETIME NOT NULL +CREATE TABLE gamesinfo ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + title VARCHAR(255) NOT NULL, + asin VARCHAR(128) DEFAULT NULL, + url VARCHAR(1000) DEFAULT NULL, + publisher VARCHAR(255) DEFAULT NULL, + genre_id INT(10) NULL DEFAULT NULL, + esrb VARCHAR(255) NULL DEFAULT NULL, + releasedate DATETIME DEFAULT NULL, + review VARCHAR(3000) DEFAULT NULL, + cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + backdrop TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + trailer VARCHAR(1000) NOT NULL DEFAULT '', + classused VARCHAR(10) NOT NULL DEFAULT 'steam', + createddate DATETIME NOT NULL, + updateddate DATETIME NOT NULL, + PRIMARY KEY (id), + UNIQUE INDEX ix_gamesinfo_asin (asin), + INDEX ix_title (title) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX ix_gamesinfo_asin ON gamesinfo (asin); + ENGINE = MyISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS genres; -CREATE TABLE genres -( - id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - title VARCHAR(255) NOT NULL, - type INT(4), - disabled TINYINT(1) DEFAULT '0' NOT NULL +CREATE TABLE genres ( + id INT(11) NOT NULL AUTO_INCREMENT, + title VARCHAR(255) NOT NULL, + type INT(4) DEFAULT NULL, + disabled TINYINT(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1000001; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1000001; + DROP TABLE IF EXISTS groups; -CREATE TABLE groups -( - id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - name VARCHAR(255) DEFAULT '' NOT NULL, - backfill_target INT(4) DEFAULT '1' NOT NULL, - first_record BIGINT(20) unsigned DEFAULT '0' NOT NULL, - first_record_postdate DATETIME, - last_record BIGINT(20) unsigned DEFAULT '0' NOT NULL, - last_record_postdate DATETIME, - last_updated DATETIME, - minfilestoformrelease INT(4), - minsizetoformrelease BIGINT(20), - regexmatchonly TINYINT(1) DEFAULT '1' NOT NULL, - active TINYINT(1) DEFAULT '0' NOT NULL, - backfill TINYINT(1) DEFAULT '0' NOT NULL, - description VARCHAR(255) DEFAULT '' +CREATE TABLE groups ( + id INT(11) NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL DEFAULT '', + backfill_target INT(4) NOT NULL DEFAULT '1', + first_record BIGINT UNSIGNED NOT NULL DEFAULT '0', + first_record_postdate DATETIME DEFAULT NULL, + last_record BIGINT UNSIGNED NOT NULL DEFAULT '0', + last_record_postdate DATETIME DEFAULT NULL, + last_updated DATETIME DEFAULT NULL, + minfilestoformrelease INT(4) NULL, + minsizetoformrelease BIGINT NULL, + active TINYINT(1) NOT NULL DEFAULT '0', + backfill TINYINT(1) NOT NULL DEFAULT '0', + description VARCHAR(255) NULL DEFAULT '', + PRIMARY KEY (id), + KEY active (active), + UNIQUE INDEX ix_groups_name (name) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 100001; -CREATE INDEX active ON groups (active); -CREATE UNIQUE INDEX name ON groups (name); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1000001; + DROP TABLE IF EXISTS invitations; -CREATE TABLE invitations -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - guid VARCHAR(50) NOT NULL, - users_id INT(11) unsigned NOT NULL COMMENT 'FK to users.id', - createddate DATETIME NOT NULL +CREATE TABLE invitations ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + guid VARCHAR(50) NOT NULL, + users_id INT(11) UNSIGNED NOT NULL, + createddate DATETIME NOT NULL, + PRIMARY KEY (id) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS logging; -CREATE TABLE logging -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - time DATETIME, - username VARCHAR(50), - host VARCHAR(40) +CREATE TABLE logging ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + time DATETIME DEFAULT NULL, + username VARCHAR(50) DEFAULT NULL, + host VARCHAR(40) DEFAULT NULL, + PRIMARY KEY (id) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; -DROP TABLE IF EXISTS menu; -CREATE TABLE menu -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - href VARCHAR(2000) DEFAULT '' NOT NULL, - title VARCHAR(2000) DEFAULT '' NOT NULL, - newwindow INT(1) unsigned DEFAULT '0' NOT NULL, - tooltip VARCHAR(2000) DEFAULT '' NOT NULL, - role INT(11) unsigned NOT NULL, - ordinal INT(11) unsigned NOT NULL, - menueval VARCHAR(2000) DEFAULT '' NOT NULL + +DROP TABLE IF EXISTS menu_items; +CREATE TABLE menu_items ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + href VARCHAR(2000) NOT NULL DEFAULT '', + title VARCHAR(2000) NOT NULL DEFAULT '', + newwindow INT(1) UNSIGNED NOT NULL DEFAULT '0', + tooltip VARCHAR(2000) NOT NULL DEFAULT '', + role INT(11) UNSIGNED NOT NULL, + ordinal INT(11) UNSIGNED NOT NULL, + menueval VARCHAR(2000) NOT NULL DEFAULT '', + PRIMARY KEY (id), + INDEX ix_role_ordinal (role, ordinal) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1000001; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1000001; + DROP TABLE IF EXISTS missed_parts; -CREATE TABLE missed_parts -( - id INT(16) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - numberid BIGINT(20) unsigned NOT NULL, - group_id INT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'FK to groups', - attempts TINYINT(1) DEFAULT '0' NOT NULL +CREATE TABLE missed_parts ( + id INT(16) UNSIGNED NOT NULL AUTO_INCREMENT, + numberid BIGINT UNSIGNED NOT NULL, + group_id INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to groups.id', + attempts TINYINT(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + INDEX ix_missed_parts_attempts (attempts), + INDEX ix_missed_parts_groupid_attempts (group_id, attempts), + INDEX ix_missed_parts_numberid_groupsid_attempts (numberid, group_id, attempts), + UNIQUE INDEX ix_missed_parts_numberid_groupsid (numberid, group_id) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_partrepair_attempts ON missed_parts (attempts); -CREATE INDEX ix_partrepair_groupid_attempts ON missed_parts (group_id, attempts); -CREATE UNIQUE INDEX ix_partrepair_numberid_groupid ON missed_parts (numberid, group_id); -CREATE INDEX ix_partrepair_numberid_groupid_attempts ON missed_parts (numberid, group_id, attempts); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS movieinfo; -CREATE TABLE movieinfo -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - imdbid MEDIUMINT(7) unsigned zerofill, - tmdbid INT(10) unsigned DEFAULT '0' NOT NULL, - title VARCHAR(255) DEFAULT '' NOT NULL, - tagline VARCHAR(1024) DEFAULT '' NOT NULL, - rating VARCHAR(4) DEFAULT '' NOT NULL, - plot VARCHAR(1024) DEFAULT '' NOT NULL, - year VARCHAR(4) DEFAULT '' NOT NULL, - genre VARCHAR(64) DEFAULT '' NOT NULL, - type VARCHAR(32) DEFAULT '' NOT NULL, - director VARCHAR(64) DEFAULT '' NOT NULL, - actors VARCHAR(2000) DEFAULT '' NOT NULL, - language VARCHAR(64) DEFAULT '' NOT NULL, - cover TINYINT(1) unsigned DEFAULT '0' NOT NULL, - backdrop TINYINT(1) unsigned DEFAULT '0' NOT NULL, - trailer VARCHAR(255), - createddate DATETIME NOT NULL, - updateddate DATETIME NOT NULL, - banner TINYINT(1) unsigned DEFAULT '0' NOT NULL +CREATE TABLE movieinfo ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + imdbid MEDIUMINT(7) UNSIGNED ZEROFILL NOT NULL, + tmdbid INT(10) UNSIGNED NOT NULL DEFAULT 0, + title VARCHAR(255) NOT NULL DEFAULT '', + tagline VARCHAR(1024) NOT NULL DEFAULT '', + rating VARCHAR(4) NOT NULL DEFAULT '', + plot VARCHAR(1024) NOT NULL DEFAULT '', + year VARCHAR(4) NOT NULL DEFAULT '', + genre VARCHAR(64) NOT NULL DEFAULT '', + type VARCHAR(32) NOT NULL DEFAULT '', + director VARCHAR(64) NOT NULL DEFAULT '', + actors VARCHAR(2000) NOT NULL DEFAULT '', + language VARCHAR(64) NOT NULL DEFAULT '', + cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + backdrop TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + createddate DATETIME NOT NULL, + updateddate DATETIME NOT NULL, + trailer VARCHAR(255) NOT NULL DEFAULT '', + PRIMARY KEY (id), + INDEX ix_movieinfo_title (title), + UNIQUE INDEX ix_movieinfo_imdbid (imdbid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX imdbid ON movieinfo (imdbid); -CREATE INDEX ix_movieinfo_title ON movieinfo (title); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS musicinfo; -CREATE TABLE musicinfo -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - title VARCHAR(255) NOT NULL, - asin VARCHAR(128), - url VARCHAR(1000), - salesrank INT(10) unsigned, - artist VARCHAR(255), - publisher VARCHAR(255), - releasedate DATETIME, - review VARCHAR(10000), - year VARCHAR(4), - genreid INT(10), - tracks VARCHAR(3000), - cover TINYINT(1) unsigned DEFAULT '0' NOT NULL, - createddate DATETIME NOT NULL, - updateddate DATETIME NOT NULL +CREATE TABLE musicinfo ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + title VARCHAR(255) NOT NULL, + asin VARCHAR(128) NULL, + url VARCHAR(1000) NULL, + salesrank INT(10) UNSIGNED NULL, + artist VARCHAR(255) NULL, + publisher VARCHAR(255) NULL, + releasedate DATETIME NULL, + review VARCHAR(3000) NULL, + year VARCHAR(4) NOT NULL, + genre_id INT(10) NULL, + tracks VARCHAR(3000) NULL, + cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + createddate DATETIME NOT NULL, + updateddate DATETIME NOT NULL, + PRIMARY KEY (id), + FULLTEXT INDEX ix_musicinfo_artist_title_ft (artist, title), + UNIQUE INDEX ix_musicinfo_asin (asin) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE FULLTEXT INDEX ix_musicinfo_artist_title_ft ON musicinfo (artist, title); -CREATE INDEX ix_musicinfo_title ON musicinfo (title); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + +DROP TABLE IF EXISTS page_contents; +CREATE TABLE page_contents ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + title VARCHAR(255) NOT NULL, + url VARCHAR(2000) NULL, + body TEXT NULL, + metadescription VARCHAR(1000) NOT NULL, + metakeywords VARCHAR(1000) NOT NULL, + contenttype INT NOT NULL, + showinmenu INT NOT NULL, + status INT NOT NULL, + ordinal INT NULL, + role INT NOT NULL DEFAULT '0', + INDEX ix_showinmenu_status_contenttype_role (showinmenu, status, contenttype, role) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1000001; + DROP TABLE IF EXISTS parts; -CREATE TABLE parts -( - binaryid BIGINT(20) unsigned DEFAULT '0' NOT NULL, - messageid VARCHAR(255) DEFAULT '' NOT NULL, - number BIGINT(20) unsigned DEFAULT '0' NOT NULL, - partnumber MEDIUMINT(10) unsigned DEFAULT '0' NOT NULL, - size MEDIUMINT(20) unsigned DEFAULT '0' NOT NULL, - CONSTRAINT `PRIMARY` PRIMARY KEY (binaryid, number) +CREATE TABLE parts ( + binaryid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0', + messageid VARCHAR(255) CHARACTER SET latin1 NOT NULL DEFAULT '', + number BIGINT UNSIGNED NOT NULL DEFAULT '0', + partnumber MEDIUMINT UNSIGNED NOT NULL DEFAULT '0', + size MEDIUMINT UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (binaryid,number) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS predb; -CREATE TABLE predb -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - filename VARCHAR(255) DEFAULT '' NOT NULL, - title VARCHAR(255) DEFAULT '' NOT NULL, - nfo VARCHAR(255), - size VARCHAR(50), - category VARCHAR(255), - predate DATETIME, - source VARCHAR(50) DEFAULT '' NOT NULL, - requestid INT(10) unsigned DEFAULT '0' NOT NULL, - groups_id INT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'FK to groups.id', - nuked TINYINT(1) DEFAULT '0' NOT NULL, - nukereason VARCHAR(255), - files VARCHAR(50), - searched TINYINT(1) DEFAULT '0' NOT NULL +CREATE TABLE predb ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary key', + title VARCHAR(255) NOT NULL DEFAULT '', + nfo VARCHAR(255) NULL, + size VARCHAR(50) NULL, + category VARCHAR(255) NULL, + predate DATETIME DEFAULT NULL, + source VARCHAR(50) NOT NULL DEFAULT '', + requestid INT(10) UNSIGNED NOT NULL DEFAULT '0', + groups_id INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to groups', + nuked TINYINT(1) NOT NULL DEFAULT '0' COMMENT 'Is this pre nuked? 0 no 2 yes 1 un nuked 3 mod nuked', + nukereason VARCHAR(255) NULL COMMENT 'If this pre is nuked, what is the reason?', + files VARCHAR(50) NULL COMMENT 'How many files does this pre have ?', + filename VARCHAR(255) NOT NULL DEFAULT '', + searched TINYINT(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id), + UNIQUE INDEX ix_predb_title (title), + INDEX ix_predb_nfo (nfo), + INDEX ix_predb_predate (predate), + INDEX ix_predb_source (source), + INDEX ix_predb_requestid (requestid, groups_id), + INDEX ix_predb_filename (filename), + INDEX ix_predb_searched (searched) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE FULLTEXT INDEX ft_predb_filename ON predb (filename); -CREATE INDEX ix_predb_category ON predb (category); -CREATE INDEX ix_predb_filename ON predb (filename); -CREATE INDEX ix_predb_nfo ON predb (nfo); -CREATE INDEX ix_predb_predate ON predb (predate); -CREATE INDEX ix_predb_requestid ON predb (requestid, groups_id); -CREATE INDEX ix_predb_searched ON predb (searched); -CREATE INDEX ix_predb_size ON predb (size); -CREATE INDEX ix_predb_source ON predb (source); -CREATE UNIQUE INDEX ix_predb_title ON predb (title); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS predb_hashes; -CREATE TABLE predb_hashes -( - hash VARBINARY(20) PRIMARY KEY NOT NULL, - predb_id INT(11) unsigned NOT NULL COMMENT 'id, of the predb entry, this hash belongs to' +CREATE TABLE predb_hashes ( + predb_id INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'id, of the predb entry, this hash belongs to', + hash VARBINARY(20) NOT NULL DEFAULT '', + PRIMARY KEY (hash) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_unicode_ci; + ENGINE = MYISAM + DEFAULT CHARSET = utf8mb4 + COLLATE = utf8mb4_unicode_ci; + DROP TABLE IF EXISTS predb_imports; -CREATE TABLE predb_imports -( - title VARCHAR(255) DEFAULT '' NOT NULL, - nfo VARCHAR(255), - size VARCHAR(50), - category VARCHAR(255), - predate DATETIME, - source VARCHAR(50) DEFAULT '' NOT NULL, - requestid INT(10) unsigned DEFAULT '0' NOT NULL, - groups_id INT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'FK to groups.id', - nuked TINYINT(1) DEFAULT '0' NOT NULL COMMENT 'Is this pre nuked? 0 no 2 yes 1 un nuked 3 mod nuked', - nukereason VARCHAR(255) COMMENT 'If this pre is nuked, what is the reason?', - files VARCHAR(50) COMMENT 'How many files does this pre have ?', - filename VARCHAR(255) DEFAULT '' NOT NULL, - searched TINYINT(1) DEFAULT '0' NOT NULL, - groupname VARCHAR(255) +CREATE TABLE predb_imports ( + title VARCHAR(255) + COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + nfo VARCHAR(255) + COLLATE utf8_unicode_ci DEFAULT NULL, + size VARCHAR(50) + COLLATE utf8_unicode_ci DEFAULT NULL, + category VARCHAR(255) + COLLATE utf8_unicode_ci DEFAULT NULL, + predate DATETIME DEFAULT NULL, + source VARCHAR(50) + COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + requestid INT(10) UNSIGNED NOT NULL DEFAULT '0', + groups_id INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to groups', + nuked TINYINT(1) NOT NULL DEFAULT '0' COMMENT 'Is this pre nuked? 0 no 2 yes 1 un nuked 3 mod nuked', + nukereason VARCHAR(255) + COLLATE utf8_unicode_ci DEFAULT NULL + COMMENT 'If this pre is nuked, what is the reason?', + files VARCHAR(50) + COLLATE utf8_unicode_ci DEFAULT NULL + COMMENT 'How many files does this pre have ?', + filename VARCHAR(255) + COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + searched TINYINT(1) NOT NULL DEFAULT '0', + groupname VARCHAR(255) + COLLATE utf8_unicode_ci DEFAULT NULL ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; + ENGINE =MYISAM + DEFAULT CHARSET =utf8 + COLLATE =utf8_unicode_ci; -DROP TABLE IF EXISTS release_comments; -CREATE TABLE release_comments -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - sourceid BIGINT(20) unsigned, - gid VARCHAR(32), - cid VARCHAR(32), - releases_id INT(11) NOT NULL COMMENT 'FK to releases.id', - TEXT VARCHAR(255), - isvisible TINYINT(1) DEFAULT '1', - issynced TINYINT(1) DEFAULT '0', - users_id INT(11) unsigned NOT NULL COMMENT 'FK to users.id', - username VARCHAR(50), - createddate DATETIME, - host VARCHAR(40), - shared TINYINT(1) DEFAULT '1' NOT NULL, - shareid VARCHAR(40) DEFAULT '' NOT NULL, - siteid VARCHAR(40) DEFAULT '' NOT NULL, - nzb_guid BINARY(16) DEFAULT '0 ' NOT NULL, - text_hash VARCHAR(32) DEFAULT '' NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_releasecomment_cid ON release_comments (cid); -CREATE INDEX ix_releasecomment_gid ON release_comments (gid); -CREATE INDEX ix_releasecomment_releaseid ON release_comments (releases_id); -CREATE INDEX ix_releasecomment_userid ON release_comments (users_id); -CREATE UNIQUE INDEX ux_text_hash_siteid_nzb_guid ON release_comments (text_hash, siteid, nzb_guid); -CREATE UNIQUE INDEX ux_text_siteid_nzb_guid ON release_comments (TEXT, siteid, nzb_guid); - -DROP TABLE IF EXISTS release_files; -CREATE TABLE release_files -( - releases_id INT(11) NOT NULL COMMENT 'FK to releases.id', - name VARCHAR(255) DEFAULT '' NOT NULL, - size BIGINT(20) unsigned DEFAULT '0' NOT NULL, - ishashed TINYINT(1) DEFAULT '0' NOT NULL, - createddate DATETIME, - passworded TINYINT(1) unsigned DEFAULT '0' NOT NULL, - CONSTRAINT `PRIMARY` PRIMARY KEY (releases_id, name) -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; -CREATE INDEX ix_releasefiles_ishashed ON release_files (ishashed); - -DROP TABLE IF EXISTS release_naming_regexes; -CREATE TABLE release_naming_regexes -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - group_regex VARCHAR(255) DEFAULT '' NOT NULL COMMENT 'This is a regex to match against usenet groups', - regex VARCHAR(2000) NOT NULL, - status TINYINT(1) unsigned DEFAULT '1' NOT NULL COMMENT '1 = ON 0 = OFF', - description VARCHAR(1000), - ordinal INT(11) DEFAULT '0' NOT NULL COMMENT 'Order to run the regex in' -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1000001; -CREATE INDEX ix_release_naming_regexes_group_regex ON release_naming_regexes (group_regex); -CREATE INDEX ix_release_naming_regexes_ordinal ON release_naming_regexes (ordinal); -CREATE INDEX ix_release_naming_regexes_status ON release_naming_regexes (status); - -DROP TABLE IF EXISTS release_unique; -CREATE TABLE release_unique -( - releases_id INT(11) unsigned NOT NULL COMMENT 'FK to releases.id.', - uniqueid BINARY(16) DEFAULT '0 ' NOT NULL COMMENT 'Unique_ID from mediainfo.', - CONSTRAINT `PRIMARY` PRIMARY KEY (releases_id, uniqueid) -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; - -DROP TABLE IF EXISTS releaseextrafull; -CREATE TABLE releaseextrafull -( - releases_id INT(11) PRIMARY KEY NOT NULL COMMENT 'FK to releases.id', - mediainfo TEXT -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; - -DROP TABLE IF EXISTS release_nfos; -CREATE TABLE release_nfos -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - releases_id INT(11) unsigned, - binaryid INT(11) unsigned, - nfo BLOB -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_releasenfo_binaryid ON release_nfos (binaryid); -CREATE UNIQUE INDEX ix_releasenfo_releaseid ON release_nfos (releases_id); DROP TABLE IF EXISTS releases; -CREATE TABLE releases -( - id INT(11) unsigned NOT NULL AUTO_INCREMENT, - gid VARCHAR(32), - name VARCHAR(255) DEFAULT '' NOT NULL, - searchname VARCHAR(255) DEFAULT '' NOT NULL, - totalpart INT(11) DEFAULT '0', - groups_id INT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'FK to groups.id', - size BIGINT(20) unsigned DEFAULT '0' NOT NULL, - postdate DATETIME, - adddate DATETIME, - updatedate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, - guid VARCHAR(50) NOT NULL, - leftguid CHAR(1) NOT NULL COMMENT 'The first letter of the release guid', - fromname VARCHAR(255), - completion FLOAT DEFAULT '0' NOT NULL, - categories_id INT(11) DEFAULT '10' NOT NULL, - videos_id MEDIUMINT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'FK to videos.id of the parent series.', - tv_episodes_id MEDIUMINT(11) DEFAULT '0' NOT NULL COMMENT 'FK to tv_episodes.id of the episode', - imdbid MEDIUMINT(7) unsigned zerofill, - musicinfo_id INT(11) unsigned COMMENT 'FK to musicinfo.id', - consoleinfo_id INT(11) unsigned COMMENT 'FK to consoleinfo.id', - bookinfo_id INT(11) unsigned COMMENT 'FK to bookinfo.id', - anidbid INT(11), - reqid VARCHAR(255), - releasenfoid INT(11), - grabs INT(10) unsigned DEFAULT '0' NOT NULL, - comments INT(11) DEFAULT '0' NOT NULL, - passwordstatus INT(11) DEFAULT '0' NOT NULL, - rarinnerfilecount INT(11) DEFAULT '0' NOT NULL, - haspreview INT(11) DEFAULT '0' NOT NULL, - dehashstatus TINYINT(1) DEFAULT '0' NOT NULL, - nfostatus TINYINT(4) DEFAULT '0' NOT NULL, - jpgstatus TINYINT(1) DEFAULT '0' NOT NULL, - audiostatus TINYINT(1) DEFAULT '0' NOT NULL, - videostatus TINYINT(1) DEFAULT '0' NOT NULL, - reqidstatus TINYINT(1) DEFAULT '0' NOT NULL, - predb_id INT(11) unsigned NOT NULL COMMENT 'id, of the predb entry, this hash belongs to', - iscategorized TINYINT(1) DEFAULT '0' NOT NULL, - isrenamed TINYINT(1) DEFAULT '0' NOT NULL, - ishashed TINYINT(1) DEFAULT '0' NOT NULL, - isrequestid TINYINT(1) DEFAULT '0' NOT NULL, - proc_pp TINYINT(1) DEFAULT '0' NOT NULL, - proc_par2 TINYINT(1) DEFAULT '0' NOT NULL, - proc_nfo TINYINT(1) DEFAULT '0' NOT NULL, - proc_files TINYINT(1) DEFAULT '0' NOT NULL, - proc_uid TINYINT(1) DEFAULT '0' NOT NULL COMMENT 'Has the release been UID processed?', - proc_sorter TINYINT(1) DEFAULT '0' NOT NULL, - gamesinfo_id INT(10) DEFAULT '0' NOT NULL, - xxxinfo_id INT(10) DEFAULT '0' NOT NULL, - nzbstatus TINYINT(1) DEFAULT '0' NOT NULL, - nzb_guid BINARY(16), - CONSTRAINT `PRIMARY` PRIMARY KEY (id, categories_id) +CREATE TABLE releases ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL DEFAULT '', + searchname VARCHAR(255) NOT NULL DEFAULT '', + totalpart INT DEFAULT '0', + groups_id INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to groups.id', + size BIGINT UNSIGNED NOT NULL DEFAULT '0', + postdate DATETIME DEFAULT NULL, + adddate DATETIME DEFAULT NULL, + updatetime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + guid VARCHAR(40) NOT NULL, + leftguid CHAR(1) NOT NULL COMMENT 'The first letter of the release guid', + fromname VARCHAR(255) NULL, + completion FLOAT NOT NULL DEFAULT '0', + categories_id INT NOT NULL DEFAULT '0010', + videos_id MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to videos.id of the parent series.', + tv_episodes_id MEDIUMINT(11) SIGNED NOT NULL DEFAULT '0' COMMENT 'FK to tv_episodes.id for the episode.', + imdbid MEDIUMINT(7) UNSIGNED ZEROFILL NULL, + xxxinfo_id INT SIGNED NOT NULL DEFAULT '0', + musicinfo_id INT(11) SIGNED NULL COMMENT 'FK to musicinfo.id', + consoleinfo_id INT(11) SIGNED NULL COMMENT 'FK to consoleinfo.id', + gamesinfo_id INT SIGNED NOT NULL DEFAULT '0', + bookinfo_id INT(11) SIGNED NULL COMMENT 'FK to bookinfo.id', + anidbid INT NULL COMMENT 'FK to anidb_titles.anidbid', + predb_id INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to predb.id', + grabs INT UNSIGNED NOT NULL DEFAULT '0', + comments INT NOT NULL DEFAULT '0', + passwordstatus TINYINT NOT NULL DEFAULT '0', + rarinnerfilecount INT NOT NULL DEFAULT '0', + haspreview TINYINT NOT NULL DEFAULT '0', + nfostatus TINYINT NOT NULL DEFAULT '0', + jpgstatus TINYINT(1) NOT NULL DEFAULT '0', + videostatus TINYINT(1) NOT NULL DEFAULT '0', + audiostatus TINYINT(1) NOT NULL DEFAULT '0', + dehashstatus TINYINT(1) NOT NULL DEFAULT '0', + reqidstatus TINYINT(1) NOT NULL DEFAULT '0', + nzb_guid BINARY(16) NULL, + nzbstatus TINYINT(1) NOT NULL DEFAULT '0', + iscategorized TINYINT(1) NOT NULL DEFAULT '0', + isrenamed TINYINT(1) NOT NULL DEFAULT '0', + ishashed TINYINT(1) NOT NULL DEFAULT '0', + isrequestid TINYINT(1) NOT NULL DEFAULT '0', + proc_pp TINYINT(1) NOT NULL DEFAULT '0', + proc_sorter TINYINT(1) NOT NULL DEFAULT '0', + proc_par2 TINYINT(1) NOT NULL DEFAULT '0', + proc_nfo TINYINT(1) NOT NULL DEFAULT '0', + proc_files TINYINT(1) NOT NULL DEFAULT '0', + proc_uid TINYINT(1) NOT NULL DEFAULT '0', + PRIMARY KEY (id, categories_id), + INDEX ix_releases_name (name), + INDEX ix_releases_groupsid (groups_id,passwordstatus), + INDEX ix_releases_postdate_searchname (postdate,searchname), + INDEX ix_releases_guid (guid), + INDEX ix_releases_leftguid (leftguid ASC, predb_id), + INDEX ix_releases_nzb_guid (nzb_guid), + INDEX ix_releases_videos_id (videos_id), + INDEX ix_releases_tv_episodes_id (tv_episodes_id), + INDEX ix_releases_imdbid (imdbid), + INDEX ix_releases_xxxinfo_id (xxxinfo_id), + INDEX ix_releases_musicinfo_id (musicinfo_id,passwordstatus), + INDEX ix_releases_consoleinfo_id (consoleinfo_id), + INDEX ix_releases_gamesinfo_id (gamesinfo_id), + INDEX ix_releases_bookinfo_id (bookinfo_id), + INDEX ix_releases_anidbid (anidbid), + INDEX ix_releases_predb_id_searchname (predb_id,searchname), + INDEX ix_releases_haspreview_passwordstatus (haspreview,passwordstatus), + INDEX ix_releases_passwordstatus (passwordstatus), + INDEX ix_releases_nfostatus (nfostatus,size), + INDEX ix_releases_dehashstatus (dehashstatus,ishashed), + INDEX ix_releases_reqidstatus (adddate,reqidstatus,isrequestid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1 - PARTITION BY RANGE (categories_id)( - PARTITION misc VALUES LESS THAN (1000), + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1 + PARTITION BY RANGE (categories_id) ( + PARTITION misc VALUES LESS THAN (1000), PARTITION console VALUES LESS THAN (2000), - PARTITION movies VALUES LESS THAN (3000), - PARTITION audio VALUES LESS THAN (4000), - PARTITION pc VALUES LESS THAN (5000), - PARTITION tv VALUES LESS THAN (6000), - PARTITION xxx VALUES LESS THAN (7000), - PARTITION books VALUES LESS THAN (8000)); -CREATE INDEX ix_releases_anidbid ON releases (anidbid); -CREATE INDEX ix_releases_bookinfoid ON releases (bookinfo_id); -CREATE INDEX ix_releases_consoleinfoid ON releases (consoleinfo_id); -CREATE INDEX ix_releases_dehashstatus ON releases (dehashstatus, ishashed); -CREATE INDEX ix_releases_gamesinfo_id ON releases (gamesinfo_id); -CREATE INDEX ix_releases_gid ON releases (gid); -CREATE INDEX ix_releases_group_id ON releases (groups_id, passwordstatus); -CREATE INDEX ix_releases_guid ON releases (guid); -CREATE INDEX ix_releases_haspreview_passwordstatus ON releases (haspreview, passwordstatus); -CREATE INDEX ix_releases_imdbid ON releases (imdbid); -CREATE INDEX ix_releases_leftguid ON releases (leftguid, predb_id); -CREATE INDEX ix_releases_musicinfoid ON releases (musicinfo_id, passwordstatus); -CREATE INDEX ix_releases_name ON releases (name); -CREATE INDEX ix_releases_nfostatus ON releases (nfostatus, size); -CREATE INDEX ix_releases_nzb_guid ON releases (nzb_guid); -CREATE INDEX ix_releases_passwordstatus ON releases (passwordstatus); -CREATE INDEX ix_releases_postdate_searchname ON releases (postdate, searchname); -CREATE INDEX ix_releases_preid_searchname ON releases (predb_id, searchname); -CREATE INDEX ix_releases_reqidstatus ON releases (adddate, reqidstatus, isrequestid); -CREATE INDEX ix_releases_tv_episodes_id ON releases (tv_episodes_id); -CREATE INDEX ix_releases_videos_id ON releases (videos_id); -CREATE INDEX ix_releases_xxxinfo_id ON releases (xxxinfo_id); + PARTITION movies VALUES LESS THAN (3000), + PARTITION audio VALUES LESS THAN (4000), + PARTITION pc VALUES LESS THAN (5000), + PARTITION tv VALUES LESS THAN (6000), + PARTITION xxx VALUES LESS THAN (7000), + PARTITION books VALUES LESS THAN (9000) + ); + + +DROP TABLE IF EXISTS release_comments; +CREATE TABLE release_comments ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + releases_id INT(11) UNSIGNED NOT NULL COMMENT 'FK to releases.id', + text VARCHAR(2000) NOT NULL DEFAULT '', + text_hash VARCHAR(32) NOT NULL DEFAULT '', + username VARCHAR(255) NOT NULL DEFAULT '', + users_id INT(11) UNSIGNED NOT NULL, + createddate DATETIME DEFAULT NULL, + host VARCHAR(15) NULL, + shared TINYINT(1) NOT NULL DEFAULT '0', + shareid VARCHAR(40) NOT NULL DEFAULT '', + siteid VARCHAR(40) NOT NULL DEFAULT '', + nzb_guid BINARY(16) NOT NULL DEFAULT '0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', + PRIMARY KEY (id), + UNIQUE INDEX ix_release_comments_hash_releases_id(text_hash, releases_id), + INDEX ix_releasecomment_releases_id (releases_id), + INDEX ix_releasecomment_userid (users_id) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + DROP TABLE IF EXISTS release_unique; + CREATE TABLE release_unique ( + releases_id INT(11) UNSIGNED NOT NULL COMMENT 'FK to releases.id.', + uniqueid BINARY(16) NOT NULL DEFAULT '0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' COMMENT 'Unique_ID from mediainfo.', + PRIMARY KEY (releases_id, uniqueid) +) + ENGINE = MyISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + + +DROP TABLE IF EXISTS releaseextrafull; +CREATE TABLE releaseextrafull ( + releases_id INT(11) UNSIGNED NOT NULL COMMENT 'FK to releases.id', + mediainfo TEXT NULL, + PRIMARY KEY (releases_id) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + + +DROP TABLE IF EXISTS release_files; +CREATE TABLE release_files ( + releases_id int(11) unsigned NOT NULL COMMENT 'FK to releases.id', + name varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', + size bigint(20) unsigned NOT NULL DEFAULT '0', + ishashed tinyint(1) NOT NULL DEFAULT '0', + createddate datetime DEFAULT NULL, + passworded tinyint(1) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (releases_id, name), + KEY ix_releasefiles_ishashed (ishashed) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + + +DROP TABLE IF EXISTS release_naming_regexes; +CREATE TABLE release_naming_regexes ( + id INT UNSIGNED NOT NULL AUTO_INCREMENT, + group_regex VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'This is a regex to match against usenet groups', + regex VARCHAR(5000) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Regex used for extracting name from subject', + status TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '1=ON 0=OFF', + description VARCHAR(1000) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'Optional extra details on this regex', + ordinal INT SIGNED NOT NULL DEFAULT '0' COMMENT 'Order to run the regex in', + PRIMARY KEY (id), + INDEX ix_release_naming_regexes_group_regex (group_regex), + INDEX ix_release_naming_regexes_status (status), + INDEX ix_release_naming_regexes_ordinal (ordinal) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 100000; + + +DROP TABLE IF EXISTS release_nfos; +CREATE TABLE release_nfos ( + releases_id INT(11) UNSIGNED NOT NULL COMMENT 'FK to releases.id', + nfo BLOB NULL DEFAULT NULL, + PRIMARY KEY (releases_id) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + DROP TABLE IF EXISTS release_search_data; -CREATE TABLE release_search_data -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - releases_id INT(11) unsigned NOT NULL, - guid VARCHAR(50) NOT NULL, - name VARCHAR(255) DEFAULT '' NOT NULL, - searchname VARCHAR(255) DEFAULT '' NOT NULL, - fromname VARCHAR(255) +CREATE TABLE release_search_data ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + releases_id INT(11) UNSIGNED NOT NULL COMMENT 'FK to releases.id', + guid VARCHAR(50) NOT NULL, + name VARCHAR(255) NOT NULL DEFAULT '', + searchname VARCHAR(255) NOT NULL DEFAULT '', + fromname VARCHAR(255) NULL, + PRIMARY KEY (id), + FULLTEXT INDEX ix_releasesearch_name_ft (name), + FULLTEXT INDEX ix_releasesearch_searchname_ft (searchname), + FULLTEXT INDEX ix_releasesearch_fromname_ft (fromname), + INDEX ix_releasesearch_releases_id (releases_id), + INDEX ix_releasesearch_guid (guid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE FULLTEXT INDEX ix_releasesearch_fromname_ft ON release_search_data (fromname); -CREATE INDEX ix_releasesearch_guid ON release_search_data (guid); -CREATE FULLTEXT INDEX ix_releasesearch_name_ft ON release_search_data (name); -CREATE INDEX ix_releasesearch_releaseid ON release_search_data (releases_id); -CREATE FULLTEXT INDEX ix_releasesearch_searchname_ft ON release_search_data (searchname); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS release_subtitles; -CREATE TABLE release_subtitles -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - releases_id INT(11) unsigned NOT NULL, - subsid INT(2) unsigned NOT NULL, - subslanguage VARCHAR(50) NOT NULL +CREATE TABLE release_subtitles ( + id INT(11) UNSIGNED AUTO_INCREMENT, + releases_id INT(11) UNSIGNED NOT NULL COMMENT 'FK to releases.id', + subsid INT(2) UNSIGNED NOT NULL, + subslanguage VARCHAR(50) NOT NULL, + PRIMARY KEY (id), + UNIQUE INDEX ix_releasesubs_releases_id_subsid (releases_id, subsid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX releaseid ON release_subtitles (releases_id, subsid); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; -DROP TABLE IF EXISTS roleexcat; -CREATE TABLE roleexcat -( - id INT(16) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - role INT(11) NOT NULL, - categories_id INT(11), - createddate DATETIME NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX ix_roleexcat_rolecat ON roleexcat (role, categories_id); DROP TABLE IF EXISTS settings; -CREATE TABLE settings -( - setting VARCHAR(64) NOT NULL, - value VARCHAR(19000), - updateddate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, - section VARCHAR(25) DEFAULT '' NOT NULL, - subsection VARCHAR(25) DEFAULT '' NOT NULL, - name VARCHAR(25) DEFAULT '' NOT NULL, - hint TEXT NOT NULL, - CONSTRAINT `PRIMARY` PRIMARY KEY (section, subsection, name) +CREATE TABLE settings ( + section VARCHAR(25) NOT NULL DEFAULT '', + subsection VARCHAR(25) NOT NULL DEFAULT '', + name VARCHAR(25) NOT NULL DEFAULT '', + value VARCHAR(1000) NOT NULL DEFAULT '', + hint TEXT NOT NULL, + setting VARCHAR(64) NOT NULL DEFAULT '', + PRIMARY KEY (section, subsection, name), + UNIQUE KEY ui_settings_setting (setting) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; -CREATE UNIQUE INDEX ui_settings_setting ON settings (setting); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + DROP TABLE IF EXISTS sharing; -CREATE TABLE sharing -( - site_guid VARCHAR(40) PRIMARY KEY NOT NULL, - site_name VARCHAR(255) DEFAULT '' NOT NULL, - enabled TINYINT(1) DEFAULT '0' NOT NULL, - posting TINYINT(1) DEFAULT '0' NOT NULL, - start_position TINYINT(1) DEFAULT '0' NOT NULL, - fetching TINYINT(1) DEFAULT '1' NOT NULL, - auto_enable TINYINT(1) DEFAULT '1' NOT NULL, - hide_users TINYINT(1) DEFAULT '1' NOT NULL, - last_article BIGINT(20) unsigned DEFAULT '0' NOT NULL, - max_push MEDIUMINT(8) unsigned DEFAULT '40' NOT NULL, - max_pull INT(10) unsigned DEFAULT '200' NOT NULL, - max_download MEDIUMINT(8) unsigned DEFAULT '150' NOT NULL +CREATE TABLE sharing ( + site_guid VARCHAR(40) NOT NULL DEFAULT '', + site_name VARCHAR(255) NOT NULL DEFAULT '', + username VARCHAR(255) NOT NULL DEFAULT '', + enabled TINYINT(1) NOT NULL DEFAULT '0', + posting TINYINT(1) NOT NULL DEFAULT '0', + fetching TINYINT(1) NOT NULL DEFAULT '1', + auto_enable TINYINT(1) NOT NULL DEFAULT '1', + start_position TINYINT(1) NOT NULL DEFAULT '0', + hide_users TINYINT(1) NOT NULL DEFAULT '1', + last_article BIGINT UNSIGNED NOT NULL DEFAULT '0', + max_push MEDIUMINT UNSIGNED NOT NULL DEFAULT '40', + max_download MEDIUMINT UNSIGNED NOT NULL DEFAULT '150', + max_pull MEDIUMINT UNSIGNED NOT NULL DEFAULT '20000', + PRIMARY KEY (site_guid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + DROP TABLE IF EXISTS sharing_sites; -CREATE TABLE sharing_sites -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - site_name VARCHAR(255) DEFAULT '' NOT NULL, - site_guid VARCHAR(40) DEFAULT '' NOT NULL, - last_time DATETIME, - first_time DATETIME, - enabled TINYINT(1) DEFAULT '0' NOT NULL, - comments MEDIUMINT(8) unsigned DEFAULT '0' NOT NULL +CREATE TABLE sharing_sites ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + site_name VARCHAR(255) NOT NULL DEFAULT '', + site_guid VARCHAR(40) NOT NULL DEFAULT '', + last_time DATETIME DEFAULT NULL, + first_time DATETIME DEFAULT NULL, + enabled TINYINT(1) NOT NULL DEFAULT '0', + comments MEDIUMINT UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (id) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS short_groups; -CREATE TABLE short_groups -( - id INT(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, - name VARCHAR(255) DEFAULT '' NOT NULL, - first_record BIGINT(20) unsigned DEFAULT '0' NOT NULL, - last_record BIGINT(20) unsigned DEFAULT '0' NOT NULL, - updated DATETIME +CREATE TABLE short_groups ( + id INT(11) NOT NULL AUTO_INCREMENT, + name VARCHAR(255) NOT NULL DEFAULT '', + first_record BIGINT UNSIGNED NOT NULL DEFAULT '0', + last_record BIGINT UNSIGNED NOT NULL DEFAULT '0', + updated DATETIME DEFAULT NULL, + PRIMARY KEY (id), + INDEX ix_shortgroups_name (name) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_shortgroups_id ON short_groups (id); -CREATE INDEX ix_shortgroups_name ON short_groups (name); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; -DROP TABLE IF EXISTS sphinx; - -DROP TABLE IF EXISTS spotnabsources; -CREATE TABLE spotnabsources -( - id BIGINT(20) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - username VARCHAR(64) DEFAULT 'nntp' NOT NULL, - useremail VARCHAR(128) DEFAULT 'spot@nntp.com' NOT NULL, - usenetgroup VARCHAR(64) DEFAULT 'alt.binaries.backup' NOT NULL, - publickey VARCHAR(512) NOT NULL, - active TINYINT(1) DEFAULT '0' NOT NULL, - description VARCHAR(255) DEFAULT '', - lastupdate DATETIME, - lastbroadcast DATETIME, - lastarticle BIGINT(20) unsigned DEFAULT '0' NOT NULL, - dateadded DATETIME -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX spotnabsources_ix1 ON spotnabsources (username, useremail, usenetgroup); DROP TABLE IF EXISTS tmux; -CREATE TABLE tmux -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - setting VARCHAR(64) NOT NULL, - value VARCHAR(19000), - updateddate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +CREATE TABLE tmux ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + setting VARCHAR(64) NOT NULL, + value VARCHAR(19000) DEFAULT NULL, + updateddate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (id), + UNIQUE INDEX ix_tmux_setting (setting) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX setting ON tmux (setting); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; DROP TABLE IF EXISTS tv_episodes; -CREATE TABLE tv_episodes -( - id INT(11) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - videos_id MEDIUMINT(11) unsigned NOT NULL COMMENT 'FK to videos.id of the parent series.', - series SMALLINT(5) unsigned DEFAULT '0' NOT NULL COMMENT 'Number of series/season.', - episode SMALLINT(5) unsigned DEFAULT '0' NOT NULL COMMENT 'Number of episode within series', - se_complete VARCHAR(10) NOT NULL COMMENT 'String version of Series/Episode as taken from release subject (i.e. S02E21+22).', - title VARCHAR(180) NOT NULL COMMENT 'Title of the episode.', - firstaired DATE, - summary TEXT NOT NULL COMMENT 'Description/summary of the episode.' +CREATE TABLE tv_episodes ( + id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, + videos_id MEDIUMINT(11) UNSIGNED NOT NULL COMMENT 'FK to videos.id of the parent series.', + series SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Number of series/season.', + episode SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Number of episode within series', + se_complete VARCHAR(10) COLLATE utf8_unicode_ci NOT NULL COMMENT 'String version of Series/Episode as taken from release subject (i.e. S02E21+22).', + title VARCHAR(180) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Title of the episode.', + firstaired DATE NOT NULL COMMENT 'Date of original airing/release.', + summary TEXT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Description/summary of the episode.', + PRIMARY KEY (id), + UNIQUE KEY (videos_id, series, episode, firstaired) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ux_videoid_series_episode_aired ON tv_episodes (videos_id, series, episode, firstaired); + ENGINE = MyISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; DROP TABLE IF EXISTS tv_info; -CREATE TABLE tv_info -( - videos_id MEDIUMINT(11) unsigned PRIMARY KEY NOT NULL COMMENT 'FK to video.id', - summary TEXT NOT NULL COMMENT 'Description/summary of the show.', - publisher VARCHAR(50) NOT NULL COMMENT 'The channel/network of production/release (ABC, BBC, Showtime, etc.).', - localzone VARCHAR(50) DEFAULT '' NOT NULL COMMENT 'The linux tz style identifier', - image TINYINT(1) unsigned DEFAULT '0' NOT NULL COMMENT 'Does the video have a cover image?' +CREATE TABLE tv_info ( + videos_id MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'FK to video.id', + summary TEXT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Description/summary of the show.', + publisher VARCHAR(50) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The channel/network of production/release (ABC, BBC, Showtime, etc.).', + localzone VARCHAR(50) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'The linux tz style identifier', + image TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Does the video have a cover image?', + PRIMARY KEY (videos_id), + KEY ix_tv_info_image (image) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; -CREATE INDEX ix_tv_info_image ON tv_info (image); + ENGINE = MyISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; DROP TABLE IF EXISTS upcoming_releases; -CREATE TABLE upcoming_releases -( - id INT(10) PRIMARY KEY NOT NULL AUTO_INCREMENT, - source VARCHAR(20) NOT NULL, - typeid INT(10), - info TEXT, - updateddate TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL +CREATE TABLE upcoming_releases ( + id INT(10) NOT NULL AUTO_INCREMENT, + source VARCHAR(20) NOT NULL, + typeid INT(10) NOT NULL, + info TEXT NULL, + updateddate TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (id), + UNIQUE INDEX ix_upcoming_source (source, typeid) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX source ON upcoming_releases (source, typeid); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; -DROP TABLE IF EXISTS user_downloads; -CREATE TABLE user_downloads -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - users_id INT(11) unsigned NOT NULL COMMENT 'FK to users.id', - hosthash VARCHAR(50), - TIMESTAMP DATETIME NOT NULL, - releases_id INT(11) NOT NULL COMMENT 'FK to releases.id' -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX hosthash ON user_downloads (hosthash); -CREATE INDEX releaseid ON user_downloads (releases_id); -CREATE INDEX TIMESTAMP ON user_downloads (TIMESTAMP); -CREATE INDEX userid ON user_downloads (users_id); - -DROP TABLE IF EXISTS user_excluded_categories; -CREATE TABLE user_excluded_categories -( - id INT(16) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - users_id INT(11), - categories_id INT(11) NOT NULL, - createddate DATETIME NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX ix_userexcat_usercat ON user_excluded_categories (users_id, categories_id); - -DROP TABLE IF EXISTS user_movies; -CREATE TABLE user_movies -( - id INT(16) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - users_id INT(11) unsigned NOT NULL COMMENT 'FK to users.id', - imdbid MEDIUMINT(7) unsigned zerofill, - categories VARCHAR(64) COMMENT 'List of categories for user movies', - createddate DATETIME NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_usermovies_userid ON user_movies (users_id, imdbid); - -DROP TABLE IF EXISTS user_requests; -CREATE TABLE user_requests -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - users_id INT(11) unsigned NOT NULL COMMENT 'FK to users.id', - request VARCHAR(255) NOT NULL, - hosthash VARCHAR(50), - TIMESTAMP DATETIME NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX hosthash ON user_requests (hosthash); -CREATE INDEX TIMESTAMP ON user_requests (TIMESTAMP); -CREATE INDEX userid ON user_requests (users_id); - -DROP TABLE IF EXISTS user_roles; -CREATE TABLE user_roles -( - id INT(10) PRIMARY KEY NOT NULL AUTO_INCREMENT, - name VARCHAR(32) NOT NULL, - apirequests INT(10) unsigned NOT NULL, - downloadrequests INT(10) unsigned NOT NULL, - defaultinvites INT(10) unsigned NOT NULL, - isdefault TINYINT(1) unsigned DEFAULT '0' NOT NULL, - canpreview TINYINT(1) unsigned DEFAULT '0' NOT NULL, - canpre TINYINT(1) unsigned DEFAULT '0' NOT NULL, - hideads TINYINT(1) unsigned DEFAULT '0' NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 4; - -DROP TABLE IF EXISTS user_series; -CREATE TABLE user_series -( - id INT(16) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - users_id INT(11) unsigned NOT NULL COMMENT 'FK to users.id', - videos_id INT(16) NOT NULL COMMENT 'FK to videos.id', - categories VARCHAR(64) COMMENT 'List of categories for users tv shows', - createddate DATETIME NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_userseries_videos_id ON user_series (users_id, videos_id); - -DROP TABLE IF EXISTS usercart; -DROP TABLE IF EXISTS users_releases; -CREATE TABLE users_releases -( - id INT(16) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - users_id INT(11), - releases_id INT(11), - createddate DATETIME NOT NULL -) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE UNIQUE INDEX ix_usercart_userrelease ON users_releases (users_id, releases_id); DROP TABLE IF EXISTS users; -CREATE TABLE users -( - id INT(16) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - username VARCHAR(50) NOT NULL, - email VARCHAR(255) NOT NULL, - password VARCHAR(255) NOT NULL, - role INT(11) DEFAULT '1' NOT NULL, - host VARCHAR(40), - grabs INT(11) DEFAULT '0' NOT NULL, - rsstoken VARCHAR(32) NOT NULL, - createddate DATETIME NOT NULL, - resetguid VARCHAR(50), - lastlogin DATETIME, - apiaccess DATETIME, - invites INT(11) DEFAULT '0' NOT NULL, - invitedby INT(11), - movieview INT(11) DEFAULT '1' NOT NULL, - musicview INT(11) DEFAULT '0' NOT NULL, - consoleview INT(11) DEFAULT '0' NOT NULL, - xxxview INT(11), - gameview INT(11), - bookview INT(11) DEFAULT '0' NOT NULL, - saburl VARCHAR(255), - sabapikey VARCHAR(255), - sabapikeytype TINYINT(1), - sabpriority TINYINT(1), - nzbgeturl VARCHAR(255), - nzbgetusername VARCHAR(255), - nzbgetpassword VARCHAR(255), - userseed VARCHAR(50) NOT NULL, - notes VARCHAR(255), - rolechangedate DATETIME, - nzbvortex_api_key VARCHAR(10), - nzbvortex_server_url VARCHAR(255), - cp_api VARCHAR(255), - cp_url VARCHAR(255), - queuetype TINYINT(1) DEFAULT '1' NOT NULL, - style VARCHAR(255) +CREATE TABLE users ( + id INT(16) UNSIGNED NOT NULL AUTO_INCREMENT, + username VARCHAR(50) NOT NULL, + firstname VARCHAR(255) DEFAULT NULL, + lastname VARCHAR(255) DEFAULT NULL, + email VARCHAR(255) NOT NULL, + password VARCHAR(255) NOT NULL, + role INT NOT NULL DEFAULT '1', + host VARCHAR(40) NULL, + grabs INT NOT NULL DEFAULT '0', + rsstoken VARCHAR(32) NOT NULL, + createddate DATETIME NOT NULL, + resetguid VARCHAR(50) NULL, + lastlogin DATETIME DEFAULT NULL, + apiaccess DATETIME DEFAULT NULL, + invites INT NOT NULL DEFAULT '0', + invitedby INT NULL, + movieview INT NOT NULL DEFAULT '1', + xxxview INT NOT NULL DEFAULT '1', + musicview INT NOT NULL DEFAULT '1', + consoleview INT NOT NULL DEFAULT '1', + bookview INT NOT NULL DEFAULT '1', + gameview INT NOT NULL DEFAULT 1, + saburl VARCHAR(255) NULL DEFAULT NULL, + sabapikey VARCHAR(255) NULL DEFAULT NULL, + sabapikeytype TINYINT(1) NULL DEFAULT NULL, + sabpriority TINYINT(1) NULL DEFAULT NULL, + queuetype TINYINT(1) NOT NULL DEFAULT '1' + COMMENT 'Type of queue, Sab or NZBGet', + nzbgeturl VARCHAR(255) NULL DEFAULT NULL, + nzbgetusername VARCHAR(255) NULL DEFAULT NULL, + nzbgetpassword VARCHAR(255) NULL DEFAULT NULL, + userseed VARCHAR(50) NOT NULL, + cp_url VARCHAR(255) NULL DEFAULT NULL, + cp_api VARCHAR(255) NULL DEFAULT NULL, + style VARCHAR(255) NULL DEFAULT NULL, + PRIMARY KEY (id), + INDEX ix_role (role) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + +DROP TABLE IF EXISTS users_releases; +CREATE TABLE users_releases ( + id INT(16) UNSIGNED NOT NULL AUTO_INCREMENT, + users_id INT NOT NULL, + releases_id INT NOT NULL COMMENT 'FK to releases.id', + createddate DATETIME NOT NULL, + PRIMARY KEY (id), + UNIQUE INDEX ix_usercart_userrelease (users_id, releases_id) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + +DROP TABLE IF EXISTS user_downloads; +CREATE TABLE user_downloads ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + users_id INT(16) NOT NULL, + timestamp DATETIME NOT NULL, + PRIMARY KEY (id), + KEY userid (users_id), + KEY timestamp (timestamp) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + +DROP TABLE IF EXISTS user_excluded_categories; +CREATE TABLE user_excluded_categories ( + id INT(16) UNSIGNED NOT NULL AUTO_INCREMENT, + users_id INT NOT NULL, + categories_id INT NOT NULL, + createddate DATETIME NOT NULL, + PRIMARY KEY (id), + UNIQUE INDEX ix_userexcat_usercat (users_id, categories_id) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + +DROP TABLE IF EXISTS user_movies; +CREATE TABLE user_movies ( + id INT(16) UNSIGNED NOT NULL AUTO_INCREMENT, + users_id INT(16) NOT NULL, + imdbid MEDIUMINT(7) UNSIGNED ZEROFILL NULL, + categories VARCHAR(64) NULL DEFAULT NULL COMMENT 'List of categories for user movies', + createddate DATETIME NOT NULL, + PRIMARY KEY (id), + INDEX ix_usermovies_userid (users_id, imdbid) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + +DROP TABLE IF EXISTS user_requests; +CREATE TABLE user_requests ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + users_id INT(16) NOT NULL, + request VARCHAR(255) NOT NULL, + timestamp DATETIME NOT NULL, + PRIMARY KEY (id), + KEY userid (users_id), + KEY timestamp (timestamp) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + +DROP TABLE IF EXISTS user_roles; +CREATE TABLE user_roles ( + id INT(10) NOT NULL AUTO_INCREMENT, + name VARCHAR(32) NOT NULL, + apirequests INT(10) UNSIGNED NOT NULL, + downloadrequests INT(10) UNSIGNED NOT NULL, + defaultinvites INT(10) UNSIGNED NOT NULL, + isdefault TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + canpreview TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (id) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 4; + + +DROP TABLE IF EXISTS user_series; +CREATE TABLE user_series ( + id INT(16) UNSIGNED NOT NULL AUTO_INCREMENT, + users_id INT(16) NOT NULL, + videos_id INT(16) NOT NULL COMMENT 'FK to videos.id', + categories VARCHAR(64) NULL DEFAULT NULL COMMENT 'List of categories for user tv shows', + createddate DATETIME NOT NULL, + PRIMARY KEY (id), + INDEX ix_userseries_videos_id (users_id, videos_id) +) + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + DROP TABLE IF EXISTS video_data; -CREATE TABLE video_data -( - releases_id INT(11) PRIMARY KEY NOT NULL COMMENT 'FK to releases.id', - containerformat VARCHAR(255), - overallbitrate VARCHAR(255), - videoduration VARCHAR(255), - videoformat VARCHAR(255), - videocodec VARCHAR(255), - videowidth INT(10), - videoheight INT(10), - videoaspect VARCHAR(255), - videoframerate FLOAT(7,4), - videolibrary VARCHAR(255), - definition INT(10) +CREATE TABLE video_data ( + releases_id INT(11) UNSIGNED NOT NULL COMMENT 'FK to releases.id', + containerformat VARCHAR(50) DEFAULT NULL, + overallbitrate VARCHAR(20) DEFAULT NULL, + videoduration VARCHAR(20) DEFAULT NULL, + videoformat VARCHAR(50) DEFAULT NULL, + videocodec VARCHAR(50) DEFAULT NULL, + videowidth INT(10) DEFAULT NULL, + videoheight INT(10) DEFAULT NULL, + videoaspect VARCHAR(10) DEFAULT NULL, + videoframerate FLOAT(7, 4) DEFAULT NULL, + videolibrary VARCHAR(50) DEFAULT NULL, + PRIMARY KEY (releases_id) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci; + DROP TABLE IF EXISTS videos; -CREATE TABLE videos -( - id MEDIUMINT(11) unsigned PRIMARY KEY NOT NULL COMMENT 'Show ID to be used in other tables as reference.' AUTO_INCREMENT, - type TINYINT(1) unsigned DEFAULT '0' NOT NULL COMMENT '0 = TV, 1 = Film, 2 = Anime', - title VARCHAR(180) NOT NULL COMMENT 'Name of the video.', - countries_id CHAR(2) DEFAULT '' NOT NULL COMMENT 'Two character country code (FK to countries table).', - started DATETIME NOT NULL COMMENT 'Date (UTC) of productions first airing.', - anidb MEDIUMINT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'ID number for anidb site', - imdb MEDIUMINT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'ID number for IMDB site (without the 'tt' prefix).', - tmdb MEDIUMINT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'ID number for TMDB site.', - trakt MEDIUMINT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'ID number for TraktTV site.', - tvdb MEDIUMINT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'ID number for TVDB site', - tvmaze MEDIUMINT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'ID number for TVMaze site.', - tvrage MEDIUMINT(11) unsigned DEFAULT '0' NOT NULL COMMENT 'ID number for TVRage site.', - source TINYINT(1) unsigned DEFAULT '0' NOT NULL COMMENT 'Which site did we use for info?' +CREATE TABLE videos ( + id MEDIUMINT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Show\'s ID to be used in other tables as reference.', + type TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '0 = TV, 1 = Film, 2 = Anime', + title VARCHAR(180) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Name of the video.', + countries_id CHAR(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'Two character country code (FK to countries table).', + started DATETIME NOT NULL COMMENT 'Date (UTC) of production''s first airing.', + anidb MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'ID number for anidb site', + imdb MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'ID number for IMDB site (without the ''tt'' prefix).', + tmdb MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'ID number for TMDB site.', + trakt MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'ID number for TraktTV site.', + tvdb MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'ID number for TVDB site', + tvmaze MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'ID number for TVMaze site.', + tvrage MEDIUMINT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'ID number for TVRage site.', + source TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Which site did we use for info?', + PRIMARY KEY (id), + UNIQUE KEY ix_videos_title (title, type, started, countries_id), + KEY ix_videos_imdb (imdb), + KEY ix_videos_tmdb (tmdb), + KEY ix_videos_trakt (trakt), + KEY ix_videos_tvdb (tvdb), + KEY ix_videos_tvmaze (tvmaze), + KEY ix_videos_tvrage (tvrage), + KEY ix_videos_type_source (type, source) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_videos_imdb ON videos (imdb); -CREATE UNIQUE INDEX ix_videos_title ON videos (title, type, started, countries_id); -CREATE INDEX ix_videos_tmdb ON videos (tmdb); -CREATE INDEX ix_videos_trakt ON videos (trakt); -CREATE INDEX ix_videos_tvdb ON videos (tvdb); -CREATE INDEX ix_videos_tvmaze ON videos (tvmaze); -CREATE INDEX ix_videos_tvrage ON videos (tvrage); -CREATE INDEX ix_videos_type_source ON videos (type, source); + ENGINE = MyISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 10000000; DROP TABLE IF EXISTS videos_aliases; -CREATE TABLE videos_aliases -( - videos_id MEDIUMINT(11) unsigned NOT NULL COMMENT 'FK to videos.id of the parent title.', - title VARCHAR(180) NOT NULL COMMENT 'AKA of the video.', - CONSTRAINT `PRIMARY` PRIMARY KEY (videos_id, title) +CREATE TABLE videos_aliases ( + videos_id MEDIUMINT(11) UNSIGNED NOT NULL COMMENT 'FK to videos.id of the parent title.', + title VARCHAR(180) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'AKA of the video.', + PRIMARY KEY (videos_id, title) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci; + ENGINE = MyISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 10000000; DROP TABLE IF EXISTS xxxinfo; -CREATE TABLE xxxinfo -( - id INT(10) unsigned PRIMARY KEY NOT NULL AUTO_INCREMENT, - title VARCHAR(255) NOT NULL, - tagline VARCHAR(1024) NOT NULL, - plot BLOB, - genre VARCHAR(64) NOT NULL, - director VARCHAR(64), - actors VARCHAR(2000) NOT NULL, - extras TEXT, - productinfo TEXT, - trailers TEXT, - directurl VARCHAR(2000) NOT NULL, - classused VARCHAR(4) DEFAULT 'ade', - cover TINYINT(1) unsigned DEFAULT '0' NOT NULL, - backdrop TINYINT(1) unsigned DEFAULT '0' NOT NULL, - createddate DATETIME NOT NULL, - updateddate DATETIME NOT NULL +CREATE TABLE xxxinfo ( + id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + title VARCHAR(255) NOT NULL, + tagline VARCHAR(1024) NOT NULL, + plot BLOB NULL DEFAULT NULL, + genre VARCHAR(64) NOT NULL, + director VARCHAR(64) DEFAULT NULL, + actors VARCHAR(2500) NOT NULL, + extras TEXT DEFAULT NULL, + productinfo TEXT DEFAULT NULL, + trailers TEXT DEFAULT NULL, + directurl VARCHAR(2000) NOT NULL, + classused VARCHAR(4) NOT NULL DEFAULT 'ade', + cover TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + backdrop TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', + createddate DATETIME NOT NULL, + updateddate DATETIME NOT NULL, + PRIMARY KEY (id), + UNIQUE INDEX ix_xxxinfo_title (title) ) - ENGINE = MyISAM - DEFAULT CHARSET = utf8 - COLLATE = utf8_unicode_ci - AUTO_INCREMENT = 1; -CREATE INDEX ix_xxxinfo_title ON xxxinfo (title); + ENGINE = MYISAM + DEFAULT CHARSET = utf8 + COLLATE = utf8_unicode_ci + AUTO_INCREMENT = 1; + + DELIMITER $$ CREATE TRIGGER check_insert BEFORE INSERT ON releases FOR EACH ROW - BEGIN - IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' - THEN SET NEW.ishashed = 1; - ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\s?\\[' - THEN SET NEW.isrequestid = 1; - END IF; - END; $$ + BEGIN + IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' + THEN SET NEW.ishashed = 1; + ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\s?\\[' + THEN SET NEW.isrequestid = 1; + END IF; + END; $$ CREATE TRIGGER check_update BEFORE UPDATE ON releases FOR EACH ROW - BEGIN - IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' - THEN SET NEW.ishashed = 1; - ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\s?\\[' - THEN SET NEW.isrequestid = 1; - END IF; - END; $$ + BEGIN + IF NEW.searchname REGEXP '[a-fA-F0-9]{32}' OR NEW.name REGEXP '[a-fA-F0-9]{32}' + THEN SET NEW.ishashed = 1; + ELSEIF NEW.name REGEXP '^\\[ ?([[:digit:]]{4,6}) ?\\]|^REQ\\s*([[:digit:]]{4,6})|^([[:digit:]]{4,6})-[[:digit:]]{1}\\s?\\[' + THEN SET NEW.isrequestid = 1; + END IF; + END; $$ CREATE TRIGGER check_rfinsert BEFORE INSERT ON release_files FOR EACH ROW - BEGIN - IF NEW.name REGEXP '[a-fA-F0-9]{32}' - THEN SET NEW.ishashed = 1; - END IF; - END; $$ + BEGIN + IF NEW.name REGEXP '[a-fA-F0-9]{32}' + THEN SET NEW.ishashed = 1; + END IF; + END; $$ CREATE TRIGGER check_rfupdate BEFORE UPDATE ON release_files FOR EACH ROW - BEGIN - IF NEW.name REGEXP '[a-fA-F0-9]{32}' - THEN SET NEW.ishashed = 1; - END IF; - END; $$ + BEGIN + IF NEW.name REGEXP '[a-fA-F0-9]{32}' + THEN SET NEW.ishashed = 1; + END IF; + END; $$ CREATE TRIGGER insert_search AFTER INSERT ON releases FOR EACH ROW - BEGIN - INSERT INTO release_search_data (releases_id, guid, name, searchname, fromname) VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname, NEW.fromname); - END; $$ + BEGIN + INSERT INTO release_search_data (releases_id, guid, name, searchname, fromname) VALUES (NEW.id, NEW.guid, NEW.name, NEW.searchname, NEW.fromname); + END; $$ CREATE TRIGGER update_search AFTER UPDATE ON releases FOR EACH ROW - BEGIN - IF NEW.guid != OLD.guid - THEN UPDATE release_search_data SET guid = NEW.guid WHERE releases_id = OLD.id; - END IF; - IF NEW.name != OLD.name - THEN UPDATE release_search_data SET name = NEW.name WHERE releases_id = OLD.id; - END IF; - IF NEW.searchname != OLD.searchname - THEN UPDATE release_search_data SET searchname = NEW.searchname WHERE releases_id = OLD.id; - END IF; - IF NEW.fromname != OLD.fromname - THEN UPDATE release_search_data SET fromname = NEW.fromname WHERE releases_id = OLD.id; - END IF; - END; $$ + BEGIN + IF NEW.guid != OLD.guid + THEN UPDATE release_search_data SET guid = NEW.guid WHERE releases_id = OLD.id; + END IF; + IF NEW.name != OLD.name + THEN UPDATE release_search_data SET name = NEW.name WHERE releases_id = OLD.id; + END IF; + IF NEW.searchname != OLD.searchname + THEN UPDATE release_search_data SET searchname = NEW.searchname WHERE releases_id = OLD.id; + END IF; + IF NEW.fromname != OLD.fromname + THEN UPDATE release_search_data SET fromname = NEW.fromname WHERE releases_id = OLD.id; + END IF; + END; $$ CREATE TRIGGER delete_search AFTER DELETE ON releases FOR EACH ROW - BEGIN - DELETE FROM release_search_data WHERE releases_id = OLD.id; - END; $$ + BEGIN + DELETE FROM release_search_data WHERE releases_id = OLD.id; + END; $$ CREATE TRIGGER insert_hashes AFTER INSERT ON predb FOR EACH ROW - BEGIN - INSERT INTO predb_hashes (hash, predb_id) VALUES (UNHEX(MD5(NEW.title)), NEW.id), (UNHEX(MD5 - (MD5(NEW.title))), NEW.id), ( UNHEX(SHA1(NEW.title)), NEW.id); - END; $$ + BEGIN + INSERT INTO predb_hashes (hash, predb_id) VALUES (UNHEX(MD5(NEW.title)), NEW.id), (UNHEX(MD5 + (MD5(NEW.title))), NEW.id), ( UNHEX(SHA1(NEW.title)), NEW.id); + END; $$ CREATE TRIGGER update_hashes AFTER UPDATE ON predb FOR EACH ROW - BEGIN - IF NEW.title != OLD.title - THEN - DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; - INSERT INTO predb_hashes (hash, predb_id) VALUES ( UNHEX(MD5(NEW.title)), NEW.id ), ( UNHEX(MD5(MD5(NEW.title))), NEW.id ), ( UNHEX(SHA1(NEW.title)), NEW.id ); - END IF; - END; $$ + BEGIN + IF NEW.title != OLD.title + THEN + DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; + INSERT INTO predb_hashes (hash, predb_id) VALUES ( UNHEX(MD5(NEW.title)), NEW.id ), ( UNHEX(MD5(MD5(NEW.title))), NEW.id ), ( UNHEX(SHA1(NEW.title)), NEW.id ); + END IF; + END; $$ CREATE TRIGGER delete_hashes AFTER DELETE ON predb FOR EACH ROW - BEGIN - DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; - END; $$ + BEGIN + DELETE FROM predb_hashes WHERE hash IN ( UNHEX(md5(OLD.title)), UNHEX(md5(md5(OLD.title))), UNHEX(sha1(OLD.title)) ) AND predb_id = OLD.id; + END; $$ CREATE TRIGGER insert_MD5 BEFORE INSERT ON release_comments FOR EACH ROW - SET + SET NEW.text_hash = MD5(NEW.text); -$$ + $$ DELIMITER ; diff --git a/www/install/.gitignore b/www/install/.gitignore new file mode 100755 index 000000000..4c836fc61 --- /dev/null +++ b/www/install/.gitignore @@ -0,0 +1 @@ +install.lock diff --git a/www/install/config.php.tpl b/www/install/config.php.tpl new file mode 100755 index 000000000..2720d2e0d --- /dev/null +++ b/www/install/config.php.tpl @@ -0,0 +1,40 @@ +isLocked()) { + $cfg->error = true; +} + +$cfg->cacheCheck = is_writable(nZEDb_RES . 'smarty' . DS . 'templates_c'); +if ($cfg->cacheCheck === false) { + $cfg->error = true; +} + +if (!$cfg->error) { + $cfg->setSession(); +} +?> + + + + + + <?php + echo $page_title; + ?> + + + + + +

+ +

+ +
+

Index Usenet. Now.

+ +

Welcome to NNTmux.

+

Before getting started, you need to make sure that the server meets the minimum requirements. You will also need...

+
    +
  1. Your database credentials.
  2. +
  3. Your news server credentials.
  4. +
  5. SSH & root ability on your server (in case you need to install missing packages).
  6. +
  7. You should consider copying nntmux/nntmux/config/settings.example.php to + nntmux/nntmux/config/settings.php (Default settngs should be fine for installing).
  8. +
+

+

+ +

WARNING:
+ This software is not practical for use on shared hosting. You should only use this on a server where YOU have the required privileges and knowledge to solve any challenges that might appear. + +

+
+ error) { + ?> +
+ +
+ cacheCheck) { + ?> +
+ The template compile dir must be writable.
A quick solution is to run:
+
Another solution is to run:
chown -R YourUnixUserName:' . $group['name'] . ' ' . nZEDb_ROOT . + '
Then give your user access to the group:
usermod -a -G ' . $group['name'] . ' YourUnixUserName' . + '
Finally give read/write access to your user/group:
chmod -R 774 ' . nZEDb_ROOT; + } + ?> +
+ +
Installation Locked! If reinstalling, please remove www/install/install.lock.
+ +
+ + +
+ + diff --git a/www/install/install.php b/www/install/install.php new file mode 100644 index 000000000..32e2a5c51 --- /dev/null +++ b/www/install/install.php @@ -0,0 +1,42 @@ +. + * @author niel + * @copyright 2015 nZEDb + */ + +if (!defined('nZEDb_INSTALLER')) { + define('nZEDb_INSTALLER', true); +} +require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'bootstrap.php'); + +use nntmux\config\Configure; + +$config = new Configure('install'); + +// Path to smarty files. (not prefixed with NNtmux as the name is needed in smarty files). +define('SMARTY_DIR', NN_ROOT . 'app' . DS . 'libraries' . DS . 'smarty' . DS . 'smarty' . DS . 'libs' . DS); + +$www_top = str_replace("\\", "/", dirname($_SERVER['PHP_SELF'])); +if (strlen($www_top) == 1) { + $www_top = ""; +} + +// Used everywhere an href is output, includes the full path to the NNTmux install. +define('WWW_TOP', $www_top); + +?> diff --git a/www/install/step1.php b/www/install/step1.php new file mode 100755 index 000000000..8b5bc242f --- /dev/null +++ b/www/install/step1.php @@ -0,0 +1,201 @@ +title = "Preflight Checklist"; + +$cfg = new Install(); + +if (!$cfg->isInitialized()) { + header("Location: index.php"); + die(); +} + +$cfg->setSession(); +$cfg = $cfg->getSession(); + +// Start checks. +$cfg->sessionsPathPermissions = true; +$sessionPath = session_save_path(); +$sessionPath = empty($sessionPath) ? sys_get_temp_dir() : $sessionPath; +$page->smarty->assign('sessionsSavePath', $sessionPath); +if (!is_readable($sessionPath) || !is_writable($sessionPath)) { + $cfg->error = true; + $cfg->sessionsPathPermissions = false; +} + +$cfg->iconvCheck = function_exists('iconv'); +if ($cfg->iconvCheck === false) { + $cfg->error = true; +} + +$cfg->cryptCheck = function_exists('crypt'); +if ($cfg->cryptCheck === false) { + $cfg->error = true; +} + +$cfg->sha1Check = function_exists('sha1'); +if ($cfg->sha1Check === false) { + $cfg->error = true; +} + +$cfg->PDOCheck = extension_loaded('PDO'); +if ($cfg->PDOCheck === false) { + $cfg->error = true; +} + +$cfg->jsonCheck = extension_loaded('json'); +if ($cfg->jsonCheck === false) { + $cfg->error = true; +} + +$cfg->gdCheck = function_exists('imagecreatetruecolor'); + +$cfg->curlCheck = function_exists('curl_init'); + +if (extension_loaded('posix') && strtolower(substr(PHP_OS, 0, 3)) !== 'win') { + $group = posix_getgrgid(posix_getgid()); + $fixString = '

Another solution is to run:
chown -R YourUnixUserName:' . $group['name'] . ' ' . nZEDb_ROOT . + '
Then give your user access to the group:
usermod -a -G ' . $group['name'] . ' YourUnixUserName' . + '
Finally give read/write access to your user/group:
chmod -R 774 ' . nZEDb_ROOT; + $page->smarty->assign('fixString', $fixString); + $page->smarty->assign('unixGroup', $group['name']); + $page->smarty->assign('rootPath', nZEDb_ROOT); +} else { + $page->smarty->assign('fixString', false); +} + +$cfg->cacheCheck = is_writable(nZEDb_RES . 'smarty' . DS . 'templates_c'); +if ($cfg->cacheCheck === false) { + $cfg->error = true; +} + +$cfg->animeCoversCheck = is_writable($cfg->COVERS_PATH . 'anime'); +if ($cfg->animeCoversCheck === false) { + $cfg->error = true; +} + +$cfg->audioCoversCheck = is_writable($cfg->COVERS_PATH . 'audio'); +if ($cfg->audioCoversCheck === false) { + $cfg->error = true; +} + +$cfg->audiosampleCoversCheck = is_writable($cfg->COVERS_PATH . 'audiosample'); +if ($cfg->audiosampleCoversCheck === false) { + $cfg->error = true; +} + +$cfg->bookCoversCheck = is_writable($cfg->COVERS_PATH . 'book'); +if ($cfg->bookCoversCheck === false) { + $cfg->error = true; +} + +$cfg->consoleCoversCheck = is_writable($cfg->COVERS_PATH . 'console'); +if ($cfg->consoleCoversCheck === false) { + $cfg->error = true; +} + +$cfg->movieCoversCheck = is_writable($cfg->COVERS_PATH . 'movies'); +if ($cfg->movieCoversCheck === false) { + $cfg->error = true; +} + +$cfg->musicCoversCheck = is_writable($cfg->COVERS_PATH . 'music'); +if ($cfg->musicCoversCheck === false) { + $cfg->error = true; +} + +$cfg->previewCoversCheck = is_writable($cfg->COVERS_PATH . 'preview'); +if ($cfg->previewCoversCheck === false) { + $cfg->error = true; +} + +$cfg->sampleCoversCheck = is_writable($cfg->COVERS_PATH . 'sample'); +if ($cfg->sampleCoversCheck === false) { + $cfg->error = true; +} + +$cfg->videoCoversCheck = is_writable($cfg->COVERS_PATH . 'video'); +if ($cfg->videoCoversCheck === false) { + $cfg->error = true; +} + +$cfg->configCheck = is_writable(nZEDb_CONFIGS); +if ($cfg->configCheck === false) { + $cfg->configCheck = is_file(nZEDb_CONFIGS); + if ($cfg->configCheck === true) { + $cfg->configCheck = false; + $cfg->error = true; + } else { + $cfg->configCheck = is_writable(nZEDb_CONFIGS); + if ($cfg->configCheck === false) { + $cfg->error = true; + } + } +} + +$cfg->lockCheck = is_writable($cfg->INSTALL_DIR . 'install.lock'); +if ($cfg->lockCheck === false) { + $cfg->lockCheck = is_file($cfg->INSTALL_DIR . 'install.lock'); + if ($cfg->lockCheck === true) { + $cfg->lockCheck = false; + $cfg->error = true; + } else { + $cfg->lockCheck = is_writable($cfg->INSTALL_DIR); + if ($cfg->lockCheck === false) { + $cfg->error = true; + } + } +} + +$cfg->pearCheck = @include 'System.php'; +$cfg->pearCheck = class_exists('System'); +if (!$cfg->pearCheck) { + $cfg->error = true; +} + +$cfg->schemaCheck = false; +if (is_readable($cfg->DB_DIR . 'mysql-ddl.sql')) { + $cfg->schemaCheck = true; +} +if ($cfg->schemaCheck === false) { + $cfg->error = true; +} + +// Don't set error = true for these as we only want to display a warning. +$cfg->phpCheck = (version_compare(PHP_VERSION, nZEDb_MINIMUM_PHP_VERSION, '>=')) ? true : false; +$cfg->timelimitCheck = (ini_get('max_execution_time') >= 120) ? true : false; +$cfg->memlimitCheck = (ini_get('memory_limit') >= 1024 || ini_get('memory_limit') == -1) ? true : false; +$cfg->opensslCheck = extension_loaded("openssl"); +$cfg->exifCheck = extension_loaded("exif"); +$cfg->timezoneCheck = (ini_get('date.timezone') != ""); + +if (preg_match('/apache/i', $_SERVER['SERVER_SOFTWARE'])) { + $cfg->rewriteCheck = (function_exists("apache_get_modules") && in_array("mod_rewrite", apache_get_modules())) ? true : false; +} else { + $cfg->rewriteCheck = true; +} + +// Load previous config.php. +if (file_exists(nZEDb_CONFIGS . 'config.php') && is_readable(nZEDb_CONFIGS . 'config.php')) { + $tmpCfg = file_get_contents(nZEDb_CONFIGS . 'config.php'); + $cfg->setConfig($tmpCfg); +} + +if (!$cfg->error) { + $cfg->setSession(); +} + +$page->smarty->assign('cfg', $cfg); + +$page->smarty->assign('page', $page); + +$page->content = $page->smarty->fetch('step1.tpl'); +$page->render(); diff --git a/www/install/step2.php b/www/install/step2.php new file mode 100755 index 000000000..87556eb0b --- /dev/null +++ b/www/install/step2.php @@ -0,0 +1,222 @@ +title = "Database Setup"; + +$cfg = new Install(); + +if (!$cfg->isInitialized()) { + header("Location: index.php"); + die(); +} + +/** + * Check if the database exists. + * + * @param string $dbName The name of the database to be checked. + * @param string $dbType mysql + * @param PDO $pdo Class PDO instance. + * + * @return bool + */ +function databaseCheck($dbName, $dbType, $pdo) +{ + // Return value. + $retVal = false; + + // Prepare queries. + $stmt = ($dbType === "mysql" ? 'SHOW DATABASES' : 'SELECT datname AS Database FROM pg_database'); + $stmt = $pdo->prepare($stmt); + $stmt->setFetchMode(PDO::FETCH_ASSOC); + + // Run the query. + $stmt->execute(); + $tables = $stmt->fetchAll(); + + // Store the query result as an array. + $tablearr = []; + foreach ($tables as $table) { + $tablearr[] = $table; + } + + // Loop over the query result. + foreach ($tablearr as $tab) { + + // Check if the database is found. + if (isset($tab["Database"])) { + if ($tab["Database"] == $dbName) { + $retVal = true; + break; + } + } + + if (isset($tab["database"])) { + if ($tab["database"] == $dbName) { + $retVal = true; + break; + } + } + } + return $retVal; +} + +$cfg = $cfg->getSession(); + +if ($page->isPostBack()) { + $cfg->doCheck = true; + + // Get the information the user typed into the website. + $cfg->DB_HOST = trim($_POST['host']); + $cfg->DB_PORT = trim($_POST['sql_port']); + $cfg->DB_SOCKET = trim($_POST['sql_socket']); + $cfg->DB_USER = trim($_POST['user']); + $cfg->DB_PASSWORD = trim($_POST['pass']); + $cfg->DB_NAME = trim($_POST['db']); + $cfg->DB_SYSTEM = strtolower(trim($_POST['db_system'])); + $cfg->error = false; + + // Check if user selected right DB type. + if (!in_array($cfg->DB_SYSTEM, ['mysql'])) { + $cfg->emessage = 'Invalid database system. Must be: mysql ; Not: ' . $cfg->DB_SYSTEM; + $cfg->error = true; + } else { + // Connect to the SQL server. + try { + // HAS to be DB because settings table does not exist yet. + $pdo = new DB( + [ + 'checkVersion' => true, + 'createDb' => true, + 'dbhost' => $cfg->DB_HOST, + 'dbname' => $cfg->DB_NAME, + 'dbpass' => $cfg->DB_PASSWORD, + 'dbport' => $cfg->DB_PORT, + 'dbsock' => $cfg->DB_SOCKET, + 'dbtype' => $cfg->DB_SYSTEM, + 'dbuser' => $cfg->DB_USER, + ] + ); + $cfg->dbConnCheck = true; + } catch (\PDOException $e) { + $cfg->emessage = 'Unable to connect to the SQL server.'; + $cfg->error = true; + $cfg->dbConnCheck = false; + } catch (\RuntimeException $e) { + switch ($e->getCode()) { + case 1: + case 2: + case 3: + $cfg->error = true; + $cfg->emessage = $e->getMessage(); + break; + default: + var_dump($e); + throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); + } + } + + // Check if the MySQL version is correct. + $goodVersion = false; + if (!$cfg->error) { + try { + $goodVersion = $pdo->isDbVersionAtLeast(nZEDb_MINIMUM_MYSQL_VERSION); + } catch (\PDOException $e) { + $goodVersion = false; + $cfg->error = true; + $cfg->emessage = 'Could not get version from SQL server.'; + } + + if ($goodVersion === false) { + $cfg->error = true; + $cfg->emessage = + 'You are using an unsupported version of ' . + $cfg->DB_SYSTEM . + ' the minimum allowed version is ' . + nZEDb_MINIMUM_MYSQL_VERSION; + } + } + } + + // Start inserting data into the DB. + if (!$cfg->error) { + $cfg->setSession(); + + $DbSetup = new \nntmux\db\DbUpdate( + [ + 'backup' => false, + 'db' => $pdo, + ] + ); + + try { + $DbSetup->processSQLFile(); // Setup default schema + $DbSetup->processSQLFile( // Process any custom stuff. + [ + 'filepath' => nZEDb_RES . 'db' . DS . 'schema' . DS . 'mysql-data.sql' + ] + ); + $DbSetup->loadTables(); // Load default data files + } catch (\PDOException $err) { + $cfg->error = true; + $cfg->emessage = "Error inserting: (" . $err->getMessage() . ")"; + } + + if (!$cfg->error) { + // Check one of the standard tables was created and has data. + $dbInstallWorked = false; + $reschk = $pdo->query("SELECT COUNT(id) AS num FROM tmux"); + if ($reschk === false) { + $cfg->dbCreateCheck = false; + $cfg->error = true; + $cfg->emessage = 'Could not select data from your database, check that tables and data are properly created/inserted.'; + } else { + foreach ($reschk as $row) { + if ($row['num'] > 0) { + $dbInstallWorked = true; + break; + } + } + } + + $ver = new Versions(); + $patch = $ver->getSQLPatchFromFile(); + + if ($dbInstallWorked) { + if ($patch > 0) { + $updateSettings = $pdo->exec( + "UPDATE settings SET value = '$patch' WHERE section = '' AND subsection = '' AND name = 'sqlpatch'" + ); + } else { + $updateSettings = false; + } + + // If it all worked, move to the next page. + if ($updateSettings) { + header("Location: ?success"); + if (file_exists($cfg->DB_DIR . '/post_install.php')) { + exec("php " . $cfg->DB_DIR . "/post_install.php ${pdo}"); + } + exit(); + } else { + $cfg->error = true; + $cfg->emessage = "Could not update sqlpatch to '$patch' for your database."; + } + } else { + $cfg->dbCreateCheck = false; + $cfg->error = true; + $cfg->emessage = 'Could not select data from your database.'; + } + } + } +} + +$page->smarty->assign('cfg', $cfg); +$page->smarty->assign('page', $page); +$page->content = $page->smarty->fetch('step2.tpl'); +$page->render(); diff --git a/www/install/step3.php b/www/install/step3.php new file mode 100755 index 000000000..6f7b4e65e --- /dev/null +++ b/www/install/step3.php @@ -0,0 +1,80 @@ +title = "OpenSSL Setup"; + +$cfg = new Install(); + +if (!$cfg->isInitialized()) { + header("Location: index.php"); + die(); +} + +$cfg = $cfg->getSession(); + +if ($page->isPostBack()) { + $cfg->doCheck = true; + + $cfg->nZEDb_SSL_CAFILE = trim($_POST['cafile']); + $cfg->nZEDb_SSL_CAPATH = trim($_POST['capath']); + $cfg->nZEDb_SSL_VERIFY_PEER = (isset($_POST['verifypeer']) ? (trim($_POST['verifypeer']) == '1' ? true : false) : false); + $cfg->nZEDb_SSL_VERIFY_HOST = (isset($_POST['verifyhost']) ? (trim($_POST['verifyhost']) == '1' ? true : false) : false); + $cfg->nZEDb_SSL_ALLOW_SELF_SIGNED = (isset($_POST['allowselfsigned']) ? (trim($_POST['allowselfsigned']) == '1' ? true : false) : false); + + // If the user doesn't want to verify peer, disable everything. + if (!$cfg->nZEDb_SSL_VERIFY_PEER) { + $cfg->nZEDb_SSL_ALLOW_SELF_SIGNED = true; + $cfg->nZEDb_SSL_VERIFY_HOST = false; + $cfg->nZEDb_SSL_CAFILE = $cfg->nZEDb_SSL_CAPATH = ''; + } + + // If both paths are empty, disable everything. + if (!$cfg->nZEDb_SSL_CAPATH && !$cfg->nZEDb_SSL_CAFILE) { + $cfg->nZEDb_SSL_VERIFY_PEER = $cfg->nZEDb_SSL_VERIFY_HOST = false; + $cfg->nZEDb_SSL_ALLOW_SELF_SIGNED = true; + $cfg->nZEDb_SSL_CAFILE = $cfg->nZEDb_SSL_CAPATH = ''; + } + + // Make sure the files and all paths are readable. + if ($cfg->nZEDb_SSL_CAFILE != '') { + if (!checkPathsReadable($cfg->nZEDb_SSL_CAFILE)) { + $cfg->error = 'Invalid ca file path or it is not readable or the folders up to it are not readable.'; + } else if (1) { + + } + } + if ($cfg->nZEDb_SSL_CAPATH != '' && !checkPathsReadable($cfg->nZEDb_SSL_CAPATH)) { + $cfg->error = 'Invalid ca folder path or it is not readable or the folders up to it are not readable.'; + } + + if (!$cfg->error) { + $cfg->setSession(); + header("Location: ?success"); + die(); + } +} + +$page->smarty->assign('cfg', $cfg); +$page->smarty->assign('page', $page); + +$page->content = $page->smarty->fetch('step3.tpl'); +$page->render(); + +function checkPathsReadable($location) +{ + $paths = preg_split('#\/#', $location); + $directory = ''; + if ($paths && count($paths)) { + foreach ($paths as $path) { + $directory .= DS . $path; + if (!is_readable($directory)) { + return false; + } + } + return true; + } + return false; +} diff --git a/www/install/step4.php b/www/install/step4.php new file mode 100755 index 000000000..e211b5a86 --- /dev/null +++ b/www/install/step4.php @@ -0,0 +1,68 @@ +title = "News Server Setup"; + +$cfg = new Install(); + +if (!$cfg->isInitialized()) { + header("Location: index.php"); + die(); +} + +$cfg = $cfg->getSession(); + +if ($page->isPostBack()) { + $cfg->doCheck = true; + + $cfg->NNTP_SERVER = trim($_POST['server']); + $cfg->NNTP_USERNAME = trim($_POST['user']); + $cfg->NNTP_PASSWORD = trim($_POST['pass']); + $cfg->NNTP_PORT = (trim($_POST['port']) == '') ? 119 : trim($_POST['port']); + $cfg->NNTP_SSLENABLED = (isset($_POST['ssl']) ? (trim($_POST['ssl']) == '1' ? true : false) : false); + $cfg->NNTP_SOCKET_TIMEOUT = (is_numeric(trim($_POST['socket_timeout'])) ? (int)trim($_POST['socket_timeout']) : 120); + + $cfg->NNTP_SERVER_A = trim($_POST['servera']); + $cfg->NNTP_USERNAME_A = trim($_POST['usera']); + $cfg->NNTP_PASSWORD_A = trim($_POST['passa']); + $cfg->NNTP_PORT_A = (trim($_POST['porta']) == '') ? 119 : trim($_POST['porta']); + $cfg->NNTP_SSLENABLED_A = (isset($_POST['ssla']) ? (trim($_POST['ssla']) == '1' ? true : false) : false); + $cfg->NNTP_SOCKET_TIMEOUT_A = (is_numeric(trim($_POST['socket_timeouta'])) ? (int)trim($_POST['socket_timeouta']) : 120); + + $test = new Net_NNTP_Client(); + $pear_obj = new PEAR(); + + $enc = false; + if ($cfg->NNTP_SSLENABLED) { + $enc = "tls"; + } + + // test connection + $cfg->nntpCheck = $test->connect($cfg->NNTP_SERVER, $enc, $cfg->NNTP_PORT); + if ($pear_obj->isError($cfg->nntpCheck)) { + $cfg->nntpCheck->message = 'Connection error, check your server name, port and SSL: (' . $cfg->nntpCheck->getMessage() . ')'; + $cfg->error = true; + } else if ($cfg->NNTP_USERNAME != '' && $cfg->NNTP_PASSWORD != '') { + //test authentication if username and password are provided + $cfg->nntpCheck = $test->authenticate($cfg->NNTP_USERNAME, $cfg->NNTP_PASSWORD); + if ($pear_obj->isError($cfg->nntpCheck)) { + $cfg->nntpCheck->message = 'Authentication error, check your username and password: (' . $cfg->nntpCheck->getMessage() . ')'; + $cfg->error = true; + } + } + + if (!$cfg->error) { + $cfg->setSession(); + header("Location: ?success"); + die(); + } +} + +$page->smarty->assign('cfg', $cfg); +$page->smarty->assign('page', $page); + +$page->content = $page->smarty->fetch('step4.tpl'); +$page->render(); diff --git a/www/install/step5.php b/www/install/step5.php new file mode 100755 index 000000000..04438d169 --- /dev/null +++ b/www/install/step5.php @@ -0,0 +1,36 @@ +title = "Save Settings"; + +$cfg = new Install(); + +if (!$cfg->isInitialized()) { + header("Location: index.php"); + die(); +} + +$cfg = $cfg->getSession(); + +$cfg->saveConfigCheck = $cfg->saveConfig(); +if ($cfg->saveConfigCheck === false) { + $cfg->error = true; +} + +$cfg->saveLockCheck = $cfg->saveInstallLock(); +if ($cfg->saveLockCheck === false) { + $cfg->error = true; +} + +if (!$cfg->error) { + $cfg->setSession(); +} + +$page->smarty->assign('cfg', $cfg); +$page->smarty->assign('page', $page); + +$page->content = $page->smarty->fetch('step5.tpl'); +$page->render(); diff --git a/www/install/step6.php b/www/install/step6.php new file mode 100755 index 000000000..bf7b342a3 --- /dev/null +++ b/www/install/step6.php @@ -0,0 +1,68 @@ +title = "Setup Admin User"; + +$cfg = new Install(); + +if (!$cfg->isInitialized()) { + header("Location: index.php"); + die(); +} + +$cfg = $cfg->getSession(); + +if ($page->isPostBack()) { + $cfg->doCheck = true; + + $cfg->ADMIN_USER = trim($_POST['user']); + $cfg->ADMIN_FNAME = trim($_POST['fname']); + $cfg->ADMIN_LNAME = trim($_POST['lname']); + $cfg->ADMIN_PASS = trim($_POST['pass']); + $cfg->ADMIN_EMAIL = trim($_POST['email']); + + if ($cfg->ADMIN_USER == '' || $cfg->ADMIN_PASS == '' || $cfg->ADMIN_EMAIL == '') { + $cfg->error = true; + } else { + $user = new Users(); + if (!$user->isValidUsername($cfg->ADMIN_USER)) { + $cfg->error = true; + $cfg->ADMIN_USER = ''; + } else { + $usrCheck = $user->getByUsername($cfg->ADMIN_USER); + if ($usrCheck) { + $cfg->error = true; + $cfg->ADMIN_USER = ''; + } + } + if (!$user->isValidEmail($cfg->ADMIN_EMAIL)) { + $cfg->error = true; + $cfg->ADMIN_EMAIL = ''; + } + + if (!$cfg->error) { + $cfg->adminCheck = $user->add($cfg->ADMIN_USER, $cfg->ADMIN_FNAME, $cfg->ADMIN_LNAME, $cfg->ADMIN_PASS, $cfg->ADMIN_EMAIL, 2, ''); + if (!is_numeric($cfg->adminCheck)) { + $cfg->error = true; + } else { + $user->login($cfg->adminCheck, "", 1); + } + } + } + + if (!$cfg->error) { + $cfg->setSession(); + header("Location: ?success"); + die(); + } +} + +$page->smarty->assign('cfg', $cfg); +$page->smarty->assign('page', $page); + +$page->content = $page->smarty->fetch('step6.tpl'); +$page->render(); diff --git a/www/install/step7.php b/www/install/step7.php new file mode 100755 index 000000000..aae2da541 --- /dev/null +++ b/www/install/step7.php @@ -0,0 +1,113 @@ +title = "File Paths"; +} + +$cfg = new Install(); + +if (!$cfg->isInitialized()) { + header("Location: index.php"); + die(); +} + +$cfg = $cfg->getSession(); + +if ($page->isPostBack()) { + $cfg->doCheck = true; + + $cfg->NZB_PATH = trim($_POST['nzbpath']); + $cfg->COVERS_PATH = trim($_POST['coverspath']); + $cfg->UNRAR_PATH = trim($_POST['tmpunrarpath']); + + if (extension_loaded('posix') && strtolower(substr(PHP_OS, 0, 3)) !== 'win') { + $group = posix_getgrgid(posix_getgid()); + $fixString = '

Another solution is to run:
chown -R YourUnixUserName:' . $group['name'] . ' ' . nZEDb_ROOT . + '
Then give your user access to the group:
usermod -a -G ' . $group['name'] . ' YourUnixUserName' . + '
Finally give read/write access to your user/group:
chmod -R 774 ' . nZEDb_ROOT; + $page->smarty->assign('fixString', $fixString); + } + + if ($cfg->NZB_PATH == '') { + $cfg->error = true; + } else { + $cfg->nzbPathCheck = is_writable($cfg->NZB_PATH); + if ($cfg->nzbPathCheck === false) { + $cfg->error = true; + } + + $lastchar = substr($cfg->NZB_PATH, strlen($cfg->NZB_PATH) - 1); + if ($lastchar != "/") { + $cfg->NZB_PATH = $cfg->NZB_PATH . "/"; + } + } + + if ($cfg->UNRAR_PATH == '') { + $cfg->error = true; + } else { + $cfg->unrarPathCheck = is_writable($cfg->NZB_PATH); + if ($cfg->unrarPathCheck === false) { + $cfg->error = true; + } + + $lastchar = substr($cfg->UNRAR_PATH, strlen($cfg->UNRAR_PATH) - 1); + if ($lastchar != "/") { + $cfg->UNRAR_PATH = $cfg->UNRAR_PATH . "/"; + } + } + /* + if ($cfg->COVERS_PATH == '') { + $cfg->error = true; + } else { + \nntmux\utility\Misc::trailingSlash($cfg->COVERS_PATH); + + $cfg->coverPathCheck = is_writable($cfg->COVERS_PATH); + if ($cfg->coverPathCheck === false) { + $cfg->error = true; + } + } + */ + + if (!$cfg->error) { + if (!file_exists($cfg->UNRAR_PATH)) { + mkdir($cfg->UNRAR_PATH); + } + + $pdo = new Settings(); + $sql1 = sprintf("UPDATE settings SET value = %s WHERE setting = 'nzbpath'", $pdo->escapeString($cfg->NZB_PATH)); + $sql2 = sprintf("UPDATE settings SET value = %s WHERE setting = 'tmpunrarpath'", $pdo->escapeString($cfg->UNRAR_PATH)); + $sql3 = sprintf("UPDATE settings SET value = %s WHERE setting = 'coverspath'", $pdo->escapeString($cfg->COVERS_PATH)); + if ($pdo->queryExec($sql1) === false || $pdo->queryExec($sql2) === false || $pdo->queryExec($sql3) === false) { + $cfg->error = true; + } + + if ($cfg->error !== true) { + if ($cfg->COVERS_PATH != nZEDb_WWW . 'covers' . DS) { + // TODO clean up old covers location if 'empty' (i.e. only contains the versioned files). + } + + if ($cfg->NZB_PATH != nZEDb_ROOT . 'nzbfiles' . DS) { + // TODO clean up old nzbfiles location if 'empty' (i.e. only contains the versioned files). + } + } + } + + if (!$cfg->error) { + $cfg->setSession(); + header("Location: ?success"); + die(); + } +} + +$page->smarty->assign('cfg', $cfg); +$page->smarty->assign('page', $page); + +$page->content = $page->smarty->fetch('step7.tpl'); +$page->render(); diff --git a/www/install/templates/install.css b/www/install/templates/install.css new file mode 100755 index 000000000..a7781d3b6 --- /dev/null +++ b/www/install/templates/install.css @@ -0,0 +1,46 @@ +/* +site wide html styles +*/ +body { margin: 0; padding: 0; background: #FFFFFF url(../../themes/shared/images/menu.gif) repeat-x; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 14px; color: #515151; } +input, select, textarea { font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 14px;} +a { text-decoration: none; color: blue; } +h1, h2, h3 { margin: 0; font-weight: normal; color: #485459; } +li { padding-top:10px; } +textarea { font-family: Arial, Helvetica, sans-serif; height:100px; width:300px;} +h1 { font-size: 3.0em; padding-bottom:10px;} +h2 { font-size: 2.0em; padding-bottom:10px;} +input[type=text], input[type=password], textarea, select { background: #fff; background: -webkit-gradient(linear, left top, left 25, from(#fff), color-stop(4%, #f0f0f0), to(#fff)); border: 1px solid #ccc; border-bottom-color: #999; border-right-color: #999; margin: 0; padding: 4px; color: #444; font-size: 100%; outline: none; width: 97%; } + + + +/* +page layout +*/ +#logo { margin-left: 200px; margin-top: 30px; margin-bottom: 30px; } +.content { border: 1px solid #515151; width: 35%; padding: 30px; margin-left: auto; margin-right: auto; background: #FFF; border:1px solid #EEE; -moz-box-shadow: 3px 6px 8px -4px #777; -webkit-box-shadow: 3px 6px 8px -4px #777; box-shadow: 3px 6px 8px -4px #777; } +.footer { font-size: 10px; text-align: center; } + +/* +install warning message +*/ +div.error { color: red; padding: 20px; } +span.error { color: red; } +span.warn { color: orange; } +span.success { color: green; } + +/* +lists +*/ +table.data { border-collapse:collapse; } +table.data th { text-align:left; vertical-align:top; background-color:#DDD; border-color: #AAA; border-width: 1px; border-style: solid; padding:3px; font-style:bolder; text-transform:capitalize;} +table.data td { white-space:normal; vertical-align:top; padding:5px; border-color: #AAA; border-width: 1px; border-style: solid; } +table.data td.less { color: #888; font-size: 0.8em; white-space:nowrap; } +table.data td.icons { white-space:nowrap; padding-left:0px; padding-right:0px; width:60px; } +table.highlight tr:hover td { background-color: #E1F0D9; } +table tr.alt { background-color: #EEE; } +table.data em {font-weight:bolder; color:red;} +div.hint, div.hint a {font-size:0.9em; font-style:italic; color:#999;} +div.hint { margin-bottom:10px;} +input.long {width:400px; } +input.short { width:40px; } +input.date { width:70px; } diff --git a/www/install/templates/installpage.tpl b/www/install/templates/installpage.tpl new file mode 100755 index 000000000..33c50811b --- /dev/null +++ b/www/install/templates/installpage.tpl @@ -0,0 +1,21 @@ + + + + + {$page->title} + + + {$page->head} + + +

NNTmux

+
+

{$page->title}

+ {$page->content} + + +
+ + diff --git a/www/install/templates/step1.tpl b/www/install/templates/step1.tpl new file mode 100755 index 000000000..4b421bfdc --- /dev/null +++ b/www/install/templates/step1.tpl @@ -0,0 +1,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {if $smarty.server.SERVER_SOFTWARE|truncate:8:"" == 'lighttpd'} + + + {else} + + + {/if} + + + + + +
checkstatus
Checking for iconv support:{if !$cfg->iconvCheck}
The PHP installation lacks support for iconv.{/if}
{if $cfg->iconvCheck}OK{else}Error{/if}
Checking for Curl support:{if !$cfg->curlCheck}
The PHP installation lacks support for curl.{/if}
{if $cfg->curlCheck}OK{else}Error{/if}
Checking for sha1():{if !$cfg->sha1Check}
The PHP installation lacks support for sha1.{/if}
{if $cfg->sha1Check}OK{else}Error{/if}
Checking for crypt():{if !$cfg->cryptCheck}
The PHP installation lacks support for crypt.{/if}
{if $cfg->sha1Check}OK{else}Error{/if}
Checking PHP's version:{if !$cfg->phpCheck}
Your PHP version is lower than recommended ({$cfg->minPhpVersion}). You may encounter errors if you proceed.{/if}
{if $cfg->phpCheck}OK{else}Warning{/if}
Checking for Pear:{if !$cfg->pearCheck}
Cannot find PEAR. To install PEAR follow the instructions at http://pear.php.net/manual/en/installation.php{/if}
{if $cfg->pearCheck}OK{else}Error{/if}
Checking PHP PDO extension:{if !$cfg->PDOCheck}
The PHP installation lacks support for PDO.{/if}
{if $cfg->PDOCheck}OK{else}Error{/if}
Checking PHP GD extension:{if !$cfg->gdCheck}
The PHP installation lacks support for GD.{/if}
{if $cfg->gdCheck}OK{else}Warning{/if}
Checking PHP OpenSSL Extension:{if !$cfg->opensslCheck}
Your PHP installation does not have the openssl extension loaded. SSL Usenet connections will fail.{/if}
{if $cfg->opensslCheck}OK{else}Warning{/if}
Checking PHP EXIF Extension:{if !$cfg->exifCheck}
Your PHP installation does not have the exif extension loaded. It is required for NFO checking and various other functions.{/if}
{if $cfg->exifCheck}OK{else}Warning{/if}
Checking PHP json extension:{if !$cfg->jsonCheck}
The PHP installation lacks support for json.{/if}
{if $cfg->jsonCheck}OK{else}Error{/if}
Checking PHP date.timezone:{if !$cfg->timezoneCheck}
You have no default timezone set in php.ini. e.g date.timezone = America/New_York{/if}
{if $cfg->timezoneCheck}OK{else}Warning{/if}
Checking PHP max_execution_time:{if !$cfg->timelimitCheck}
Your PHP installation's max_execution_time setting is low, please consider increasing it >= 120{/if}
{if $cfg->timelimitCheck}OK{else}Warning{/if}
Checking PHP memory_limit:{if !$cfg->memlimitCheck}
Your PHP installation's memory_limit setting is low, please consider increasing it >= 1024M.{/if}
{if $cfg->memlimitCheck}OK{else}Warning{/if}
Checking if the Smarty compile dir is writable: + {if !$cfg->cacheCheck}
+ + The template compile dir must be writable.

+ A quick solution is to run:
+ chmod 777 {$cfg->SMARTY_COMPILED_TEMPLATES} + {$fixString} +
+ {/if} +
{if $cfg->cacheCheck}OK{else}Error{/if}
Checking if the anime covers dir is writable: + {if !$cfg->animeCoversCheck}
+ + The covers/anime dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}anime + {$fixString} +
+ {/if} +
{if $cfg->animeCoversCheck}OK{else}Error{/if}
Checking if the audio covers dir is writable: + {if !$cfg->audioCoversCheck}
+ + The covers/audio dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}audio + {$fixString} +
+ {/if} +
{if $cfg->audioCoversCheck}OK{else}Error{/if}
Checking if the audio sample dir is writable: + {if !$cfg->audiosampleCoversCheck}
+ + The covers/audiosample dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}audiosample + {$fixString} +
+ {/if} +
{if $cfg->audiosampleCoversCheck}OK{else}Error{/if}
Checking if the book covers dir is writable: + {if !$cfg->bookCoversCheck}
+ + The covers/book dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}book + {$fixString} +
+ {/if} +
{if $cfg->bookCoversCheck}OK{else}Error{/if}
Checking if the console covers dir is writable: + {if !$cfg->consoleCoversCheck}
+ + The covers/console dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}console + {$fixString} +
+ {/if} +
{if $cfg->consoleCoversCheck}OK{else}Error{/if}
Checking if the movie covers dir is writable: + {if !$cfg->movieCoversCheck}
+ + The covers/movies dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}movies + {$fixString} +
+ {/if} +
{if $cfg->movieCoversCheck}OK{else}Error{/if}
Checking if the music covers dir is writable: + {if !$cfg->musicCoversCheck}
+ + The covers/music dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}music + {$fixString} +
+ {/if} +
{if $cfg->musicCoversCheck}OK{else}Error{/if}
Checking if the preview picture dir is writable: + {if !$cfg->previewCoversCheck}
+ + The covers/preview dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}preview + {$fixString} +
+ {/if} +
{if $cfg->previewCoversCheck}OK{else}Error{/if}
Checking if the sample picture dir is writable: + {if !$cfg->sampleCoversCheck}
+ + The covers/sample dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}sample + {$fixString} +
+ {/if} +
{if $cfg->sampleCoversCheck}OK{else}Error{/if}
Checking if the video sample dir is writable: + {if !$cfg->videoCoversCheck}
+ + The covers/video dir must be writable.
+ A quick solution is to run:
+ chmod 777 {$cfg->COVERS_PATH}video + {$fixString} +
+ {/if} +
{if $cfg->videoCoversCheck}OK{else}Error{/if}
Checking if the config.php file is writable: + {if !$cfg->configCheck}
+ + The installer cannot write to {$cfg->CONFIG_PATH}.
A quick solution is to run:
chmod 777 {$cfg->CONFIG_PATH} + {$fixString} +
+ {/if} +
{if $cfg->configCheck}OK{else}Error{/if}
Checking if the install.lock file is writable: + {if !$cfg->lockCheck}
+ + The installer cannot write to {$cfg->INSTALL_DIR}/install.lock.
+ A quick solution is to run:
+ chmod 777 {$cfg->INSTALL_DIR} + {$fixString} +
+ {/if} +
{if $cfg->lockCheck}OK{else}Error{/if}
Checking for schema files:{if !$cfg->schemaCheck}
One or all of the schema files are missing, please make sure they are placed placed in: {$cfg->DB_DIR}/{/if}
{if $cfg->schemaCheck}OK{else}Error{/if}
Instructions for Lighttpd's mod_rewrite:
It is not possible for me to check you have enabled this properly! YOU will need to ensure that "mod_rewrite" is included in server.modules, check lighttpd for this, also ensure the rewrite rules are installed for your host. See misc/urlrewriting/lighttpd.txt for examples.
WarningChecking for Apache's mod_rewrite:{if !$cfg->rewriteCheck}
The Apache module mod_rewrite is not loaded. This module is required, please enable it if you are running Apache{/if}
{if $cfg->rewriteCheck}OK{else}Warning{/if}
Checking PHP sessions path permissions:{if !$cfg->sessionsPathPermissions}
The PHP sessions path ({$sessionsSavePath}) does not have read or write access.{/if}
{if $cfg->sessionsPathPermissions}OK{else}Error{/if}
+
+ {if !$cfg->error} +

No problems were found and you are ready to install.

+
+ {else} +
Errors encountered - NNtmux will not function correctly unless these problems are solved.
+ {/if} +
diff --git a/www/install/templates/step2.tpl b/www/install/templates/step2.tpl new file mode 100755 index 000000000..4ae770cae --- /dev/null +++ b/www/install/templates/step2.tpl @@ -0,0 +1,78 @@ +{if $page->isSuccess()} +
+

The database setup is correct, you may continue to the next step.

+
+
+ +
+
+
+{else} + +

This page will attempt to use your database information provided below to connect to the database and create the required tables and initial data.

+ + +
+
+ {if $cfg->error} +
+ The following error(s) were encountered:
+ {if $cfg->dbConnCheck === false} + • Unable to connect to database:
{$cfg->emessage}

+ {elseif $cfg->dbNameCheck === false} + • Unable to select database:
{$cfg->emessage}

+ {elseif $cfg->dbCreateCheck === false} + • Unable to create database and data. Check permissions of your mysql user.
+ {else} + {$cfg->emessage}
+ {/if} +
+
+ {/if} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +{/if} diff --git a/www/install/templates/step3.tpl b/www/install/templates/step3.tpl new file mode 100755 index 000000000..2a37238bc --- /dev/null +++ b/www/install/templates/step3.tpl @@ -0,0 +1,82 @@ +{if $page->isSuccess()} +
+

The openssl setup looks correct, you may continue to the next step.

+
+
+ +
+
+
+{else} +
+

An openssl CA bundle file is recommended to verify the authenticity of remote certificates when connecting to various servers using TLS/SSL.

+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ Location of Certificate Authority file on local filesystem which will be used if the Verify Peer option is enabled to authenticate the identity of the remote peer. +
Example: /etc/ssl/certs/cacert.pem +
+
+ +
+ If the ca bundle cert file is not specified or if the certificate is not found there, you can specify a directory here which will be searched for a suitable certificate. +
Example: /etc/ssl/certs/
+
+ nZEDb_SSL_VERIFY_PEER=="true"}checked="checked"{/if} /> +
+ Enabling this requires the ca bundle cert file path to be set.
+ Disabling this will disable TLS/SSL remote certificate verification which is not recommended. +
+
+ nZEDb_SSL_VERIFY_HOST=="true"}checked="checked"{/if} /> +
+ This makes sure the host is who they say they are.
+ See this link for detailed info.
+ You might need to disable this as some providers are using the wrong CN in their certs (probably because they are cheap and re-using a cert and rely on people disabling host verification or lack knowledge).
+ Note that disabling this is a security risk and you should consider getting a usenet provider that has a proper certificate. +
+
+ nZEDb_SSL_ALLOW_SELF_SIGNED=="true"}checked="checked"{/if} /> +
+ Enabling this will not verify self-signed openssl certificates.
+ Note that you will require non self-signed certificates for sabnzbd/nzbget/etc if you disable this. +
+
+
+ {if $cfg->error} +
+ The following error was encountered:
+ • {$cfg->error}


+
+ {/if} + +
+
+{/if} \ No newline at end of file diff --git a/www/install/templates/step4.tpl b/www/install/templates/step4.tpl new file mode 100755 index 000000000..e5e6ffd3e --- /dev/null +++ b/www/install/templates/step4.tpl @@ -0,0 +1,98 @@ +{if $page->isSuccess()} +
+

The news server setup is correct, you may continue to the next step.

+
+
+{else} +
+

If you have a primary news server (NNTP), please provide the following information (make sure the information is correct, some servers do not check if the password is good):

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
e.g. eu.news.astraweb.com
+
+ +
+ +
e.g. 119 or 443,563 for SSL
+
+ NNTP_SSLENABLED=="true"}checked="checked"{/if} /> +
+ +
Seconds to time out when we lost connection to usenet. Default is 120 seconds.
+
+

(optional) If you have an alternate news server (NNTP), please provide the following information (make sure the information is correct, some servers do not check if the password is good):

+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
e.g. eu.news.astraweb.com
+
+ +
+ +
e.g. 119 or 443,563 for SSL
+
+ NNTP_SSLENABLED_A=="true"}checked="checked"{/if} /> +
+ +
Seconds to time out when we lost connection to usenet. Default is 120 seconds.
+
+
+ {if $cfg->error} +
+ The following error was encountered:
+ • {$cfg->error}


+
+ {/if} + +
+
+{/if} \ No newline at end of file diff --git a/www/install/templates/step5.tpl b/www/install/templates/step5.tpl new file mode 100755 index 000000000..19066c02c --- /dev/null +++ b/www/install/templates/step5.tpl @@ -0,0 +1,17 @@ +
+{if !$cfg->error} +

The configuration file has been saved, you may continue to the next step.

+
+{else} + {if !$cfg->saveConfigCheck} +

Error saving {$cfg->nZEDb_WWW}/config.php.

+

Please save the config.php yourself by creating:
{$cfg->nZEDb_WWW}/config.php
and setting its contents to the following:

+

+ {/if} + {if !$cfg->saveLockCheck} +
+

Error saving {$cfg->INSTALL_DIR}/install.lock

+

Please save the install.lock yourself by creating:
{$cfg->INSTALL_DIR}/install.lock

+ {/if} +{/if} +
diff --git a/www/install/templates/step6.tpl b/www/install/templates/step6.tpl new file mode 100755 index 000000000..3a1ebe605 --- /dev/null +++ b/www/install/templates/step6.tpl @@ -0,0 +1,54 @@ +{if $page->isSuccess()} +
+

The admin user has been setup, you may continue to the next step.

+
+
+{else} + +

This will set up an administrator account you can use to change site settings.

+ +
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ {if $cfg->error} +
+ The following error(s) were encountered:
+ {if $cfg->ADMIN_USER == ''}• Invalid username
{/if} + {if $cfg->ADMIN_PASS == ''}• Invalid password
{/if} + {if $cfg->ADMIN_EMAIL == ''}• Invalid email
{/if} +
+
+ {/if} + +
+
+ +{/if} diff --git a/www/install/templates/step7.tpl b/www/install/templates/step7.tpl new file mode 100755 index 000000000..ac9ae64d9 --- /dev/null +++ b/www/install/templates/step7.tpl @@ -0,0 +1,58 @@ +{if $page->isSuccess()} +
+

Install Complete!

+
+

Continue to the admin home page to give your site a name and learn how to start indexing usenet.

+
+{else} + +

You must accept or change these file paths. This is the location where your covers, NZB, and temporary files are stored:

+
+ + + + + + + + + + + + + +
+ +
+ {if $cfg->error} +
+ The following error was encountered:
+
+ {if !$cfg->nzbPathCheck} + + The installer cannot write to {$cfg->NZB_PATH}.
+ A quick solution is to run:
+ chmod -R 777 {$cfg->NZB_PATH} + {$fixString} {$cfg->NZB_PATH} +

+
+ {/if} + {if !$cfg->coverPathCheck}
The installer cannot write to {$cfg->COVERS_PATH}. A quick solution is to run:
chmod -R 777 {$cfg->COVERS_PATH}

{/if} + {if !$cfg->unrarPathCheck} + + The installer cannot write to {$cfg->UNRAR_PATH}.
+ A quick solution is to run:
+ chmod -R 777 {$cfg->UNRAR_PATH} + {$fixString} {$cfg->UNRAR_PATH} +

+
+ {/if} +
+
+ {/if} + +
+ +
+ +{/if}