Skip to content

Commit

Permalink
doc: add rg port ranges to self hosting docs
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Dec 10, 2024
1 parent c38e664 commit 0aef551
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 25 deletions.
14 changes: 10 additions & 4 deletions docs/src/content/docs/networking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,7 @@ If using host ports, read about differences in behavior with [actor rescheduling

### Host

<Note>
"Host endpoint type" has no association with "host networking" or "host
routing" above.
</Note>
<Note>"Host endpoint type" has no association with "host networking" or "host routing" above.</Note>

The host endpoint type uses the `Host` header to route the request to the correct actor. This is the default & recommended method to use for production Rivet clusters.

Expand All @@ -98,6 +95,15 @@ The path endpoint type uses the beginning of the request path to route to the co
- Self hosting or developing Rivet without a wildcard DNS record (e.g. Rivet Guard running on `127.0.0.1:7080`)
- Rare cases where explicit hostnames need to be whitelisted (e.g. Discord Activities [URL mappings](https://discord.com/developers/docs/activities/development-guides#url-mapping))

<Warning>
Directing your users to an HTML page with path endpoint type may be a security
risk. The origin for path endpoint types (`route.actor.{region}.rivet.run`) is
shared with other actors. This means that all cookies, local/session storage,
web workers, etc are shared with any other actor running in the same region.

Use the host endpoint type instead if serving HTML content.
</Warning>

## Routing Diagram

This diagram shows how requests are routed from the end-user to the application running on Rivet based on the
Expand Down
12 changes: 9 additions & 3 deletions docs/src/content/docs/self-hosting/docker-compose.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ This Docker Compose is intended for running a full development environment for R

## Prerequisites

- Docker
- Docker Compose

## Required ports

The following ports need to be open before running Rivet:

- 8080-8082 (Rivet server)
- 9000 (S3)
- 20000-20100 (Rivet client host networking)
| Service | Description | Optional | Port |
| ------------ | --------------- | -------- | --------- |
| Rivet Server | API | | 8080 |
| | Object Storage | | 9000 |
| Rivet Guard | HTTP | | 7080 |
| | HTTPS | | 7443 |
| | TCP & UDP | X | 7500-7599 |
| Rivet Client | Host Networking | X | 7600-7699 |

## Operation

Expand Down
18 changes: 10 additions & 8 deletions packages/services/cluster/src/workflows/datacenter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ pub(crate) async fn cluster_datacenter(ctx: &mut WorkflowCtx, input: &Input) ->
};

// TODO(RVT-4340): Clean up this syntax
if ctx.is_new().await? {
ctx.activity(InsertDbInputV2 {
v1,
guard_public_hostname: input.guard_public_hostname.clone(),
})
.await?;
} else {
ctx.activity(v1).await?;
match ctx.check_version(2).await? {
1 => ctx.activity(v1).await?,
2 => {
ctx.activity(InsertDbInputV2 {
v1,
guard_public_hostname: input.guard_public_hostname.clone(),
})
.await?
}
_ => bail!("unreachable"),
}
}

Expand Down
15 changes: 13 additions & 2 deletions scripts/openapi/gen_rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async function generateRustSdk() {
}

async function fixOpenApiBugs() {
const files = {
const files: Record<string, [RegExp, string][]> = {
"cloud_games_matchmaker_api.rs": [
[/CloudGamesLogStream/g, "crate::models::CloudGamesLogStream"],
],
Expand All @@ -80,7 +80,18 @@ async function fixOpenApiBugs() {

for (const [file, replacements] of Object.entries(files)) {
const filePath = `${GEN_PATH_RUST}/src/apis/${file}`;
let content = await Deno.readTextFile(filePath);
let content;
try {
content = await Deno.readTextFile(filePath);
} catch (error) {
if (error instanceof Deno.errors.NotFound) {
console.warn(`File not found: ${filePath}`);
continue;
} else {
throw error;
}
}

for (const [from, to] of replacements) {
content = content.replace(from, to);
}
Expand Down
4 changes: 2 additions & 2 deletions sdks/api/full/typescript/archive.tgz

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions sdks/api/runtime/rust/Cargo.toml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions sdks/api/runtime/rust/src/apis/actor_api.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdks/api/runtime/rust/src/apis/actor_logs_api.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdks/api/runtime/typescript/archive.tgz

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0aef551

Please sign in to comment.