Browse Source

change config location

main
ghost 1 year ago
parent
commit
72f2fdaeca
  1. 3
      .gitignore
  2. 10
      README.md
  3. 2
      src/cli/document/add.php
  4. 2
      src/cli/document/crawl.php
  5. 2
      src/cli/document/search.php
  6. 2
      src/cli/index/init.php
  7. 107
      src/config.json
  8. 0
      src/nodes.json
  9. 2
      src/webui/index.php
  10. 2
      src/webui/search.php

3
.gitignore vendored

@ -1,3 +1,4 @@
/storage/ /storage/
/vendor/ /vendor/
composer.lock composer.lock
config.json

10
README.md

@ -2,16 +2,16 @@
Next generation of [YGGo!](https://github.com/YGGverse/YGGo) project with goal to reduce server requirements and make deployment process simpler Next generation of [YGGo!](https://github.com/YGGverse/YGGo) project with goal to reduce server requirements and make deployment process simpler
- Index model changed to the distributed cluster model, and oriented to aggregate search results from different instances trough API - Index model changed to distributed cluster model, and now oriented to aggregate search results from network instances trough API
- Refactored data exchange model with drop all primary keys dependencies - Refactored data exchange model where drop all internal keys dependencies
- Snaps now using tar.gz compression to reduce storage requirements and still supporting remote mirrors, FTP including - Snaps now using tar.gz compression to reduce storage requirements and still supporting remote mirrors, FTP including
- Minimalism everywhere - Minimalism everywhere
## Implementation ## Implementation
Engine written in PHP and uses [Manticore](https://github.com/manticoresoftware) on backend. Engine written in PHP 8 and uses [Manticore](https://github.com/manticoresoftware) on backend.
Default build inspired and adapted for [Yggdrasil](https://github.com/yggdrasil-network) but could be used to make internet search portal. Default build adapted for [Yggdrasil](https://github.com/yggdrasil-network) but could be used to make internet search portal.
## Components ## Components
@ -29,7 +29,7 @@ Default build inspired and adapted for [Yggdrasil](https://github.com/yggdrasil-
1. Install `composer`, `php` and `manticore` 1. Install `composer`, `php` and `manticore`
2. Grab latest `Yo` version `git clone https://github.com/YGGverse/Yo.git` 2. Grab latest `Yo` version `git clone https://github.com/YGGverse/Yo.git`
3. Run `composer update` inside the project directory 3. Run `composer update` inside the project directory
4. Check `src/config.json` for any customizations 4. Copy and customize config file `cp example/config.json config.json`
5. Make sure `storage` folder writable 5. Make sure `storage` folder writable
6. Run indexes init script `php src/cli/index/init.php` 6. Run indexes init script `php src/cli/index/init.php`
7. Add new URL `php src/cli/document/add.php URL` 7. Add new URL `php src/cli/document/add.php URL`

2
src/cli/document/add.php

@ -6,7 +6,7 @@ require_once __DIR__ . '/../../../vendor/autoload.php';
// Init config // Init config
$config = json_decode( $config = json_decode(
file_get_contents( file_get_contents(
__DIR__ . '/../../config.json' __DIR__ . '/../../../config.json'
) )
); );

2
src/cli/document/crawl.php

@ -14,7 +14,7 @@ require_once __DIR__ . '/../../../vendor/autoload.php';
// Init config // Init config
$config = json_decode( $config = json_decode(
file_get_contents( file_get_contents(
__DIR__ . '/../../config.json' __DIR__ . '/../../../config.json'
) )
); );

2
src/cli/document/search.php

@ -6,7 +6,7 @@ require_once __DIR__ . '/../../../vendor/autoload.php';
// Init config // Init config
$config = json_decode( $config = json_decode(
file_get_contents( file_get_contents(
__DIR__ . '/../../config.json' __DIR__ . '/../../../config.json'
) )
); );

2
src/cli/index/init.php

@ -6,7 +6,7 @@ require_once __DIR__ . '/../../../vendor/autoload.php';
// Init config // Init config
$config = json_decode( $config = json_decode(
file_get_contents( file_get_contents(
__DIR__ . '/../../config.json' __DIR__ . '/../../../config.json'
) )
); );

107
src/config.json

@ -1,107 +0,0 @@
{
"manticore":
{
"server":
{
"host":"127.0.0.1",
"port":9308
},
"index":
{
"document":"yo_document"
}
},
"webui":
{
"url":
{
"base":"http://127.0.0.1:8888"
},
"pagination":
{
"limit":20
}
},
"cli":
{
"document":
{
"crawl":
{
"queue":
{
"limit":1,
"delay":1
},
"selector":
{
"a:not([rel=nofollow])":
{
"attribute":"href",
"external":false,
"regex":"/.*/ui"
},
"image":
{
"attribute":"src",
"external":true,
"regex":"/.*/ui"
},
"audio":
{
"attribute":"src",
"external":false,
"regex":"/.*/ui"
},
"video":
{
"attribute":"src",
"external":false,
"regex":"/.*/ui"
},
"script":
{
"attribute":"href",
"external":false,
"regex":"/.*/ui"
}
},
"snap":
{
"enabled":true
}
}
}
},
"snap":
{
"storage":
{
"local":{
"enabled":true,
"directory":"storage/snap",
"size":
{
"max":100024
},
"mime":
[
"application/xhtml+xml",
"application/javascript",
"text/html",
"text/plain",
"text/css",
"image/webp",
"image/png",
"image/gif",
"image/ico"
]
},
"mirror":
{
"enabled":false,
"ftp":[]
}
}
}
}

0
src/nodes.json

2
src/webui/index.php

@ -11,7 +11,7 @@ require_once __DIR__ . '/../../vendor/autoload.php';
// Init config // Init config
$config = json_decode( $config = json_decode(
file_get_contents( file_get_contents(
__DIR__ . '/../config.json' __DIR__ . '/../../config.json'
) )
); );

2
src/webui/search.php

@ -11,7 +11,7 @@ require_once __DIR__ . '/../../vendor/autoload.php';
// Init config // Init config
$config = json_decode( $config = json_decode(
file_get_contents( file_get_contents(
__DIR__ . '/../config.json' __DIR__ . '/../../config.json'
) )
); );

Loading…
Cancel
Save