Simrep is a simple repository service. It is aim for single hobbyists or small startups/teams which don't need huge alternatives and for on-prem needs.
- Intented for private use ;
- No database and no UI ;
- A single secret key for uploading and a single secret key for downloading.
Download the latest release from the releases page and put it in a folder where your files and data will be stored.
You can configure simrep by three ways:
PORT
is the port number simrep will listen ;PROXY
unused for now, is passed to express trust proxy setting ;SECRET_UPLOADER
is the secret key for uploading and downloading files ;SECRET_DOWNLOADER
is the secret key for only downloading files;
Create a .env
files in the same folder as the simrep binary and edit it with
the same variable as the environment ones like this:
PORT=3100
SECRET_UPLOADER=your_secret_key
SECRET_DOWNLOADER=your_secret_key
Starts the server with ./simrep
. Use a systemd
script, PM2
or an
equivalent to manage the life of simrep. Achieve HTTPS and/or logs with a
reverse proxy like nginx or caddy.
All calls must provide a key in the key
query parameters in the url. For
example: http://localhost/api/upload?key=myKey
. The server responds in JSON
with a structure similar to the Google Style Guide,
following the apiVersion
, context
and error
properties and some others.
Uploads a new file in the repository. Need the SECRET_UPLOADER
key.
- Must be in
multipart/form-data
; - Body should have a
project
,filename
andfile
fields:project
is the name of your project ;filename
is the name of your file on the server ;file
is your file.
project
andfilename
should only containsa-zA-Z0-9.-_
characters.
Example to upload a file with curl:
$ curl -F project=myproject -F filename=project-1.0.0.deb -F file=@build.deb https://repo.example.com/api/upload?key=my_uploader_key
Returns a list of all projects. Example of response:
{
"apiVersion": "1.0",
"data": {
"kind": "projects",
"totalItems": 3,
"currentItemCount": 3,
"items": [
"project1",
"project2",
"superProject"
]
}
}
Lists all files for a project. Example of response:
{
"apiVersion": "1.0",
"data": {
"kind": "files",
"totalItems": 3,
"currentItemCount": 3,
"items": [
"latest.zip",
"project-1.0.0.zip",
"project-1.0.1-amd64.exe"
]
}
}
Downloads a file.