-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Steps to host your own ttl.sh #16
Comments
@milindchawre Our GitHub Actions is still the old HCL format, quite old. Our current hosting is pretty specific, evident from the env vars. We are hosting this service on Heroku today, but there's nothing too proprietary here. It should be possible to adapt and run elsewhere. A quick first pass to explain the vars. This is running the common (unmodified) docker distribution registry. The config file is here: https://github.com/replicatedhq/ttl.sh/blob/master/registry/config.yml. Most of those variables are subst'ed using sed into that file at build time. So these are documented in the docker/distribution docs for the version we have. The ephemeral parts of TTL.sh are implemented via a separate app ("reaper", in the repo). When an image is pushed to the main distribution, a web hook is fired to a trivial process where we write the image name/expiration to a redis database. The "reaper" process just reads from the redis database, and removes the image from the registry. The HOOK_TOKEN, and HOOK_URI are specific to your reaper. The token is a random string for security (you don't want anyone deleting images). And the HOOK_URI defines where docker distribution will fire the messages to. Sorry there aren't better docs on self hosting this yet! |
@marccampbell |
Yes. This sounds right. TTL.sh is a pretty simple tool! |
@marccampbell What do y'all set for REPLREG_HOST, REPLREG_SECRET ? I am using the same hosting method as yours right now for the sake of simplicity and understand that replreg is also the name of the bucket. Is the REPLREG_HOST the url to the GCS bucket ? How do I generate the REPLREG_SECRET ? |
I am getting the following error on the hooks server as well
What is the redis setup and configuration you are using on heroku over here ? Where do you have your redis instance deployed ? I understand that's what the REDIS_CLOUD env var is for. |
It would be really nice if there was a |
@spkane my team uses ttl.sh and have created a docker-compose at our org level fork https://github.com/UffizziCloud/ttl.sh/blob/main/docker-compose.yaml |
Thanks! I'll take a look. |
I was trying to setup ttl.sh on my own system, but got stuck since there are no clear steps documented to do so.
This is what I tried.
docker run
:docker run -itd ttlsh:v1
-> got this errorSet GCS_KEY_ENCODED variable configuration error: error parsing /etc/docker/registry/config.yml: yaml: line 16: mapping values are not allowed in this context
docker run -itd -e PORT=5000 -e GCS_KEY_ENCODED=Z2NzCg== -e REPLREG_HOST=0.0.0.0 -e REPLREG_SECRET=secret ttlsh:v1
-> got errorpanic: invalid character 'g' looking for beginning of value
What is the correct way to run it. There are lot of env variables defined in entrypoint.sh, what those each variables means?
variables: PORT,HOOK_TOKEN, HOOK_URI, REPLREG_HOST, REPLREG_SECRET, GCS_KEY_ENCODED.
The text was updated successfully, but these errors were encountered: