From 77b539522cb4786d393d655d3af6673d4d4fbbca Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 15 Mar 2025 23:48:17 +0100 Subject: [PATCH 1/8] chore(tooling): add service unit target in the README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f5f82b8..3a7fd2d 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,9 @@ Description=ods.adyxax.org service Environment="ODS_PORT=8090" ExecStart=/usr/local/bin/ods Type=simple + +[Install] +WantedBy=default.target ``` ## Nginx reverse proxy From 55168d4091beadcbee4b1086b521cad928c2001a Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 16 Mar 2025 00:02:52 +0100 Subject: [PATCH 2/8] chore(tooling): improve README and Makefile --- GNUmakefile | 4 ++-- README.md | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 483f13b..2e974e2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -37,8 +37,8 @@ push: tidy no-dirty check ## push changes to git remote .PHONY: deploy deploy: build ## deploy changes to the production server - rsync ./ods root@ods.adyxax.org:/usr/local/bin/ - ssh root@ods.adyxax.org "systemctl restart ods" + rsync ./ods ods@ods.adyxax.org: + ssh ods@ods.adyxax.org "systemctl --user restart ods" ##### Utils #################################################################### .PHONY: confirm diff --git a/README.md b/README.md index 3a7fd2d..f450fe1 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,13 @@ help` if running BSD) to see the possible actions. Use `make build` to build a static binary of the service, embedding everything. +## Configuration + +ODS can be configured by setting the following environment variables: +- `ODS_DEBUG`: Set this to a non empty string to activate debug logs. +- `ODS_HOST`: Hostname or address to listen on, defaults to `127.0.0.1`. +- `ODS_PORT`: TCP port to listen on, defaults to `8080`. + ## The dictionary The "Officiel Du Scrabble" (ODS for short) is what the official dictionary for From 8ae98ee7c268751e69ecaeb5c374d6460848b814 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 16 Mar 2025 22:54:02 +0100 Subject: [PATCH 3/8] fix(tooling): fix workflow --- .forgejo/workflows/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index c74d14a..4ff18d9 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -16,7 +16,7 @@ jobs: make tidy no-dirty - name: 'check' run: | - make check tidy no-dirty + make check no-dirty build: if: "${{ startsWith(github.ref, 'refs/tags/') }}" needs: @@ -71,4 +71,4 @@ jobs: release-dir: './' token: '${{ env.GITHUB_TOKEN }}' hide-archive-link: true - release-notes-assistant: true + prerelease: true From 605b195085aec0653373e374d67305b03e215f0d Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 7 Apr 2025 09:23:46 +0200 Subject: [PATCH 4/8] chore(deps): update dependencies --- .forgejo/workflows/main.yaml | 9 ++++++--- CHANGELOG.md | 6 ++++++ go.mod | 4 ++-- go.sum | 4 ++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index 4ff18d9..9962c80 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -34,7 +34,8 @@ jobs: make build env: GIT_CRYPT_SECRET: '${{ secrets.GIT_CRYPT }}' - - uses: 'actions/upload-artifact@v3' + #- uses: 'actions/upload-artifact@v4' + - uses: 'forgejo/upload-artifact@v4' with: if-no-files-found: 'error' name: 'ods' @@ -44,7 +45,8 @@ jobs: - 'build' runs-on: 'self-hosted' steps: - - uses: 'actions/download-artifact@v3' + #- uses: 'actions/download-artifact@v4' + - uses: 'forgejo/download-artifact@v4' with: name: 'ods' - run: | @@ -60,7 +62,8 @@ jobs: - 'build' runs-on: 'self-hosted' steps: - - uses: 'actions/download-artifact@v3' + #- uses: 'actions/download-artifact@v4' + - uses: 'forgejo/download-artifact@v4' with: name: 'ods' - uses: 'actions/forgejo-release@v2' diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e70f2..0984382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## 1.0.1 - 2024-04-07 + +### Changed + +- Upgrade dependencies. + ## 1.0.0 - 2025-03-15 ### Added diff --git a/go.mod b/go.mod index 239321e..9dde400 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module git.adyxax.org/adyxax/ods -go 1.24.1 +go 1.24.2 -require golang.org/x/text v0.23.0 +require golang.org/x/text v0.24.0 diff --git a/go.sum b/go.sum index d00bb39..5b77acb 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= From 060942051fac46e9b597e6b1f00ae8363f2947a5 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 9 Apr 2025 18:20:24 +0200 Subject: [PATCH 5/8] chore(tooling): integrate forgejo workflow's deploy step into the makefile's --- .forgejo/workflows/main.yaml | 6 +----- GNUmakefile | 13 +++++++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index 9962c80..1c36362 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -50,11 +50,7 @@ jobs: with: name: 'ods' - run: | - umask 077 - printf '%s' "$SSH_PRIVATE_KEY" | base64 -d > private_key - SSHOPTS="-i private_key -o StrictHostKeyChecking=accept-new" - rsync -e "ssh ${SSHOPTS}" ods ods@ods.adyxax.org: - ssh ${SSHOPTS} ods@ods.adyxax.org "chmod +x ods; systemctl --user restart ods" + make deploy env: SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}' publish: diff --git a/GNUmakefile b/GNUmakefile index 2e974e2..3695969 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -37,8 +37,17 @@ push: tidy no-dirty check ## push changes to git remote .PHONY: deploy deploy: build ## deploy changes to the production server - rsync ./ods ods@ods.adyxax.org: - ssh ods@ods.adyxax.org "systemctl --user restart ods" + umask 077 + if [ -n "$${SSH_PRIVATE_KEY:-}" ]; then + cleanup() { + rm -f private_key + } + trap cleanup EXIT + printf '%s' "$$SSH_PRIVATE_KEY" | base64 -d > private_key + SSHOPTS="-i private_key -o StrictHostKeyChecking=accept-new" + fi + rsync -e "ssh $${SSHOPTS:-}" ./ods ods@ods.adyxax.org: + ssh $${SSHOPTS:-} ods@ods.adyxax.org "chmod +x ods; systemctl --user restart ods" ##### Utils #################################################################### .PHONY: confirm From 425cc5435688b119eef243ded11a3b0ebdc408bb Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sat, 12 Apr 2025 14:06:28 +0200 Subject: [PATCH 6/8] chore(tooling): update workflow --- .forgejo/workflows/main.yaml | 40 +++++------------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/.forgejo/workflows/main.yaml b/.forgejo/workflows/main.yaml index 1c36362..eeaaf02 100644 --- a/.forgejo/workflows/main.yaml +++ b/.forgejo/workflows/main.yaml @@ -1,4 +1,6 @@ --- +name: 'main' + on: push: workflow_dispatch: @@ -17,7 +19,7 @@ jobs: - name: 'check' run: | make check no-dirty - build: + main: if: "${{ startsWith(github.ref, 'refs/tags/') }}" needs: - 'test' @@ -34,40 +36,8 @@ jobs: make build env: GIT_CRYPT_SECRET: '${{ secrets.GIT_CRYPT }}' - #- uses: 'actions/upload-artifact@v4' - - uses: 'forgejo/upload-artifact@v4' - with: - if-no-files-found: 'error' - name: 'ods' - path: 'ods' - deploy: - needs: - - 'build' - runs-on: 'self-hosted' - steps: - #- uses: 'actions/download-artifact@v4' - - uses: 'forgejo/download-artifact@v4' - with: - name: 'ods' - - run: | + - name: 'deploy' + run: | make deploy env: SSH_PRIVATE_KEY: '${{ secrets.SSH_PRIVATE_KEY }}' - publish: - needs: - - 'build' - runs-on: 'self-hosted' - steps: - #- uses: 'actions/download-artifact@v4' - - uses: 'forgejo/download-artifact@v4' - with: - name: 'ods' - - uses: 'actions/forgejo-release@v2' - with: - direction: 'upload' - tag: '${{ github.ref_name }}' - sha: '${{ github.sha }}' - release-dir: './' - token: '${{ env.GITHUB_TOKEN }}' - hide-archive-link: true - prerelease: true From 731b70f9e6f1d398a197261f05239db9ba2b2bd6 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 11 May 2025 09:50:28 +0200 Subject: [PATCH 7/8] chore(deps): update dependencies --- CHANGELOG.md | 10 ++++++++-- go.mod | 4 ++-- go.sum | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0984382..00a6706 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,17 @@ All notable changes to this project will be documented in this file. -## 1.0.1 - 2024-04-07 +## 1.0.2 - 2025-05-11 ### Changed -- Upgrade dependencies. +- Updated dependencies. + +## 1.0.1 - 2025-04-07 + +### Changed + +- Updated dependencies. ## 1.0.0 - 2025-03-15 diff --git a/go.mod b/go.mod index 9dde400..a77e3a5 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module git.adyxax.org/adyxax/ods -go 1.24.2 +go 1.24.3 -require golang.org/x/text v0.24.0 +require golang.org/x/text v0.25.0 diff --git a/go.sum b/go.sum index 5b77acb..3470e4e 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= +golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= From 4c4f5e4322ee954506d4301dc137b96415788b8f Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Fri, 6 Jun 2025 09:45:12 +0200 Subject: [PATCH 8/8] chore(deps): update dependencies --- CHANGELOG.md | 6 ++++++ go.mod | 4 ++-- go.sum | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00a6706..c13cec6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## 1.0.3 - 2025-06-06 + +### Changed + +- Updated dependencies. + ## 1.0.2 - 2025-05-11 ### Changed diff --git a/go.mod b/go.mod index a77e3a5..5328638 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module git.adyxax.org/adyxax/ods -go 1.24.3 +go 1.24.4 -require golang.org/x/text v0.25.0 +require golang.org/x/text v0.26.0 diff --git a/go.sum b/go.sum index 3470e4e..b69360c 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,2 @@ -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=