@aeppic/install-repository-server

3.44.0 • Public • Published

Intro

@aeppic/install-repository-server installs the a repository server to host binary files compatible with @aeppic/install-server

It automatically registers (installs) the service as a SystemD service under /etc/systemd/system but does not enable or start it yet.

It is as simple as possible, directly contained in this module, and just copies itself to the install location. An install requires the service to not already run, existing data never gets touched.

Installing a custom repository server is only required when running accessing the curasystems registry is not possible.

Uploaded files should follow the naming convention <PACKAGE_NAME>@<VERSION>.tgz.

Security

Upload and Download is only possible if the correct token is available. These are stored in JSON files see below.

API

Launch example server

  • PORT=8881
  • DATA_PATH=test
  • UPLOAD_TOKENS=upload.json
  • DOWNLOAD_TOKENS=download.json

node server.js

Upload a new file

<filepath> equals a path to a packaged file <PACKAGE_NAME>@<VERSION>.tgz. E.g. my-package@1.0.2.tgz.

Note: The path can include directories, but only the filename is used in the uploaded name.

curl -XPOST -H "Authorization: Bearer <TOKEN_FROM_UPLOAD_TOKENS_JSON>" --form file=@<filepath> http://localhost:8881

Download

curl -H "Authorization: Bearer <TOKEN_FROM_DOWNLOAD_TOKEN_JSON>" http://localhost:8881/<filename>

Tag a file

<tagname> is the name of the tag to use. It is a string with at least 3 characters and starting with a letter

curl -XPOST -H "Authorization: Bearer <TOKEN_FROM_UPLOAD_TOKENS_JSON>" http://localhost:8881/<filename>/tags/<tagname>

List all known files

curl -H "Authorization: Bearer <TOKEN_FROM_DOWNLOAD_TOKEN_JSON>" http://localhost:8881/

Which returns a json with all known files and dirs in the data folder. This list includes the uploaded files as well as uploaded tags. The tags are named <PACKAGE_NAME>@<TAG> and contain the name of the file it points to.

Readme

Keywords

none

Package Sidebar

Install

npm i @aeppic/install-repository-server

Weekly Downloads

30

Version

3.44.0

License

MIT

Unpacked Size

4.88 MB

Total Files

54

Last publish

Collaborators

  • matthiasg