Fix test.cljs
Turns out, the cljs version creates newlines at the end of a string. This was not considered in the test and thus resulted in failure.
This commit is contained in:
parent
df3e099fab
commit
b5614681d9
7 changed files with 17 additions and 28 deletions
|
@ -23,11 +23,11 @@
|
||||||
"url": "https://gitlab.com/domaindrivenarchitecture/c4k-website/issues"
|
"url": "https://gitlab.com/domaindrivenarchitecture/c4k-website/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"js-base64": "^3.6.1",
|
"js-base64": "^3.7.2",
|
||||||
"js-yaml": "^4.0.0"
|
"js-yaml": "^4.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"shadow-cljs": "^2.11.18",
|
"shadow-cljs": "^2.11.18",
|
||||||
"source-map-support": "^0.5.19"
|
"source-map-support": "^0.5.19"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,16 +15,3 @@
|
||||||
(website/generate-certificate config)
|
(website/generate-certificate config)
|
||||||
(website/generate-website-build-cron config)
|
(website/generate-website-build-cron config)
|
||||||
(website/generate-website-build-secret config)])))
|
(website/generate-website-build-secret config)])))
|
||||||
|
|
||||||
(not
|
|
||||||
(=
|
|
||||||
{:website.conf-c1
|
|
||||||
"server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.de;\n # security headers\n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header Content-Security-Policy \"default-src 'self'; font-src *;img-src * data:; script-src *; style-src *\";\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # maybe need to add:\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n # root /usr/share/nginx/html/; # testing purposes\n index index.html;\n location / { \n try_files $uri $uri/ /index.html =404; \n }\n}",
|
|
||||||
:website.conf-c2 "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.com;\n # security headers\n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header Content-Security-Policy \"default-src 'self'; font-src *;img-src * data:; script-src *; style-src *\";\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # maybe need to add:\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n # root /usr/share/nginx/html/; # testing purposes\n index index.html;\n location / { \n try_files $uri $uri/ /index.html =404; \n }\n}",
|
|
||||||
:name-c1 "test-de-configmap",
|
|
||||||
:name-c2 "test-com-configmap"}
|
|
||||||
{:website.conf-c1
|
|
||||||
"server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.de;\n # security headers\n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header Content-Security-Policy \"default-src 'self'; font-src *;img-src * data:; script-src *; style-src *\";\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # maybe need to add:\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n # root /usr/share/nginx/html/; # testing purposes\n index index.html;\n location / { \n try_files $uri $uri/ /index.html =404; \n }\n}\n",
|
|
||||||
:website.conf-c2 "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.com;\n # security headers\n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header Content-Security-Policy \"default-src 'self'; font-src *;img-src * data:; script-src *; style-src *\";\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # maybe need to add:\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n # root /usr/share/nginx/html/; # testing purposes\n index index.html;\n location / { \n try_files $uri $uri/ /index.html =404; \n }\n}\n",
|
|
||||||
:name-c1 "test-de-configmap",
|
|
||||||
:name-c2 "test-com-configmap"}))
|
|
||||||
|
|
|
@ -12,4 +12,5 @@ spec:
|
||||||
- FQDN
|
- FQDN
|
||||||
issuerRef:
|
issuerRef:
|
||||||
name: staging
|
name: staging
|
||||||
kind: ClusterIssuer
|
kind: ClusterIssuer
|
||||||
|
|
|
@ -82,20 +82,18 @@ data:
|
||||||
listen 443 ssl;
|
listen 443 ssl;
|
||||||
ssl_certificate /etc/certs/tls.crt;
|
ssl_certificate /etc/certs/tls.crt;
|
||||||
ssl_certificate_key /etc/certs/tls.key;
|
ssl_certificate_key /etc/certs/tls.key;
|
||||||
server_name FQDN
|
server_name FQDN
|
||||||
# security headers
|
|
||||||
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
|
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
|
||||||
add_header Content-Security-Policy "default-src 'self'; font-src *;img-src * data:; script-src *; style-src *";
|
add_header Content-Security-Policy "default-src 'self'; font-src *;img-src * data:; script-src *; style-src *";
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
add_header X-Frame-Options "SAMEORIGIN";
|
add_header X-Frame-Options "SAMEORIGIN";
|
||||||
add_header X-Content-Type-Options nosniff;
|
add_header X-Content-Type-Options nosniff;
|
||||||
add_header Referrer-Policy "strict-origin";
|
add_header Referrer-Policy "strict-origin";
|
||||||
# maybe need to add:
|
|
||||||
# add_header Permissions-Policy "permissions here";
|
# add_header Permissions-Policy "permissions here";
|
||||||
root /var/www/html/website/;
|
root /var/www/html/website/;
|
||||||
# root /usr/share/nginx/html/; # testing purposes
|
|
||||||
index index.html;
|
index index.html;
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html =404;
|
try_files $uri $uri/ /index.html =404;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ spec:
|
||||||
name: log
|
name: log
|
||||||
- mountPath: /var/www/html/website
|
- mountPath: /var/www/html/website
|
||||||
name: website-content-volume
|
name: website-content-volume
|
||||||
|
readOnly: true
|
||||||
- mountPath: /etc/certs
|
- mountPath: /etc/certs
|
||||||
name: website-cert
|
name: website-cert
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
@ -52,4 +53,5 @@ spec:
|
||||||
- key: tls.crt
|
- key: tls.crt
|
||||||
path: tls.crt
|
path: tls.crt
|
||||||
- key: tls.key
|
- key: tls.key
|
||||||
path: tls.key
|
path: tls.key
|
||||||
|
|
|
@ -30,4 +30,5 @@ spec:
|
||||||
- name: content-volume
|
- name: content-volume
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: NAME-content-volume
|
claimName: NAME-content-volume
|
||||||
restartPolicy: OnFailure
|
restartPolicy: OnFailure
|
||||||
|
|
|
@ -36,8 +36,8 @@
|
||||||
(cut/generate-ingress {:fqdn "test.de"}))))
|
(cut/generate-ingress {:fqdn "test.de"}))))
|
||||||
|
|
||||||
(deftest should-generate-nginx-configmap
|
(deftest should-generate-nginx-configmap
|
||||||
(is (= {:website.conf-c1 "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.de;\n # security headers\n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header Content-Security-Policy \"default-src 'self'; font-src *;img-src * data:; script-src *; style-src *\";\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # maybe need to add:\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n # root /usr/share/nginx/html/; # testing purposes\n index index.html;\n location / { \n try_files $uri $uri/ /index.html =404; \n }\n}",
|
(is (= {:website.conf-c1 "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.de; \n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header Content-Security-Policy \"default-src 'self'; font-src *;img-src * data:; script-src *; style-src *\";\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n index index.html;\n location / {\n try_files $uri $uri/ /index.html =404;\n }\n}\n",
|
||||||
:website.conf-c2 "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.com;\n # security headers\n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header Content-Security-Policy \"default-src 'self'; font-src *;img-src * data:; script-src *; style-src *\";\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # maybe need to add:\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n # root /usr/share/nginx/html/; # testing purposes\n index index.html;\n location / { \n try_files $uri $uri/ /index.html =404; \n }\n}",
|
:website.conf-c2 "server {\n listen 80 default_server;\n listen [::]:80 default_server;\n listen 443 ssl;\n ssl_certificate /etc/certs/tls.crt;\n ssl_certificate_key /etc/certs/tls.key;\n server_name test.com; \n add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';\n add_header Content-Security-Policy \"default-src 'self'; font-src *;img-src * data:; script-src *; style-src *\";\n add_header X-XSS-Protection \"1; mode=block\";\n add_header X-Frame-Options \"SAMEORIGIN\";\n add_header X-Content-Type-Options nosniff;\n add_header Referrer-Policy \"strict-origin\";\n # add_header Permissions-Policy \"permissions here\";\n root /var/www/html/website/;\n index index.html;\n location / {\n try_files $uri $uri/ /index.html =404;\n }\n}\n",
|
||||||
:name-c1 "test-de-configmap",
|
:name-c1 "test-de-configmap",
|
||||||
:name-c2 "test-com-configmap"}
|
:name-c2 "test-com-configmap"}
|
||||||
(th/map-diff (cut/generate-nginx-configmap {:fqdn "test.de"})
|
(th/map-diff (cut/generate-nginx-configmap {:fqdn "test.de"})
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
:volumeMounts
|
:volumeMounts
|
||||||
[{:mountPath "/etc/nginx", :readOnly true, :name "nginx-config-volume"}
|
[{:mountPath "/etc/nginx", :readOnly true, :name "nginx-config-volume"}
|
||||||
{:mountPath "/var/log/nginx", :name "log"}
|
{:mountPath "/var/log/nginx", :name "log"}
|
||||||
{:mountPath "/var/www/html/website", :name "website-content-volume"}
|
{:mountPath "/var/www/html/website", :name "website-content-volume", :readOnly true}
|
||||||
{:mountPath "/etc/certs", :name "website-cert", :readOnly true}]}],
|
{:mountPath "/etc/certs", :name "website-cert", :readOnly true}]}],
|
||||||
:volumes
|
:volumes
|
||||||
[{:name "nginx-config-volume",
|
[{:name "nginx-config-volume",
|
||||||
|
|
Loading…
Reference in a new issue