Skip to content

Commit

Permalink
Removed $ character from all shell commands in docs. (#32)
Browse files Browse the repository at this point in the history
$ character is now removed from all shell commands in markdown documentation.

When docs are eventually compiling to we can add $ automatically to code blocks.
  • Loading branch information
noahtalerman authored Nov 12, 2020
1 parent 227f854 commit 6536ba6
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 96 deletions.
4 changes: 2 additions & 2 deletions docs/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ Fleet and `fleetctl` have built in support for [goquery](https://github.com/AbGu
Use `fleetctl goquery` to open up the goquery console. When used with Fleet, goquery can connect using either a hostname or UUID.

```
$ ./build/fleetctl get hosts
./build/fleetctl get hosts
+--------------------------------------+--------------+----------+---------+
| UUID | HOSTNAME | PLATFORM | STATUS |
+--------------------------------------+--------------+----------+---------+
| 192343D5-0000-0000-B85B-58F656BED4C7 | 6523f89187f8 | centos | online |
+--------------------------------------+--------------+----------+---------+
$ ./build/fleetctl goquery
./build/fleetctl goquery
goquery> .connect 6523f89187f8
Verified Host(6523f89187f8) Exists.
.
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/file-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ All of these files can be concatenated together into [one file](../../examples/c
`fleetctl` format. Use `fleetctl convert` with a path to the pack file:

```
$ fleetctl convert -f test.json
fleetctl convert -f test.json
---
apiVersion: v1
kind: pack
Expand Down
14 changes: 7 additions & 7 deletions docs/cli/setup-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ At this point, the MySQL database doesn't have any users in it. Because of this,
Now, since our Fleet instance is local in this tutorial, we didn't get a valid TLS certificate, so we need to run the following to configure our Fleet context:

```
$ fleetctl config set --address https://localhost:8080 --tls-skip-verify
fleetctl config set --address https://localhost:8080 --tls-skip-verify
[+] Set the address config key to "https://localhost:8080" in the "default" context
[+] Set the tls-skip-verify config key to "true" in the "default" context
```

Now, if you were connecting to a Fleet instance for real, you wouldn't want to skip TLS certificate verification, so you might run something like:

```
$ fleetctl config set --address https://fleet.corp.example.com
fleetctl config set --address https://fleet.corp.example.com
[+] Set the address config key to "https://fleet.corp.example.com" in the "default" context
```

Expand All @@ -46,7 +46,7 @@ $ fleetctl config set --address https://fleet.corp.example.com
Now that we've configured our local CLI context, lets go ahead and create our admin account:

```
$ fleetctl setup --email [email protected]
fleetctl setup --email [email protected]
Password:
[+] Fleet setup successful and context configured!
```
Expand All @@ -60,7 +60,7 @@ For the sake of this tutorial, I'm going to be using Kolide's osquery launcher t
To get your osquery enroll secret, run the following:

```
$ fleetctl get enroll-secret
fleetctl get enroll-secret
E7P6zs9D0mvY7ct08weZ7xvLtQfGYrdC
```

Expand All @@ -79,7 +79,7 @@ launcher \
To run a simple query against all hosts, you might run something like the following:

```
$ fleetctl query --query 'select * from osquery_info;' --labels='All Hosts' > results.json
fleetctl query --query 'select * from osquery_info;' --labels='All Hosts' > results.json
⠂ 100% responded (100% online) | 1/1 targeted hosts (1/1 online)
^C
```
Expand Down Expand Up @@ -154,10 +154,10 @@ Now run a live query again. You should notice results coming back more quickly.
If you have an existing Fleet instance (version 2.0.0 or above), then simply run `fleetctl login` (after configuring your local CLI context):
```
$ fleetctl config set --address https://fleet.corp.example.com
fleetctl config set --address https://fleet.corp.example.com
[+] Set the address config key to "https://fleet.corp.example.com" in the "default" context

$ fleetctl login
fleetctl login
Log in using the standard Fleet credentials.
Email: [email protected]
Password:
Expand Down
12 changes: 6 additions & 6 deletions docs/infrastructure/adding-hosts-to-fleet.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ If you're running Fleet locally, include `--insecure` because your TLS certifica
```
mkdir .osquery
./build/launcher \
--hostname=localhost:8412 \
--root_directory=.osquery \
--enroll_secret=32IeN3QLgckHUmMD3iW40kyLdNJcGzP5
--insecure
--hostname=localhost:8412 \
--root_directory=.osquery \
--enroll_secret=32IeN3QLgckHUmMD3iW40kyLdNJcGzP5
--insecure
```

#### Generating packages

The Launcher also provides easy, robust tooling for creating packages that you can distribute across your fleet:

```
$ make package-builder
$ ./build/package-builder make \
make package-builder
./build/package-builder make \
--hostname=fleet.acme.net:443 \
--enroll_secret=32IeN3QLgckHUmMD3iW40kyLdNJcGzP5
```
Expand Down
44 changes: 22 additions & 22 deletions docs/infrastructure/configuring-the-fleet-binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,37 +48,37 @@ For example, all of the following ways of launching Fleet are equivalent:
#### Using only CLI flags

```
$ /usr/bin/fleet serve \
--mysql_address=127.0.0.1:3306 \
--mysql_database=kolide \
--mysql_username=root \
--mysql_password=toor \
--redis_address=127.0.0.1:6379 \
--server_cert=/tmp/server.cert \
--server_key=/tmp/server.key \
--logging_json \
--auth_jwt_key=changeme
/usr/bin/fleet serve \
--mysql_address=127.0.0.1:3306 \
--mysql_database=kolide \
--mysql_username=root \
--mysql_password=toor \
--redis_address=127.0.0.1:6379 \
--server_cert=/tmp/server.cert \
--server_key=/tmp/server.key \
--logging_json \
--auth_jwt_key=changeme
```

#### Using only environment variables

```
$ KOLIDE_MYSQL_ADDRESS=127.0.0.1:3306 \
KOLIDE_MYSQL_DATABASE=kolide \
KOLIDE_MYSQL_USERNAME=root \
KOLIDE_MYSQL_PASSWORD=toor \
KOLIDE_REDIS_ADDRESS=127.0.0.1:6379 \
KOLIDE_SERVER_CERT=/tmp/server.cert \
KOLIDE_SERVER_KEY=/tmp/server.key \
KOLIDE_LOGGING_JSON=true \
KOLIDE_AUTH_JWT_KEY=changeme \
/usr/bin/fleet serve
KOLIDE_MYSQL_ADDRESS=127.0.0.1:3306 \
KOLIDE_MYSQL_DATABASE=kolide \
KOLIDE_MYSQL_USERNAME=root \
KOLIDE_MYSQL_PASSWORD=toor \
KOLIDE_REDIS_ADDRESS=127.0.0.1:6379 \
KOLIDE_SERVER_CERT=/tmp/server.cert \
KOLIDE_SERVER_KEY=/tmp/server.key \
KOLIDE_LOGGING_JSON=true \
KOLIDE_AUTH_JWT_KEY=changeme \
/usr/bin/fleet serve
```

#### Using a config file

```
$ echo '
echo '
mysql:
address: 127.0.0.1:3306
database: kolide
Expand All @@ -94,7 +94,7 @@ logging:
auth:
jwt_key: changeme
' > /tmp/kolide.yml
$ fleet serve --config /tmp/kolide.yml
fleet serve --config /tmp/kolide.yml
```

### What are the options?
Expand Down
60 changes: 30 additions & 30 deletions docs/infrastructure/fleet-on-centos.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ In this guide, we're going to install Kolide Fleet and all of it's application d
Acquiring a CentOS host to use for this guide is largely an exercise for the reader. If you don't have an CentOS host readily available, feel free to use [Vagrant](https://www.vagrantup.com/). In a clean, temporary directory, you can run the following to create a vagrant box, start it, and log into it:

```
$ echo 'Vagrant.configure("2") do |config|
echo 'Vagrant.configure("2") do |config|
config.vm.box = "bento/centos-7.1"
config.vm.network "forwarded_port", guest: 8080, host: 8080
end' > Vagrantfile
$ vagrant up
$ vagrant ssh
vagrant up
vagrant ssh
```

## Installing Fleet

To install Fleet, run the following:

```
$ wget https://github.com/fleetdm/fleet/releases/latest/download/fleet.zip
$ unzip fleet.zip 'linux/*' -d fleet
$ sudo cp fleet/linux/fleet* /usr/bin/
wget https://github.com/fleetdm/fleet/releases/latest/download/fleet.zip
unzip fleet.zip 'linux/*' -d fleet
sudo cp fleet/linux/fleet* /usr/bin/
```

## Installing and configuring dependencies
Expand All @@ -33,24 +33,24 @@ $ sudo cp fleet/linux/fleet* /usr/bin/
To install the MySQL server files, run the following:

```
$ wget https://repo.mysql.com/mysql57-community-release-el7.rpm
$ sudo rpm -i mysql57-community-release-el7.rpm
$ sudo yum update
$ sudo yum install mysql-server
wget https://repo.mysql.com/mysql57-community-release-el7.rpm
sudo rpm -i mysql57-community-release-el7.rpm
sudo yum update
sudo yum install mysql-server
```

To start the MySQL service:

```
$ sudo systemctl start mysqld
sudo systemctl start mysqld
```

Let's set a password for the MySQL root user.
MySQL creates an initial temporary root password which you can find in ```/var/log/mysqld.log``` you will need this password to change the root password.

Connect to MySQL
```
$ mysql -u root -p
mysql -u root -p
```
When prompted enter in the temporary password from ```/var/log/mysqld.log```

Expand All @@ -77,40 +77,40 @@ mysql> exit
```
Stop MySQL and start again
```
$ sudo mysqld stop
$ sudo systemctl start mysqld
sudo mysqld stop
sudo systemctl start mysqld
```
It's also worth creating a MySQL database for us to use at this point. Run the following to create the `kolide` database in MySQL. Note that you will be prompted for the password you created above.

```
$ echo 'CREATE DATABASE kolide;' | mysql -u root -p
echo 'CREATE DATABASE kolide;' | mysql -u root -p
```

### Redis

To install the Redis server files, run the following:

```
$ sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
$ sudo yum install redis
sudo rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo yum install redis
```

To start the Redis server in the background, you can run the following:

```
$ sudo service redis start
sudo service redis start
```

## Running the Fleet server

Now that we have installed Fleet, MySQL, and Redis, we are ready to launch Fleet! First, we must "prepare" the database. We do this via `fleet prepare db`:

```
$ /usr/bin/fleet prepare db \
--mysql_address=127.0.0.1:3306 \
--mysql_database=kolide \
--mysql_username=root \
--mysql_password=toor?Fl33t
/usr/bin/fleet prepare db \
--mysql_address=127.0.0.1:3306 \
--mysql_database=kolide \
--mysql_username=root \
--mysql_password=toor?Fl33t
```

The output should look like:
Expand All @@ -122,9 +122,9 @@ Migrations completed.
Before we can run the server, we need to generate some TLS keying material. If you already have tooling for generating valid TLS certificates, then you are encouraged to use that instead. You will need a TLS certificate and key for running the Fleet server. If you'd like to generate self-signed certificates, you can do this via:

```
$ openssl genrsa -out /tmp/server.key 4096
$ openssl req -new -key /tmp/server.key -out /tmp/server.csr
$ openssl x509 -req -days 366 -in /tmp/server.csr -signkey /tmp/server.key -out /tmp/server.cert
openssl genrsa -out /tmp/server.key 4096
openssl req -new -key /tmp/server.key -out /tmp/server.csr
openssl x509 -req -days 366 -in /tmp/server.csr -signkey /tmp/server.key -out /tmp/server.cert
```

You should now have three new files in `/tmp`:
Expand All @@ -136,7 +136,7 @@ You should now have three new files in `/tmp`:
Now we are ready to run the server! We do this via `fleet serve`:

```
$ /usr/bin/fleet serve \
/usr/bin/fleet serve \
--mysql_address=127.0.0.1:3306 \
--mysql_database=kolide \
--mysql_username=root \
Expand All @@ -162,8 +162,8 @@ See [systemd](./systemd.md) for documentation on running fleet as a background p
To install osquery on CentOS, you can run the following:

```
$ sudo rpm -ivh https://osquery-packages.s3.amazonaws.com/centos7/noarch/osquery-s3-centos7-repo-1-0.0.noarch.rpm
$ sudo yum install osquery
sudo rpm -ivh https://osquery-packages.s3.amazonaws.com/centos7/noarch/osquery-s3-centos7-repo-1-0.0.noarch.rpm
sudo yum install osquery
```

You will need to set the osquery enroll secret and osquery server certificate. If you head over to the manage hosts page on your Fleet instance (which should be [https://localhost:8080/hosts/manage](https://localhost:8080/hosts/manage)), you should be able to click "Add New Hosts" and see a modal like the following:
Expand All @@ -175,7 +175,7 @@ If you select "Fetch Kolide Certificate", your browser will download the appropr
You can also select "Reveal Secret" on that modal and the enrollment secret for your Fleet instance will be revealed. Copy that text and create a file with it's contents:

```
$ echo 'LQWzGg9+/yaxxcBUMY7VruDGsJRYULw8' | sudo tee /var/osquery/enroll_secret
echo 'LQWzGg9+/yaxxcBUMY7VruDGsJRYULw8' | sudo tee /var/osquery/enroll_secret
```

Now you're ready to run the `osqueryd` binary:
Expand Down
2 changes: 1 addition & 1 deletion docs/infrastructure/fleet-on-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ kubectl apply -f ./examples/kubernetes/fleet-deployment.yml
You should be able to get an instance of the webserver running via `kubectl get pods` and you should see the following logs:

```
$ kubectl logs fleet-webserver-9bb45dd66-zxnbq
kubectl logs fleet-webserver-9bb45dd66-zxnbq
ts=2017-11-16T02:48:38.440578433Z component=service method=ListUsers user=none err=null took=2.350435ms
ts=2017-11-16T02:48:38.441148166Z transport=https address=0.0.0.0:443 msg=listening
```
Expand Down
Loading

0 comments on commit 6536ba6

Please sign in to comment.