Skip to content

Commit fdf6a33

Browse files
authored
Merge pull request #17 from echohello-dev/feature/plausible-fix-csp
chore: Update security settings and environment variables
2 parents 63839d5 + 1971d91 commit fdf6a33

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
GITHUB_TOKEN=
33

44
# Backstage
5+
APP_BASE_URL=http://backstage.localhost
56
PLAUSIBLE_DATA_DOMAIN=backstage.localhost
67
PLAUSIBLE_SOURCE_URL=http://plausible.localhost/js/script.js
78

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ exec:
5050

5151
plausible-up: init
5252
@echo "Plausible is running at http://localhost:8000 or http://plausible.localhost"
53+
@echo "Backstage is running at http://localhost:7007 or http://backstage.localhost"
54+
@echo "Traefik is running at http://localhost:8080 or http://traefik.localhost"
5355
docker compose -f compose.yaml -f compose.plausible.yaml up -d
5456

5557
plausible-down:

app-config.production.yaml

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
app:
2-
# Should be the same as backend.baseUrl when using the `app-backend` plugin.
3-
baseUrl: http://localhost:7007
2+
baseUrl: ${APP_BASE_URL}
43

54
backend:
6-
# Note that the baseUrl should be the URL that the browser and other clients
7-
# should use when communicating with the backend, i.e. it needs to be
8-
# reachable not just from within the backend host, but from all of your
9-
# callers. When its value is "http://localhost:7007", it's strictly private
10-
# and can't be reached by others.
11-
baseUrl: http://localhost:7007
12-
# The listener can also be expressed as a single <host>:<port> string. In this case we bind to
13-
# all interfaces, the most permissive setting. The right value depends on your specific deployment.
5+
baseUrl: ${APP_BASE_URL}
146
listen: ':7007'
157

8+
csp:
9+
connect-src: ["'self'", 'http:', 'https:']
10+
script-src:
11+
["'self'", 'http:', 'https:', "'unsafe-eval'", '${APP_BASE_URL}']
12+
img-src: ["'self'", 'http:', 'https:', 'data:']
13+
14+
cors:
15+
origin: ${APP_BASE_URL}
16+
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
17+
credentials: true
18+
1619
auth:
1720
providers:
1821
guest:

app-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ backend:
1919
# host: 127.0.0.1
2020
csp:
2121
connect-src: ["'self'", 'http:', 'https:']
22-
script-src: ["'self'", 'http:', 'https:']
22+
script-src: ["'self'", 'http:', 'https:', "'unsafe-eval'"]
2323
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
2424
# Default Helmet Content-Security-Policy values can be removed by setting the key to false
2525
cors:

0 commit comments

Comments
 (0)