Yo/README.md

147 lines
3.6 KiB
Markdown
Raw Normal View History

2023-11-25 18:00:15 +00:00
# Yo!
2023-11-19 21:00:51 +00:00
2023-11-25 18:00:15 +00:00
Micro Web Crawler in PHP & Manticore
2023-11-24 15:52:13 +00:00
2023-11-25 18:00:15 +00:00
Yo! is the super thin layer for Manticore search server that extends official [manticoresearch-php](https://github.com/manticoresoftware/manticoresearch-php) client with CLI tools and simple JS-less WebUI.
2023-11-24 15:52:13 +00:00
2023-11-26 12:19:57 +00:00
## Features
2023-11-24 15:52:13 +00:00
2023-11-26 12:19:57 +00:00
* MIME-based crawler with flexible filter settings by regular expressions, selectors, external links etc
* Page snap history with local and remote mirrors support (including FTP protocol)
* CLI tools for index administration and crontab tasks
2023-11-25 18:00:15 +00:00
* JS-less frontend to run local or public search web portal
2023-11-24 15:52:13 +00:00
* API tools to make search index distributed
2023-11-26 12:19:57 +00:00
## Components
* [Manticore Server](https://github.com/manticoresoftware/manticoresearch)
2023-11-26 12:24:38 +00:00
* [PHP library for Manticore](https://github.com/manticoresoftware/manticoresearch-php)
* [Symfony DOM crawler](https://github.com/symfony/dom-crawler)
* [Symfony CSS selector](https://github.com/symfony/css-selector)
2023-11-26 12:19:57 +00:00
* [FTP client for snap mirrors](https://github.com/YGGverse/ftp-php)
2023-11-26 12:24:38 +00:00
* [Hostname ident icons](https://github.com/dmester/jdenticon-php)
2023-11-26 12:29:20 +00:00
* [Bootstrap icons](https://icons.getbootstrap.com/)
2023-11-24 15:52:13 +00:00
2023-11-24 18:00:09 +00:00
### Install
2023-11-30 18:54:04 +00:00
Application require `manticore`, `composer` and `php`
#### Production
2023-11-30 18:55:01 +00:00
* `composer create-project yggverse/yo`
2023-11-30 18:54:04 +00:00
#### Development
* `git clone https://github.com/YGGverse/Yo.git`
2023-11-30 19:00:31 +00:00
* `cd Yo` & `composer update`
2023-11-30 18:54:04 +00:00
#### Init
* `cp example/config.json config.json`
* `php src/cli/index/init.php`
#### Usage
* `php src/cli/document/add.php URL`
* `php src/cli/document/crawl.php`
* `php src/cli/document/search.php '*'`
2023-11-24 20:26:02 +00:00
#### Web UI
1. `cd src/webui`
2. `php -S 127.0.0.1:8080`
2023-11-30 18:54:04 +00:00
3. open `http://127.0.0.1:8080` in browser
2023-11-24 18:03:12 +00:00
## Documentation
2023-11-24 18:00:09 +00:00
2023-11-24 17:55:07 +00:00
### CLI
2023-11-19 21:00:51 +00:00
2023-11-24 17:55:07 +00:00
#### Index
2023-11-19 21:00:51 +00:00
2023-11-24 17:55:07 +00:00
##### Init
2023-11-19 21:00:51 +00:00
Create initial index
```
php src/cli/index/init.php [reset]
```
* `reset` - optional, reset existing index
2023-11-24 17:55:07 +00:00
#### Document
2023-11-19 21:00:51 +00:00
2023-11-24 17:55:07 +00:00
##### Add
2023-11-19 21:00:51 +00:00
```
php src/cli/document/add.php URL
```
* `URL` - add new URL to the crawl queue
2023-11-24 17:55:07 +00:00
##### Crawl
2023-11-19 21:00:51 +00:00
```
php src/cli/document/crawl.php
```
2023-11-27 17:29:17 +00:00
##### Clean
```
php src/cli/document/clean.php
```
* make index optimization
2023-11-24 17:55:07 +00:00
##### Search
2023-11-19 21:00:51 +00:00
```
php src/cli/document/search.php '@title "*"' [limit]
```
* `query` - required
2023-11-25 02:44:07 +00:00
* `limit` - optional search results limit
##### Migration
###### YGGo
Import index from YGGo database
```
2023-11-25 11:19:34 +00:00
php src/cli/yggo/import.php 'host' 'port' 'user' 'password' 'database' [unique=off] [start=0] [limit=100]
2023-11-25 02:44:07 +00:00
```
Source DB fields required:
* `host`
* `port`
* `user`
* `password`
* `database`
2023-11-25 11:19:34 +00:00
* `unique` - optional, check for unique URL (takes more time)
* `start` - optional, offset to start queue
2023-11-25 11:42:22 +00:00
* `limit` - optional, limit queue
2023-11-30 12:32:55 +00:00
### Backup
#### Logical
2023-11-30 12:33:57 +00:00
SQL text dumps could be useful for public index distribution, but requires more computing resources.
2023-11-30 12:32:55 +00:00
[Read more](https://manual.manticoresearch.com/Securing_and_compacting_a_table/Backup_and_restore#Backup-and-restore-with-mysqldump)
#### Physical
2023-11-30 12:33:57 +00:00
Better for infrastructure administration and includes original data binaries.
2023-11-30 12:32:55 +00:00
[Read more](https://manual.manticoresearch.com/Securing_and_compacting_a_table/Backup_and_restore#Using-manticore-backup-command-line-tool)
2023-11-25 11:42:22 +00:00
## Instances
2023-11-30 12:32:55 +00:00
### [Yggdrasil](https://github.com/yggdrasil-network)
2023-11-30 14:18:44 +00:00
* `http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yo/` - IPv6 `0200::/7` addresses only | [index](http://[201:23b4:991a:634d:8359:4521:5576:15b7]/yo/index.sql)
2023-11-30 12:32:55 +00:00
### [Alfis DNS](https://github.com/Revertron/Alfis)
2023-11-30 14:18:44 +00:00
* `http://yo.ygg` - `.ygg` domain zone search only | [index](http://yo.ygg/index.sql)
* `http://ygg.yo.index` - alias of `http://yo.ygg` | [index](http://ygg.yo.index/index.sql)
2023-11-25 11:42:22 +00:00
2023-11-30 12:32:55 +00:00
_*`*.yo.index` reserved for domain-oriented instances e.g. `.btn`, `.conf`, `.mirror` - feel free to request the address_