Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update allowed origins list and nginx config #4730

Merged
merged 4 commits into from
Jun 27, 2024
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
2 changes: 1 addition & 1 deletion chaoscenter/authentication/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Config struct {
DbServer string `required:"true" split_words:"true"`
DbUser string `required:"true" split_words:"true"`
DbPassword string `required:"true" split_words:"true"`
AllowedOrigins []string `split_words:"true" default:"litmuschaos.io?,localhost:([0-9]+)?"`
AllowedOrigins []string `split_words:"true" default:"^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)localhost(:[0-9]+|)"`
}

var config Config
Expand Down
2 changes: 1 addition & 1 deletion chaoscenter/graphql/server/utils/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type Configuration struct {
CustomChaosHubPath string `split_words:"true" default:"/tmp/"`
DefaultChaosHubPath string `split_words:"true" default:"/tmp/default/"`
EnableGQLIntrospection string `split_words:"true" default:"false"`
AllowedOrigins []string `split_words:"true" default:"litmuschaos.io?,localhost:([0-9]+)?"`
AllowedOrigins []string `split_words:"true" default:"^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)localhost(:[0-9]+|)"`
}

var Config Configuration
13 changes: 4 additions & 9 deletions chaoscenter/manifests/litmus-cluster-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,6 @@ data:
}

location /api/ {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass "http://litmusportal-server-service:9002/";
}

location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand Down Expand Up @@ -313,6 +304,8 @@ spec:
value: "5000000"
- name: INFRA_COMPATIBLE_VERSIONS
value: '["ci"]'
- name: ALLOWED_ORIGINS
value: ^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-server-service(:[0-9]+|)?
ports:
- containerPort: 8080
- containerPort: 8000
Expand Down Expand Up @@ -387,6 +380,8 @@ spec:
value: "litmusportal-server-service"
- name: LITMUS_GQL_GRPC_PORT
value: ":8000"
- name: ALLOWED_ORIGINS
value: ^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-auth-server-service(:[0-9]+|)?
resources:
requests:
memory: "250Mi"
Expand Down
15 changes: 5 additions & 10 deletions chaoscenter/manifests/litmus-namespaced-scope.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,6 @@ data:
}

location /api/ {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass "http://litmusportal-server-service:9002/";
}

location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand Down Expand Up @@ -288,7 +279,9 @@ spec:
- name: INGRESS_NAME
value: "litmus-ingress"
- name: INFRA_COMPATIBLE_VERSIONS
value: '["ci"]'
value: '["ci"]'
- name: ALLOWED_ORIGINS
value: ^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-server-service(:[0-9]+|)?
ports:
- containerPort: 8080
- containerPort: 8000
Expand Down Expand Up @@ -361,6 +354,8 @@ spec:
value: "litmusportal-server-service"
- name: LITMUS_GQL_GRPC_PORT
value: ":8000"
- name: ALLOWED_ORIGINS
value: ^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-auth-server-service(:[0-9]+|)?
ports:
- containerPort: 3000
- containerPort: 3030
Expand Down
13 changes: 4 additions & 9 deletions chaoscenter/manifests/litmus-without-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,6 @@ data:
}

location /api/ {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass "http://litmusportal-server-service:9002/";
}

location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand Down Expand Up @@ -301,6 +292,8 @@ spec:
value: "5000000"
- name: INFRA_COMPATIBLE_VERSIONS
value: '["ci"]'
- name: ALLOWED_ORIGINS
value: ^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-server-service(:[0-9]+|)?
ports:
- containerPort: 8080
- containerPort: 8000
Expand Down Expand Up @@ -366,6 +359,8 @@ spec:
value: "litmusportal-server-service"
- name: LITMUS_GQL_GRPC_PORT
value: ":8000"
- name: ALLOWED_ORIGINS
value: ^(http://|https://|)litmuschaos.io(:[0-9]+|)?,^(http://|https://|)litmusportal-auth-server-service(:[0-9]+|)?
ports:
- containerPort: 3000
- containerPort: 3030
Expand Down
9 changes: 0 additions & 9 deletions chaoscenter/web/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ http {
}

location /api/ {
Jonsy13 marked this conversation as resolved.
Show resolved Hide resolved
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass "http://litmusportal-server-service:9002/";
}

location /ws/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
Expand Down
Loading