diff --git a/.editorconfig b/.editorconfig index 452070b..1923d41 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,10 +2,7 @@ root = true [*] indent_style = space -indent_size = 4 +indent_size = 2 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true - -[*.{json,yml,yaml}] -indent_size = 2 diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 4dd255d..e666dac 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -15,27 +15,25 @@ concurrency: group: pages cancel-in-progress: false -defaults: - run: - shell: bash - jobs: build: runs-on: ubuntu-latest container: - image: hugomods/hugo:exts + image: hugomods/hugo:ci env: TZ: Europe/Budapest steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: submodules: recursive fetch-depth: 0 + - name: Setup Pages id: pages uses: actions/configure-pages@v5 + - name: Cache restore id: cache-restore uses: actions/cache/restore@v5 @@ -44,6 +42,7 @@ jobs: key: hugo-${{ github.run_id }} restore-keys: hugo- + - name: Build the site run: | hugo \ @@ -51,12 +50,19 @@ jobs: --minify \ --baseURL "${{ steps.pages.outputs.base_url }}/" \ --cacheDir "${{ runner.temp }}/hugo_cache" + - name: Cache save id: cache-save uses: actions/cache/save@v5 with: path: ${{ runner.temp }}/hugo_cache key: ${{ steps.cache-restore.outputs.cache-primary-key }} + + # This is necessary to upload artifacts + - name: Install GNU Tar + run: | + apk add tar + - name: Upload artifact uses: actions/upload-pages-artifact@v4 with: diff --git a/assets/scss/custom.scss b/assets/scss/custom.scss index 0aedcd1..16f8cf2 100644 --- a/assets/scss/custom.scss +++ b/assets/scss/custom.scss @@ -1,13 +1,13 @@ @font-face { - font-family: 'Lora'; + font-family: "Lora"; font-style: normal; - src: url('../fonts/Lora-VariableFont_wght.ttf'); + src: url("../fonts/Lora-VariableFont_wght.ttf"); } @font-face { - font-family: 'Lora'; + font-family: "Lora"; font-style: italic; - src: url('../fonts/Lora-Italic-VariableFont_wght.ttf'); + src: url("../fonts/Lora-Italic-VariableFont_wght.ttf"); } .navigation-item { @@ -18,6 +18,39 @@ a { transition: none; } -.navigation a:hover { - text-decoration: none; +.navigation { + a:hover { + text-decoration: none; + } +} + +.content { + .post { + .post-content { + p { + text-align: left; + hyphens: none; + } + + figure > img { + border-radius: 1rem; + box-shadow: 0 0.6rem 1.25rem rgba(0, 0, 0, 0.25); + } + + figure > figcaption > p { + text-align: center; + } + + table { + margin: 0 auto; + tr { + th, + td { + border-left: 0 !important; + border-right: 0 !important; + } + } + } + } + } } diff --git a/content/blog/_index.md b/content/blog/_index.md index 3582a6d..c63b190 100644 --- a/content/blog/_index.md +++ b/content/blog/_index.md @@ -1,9 +1,6 @@ --- +title: Blog +type: posts cascade: - comments: true - author: "Lóránt Pintér" - ShowShareButtons: true - ShowReadingTime: true - ShowPostNavLinks: true - ShowCodeCopyButtons: true + type: posts --- diff --git a/content/blog/dockero-host.md b/content/blog/dockero-host.md new file mode 100644 index 0000000..8c19d02 --- /dev/null +++ b/content/blog/dockero-host.md @@ -0,0 +1,55 @@ ++++ +date = '2026-02-03' +title = 'Dockero in the Local Development Environment' +summary = 'How to configure Dockero to work with alternative Docker runtimes in development' ++++ + +I've been using the excellent [Dockero](https://github.com/the-abra/dockero) library for running some Docker containers in my web applications. In production environments the applications are running on the actual Docker runtime, but in my development environment I like to use alternatives. + +Specifically, when I started using macOS again recently, I first opted for [Colima](https://github.com/abiosoft/colima) for its simplicity. However, anything involving Docker in my local development environment broke, and it took me a while to figure out what was wrong. + +It took a while to figure out that the Dockero expects the Docker Unix socket to be at `/var/run/docker.sock`, but Colima has it at `~/.colima/default/docker.sock`. + +To make Dockero work, you have to set the `DOCKER_HOST` environment variable. For my [Express](https://expressjs.com/)-based application this meant adding to `.env` (no `$HOME` variable substitution here unfortunately): + +```properties +DOCKER_HOST=unix:///Users/lptr/.colima/default/docker.sock +``` + +I also had some tests using [Jest](https://jestjs.io/) that involved executing Docker containers. Fixing those was a bit more complicated. + +I first installed [`dotenv`](https://github.com/motdotla/dotenv): + +```shell +npm install dotenv --save-dev +``` + +Then in `jest.config.ts` I added: + +```ts +import type { Config } from 'jest'; + +export default { + // ... + setupFiles: ['./jest.setup.ts'], +} as Config; +``` + +And in `jest.setup.js`: + +```ts +import { config } from 'dotenv'; + +config({ + path: '.env.test', + quiet: true, +}); +``` + +This loads a `.env.test` file before tests executed by Jest, so I can also put the `DOCKER_HOST` in there. + +I then later switched from Colima to [Rancher Desktop](https://rancherdesktop.io/). To make things work once again I had to change both `.env` files: + +```properties +DOCKER_HOST=unix:///Users/lptr/.rd/docker.sock +``` diff --git a/hugo.toml b/hugo.toml index b98746a..99fd22f 100644 --- a/hugo.toml +++ b/hugo.toml @@ -4,13 +4,15 @@ title = 'Redneck Overengineering' theme = 'hugo-coder' [params] +since = 2021 author = 'Lóránt Pintér' description = 'Taking farm automation to extreme levels' colorScheme = "auto" -hidecolorschemetoggle = false +hidecolorschemetoggle = true customSCSS = ["scss/custom.scss"] commit = "https://github.com/lptr/lptr.github.io/tree/" contactEmail = "lorant@pindoro.eu" +gravatar = 'lorant@pindoro.eu' # Menu [[menu.main]] @@ -18,6 +20,10 @@ name = "Blog" weight = 1 url = "/blog/" +[outputs] +home = ["html"] +blog = ["html", "rss"] + # Social links [[params.social]] name = "GitHub" @@ -37,6 +43,22 @@ icon = "fa-brands fa-linkedin fa-2x" weight = 3 url = "https://www.linkedin.com/in/lorantpinter/" +[[params.social]] +name = "RSS" +icon = "fa-solid fa-rss fa-2x" +weight = 4 +url = "https://lptr.github.io/blog/index.xml" +rel = "alternate" +type = "application/rss+xml" + +[params.umami] +siteID = "b6c0fdbc-a1b5-4581-bdd5-ed239d653585" +scriptURL = "https://analytics.cornucopia-machines.eu/script.js" + +[services] +[services.disqus] +shortname = "lptr" + [caches] - [caches.images] - dir = ':cacheDir/images' +[caches.images] +dir = ':cacheDir/images' diff --git a/layouts/_partials/analytics/umami.html b/layouts/_partials/analytics/umami.html new file mode 100644 index 0000000..6a9c33a --- /dev/null +++ b/layouts/_partials/analytics/umami.html @@ -0,0 +1,5 @@ + +{{- if hugo.IsProduction }} + +{{- end }} + diff --git a/static/site.webmanifest b/static/site.webmanifest new file mode 100644 index 0000000..8d2c0fb --- /dev/null +++ b/static/site.webmanifest @@ -0,0 +1,9 @@ +{ + "name": "Redneck Overengineering", + "short_name": "RNOE", + "description": "Taking farm automation to extreme levels", + "start_url": "/blog", + "display": "standalone", + "theme_color": "#ffffff", + "background_color": "#ffffff" +}