Compare commits

...

6 commits
1.0.0 ... main

Author SHA1 Message Date
5cacfdb574
chore(tooling): update workflow
All checks were successful
main / publish (push) Has been skipped
main / main (push) Successful in 22s
main / deploy (push) Has been skipped
2025-04-12 14:08:59 +02:00
060942051f
chore(tooling): integrate forgejo workflow's deploy step into the makefile's
All checks were successful
/ deploy (push) Has been skipped
/ publish (push) Has been skipped
/ build (push) Has been skipped
/ test (push) Successful in 17s
2025-04-09 18:20:24 +02:00
605b195085
chore(deps): update dependencies
All checks were successful
/ test (push) Successful in 8s
/ build (push) Successful in 14s
/ publish (push) Successful in 8s
/ deploy (push) Successful in 9s
2025-04-07 14:18:59 +02:00
8ae98ee7c2
fix(tooling): fix workflow
All checks were successful
/ deploy (push) Has been skipped
/ publish (push) Has been skipped
/ build (push) Has been skipped
/ test (push) Successful in 13s
2025-03-16 22:54:37 +01:00
55168d4091
chore(tooling): improve README and Makefile
All checks were successful
/ deploy (push) Has been skipped
/ publish (push) Has been skipped
/ test (push) Successful in 13s
/ build (push) Has been skipped
2025-03-16 00:02:52 +01:00
77b539522c
chore(tooling): add service unit target in the README
All checks were successful
/ deploy (push) Has been skipped
/ publish (push) Has been skipped
/ test (push) Successful in 21s
/ build (push) Has been skipped
2025-03-15 23:48:17 +01:00
6 changed files with 48 additions and 29 deletions

View file

@ -1,10 +1,12 @@
---
name: 'main'
on:
push:
workflow_dispatch:
jobs:
test:
main:
runs-on: 'self-hosted'
steps:
- uses: 'actions/checkout@v4'
@ -16,17 +18,7 @@ jobs:
make tidy no-dirty
- name: 'check'
run: |
make check tidy no-dirty
build:
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
needs:
- 'test'
runs-on: 'self-hosted'
steps:
- uses: 'actions/checkout@v4'
- uses: 'actions/setup-go@v5'
with:
go-version-file: 'go.mod'
make check no-dirty
- name: 'build'
run: |
printf '%s' "$GIT_CRYPT_SECRET" | base64 -d > secret
@ -34,33 +26,35 @@ 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'
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
with:
if-no-files-found: 'error'
name: 'ods'
path: 'ods'
deploy:
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
needs:
- 'build'
- 'main'
runs-on: 'self-hosted'
steps:
- uses: 'actions/download-artifact@v3'
#- uses: 'actions/download-artifact@v4'
- uses: 'forgejo/download-artifact@v4'
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:
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
needs:
- 'build'
- 'main'
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'
@ -71,4 +65,4 @@ jobs:
release-dir: './'
token: '${{ env.GITHUB_TOKEN }}'
hide-archive-link: true
release-notes-assistant: true
prerelease: false

View file

@ -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

View file

@ -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 root@ods.adyxax.org:/usr/local/bin/
ssh root@ods.adyxax.org "systemctl 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

View file

@ -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
@ -39,6 +46,9 @@ Description=ods.adyxax.org service
Environment="ODS_PORT=8090"
ExecStart=/usr/local/bin/ods
Type=simple
[Install]
WantedBy=default.target
```
## Nginx reverse proxy

4
go.mod
View file

@ -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

4
go.sum
View file

@ -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=