Skip to main content

Samba Bridge Client

How to install and setup the Samba Bridge Client

Welcome to the setup guide for the Samba Bridge Client. This document will walk you through the following steps:

The Samba Bridge creates a connection between your local machine and the 4ALLPORTAL system over WebSocket.

Samba/SMB is a useful alternative to WebDAV in a cloud environment (technical details).

Note that the Samba Bridge Client is still a beta version.


Installation

You can install the Samba Bridge Client either centrally or locally. You can use either Docker or a binary file for the installation.

Note that a local installation is only supported for Linux/macOS (due to Windows SMB port reservation).

Central installation on a server or VM (admin setup)

With a central installation, the Samba Bridge runs on a server within the same network as the end users. Users can connect via hostname or IP and port.

Advantages:

  • Only one installation is required.

  • All users in the same network can use the bridge.

Limitations:

  • Only works inside the internal network.

  • External users need VPN or similar access.

Local installation on an end user machine (user setup)

With a local installation, the Docker container or binary is run directly on each user’s machine (Linux/macOS only).

Advantages:

  • Works even if the user is not in the internal network.

  • Perfect for external users or partner companies.

Limitations:

  • Requires user setup.

  • Not supported for Windows

  • Requires admin rights to install Docker or run the binary.


Installation with Docker

You can run the Samba Bridge Client using Docker. You can use a Docker Compose or Docker Run.

Example Values

  • Make sure to replace the listening port, <your-api-key> and <host> with your actual listening port, API key and 4ALLPORTAL host (URL).
    An API key can be generated by an 4ALLPORTAL administrator (details).

  • If you’re unsure about the correct variable values, ask your system administrator or contact the 4ALLPORTAL support team.

Docker Compose Example

version: "3.3"

services:
samba-bridge-client:
image: registry.4allportal.net/samba-bridge-client:0.0.2
container_name: samba-bridge-client
ports:
- "8883:8883" # Listening port
- "80:80"
- "433:443"
environment:
- BRIDGE_LISTEN=:8883
- BRIDGE_VERBOSE=
- BRIDGE_UUID_TOKEN=<your-api-key>
- BRIDGE_REMOTE_WS_URL=wss://<host>/smb

Docker Run Example

If you prefer to run the container using a single command instead of Docker Compose, use the following:

docker run -d --name samba-bridge-client -p 8883:8883 -p 80:80 -p 433:443 -e BRIDGE_LISTEN=:8883 -e BRIDGE_VERBOSE= -e BRIDGE_UUID_TOKEN=<your-api-key> -e BRIDGE_REMOTE_WS_URL=wss://<host>/smb registry.4allportal.net/samba-bridge-client:0.0.2


Installation with Binary

You can as well run the Samba Bridge Client using a binary file.

Example Values

  • Make sure to replace the listening port, <your-api-key> and <host> with your actual listening port, API key and 4ALLPORTAL host (URL).
    An API key can be generated by an 4ALLPORTAL administrator (details).

  • If you’re unsure about the correct variable values, ask your system administrator or contact the 4ALLPORTAL support team.

1. You need to download the binary file from one of these 4ALLPORTAL URLs:

2. Make the binary executable with this command (only Linux and Mac):

chmod +x samba-bridge-client

3. Run it with the following flags:

Linux/Mac:

 ./samba-bridge-client --verbose --uuid-token="<your API key>" --listen=":8883" --remote-ws-url="wss://<host>/smb"


Windows:

.\samba-bridge-client.exe --verbose --uuid-token="<your API key>" --listen=":8883" --remote-ws-url="wss://<host>/smb"


Samba Bridge updates

How the Samba Bridge is updated depends on whether you used Docker or binary for installation.


Update with Docker

1. Stop the running Docker container:

docker-compose down

2. Pull the latest image from the 4ALLPORTAL registry:

docker pull registry.4allportal.net/samba-bridge-client:latest

3. Restart the container:

docker-compose up -d

Update with Binary

If you're using the binary version, just re-download it from the correspondent 4ALLPORTAL URL (find the list here) and replace the old file.


Configuration

The Samba Bridge Client is configured using environment variables (Docker) or flags (binary). You can use them to set up and configure the Samba Bridge:

Environment Variable
(Docker)

Flag

(binary)

Description

BRIDGE_LISTEN

--listen

Port the Samba Bridge listens on (e.g., :8883)

BRIDGE_VERBOSE

--verbose

Enables debug output (optional)
values: true/false

BRIDGE_UUID_TOKEN

--uuid-token

API key for authentication

BRIDGE_REMOTE_WS_URL

--remote-ws-url

The WebSocket URL to your 4ALLPORTAL instance
format: wss://<host>/smb


Token creation (API Key)

To authenticate with the 4ALLPORTAL, you need a valid API key (UUID token). A 4ALLPORTAL administrator can create an API key in admin snap-in
Administration > Developer > API > API Key Settings.

This API key can be copied into the BRIDGE_UUID_TOKEN variable or binary flag.


How to connect: Mapping the network drive

Once the Samba Bridge is running, users can connect to the SMB share via their operating system's built-in file browser:

  • Use the IP or hostname of the machine running the Samba Bridge

  • Use the listening port (e.g., 8883)

  • Provide your 4ALLPORTAL username and password when prompted


Networking explanation

The Samba Bridge is a Golang project that facilitates the forwarding of a WebSocket stream contents to a Samba server.


It consists of two main components: A server that handles WebSocket connections and forwards data to a Samba server, and a client that accepts TCP streams (SMB) from clients like macOS Finder or Windows Explorer.

  • The client connects via WebSocket (wss://<host>/smb) to the 4ALLPORTAL system.

  • It then exposes the file share locally on the listening port.

  • You can connect as if it's a regular SMB network share.

This architecture allows for:

  • Secure and efficient forwarding of SMB traffic over WebSocket connections.

  • Access to multiple cloud-based Samba resources as if they were on the local network.

  • Flexible routing capabilities, enabling scenarios such as load balancing, multi-tenancy, or accessing geographically distributed Samba servers.

The Samba Bridge Server's routing capability makes it a powerful tool for managing complex Samba server infrastructures while providing a simple, local network-like experience for end-users.

Key ports

  • Listening Port (e.g., 8883): The local port used to expose the SMB bridge.

  • 80 & 443: Required for internal bridge communication. Should be open on firewalls if required.


Support

If you encounter issues or need credentials, please contact your system administrator or 4ALLPORTAL support team.

Did this answer your question?