🌱 Tollport
Tollport is self-hosted software that lets you host, manage, and share Docker compatible images without the restrictions that other services do. Keep full control, set fine-grained permissions, and even sell your images through your own marketplace.
Tollport is at a pre-release version of 0.5 right now. It's being actively worked on and more features are added each week. Right now, you can use all of the fundamental features of the software. Quality of life patches will be released to get us to version 1.
Simple, quick setup
The easiest way to get Tollport up and running is by using a docker compose file like this:
services:
registry:
image: distribution/distribution:3
ports:
- "5500:5000"
environment:
REGISTRY_AUTH_TOKEN_SERVICE: tollport-registry
REGISTRY_AUTH_TOKEN_ISSUER: tollport
REGISTRY_AUTH_TOKEN_JWKS: /var/lib/registry/jwks.json
REGISTRY_NOTIFICATIONS_ENDPOINTS_0_NAME: tollport
REGISTRY_NOTIFICATIONS_ENDPOINTS_0_URL: http://web:3000/registry-notification
REGISTRY_LOG_LEVEL: info
OTEL_TRACES_EXPORTER: none
OTEL_METRICS_EXPORTER: none
OTEL_LOGS_EXPORTER: none
env_file: .env
volumes:
- registry_data:/var/lib/registry
depends_on:
web:
condition: service_healthy
networks:
- external_network
- internal_network
web:
image: tollport.shane.computer:5500/tollport:latest
ports:
- "3832:3000"
env_file: .env
networks:
- external_network
- internal_network
volumes:
- registry_data:/rails/registry_data
- tollport_storage:/rails/storage
healthcheck:
test: ['CMD-SHELL', "curl -s --noproxy localhost localhost:3000/up | grep -q 'green' || exit 1"]
interval: 60s
start_period: 2s
start_interval: 1s
depends_on:
- database
database:
image: postgres:17.4
environment:
- 'POSTGRES_HOST_AUTH_METHOD=trust'
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- internal_network
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
volumes:
registry_data:
postgres_data:
tollport_storage:
networks:
external_network:
internal_network:
internal: true
And then with you configuration in a .env file:
# railsy bits DATABASE_URL="postgres://postgres:somepass@database/tollport_production" POSTGRES_PASSWORD=somepass RAILS_ENV=production SECRET_KEY_BASE=some_key_base ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY=generate with bin/rails db:encryption:init ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY=generate with bin/rails db:encryption:init ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT=generate with bin/rails db:encryption:init TOLLPORT_USE_SSL=true # tollporty bits TOLLPORT_HOSTNAME=yourdomain.com TOLLPORT_REGISTRY_ADDRESS=yourdomain.com:5500 TOLLPORT_REGISTRY_URI=http://registry:5000 # emaily bits SMTP_SERVER=... SMTP_PORT=587 SMTP_LOGIN=... SMTP_PASSWORD=... SMTP_AUTH_METHOD=plain SMTP_ENABLE_STARTTLS=true SMTP_FROM_ADDRESS="notifications@example.com" # stripey bits STRIPE_API_KEY=your-stripe-key # distrubution bits REGISTRY_AUTH_TOKEN_REALM=http://yourdomain.com/auth/token REGISTRY_HTTP_SECRET: do-a-bit-of-keyboard-bashing
Then, set up your nginx (etc) server configuration to point both services to a hostname.
upstream tollport {
server 127.0.0.1:3832 fail_timeout=0;
}
upstream tollport_registry {
server 127.0.0.1:5000 fail_timeout=0;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 5500 ssl;
server_name tollport.shane.computer;
location / {
proxy_pass http://tollport_registry;
}
}
server {
server_name tollport.shane.computer;
access_log /var/log/nginx/tollport.access.log;
location / {
proxy_pass http://tollport;
# Preserve client headers for Rails
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /cable {
proxy_pass http://tollport;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Avoid buffering for WebSockets
proxy_read_timeout 3600;
proxy_send_timeout 3600;
proxy_buffering off;
}
}
After that, you should be good to go!