proved that I could manage the protocol with something that was faked,
starting to try to serve something for real. The idea is that you would
have a directory that contains all of your module zips, and the mir
server would serve modules from that directory, and it would query that
directory to find out which versions were available and which were
latest.
I'm not sure about the version list and retractions. It seems like if a
module is retracted you still want it to be in the list of available
modules, and that a retraction is not signaled by the absence of that
version in the list endpoint, but by the module file of the latest
version itself.
/srv/mir
└── modules
└── orel.li
└── mir@v0.0.0-pre1.zip
this doens't work if os.TempDir and the current directory are in
different filesystems because it's a cross-filesystem move. Annoying af
honestly. I think I have to use zip.Create instead of zip.CreateFromDir
and handle the file exclusion myself.
I could in theory create the zip into memory and then write it to avoid
CreateFromDir trying to circularly zip up its own output but I don't
like that.
ok so there are some problems when you're creating the archive but
you're at the root of the project. Namely, the mod package tries to put
the zip inside of itself. So we have to go around that by creating the
zip somewhere else and moving it. This is the first step in that
process.