Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
4637eb5
Add postcss to the frontend setup
bikkelhart-menno Feb 20, 2025
3d0485e
change tomato to white as git test
Khdulkadir Feb 21, 2025
47f4047
Build CSS with postcss
aequitas Feb 21, 2025
f4573b2
Feature/header (#9)
Khdulkadir Mar 14, 2025
9cb6a0e
Feature/footer (#10)
Khdulkadir Mar 14, 2025
f98a748
Feature/test site pagina (#18)
Khdulkadir Mar 14, 2025
74d14e6
Feature/Big Refactor (#23)
Khdulkadir Mar 14, 2025
1515d85
Feature/domein email verbinding test sectie (#11)
Khdulkadir Mar 14, 2025
0ddc96b
Add example report fixtures for frontend development
aequitas Mar 14, 2025
d941a4e
Fix serialization for ListField
aequitas Mar 14, 2025
e8b021d
feature: nieuwe contact pagina (niet gelukt)
Khdulkadir Mar 21, 2025
5941ed0
feature: nieuwe contact pagina (niet gelukt)
Khdulkadir Mar 21, 2025
ff66b48
Feature/full test homepage (#32)
Khdulkadir Mar 31, 2025
d1268bd
Feature/kennisbank pagina 2 (#33)
Khdulkadir Mar 31, 2025
0288750
Feature/nieuws pagina (#34)
Khdulkadir Mar 31, 2025
953d79c
Feature/over ons pagina (#35)
Khdulkadir Mar 31, 2025
08df85b
feature hall of fame page and small fixes
Khdulkadir Mar 31, 2025
5303822
update header inline svgs changed to css mask-image
Khdulkadir Mar 31, 2025
4f3cd92
update footer inline svg to mask-image
Khdulkadir Mar 31, 2025
64cf16b
update homepage inline svg replaced with css mask image
Khdulkadir Mar 31, 2025
ab25ae7
update test pages inline svg to css mask image
Khdulkadir Mar 31, 2025
cada56b
update other pages inline svg to css mask image
Khdulkadir Mar 31, 2025
b37bf1e
feature hall of fame page
Khdulkadir Apr 1, 2025
d326912
fix more semantic variable names
Khdulkadir Apr 1, 2025
439a61d
update refactor dark light variables
Khdulkadir Apr 1, 2025
6654c4e
update refactored html classes and changed ellipses from divs to after
Khdulkadir Apr 3, 2025
8b8dba6
update refactored global headings and body text classes
Khdulkadir Apr 3, 2025
9d704e9
update added article load more button and more refactoring
Khdulkadir Apr 3, 2025
d94bcea
update refactor test card html
Khdulkadir Apr 4, 2025
34cc298
update animated load more function
Khdulkadir Apr 4, 2025
1b49bf1
update added visually hidden elements
Khdulkadir Apr 4, 2025
f942af0
feature article detail page and contact page added
Khdulkadir Apr 4, 2025
c84e193
update moved some code to other files
Khdulkadir Apr 4, 2025
c69730b
update added regions tags and moved some code
Khdulkadir Apr 4, 2025
8d0afbf
update: small fixes
Khdulkadir Apr 4, 2025
f247783
update small fixes
Khdulkadir Apr 4, 2025
c4c7378
update added new select with flag icon
Khdulkadir Apr 7, 2025
0685c4f
update hover states to cards with links and secondary button
Khdulkadir Apr 7, 2025
c330fc1
feature added loading page
Khdulkadir Apr 7, 2025
ab7d70d
feature: partially made result page
Khdulkadir Apr 8, 2025
64a2736
feature: added version number in footer
Khdulkadir Apr 8, 2025
b472c92
style: align changes version number
Khdulkadir Apr 8, 2025
bd41e6e
feature: added success state to loading page
Khdulkadir Apr 8, 2025
0301f37
fix: succes state loading page
Khdulkadir Apr 8, 2025
154bd53
feature: added meter element to result page
Khdulkadir Apr 8, 2025
9d613ce
refactor renamed faq section to contact section and animated loading …
Khdulkadir Apr 14, 2025
9c112f6
feature: animated action card result page
Khdulkadir Apr 14, 2025
509bbfb
feature: result details
Khdulkadir Apr 14, 2025
7cb7570
Fix linting
aequitas Apr 15, 2025
23f4e4c
Fix CSS filename
aequitas Apr 15, 2025
d816eca
Fix progress page
aequitas Apr 15, 2025
366f175
Fix some tests after design changes
aequitas Apr 15, 2025
6a31a73
Fix develop test target
aequitas Apr 15, 2025
f4639a2
Update to bikkelhart/internet-nl@06d43e7c
bwbroersma May 11, 2025
7853ab6
Merge branch 'main' into bikkelhart-redesign-dev3
bwbroersma May 16, 2025
2907484
Fix contact page
aequitas May 20, 2025
ddb17a9
Include postcss/autoreload dependencies in default image target, as u…
aequitas May 20, 2025
f36e543
Merge main
bwbroersma May 29, 2025
41bfd72
Update to bikkelhart/internet-nl@9e3cdd9a
bwbroersma Jun 2, 2025
18554e0
Merge main.
bwbroersma Jun 5, 2025
fe11a50
Update to bikkelhart/internet-nl@7764e493
bwbroersma Jun 5, 2025
db3be51
Merge main & update to bikkelhart/internet-nl@87f11734
bwbroersma Jun 6, 2025
4fcee28
Merge main & update to bikkelhart/internet-nl@7cb9a8d5
bwbroersma Jun 13, 2025
92432d1
Merge main & update to bikkelhart/internet-nl@1cbb2122
bwbroersma Jul 10, 2025
dcd49bc
Merge main & update to bikkelhart/internet-nl@42214526
bwbroersma Jul 18, 2025
1ca7826
Reapply rate limiting fix after merge
aequitas Jul 18, 2025
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ __pycache__
*.log
*.pid
/tests/.pytest_cache/
/node_modules

# Pycharm defaults
.idea
Expand Down Expand Up @@ -79,3 +80,7 @@ docker/local.env

# config dumps from make docker-compose-config-to-file
config-compose-*

# Frontend
frontend/node_modules
frontend/dist
112 changes: 0 additions & 112 deletions bin/frontend.py

This file was deleted.

5,197 changes: 5,197 additions & 0 deletions checks/fixtures/example_reports.json

Large diffs are not rendered by default.

18 changes: 5 additions & 13 deletions checks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ class ListField(models.TextField):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def from_db_value(self, value, expression, connection, context="Null"):
if value is None:
return value
try:
return ast.literal_eval(value)
except SyntaxError:
raise SyntaxError(
f"Syntax error while attempting to parse value as python, in ListField,"
f" possibly raw value has been stored instead of valid python code: {value}"
)

def to_python(self, value):
if not value:
value = []
Expand All @@ -42,8 +31,11 @@ def get_prep_value(self, value):
return str(value)

def value_to_string(self, obj):
value = self._get_val_from_obj(obj)
return self.get_db_prep_value(value)
value = self.value_from_object(obj)
return self.get_prep_value(value)

def from_db_value(self, value, expression, connection):
return self.to_python(value)


class AutoConfOption(Enum):
Expand Down
31 changes: 29 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ USER unbound

ENTRYPOINT ["/entrypoint.sh"]

# build frontend image target
FROM --platform=linux/amd64 debian:bullseye-20241111-slim AS frontend

# install npm from official image
COPY --from=node:22-slim /usr/local/bin/ /usr/local/bin/
COPY --from=node:22-slim /usr/local/lib/node_modules /usr/local/lib/node_modules

ADD frontend/ /app/frontend
WORKDIR /app/frontend
RUN npm install
RUN npm run docker:build

# build main application image target
FROM --platform=linux/amd64 debian:bullseye-20241111-slim AS build-app
ARG PYTHON_VERSION
Expand Down Expand Up @@ -205,8 +217,10 @@ RUN install -d -m 0755 -o nobody -g nogroup /app/batch_results
# some js/css files use a separate script to generate minimized versions
# storage these in a place for django to find
RUN mkdir -p /app/static_frontend
RUN python3 bin/frontend.py js
RUN python3 bin/frontend.py css
# copy build/minimized CSS files from frontend stage
COPY --from=frontend --chown=nobody:nogroup /app/static_frontend/css/*.css /app/static_frontend/css/
# copy build/minimized JS files from frontend stage
COPY --from=frontend --chown=nobody:nogroup /app/static_frontend/js/ /app/static_frontend/js/

# generate language files
RUN python3 bin/pofiles.py to_django
Expand All @@ -228,6 +242,19 @@ ENV SETUPTOOLS_SCM_PRETEND_VERSION=$RELEASE
ENTRYPOINT [ "python3", "./manage.py"]
CMD ["runserver", "0.0.0.0:8080"]

# app image with development tools for better live reloading
FROM app AS app-dev

# required for compose `develop` mode file sync/copy
USER root

# copy dependencies to rebuild CSS (postcss)
COPY --from=frontend /usr/local/bin/ /usr/local/bin/
COPY --from=frontend /usr/local/lib/node_modules /usr/local/lib/node_modules

# copy browser reload module
COPY --from=linttest-deps /usr/local/lib/python${PYTHON_VERSION}/dist-packages/django_browser_reload /usr/local/lib/python${PYTHON_VERSION}/dist-packages/django_browser_reload

# supplement application with unittest, lint dependencies
FROM build-app AS linttest
ARG PYTHON_VERSION
Expand Down
29 changes: 11 additions & 18 deletions docker/compose.development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,23 @@ services:
environment:
- INTERNETNL_DOMAINNAME

webserver:
build:
context: ..
dockerfile: docker/webserver.Dockerfile
develop:
watch:
# auto rebuild/reload when config files change
- path: ./webserver/
action: rebuild

app:
develop:
watch:
# auto rebuild/reload when CSS/JS changes
- path: ../frontend/
action: sync+exec
target: /app/frontend
exec:
command: /bin/sh -c "python3 bin/frontend.py js;python3 bin/frontend.py css;"
build:
target: app-dev
# use Django runserver for better debug abilities during development
entrypoint: ["/bin/bash"]
# run CSS auto rebuild in the background and start devserver
command:
- "-c"
- >
if [ "$INTERNETNL_AUTORELOAD" = "True" ]; then
# install npm dependencies and watch CSS and JS files for rebuild
cd /app/frontend;
# It's needed to install the rollup linux dependency
npm install;
npm run docker:watch &
cd /app;
# start development server with auto reloading
./manage.py runserver 0.0.0.0:8080
else
./manage.py runserver 0.0.0.0:8080 --noreload
Expand All @@ -55,6 +46,8 @@ services:
- ../checks:/app/checks
- ../interface:/app/interface
- ../internetnl:/app/internetnl
# mount frontend files so build tools can detect changes and rebuild
- ../frontend/src:/app/frontend/src

worker:
volumes:
Expand Down
2 changes: 2 additions & 0 deletions docker/webserver.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ RUN mkdir -p /var/www/internet.nl/.well-known/
# copy all security*.txt files
COPY .well-known/security*.txt /var/www/internet.nl/.well-known/
COPY interface/static/favicon.ico /var/www/internet.nl/
COPY interface/static/favicon.svg /var/www/internet.nl/
COPY interface/static/favicon.png /var/www/internet.nl/

COPY docker/webserver/nginx_templates/* /etc/nginx/templates/
COPY docker/webserver/mime.types /etc/nginx/
Expand Down
6 changes: 6 additions & 0 deletions docker/webserver/nginx_templates/app.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ server {
location = /favicon.ico {
alias /var/www/internet.nl/favicon.ico;
}
location = /favicon.svg {
alias /var/www/internet.nl/favicon.svg;
}
location = /favicon.png {
alias /var/www/internet.nl/favicon.png;
}

# static files served from app
location /static {
Expand Down
28 changes: 28 additions & 0 deletions documentation/Docker-development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,31 @@ There are various cron jobs configured during normal deployments that perform ta
## Routinator

For the development environment the Routinator service/container is not started but instead an external routinator service is used. This reduces resource usage and wait time.

## Testdata/fixtures

For frontend development purposes a set of testresults can be loaded into the database to so these don't have to be generated manually.

To load this testdata run:

docker exec -ti internetnl-develop-app-1 ./manage.py loaddata example_reports

The following urls can be used to view the testresults:

http://localhost:8080/site/internet.nl/9000/
http://localhost:8080/site/example.nl/9001/
http://localhost:8080/site/ipv6.internet.nl/9002/
http://localhost:8080/site/forfun.net/9003/
http://localhost:8080/site/ipv6.google.com/9004/
http://localhost:8080/site/brokendnssec.net/9005/
http://localhost:8080/site/ok.bogussig.ok.bad-dnssec.wb.sidnlabs.nl/9006/
http://localhost:8080/site/badhash.dane.huque.com/9007/
http://localhost:8080/site/expired.badssl.com/9008/
http://localhost:8080/site/wrong.host.badssl.com/9009/
http://localhost:8080/site/self-signed.badssl.com/9010/
http://localhost:8080/site/untrusted-root.badssl.com/9011/
http://localhost:8080/site/revoked.badssl.com/9012/
http://localhost:8080/site/pinning-test.badssl.com/9013/
http://localhost:8080/site/invalid.rpki.isbgpsafeyet.com/9014/

There are several scenarios with different failures in the testresults.
Loading
Loading