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:
PORTis the port number simrep will listen ;PROXYunused for now, is passed to express trust proxy setting ;SECRET_UPLOADERis the secret key for uploading and downloading files ;SECRET_DOWNLOADERis 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,filenameandfilefields:projectis the name of your project ;filenameis the name of your file on the server ;fileis your file.
projectandfilenameshould 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.