Registry

8 months ago

Description: Self Hosted Docker Registry

Category: Storage

URL: https://railway.app/template/FCYzGQ

6 Replies

sarzixonPRO

7 months ago

Anyone tried to add basic http authentication to this template?


rutuserPRO

2 months ago

Im trying to do the same. Any insights for this?


rutuserPRO

2 months ago

Alright got it working. Just need to ssh into the service and install htpasswd into the volume's path. You will also have to add some envs to the service. Let me know if you want the steps for this.


rutuser

Alright got it working. Just need to ssh into the service and install htpasswd into the volume's path. You will also have to add some envs to the service. Let me know if you want the steps for this.

2 months ago

Even though you mentioned the volume, it's likely you also made changes to the ephemeral filesystem and thus your changes will not persist between deployments.

I'm sure steps would be very helpful, but only if you can confirm that the changes will persist between deployments.


rutuserPRO

2 months ago

I've mounted the htpasswd file into the volume so it should persist between deployments. Just redeployed the service and the auth is still working as expected.

Steps:

- SSH into the service. You'll have to use the railway cli for this. First link your service running railway link and then run railway ssh.
- Install htpasswd running apk add --no-cache apache2-utils.
- Create the htpasswd file into the volume mount running htpasswd -Bbc /var/lib/registry/htpasswd <username> <password>. The volume was mounted at /var/lib/registry. Keep that in mind in case this changes. You can check the volume mount path inspecting the volume settings. Don't forget to change the username and password

- Lastly add this envs to the registry service:

  • REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm

  • REGISTRY_AUTH_HTPASSWD_PATH=/var/lib/registry/htpasswd

  • REGISTRY_AUTH=htpasswd


brody

Even though you mentioned the volume, it's likely you also made changes to the ephemeral filesystem and thus your changes will not persist between deployments.I'm sure steps would be very helpful, but only if you can confirm that the changes will persist between deployments.

rutuserPRO

2 months ago

Just a quick question. I'm using this custom registry to deploy a new service. Is this supported in Railway? I'm asking because it seems that the service is stuck in creating container for 15 minutes. Not showing any build logs.

Thanks in advance!


Registry - Railway Help Station