Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix code block styling #5058

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions website/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import type { MDXComponents } from "mdx/types";

export function useMDXComponents(components: MDXComponents): MDXComponents {
return {
// Flowbite typography and highlight together create ugly code block
// offspring, so disable typography for code blocks.
pre: ({ children }) => (
<div className="not-format mb-4 lg:mb-8">
<pre>{children}</pre>
</div>
),
...components,
};
}
2 changes: 1 addition & 1 deletion website/src/app/blog/apr-2024-update/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ address handed out by an Erlang-powered telecom switch.
As it turns out, managing connections for a remote access product is _a lot_
like managing messages across a telecom network:

```
```text
1. Peer A wants to connect to Peer B.
2. Is it allowed?
Yes: here are their addresses and keys to secure the connection.
Expand Down
5 changes: 3 additions & 2 deletions website/src/app/blog/how-dns-works-in-firezone/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Image from "next/image";
import Alert from "@/components/DocsAlert";
import Link from "next/link";

```
```text
user@host:~ % nslookup github.com
Server: 100.100.111.1
Address: 100.100.111.1#53
Expand Down Expand Up @@ -385,7 +385,8 @@ works the same for any third-party SaaS service.

1. An admin defines a DNS Resource with address `*.slack.com` in the Firezone
admin portal. Notice the wildcard -- this will route all subdomains for Slack
through Firezone as well, which helps ensure all relevant Slack traffic is routed.
through Firezone as well, which helps ensure all relevant Slack traffic is
routed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a hard word wrap I should set in my editors?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I use prettier set at 80, but it's not a hard requirement. Wrapping markdown is handled to varying degrees of success depending on the editor.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just like to avoid like 200 line markdown paragraphs if possible.

1. The admin then defines a corresponding Policy with the Groups that should
have access.
1. All connected Clients affected by the Policy will immediately receive the new
Expand Down
2 changes: 1 addition & 1 deletion website/src/app/blog/mar-2024-update/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ instructions and download links for your architecture.

Here's an quick example of how to connect to Firezone with it:

```
```bash
# sudo is needed to manage DNS and open a tun interface
sudo ./firezone-linux-x64 --token <your-service-account-token>
```
Expand Down
16 changes: 8 additions & 8 deletions website/src/app/docs/administer/backup/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ using the default Docker compose template.
1. Stop Firezone (warning: this **will** disconnect any users connected to the
VPN):

```
```bash
docker compose -f $HOME/.firezone/docker-compose.yml down
```

2. Copy relevant files and folders. If your made any customizations to
`/etc/docker/daemon.json` (for example, for IPv6 support), be sure to include
that in the backup as well.

```
```bash
tar -zcvfp $HOME/firezone-back-$(date +'%F-%H-%M').tgz $HOME/.firezone /var/lib/docker/volumes/firezone_postgres-data
```

Expand All @@ -56,13 +56,13 @@ A backup file named `firezone-back-TIMESTAMP.tgz` will then be stored in

1. Copy the files back to their original location:

```
```bash
tar -zxvfp /path/to/firezone-back.tgz -C / --numeric-owner
```

2. Optionally, enable Docker to boot on startup:

```
```bash
systemctl enable docker
```

Expand All @@ -74,13 +74,13 @@ systemctl enable docker
1. Stop Firezone (warning: this **will** disconnect any users connected to the
VPN):

```
```bash
firezone-ctl stop
```

2. Copy relevant files and folders:

```
```bash
tar -zcvfp $HOME/firezone-back-$(date +'%F-%H-%M').tgz /var/opt/firezone /opt/firezone /usr/bin/firezone-ctl /etc/systemd/system/firezone-runsvdir-start.service /etc/firezone
```

Expand All @@ -91,13 +91,13 @@ A backup file named `firezone-back-TIMESTAMP.tgz` will then be stored in

1. Copy the files back to their original location:

```
```bash
tar -zxvfp /path/to/firezone-back.tgz -C / --numeric-owner
```

2. Reconfigure Firezone to ensure configuration is applied to the host system:

```
```bash
firezone-ctl reconfigure
```

Expand Down
16 changes: 8 additions & 8 deletions website/src/app/docs/administer/troubleshoot/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@ For example, to clear OIDC configs:
<TabsGroup>
<TabsItem title="Docker" active>

```
```bash
psql -d firezone -h 127.0.0.1 -U postgres -c "UPDATE configurations SET openid_connect_providers = '[]'"
```

Similarly, to clear SAML configs:

```
```bash
psql -d firezone -h 127.0.0.1 -U postgres -c "UPDATE configurations SET saml_identity_providers = '[]'"
```

</TabsItem>
<TabsItem title="Omnibus">

```
```bash
/opt/firezone/embedded/bin/psql -d $DATABASE_NAME -h $DATABASE_HOST -U $DATABASE_USER -c "UPDATE configurations SET openid_connect_providers = '[]'"
```

Similarly, to clear SAML configs:

```
```bash
/opt/firezone/embedded/bin/psql -d $DATABASE_NAME -h $DATABASE_HOST -U $DATABASE_USER -c "UPDATE configurations SET saml_identity_providers = '[]'"
```

Expand All @@ -68,7 +68,7 @@ websocket connection can't be established, you'll see a red dot indicator in the
upper-right portion of the Firezone web UI and a corresponding message when you
hover over it:

```
```text
Secure websocket not connected! ...
```

Expand Down Expand Up @@ -96,7 +96,7 @@ In most cases, you'll find clues in one or more of the following locations:
If the websocket connection is successful, you should see output in the
`phoenix` service logs similar the following:

