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

chore: v0.49.0 #306

Merged
merged 11 commits into from
Nov 12, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/builds.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,35 @@ Create them at the root of your project.
- `shuttle_prebuild.sh`: Runs before `cargo build`. Can be used to install custom build dependencies.
- `shuttle_postbuild.sh`: Runs after `cargo build`.
- `shuttle_setup_container.sh`: Runs in the runtime image before build artifacts are copied into it. Can be used to install custom runtime dependencies.

### Example: Install a custom Rust toolchain

In this example, we install and switch to the `nighlty` toolchain.

```sh shuttle_prebuild.sh
rustup install nightly --profile minimal
rustup default nightly
```

### Example: Install a build dependency

```sh shuttle_prebuild.sh
apt update
apt install -y libopus-dev
```

### Example: Build a WASM frontend

```sh shuttle_postbuild.sh
cd frontend
trunk build --release
```

Note: To use the built static assets at runtime, use [build.assets](/docs/files#build-assets).

### Example: Install a runtime dependency

```sh shuttle_setup_container.sh
apt update
apt install -y ffmpeg
```
14 changes: 13 additions & 1 deletion docs/deployment-environment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,24 @@ icon: "box"

## Infrastructure

### Deployments

Deployments run in AWS ECS with Fargate VMs.
The default compute configuration is 0.25 vCPU and 0.5 GB RAM.
This will soon be made configurable.
If you need more compute out of the gate, reach out to us.

{/* HTTPS traffic is proxied to your */}
**Rolling deployments**:
When a new deployment is made, it will be started alongside the previous one until it is considered healthy.
After that, the previous deployment will start shutting down.
This means that there is a window of time where there are two instances running in parallel.
If the new deployment fails to become healthy, it will be retried 3 times while the the previous one will stays up.

### HTTPS traffic

HTTPS traffic is proxied to your app on the project's default subdomain and any [custom domains]() that have been added.

The proxy sets the `X-Forwarded-For` HTTP header on incoming requests to the remote IP address of the request.

## Environment variables

Expand Down
18 changes: 9 additions & 9 deletions docs/local-run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ It then starts a local provisioner server that simulates resource provisioning o

The environment variables available in the [deployment environment](/docs/deployment-environment) are also set during a local run.

### Local runs with databases
## Local runs with databases

If your project uses a database resource, it will default to starting a local [Docker](https://docs.docker.com/get-docker/) container for that database.
If you'd like to opt out of this behavior and supply your own database URI, simply pass it in as an argument to your resource.
Expand All @@ -34,7 +34,7 @@ async fn main(

<Note>**IMPORTANT:** If Docker isn't started, you may receive an "os error 2" error. This is typically related to your Docker installation. If you're using Docker via the CLI, you can use any Docker command to start it up. If you're using Docker Desktop, you will need to start Docker Desktop.</Note>

### Expose your application to your local network
## Expose your application to your local network

If you'd like to expose your application to you local network, for example if you're serving a static
website and you'd like to open it on your phone, simply pass in the `--external` flag:
Expand All @@ -53,11 +53,11 @@ shuttle run --external --port 8123

<Note>You may need to open the port your app is started on in your firewall.</Note>

### Development Tips
## Development Tips

Here are some small tips and tricks to boost your productivity when developing locally.

#### Live reload backend with `cargo watch`
### Live reload backend with `cargo watch`

To live reload your Shuttle app when you save a file, you can use [cargo-watch](https://github.com/watchexec/cargo-watch):

Expand All @@ -72,7 +72,7 @@ cargo watch -qcs 'shuttle run'

Small caveat: Be aware that ignoring files with `.ignore` will also affect the behaviour of `shuttle deploy`.

#### Live reload frontend with `tower-livereload`
### Live reload frontend with `tower-livereload`

Using `cargo watch` will only reload the "backend" Shuttle process.
If you are developing a frontend in the browser that is hosted by your Shuttle app,
Expand Down Expand Up @@ -106,7 +106,7 @@ if cfg!(debug_assertions) {
}
```

### Docker engines
## Docker engines

`cargo-shuttle` uses the [bollard](https://crates.io/crates/bollard) crate to interact with the Docker engine on local runs.

Expand All @@ -123,13 +123,13 @@ On Unix, bollard defaults to connecting to `unix:///var/run/docker.sock` unless

If you end up using a `DOCKER_HOST` like below, you can add the `export DOCKER_HOST=...` line to your shell's config file to have it automatically set in new shell sessions.

#### Docker Desktop
### Docker Desktop

```bash
export DOCKER_HOST="unix://$HOME/.docker/run/docker.sock"
```

#### Podman
### Podman

You will need to expose a rootless socket for Podman, and then set the `DOCKER_HOST` environment variable:

Expand All @@ -138,7 +138,7 @@ podman system service --time=0 unix:///tmp/podman.sock
export DOCKER_HOST=unix:///tmp/podman.sock
```

#### Colima
### Colima

```bash
export DOCKER_HOST="unix://$HOME/.colima/default/docker.sock"
Expand Down
2 changes: 1 addition & 1 deletion docs/logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ By default, Shuttle will set up a global tracing subscriber behind the scenes.
If you'd rather set up your own tracing or logging, you can opt-out by disabling the default features on `shuttle-runtime`:

```toml Cargo.toml
shuttle-runtime = { version = "0.48.0", default-features = false }
shuttle-runtime = { version = "0.49.0", default-features = false }
```

With the default features enabled you can skip the step of initializing your subscriber when implementing [tracing](https://docs.rs/tracing/latest/tracing/)
Expand Down
10 changes: 9 additions & 1 deletion docs/projects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Deployments to different Shuttle projects run in their own ECS service (Fargate
## Project Limits

<Info>
In the free Community Tier, you are limited to a single project.
In the free Community Tier, you are limited to 3 projects.
See [Pricing](https://www.shuttle.dev/pricing) for Pro tier benefits, such as more projects.
</Info>

Expand All @@ -33,6 +33,14 @@ You can view your project IDs and names with:
shuttle project list
```

You can rename a project with the following command.
Note: This also updates the default subdomain name.
Custom domains remain unchanged.

```sh
shuttle project update name <new-name>
```

## Project Linking

For the Shuttle CLI to know which Shuttle Project ID to target, it stores the ID in a gitignored config file in your project.
Expand Down
4 changes: 2 additions & 2 deletions examples/actix-cookie-authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ edition = "2021"
actix-identity = "0.6.0"
actix-session = { version = "0.8.0", features = ["cookie-session"] }
actix-web = "4.3.1"
shuttle-actix-web = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-actix-web = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.26.0"
```
Your `main.rs` should look like this:
Expand Down
6 changes: 3 additions & 3 deletions examples/actix-postgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ edition = "2021"

[dependencies]
actix-web = "4.3.1"
shuttle-actix-web = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-actix-web = "0.49.0"
shuttle-runtime = "0.49.0"
serde = "1.0.148"
shuttle-shared-db = { version = "0.48.0", features = ["postgres", "sqlx"] }
shuttle-shared-db = { version = "0.49.0", features = ["postgres", "sqlx"] }
sqlx = "0.8.2"
tokio = "1.26.0"
```
Expand Down
4 changes: 2 additions & 2 deletions examples/actix-static-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ edition = "2021"
[dependencies]
actix-web = "4.3.1"
actix-files = "0.6.2"
shuttle-actix-web = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-actix-web = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.26.0"
```

Expand Down
4 changes: 2 additions & 2 deletions examples/actix-websocket-actorless.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ futures = "0.3"
reqwest = "0.11"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
shuttle-actix-web = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-actix-web = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = { version = "1", features = ["rt-multi-thread", "sync"] }
tracing = "0.1"
```
Expand Down
4 changes: 2 additions & 2 deletions examples/actix.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ edition = "2021"

[dependencies]
actix-web = "4.3.1"
shuttle-actix-web = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-actix-web = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.26.0"
```
</CodeGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/axum-jwt-authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ jsonwebtoken = "8.3.0"
once_cell = "1.18.0"
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.107"
shuttle-axum = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-axum = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.28.2"
tracing-subscriber = "0.3.17"
```
Expand Down
6 changes: 3 additions & 3 deletions examples/axum-postgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ edition = "2021"
[dependencies]
axum = "0.7.3"
serde = { version = "1.0.188", features = ["derive"] }
shuttle-axum = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-shared-db = { version = "0.48.0", features = ["postgres", "sqlx"] }
shuttle-axum = "0.49.0"
shuttle-runtime = "0.49.0"
shuttle-shared-db = { version = "0.49.0", features = ["postgres", "sqlx"] }
sqlx = "0.8.2"
tokio = "1.28.2"
```
Expand Down
4 changes: 2 additions & 2 deletions examples/axum-static-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ publish = false

[dependencies]
axum = "0.7.3"
shuttle-axum = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-axum = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.28.2"
tower-http = { version = "0.5.0", features = ["fs"] }
```
Expand Down
4 changes: 2 additions & 2 deletions examples/axum-websockets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ futures = "0.3.28"
reqwest = "0.11.23"
serde = { version = "1.0.163", features = ["derive"] }
serde_json = "1.0.96"
shuttle-axum = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-axum = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.28.2"
tower-http = { version = "0.5.0", features = ["fs"] }
```
Expand Down
4 changes: 2 additions & 2 deletions examples/axum.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ edition = "2021"

[dependencies]
axum = "0.7.4"
shuttle-axum = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-axum = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.28.2"
```
</CodeGroup>
Expand Down
4 changes: 2 additions & 2 deletions examples/poise.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ publish = false
[dependencies]
anyhow = "1.0.68"
poise = "0.6.1"
shuttle-runtime = "0.48.0"
shuttle-runtime = "0.49.0"
# Since poise is a serenity command framework, it can run on Shuttle with shuttle-serenity
shuttle-serenity = "0.48.0"
shuttle-serenity = "0.49.0"
tracing = "0.1.37"
tokio = "1.26.0"
```
Expand Down
4 changes: 2 additions & 2 deletions examples/rocket-jwt-authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jsonwebtoken = { version = "8.1.1", default-features = false }
lazy_static = "1.4.0"
rocket = { version = "0.5.0", features = ["json"] }
serde = { version = "1.0.148", features = ["derive"] }
shuttle-rocket = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-rocket = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.26.0"
```
Your `main.rs` should look like this:
Expand Down
6 changes: 3 additions & 3 deletions examples/rocket-postgres.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ edition = "2021"
[dependencies]
rocket = { version = "0.5.0", features = ["json"] }
serde = "1.0.148"
shuttle-rocket = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-shared-db = { version = "0.48.0", features = ["postgres", "sqlx"] }
shuttle-rocket = "0.49.0"
shuttle-runtime = "0.49.0"
shuttle-shared-db = { version = "0.49.0", features = ["postgres", "sqlx"] }
sqlx = "0.8.2"
tokio = "1.26.0"
```
Expand Down
4 changes: 2 additions & 2 deletions examples/rocket-static-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ publish = false

[dependencies]
rocket = "0.5.0"
shuttle-rocket = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-rocket = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.26.0"
```

Expand Down
4 changes: 2 additions & 2 deletions examples/rocket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ edition = "2021"

[dependencies]
rocket = "0.5.0"
shuttle-rocket = "0.48.0"
shuttle-runtime = "0.48.0"
shuttle-rocket = "0.49.0"
shuttle-runtime = "0.49.0"
tokio = "1.26.0"
```
</CodeGroup>
Expand Down
6 changes: 3 additions & 3 deletions examples/serenity-todo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ edition = "2021"
anyhow = "1.0.66"
serde = "1.0.148"
serenity = { version = "0.12.0", default-features = false, features = ["client", "gateway", "rustls_backend", "model"] }
shuttle-runtime = "0.48.0"
shuttle-serenity = "0.48.0"
shuttle-shared-db = { version = "0.48.0", features = ["postgres", "sqlx"] }
shuttle-runtime = "0.49.0"
shuttle-serenity = "0.49.0"
shuttle-shared-db = { version = "0.49.0", features = ["postgres", "sqlx"] }
sqlx = "0.8.2"
tokio = "1.26.0"
tracing = "0.1.37"
Expand Down
4 changes: 2 additions & 2 deletions examples/serenity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ edition = "2021"
[dependencies]
anyhow = "1.0.66"
serenity = { version = "0.12.0", default-features = false, features = ["client", "gateway", "rustls_backend", "model"] }
shuttle-runtime = "0.48.0"
shuttle-serenity = "0.48.0"
shuttle-runtime = "0.49.0"
shuttle-serenity = "0.49.0"
tokio = "1.26.0"
tracing = "0.1.37"
```
Expand Down
4 changes: 2 additions & 2 deletions getting-started/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ If you haven't, go to the [installation](./installation) guide.

## Login

The login command opens the [Shuttle Console](https://console.shuttle.dev/) where you can copy your API key:
The login command opens the [Shuttle Console](https://console.shuttle.dev/) to authenticate your CLI:

```sh
shuttle login
```

## Create your first project

The init command lets you generate a Hello World project or one of our [examples](/examples) or [templates](/templates).
The init command lets you generate a Hello World project or clone one of our [examples](/examples) or [templates](/templates).
For your first project, try a Hello World template.

```sh
Expand Down
Loading
Loading