Skip to content
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
3 changes: 2 additions & 1 deletion .docker/scripts/proxy/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ connect_proxy_to_project_network() {
return 0
fi

Docker network connect "$network" "$proxy_container"
public_host="${NEXTCLOUD_HOST:-${PROJECT_NAME:-}.localhost}"
Docker network connect --alias "$public_host" "$network" "$proxy_container"
}

disconnect_proxy_from_project_network() {
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ services:
command: sleep infinity
depends_on:
- nextcloud
extra_hosts:
- "${NEXTCLOUD_HOST:-${COMPOSE_PROJECT_NAME}.localhost}:host-gateway"
restart: unless-stopped
networks:
- default
Expand Down
5 changes: 3 additions & 2 deletions tests/proxy/services.bats
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ setup() {
source "$REPO_ROOT/.docker/scripts/proxy/services.sh"

PROJECT_NAME=current
NEXTCLOUD_HOST=current.localhost
}

@test "proxy is connected to the current Compose project network" {
@test "proxy is connected to the current Compose project network with the public hostname alias" {
compatible_proxy_container() { printf '%s\n' librecode-dev-proxy; }
container_networks() { printf '{}\n'; }
Docker() {
Expand All @@ -22,7 +23,7 @@ setup() {

connect_proxy_to_project_network

grep -q '^docker network connect current_default librecode-dev-proxy$' "$TEST_LOG"
grep -q '^docker network connect --alias current.localhost current_default librecode-dev-proxy$' "$TEST_LOG"
}

@test "proxy is not connected twice to the project network" {
Expand Down
8 changes: 0 additions & 8 deletions tests/worker/contract.bats
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,3 @@ setup() {
}



@test "Playwright resolves the public Nextcloud hostname through the Docker host" {
run env DB_TYPE=sqlite COMPOSE_PROFILES=playwright sh "$WORKER" playwright-route config
[ "$status" -eq 0 ]
[[ "$output" == *"PLAYWRIGHT_BASE_URL: https://ncdev-playwright-route.localhost"* ]]
[[ "$output" == *"ncdev-playwright-route.localhost"* ]]
[[ "$output" == *"host-gateway"* ]]
}
Loading