Full documentation: Chemotion docs, data transfer (self-contained lab-staff version in this repository: docs/chemotion-data-transfer.md).
ShuttleBuilder is a Django application that builds Shuttle for each lab and serves it as a download. Shuttle is a small Go program that watches a folder on a lab PC and uploads new data via WebDAV or SFTP to an intermediate storage, from where the Electronic Lab Notebook (ELN) Chemotion collects it. A third transfer type, ChemAssistent, uploads to a ChemAssistentManager job instead (see ChemAssistent upload).
The application works independently of Chemotion but is designed to operate as a service for it. Users log in with their Chemotion password and abbreviation; superusers can also create local users in the admin.
Lab PCs are physically separated from public networks for security reasons, so data must be forwarded to the ELN through an intermediary system. Shuttle is one part of it: it sends device data to the intermediate storage. Each Shuttle is built for its lab (source folder, destination, credentials, security options), so installing it takes only a few steps.
Contents: Install | After the installation | Security | Windows XP | Preprocess scripts | Admins | Chemotion docs
Supported: Windows x64 and i386 (including Windows XP) and Linux x64. Installing needs administrative rights.
- Create the instance. In the Shuttle list click the new-instance button and fill in the Shuttle instance form for your WebDAV or SFTP server (or for a ChemAssistentManager job).
- Download it from the Shuttle list. Depending on the options you get a single executable or a zip file. Every zip contains an
INSTALL.txtwith the steps for exactly this instance (it never contains passwords, users or host keys). - Install it as described below.
- Create the folder
C:\Program Files\Shuttle. - Copy
shuttle.exeinto it (for a zip: all files exceptINSTALL.txt). - Download shuttle_task.vbs (also linked in the app's documentation page and in
INSTALL.txt) and copy it into the startup folder: press Windows key + R, typeshell:startup, press Enter. - Restart the computer, or double-click
shuttle_task.vbsonce.
The .vbs file starts C:\Program Files\Shuttle\shuttle.exe hidden at every login.
Use the zip shuttle_sftp_winxp.zip. It contains shuttle.exe and a portable WinSCP. Install it like Windows above, but copy all files (shuttle.exe, WinSCP.exe, WinSCP.com, license.txt) into C:\Program Files\Shuttle. WinSCP must stay next to shuttle.exe. See Windows XP.
Shuttle is installed as a systemd service, one unit per instance.
- Set the field Linux user of the instance: the user whose home folder holds the working folder.
- Create
/opt/Shuttleand copyshuttleinto it (for a zip: all files exceptINSTALL.txt). Make the programs executable (chmod +x /opt/Shuttle/shuttle, and/opt/Shuttle/ChemConverterAppif the instance has a converter). - Click the systemd unit button of the instance in the Shuttle list and save the file as
/etc/systemd/system/shuttle.service. (Generic fallback:/sdc_view/main_app/download/shuttle.service.) If it containsUser=CHANGE_ME, replaceCHANGE_MEwith the Linux user. - Run:
systemctl daemon-reload systemctl enable --now shuttle.service
Working folder. Shuttle creates ~/shuttle/shuttle_<name>/ (Windows: %USERPROFILE%\shuttle\shuttle_<name>\), where <name> is the instance name. It holds:
shuttle_log.txt, the log (the first place to look when something does not work);sent_register.json, the list of files already handed over (path relative to the source folder, modification time and size);known_hosts(SFTP only, see Security).
What gets sent.
- A file is sent when it is new or has changed since it was last sent, has not been modified for the configured duration, and is not locked by another program.
- Folder-based transfer types (folder, zip, tar): a folder is sent when at least one of its files is new or changed and all of its files have been unchanged for the duration. A changed folder is always sent again completely.
- First start: every stable file already in the source folder (older than the duration) is sent once. Plan for the traffic, and for duplicates on the server if the data was already transferred another way. The same happens when the register is empty or missing.
- Resend everything: stop Shuttle, delete
sent_register.json, start Shuttle. A damaged register is moved aside assent_register.json.corrupt-<time>and Shuttle starts with an empty one.
Outages. Network problems are never fatal. If the server cannot be reached (also at boot, before the network is up) the error is logged and the upload is retried with increasing waits (up to the duration). Files stay in the working folders until the server confirmed the upload.
Stopping. On Linux systemd stops Shuttle cleanly (SIGTERM); files not yet sent are sent after the next start. Shuttle exits on configuration errors (e.g. an unreadable ~/shuttle/scripts folder, or a missing ChemConverterApp when the converter is enabled); the reason is in the log.
Each instance has three optional settings that control how the server is verified.
Shuttle checks the server certificate with the system root certificates plus an optional certificate file. A server with a self-signed or private certificate needs that certificate (or its CA) as the instance's server certificate (PEM); this works the same for WebDAV and ChemAssistent. Without it, uploads fail until it is set; files wait and are sent once the connection works.
The certificate is shipped as server.crt next to the executable, so the download becomes a zip file. Keep server.crt next to shuttle.exe / shuttle: Shuttle looks for it there first. If the certificate was added after you installed Shuttle, download the zip again and replace the files. An unreadable certificate file is logged as a warning.
- Pinned: enter the server's fingerprint as SSH host key (
SHA256:..., optionally with the WinSCP prefix such asssh-ed25519 255 SHA256:..., orMD5:aa:bb:...). Shuttle then only connects to a server presenting exactly this key. Get the fingerprint in WinSCP (Session > Server/Protocol Information) or withssh-keyscan -p <port> <host> | ssh-keygen -lf -(use theSHA256:...value). The host key applies to both SFTP destinations (main and converter), so they must be the same server. - Trust on first use (no host key entered): Shuttle trusts the key it sees on the first connection and stores it in
known_hostsin the working folder. If the server later presents a different key, Shuttle refuses to connect and logs which key it saw. If the change is intended (for example a reinstalled server), delete the server's line fromknown_hosts, or set the SSH host key.
Switches off TLS and SSH host key verification and logs a warning. Any user can set it. The instance list marks such instances with a red "Verification disabled" badge; SFTP instances without a host key show a "No host key" hint. Use it only for tests.
The transfer type ChemAssistent job (HTTP upload) sends each file (or each folder) to a ChemAssistentManager job by HTTP POST. Every upload starts one run of the job's AI agent, which gets the files as input.
- In ChemAssistentManager create a job with the trigger "HTTP file upload (API key)" and create an API key for it. The key is shown only once.
- In ShuttleBuilder create the Shuttle instance with the transfer type ChemAssistent job (HTTP upload). Enter the server URL as destination and the key (starts with
cam_) in the API key field (stored in the instance'spasswordfield). The user and the SSH host key are not used. If the administrator configuredCHEMASSISTENT_URL, the form pre-fills the destination and links to ChemAssistentManager. - Download and install the Shuttle as usual.
- Destination:
http://orhttps://with a host. Without a path (or with/)/api/jobs/triggeris appended; any other path is used as the full trigger URL. - Runs per Shuttle type:
fileandflat_tar: one run per file.zipandtar: one run per archive.folder: one run per folder with all its files; folder paths are flattened into the file names (A/B/x.csvbecomesA__B__x.csv). - Size limit: uploads larger than 100 MB are not attempted and stay local.
- Local files: a file is deleted locally only after the server confirmed the upload (
202). - Revoked key or disabled job: the files stay local and are sent when the problem is fixed. After a revoked key, give the instance a new key, build it and download it again, then replace the Shuttle on the PC.
- TLS: the server certificate and insecure work as for WebDAV. Windows XP builds speak at most TLS 1.2, so the server must offer TLS 1.2. Like WebDAV, a Windows XP build verifies the server only when a server certificate is given.
- Not supported: the converter (
ChemConverterApp) cannot be combined with this transfer type. - Zip or single file: the download is the plain executable; with a server certificate it is a zip with
server.crtandINSTALL.txt(no WinSCP). - The API key is never written to the Shuttle log or to
INSTALL.txt.
- XP builds are compiled with Go 1.10.8.
- SFTP: WinSCP is used for the transfer.
WinSCP.com(andWinSCP.exe) must be in the same folder asshuttle.exe; the zip contains them. Shuttle writes a short temporary script into its working folder, runsWinSCP.comonce per uploaded file and deletes the script afterwards. The password is not written to the log. At startup a connection check runs, so a missingWinSCP.comor a rejected host key shows up in the log immediately. - Host key: the host key is required for XP with SFTP (unless verification is disabled). It is compiled into
shuttle.exe. Without a host key WinSCP must already know the server's key (connect once with WinSCP on that PC and accept it), otherwise every upload fails; Shuttle logs a note at startup. - WebDAV / TLS: the XP build cannot read the Windows certificate store, so it verifies the server certificate only when the server certificate (
server.crt) is set. Without it, verification is off and a warning is logged at startup. - Not yet tested on real hardware: SFTP on a real Windows XP machine is still an open manual test (tracked as a Shuttle issue). Test it on your PC before relying on it.
Scripts in ~/shuttle/scripts (Windows: %USERPROFILE%\shuttle\scripts) run before each file is sent. They get one argument, the absolute path of the file, and may overwrite it or write a new copy in the same folder.
- Windows: only regular files with the extension
.exe(any case) run;.bat,.cmdand.shdo not. - Linux: every regular file with an execute bit runs, whatever its extension (a symlink to such a file too).
- Directories and hidden files (names starting with
.) never run. - A failing script or converter is logged; the conversion is skipped and the raw data is still sent.
Use the Docker image mstarman/shuttlebuilder. Environment variables:
MODE=prod
# The host URL via which the service can be accessed
ALLOWED_HOST=http://0.0.0.0
# Signs sessions and tokens: python -c "import secrets; print(secrets.token_urlsafe(50))"
DJANGO_SECRET_KEY=<long-random-value>
# The Chemotion URL, only needed if you want to mirror the user management
ELN_URL=https://eln.example.org
# Initial superuser
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_EMAIL=admin@example.org
DJANGO_SUPERUSER_PASSWORD=<choose-a-strong-password>
# Database
POSTGRES_DB=builder
POSTGRES_USER=postgres
POSTGRES_PASSWORD=<choose-a-strong-password>
POSTGRES_PORT=5432
POSTGRES_HOST=db
Compose files:
docker-compose.yml: the image from Docker Hub with PostgreSQL, Redis, the LAN broadcaster and pgAdmin.POSTGRES_PASSWORD,PGADMIN_DEFAULT_EMAILandPGADMIN_DEFAULT_PASSWORDhave no defaults and must be set in.env(see.env.sample). PostgreSQL and pgAdmin publish no ports; only the web port (PROJECT_WEB_PORT, default 80) is reachable from outside. For pgAdmin, start it on demand bound to localhost,docker compose run --rm -p 127.0.0.1:8080:80 pgadmin, and reach it through an SSH tunnel. Uploaded converter profiles and server certificates are kept in the volumeshuttle_media(/opt/media).docker-compose.p2d.yml: Push2Deploy (e.g. Dokploy). It builds the image from this repository and runs PostgreSQL and Redis as separate services.ALLOWED_HOST,DJANGO_SECRET_KEYandPOSTGRES_PASSWORDare required, the rest is optional (environment or.env). The app listens on container port 80 (Traefik ondokploy-network). The Shuttle checkout and the builds are not kept: after a redeploy the next download clones the activeGitInstanceagain.docker-compose.dev.ymlanddocker-compose.db.yml: local development.
The image contains two Go toolchains: Go 1.26.11 (GOROOT=/usr/local/go, on PATH) for all modern targets, and Go 1.10.8 for Windows XP (XP_GOROOT=/usr/local/go1.10.8, not on PATH; used in GOPATH mode). Both are pinned in the Dockerfile (GO_VERSION, XP_GO_VERSION, with checksums).
- In the git instance list, reload the active
GitInstance(or activate another one). This clones the repository again; the Shuttle version of the checkout (shuttle_version, read frommain.go) is shown in the list. - Every Shuttle instance is rebuilt on its next download. The Shuttle list shows the version each instance was last built with (
built_version, "not built yet" otherwise);INSTALL.txtnames it too. - Labs download their zip again, replace the executable and restart Shuttle (Windows: end the running
shuttle.exein the Task Manager, replace the file, then restart the PC or double-clickshuttle_task.vbs; Linux: replace the file, thensystemctl restart shuttle.service).
Announce the rollout first: after an update from Shuttle 1.12 or older, the first start sends every stable file in the source folder once (later updates keep sent_register.json) (see docs/announcement-shuttle-1.14.md).
python manage.py shuttle_smoke_build(inside the image, throw-away SQLite database) builds Shuttle for all six architectures and checks the results.dev/smoke_build.sh <image>runs it in a Docker image:dev/smoke_build.sh -hshows the options.- GitHub Actions:
.github/workflows/ci.ymlruns the tests;.github/workflows/smoke.ymlruns the smoke build against Shuttlemain. deploy.shbuilds the image, runs the smoke build and only deploys when it passes.
