Skip to content

Commit

Permalink
Fix port range to_string (#1915)
Browse files Browse the repository at this point in the history
Fixes port range to string by explicitly calling the `cast` function.

Fixes #1867
  • Loading branch information
jamilbk committed Aug 16, 2023
1 parent f334e5e commit 5c92e32
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docker Build
on:
push:
branches:
- master
- legacy
- 'build/**'

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/omnibus_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ jobs:
sudo rm -rf /tmp/firezone*
rm -rf omnibus/pkg/*
# Publish packages to the drafted release on merges to master so we can
# Publish packages to the drafted release on merges to legacy so we can
# manually test them if needed. Then we can just publish the drafted release
# and we're good to go.
publish:
if: startsWith(github.ref, 'refs/heads/master')
if: startsWith(github.ref, 'refs/heads/legacy')
needs:
- build-package-test
- draft-release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
push:
branches:
- master
- legacy

jobs:
static-analysis:
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
push:
branches:
- master
- legacy

jobs:
unit-test:
Expand Down Expand Up @@ -216,12 +216,12 @@ jobs:
run: mix deps.get --only $MIX_ENV
- name: Compile
run: mix compile
- name: Download master branch DB dump
- name: Download legacy branch DB dump
id: download-artifact
uses: dawidd6/action-download-artifact@v2
if: "!contains(github.ref, 'master')"
if: "!contains(github.ref, 'legacy')"
with:
branch: master
branch: legacy
name: db-dump
path: apps/fz_http/priv/repo/
search_artifacts: true
Expand All @@ -231,7 +231,7 @@ jobs:
run: |
mix ecto.create
- name: Restore DB dump
if: "!contains(github.ref, 'master')"
if: "!contains(github.ref, 'legacy')"
env:
PGPASSWORD: postgres
run: |
Expand All @@ -240,7 +240,7 @@ jobs:
run: |
mix ecto.migrate
- name: Dump DB
if: "contains(github.ref, 'master')"
if: "contains(github.ref, 'legacy')"
env:
PGPASSWORD: postgres
run: |
Expand All @@ -249,8 +249,8 @@ jobs:
--file apps/fz_http/priv/repo/structure.sql \
--no-acl \
--no-owner
- name: Upload master branch DB dump
if: "contains(github.ref, 'master')"
- name: Upload legacy branch DB dump
if: "contains(github.ref, 'legacy')"
uses: actions/upload-artifact@v3
with:
name: db-dump
Expand Down Expand Up @@ -303,7 +303,7 @@ jobs:
- 8400:8080/tcp
- 8443:8443/tcp
steps:
- uses: nanasess/setup-chromedriver@v1
- uses: nanasess/setup-chromedriver@v2
- run: |
export DISPLAY=:99
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
Expand Down
2 changes: 1 addition & 1 deletion apps/fz_wall/lib/fz_wall/cli/live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ defmodule FzWall.CLI.Live do
get_filter_set_name(rule.user_id, ip_type, rule.action, layer4),
rule.destination,
port_type,
rule.port_range
FzHttp.Types.Int4Range.cast(rule.port_range)
)
end
end
6 changes: 3 additions & 3 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
networks:
firezone-network:
ipv4_address: 172.25.0.100
ipv6_address: 2001:3990:3990::99
ipv6_address: fcff:3990:3990::99

deploy:
<<: *default-deploy
Expand Down Expand Up @@ -96,5 +96,5 @@ networks:
ipam:
config:
- subnet: 172.25.0.0/16
- subnet: 2001:3990:3990::/64
gateway: 2001:3990:3990::1
- subnet: fcff:3990:3990::/64
gateway: fcff:3990:3990::1
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
networks:
app:
ipv4_address: 172.28.0.99
ipv6_address: 2001:3990:3990::99
ipv6_address: fcff:3990:3990::99

firezone:
build:
Expand Down Expand Up @@ -149,5 +149,5 @@ networks:
ipam:
config:
- subnet: 172.28.0.0/16
- subnet: 2001:3990:3990::/64
- subnet: fcff:3990:3990::/64
isolation:
2 changes: 1 addition & 1 deletion scripts/post-down-wg.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
FIREZONE_DEV_V4='172.28.0.0/16'
FIREZONE_DEV_V6='2001:3990:3990::/64'
FIREZONE_DEV_V6='fcff:3990:3990::/64'
TABLE=333444

sudo ip -4 rule del from $FIREZONE_DEV_V4 table $TABLE
Expand Down
2 changes: 1 addition & 1 deletion scripts/post-up-wg.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
FIREZONE_DEV_V4='172.28.0.0/16'
FIREZONE_DEV_V6='2001:3990:3990::/64'
FIREZONE_DEV_V6='fcff:3990:3990::/64'
TABLE=333444
DEFAULT_ROUTE_V4=$(sudo ip -4 route | grep ^default)
DOCKER_ROUTE_V4=$(sudo ip -4 route | grep ^$FIREZONE_DEV_V4)
Expand Down

0 comments on commit 5c92e32

Please sign in to comment.