Skip to content

Commit

Permalink
infra: Add infra config docs and fix pubsub config bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ekerfelt committed Jan 17, 2025
1 parent a389ac0 commit 08f6c53
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion docs/go/self-host/configure-infra.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,13 @@ There must be exactly one database configuration for each declared database. You
"host": "db.myencoreapp.com:5432",
"tls_config": {
"disabled": false,
"ca": "---BEGIN CERTIFICATE---\n..."
"ca": "---BEGIN CERTIFICATE---\n...",
"disable_tls_hostname_verification": false,
"disable_ca_verification": false
},
"databases": {
"my-database": {
"name": "my-postgres-db-name",
"max_connections": 100,
"min_connections": 10,
"username": "db_user",
Expand All @@ -298,6 +301,7 @@ There must be exactly one database configuration for each declared database. You
```

- `my-database`: This is the name of the database as it is declared in your Encore app.
- `name`: The name of the database on the database server. Defaults to the declared Encore name.
- `host`: SQL server host, optionally including the port.
- `tls_config`: TLS configuration for secure connections. If the server uses TLS with a non-system CA root, or requires a client certificate, specify the appropriate fields as PEM-encoded strings. Otherwise, they can be left empty.
- `databases`: List of databases, each with connection settings.
Expand Down
2 changes: 2 additions & 0 deletions pkg/encorebuild/compile/compile.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package compile

import (
"fmt"
osPkg "os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -192,6 +193,7 @@ func RustBinary(cfg *buildconf.Config, artifactPath, outputPath string, cratePat
defer cargoLock.Unlock()

// nosemgrep
fmt.Println(cmd.String())
if err := cmd.Run(); err != nil {
Bailf("failed to compile rust binary: %v", err)
}
Expand Down
5 changes: 3 additions & 2 deletions runtimes/core/src/infracfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ pub struct GCPPubsub {
#[derive(Debug, Serialize, Deserialize)]
pub struct GCPTopic {
pub name: String,

pub project_id: Option<String>,
#[serde(skip_serializing_if = "HashMap::is_empty", default)]
pub subscriptions: HashMap<String, GCPSub>,
}

Expand Down Expand Up @@ -281,6 +281,7 @@ pub struct AWSSnsSqs {
#[derive(Debug, Serialize, Deserialize)]
pub struct AWSTopic {
pub arn: String,
#[serde(skip_serializing_if = "HashMap::is_empty", default)]
pub subscriptions: HashMap<String, AWSSub>,
}

Expand All @@ -298,7 +299,7 @@ pub struct NSQPubsub {
#[derive(Debug, Serialize, Deserialize)]
pub struct NSQTopic {
pub name: String,
#[serde(skip_serializing_if = "HashMap::is_empty")]
#[serde(skip_serializing_if = "HashMap::is_empty", default)]
pub subscriptions: HashMap<String, NSQSub>,
}

Expand Down
2 changes: 1 addition & 1 deletion runtimes/go/appruntime/exported/config/infra/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (a *GCS) Validate(v *validator) {
type Bucket struct {
Name string `json:"name,omitempty"`
KeyPrefix string `json:"key_prefix,omitempty"`
PublicBaseURL string `json:"public_base_url,omitempty`
PublicBaseURL string `json:"public_base_url,omitempty"`
}

func (a *Bucket) Validate(v *validator) {
Expand Down

0 comments on commit 08f6c53

Please sign in to comment.