From 1eac3f2464cd980c181666539e2ee039f67ab91e Mon Sep 17 00:00:00 2001 From: bota Date: Thu, 31 Jul 2025 16:00:25 +0300 Subject: [PATCH] Issue #48: Removed documentation files Signed-off-by: bota --- docs/book/index.md | 1 - docs/book/v1/commands.md | 37 ------------- docs/book/v1/installation.md | 41 -------------- docs/book/v1/overview.md | 19 ------- docs/book/v1/server-setup.md | 104 ----------------------------------- docs/book/v1/valkey.md | 61 -------------------- 6 files changed, 263 deletions(-) delete mode 120000 docs/book/index.md delete mode 100644 docs/book/v1/commands.md delete mode 100644 docs/book/v1/installation.md delete mode 100644 docs/book/v1/overview.md delete mode 100644 docs/book/v1/server-setup.md delete mode 100644 docs/book/v1/valkey.md diff --git a/docs/book/index.md b/docs/book/index.md deleted file mode 120000 index fe84005..0000000 --- a/docs/book/index.md +++ /dev/null @@ -1 +0,0 @@ -../../README.md \ No newline at end of file diff --git a/docs/book/v1/commands.md b/docs/book/v1/commands.md deleted file mode 100644 index 0f6bbf7..0000000 --- a/docs/book/v1/commands.md +++ /dev/null @@ -1,37 +0,0 @@ -# Available commands and usage - -The commands available are: - -1. `GetFailedMessagesCommand.php (failed)` - returns logs with messages that failed to process (levelName:error) -2. `GetProcessedMessagesCommand.php (procecssed)` - returns logs with messages that were successfully processed (levelName:info) -3. `GetQueuedMessagesCommand (inventory)` - returns all queued messages from Redis stream 'messages' - -The commands can be run in two different ways: - -## CLI - -To run the commands via CLI, use the following syntax: - -`php bin/cli.php failed --start="yyyy-mm-dd" --end="yyyy-mm-dd" --limit=int` - -`php bin/cli.php processed --start="yyyy-mm-dd" --end="yyyy-mm-dd" --limit=int` - -`php bin/cli.php inventory` - -## TCP message - -To use commands using TCP messages the following messages can be used: - -`echo "failed --start=yyyy-mm-dd --end=yyyy-mm-dd --limit=days" | socat -t1 - TCP:host:port` - -`echo "processed --start=yyyy-mm-dd --end=yyyy-mm-dd --limit=days" | socat -t1 - TCP:host:port` - -In both cases the flags are optional. Keep in mind if both `start` and `end` are set, `limit` will not be applied, it's only used when one of `start` or `end` is missing. - -In order to be able to test the `processed` command, by default when processing the "control" message, it is logged as successfully processed with `"levelName":"info"` simulating that the message was processed successfully. To use it run the following message: - -`echo "control" | socat -t1 - TCP:host:port` - - > Using `-t1` flag is not necessary but can be useful, it is used to set a timeout of n seconds for both reading and writing, after n second of inactivity, socat will terminate the connection. If the timeout is not set and the server does not respond or keep the connection open, the socat process could hang indefinitely. - -`echo "inventory" | socat -t1 - TCP:host:port` diff --git a/docs/book/v1/installation.md b/docs/book/v1/installation.md deleted file mode 100644 index c2fc6b3..0000000 --- a/docs/book/v1/installation.md +++ /dev/null @@ -1,41 +0,0 @@ -# INSTALLATION - -## git clone - -`git clone -b default-queue https://github.com/dotkernel/queue.git` - -## Edit .dist files from config/autoload folder - -- local.php.dist -- log.local.dist -- messenger.local.php.dist -- swoole.local.php.dist - -## Run Composer - -`composer install --no-dev` - -## Create services ( daemon) - -- Edit the files from `/daemon` folder and set proper paths -- copy them in /etc/systemd/system/ - -`sudo cp /home/dotkernel/queue/daemon\swoole.service` - -`sudo cp /home/dotkernel/queue/daemon\messenger.service` - -## Start the daemon - -`sudo systemctl daemon-reload` - -`sudo systemctl enable swoole.service` - -`sudo systemctl start swoole.service` - -`sudo systemctl status swoole.service` - -### Testing the installation - -Send a request from your local machine - -`echo "Hello" | socat -T1 - TCP:SERVER-IP:8556` diff --git a/docs/book/v1/overview.md b/docs/book/v1/overview.md deleted file mode 100644 index 2819c80..0000000 --- a/docs/book/v1/overview.md +++ /dev/null @@ -1,19 +0,0 @@ -# Overview - -> [!IMPORTANT] -> Dotkernel component used to queue tasks to be processed asynchronously based on [netglue/laminas-messenger](https://github.com/netglue/laminas-messenger) - -## Badges - -![OSS Lifecycle](https://img.shields.io/osslifecycle/dotkernel/queue) -![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/queue/1.0) - -[![GitHub issues](https://img.shields.io/github/issues/dotkernel/queue)](https://github.com/dotkernel/queue/issues) -[![GitHub forks](https://img.shields.io/github/forks/dotkernel/queue)](https://github.com/dotkernel/queue/network) -[![GitHub stars](https://img.shields.io/github/stars/dotkernel/queue)](https://github.com/dotkernel/queue/stargazers) -[![GitHub license](https://img.shields.io/github/license/dotkernel/queue)](https://github.com/dotkernel/queue/blob/1.0/LICENSE.md) - -[![Build Status](https://github.com/mezzio/mezzio-skeleton/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/mezzio/mezzio-skeleton/actions/workflows/continuous-integration.yml) -[![codecov](https://codecov.io/gh/dotkernel/queue/graph/badge.svg?token=pexSf4wIhc)](https://codecov.io/gh/dotkernel/queue) -[![Qodana](https://github.com/dotkernel/queue/actions/workflows/qodana_code_quality.yml/badge.svg?branch=main)](https://github.com/dotkernel/queue/actions/workflows/qodana_code_quality.yml) -[![PHPStan](https://github.com/dotkernel/queue/actions/workflows/static-analysis.yml/badge.svg?branch=main)](https://github.com/dotkernel/queue/actions/workflows/static-analysis.yml) diff --git a/docs/book/v1/server-setup.md b/docs/book/v1/server-setup.md deleted file mode 100644 index 89a379f..0000000 --- a/docs/book/v1/server-setup.md +++ /dev/null @@ -1,104 +0,0 @@ -# Server setup - -> Below instructions are working only on **AlmaLinux 9** -> ->For other OS's need to be adapted accordingly - -## Starting point - -A server with AlmaLinux 9 freshly installed, with root access and updated - -### Update OS - -dnf update - -### Create a new user with sudo permissions - -`useradd dotkernel` - -`passwd dotkernel` - -`usermod -aG wheel dotkernel` - -### reboot - -### SSH to the server as new user - -### Install various utilities - -`sudo dnf install -y dnf-utils` - -`sudo dnf install zip unzip socat wget` - -### PHP - -`sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm` - -`sudo dnf module enable php:remi-8.4` - -`sudo dnf install -y php php-cli php-common php-intl` - -### Start PHP-FPM - -`sudo systemctl start php-fpm` - -`sudo systemctl enable php-fpm` - -### Install and verify swoole - -`sudo dnf install php-pecl-swoole6` - -`php -i | grep swoole` - -### Valkey - -`sudo dnf install valkey` - -`sudo systemctl enable valkey` - -`sudo systemctl start valkey` - -`sudo valkey-cli ping` - -### Valkey PHP module - -`sudo dnf install php-pecl-redis` - -`php -i | grep redis` - -### GIT - -`sudo dnf install git` - -### Composer - -`wget https://getcomposer.org/installer -O composer-installer.php` - -`sudo chmod 777 /usr/local/bin` - -`php composer-installer.php --filename=composer --install-dir=/usr/local/bin` - -### Firewall setup - -In order to add a minimum level of security, a firewall needs to be installed and allows -connections from outside only to certain ports, from certain IP's. - -> Firewall setup is not mandatory - -`sudo dnf install firewalld` - -`sudo systemctl enable firewalld` - -> Before starting the firewall, be sure you will not be locked outside - -`sudo firewall-offline-cmd --zone=public --add-port=22/tcp --permanent` - -`sudo systemctl start firewalld` - -> By default, Swoole runs on port 8556. You can change that in the configuration file. - -`sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="YOUR_IP_ADDRESS" port port="8556" protocol="tcp" accept'` - -`sudo firewall-cmd --reload` - -## NOW THE SERVER IS READY diff --git a/docs/book/v1/valkey.md b/docs/book/v1/valkey.md deleted file mode 100644 index 24bc714..0000000 --- a/docs/book/v1/valkey.md +++ /dev/null @@ -1,61 +0,0 @@ -# Valkey usage - -Valkey is an open source (BSD) high-performance key/value datastore that supports a variety of workloads such as caching, message queues, and can act as a primary database. - -The following commands can be run in the CLI to interact with Valkey. To enter CLI run: - -`valkey-cli` - -## Utility Commands - -List all keys matching a pattern. - -`KEYS *` - -Get server information and statistics. - -`INFO` - -Check if the server is running. - -`PING` - -Delete all keys in all databases - -`FLUSHALL` - -Check data type stored at a specific key (Possible types: string, list, set, zset, hash, stream) - -`TYPE keyName` - -## Key-Value Operations - -Set a string key to a value. - -`SET keyName "keyValue"` - -Get the value of a key. - -`GET keyName` - -Delete one or more keys. - -`DEL keyName1 keyName2` - -## Stream Commands - -Read entries from a stream oldest to newest (revers '-' and '+' to reverse order). - -`XRANGE streamName - +` - -Delete stream - -`DEL streamName` - -Remove all stream entries and keep stream key - -`XTRIM streamName MAXLEN 0` - -Delete specific entry - -`XDEL streamName `