### Quick Start Commands
Source: https://github.com/nntmux/newznab-tmux/blob/master/DOCKER.md
Commands to initialize the environment, start containers, and perform initial application setup.
```bash
# 1. Copy and configure your environment
cp .env.example .env
# Edit .env — set DB credentials, COMPOSER_AUTH, and uncomment the
# "Docker service hostnames" block at the bottom.
# 2. Build and start
make build
make up
# 3. Install NNTmux (first run only)
make artisan cmd="nntmux:install"
# 4. Build frontend assets
make npm-build
```
--------------------------------
### Enable and Start Systemd Service
Source: https://github.com/nntmux/newznab-tmux/wiki/IRC-Pre-Channels
After creating the systemd service file, enable it to start on boot and then start it immediately. Use 'sudo' for these commands.
```bash
sudo systemctl enable nntmux-irc
```
```bash
sudo systemctl start nntmux-irc
```
--------------------------------
### Install and Run MySQLTuner
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Download and execute mysqltuner.pl to get recommendations for optimizing your MySQL/MariaDB server configuration.
```bash
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
perl mysqltuner.pl
```
--------------------------------
### Install MariaDB Server and Client
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Installs the MariaDB database server and client tools after the repository has been configured. Includes a step to secure the installation.
```bash
sudo apt update
sudo apt install -y mariadb-server mariadb-client
sudo mysql_secure_installation
```
--------------------------------
### Start and Enable ManticoreSearch Service
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Enable the ManticoreSearch service to start on boot and then start the service immediately.
```bash
sudo systemctl enable manticore
sudo systemctl start manticore
```
--------------------------------
### Install Nginx
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Installs the Nginx web server. This is the recommended option for NNTmux.
```bash
sudo apt install -y nginx
```
--------------------------------
### Start and Enable Redis Server
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Ensure the Redis server is running and configured to start automatically on system boot.
```bash
sudo systemctl enable redis-server
sudo systemctl start redis-server
```
--------------------------------
### Install Composer
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Downloads and installs Composer, the dependency manager for PHP, globally.
```bash
cd ~
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --version
```
--------------------------------
### Clone and Install NNTmux
Source: https://github.com/nntmux/newznab-tmux/wiki/Home
Steps to clone the repository, configure environment variables, and run the installer.
```bash
git clone https://github.com/NNTmux/newznab-tmux.git
cd newznab-tmux
cp .env.example .env
nano .env # Edit with your settings
php artisan nntmux:install
php artisan tmux:start
```
--------------------------------
### Install NNTmux
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Executes the fresh installation process for NNTmux. This command should be used when setting up NNTmux for the first time.
```bash
php artisan nntmux:install
```
--------------------------------
### Install Apache and PHP Module
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Installs the Apache web server and the PHP module for Apache.
```bash
sudo apt install -y apache2 libapache2-mod-php8.3
```
--------------------------------
### Install Frontend Dependencies
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Install the necessary Node.js dependencies for frontend development using npm.
```bash
npm install
```
--------------------------------
### Install Essential Prerequisites
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Installs necessary command-line tools for managing software repositories, version control, file transfer, and compression.
```bash
sudo apt install -y software-properties-common git make curl wget unzip
```
--------------------------------
### Get MySQL Version
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Display the installed MySQL client version.
```bash
mysql --version
```
--------------------------------
### Install Node.js
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Installs Node.js version 20.x and npm using NodeSource repository.
```bash
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
node --version
npm --version
```
--------------------------------
### Install Composer Globally
Source: https://github.com/nntmux/newznab-tmux/wiki/Installing-Composer
Follow these commands to install Composer globally on your system. Ensure you have the necessary permissions.
```bash
cd /var/www
sudo chmod 777 .
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r 'if (hash_file("SHA384", "composer-setup.php") === preg_filter("#^.*?
|
.*$#s", "", file_get_contents("https://composer.github.io/pubkeys.html"))) { echo "Installer verified"; } else { echo "Installer corrupt"; unlink("composer-setup.php"); } echo PHP_EOL;'
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
php -r "unlink('composer-setup.php');"
composer -V
```
--------------------------------
### Install Required Software Tools
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Installs essential command-line tools required for NNTmux functionality.
```bash
sudo apt install -y p7zip-full mediainfo lame ffmpeg tmux
```
--------------------------------
### Install Common PHP Extensions
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Installs essential PHP extensions using apt for Debian/Ubuntu systems. Verify installation by checking the loaded modules.
```bash
sudo apt install php8.3-{curl,mbstring,xml,zip,gd,intl,pcntl,mysql}
php -m | grep -i extension_name
```
--------------------------------
### Configure Environment and Generate Key
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Copy the example environment file and generate an application key. This sets up your application's configuration.
```bash
cp .env.example .env
php artisan key:generate
```
--------------------------------
### Start Laravel Horizon
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Launches the Laravel Horizon supervisor, which manages and monitors your queues. This is the primary command to start Horizon.
```bash
php artisan horizon
```
--------------------------------
### Start NNTmux Processing
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Navigate to the NNTmux directory and run the artisan command to start the background processing and indexing tasks.
```bash
cd /var/www/nntmux
php artisan tmux:start
```
--------------------------------
### Install Tmux Session Manager
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Navigate to the NNTmux directory and run the included installation script to set up Tmux for managing background processes.
```bash
cd /var/www/nntmux
./install_tmux.sh
```
--------------------------------
### Download and Run MySQLTuner
Source: https://github.com/nntmux/newznab-tmux/wiki/Database-Tuning
Instructions for downloading MySQLTuner and running it to get database performance recommendations. Ensure the database has been running for at least 24 hours before execution.
```bash
# Download
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
# Run (after database has been running for 24+ hours)
perl mysqltuner.pl --user root --pass yourpassword
```
--------------------------------
### Start MariaDB Service
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Starts the MariaDB database service if it is not running.
```bash
sudo systemctl start mariadb
```
--------------------------------
### Install PHP 8.3 and Extensions
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Installs PHP 8.3 core components, development tools, and a comprehensive set of common extensions required by web applications. Also installs Redis server.
```bash
sudo apt install -y php8.3-cli php8.3-dev php8.3-common php8.3-curl \
php8.3-gd php8.3-mysql php8.3-mbstring php8.3-xml php8.3-intl \
php8.3-fpm php8.3-bcmath php8.3-zip php8.3-imagick php8.3-redis \
php-pear redis-server
```
--------------------------------
### Create NNTmux Environment File
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Copies the example environment file to `.env` and opens it for editing.
```bash
cp .env.example .env
nano .env
```
--------------------------------
### Install ManticoreSearch (Debian/Ubuntu)
Source: https://github.com/nntmux/newznab-tmux/wiki/Search-Engines
Installs ManticoreSearch and its dependencies on Debian/Ubuntu systems. Ensure the repository is added before installation.
```bash
# Add repository (Debian/Ubuntu)
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo dpkg -i manticore-repo.noarch.deb
sudo apt update
# Install
sudo apt install manticore manticore-columnar-lib
# Start service
sudo systemctl enable manticore
sudo systemctl start manticore
# Verify
mysql -h 127.0.0.1 -P 9306 -e "SHOW STATUS"
```
--------------------------------
### Start and Manage Supervisor Processes
Source: https://github.com/nntmux/newznab-tmux/wiki/Laravel-Horizon
After creating the Supervisor configuration file, use these commands to reload Supervisor's configuration, update the process list, and start the Laravel Horizon processes.
```bash
sudo supervisorctl reread
```
```bash
sudo supervisorctl update
```
```bash
sudo supervisorctl start laravel-horizon:*
```
--------------------------------
### Get Help for a Command
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Run any NNTmux Artisan command with the -h or --help flag to get detailed options and usage information.
```bash
php artisan command:name --help
```
--------------------------------
### Get NNTmux Version
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Display the installed version of NNTmux using the Artisan command.
```bash
php artisan --version
```
--------------------------------
### Install ManticoreSearch Dependencies
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Download and install the ManticoreSearch repository and packages using apt. This ensures all necessary components are present.
```bash
wget https://repo.manticoresearch.com/manticore-repo.noarch.deb
sudo dpkg -i manticore-repo.noarch.deb
sudo apt update
sudo apt install -y manticore manticore-columnar-lib
```
--------------------------------
### Deploy Production Environment
Source: https://github.com/nntmux/newznab-tmux/blob/master/DOCKER.md
Initializes the production docker-compose configuration and starts the services in detached mode.
```bash
cp docker-compose.yml.prod-dist docker-compose.yml
# Edit .env for production settings
docker compose up -d
```
--------------------------------
### Install Supervisor
Source: https://github.com/nntmux/newznab-tmux/wiki/Laravel-Horizon
Use this command to install Supervisor on Ubuntu systems. Supervisor is a process control system that will automatically restart your queue:work process if it fails.
```bash
sudo apt-get install supervisor
```
--------------------------------
### Verify Unrar Installation
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Checks the installed version of `unrar` to confirm successful installation.
```bash
unrar --version
```
--------------------------------
### Configure Supervisor for Laravel Queue Worker
Source: https://github.com/nntmux/newznab-tmux/wiki/Email-queue
This is an example Supervisor configuration file for monitoring a Laravel queue worker. Adjust 'command' and 'user' as needed for your NNTmux setup. Ensure the log file path is correct.
```ini
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/NNTmux/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=your user here
numprocs=8
redirect_stderr=true
stdout_logfile=/var/www/NNTmux/storage/logs/worker.log
```
--------------------------------
### Install Elasticsearch (Debian/Ubuntu)
Source: https://github.com/nntmux/newznab-tmux/wiki/Search-Engines
Installs Elasticsearch on Debian/Ubuntu systems. Remember to configure JVM memory settings.
```bash
# Add repository
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
# Install
sudo apt update
sudo apt install elasticsearch
# Configure memory (edit /etc/elasticsearch/jvm.options)
# -Xms2g
# -Xmx2g
# Start service
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch
# Verify
curl -X GET "localhost:9200/_cluster/health?pretty"
```
--------------------------------
### Install Elasticsearch
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Install Elasticsearch version 8.x for NNTmux. This involves adding the Elastic repository and installing the package.
```bash
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list
sudo apt update && sudo apt install elasticsearch
```
--------------------------------
### MariaDB Configuration for Small Installations
Source: https://github.com/nntmux/newznab-tmux/wiki/Database-Tuning
Recommended MariaDB configuration for small installations with less than 1 million releases and 16GB of RAM. Adjust InnoDB settings, connection limits, and buffer sizes for optimal performance.
```ini
[mysqld]
# InnoDB Settings
innodb_buffer_pool_size = 8G
innodb_buffer_pool_instances = 8
innodb_log_file_size = 512M
innodb_log_buffer_size = 64M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
innodb_io_capacity = 2000
innodb_io_capacity_max = 4000
# Query Cache (disable for MariaDB 10.2+)
query_cache_type = 0
query_cache_size = 0
# Connections
max_connections = 200
thread_cache_size = 50
# Temp Tables
tmp_table_size = 256M
max_heap_table_size = 256M
# Buffer Sizes
join_buffer_size = 4M
sort_buffer_size = 4M
read_buffer_size = 2M
read_rnd_buffer_size = 4M
# Table Cache
table_open_cache = 4000
table_definition_cache = 2000
# Logging
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 2
```
--------------------------------
### Install Latest Unrar Version
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Downloads, compiles, and installs the latest version of `unrar` from source, as the repository version may be outdated.
```bash
mkdir -p ~/unrar_install && cd ~/unrar_install
wget https://www.rarlab.com/rar/rarlinux-x64-701.tar.gz
tar -xzf rarlinux-x64-701.tar.gz
sudo cp rar/unrar /usr/local/bin/
sudo chmod 755 /usr/local/bin/unrar
cd ~ && rm -rf ~/unrar_install
```
--------------------------------
### Check for Missing PHP Extensions
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Use this command to list installed PHP extensions and identify any missing ones. If an extension is missing, use the provided apt command to install it.
```bash
php -m | grep -i extension_name
```
```bash
sudo apt install php8.3-extensionname
```
--------------------------------
### Start IRC Scraper Manually
Source: https://github.com/nntmux/newznab-tmux/wiki/IRC-Pre-Channels
Use these Artisan commands to manually start the IRC scraper or test the connection without active scraping. Ensure you are in the project's root directory.
```bash
# Start IRC scraper
php artisan nntmux:irc
```
```bash
# Test connection without scraping
php artisan nntmux:irc-test
```
--------------------------------
### Example Sorting API Requests
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Common query patterns for searching and filtering releases with sorting.
```text
/api/v2/search?api_token=&id=ubuntu&sort=posted_desc
/api/v2/search?api_token=&id=ubuntu&sort=name_asc
/api/v2/tv?api_token=&id=last+week+tonight&season=2025&ep=11/10&sort=posted_desc
/api/v2/movies?api_token=&imdbid=tt0816692&sort=size_desc
```
--------------------------------
### Run Additional Postprocessing for a Release
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Performs additional postprocessing steps for a specific release, identified by its GUID. Requires the --guid option.
```bash
php artisan releases:additional --guid=abc123
```
--------------------------------
### Clone Repository and Install Dependencies
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Clone the NNTmux repository and install PHP dependencies using Composer. Ensure you are in the project directory after cloning.
```bash
git clone https://github.com/NNTmux/newznab-tmux.git
cd newznab-tmux
composer install --no-dev --optimize-autoloader
```
--------------------------------
### Start Tmux as Correct User
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Start the tmux server as the intended user, ensuring correct file permissions for subsequent operations.
```bash
su - youruser -c "cd /var/www/nntmux && php artisan tmux:start"
```
--------------------------------
### Switch CAPTCHA Provider Example
Source: https://github.com/nntmux/newznab-tmux/blob/master/CAPTCHA_CONFIGURATION.md
Example of switching from reCAPTCHA to Turnstile by updating the .env file. Remember to clear the config cache after making changes.
```env
# Change this
CAPTCHA_PROVIDER=turnstile
# Enable Turnstile
TURNSTILE_ENABLED=true
TURNSTILE_SITEKEY=your_turnstile_sitekey
TURNSTILE_SECRET=your_turnstile_secret
# Disable reCAPTCHA
NOCAPTCHA_ENABLED=false
```
--------------------------------
### Frontend Development with Hot Reload
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Start the frontend development server with hot module replacement enabled for rapid iteration.
```bash
npm run dev
```
--------------------------------
### Configure MariaDB Repository
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Sets up the MariaDB 11.4 repository for Ubuntu 24.04 (Noble). Adjust 'noble' to 'jammy' for Ubuntu 22.04. This ensures `apt` can find and install MariaDB packages.
```bash
sudo tee /etc/apt/sources.list.d/mariadb.sources <>> DB::table('predb')->where('title', 'like', '%Release.Name%')->first();
```
--------------------------------
### Schedule Artisan Commands with Crontab
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
This example shows how to add the Artisan scheduler to your crontab to run scheduled tasks automatically. It ensures that tasks like `schedule:run` are executed at defined intervals.
```bash
* * * * * cd /var/www/nntmux && php artisan schedule:run >> /dev/null 2>&1
```
--------------------------------
### Systemd Service for NNTmux IRC Scraper
Source: https://github.com/nntmux/newznab-tmux/wiki/IRC-Pre-Channels
Create a systemd service file to ensure the NNTmux IRC scraper runs persistently in the background. This requires root privileges for enabling and starting the service.
```ini
# /etc/systemd/system/nntmux-irc.service
[Unit]
Description=NNTmux IRC Pre Scraper
After=network.target
[Service]
Type=simple
User=www-data
WorkingDirectory=/var/www/nntmux
ExecStart=/usr/bin/php artisan nntmux:irc
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
```
--------------------------------
### Configure Database Connection
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Set your database connection details in the .env file. Ensure the database server is running and accessible.
```env
DB_CONNECTION=mariadb
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=nntmux
DB_USERNAME=nntmux
DB_PASSWORD=YourDatabasePassword
```
--------------------------------
### Cache Configuration for Production
Source: https://github.com/nntmux/newznab-tmux/wiki/Configuration
For production environments, it is recommended to cache your configuration, routes, and views for performance.
```bash
php artisan config:cache
```
```bash
php artisan route:cache
```
```bash
php artisan view:cache
```
--------------------------------
### Install Certbot for Nginx SSL
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Install Certbot and the Nginx plugin to obtain and manage free SSL certificates for your domain.
```bash
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-domain.com
```
--------------------------------
### Configure NNTP Server Settings
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Provide your Usenet provider's connection details. Verify the server address, port, and authentication credentials.
```env
NNTP_SERVER=news.your-provider.com
NNTP_PORT=563
NNTP_SSLENABLED=true
NNTP_USERNAME=your_usenet_username
NNTP_PASSWORD=your_usenet_password
NNTP_SOCKET_TIMEOUT=120
```
--------------------------------
### Start Queue Worker
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Starts a worker process to handle and execute jobs from the queue. Essential for background task processing.
```bash
php artisan queue:work
```
--------------------------------
### Run Database Migrations
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Apply database migrations to set up the necessary tables for NNTmux. This command should be run after configuring your .env file.
```bash
php artisan migrate
```
--------------------------------
### Create Custom MariaDB Configuration
Source: https://github.com/nntmux/newznab-tmux/wiki/Database-Tuning
Create a custom configuration file for MariaDB. This is the first step before applying any tuning settings.
```bash
sudo nano /etc/mysql/mariadb.conf.d/99-nntmux.cnf
```
--------------------------------
### Apply and Verify MariaDB Configuration Changes
Source: https://github.com/nntmux/newznab-tmux/wiki/Database-Tuning
Commands to check MariaDB configuration syntax, restart the service, and verify specific settings like 'innodb_buffer_pool_size'.
```bash
# Check configuration syntax
mysqld --verbose --help > /dev/null
# Restart MariaDB
sudo systemctl restart mariadb
# Verify settings
mysql -e "SHOW VARIABLES LIKE 'innodb_buffer_pool_size';"
```
--------------------------------
### Create NNTmux Database and User
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Connects to MariaDB and creates a dedicated database and user for NNTmux, granting all necessary privileges. Remember to replace 'YourPassword' with a strong password.
```sql
-- Create database
CREATE DATABASE nntmux CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Create user (replace 'YourPassword' with a strong password)
CREATE USER 'nntmux'@'localhost' IDENTIFIED BY 'YourPassword';
-- Grant privileges
GRANT ALL PRIVILEGES ON nntmux.* TO 'nntmux'@'localhost';
FLUSH PRIVILEGES;
-- Exit
EXIT;
```
--------------------------------
### Troubleshooting Commands
Source: https://github.com/nntmux/newznab-tmux/blob/master/DOCKER.md
Common Makefile commands used to resolve permission, configuration, and container state issues.
```text
make fix-permissions
```
```text
make fix-permissions, then re-run make composer-install
```
```text
make fix-permissions
```
```text
make fix-permissions
```
```text
WWWUSER=$(id -u) / WWWGROUP=$(id -g) in .env, then make rebuild
```
```text
make cache-clear and prefer make optimize (dev-safe) over optimize-deploy in development
```
```text
APP_PORT, FORWARD_DB_PORT, etc. in .env
```
```text
make logs to inspect, or make rebuild to start fresh
```
```text
make update (pulls base images + rebuild + restart)
```
```text
make fresh (destroys all volumes; add FORCE=1 for non-interactive)
```
```text
make fresh FORCE=1 or make nuke FORCE=1 to skip prompts
```
```text
make root-shell then supervisorctl status to verify socket path
```
--------------------------------
### Verify Binary and Part Counts
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
SQL queries to check if binaries and parts have been downloaded and stored in the database.
```sql
SELECT COUNT(*) FROM binaries;
SELECT COUNT(*) FROM parts;
```
--------------------------------
### Create Elasticsearch Indexes
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Run the artisan command to create the necessary indexes in Elasticsearch.
```bash
php artisan nntmux:create-es-indexes
```
--------------------------------
### Check Public Build Directory Permissions
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
List the contents of the `public/build/` directory to check for asset loading issues.
```bash
ls -la public/build/
```
--------------------------------
### NNTmux Database Configuration
Source: https://github.com/nntmux/newznab-tmux/wiki/Configuration
Set up your database connection details, including the type, host, port, database name, username, and password.
```env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nntmux
DB_USERNAME=nntmux
DB_PASSWORD=your_secure_password
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
```
--------------------------------
### Create ManticoreSearch Directories
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Create necessary directories for ManticoreSearch data and logs, and set appropriate ownership.
```bash
sudo mkdir -p /var/lib/manticore/data
sudo mkdir -p /var/log/manticore
sudo chown -R manticore:manticore /var/lib/manticore /var/log/manticore
```
--------------------------------
### GET /anime
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Searches for anime using various identifiers.
```APIDOC
## GET /anime
### Description
Searches for anime.
### Method
GET
### Endpoint
/anime
### Parameters
#### Query Parameters
- **id, anidbid, anilistid** (string) - Optional - Selectors
```
--------------------------------
### GET /books
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Searches for books using a required id.
```APIDOC
## GET /books
### Description
Searches for books.
### Method
GET
### Endpoint
/books
### Parameters
#### Query Parameters
- **id** (string) - Required - Query string identifier
```
--------------------------------
### GET /audio
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Searches for audio content using a required id.
```APIDOC
## GET /audio
### Description
Searches for audio content.
### Method
GET
### Endpoint
/audio
### Parameters
#### Query Parameters
- **id** (string) - Required - Query string identifier
```
--------------------------------
### Troubleshoot Permission Denied Errors
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Correct ownership and permissions for the NNTmux storage directory to resolve 'Permission Denied' issues.
```bash
sudo chown -R $USER:www-data /var/www/nntmux/storage
sudo chmod -R 775 /var/www/nntmux/storage
```
--------------------------------
### GET /movies
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Searches for movies using identifiers and optional filters.
```APIDOC
## GET /movies
### Description
Searches for movies using imdbid, tmdbid, or traktid.
### Method
GET
### Endpoint
/movies
### Parameters
#### Query Parameters
- **imdbid, tmdbid, traktid** (string) - Optional - Identifiers
- **id, cat, maxage, minsize, sort, offset, limit** (string) - Optional - Filters
```
--------------------------------
### Set Permissions for Public Build Directory
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Ensure the web server has read and execute permissions for the `public/build/` directory and its contents.
```bash
chmod -R 755 public/build
```
--------------------------------
### Configure Cache and Queue Drivers
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Specify the drivers for caching, queueing, and session management. Redis is recommended for performance.
```env
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
```
--------------------------------
### Import Pre Data from PreDB Dumps
Source: https://github.com/nntmux/newznab-tmux/wiki/IRC-Pre-Channels
Import release data from a downloaded predb.ovh CSV dump file. Ensure the file is uncompressed before running the import command with the --file option.
```bash
# Download latest dump
wget https://predb.ovh/download/predb_dump.csv.gz
gunzip predb_dump.csv.gz
# Import
php artisan nntmux:import-predb --file=predb_dump.csv
```
--------------------------------
### GET /capabilities
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Retrieves the public capabilities of the API. This is the only endpoint that does not require an api_token.
```APIDOC
## GET /capabilities
### Description
Returns the public capabilities of the API. This endpoint is public and does not require authentication.
### Method
GET
### Endpoint
/api/v2/capabilities
```
--------------------------------
### Create a Feature Branch
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Branch off the current commit to start working on a new feature.
```git
git checkout -b feature/your-feature
```
--------------------------------
### GET /tv
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Searches for TV shows using various identifiers and optional filters.
```APIDOC
## GET /tv
### Description
Searches for TV shows using identifiers like vid, tvdbid, traktid, rid, tvmazeid, imdbid, or tmdbid.
### Method
GET
### Endpoint
/tv
### Parameters
#### Query Parameters
- **vid, tvdbid, traktid, rid, tvmazeid, imdbid, tmdbid** (string) - Optional - Identifiers
- **season, ep, cat, maxage, minsize, sort, offset, limit** (string) - Optional - Filters
```
--------------------------------
### Apply PHP style fixes with Pint
Source: https://github.com/nntmux/newznab-tmux/blob/master/AGENTS.md
Formats only the changed PHP files using the project's Pint configuration.
```bash
./vendor/bin/pint --dirty # Format only changed files
```
--------------------------------
### Reprocess Specific TV Release
Source: https://github.com/nntmux/newznab-tmux/wiki/Home
Command to reprocess a single TV release identified by its GUID.
```bash
php artisan tv:reprocess --guid=xxx
```
--------------------------------
### Rebuild RT Tables
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/manticore-ubuntu-package.md
Recreate Real-Time tables if they remain inaccessible after binlog quarantine.
```bash
php artisan manticore:create-indexes --drop
php artisan nntmux:populate --manticore --all
```
--------------------------------
### GET /search
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Performs a text search or browse mode depending on the presence of the id parameter.
```APIDOC
## GET /search
### Description
Performs a text search if an id is provided, or browse mode if omitted. Includes API usage counters in response headers.
### Method
GET
### Endpoint
/search
### Parameters
#### Query Parameters
- **id** (string) - Optional - Text search identifier
```
--------------------------------
### Show Roles and Permissions
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Displays a table listing all available roles and their associated permissions within the system. Useful for auditing.
```bash
php artisan permission:show
```
--------------------------------
### Configure API Keys for Metadata Providers
Source: https://github.com/nntmux/newznab-tmux/wiki/TV-Movie-Processing
API keys for metadata providers are configured in the .env file. Ensure you replace placeholders with your actual keys.
```env
TMDB_API_KEY=your_key_here
TVDB_API_KEY=your_key_here
TRAKT_CLIENT_ID=your_key_here
TRAKT_CLIENT_SECRET=your_secret_here
OMDB_API_KEY=your_key_here
```
--------------------------------
### Populate AniList Data
Source: https://github.com/nntmux/newznab-tmux/wiki/TV-Movie-Processing
Execute this artisan command to populate data from AniList, likely for anime series.
```bash
php artisan nntmux:populate-anidb
```
--------------------------------
### Manually Process Releases
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Manually trigger the processing of releases, which can be useful for initial setup or troubleshooting.
```bash
php artisan nntmux:process-releases
```
--------------------------------
### Reprocess a Specific Release
Source: https://github.com/nntmux/newznab-tmux/wiki/TV-Movie-Processing
Reprocess a single release using its GUID. This is useful after manual updates or corrections.
```bash
php artisan tv:reprocess --guid=
```
--------------------------------
### NNTmux Queue, Cache, and Session Configuration
Source: https://github.com/nntmux/newznab-tmux/wiki/Configuration
Configure the drivers for your queue, cache, and session management. Redis is a common choice for all three.
```env
# Queue driver: sync, database, redis, beanstalkd
QUEUE_CONNECTION=redis
# Cache driver: file, redis, memcached, database
CACHE_DRIVER=redis
# Session driver
SESSION_DRIVER=redis
```
--------------------------------
### Check live process limits
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/manticore-ubuntu-package.md
Verify the limits currently applied to the active searchd process.
```bash
pid=$(systemctl show manticore -p MainPID --value)
if [ "$pid" != "0" ]; then sudo grep -E 'open files|max user processes' /proc/$pid/limits; fi
```
--------------------------------
### Manage Supervisor Processes
Source: https://github.com/nntmux/newznab-tmux/wiki/Email-queue
Commands to reload Supervisor configuration, update running processes, and start the 'laravel-worker' group.
```bash
sudo supervisorctl reread
```
```bash
sudo supervisorctl update
```
```bash
sudo supervisorctl start laravel-worker:*
```
--------------------------------
### Count Documents in Elasticsearch
Source: https://github.com/nntmux/newznab-tmux/wiki/Search-Engines
Use curl to query the Elasticsearch API and get the document count for the 'nntmux' index.
```bash
curl localhost:9200/nntmux/_count
```
--------------------------------
### Apply systemd override
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/manticore-ubuntu-package.md
Create a systemd override file to increase file descriptor and process limits for the Manticore service.
```bash
sudo install -d -m 0755 /etc/systemd/system/manticore.service.d
cat <<'EOF' | sudo tee /etc/systemd/system/manticore.service.d/override.conf
[Service]
LimitNOFILE=1048576
LimitNPROC=65535
EOF
sudo systemctl daemon-reload
```
--------------------------------
### Import NZB Files
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Imports NZB files from a specified directory into the system. Ensure the path is correct.
```bash
php artisan nntmux:import-nzbs --path=/path/to/nzbs
```
--------------------------------
### Quarantine Corrupted Binlogs
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/manticore-ubuntu-package.md
Move binlog files to a quarantine directory to allow the service to start from flushed table data.
```bash
stamp=$(date +%Y%m%d-%H%M%S)
sudo install -d -m 0755 /var/lib/manticore/binlog-quarantine-$stamp
sudo find /var/lib/manticore/data -maxdepth 1 -type f \
\( -name 'binlog*' -o -name '*.binlog*' \) \
-exec mv -t /var/lib/manticore/binlog-quarantine-$stamp {} +
sudo systemctl start manticore
sudo systemctl status manticore --no-pager
sudo journalctl -u manticore -n 100 --no-pager
sudo dpkg --configure -a
```
--------------------------------
### Manually Connect to MariaDB
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Attempts to connect to the MariaDB database using the command-line client.
```bash
mysql -u nntmux -p
```
--------------------------------
### Count Releases in ManticoreSearch
Source: https://github.com/nntmux/newznab-tmux/wiki/Search-Engines
Query ManticoreSearch directly using the MySQL client to get the total count of releases in the index.
```bash
mysql -h 127.0.0.1 -P 9306 -e "SELECT COUNT(*) FROM releases"
```
--------------------------------
### API Response with Sorting Headers
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/nntmux_api_v2.md
Example HTTP response showing pagination and quota headers alongside the sorted JSON payload.
```http
HTTP/1.1 200 OK
Content-Type: application/json
X-Total-Count: 2
X-Api-Current: 0
X-Api-Max: 100
X-Grab-Current: 0
X-Grab-Max: 100
X-Api-Oldest-Time:
X-Grab-Oldest-Time:
[
{ "title": "Ubuntu ISO x64", "size": 734003200 },
{ "title": "Ubuntu ISO x86", "size": 367001600 }
]
```
--------------------------------
### Disable Buddy Service
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/manticore-ubuntu-package.md
Temporarily disable the Buddy process to allow the search daemon to start if it continues to crash after increasing file limits.
```bash
sudo cp -a /etc/manticoresearch/manticore.conf /etc/manticoresearch/manticore.conf.before-buddy-disable
sudo perl -0pi -e 's/^\s*#?\s*buddy_path\s*=.*$/\tbuddy_path\t\t=/' /etc/manticoresearch/manticore.conf
sudo searchd --config /etc/manticoresearch/manticore.conf --check
sudo systemctl restart manticore
sudo systemctl status manticore --no-pager
sudo dpkg --configure -a
```
--------------------------------
### Essential .env Configuration Settings
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Configure essential application settings in the .env file, including database credentials, Usenet server details, API keys for metadata services, and search engine preferences.
```env
# Application
APP_NAME=NNTmux
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-domain.com
# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nntmux
DB_USERNAME=nntmux
DB_PASSWORD=your_secure_password
# Usenet Server
NNTP_SERVER=news.your-provider.com
NNTP_PORT=563
NNTP_SSLENABLED=true
NNTP_USERNAME=your_username
NNTP_PASSWORD=your_password
# API Keys (obtain from respective services)
TMDB_API_KEY=your_tmdb_key
TVDB_API_KEY=your_tvdb_key
TVMAZE_API_KEY= # Optional, no key required for basic usage
TRAKT_CLIENT_ID=your_trakt_client_id
TRAKT_CLIENT_SECRET=your_trakt_secret
OMDB_API_KEY=your_omdb_key
FANART_API_KEY=your_fanart_key
GIANTBOMB_API_KEY=your_giantbomb_key
# Search Engine (choose one)
SEARCH_ENGINE=manticore # Options: manticore, elasticsearch
MANTICORE_HOST=127.0.0.1
MANTICORE_PORT=9308
# Or for Elasticsearch:
# ELASTICSEARCH_HOST=127.0.0.1
# ELASTICSEARCH_PORT=9200
# IRC Pre Scraping (optional)
SCRAPE_IRC_SERVER=irc.synirc.net
SCRAPE_IRC_PORT=6697
SCRAPE_IRC_TLS=true
SCRAPE_IRC_USERNAME=YourUniqueNick
```
--------------------------------
### Perform Emergency Recovery Backup
Source: https://github.com/nntmux/newznab-tmux/blob/master/docs/manticore-ubuntu-package.md
Stop application traffic and create a comprehensive backup of logs, configuration, and data before attempting further recovery or reporting a bug.
```bash
php artisan tmux:stop
php artisan horizon:terminate
sudo systemctl stop manticore || true
sudo systemctl reset-failed manticore
stamp=$(date +%Y%m%d-%H%M%S)
sudo install -d -m 0755 /root/manticore-recovery/$stamp
sudo journalctl -u manticore -b --no-pager > /root/manticore-recovery/$stamp/journal.log
sudo cp -a /var/log/manticore /root/manticore-recovery/$stamp/logs
sudo cp -a /etc/manticoresearch/manticore.conf /root/manticore-recovery/$stamp/manticore.conf
sudo tar -C /var/lib -czf /root/manticore-recovery/$stamp/manticore-var-lib-before-recovery.tgz manticore
if command -v coredumpctl >/dev/null 2>&1; then
sudo coredumpctl info searchd > /root/manticore-recovery/$stamp/coredumpctl-info.txt || true
fi
```
--------------------------------
### Update NNTmux from Git Repository
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Updates the NNTmux installation by pulling the latest changes from its git repository. This command focuses solely on the git source.
```bash
php artisan nntmux:git
```
--------------------------------
### Check Show Existence in Database
Source: https://github.com/nntmux/newznab-tmux/wiki/TV-Movie-Processing
Query the 'videos' table to check if a show with a similar title already exists in the database.
```sql
SELECT id, title, tmdb, tvdb FROM videos WHERE title LIKE '%Show Name%';
```
--------------------------------
### Update Composer and Install Packages
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Use this command to update Composer and then clear its cache and reinstall packages, resolving 'requirements could not be resolved' errors.
```bash
composer self-update
composer clear-cache
composer install --no-cache
```
--------------------------------
### Test API Keys
Source: https://github.com/nntmux/newznab-tmux/wiki/Troubleshooting
Run the Artisan command to validate the configured API keys for external services.
```bash
php artisan nntmux:test-apis
```
--------------------------------
### Post Process TV Releases via Pipeline
Source: https://github.com/nntmux/newznab-tmux/wiki/Console-Commands
Performs post-processing on TV releases using a pipeline approach based on GUID characters and providers.
```bash
php artisan postprocess:tv-pipeline
```
--------------------------------
### Import Pre Data from IRC Logs
Source: https://github.com/nntmux/newznab-tmux/wiki/IRC-Pre-Channels
Use this Artisan command to import release data from existing IRC log files. Specify the path to your log file using the --file option.
```bash
php artisan nntmux:import-pre-logs --file=/path/to/irc.log
```
--------------------------------
### Create Admin User
Source: https://github.com/nntmux/newznab-tmux/blob/master/README.md
Generate a new administrator user account for NNTmux.
```bash
php artisan nntmux:create-admin
```
--------------------------------
### Setup Laravel Scheduler Cron Job
Source: https://github.com/nntmux/newznab-tmux/wiki/Ubuntu-Install-guide
Add the Laravel scheduler command to the crontab to ensure scheduled tasks, like cleanup or updates, run automatically.
```bash
crontab -e
* * * * * cd /var/www/nntmux && php artisan schedule:run >> /dev/null 2>&1
```
--------------------------------
### Checkout Development Version
Source: https://github.com/nntmux/newznab-tmux/wiki/Installing-Composer
If you prefer to use the latest development version, checkout the master branch.
```bash
git checkout master
```
--------------------------------
### Register Nick with NickServ
Source: https://github.com/nntmux/newznab-tmux/wiki/IRC-Pre-Channels
If your nickname is already in use and registered, you can use the NickServ GHOST command to take control of it. Replace 'oldnick' and 'password' with the appropriate details.
```irc
/msg NickServ GHOST oldnick password
```