```
```text
2022-09-23_15:05:47.29158 15:05:47.291 [info] CONNECTED TO Phoenix.LiveView.Socket in 24µs
2022-09-23_15:05:47.29160 Transport: :websocket
2022-09-23_15:05:47.29160 Serializer: Phoenix.Socket.V2.JSONSerializer
Expand Down Expand Up @@ -127,15 +127,15 @@ clients to the destinations you want to allow through Firezone.
If you're using `ufw`, this can be done by making sure the default routing
policy is `allow`:

```
```text
ubuntu@fz:~$ sudo ufw default allow routed
Default routed policy changed to 'allow'
(be sure to update your rules accordingly)
```

A `ufw` status for a typical Firezone server might look like this:

```
```text
ubuntu@fz:~$ sudo ufw status verbose
Status: active
Logging: on (low)
Expand Down
6 changes: 3 additions & 3 deletions website/src/app/docs/administer/upgrade/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Follow the steps below to upgrade Firezone:

1. Change to your Firezone installation directory, by default `$HOME/.firezone`:

```
```bash
cd $HOME/.firezone
```

Expand All @@ -30,13 +30,13 @@ cd $HOME/.firezone
key for the `firezone` service.
1. Update service images:

```
```bash
docker compose pull
```

1. Re-up the services (**warning: this will restart updated services**):

```
```bash
docker compose up -d
```

Expand Down
2 changes: 1 addition & 1 deletion website/src/app/docs/authenticate/saml/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Firezone automatically generates these for on both Docker and Omnibus-based
deployments. If you'd like to use your own cert and key, however, you can
generate them with `openssl`:

```
```bash
openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout saml.key -out saml.crt
```

Expand Down
18 changes: 8 additions & 10 deletions website/src/app/docs/deploy/docker/readme.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Alert from "@/components/DocsAlert";
import SupportOptions from "@/components/SupportOptions";
import CodeBlock from "@/components/CodeBlock";

# Install Firezone with Docker

Expand Down Expand Up @@ -46,10 +45,9 @@ After prerequisites are satisfied, you're ready to install the Firezone Server.

The easiest way to deploy Firezone with Docker is the automatic install script:

<CodeBlock
language="bash"
codeString="bash <(curl -fsSL https://github.com/firezone/firezone/raw/legacy/scripts/install.sh)"
/>
```bash
bash <(curl -fsSL https://github.com/firezone/firezone/raw/legacy/scripts/install.sh)
```

This will ask you a few questions regarding initial configuration, then proceed
to download a sample docker-compose.yml file, configure it with your responses,
Expand All @@ -65,33 +63,33 @@ installation process, follow the steps below to install manually.
1. Download the docker compose template to a local working directory: **For
Linux**:

```
```bash
curl -fsSL https://raw.githubusercontent.com/firezone/firezone/legacy/docker-compose.prod.yml -o docker-compose.yml
```

**For macOS, Windows (non-production only)**:

```
```bash
curl -fsSL https://raw.githubusercontent.com/firezone/firezone/legacy/docker-compose.desktop.yml -o docker-compose.yml
```

1. Generate required secrets:

```
```bash
docker run --rm firezone/firezone bin/gen-env > .env
```

2. At a minimum, change the `DEFAULT_ADMIN_EMAIL` and `EXTERNAL_URL` variables.
Optionally modify other secrets as needed.
3. Migrate the database:

```
```bash
docker compose run --rm firezone bin/migrate
```

4. Create the first admin:

```
```bash
docker compose run --rm firezone bin/create-or-reset-admin
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This configuration needs to be placed in

and activated with `a2ensite <server-name>`

```
```text
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
Expand All @@ -39,7 +39,7 @@ LoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so
This configuration builds on the one above and uses Firezone's auto-generated
self-signed certificates.

```
```text
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ the `crt` and `key` file.

`/etc/haproxy/haproxy.cfg`:

```
```text
defaults
mode http

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You may use the public key below to encrypt emails to

https://keys.openpgp.org/vks/v1/by-fingerprint/250F8B56804107042DFC6A7345113BA04AD83D8A

```
```text
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: 250F 8B56 8041 0704 2DFC 6A73 4511 3BA0 4AD8 3D8A
Comment: Firezone Security <security@firezone.dev>
Expand Down
4 changes: 2 additions & 2 deletions website/src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
text-decoration: underline !important;
}

:is(pre, code) {
@apply overflow-x-auto;
*:is(code) {
@apply overflow-x-auto rounded text-sm;
}
}
4 changes: 2 additions & 2 deletions website/src/app/kb/administer/logs/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ that can be easily shared.
To export logs from the Gateway Docker container, use the `docker logs` command
and redirect the output to a file:

```
```bash
docker logs firezone-gateway > firezone-gateway.log
```

Expand All @@ -50,7 +50,7 @@ for a full list of log drivers and options available.
To export logs from the Gateway systemd service, use the `journalctl` command
and redirect the output to a file:

```
```bash
journalctl -u firezone-gateway > firezone-gateway.log
```

Expand Down
8 changes: 4 additions & 4 deletions website/src/app/kb/administer/troubleshooting/readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ some of the troubleshooting commands below to diagnose the issue.

Check that the container is running:

```
```bash
docker ps --filter "name=firezone-gateway"
```

Check the container logs:

```
```bash
docker logs firezone-gateway
```

Expand All @@ -32,13 +32,13 @@ docker logs firezone-gateway

Check the status of the service:

```
```bash
sudo systemctl status firezone-gateway
```

Check the logs:

```
```bash
sudo journalctl -u firezone-gateway.service
```

Expand Down