Commit Graph

70 Commits (main)

Author SHA1 Message Date
naicoi f3fb25e3a3
Merge branch 'hotfix/1.6.4' into main 2023-06-25 01:44:20 +07:00
naicoi fe04dd21a3
build: Update Dockerfile and go.mod
The Dockerfile has been updated to use a new Redis module, techio.dev/lttech/caddy-redis. The go.mod file no longer requires github.com/go-redis/redis/v8 v8.11.5 as a dependency.
2023-06-25 01:44:17 +07:00
naicoi cfbc21d9ff
Merge branch 'hotfix/1.6.3' into main 2023-06-25 01:42:57 +07:00
naicoi 1f851e8621
Update Redis client library and module name
- Update Redis client library from v8 to v9
- Update module name from github.com/techio-dev/caddy-redis to techio.dev/lttech/caddy-redis
2023-06-25 01:42:54 +07:00
naicoi 19452e286a
Merge branch 'hotfix/1.6.2' into main 2023-06-25 01:37:19 +07:00
naicoi 9e2c6d9186
Update Redis dependency and use new Redis client library
This commit updates the Redis dependency to v1.6.2 in Dockerfile and replaces the old Redis client library with a new one (v8) in envredisloader.go file. The new client is used to parse the REDIS_URL environment variable and retrieve configuration data from Redis server using Get() method instead of ParseURL().
2023-06-25 01:37:16 +07:00
naicoi 6e7bff4565
Merge branch 'hotfix/1.6.1' into main 2023-06-25 01:32:48 +07:00
naicoi 22a333011d
Refactor Dockerfile and rename redis.go to envredisloader.go
The Dockerfile has been refactored to include new dependencies and remove unused ones. The redis.go file has been renamed to envredisloader.go for clarity.
2023-06-25 01:32:46 +07:00
naicoi 9840674121
Merge branch 'release/2.6.0' into main 2023-06-25 01:02:31 +07:00
naicoi dc50db7c88
Rename redis loader package to envredisloader
This commit renames the redis loader package from caddyconfig to envredisloader. The changes were made in the file redis.go.
2023-06-25 01:02:28 +07:00
naicoi 2625fcf725
Merge branch 'release/1.5.0' into main 2023-06-25 00:54:49 +07:00
naicoi 85589697da
Add Redis loader for Caddy configs
This commit adds a new file `redis.go` which contains the implementation of a Redis loader for Caddy configs. The `ENVRedisLoader` struct can load Caddy configs over HTTP(S) and adapt the config based on the Content-Type header of the HTTP response. It uses the `go-redis/redis` package to connect to Redis and retrieve the config data.
2023-06-25 00:54:35 +07:00
naicoi 69ee268a5e
Merge branch 'hotfix/1.4.1' into main 2023-06-22 22:28:00 +07:00
naicoi 195f68c254
Merge branch 'hotfix/1.4.1' into develop 2023-06-22 22:27:59 +07:00
naicoi 1665855cdf
Refactor RedisStorage to remove locking functionality
This commit removes the locking functionality from RedisStorage by removing the redislock package and related code. The Lock and Unlock methods have been updated to use Redis' built-in SETNX and DEL commands respectively. The obtainLock, keepRedisLockFresh, and updateRedisLockFreshness functions have been removed as they are no longer needed.
2023-06-22 22:27:57 +07:00
naicoi d80127d83c
Merge branch 'release/1.4.0' into main 2023-06-22 19:47:45 +07:00
naicoi 81764ecbab
Add Redis lock support to storage module
This commit adds Redis lock support to the storage module. It uses the `github.com/bsm/redislock` package to obtain and release locks on keys in Redis. The implementation includes a background goroutine that refreshes the locks periodically, and a sync.Map to keep track of active locks.
2023-06-22 19:47:36 +07:00
naicoi d2074caba7
Merge branch 'hotfix/1.3.9' into main 2023-06-22 19:01:20 +07:00
naicoi 4766ac0ac5
Merge branch 'hotfix/1.3.9' into develop 2023-06-22 19:01:20 +07:00
naicoi 7f48884fec
Refactor RedisStorage Lock method to use lockKey instead of prefixKey
The RedisStorage Lock method was refactored to use the lockKey function instead of the prefixKey function. This change ensures that the correct key is used when checking if a key is locked in Redis.
2023-06-22 19:01:17 +07:00
naicoi 26520c7640
Merge branch 'hotfix/1.3.8' into main 2023-06-22 18:57:41 +07:00
naicoi e2f37917f5
Merge branch 'hotfix/1.3.8' into develop 2023-06-22 18:57:41 +07:00
naicoi c2cd1e63b3
Refactor RedisStorage Lock and Unlock methods to use a new lock key.
The RedisStorage Lock method now checks if the key is already locked before setting a new lock. The Unlock method now uses the new lock key to delete the lock.
2023-06-22 18:57:38 +07:00
naicoi d58aa15b4d
Merge branch 'hotfix/1.3.7' into main 2023-06-22 18:28:06 +07:00
naicoi 757fc73c0d
Merge branch 'hotfix/1.3.7' into develop 2023-06-22 18:28:06 +07:00
naicoi 6e7702a4f5
Refactor RedisStorage prefixing keys
This commit refactors the RedisStorage struct to prefix keys with a new method, `prefixKey`, instead of using separate methods for locking and unlocking. The `lockKey` method has been removed as it is no longer needed. Additionally, the `Exists` method now uses the `prefixKey` method to check if a key exists in Redis.
2023-06-22 18:28:03 +07:00
naicoi 0e8494f042
Merge branch 'hotfix/1.3.6' into main 2023-06-22 18:11:11 +07:00
naicoi 0a6b0c9741
Merge branch 'hotfix/1.3.6' into develop 2023-06-22 18:11:11 +07:00
naicoi 13735bcbfb
Refactor RedisStorage module to remove ClientName and use a constant instead. 2023-06-22 18:11:08 +07:00
naicoi fb4d205b19
Merge branch 'hotfix/1.3.5' into main 2023-06-22 17:57:15 +07:00
naicoi 8d2d4a1f8d
Merge branch 'hotfix/1.3.5' into develop 2023-06-22 17:57:15 +07:00
naicoi 2cfdbf9510
Update Redis version and handle non-existent keys in Redis storage
- Update Redis version to v1.3.4
- Handle non-existent keys in Redis storage by returning fs.ErrNotExist instead of nil
2023-06-22 17:57:11 +07:00
naicoi 23f218626f
Merge branch 'hotfix/1.3.4' into main 2023-06-22 16:41:24 +07:00
naicoi dc5a30f217
Merge branch 'hotfix/1.3.4' into develop 2023-06-22 16:41:24 +07:00
naicoi 649bd87468
Refactor RedisStorage to use RedisClient instead of rdb
This commit refactors the RedisStorage struct to use a RedisClient instance instead of the global rdb variable. The Provision method now sets the RedisClient field of the struct, and all other methods that interact with Redis now use this field. Additionally, this commit adds a caddy.Provisioner implementation to the RedisStorage struct by implementing its Provision method.
2023-06-22 16:41:21 +07:00
naicoi fa01605e84
Merge branch 'hotfix/1.3.3' into main 2023-06-22 03:12:14 +07:00
naicoi 3b854f2eee
Merge branch 'hotfix/1.3.3' into develop 2023-06-22 03:12:14 +07:00
naicoi 9d60ee8b1a
Update Redis version and refactor RedisStorage struct
- Update Redis version to v1.3.3
- Refactor RedisStorage struct to remove unused field and use a global variable for redis client instead of creating a new one on each method call
2023-06-22 03:12:11 +07:00
naicoi 94adb2a29e
Merge branch 'hotfix/1.3.2' into main 2023-06-22 03:06:26 +07:00
naicoi 88f8dac20d
Merge branch 'hotfix/1.3.2' into develop 2023-06-22 03:06:26 +07:00
naicoi ef364c120d
Update Caddy Redis version and log additional info
- Update Caddy Redis version to v1.3.1
- Log additional information in RedisStorage function
2023-06-22 03:06:23 +07:00
naicoi 0cd6db7bb8
Merge branch 'hotfix/1.3.1' into main 2023-06-22 03:02:53 +07:00
naicoi 67127eb07b
Merge branch 'hotfix/1.3.1' into develop 2023-06-22 03:02:53 +07:00
naicoi 6e52f6e295
Update Redis version and fix error handling in Redis storage
The Dockerfile has been updated to use the latest version of the caddy-redis module. The RedisStorage function in redis.go has been modified to handle errors correctly when parsing the REDIS_URL environment variable. The Provision function has also been removed as it is no longer needed.
2023-06-22 03:02:50 +07:00
naicoi 3052f7e52b
Merge branch 'release/1.3.0' into main 2023-06-22 02:59:04 +07:00
naicoi 24aab589a4
Merge branch 'release/1.3.0' into develop 2023-06-22 02:59:04 +07:00
naicoi 476dc710af
go.mod go.sum 2023-06-22 02:59:00 +07:00
naicoi 40d170cf51
Update Redis library and Dockerfile, add context to Redis functions
This commit updates the Redis library used in the code from go-redis/v9 to redis/go-redis/v9. It also updates the version of caddy-redis/adapt and caddy-redis/storage in the Dockerfile. Additionally, this commit adds a context parameter to all Redis functions that did not have it before.
2023-06-22 02:58:48 +07:00
naicoi be5e91535f
Merge branch 'hotfix/1.2.1' into main 2023-06-22 02:50:33 +07:00
naicoi a1f0432771
Merge branch 'hotfix/1.2.1' into develop 2023-06-22 02:50:33 +07:00