Skip to content
Closed
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
130 changes: 3 additions & 127 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion docker/dev-full/frontend-hub/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ cd /app
yarn install

# Start dev server
#
# Set base to /ui since this is where the UI is hosted in the dev server
cd /app/frontend/apps/hub
yarn dev --host 0.0.0.0 --port 5080
yarn dev --base=/ui
2 changes: 2 additions & 0 deletions docker/dev-full/rivet-server/config.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"access_kind": "development"
},
"ui": {
"enable": true,
"proxy_origin": "http://frontend-hub:5080",
"public_origin_regex": ".*"
},
"guard": {
Expand Down
7 changes: 7 additions & 0 deletions frontend/apps/hub/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@ export default defineConfig({
process.env.DEBUG_BUNDLE ? visualizer() : null,
],
server: {
host: "0.0.0.0",
port: 5080,
allowedHosts: true,
// Listen on a different port since we don't proxy WebSockets on /ui
hmr: {
port: 5080,
host: "127.0.0.1"
}
},
preview: {
port: 5080,
Expand Down
11 changes: 11 additions & 0 deletions packages/common/config/src/config/server/rivet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,11 @@ pub struct Ui {
///
/// If disabled, the UI can be hosted separately.
pub enable: Option<bool>,
/// Origin to proxy UI requests to. This should be the server serving the actula files fro the
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a typo in the documentation comment: actula files fro the should be actual files from the.

Suggested change
/// Origin to proxy UI requests to. This should be the server serving the actula files fro the
/// Origin to proxy UI requests to. This should be the server serving the actual files from the

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

/// frontend.
///
/// This is frequently either Vite for a development setup or Nginx for a simple setup.
pub proxy_origin: Option<Url>,
/// The origin URL for the UI.
pub public_origin: Option<Url>,
/// Regular expression to match valid UI origins.
Expand All @@ -741,6 +746,12 @@ impl Ui {
self.enable.unwrap_or(true)
}

pub fn proxy_origin(&self) -> Url {
self.proxy_origin
.clone()
.unwrap_or_else(|| Url::parse(&format!("http://127.0.0.1:5080")).unwrap())
}

pub fn public_origin(&self) -> Url {
self.public_origin.clone().unwrap_or_else(|| {
Url::parse(&format!(
Expand Down
15 changes: 0 additions & 15 deletions packages/common/hub-embed/Cargo.toml

This file was deleted.

65 changes: 0 additions & 65 deletions packages/common/hub-embed/build.rs

This file was deleted.

7 changes: 0 additions & 7 deletions packages/common/hub-embed/src/lib.rs

This file was deleted.

3 changes: 1 addition & 2 deletions packages/core/api/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ tracing = "0.1"
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "json", "ansi"] }
url = "2.2.2"
uuid = { version = "1", features = ["v4"] }
rivet-hub-embed.workspace = true
mime_guess = "2.0.5"
rivet-config.workspace = true
global-error.workspace = true
reqwest = { version = "0.12", default-features = false, features = ["json"] }
Loading
Loading