Debian, raw and curl
Create the repository first. Open Settings › Repositories › New repository, and choose the format Debian (apt) or Raw files.
Set up a project
Section titled “Set up a project”-
Open the repository in the web UI, then the Publish to this repository tab.
-
Click Set up a project, and confirm with your second factor.
-
Open a terminal in the project folder. Paste the line, then press Enter.
Terminal window curl -fsSL https://repo.example.com/install.sh | sh -s -- setup 'https://repo.example.com/#/setup/trsu_...'The CLI asks for the folder of a raw repository, or the distribution and the component of a Debian repository. It writes the answers to
telesphorepo.toml. -
Commit
telesphorepo.toml.
For a Debian repository named apt, the file is this:
server = "https://repo.example.com"repo = "apt"dist = "stable"component = "main"For a raw repository named files, path is the folder in the repository:
server = "https://repo.example.com"repo = "files"path = "app"Then publish the files with the CLI, on your computer or in CI:
telesphorepo publish my-package_1.0.0_amd64.debtelesphorepo publish app-1.2.0.tar.gzThe CLI sends a file of 64 MiB or more in parts, and sends a failed part again.
In CI, the CLI publishes with the identity token of the job. An admin adds a CI pipeline for the job first, as in Run the server. The Publish to this repository tab shows the CI files.
Publish tokens
Section titled “Publish tokens”To upload with curl, you need a publish token:
- Open Settings › Tokens, and click New publish token.
- Choose the repository, and click Continue.
- Confirm with your second factor, and click Create token.
- Copy the token. It starts with
trs_and works for 15 minutes.
Publish tokens are for accounts with a password and Publish on the repository. You can also upload in the browser: open the repository and click Upload.
Debian
Section titled “Debian”The examples use a Debian repository named apt.
-
Upload a package with
telesphorepo publish my-package_1.0.0_amd64.deb, or withcurl. The path names the distribution (stable) and the component (main). Paste the publish token at the hidden prompt, so it stays out of the shell history and the process list.Terminal window printf 'Publish token: '; read -rs TOKEN; echoprintf 'user = "publish:%s"\n' "$TOKEN" | curl -fsS -K - -T my-package_1.0.0_amd64.deb \https://repo.example.com/debian/apt/upload/stable/mainThe server builds and signs the indexes about 2 seconds later.
-
On each machine that installs, add the key and the source:
Terminal window sudo mkdir -p /etc/apt/keyringssudo curl -fsSL https://repo.example.com/debian/apt/key.asc -o /etc/apt/keyrings/telesphorepo.ascecho "deb [signed-by=/etc/apt/keyrings/telesphorepo.asc] https://repo.example.com/debian/apt stable main" \| sudo tee /etc/apt/sources.list.d/telesphorepo.list -
Install:
Terminal window sudo apt updatesudo apt install my-package
Private Debian repository
apt needs your username and a read token. Create the token under Settings › Tokens › New read token. It starts with trp_. Each command below asks for the token at a hidden prompt.
Download the key with the token:
printf 'Read token: '; read -rs READ_TOKEN; echoprintf 'user = "YOUR_USERNAME:%s"\n' "$READ_TOKEN" \ | sudo curl -fsSL -K - https://repo.example.com/debian/apt/key.asc -o /etc/apt/keyrings/telesphorepo.ascGive apt the token. The install command makes the file readable by root only before the token goes in. tee writes to the file only, not to the terminal.
printf 'Read token: '; read -rs READ_TOKEN; echosudo install -m 600 /dev/null /etc/apt/auth.conf.d/apt.confprintf 'machine %s login YOUR_USERNAME password %s\n' https://repo.example.com/debian/apt "$READ_TOKEN" \ | sudo tee -a /etc/apt/auth.conf.d/apt.conf > /dev/nullArchitectures and upload errors
A new Debian repository takes the architectures amd64 and arm64, and packages for all. Change the list in Architectures on the Format settings tab of the repository settings. An upload with another architecture fails. The server builds the package lists of an added architecture, and removes those of a removed one.
An upload of the same package and version with other bytes answers 409. Raise the version.
Raw files
Section titled “Raw files”A raw repository keeps any file at any path. The examples use a raw repository named files.
Upload with telesphorepo publish app-1.2.0.tar.gz, or with curl and a publish token:
printf 'Publish token: '; read -rs TOKEN; echoprintf 'user = "publish:%s"\n' "$TOKEN" | curl -fsS -K - -T app-1.2.0.tar.gz \ https://repo.example.com/raw/files/app/app-1.2.0.tar.gzDownload:
curl -fL -O https://repo.example.com/raw/files/app/app-1.2.0.tar.gzFor a private repository, give curl your username and a read token on stdin:
printf 'Read token: '; read -rs READ_TOKEN; echoprintf 'user = "YOUR_USERNAME:%s"\n' "$READ_TOKEN" \ | curl -fL -K - -O https://repo.example.com/raw/files/app/app-1.2.0.tar.gzReplace a file
By default, a raw repository refuses other bytes at a path that exists. It answers 409. To allow a replace, open the repository settings, then the Format settings tab. In Replace files, choose allow, then click Save.
Maven files with curl
Section titled “Maven files with curl”Upload a file to a Maven repository with a publish token:
printf 'Publish token: '; read -rs TOKEN; echoprintf 'user = "publish:%s"\n' "$TOKEN" | curl -fsS -K - -T my-lib-1.0.0.jar \ https://repo.example.com/maven/releases/com/example/my-lib/1.0.0/my-lib-1.0.0.jar