Skip to content
Open
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
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ The following variables as mandatory

Set the value for the following variables - `MONGO_URI`, `MONGO_DBNAME`, `REDIS_HOST`, `REDIS_PORT`

3. Configure `widget/nginx-variables.conf`.

`set $FRAME_ANCESTORS "http:"`, to allow unencrypted iframing of the widget in your development environment.

## Installing dependencies and running app

From the root folder run the following commands
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ docker-compose down
sudo docker-compose up --build --force-recreate
```

3. Configure `widget/nginx-variables.conf`.

`set $FRAME_ANCESTORS "https://your.domain"`, to allow iframing of the widget on `your.domain`.

### 🛃 Manual

WebWhiz is designed to be used as a production grade Chatbot that can be scaled up or down to handle any volume of data.
Expand Down Expand Up @@ -153,6 +157,10 @@ The following variables as mandatory

Set the value for the following variables - `MONGO_URI`, `MONGO_DBNAME`, `REDIS_HOST`, `REDIS_PORT`

3. Configure `widget/nginx-variables.conf`.

`set $FRAME_ANCESTORS "https://your.domain"`, to allow iframing of the widget on `your.domain`.

#### Installing dependencies and running app

From the root folder run the following commands
Expand Down
2 changes: 2 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ upstream web {
server {
listen 80;

add_header Content-Security-Policy "frame-ancestors 'none'" always;

location ~ ^/api(/?)(.*) {
proxy_pass http://web/$2$is_args$args;
}
Expand Down
1 change: 1 addition & 0 deletions widget/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ COPY --from=builder_widget /app/dist /usr/share/nginx/html

# Copying our nginx.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginx-variables.conf /etc/nginx/nginx-variables.conf

# Expose port
EXPOSE 80
Expand Down
1 change: 1 addition & 0 deletions widget/nginx-variables.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set $FRAME_ANCESTORS "'none'"; # Space delimited urls allowed to iframe the widget. If set to https: (without single quotes) all https sites are allowed
5 changes: 5 additions & 0 deletions widget/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
server {
include /etc/nginx/nginx-variables.conf;

listen 80;

set $FRAME_ANCESTORS "frame-ancestors ${FRAME_ANCESTORS}";
add_header Content-Security-Policy "${FRAME_ANCESTORS}" always;

location / {
root /usr/share/nginx/html/;
include /etc/nginx/mime.types;
Expand Down