Skip to main content

Lab_nas

Access a Synology NAS from Google Colab (or any headless Linux box) through a NetBird mesh network.

Lab_nas bundles two small pieces:

  • NetBird — starts the NetBird client in userspace (netstack) mode, connects with a setup key, and exposes a local SOCKS5 proxy. On Colab it keeps the peer identity in Google Drive, so every runtime reconnects as the same peer with the same NetBird IP.
  • Synology — a Synology File Station client that talks to DSM through that SOCKS5 proxy: browse, search, download (files and folders as .zip), and upload, with live progress bars.

Install

pip install Lab_nas

The NetBird binary itself is downloaded automatically the first time you call NetBird().start() (fetched from the official netbirdio/netbird GitHub releases).

Quick start (Google Colab)

from Lab_nas import NetBird, Synology

NetBird().start()                       # connect Colab to your NetBird network
nas = Synology('100.83.14.114')         # your NAS's NetBird IP
nas.login()                             # uses Colab secrets SYNO_USER / SYNO_PASS

nas.ls('/')                             # list shared folders
nas.find('*.xlsx', '/home/Drive')       # search by name
nas.download('/home/Drive/file.xlsx')   # download to /content
nas.download('/home/Drive/MyFolder')    # a folder arrives as MyFolder.zip
nas.upload('/content/file.xlsx', '/home/Drive')   # upload a local file

Secrets

In Colab, add these in the 🔑 sidebar (with Notebook access enabled). If a secret is missing you'll simply be prompted to type it.

Secret Meaning
NETBIRD_SETUP_KEY a reusable NetBird setup key
SYNO_USER DSM username
SYNO_PASS DSM password

Common operations

nb = NetBird(hostname='colab')          # customise the peer name
nb.start()
nb.status()                             # show NetBird status + proxy state
nb.log()                                # tail the NetBird log
nb.stop()

nas = Synology('100.83.14.114')
nas.login('admin', 'password')          # or pass credentials explicitly
nas.ls('/home')
nas.find('report*', '/home', max_depth=3)
nas.download_more(['/home/a.pdf', '/home/b.pdf'])
nas.download('/home/Photos', extract=True)   # download + unzip the folder
nas.upload('/content/out.csv', '/home/Drive', overwrite=True)
nas.logout()

Requirements

  • Linux (Colab counts). The NetBird binary published for linux_amd64 / linux_arm64 is used.
  • A running NetBird network and a setup key.
  • A Synology NAS reachable on your NetBird network, with an account that has File Station permission.

Notes

  • Runs NetBird in netstack (userspace) mode, so no tun device or kernel module is needed — which is exactly what makes it work inside Colab.
  • Synology often serves DSM with a self-signed certificate; TLS verification is disabled for the NAS session by design.
  • Synology Office files (.osheet, .odoc, .oslides) can only be opened in Synology Office — export to .xlsx/.docx on the NAS first if you need them elsewhere.

License

MIT — see LICENSE.

Release files for Lab-nas-v1 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Lab-nas-v1 0.1.0
File Size Uploaded
lab_nas_v1-0.1.0.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Lab-nas-v1 0.1.0
File Interpreter ABI Platform
lab_nas_v1-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / lab_nas_v1-0.1.0.tar.gz

Download URL lab_nas_v1-0.1.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6e309bcd2f5cdc9d58e8caccd492fd1194351f39e057dbb8c66d9cd8ab61b148
BLAKE2b-256 checksum
How to use checksums
9561291b72ecd22967c9588acca9778a78d087a18aac5c4227fee5e020a756ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / lab_nas_v1-0.1.0-py3-none-any.whl

Download URL lab_nas_v1-0.1.0-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26220ff3f5b9423882193bd60747a1bc0cc65939ef7eac81c258cca11229073e
BLAKE2b-256 checksum
How to use checksums
f7651904c8277457d39bf6bbf6d2b099ab9627cdcb6608a24f65953259ed06e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page