question: is the runner cache really invalidated when restarting runner with no explicit secret? #1041
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
run-multi-platform-tests
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
forgejo/runner#1041
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The documentation states about the
cache.secretoption:I have configured a v11.1.1 runner with
cache.secretleft to its default value"". Since the secret is empty I expected the cache to be invalidated every time I restart the runner. By invalidated, I expect the cache contents to be unusable and the runner to behave as if the cache had never been populated.But this is not what I experienced with a simple workflow doing a rust build:
Here are the steps I followed:
.cache/actcache/*while the runner was not running to make sure the cache is emptySo obviously, the cache was not invalidated. I digged into the code and confirmed that a new secret is indeed generated upon each startup of the runner. But I could not find anything meaningful relating to the use of this secret to actually encrypt the cache.
It's likely that I am mistaken but cannot figure out where. I'd be very grateful if anyone could shed some light on what looks like a mystery to me. Thanks!
Is the runner cache _really_ invalidated when restarting runner with no explicit secret?to Is the runner cache really invalidated when restarting runner with no explicit secret?Is the runner cache really invalidated when restarting runner with no explicit secret?to question: is the runner cache really invalidated when restarting runner with no explicit secret?could you please provide the
config.ymlyou are using?Sure, here you go:
I created it about a year ago so the template looks a bit outdated.
It is error on my part. Back when I wrote this part of the documentation I was somehow mistaken into thinking the secret played a part in determining the location of the cache file in the cache directory. But after double checking and reproducing the behavior you described I confirm it was just not true.
Note that the secret is used to secure the communications between the cache and the cache proxy. It is not used to encrypt the cache files, they are stored unencrypted.
Ah, thanks a lot for investigating that so quickly! Your assessment of the code aligns more with what I read and understood as well.
As per the cache encryption, I did not find any traces of it in the code but since there was this invalidation thing described in the doc, that was my assumption that there had to be one. Thanks for pointing that out!
Is there still any benefit from setting an explicit secret, then? It looks like the default behavior would be good enough in all situations but I may miss something.
Thanks again, mystery solved :)
If not using an external server, I agree: there is no benefit in setting a secret.