diff --git a/.github/redirects/check_redirects.py b/.github/redirects/check_redirects.py new file mode 100644 index 0000000..f7d995b --- /dev/null +++ b/.github/redirects/check_redirects.py @@ -0,0 +1,30 @@ +import json +import sys +from http import HTTPStatus +from pathlib import Path + +import requests + + +def check_redirect(url: str) -> bool: + url = f'http://localhost{url}' + print(f'checking URL: {url}') + response = requests.get(url) + + if response.status_code != HTTPStatus.OK: + print(f'ERROR: URL {url} returned: {response.status_code}') + return False + + return True + + +with Path('.github/redirects/urls.json').open() as fd: + urls = json.load(fd) + +result = True + +for url in urls: + result &= check_redirect(url) + +if not result: + sys.exit(1) diff --git a/.github/redirects/urls.json b/.github/redirects/urls.json new file mode 100644 index 0000000..abec50c --- /dev/null +++ b/.github/redirects/urls.json @@ -0,0 +1,84 @@ +[ + "/2021/05/28/django-django_tables2-and-bootstrap-table/", + "/2021/05/17/covid-19-montreal-dashboard/", + "/wp-content/uploads/2021/05/dashboard_before.jpg", + "/wp-content/uploads/2021/05/dashboard_relaunch.jpg", + "/2021/05/12/sepaq-availability-scraper/", + "/2021/05/12/setting-up-msmtp/", + "/2021/03/18/set-up-debian/", + "/2020/01/16/notes-on-traefik-v2-nextcloud-etc/", + "/2020/01/14/migrating-data-to-nextcloud/", + "/2020/01/08/notes-on-docker/", + "/2020/01/06/notes-on-setting-up-my-raspberry-pi/", + "/2019/12/12/making-emf-models-serialized-in-xmi-available-in-json-with-emfjson/", + "/2019/12/11/migrate-legacy-thunderbird-add-on-to-mailextension-for-thunderbird-68/", + "/2019/11/14/how-to-drag-music-and-videos-onto-iphone-ipad-using-itunes/", + "/2018/09/12/deploying-angular-application-on-apache-server/", + "/2018/07/25/digging-into-the-firefox-ui-for-the-tab-close-button/", + "/2017/12/08/airdrop-on-macos-working-unreliably/", + "/2016/01/04/ios-how-to-fix-or-change-voicemail-number/", + "/2016/01/04/firefox-close-tab-button-on-hover/", + "/2015/11/10/thunderbird-extension-hide-badge-icon/", + "/2015/11/10/thunderbird-extension-toggle-headers-updated/", + "/2015/08/19/mt4j-with-processing-2/", + "/2015/08/18/how-to-use-ocl-when-running-emf-standalone-with-eclipse-mars/", + "/2015/08/18/move-more-than-one-directory-into-a-new-repository/", + "/2015/06/19/move-directory-from-one-repository-to-another-preserving-history/", + "/2013/05/25/show-old-title-bar-in-thunderbird/", + "/wp-content/uploads/2013/05/thunderbird_17_titlebar.jpg", + "/wp-content/uploads/2013/05/thunderbird_17_titlebar_after.jpg", + "/2013/05/02/modifying-the-new-child-sub-menu-items-in-emf/", + "/2013/04/25/reducing-file-size-of-a-pdf-on-mac-os/", + "/2012/05/31/how-to-use-ocl-when-running-emf-standalone/", + "/2012/05/29/lyx-installing-unknown-document-classes/", + "/2012/05/19/postgresql-accepts-any-or-no-password-when-connecting/", + "/2012/05/10/using-multiple-svn-clients-with-the-svnssh-protocol-and-a-putty-profile/", + "/2012/02/07/thunderbird-extension-toggle-headers/", + "/2012/02/07/hide-star-besides-email-addresses-in-thunderbird/", + "/2011/04/14/things-discovered-in-struts-2/", + "/2011/03/30/mac-os-airport-not-connecting-automatically-to-wi-fi/", + "/2011/03/30/office-end-user-license-agreement-eula-has-to-be-accepted-every-time/", + "/2011/03/30/hide-the-network-icon-from-windows-7-explorer/", + "/2011/03/21/setting-up-apache-and-subversion-on-debian-wheezy/", + "/privacy-policy-2/", + "/projects/", + "/research/", + "/research/publications/", + "/", + "/blog/", + "/blog/page/2/", + "/legal-notice/", + "/wp-portfolio/digital-printing-workflow/", + "/wp-portfolio/covid-19-montreal-dashboard/", + "/wp-portfolio/sepaq-availability-scraper/", + "/wp-portfolio/docker-monitor/", + "/wp-portfolio/concernification-study/", + "/wp-portfolio/touchcore/", + "/wp-portfolio/tippspiel/", + "/wp-portfolio/kinect-project/", + "/wp-portfolio/hochseilgarten-nagold/", + "/wp-portfolio/max-payne-zone/", + "/category/distributed-version-control/", + "/category/frameworks/django/", + "/category/docker/", + "/category/frameworks/emf/", + "/category/firefox/", + "/category/frameworks/", + "/category/distributed-version-control/git/", + "/category/hints/", + "/category/howto/", + "/category/java/", + "/category/mac-os/", + "/category/nextcloud/", + "/category/office/", + "/category/raspberry-pi/", + "/category/frameworks/struts/", + "/category/thunderbird/", + "/category/tweaks/", + "/category/uncategorized/", + "/category/windows/", + "/category/windows/windows-7/", + "/portfolio-category/archive/", + "/portfolio-category/development/", + "/portfolio-category/side-projects/" +] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b2fd11..d638e8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,5 +53,9 @@ jobs: - name: Check markdownlint results run: | cat markdownlint-cli2-sarif.sarif | grep -q '"results": \[\]' - - name: Build mkdocs site - run: uv run mkdocs build --strict + - name: Run the production stack + run: docker compose up --build -d + - name: Check + run: uv run --script .github/redirects/check_redirects.py + - name: Stop production stack + run: docker compose down diff --git a/Dockerfile b/Dockerfile index 4bf2f6f..a38be53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,4 +31,6 @@ RUN python -m mkdocs build --strict --site-dir /site # production FROM joseluisq/static-web-server:2.34.0 +COPY deploy/sws.toml /config.toml + COPY --from=build /site /public diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..bd5a01d --- /dev/null +++ b/compose.yaml @@ -0,0 +1,7 @@ +services: + app: + build: + context: . + restart: unless-stopped + ports: + - "80:80" diff --git a/deploy/sws.toml b/deploy/sws.toml new file mode 100644 index 0000000..dc4ce23 --- /dev/null +++ b/deploy/sws.toml @@ -0,0 +1,141 @@ +[advanced] + +### URL Redirects + +# publications to research index +[[advanced.redirects]] +source = "/research/publications/" +destination = "/research/" +kind = 301 + +# old legal notice +[[advanced.redirects]] +source = "/legal-notice/" +destination = "/imprint/" +kind = 301 + +# old privacy policy +[[advanced.redirects]] +source = "/privacy-policy-2/" +destination = "/privacy-policy/" +kind = 301 + +# papers +[[advanced.redirects]] +source = "/wp-content/papercite-data/pdf/{*}.pdf" +destination = "/assets/papers/$1.pdf" +kind = 301 + +# blog categories that don't exist anymore +[[advanced.redirects]] +source = "/category/{uncategorized,frameworks,hints,howto,office,tweaks,windows}/" +destination = "/blog/" +kind = 301 + +[[advanced.redirects]] +source = "/category/java/" +destination = "/blog/category/eclipse-modeling-framework-emf/" +kind = 301 + +[[advanced.redirects]] +source = "/category/frameworks/struts/" +destination = "/blog/" +kind = 301 + +[[advanced.redirects]] +source = "/category/windows/windows-7/" +destination = "/blog/" +kind = 301 + +[[advanced.redirects]] +source = "/category/distributed-version-control/" +destination = "/blog/category/git/" +kind = 301 + +# blog categories that exist but under a different structure +[[advanced.redirects]] +source = "/category/frameworks/django/" +destination = "/blog/category/django/" +kind = 301 + +[[advanced.redirects]] +source = "/category/distributed-version-control/git/" +destination = "/blog/category/git/" +kind = 301 + +[[advanced.redirects]] +source = "/category/frameworks/emf/" +destination = "/blog/category/eclipse-modeling-framework-emf/" +kind = 301 + +[[advanced.redirects]] +source = "/category/{raspberry-pi,nextcloud}/" +destination = "/blog/category/self-hosting/" +kind = 301 + +# categories that still exist +[[advanced.redirects]] +source = "/category/{*}/" +destination = "/blog/category/$1/" +kind = 301 + +# old blog categories +[[advanced.redirects]] +source = "/category/{*}/" +destination = "/blog/category/$1/" +kind = 301 + +# blog archive: month not accessible anymore +[[advanced.redirects]] +source = "/{[0-9][0-9][0-9][0-9]}/{[0-9][0-9]}/" +destination = "/blog/archive/$1/" +kind = 301 + +# blog posts +[[advanced.redirects]] +source = "/{[0-9][0-9][0-9][0-9]}/{[0-9][0-9]}/{[0-9][0-9]}/{*}/" +destination = "/blog/$1/$2/$3/$4" +kind = 301 + +# uploads for blog posts + +# COVID-19 Montreal Dashboard +[[advanced.redirects]] +source = "/wp-content/uploads/2021/05/{*}" +destination = "/blog/2021/covid-19-montreal-dashboard/$1" +kind = 301 + +# Thunderbird titlebar +[[advanced.redirects]] +source = "/wp-content/uploads/2013/05/{*}" +destination = "/blog/2013/show-old-title-bar-in-thunderbird/$1" +kind = 301 + +# portfolio pages +[[advanced.redirects]] +source = "/wp-portfolio/{*}/" +destination = "/projects/#{$1}" +kind = 301 + +# portfolio categories +[[advanced.redirects]] +source = "/portfolio-category/development/" +destination = "/projects/#software-engineering" +kind = 301 + +[[advanced.redirects]] +source = "/portfolio-category/{*}/" +destination = "/projects/" +kind = 301 + +# image uploads +[[advanced.redirects]] +source = "/wp-content/*/*/*/{*}.jpg" +destination = "/assets/images/$1.jpg" +kind = 301 + +# video uploads +[[advanced.redirects]] +source = "/wp-content/*/*/*/{*}.{mp4,mov}" +destination = "/assets/videos/$1.$2" +kind = 301 diff --git a/docs/blog/posts/2011/mac-os-airport-not-connecting-automatically-to-wi-fi.md b/docs/blog/posts/2011/mac-os-airport-not-connecting-automatically-to-wi-fi.md index 8cf8272..ede652d 100644 --- a/docs/blog/posts/2011/mac-os-airport-not-connecting-automatically-to-wi-fi.md +++ b/docs/blog/posts/2011/mac-os-airport-not-connecting-automatically-to-wi-fi.md @@ -3,8 +3,8 @@ migrated: true date: created: 2011-03-30 updated: 2011-03-30 -# categories: -# - macOS +categories: + - Mac OS slug: mac-os-airport-not-connecting-automatically-to-wi-fi --- # Mac OS: Airport not connecting automatically to Wi-Fi diff --git a/docs/blog/posts/2012/hide-star-besides-email-addresses-in-thunderbird.md b/docs/blog/posts/2012/hide-star-besides-email-addresses-in-thunderbird.md index 0575684..cc57e38 100644 --- a/docs/blog/posts/2012/hide-star-besides-email-addresses-in-thunderbird.md +++ b/docs/blog/posts/2012/hide-star-besides-email-addresses-in-thunderbird.md @@ -1,8 +1,8 @@ --- migrated: true date: - created: 2012-02-06 - updated: 2012-02-06 + created: 2012-02-07 + updated: 2012-02-07 categories: - Thunderbird # - Tweaks diff --git a/docs/blog/posts/2012/lyx-installing-unknown-document-classes.md b/docs/blog/posts/2012/lyx-installing-unknown-document-classes.md index f8fdb93..de762a1 100644 --- a/docs/blog/posts/2012/lyx-installing-unknown-document-classes.md +++ b/docs/blog/posts/2012/lyx-installing-unknown-document-classes.md @@ -1,7 +1,7 @@ --- migrated: true date: - created: 2012-05-28 + created: 2012-05-29 updated: 2013-04-05 # categories: # - Mac OS diff --git a/docs/blog/posts/2012/thunderbird-extension-toggle-headers.md b/docs/blog/posts/2012/thunderbird-extension-toggle-headers.md index cf972d5..3517723 100644 --- a/docs/blog/posts/2012/thunderbird-extension-toggle-headers.md +++ b/docs/blog/posts/2012/thunderbird-extension-toggle-headers.md @@ -1,8 +1,8 @@ --- migrated: true date: - created: 2012-02-06 - updated: 2012-02-06 + created: 2012-02-07 + updated: 2012-02-07 categories: - Thunderbird slug: thunderbird-extension-toggle-headers diff --git a/docs/blog/posts/2013/modifying-the-new-child-sub-menu-items-in-emf.md b/docs/blog/posts/2013/modifying-the-new-child-sub-menu-items-in-emf.md index 0ac9783..8dd20ee 100644 --- a/docs/blog/posts/2013/modifying-the-new-child-sub-menu-items-in-emf.md +++ b/docs/blog/posts/2013/modifying-the-new-child-sub-menu-items-in-emf.md @@ -22,6 +22,8 @@ The default case is implemented in `ItemProviderAdapter`. There seem to be two approaches, depending on what your goal is. + + ## General Approach If you want to change the text independent from the element, meaning for all elements, you should change the `_UI_CreateChild_text` key in `plugin.properties`. diff --git a/docs/blog/posts/2013/reducing-file-size-of-a-pdf-on-mac-os.md b/docs/blog/posts/2013/reducing-file-size-of-a-pdf-on-mac-os.md index 6592e9b..07ca788 100644 --- a/docs/blog/posts/2013/reducing-file-size-of-a-pdf-on-mac-os.md +++ b/docs/blog/posts/2013/reducing-file-size-of-a-pdf-on-mac-os.md @@ -3,9 +3,9 @@ migrated: true date: created: 2013-04-25 updated: 2017-12-12 -# categories: +categories: # - Howto -# - Mac OS + - Mac OS slug: reducing-file-size-of-a-pdf-on-mac-os --- # Reducing file size of a PDF on Mac OS diff --git a/docs/blog/posts/2015/mt4j-with-processing-2.md b/docs/blog/posts/2015/mt4j-with-processing-2.md index 2c48b78..868cbc8 100644 --- a/docs/blog/posts/2015/mt4j-with-processing-2.md +++ b/docs/blog/posts/2015/mt4j-with-processing-2.md @@ -1,8 +1,8 @@ --- migrated: true date: - created: 2015-08-18 - updated: 2015-08-18 + created: 2015-08-19 + updated: 2015-08-19 # categories: # - Java slug: mt4j-with-processing-2 diff --git a/docs/blog/posts/2015/thunderbird-extension-hide-badge-icon.md b/docs/blog/posts/2015/thunderbird-extension-hide-badge-icon.md index 0d9943a..b018a8d 100644 --- a/docs/blog/posts/2015/thunderbird-extension-hide-badge-icon.md +++ b/docs/blog/posts/2015/thunderbird-extension-hide-badge-icon.md @@ -1,8 +1,8 @@ --- migrated: true date: - created: 2015-11-09 - updated: 2015-11-09 + created: 2015-11-10 + updated: 2015-11-10 categories: # - Mac OS - Thunderbird diff --git a/docs/blog/posts/2015/thunderbird-extension-toggle-headers-updated.md b/docs/blog/posts/2015/thunderbird-extension-toggle-headers-updated.md index d860a93..6b97b7b 100644 --- a/docs/blog/posts/2015/thunderbird-extension-toggle-headers-updated.md +++ b/docs/blog/posts/2015/thunderbird-extension-toggle-headers-updated.md @@ -1,8 +1,8 @@ --- migrated: true date: - created: 2015-11-09 - updated: 2015-11-09 + created: 2015-11-10 + updated: 2015-11-10 categories: - Thunderbird slug: thunderbird-extension-toggle-headers-updated diff --git a/docs/blog/posts/2017/airdrop-on-macos-working-unreliably.md b/docs/blog/posts/2017/airdrop-on-macos-working-unreliably.md index 1335ebf..26495ce 100644 --- a/docs/blog/posts/2017/airdrop-on-macos-working-unreliably.md +++ b/docs/blog/posts/2017/airdrop-on-macos-working-unreliably.md @@ -3,8 +3,8 @@ migrated: true date: created: 2017-12-08 updated: 2017-12-08 -# categories: -# - Mac OS +categories: + - Mac OS slug: airdrop-on-macos-working-unreliably --- # AirDrop on macOS working unreliably diff --git a/docs/blog/posts/2018/digging-into-the-firefox-ui-for-the-tab-close-button.md b/docs/blog/posts/2018/digging-into-the-firefox-ui-for-the-tab-close-button.md index fadc1d2..1056cc8 100644 --- a/docs/blog/posts/2018/digging-into-the-firefox-ui-for-the-tab-close-button.md +++ b/docs/blog/posts/2018/digging-into-the-firefox-ui-for-the-tab-close-button.md @@ -1,7 +1,7 @@ --- migrated: true date: - created: 2018-07-24 + created: 2018-07-25 updated: 2023-05-28 categories: - Firefox diff --git a/docs/blog/posts/2020/notes-on-traefik-v2-nextcloud-etc.md b/docs/blog/posts/2020/notes-on-traefik-v2-nextcloud-etc.md index 50ea56b..25ff975 100644 --- a/docs/blog/posts/2020/notes-on-traefik-v2-nextcloud-etc.md +++ b/docs/blog/posts/2020/notes-on-traefik-v2-nextcloud-etc.md @@ -1,7 +1,7 @@ --- migrated: true date: - created: 2020-01-15 + created: 2020-01-16 updated: 2022-12-17 categories: # - Docker diff --git a/docs/blog/posts/2021/setting-up-msmtp.md b/docs/blog/posts/2021/setting-up-msmtp.md index 5f2864b..ef9d1cd 100644 --- a/docs/blog/posts/2021/setting-up-msmtp.md +++ b/docs/blog/posts/2021/setting-up-msmtp.md @@ -1,8 +1,8 @@ --- migrated: true date: - created: 2021-05-11 - updated: 2021-05-11 + created: 2021-05-12 + updated: 2021-05-12 categories: # - Howto - Linux diff --git a/mkdocs.yml b/mkdocs.yml index 06ec3e1..2d59295 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -91,6 +91,7 @@ plugins: - Git - iOS - Linux + - Mac OS - Projects - Self-hosting - Thunderbird