mirror of
https://github.com/fluxerapp/fluxer.git
synced 2026-09-02 21:04:06 +03:00
fix(workspace): minimise dev env requirements by default (#1214)
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
"DOCKER_HOST": "unix:///var/run/docker.sock",
|
||||
"KUBECONFIG": "/workspaces/fluxer/.fluxer/k8s/local-kubeconfig"
|
||||
},
|
||||
"runServices": ["workspace", "cassandra", "valkey", "nats", "livekit", "elasticsearch"],
|
||||
"runServices": ["workspace", "postgres", "valkey", "nats", "livekit", "meilisearch", "mailpit"],
|
||||
"forwardPorts": [
|
||||
3000, 8088, 8080, 8771, 8082, 3010, 3020, 8100, 8101, 8102, 8103, 8104, 8105, 8106, 8107, 8108, 8109, 8110, 8111,
|
||||
8112, 8113, 8114, 8115, 8116, 8117, 8118, 8119, 8120, 8121, 8122, 8123, 8124, 8125, 3900, 8888, 9333, 9340, 23646,
|
||||
4222, 7880, 9200, 8000
|
||||
4222, 7700, 7880, 7900, 9200, 8000
|
||||
],
|
||||
"portsAttributes": {
|
||||
"8000": {
|
||||
@@ -51,11 +51,14 @@
|
||||
"7880": {
|
||||
"label": "LiveKit"
|
||||
},
|
||||
"7700": {
|
||||
"label": "Meilisearch"
|
||||
},
|
||||
"9200": {
|
||||
"label": "Elasticsearch"
|
||||
}
|
||||
},
|
||||
"postCreateCommand": "find /workspaces/fluxer -maxdepth 4 -type d -name node_modules -prune -exec sudo chown -R vscode:vscode {} + && sudo chown -R vscode:vscode /home/vscode/.local/share/pnpm && cargo run -p fluxer-dev -- bootstrap && bash /workspaces/fluxer/fluxer_docs/serve.sh --bootstrap",
|
||||
"postCreateCommand": "sudo chown -R vscode:vscode /workspaces/fluxer/target && find /workspaces/fluxer -maxdepth 4 -type d -name node_modules -prune -exec sudo chown -R vscode:vscode {} + && sudo chown -R vscode:vscode /home/vscode/.local/share/pnpm && cargo run -p fluxer-dev -- bootstrap",
|
||||
"postStartCommand": "cargo run -p fluxer-dev -- post-start && bash /workspaces/fluxer/fluxer_docs/serve.sh --daemon",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
|
||||
@@ -10,9 +10,9 @@ services:
|
||||
env_file:
|
||||
- ../config/env/development.env
|
||||
environment:
|
||||
FLUXER_SEARCH_URL: http://elasticsearch:9200
|
||||
FLUXER_SEARCH_USERNAME: elastic
|
||||
FLUXER_SEARCH_PASSWORD: fluxer-dev-elasticsearch
|
||||
FLUXER_SEARCH_ENGINE: meilisearch
|
||||
FLUXER_SEARCH_URL: http://meilisearch:7700
|
||||
FLUXER_SEARCH_API_KEY: fluxer-dev-meilisearch
|
||||
FLUXER_POSTGRES_HOST: postgres
|
||||
FLUXER_SELF_HOSTED: "true"
|
||||
DOCKER_HOST: unix:///var/run/docker.sock
|
||||
@@ -247,18 +247,19 @@ services:
|
||||
- "9340:9340"
|
||||
- "23646:23646"
|
||||
depends_on:
|
||||
- cassandra
|
||||
- postgres
|
||||
- valkey
|
||||
- nats
|
||||
- livekit
|
||||
- elasticsearch
|
||||
- meilisearch
|
||||
- mailpit
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
cassandra:
|
||||
image: cassandra:5.0.8
|
||||
profiles:
|
||||
- full
|
||||
environment:
|
||||
CASSANDRA_CLUSTER_NAME: fluxer-dev
|
||||
CASSANDRA_DC: datacenter1
|
||||
@@ -308,6 +309,8 @@ services:
|
||||
|
||||
elasticsearch:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:9.3.2
|
||||
profiles:
|
||||
- full
|
||||
environment:
|
||||
discovery.type: single-node
|
||||
xpack.security.enabled: "true"
|
||||
|
||||
Vendored
+5
-2
@@ -123,8 +123,11 @@ FLUXER_EMAIL_SMTP_SECURE=false
|
||||
FLUXER_SMS_ENABLED=false
|
||||
FLUXER_CAPTCHA_ENABLED=false
|
||||
FLUXER_CAPTCHA_PROVIDER=none
|
||||
FLUXER_SEARCH_ENGINE=elasticsearch
|
||||
FLUXER_SEARCH_URL=http://localhost:9200
|
||||
FLUXER_SEARCH_ENGINE=meilisearch
|
||||
FLUXER_SEARCH_URL=http://meilisearch:7700
|
||||
FLUXER_SEARCH_API_KEY=fluxer-dev-meilisearch
|
||||
FLUXER_SEARCH_USERNAME=
|
||||
FLUXER_SEARCH_PASSWORD=
|
||||
FLUXER_SEARCH_TLS_REJECT_UNAUTHORIZED=false
|
||||
FLUXER_STRIPE_ENABLED=false
|
||||
FLUXER_NCMEC_ENABLED=false
|
||||
|
||||
+3
-1
@@ -16,7 +16,9 @@
|
||||
"dev:desktop:smoke": "cargo run -p fluxer-dev -- desktop smoke-build",
|
||||
"dev:infra:down": "docker compose -f .devcontainer/docker-compose.yml down",
|
||||
"dev:infra:restart": "pnpm dev:infra:down && pnpm dev:infra:up",
|
||||
"dev:infra:up": "docker compose -f .devcontainer/docker-compose.yml up -d postgres cassandra valkey nats seaweedfs livekit elasticsearch meilisearch mailpit",
|
||||
"dev:infra:up": "pnpm dev:infra:up:lite",
|
||||
"dev:infra:up:full": "docker compose -f .devcontainer/docker-compose.yml up -d postgres cassandra valkey nats livekit elasticsearch meilisearch mailpit",
|
||||
"dev:infra:up:lite": "docker compose -f .devcontainer/docker-compose.yml up -d postgres valkey nats livekit meilisearch mailpit",
|
||||
"dev:media-proxy:seaweedfs": "cargo run -p fluxer-dev -- media-proxy seaweedfs-integration",
|
||||
"dev:native-voice-it": "cargo run -p fluxer-dev -- native-voice-it",
|
||||
"dev:services": "cargo run -p fluxer-dev -- rust-services",
|
||||
|
||||
+23
-3
@@ -461,9 +461,29 @@ async fn wait_for_search_backend_if_needed(selected: &[String]) -> Result<()> {
|
||||
{
|
||||
return Ok(());
|
||||
}
|
||||
let search_url =
|
||||
std::env::var("FLUXER_SEARCH_URL").unwrap_or_else(|_| "http://127.0.0.1:9200".to_owned());
|
||||
wait_http("Elasticsearch", &search_url, 120).await
|
||||
let env = merged_env(None, true)?;
|
||||
let search_url = env
|
||||
.get("FLUXER_SEARCH_URL")
|
||||
.cloned()
|
||||
.unwrap_or_else(|| default_search_url(&env));
|
||||
wait_http(search_backend_label(&env), &search_url, 120).await
|
||||
}
|
||||
|
||||
fn default_search_url(env: &BTreeMap<String, String>) -> String {
|
||||
if env
|
||||
.get("FLUXER_SEARCH_ENGINE")
|
||||
.is_some_and(|engine| engine == "meilisearch")
|
||||
{
|
||||
return "http://127.0.0.1:7700".to_owned();
|
||||
}
|
||||
"http://127.0.0.1:9200".to_owned()
|
||||
}
|
||||
|
||||
fn search_backend_label(env: &BTreeMap<String, String>) -> &'static str {
|
||||
match env.get("FLUXER_SEARCH_ENGINE").map(String::as_str) {
|
||||
Some("meilisearch") => "Meilisearch",
|
||||
_ => "Elasticsearch",
|
||||
}
|
||||
}
|
||||
|
||||
fn self_tool_command() -> Result<Vec<String>> {
|
||||
|
||||
Reference in New Issue
Block a user