captnbp / docker-squid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project to deploy Squid with docker

Introduction

Install and run an Squid instance with docker.

You can use LDAP authentication or like an open proxy

By default, if you don't set environment variable, Squid is on open proxy mode

Deploy witch CLI

Deploy Squid on open proxy mode

docker run --name squid --hostname squid -p 3128:3128 -d captnbp/squid

Deploy Squid with LDAP Authentication

LDAP

docker run --name squid --hostname squid -e LDAP_ENABLE=true -e LDAP_HOST=yourldap.domain.com -e LDAP_PORT=389 -e LDAP_DN="ou=Users,dc=yourdomain,dc=com" -e LDAP_ATTRIBUT="uid=%s" -e PROXY_NAME="Proxy Display Name" -p 3128:3128 -d captnbp/squid

LDAPS

docker run --name squid --hostname squid -e LDAP_ENABLE=true -e LDAP_HOST=yourldap.domain.com -e LDAP_PORT=636 -e LDAP_DN="ou=Users,dc=yourdomain,dc=com" -e LDAP_ATTRIBUT="uid=%s" -e PROXY_NAME="Proxy Display Name" -p 3128:3128 -d captnbp/squid

## Set TLS for HTTPS_PORT

To set TLS on the proxy port, you neet to enable HTTPS_PORT_ENABLE=true and provide the SERVER_TLS_CERT_PATH with a pem file containing in the following order:

  • server key
  • server crt
  • CA crt

The exposed port will be 8443.

Deploy with docker-compose

You can deploy squid docker with docker-compose.

Deploy Squid on open proxy mode

version: '3.2'

services: 
  squid:
    image: captnbp/squid
    container_name: squid
    hostname: squid
    ports:
      - "3128:3128"
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    restart: always

Deploy Squid with LDAP Authentication

LDAP

version: '3.2'

services: 
  squid:
    image: captnbp/squid
    container_name: squid
    hostname: squid
    ports:
      - "3128:3128"
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    environment: 
      - LDAP_ENABLE=true
      - LDAP_HOST=yourldap.domain.com
      - LDAP_PORT=389
      - LDAP_DN="ou=Users,dc=yourdomain,dc=com"
      - LDAP_ATTRIBUT="uid=%s"
      - PROXY_NAME="Proxy Display Name"
    restart: always

LDAPS

version: '3.2'

services: 
  squid:
    image: captnbp/squid
    container_name: squid
    hostname: squid
    ports:
      - "3128:3128"
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    environment: 
      - LDAP_ENABLE=true
      - LDAP_HOST=yourldap.domain.com
      - LDAP_PORT=636
      - LDAP_DN="ou=Users,dc=yourdomain,dc=com"
      - LDAP_ATTRIBUT="uid=%s"
      - PROXY_NAME="Proxy Display Name"
    restart: always

To deploy, just run the following command on the same directory as file

docker-compose up -d

Environment varibales

LDAP_ENABLE

It use to enable LDAP Authentication. By default, it is set to false To enable, just set to true

LDAP_ENABLE=true

LDAP_HOST

Only use if LDAP_ENABLE is set to true

Specifies the LDAP host to contact for authentication. In the form of DNS names or IP addresses

LDAP_HOST=yourldap.domain.com

LDAP_PORT

Only use if LDAP_ENABLE is set to true

Specifie the LDAP server port. By convention :

  • 389 to LDAP
  • 636 to LDAPS
LDAP_PORT=636

LDAP_DN

Only use if LDAP_ENABLE is set to true

Specifies Distinguish Name where user is registered

LDAP_DN="ou=Users,dc=yourdomain,dc=com"

LDAP_ATTRIBUT

Only use if LDAP_ENABLE is set to true

Specifies LDAP attribut for users authentication

LDAP_ATTRIBUT="uid=%s"

PROXY_NAME

Only use if LDAP_ENABLE is set to true

Set Display Name for your proxy

PROXY_NAME="Your Proxy Display Name"

About


Languages

Language:Shell 75.3%Language:Dockerfile 24.7%