diff --git a/docs/usecases/aws-resources.md b/docs/connections/aws-resources.md similarity index 97% rename from docs/usecases/aws-resources.md rename to docs/connections/aws-resources.md index 980b3cb..ec56a94 100644 --- a/docs/usecases/aws-resources.md +++ b/docs/connections/aws-resources.md @@ -1,6 +1,6 @@ --- sidebar_position: 11 -slug: /usecases/aws-resources +slug: /connections/aws-resources --- # AWS | resources diff --git a/docs/usecases/ecs-exec-oneoff.md b/docs/connections/ecs-exec.md similarity index 69% rename from docs/usecases/ecs-exec-oneoff.md rename to docs/connections/ecs-exec.md index 900c0b0..c7d9041 100644 --- a/docs/usecases/ecs-exec-oneoff.md +++ b/docs/connections/ecs-exec.md @@ -1,11 +1,11 @@ --- -sidebar_position: 10 -slug: /usecases/ecs-exec-oneoff +sidebar_position: 11 +slug: /connections/ecs-exec --- -# AWS ECS | exec one-off +# AWS ECS -The Elastic Container Service allows executing one off tasks of any type directly into ECS tasks/containers. +Interact with Elastic Container Service executing one off sessions into ECS tasks/containers. :::info note It's important to configure the ECS tasks before trying this feature, please refer to the [AWS documentation first](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) @@ -21,13 +21,39 @@ It's important to configure the ECS tasks before trying this feature, please ref | `AWS_SECRET_ACCESS_KEY` | env-var | The secret key credential | | `AWS_DEFAULT_REGION` | env-var | The AWS region | +## AWS ECS - Interactive Sessions + +The AWS Elastic Container Service allows connecting to tasks and starting interactive sessions. It's possible to map these commands to Hoop to obtain interactive sessions allocating a pseudo TTY. + +:::info note +It's important to configure the ECS tasks before trying this feature, please refer to the [AWS documentation first](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) +::: + +### Connection Command + +```shell +ecs-exec.sh --interactive --cluster=$CLUSTER_NAME --service-name=$SERVICE_NAME +``` + +### How to Use + +Start an interactive session + +```shell +hoop connect my-ecs -- --pipe /bin/bash +hoop connect my-ecs -- --pipe 'rails console' +hoop connect my-ecs -- --pipe clojure +``` + +## AWS ECS - Execute one session off + ### Connection Command ```shell ecs-exec.sh --cluster=$CLUSTER_NAME --service-name=$SERVICE_NAME ``` -## How to Use +### How to Use Now it's possible to execute ruby script straight from Hoop diff --git a/docs/usecases/heroku-oneoff.mdx b/docs/connections/heroku-oneoff.mdx similarity index 95% rename from docs/usecases/heroku-oneoff.mdx rename to docs/connections/heroku-oneoff.mdx index d8d209b..53d51d7 100644 --- a/docs/usecases/heroku-oneoff.mdx +++ b/docs/connections/heroku-oneoff.mdx @@ -1,11 +1,11 @@ --- -sidebar_position: 7 -slug: /usecases/heroku-oneoff +sidebar_position: 20 +slug: /connections/heroku-oneoff --- import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; -# Heroku one-off +# Heroku execute session one-off diff --git a/docs/usecases/heroku-psexec.mdx b/docs/connections/heroku-psexec.mdx similarity index 97% rename from docs/usecases/heroku-psexec.mdx rename to docs/connections/heroku-psexec.mdx index d2ea10a..c2b85c9 100644 --- a/docs/usecases/heroku-psexec.mdx +++ b/docs/connections/heroku-psexec.mdx @@ -1,11 +1,11 @@ --- -sidebar_position: 8 -slug: /usecases/heroku-psexec +sidebar_position: 20 +slug: /connections/heroku-psexec --- import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; -# Heroku | exec +# Heroku | interactive diff --git a/docs/usecases/forwarding-http.md b/docs/connections/http.md similarity index 87% rename from docs/usecases/forwarding-http.md rename to docs/connections/http.md index a88d45f..de8dd1a 100644 --- a/docs/usecases/forwarding-http.md +++ b/docs/connections/http.md @@ -1,9 +1,9 @@ --- -sidebar_position: 3 -slug: /usecases/forwarding-http +sidebar_position: 2 +slug: /connections/http --- -# Port Forward | http +# Http Port Forward local ports from your private network | HTTP example. diff --git a/docs/connections/index.md b/docs/connections/index.md index a010af4..b186c79 100644 --- a/docs/connections/index.md +++ b/docs/connections/index.md @@ -2,6 +2,8 @@ Connect and interact with your internal services. +Quickstart about how to connect hoop with the services. + ```mdx-code-block import DocCardList from '@theme/DocCardList'; diff --git a/docs/usecases/kubernetes-exec.mdx b/docs/connections/kubernetes-exec.mdx similarity index 96% rename from docs/usecases/kubernetes-exec.mdx rename to docs/connections/kubernetes-exec.mdx index 50ec917..2a1e5df 100644 --- a/docs/usecases/kubernetes-exec.mdx +++ b/docs/connections/kubernetes-exec.mdx @@ -1,11 +1,11 @@ --- -sidebar_position: 4 -slug: /usecases/k8s-exec +sidebar_position: 7 +slug: /usecases/k8s/exec --- import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; -# Kubernetes | exec +# Kubernetes diff --git a/docs/usecases/kubernetes-oneoff.mdx b/docs/connections/kubernetes-oneoff.mdx similarity index 97% rename from docs/usecases/kubernetes-oneoff.mdx rename to docs/connections/kubernetes-oneoff.mdx index f72fd3c..ffa8900 100644 --- a/docs/usecases/kubernetes-oneoff.mdx +++ b/docs/connections/kubernetes-oneoff.mdx @@ -1,6 +1,6 @@ --- -sidebar_position: 5 -slug: /usecases/k8s-oneoff +sidebar_position: 7 +slug: /usecases/k8s/oneoff --- import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; diff --git a/docs/usecases/kubernetes-resources.md b/docs/connections/kubernetes-resources.md similarity index 80% rename from docs/usecases/kubernetes-resources.md rename to docs/connections/kubernetes-resources.md index 5cca2b8..3d75d47 100644 --- a/docs/usecases/kubernetes-resources.md +++ b/docs/connections/kubernetes-resources.md @@ -1,6 +1,6 @@ --- -sidebar_position: 6 -slug: /usecases/k8s-resources +sidebar_position: 7 +slug: /usecases/k8s/resources --- # Kubernetes | resources @@ -23,11 +23,11 @@ kubectl ```shell # view pods in the default namespace -hoop exec k8s -- get pods +hoop exec my-conn-k8s -- get pods # restart an app hoop exec k8s -- rollout restart deployment/myapp # scale up an app -hoop exec k8s -- scale --replicas=3 deployment/myapp +hoop exec my-conn-k8s -- scale --replicas=3 deployment/myapp ``` It's possible to narrow down the commands in distinct connections, this gives a better user experience @@ -41,6 +41,6 @@ kubectl --namespace prod rollout Then it's possible ```shell -hoop exec k8s -- restart deployment/myapp -hoop exec k8s -- undo deployment/myapp +hoop exec my-conn-k8s -- restart deployment/myapp +hoop exec my-conn-k8s -- undo deployment/myapp ``` \ No newline at end of file diff --git a/docs/usecases/mongodb.md b/docs/connections/mongodb.md similarity index 97% rename from docs/usecases/mongodb.md rename to docs/connections/mongodb.md index 7980482..7ede094 100644 --- a/docs/usecases/mongodb.md +++ b/docs/connections/mongodb.md @@ -1,6 +1,6 @@ --- sidebar_position: 16 -slug: /usecases/mongodb +slug: /connections/mongodb --- # MongoDB | mongosh cli diff --git a/docs/usecases/mysqlcli.md b/docs/connections/mysql-cli.md similarity index 96% rename from docs/usecases/mysqlcli.md rename to docs/connections/mysql-cli.md index f4b9b82..b90211a 100644 --- a/docs/usecases/mysqlcli.md +++ b/docs/connections/mysql-cli.md @@ -1,6 +1,6 @@ --- -sidebar_position: 14 -slug: /usecases/mysqlcli +sidebar_position: 3 +slug: /connections/mysqlcli --- # MySQL | mysql cli diff --git a/docs/connections/native/_category_.json b/docs/connections/native/_category_.json new file mode 100644 index 0000000..242eff8 --- /dev/null +++ b/docs/connections/native/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Native Connections", + "position": 1 +} diff --git a/docs/connections/command-line.mdx b/docs/connections/native/command-line.mdx similarity index 91% rename from docs/connections/command-line.mdx rename to docs/connections/native/command-line.mdx index 4e2bae1..6b25fdf 100644 --- a/docs/connections/command-line.mdx +++ b/docs/connections/native/command-line.mdx @@ -1,9 +1,9 @@ --- sidebar_position: 1 -slug: /connections/command-line +slug: /connections/native/command-line --- -import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; +import ConnectOnHoopButton from './../../../src/components/ConnectOnHoopButton'; # Command Line diff --git a/docs/connections/port-forward.mdx b/docs/connections/native/port-forward.mdx similarity index 86% rename from docs/connections/port-forward.mdx rename to docs/connections/native/port-forward.mdx index 8bb9884..0737b96 100644 --- a/docs/connections/port-forward.mdx +++ b/docs/connections/native/port-forward.mdx @@ -1,9 +1,9 @@ --- sidebar_position: 2 -slug: /connections/port-forward +slug: /connections/native/port-forward --- -import ConnectOnHoopButton from './../../src/components/ConnectOnHoopButton'; +import ConnectOnHoopButton from './../../../src/components/ConnectOnHoopButton'; # Port Forward diff --git a/docs/usecases/psql.md b/docs/connections/postgres-psql.md similarity index 94% rename from docs/usecases/psql.md rename to docs/connections/postgres-psql.md index af4c0ff..2ec4dcc 100644 --- a/docs/usecases/psql.md +++ b/docs/connections/postgres-psql.md @@ -1,9 +1,9 @@ --- -sidebar_position: 14 -slug: /usecases/psql +sidebar_position: 4 +slug: /connections/psql --- -# Postgres | psql cli +# Postgres | psql cli An optional way to connect into postgres is using the `psql` client. It's possible to create a interactive session or execute one-off commands. diff --git a/docs/connections/postgres.mdx b/docs/connections/postgres.mdx index 7009a2b..539cab7 100644 --- a/docs/connections/postgres.mdx +++ b/docs/connections/postgres.mdx @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 5 slug: /connections/postgres --- diff --git a/docs/usecases/postgres.md b/docs/connections/postgres.txt similarity index 94% rename from docs/usecases/postgres.md rename to docs/connections/postgres.txt index 11dd9a6..41b548c 100644 --- a/docs/usecases/postgres.md +++ b/docs/connections/postgres.txt @@ -1,6 +1,6 @@ --- -sidebar_position: 13 -slug: /usecases/postgres +sidebar_position: 5 +slug: /connections/postgres-psql --- # Postgres diff --git a/docs/usecases/scripts.md b/docs/connections/scripts.md similarity index 93% rename from docs/usecases/scripts.md rename to docs/connections/scripts.md index 1cfe0cc..aa7950b 100644 --- a/docs/usecases/scripts.md +++ b/docs/connections/scripts.md @@ -1,9 +1,9 @@ --- sidebar_position: 16 -slug: /usecases/scripts +slug: /connections/scripts --- -# Scripts | one-off +# Execute scripts with Hoop connections Allows executing one-off scripts using the underlying Operating System tools. diff --git a/docs/usecases/sqlserver.md b/docs/connections/sqlserver.md similarity index 95% rename from docs/usecases/sqlserver.md rename to docs/connections/sqlserver.md index 01256b0..74c0736 100644 --- a/docs/usecases/sqlserver.md +++ b/docs/connections/sqlserver.md @@ -1,6 +1,6 @@ --- -sidebar_position: 15 -slug: /usecases/sqlserver +sidebar_position: 6 +slug: /connections/sqlserver --- # SQL Server | sqlcmd cli diff --git a/docs/usecases/ssh-bastion.md b/docs/connections/ssh-bastion.md similarity index 92% rename from docs/usecases/ssh-bastion.md rename to docs/connections/ssh-bastion.md index 1b2361f..0de681c 100644 --- a/docs/usecases/ssh-bastion.md +++ b/docs/connections/ssh-bastion.md @@ -1,11 +1,11 @@ --- sidebar_position: 17 -slug: /usecases/bastion +slug: /connections/bastion --- # Bastion Server | ssh cli -Hoop could act as a bastion server and connect into ssh hosts to allow execution of one-off tasks or opening interactive sessions. +Hoop could act as a bastion server and connect into ssh hosts to allow execution of one-off sessions. ## Connection Configuration diff --git a/docs/installing-hoop-agent/heroku.mdx b/docs/installing-hoop-agent/heroku.mdx index b9c96f6..7f06164 100644 --- a/docs/installing-hoop-agent/heroku.mdx +++ b/docs/installing-hoop-agent/heroku.mdx @@ -76,5 +76,5 @@ After disconnecting it, check if there's any recorded session available at **htt See how to use the heroku cli through Hoop. - [Heroku Management Guide](../tutorials/heroku-exec.mdx) -- [Heroku ps:exec](../usecases/heroku-psexec.mdx) -- [Heroku one-off](../usecases/heroku-oneoff.mdx) +- [Heroku ps:exec](../connections/heroku-psexec.mdx) +- [Heroku one-off](../connections/heroku-oneoff.mdx) diff --git a/docs/plugins/review.mdx b/docs/plugins/review.mdx index 02d96c0..e96ab9d 100644 --- a/docs/plugins/review.mdx +++ b/docs/plugins/review.mdx @@ -19,7 +19,7 @@ The command below asks for a 10 minutes access to the connection `bash` ```shell $ hoop connect bash --duration 10m -⣷ waiting task to be approved at https://app.hoop.dev/plugins/reviews/73a28154-58... +⣷ waiting session to be approved at https://app.hoop.dev/plugins/reviews/73a28154-58... ``` After approved, the user could connect again without prompting for review during 10 minutes. @@ -34,7 +34,7 @@ It will ask for a review every time a command is issued. ```shell $ hoop exec bash -i 'ls -l' -⣷ waiting task to be approved at https://app.hoop.dev/plugins/reviews/73a28154-58... +⣷ waiting session to be approved at https://app.hoop.dev/plugins/reviews/73a28154-58... ``` ## Configuring diff --git a/docs/plugins/runbooks/templates.md b/docs/plugins/runbooks/templates.md index b3ada20..23f4281 100644 --- a/docs/plugins/runbooks/templates.md +++ b/docs/plugins/runbooks/templates.md @@ -146,7 +146,7 @@ myvar = {{ .color ### asenv function The `asenv` function allows defining inputs and mapping then as environment variables in the connection runtime. -Instead of injecting the value as an input directly to the template, it will gather the value and inject as an environment variable when executing the task. +Instead of injecting the value as an input directly to the template, it will gather the value and inject as an environment variable when executing the session. The inputs could be just defined in a comment in the template, examples: diff --git a/docs/setting-up/quickstart-builder.jsx b/docs/setting-up/quickstart-builder.jsx index 3ec9464..f9c91d8 100644 --- a/docs/setting-up/quickstart-builder.jsx +++ b/docs/setting-up/quickstart-builder.jsx @@ -7,25 +7,24 @@ import DockerPlatform from './../installing-hoop-agent/docker.mdx'; import HerokuPlatform from './../installing-hoop-agent/heroku.mdx'; import KubernetesPlatform from './../installing-hoop-agent/kubernetes.md'; -// use cases docs -import MySQLUseCase from './../usecases/forwarding-mysql.md'; -import MySQLCLIUseCase from './../usecases/mysql.md'; -import NativePostgresUseCase from './../usecases/postgres.md'; -import PostgresPSQLUseCase from './../usecases/psql.md'; -import MongoDBmongoshUseCase from './../usecases/mongodb.md'; -import KubernetesExecUseCase from './../usecases/kubernetes-exec.mdx'; -import KubernetesResourcesUseCase from './../usecases/kubernetes-resources.md'; -import HerokuExecUseCase from './../usecases/heroku-oneoff.mdx'; -import HerokuInteractiveUseCase from './../usecases/heroku-psexec.mdx'; -import AWSExecUseCase from './../usecases/ecs-exec.md'; -import AWSResourcesUseCase from './../usecases/aws-resources.md'; -import SQLServerCLIUseCase from './../usecases/sqlserver.md'; -import BastionServerUseCase from './../usecases/ssh-bastion.md'; -import PortForwardHTTPUseCase from './../usecases/forwarding-http.md'; +// use cases docs --> moved to connections +import MySQLCLIUseCase from './../connections/mysql-cli.md'; +import NativePostgresUseCase from './../connections/postgres-psql.md'; +import PostgresPSQLUseCase from './../connections/postgres-psql.md'; +import MongoDBmongoshUseCase from './../connections/mongodb.md'; +import KubernetesExecUseCase from './../connections/kubernetes-exec.mdx'; +import KubernetesResourcesUseCase from './../connections/kubernetes-resources.md'; +import HerokuExecUseCase from './../connections/heroku-oneoff.mdx'; +import HerokuInteractiveUseCase from './../connections/heroku-psexec.mdx'; +import AWSExecUseCase from './../connections/ecs-exec.md'; +import AWSResourcesUseCase from './../connections/aws-resources.md'; +import SQLServerCLIUseCase from './../connections/sqlserver.md'; +import BastionServerUseCase from './../connections/ssh-bastion.md'; +import PortForwardHTTPUseCase from './../connections/http.md'; // connections -import CommandLineConnection from './../connections/command-line.mdx'; -import PortForwardConnection from './../connections/port-forward.mdx'; +import CommandLineConnection from './../connections/native/command-line.mdx'; +import PortForwardConnection from './../connections/native/port-forward.mdx'; import PostgresConnection from './../connections/postgres.mdx'; const docOptions = { diff --git a/docs/tutorials/heroku-exec.mdx b/docs/tutorials/heroku-exec.mdx index 72b0c37..0ce5437 100644 --- a/docs/tutorials/heroku-exec.mdx +++ b/docs/tutorials/heroku-exec.mdx @@ -110,6 +110,6 @@ EOF ## Conclusion -The auditing sessions and tasks could be viewed at **https://app.hoop.dev/plugins/audit** +The auditing sessions and connections could be viewed at **https://app.hoop.dev/plugins/audit** Hoop can wrap any heroku command giving more control, auditing features, redact sensitive content without losing local developer experience. diff --git a/docs/usecases/_category_.json b/docs/usecases/_category_.json deleted file mode 100644 index 53ed586..0000000 --- a/docs/usecases/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Use Cases", - "position": 6 -} diff --git a/docs/usecases/ecs-exec.md b/docs/usecases/ecs-exec.md deleted file mode 100644 index 851dedb..0000000 --- a/docs/usecases/ecs-exec.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -sidebar_position: 9 -slug: /usecases/ecs-exec ---- - -# AWS ECS | exec - -The AWS Elastic Container Service allows connecting to tasks and starting interactive sessions. It's possible to map these commands to Hoop to obtain interactive sessions allocating a pseudo TTY. - -:::info note -It's important to configure the ECS tasks before trying this feature, please refer to the [AWS documentation first](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html) -::: - -## Connection Configuration - -| Name | Type | Description | -|------------------------ | ------- | ---------------------------------- | -| `CLUSTER_NAME` | env-var | The name or arn of the ECS Cluster | -| `SERVICE_NAME` | env-var | The name of the service on ECS | -| `AWS_ACCESS_KEY_ID` | env-var | The access key credential | -| `AWS_SECRET_ACCESS_KEY` | env-var | The secret key credential | -| `AWS_DEFAULT_REGION` | env-var | The AWS region | - -### Connection Command - -```shell -ecs-exec.sh --interactive --cluster=$CLUSTER_NAME --service-name=$SERVICE_NAME -``` - -## How to Use - -Start an interactive session - -```shell -hoop connect my-ecs -- --pipe /bin/bash -hoop connect my-ecs -- --pipe 'rails console' -hoop connect my-ecs -- --pipe clojure -``` - diff --git a/docs/usecases/forwarding-mysql.md b/docs/usecases/forwarding-mysql.md deleted file mode 100644 index a0160b8..0000000 --- a/docs/usecases/forwarding-mysql.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -sidebar_position: 2 -slug: /usecases/forwarding-mysql ---- - -# Port Forward | mysql - -Port Forward local ports from your private network | MySQL example. - -## Connection Configuration - -| Name | Type | Description | -|------- | ------- | ---------------------------------------------- | -| `HOST` | env-var | The IP or hostname of the MySQL Server | -| `PORT` | env-var | The port of the MySQL server | - -## How to Use - -```shell -hoop connect my-mysql --port 3306 -``` - -Use a compatible mysql client to connect in the instance. - -```shell -mysql -h 127.0.0.1 -u myuser -D mydb -p -``` diff --git a/docs/usecases/index.md b/docs/usecases/index.md deleted file mode 100644 index f0422d9..0000000 --- a/docs/usecases/index.md +++ /dev/null @@ -1,9 +0,0 @@ -# Use Cases - -Examples about how to use hoop command line utility. - -```mdx-code-block -import DocCardList from '@theme/DocCardList'; - - -``` \ No newline at end of file diff --git a/docs/usecases/mysql.md b/docs/usecases/mysql.md deleted file mode 100644 index cf020c6..0000000 --- a/docs/usecases/mysql.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -sidebar_position: 13 -slug: /usecases/mysql ---- - -# MySQL - -MySQL connection is a native type where queries can be audited and the output redacted. -It forwards a passwordless TCP connection locally. - -## Connection Configuration - -| Name | Type | Description | -|------- | ------- | ------------------------------------------- | -| `HOST` | env-var | The IP or Host of the MySQL server | -| `PORT` | env-var | The port of the MySQL server | -| `USER` | env-var | The user to connect in the MySQL server | -| `PASS` | env-var | The password to connect in the MySQL server | - - -:::info INFO -The MySQL native connection only accepts `mysql_native_password` and `caching_sha2_password` [authentication plugins](https://dev.mysql.com/doc/refman/8.0/en/authentication-plugins.html) -::: - -## MySQL Proxy Server - -```shell -hoop connect mysqldb --port 3307 -``` - -Use a compatible mysql client to connect in the instance - -```shell -mysql -h 127.0.0.1 --port 3307 -```