From e90a528adde84fdbacd209b79b08cdf02bd63ec6 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Sun, 15 Oct 2023 07:35:49 -0400 Subject: [PATCH 1/7] initial version for survos/command-bundle --- .../1.5/config/packages/survos_command.php | 11 +++++++++++ .../1.5/config/routes/survos_command.php | 16 ++++++++++++++++ survos/command-bundle/1.5/manifest.json | 9 +++++++++ survos/command-bundle/1.5/post-install.txt | 8 ++++++++ 4 files changed, 44 insertions(+) create mode 100644 survos/command-bundle/1.5/config/packages/survos_command.php create mode 100644 survos/command-bundle/1.5/config/routes/survos_command.php create mode 100644 survos/command-bundle/1.5/manifest.json create mode 100644 survos/command-bundle/1.5/post-install.txt diff --git a/survos/command-bundle/1.5/config/packages/survos_command.php b/survos/command-bundle/1.5/config/packages/survos_command.php new file mode 100644 index 000000000..0dcc341a0 --- /dev/null +++ b/survos/command-bundle/1.5/config/packages/survos_command.php @@ -0,0 +1,11 @@ +extension('survos_command', [ + 'namespaces' => ['app', 'survos'] + ]); +}; +//survos_command: +//namespaces: [app, project, survos] diff --git a/survos/command-bundle/1.5/config/routes/survos_command.php b/survos/command-bundle/1.5/config/routes/survos_command.php new file mode 100644 index 000000000..fb0004a73 --- /dev/null +++ b/survos/command-bundle/1.5/config/routes/survos_command.php @@ -0,0 +1,16 @@ +add('survos_commands', '/admin/commands') + ->controller([CommandController::class, 'commands']) + ; + + $routes->add('survos_command', 'admin/run-command/{commandName}') + ->controller([CommandController::class, 'runCommand']) + ; + +}; diff --git a/survos/command-bundle/1.5/manifest.json b/survos/command-bundle/1.5/manifest.json new file mode 100644 index 000000000..9d0d81c6a --- /dev/null +++ b/survos/command-bundle/1.5/manifest.json @@ -0,0 +1,9 @@ +{ + "bundles": { + "Survos\\CommandBundle\\SurvosCommandBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } +} + diff --git a/survos/command-bundle/1.5/post-install.txt b/survos/command-bundle/1.5/post-install.txt new file mode 100644 index 000000000..22519cef2 --- /dev/null +++ b/survos/command-bundle/1.5/post-install.txt @@ -0,0 +1,8 @@ + + success + + + * Next steps: + 1. Configure /config/packages/survos_command.php to expose the namespaces (command prefixes) + 2. secure the /admin route, configure the route in config/routes/survos_command.php; + 3. Visit /admin/commmands. From bd6892e9a6c520719559434d09d6e647cbe2f1c5 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Mon, 16 Oct 2023 06:22:54 -0400 Subject: [PATCH 2/7] use yaml for package config, point routing to routes.php in the bundle --- .../1.5/config/packages/survos_command.php | 11 ----------- .../1.5/config/packages/survos_command.yaml | 4 ++++ .../1.5/config/routes/survos_command.php | 16 ++++++---------- 3 files changed, 10 insertions(+), 21 deletions(-) delete mode 100644 survos/command-bundle/1.5/config/packages/survos_command.php create mode 100644 survos/command-bundle/1.5/config/packages/survos_command.yaml diff --git a/survos/command-bundle/1.5/config/packages/survos_command.php b/survos/command-bundle/1.5/config/packages/survos_command.php deleted file mode 100644 index 0dcc341a0..000000000 --- a/survos/command-bundle/1.5/config/packages/survos_command.php +++ /dev/null @@ -1,11 +0,0 @@ -extension('survos_command', [ - 'namespaces' => ['app', 'survos'] - ]); -}; -//survos_command: -//namespaces: [app, project, survos] diff --git a/survos/command-bundle/1.5/config/packages/survos_command.yaml b/survos/command-bundle/1.5/config/packages/survos_command.yaml new file mode 100644 index 000000000..b00605fff --- /dev/null +++ b/survos/command-bundle/1.5/config/packages/survos_command.yaml @@ -0,0 +1,4 @@ +survos_command: + # expose app:my-command, etc. + namespaces: [app] + diff --git a/survos/command-bundle/1.5/config/routes/survos_command.php b/survos/command-bundle/1.5/config/routes/survos_command.php index fb0004a73..b535b0f7a 100644 --- a/survos/command-bundle/1.5/config/routes/survos_command.php +++ b/survos/command-bundle/1.5/config/routes/survos_command.php @@ -1,16 +1,12 @@ add('survos_commands', '/admin/commands') - ->controller([CommandController::class, 'commands']) - ; +use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator; - $routes->add('survos_command', 'admin/run-command/{commandName}') - ->controller([CommandController::class, 'runCommand']) +return static function (RoutingConfigurator $routes): void { + $routes->import('@SurvosCommandBundle/config/routes.php') + ->prefix('/admin') // consider adding this route to the access_control key in security + ->schemes(['https']) ; - }; + From 15f2ffa499f855a19fe9a47834a89e33a0b4bfa4 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Mon, 16 Oct 2023 07:23:00 -0400 Subject: [PATCH 3/7] fix indentation to 4 spaces --- survos/command-bundle/1.5/config/packages/survos_command.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/survos/command-bundle/1.5/config/packages/survos_command.yaml b/survos/command-bundle/1.5/config/packages/survos_command.yaml index b00605fff..f17a01e95 100644 --- a/survos/command-bundle/1.5/config/packages/survos_command.yaml +++ b/survos/command-bundle/1.5/config/packages/survos_command.yaml @@ -1,4 +1,4 @@ survos_command: - # expose app:my-command, etc. - namespaces: [app] + # expose app:my-command, etc. + namespaces: [app] From fe16f17baacbde85fdf9bc06a509eef34d563389 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Mon, 16 Oct 2023 10:36:18 -0400 Subject: [PATCH 4/7] initial version for survos/crawler-bundle --- .../1.5/config/packages/survos_crawler.yaml | 9 +++++++++ .../1.5/config/routes/survos_crawler.php | 12 ++++++++++++ survos/crawler-bundle/1.5/manifest.json | 9 +++++++++ survos/crawler-bundle/1.5/post-install.txt | 8 ++++++++ 4 files changed, 38 insertions(+) create mode 100644 survos/crawler-bundle/1.5/config/packages/survos_crawler.yaml create mode 100644 survos/crawler-bundle/1.5/config/routes/survos_crawler.php create mode 100644 survos/crawler-bundle/1.5/manifest.json create mode 100644 survos/crawler-bundle/1.5/post-install.txt diff --git a/survos/crawler-bundle/1.5/config/packages/survos_crawler.yaml b/survos/crawler-bundle/1.5/config/packages/survos_crawler.yaml new file mode 100644 index 000000000..ac9d63a08 --- /dev/null +++ b/survos/crawler-bundle/1.5/config/packages/survos_crawler.yaml @@ -0,0 +1,9 @@ +survos_crawler: +# if you've run symfony proxy:domain:attach my-project, then the error messages will be displayed with this prefix. That way, you can simply click on a link to open the page. +# base_url: 'https://my-project.wip/' + user_class: App\Entity\User + users: + - user@user.com + max_depth : 3 + routes_to_ignore : + - 'app_logout' diff --git a/survos/crawler-bundle/1.5/config/routes/survos_crawler.php b/survos/crawler-bundle/1.5/config/routes/survos_crawler.php new file mode 100644 index 000000000..c3ce85ea5 --- /dev/null +++ b/survos/crawler-bundle/1.5/config/routes/survos_crawler.php @@ -0,0 +1,12 @@ +import('@SurvosCrawlerBundle/config/routes.php') + ->prefix('/admin') // consider adding this route to the access_control key in security + ->schemes(['https']) + ; +}; + diff --git a/survos/crawler-bundle/1.5/manifest.json b/survos/crawler-bundle/1.5/manifest.json new file mode 100644 index 000000000..9d0d81c6a --- /dev/null +++ b/survos/crawler-bundle/1.5/manifest.json @@ -0,0 +1,9 @@ +{ + "bundles": { + "Survos\\CommandBundle\\SurvosCommandBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } +} + diff --git a/survos/crawler-bundle/1.5/post-install.txt b/survos/crawler-bundle/1.5/post-install.txt new file mode 100644 index 000000000..22519cef2 --- /dev/null +++ b/survos/crawler-bundle/1.5/post-install.txt @@ -0,0 +1,8 @@ + + success + + + * Next steps: + 1. Configure /config/packages/survos_command.php to expose the namespaces (command prefixes) + 2. secure the /admin route, configure the route in config/routes/survos_command.php; + 3. Visit /admin/commmands. From 30824930b3835b56831b8efc69f9c5e76b8c3794 Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Mon, 16 Oct 2023 10:40:10 -0400 Subject: [PATCH 5/7] fix instructions --- survos/crawler-bundle/1.5/post-install.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/survos/crawler-bundle/1.5/post-install.txt b/survos/crawler-bundle/1.5/post-install.txt index 22519cef2..67bf22bd4 100644 --- a/survos/crawler-bundle/1.5/post-install.txt +++ b/survos/crawler-bundle/1.5/post-install.txt @@ -3,6 +3,6 @@ * Next steps: - 1. Configure /config/packages/survos_command.php to expose the namespaces (command prefixes) - 2. secure the /admin route, configure the route in config/routes/survos_command.php; - 3. Visit /admin/commmands. + 1. Configure /config/packages/survos_crawler.php and add the users and routes to ignore + 2. Run symfony console survos:crawl + 3. Visit /admin/crawler-results. From a927d7cf6fc63adf26a0b24b478a044f5b5039ca Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Mon, 16 Oct 2023 10:42:53 -0400 Subject: [PATCH 6/7] fix classname --- survos/crawler-bundle/1.5/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/survos/crawler-bundle/1.5/manifest.json b/survos/crawler-bundle/1.5/manifest.json index 9d0d81c6a..d7e6adaaf 100644 --- a/survos/crawler-bundle/1.5/manifest.json +++ b/survos/crawler-bundle/1.5/manifest.json @@ -1,6 +1,6 @@ { "bundles": { - "Survos\\CommandBundle\\SurvosCommandBundle": ["all"] + "Survos\\CrawlerBundle\\SurvosCrawlerBundle": ["all"] }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/" From 639d35e6f23c01066d64a3677b39a514a200e8cd Mon Sep 17 00:00:00 2001 From: Tac Tacelosky Date: Mon, 16 Oct 2023 14:31:26 -0400 Subject: [PATCH 7/7] cleanup, per Ryan's suggestions --- survos/command-bundle/1.5/config/routes/survos_command.php | 5 +---- survos/crawler-bundle/1.5/config/routes/survos_crawler.php | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/survos/command-bundle/1.5/config/routes/survos_command.php b/survos/command-bundle/1.5/config/routes/survos_command.php index b535b0f7a..369434978 100644 --- a/survos/command-bundle/1.5/config/routes/survos_command.php +++ b/survos/command-bundle/1.5/config/routes/survos_command.php @@ -1,12 +1,9 @@ import('@SurvosCommandBundle/config/routes.php') - ->prefix('/admin') // consider adding this route to the access_control key in security - ->schemes(['https']) + ->prefix('/admin') // consider adding this path to the access_control key in security ; }; diff --git a/survos/crawler-bundle/1.5/config/routes/survos_crawler.php b/survos/crawler-bundle/1.5/config/routes/survos_crawler.php index c3ce85ea5..adbbb7cc2 100644 --- a/survos/crawler-bundle/1.5/config/routes/survos_crawler.php +++ b/survos/crawler-bundle/1.5/config/routes/survos_crawler.php @@ -1,12 +1,9 @@ import('@SurvosCrawlerBundle/config/routes.php') - ->prefix('/admin') // consider adding this route to the access_control key in security - ->schemes(['https']) + ->prefix('/admin') // consider adding this path to the access_control key in security ; };