Compare commits

..

2 Commits

Author SHA1 Message Date
cupcakearmy 7e70c81d81 cleanup 2026-05-31 21:39:37 +02:00
Stefan Meinecke 1a243cc96a Replace Redis with Valkey in docker-compose files and fix Rust 2024 compat
Swap redis:7-alpine images to valkey/valkey:7-alpine across all
docker-compose files and example READMEs. Keep service name as
"redis" so that the default REDIS=redis://redis/ connection string
still resolves correctly in Docker networking.

Also add turbofish type annotations to redis crate calls in store.rs
for Rust 2024 never-type-fallback compatibility, and fix a typo
("notion" -> "note") in an error message.
2026-05-12 18:40:41 +02:00
9 changed files with 42 additions and 42 deletions
+5 -5
View File
@@ -105,12 +105,12 @@ version: '3.8'
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# https://valkey.io/topics/lru-cache/
# --maxmemory 1gb --maxmemory-policy allkeys-lru
# This prevents the creation of an anonymous volume.
tmpfs:
- /data
@@ -190,7 +190,7 @@ pnpm run dev
Running `pnpm run dev` in the root folder will start the following things:
- redis docker container
- valkey docker container
- rust backend
- client
- cli
+4 -4
View File
@@ -90,12 +90,12 @@ version: '3.8'
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# https://valkey.io/topics/lru-cache/
# --maxmemory 1gb --maxmemory-policy allkeys-lru
# This prevents the creation of an anonymous volume.
tmpfs:
- /data
+8 -8
View File
@@ -73,12 +73,12 @@ version: '3.8'
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# https://valkey.io/topics/lru-cache/
# --maxmemory 1gb --maxmemory-policy allkeys-lru
# This prevents the creation of an anonymous volume.
tmpfs:
- /data
@@ -115,12 +115,12 @@ networks:
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# https://valkey.io/topics/lru-cache/
# --maxmemory 1gb --maxmemory-policy allkeys-lru
# This prevents the creation of an anonymous volume.
tmpfs:
- /data
+5 -5
View File
@@ -3,12 +3,12 @@
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# https://valkey.io/topics/lru-cache/
# --maxmemory 1gb --maxmemory-policy allkeys-lru
# This prevents the creation of an anonymous volume.
tmpfs:
- /data
@@ -25,7 +25,7 @@ services:
- 3000:8000
healthcheck:
test: ['CMD', 'curl', '--fail', 'http://127.0.0.1:8000/api/live/']
test: ["CMD", "curl", "--fail", "http://127.0.0.1:8000/api/live/"]
interval: 1m
timeout: 3s
retries: 2
+4 -4
View File
@@ -1,11 +1,11 @@
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# https://valkey.io/topics/lru-cache/
# --maxmemory 1gb --maxmemory-policy allkeys-lru
# This prevents the creation of an anonymous volume.
tmpfs:
- /data
+3 -3
View File
@@ -2,11 +2,11 @@ version: '3.8'
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# https://valkey.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# This prevents the creation of an anonymous volume.
tmpfs:
+3 -3
View File
@@ -108,11 +108,11 @@ networks:
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# https://valkey.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# This prevents the creation of an anonymous volume.
tmpfs:
+6 -6
View File
@@ -17,11 +17,11 @@ networks:
services:
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# https://valkey.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# This prevents the creation of an anonymous volume.
tmpfs:
@@ -61,11 +61,11 @@ services:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
redis:
image: redis:7-alpine
image: valkey/valkey:7-alpine
# This is required to stay in RAM only.
command: redis-server --save "" --appendonly no
command: valkey-server --save "" --appendonly no
# Set a size limit. See link below on how to customise.
# https://redis.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# https://valkey.io/docs/latest/operate/rs/databases/memory-performance/eviction-policy/
# --maxmemory 1gb --maxmemory-policy allkeys-lrulpine
# This prevents the creation of an anonymous volume.
tmpfs:
+4 -4
View File
@@ -31,13 +31,13 @@ pub fn set(id: &String, note: &Note) -> Result<(), &'static str> {
let serialized = serde_json::to_string(&note.clone()).unwrap();
let mut conn = get_connection()?;
conn.set(id, serialized)
conn.set::<_, _, ()>(id, serialized)
.map_err(|_| "Unable to set note in redis")?;
match note.expiration {
Some(e) => {
let seconds = e - now();
conn.expire(id, seconds as i64)
.map_err(|_| "Unable to set expiration on notion")?
conn.expire::<_, ()>(id, seconds as i64)
.map_err(|_| "Unable to set expiration on note")?
}
None => {}
};
@@ -58,6 +58,6 @@ pub fn get(id: &String) -> Result<Option<Note>, &'static str> {
pub fn del(id: &String) -> Result<(), &'static str> {
let mut conn = get_connection()?;
conn.del(id).map_err(|_| "Unable to delete note in redis")?;
conn.del::<_, ()>(id).map_err(|_| "Unable to delete note in redis")?;
Ok(())
}