Custom Filesystem Publishing REST

15 views
Skip to first unread message

Pablo DePaulis

unread,
Nov 22, 2023, 8:16:27 PM11/22/23
to aptly-discuss
Hi,
  I've been trying to get the syntax correct for a custom filesystem publishing but doesn't seem to work, at least not using curl.

Version: aptly version: 1.5.0+ds1-1+b4 on Debian 12
So, I have something like this as custom filesystem for publishing:
```
"FileSystemPublishEndpoints": {
   "FPBX17-qa-web": {
   "rootDir": "/var/www/html/FPBX17-qa",
   "linkMethod": "hardlink",
   "verifyMethod": ""
}
```
and I have a local "aptly-repo"
and the curl post is as follows:
```
$ curl -X POST -H 'Content-Type: application/json' --data '{"SourceKind":"local","Sources":[{"Name":"aptly-repo"}],"Architectures":["all","amd64"],"Distribution":"bookworm"}' http://localhost:8080/api/publish/filesystem:FPBX17-qa-web
```
and I get NO error

I also tried just changing the URL: http://localhost:8080/api/publish/.:FPBX17-qa-web

but nothing gets posted, i.e. this comes empty:
```
$ curl http://localhost:8080/api/publish
[]
```
btw, it actually work with an S3 bucket using the S3: syntax as in the document, but for some reason the custom filesystem syntax with RESTful I haven't been able to figure out.

Any help is appreciated!

Happy Thanksgiving those in the US!

Thx, Pablo


Pablo DePaulis

unread,
Nov 27, 2023, 5:12:44 PM11/27/23
to aptly-discuss
Ok so, I think I got it working by just adding a "prefix" to the URL, i.e. the json data is the same as shown in my previous message, but the URL now changed to:


Of course that is just a dummy prefix, but the point being, it appears one must pass a prefix.

The response will give an output like this:
[{"AcquireByHash":false,"Architectures":["all","amd64"],"ButAutomaticUpgrades":"","Distribution":"bookworm","Label":"","NotAutomatic":"","Origin":"","Path":"filesystem:FPBX17-qa-web:fpbx17/bookworm","Prefix":"my-prefix","SkipContents":false,"SourceKind":"local","Sources":[{"Component":"main","Name":"aptly-repo"}],"Storage":"filesystem:FPBX17-qa-web","Suite":""}]

I can see the packages from the repo become accessible via the, in this case: http://localhost/FPBX17-qa/

Hope it helps!
  Pablo
Reply all
Reply to author
Forward
0 new messages