Add more to HTTPS protocol

This commit is contained in:
Arthur Beck 2025-03-18 20:30:46 -05:00
parent 2b03779aa7
commit a636855716
No known key found for this signature in database
GPG key ID: ACE3D14F5CEF14BF
2 changed files with 16 additions and 2 deletions

View file

@ -8,4 +8,12 @@ All paths used are relative to the path provided by the user.
## Pulling
To start out communication, the client will attempt to access the file `.venus/VERSION`. It will then verify that it supports the specified protocol and version, before getting `.venus/default/BRANCH` and `.venus/default/MOD`. It will then get the specified branch file and retrieve each mod, populating it's own `.venus/MOD_ORDER`. It will then apply each mod's object(s) to it's own local copy of the repo.
To start out communication, the client will attempt to access the file `.venus/VERSION`. It will then verify that it supports the specified protocol and version, before getting `.venus/default/BRANCH` and `.venus/default/MOD`. It will then get the specified branch file and retrieve each mod, populating it's own `.venus/MOD_ORDER`. It will then apply each mod's object(s) to it's own local copy of the repo. After this, it will get `.venus/branches/LIST` and loop through each branch, getting the branches, mods, and objects.
## Fetching
Similar to git, Venus supports fetching(the process by which mods are recieved but objects are not). In this scenario, all that is done is verifying that the server is still up with `.venus/VERSION` before getting the branch file, checking if the local branch is up-to-date, and if not, downloading the modules but not the objects.
## Pushing
Pushing is achieved by simply creating POST requests to the necessary files and using HTTP basic authentication with a user-provided username and password to change the files. To prevent race conditions, the server MUST lock modifications to a specific IP address plus username and password combination when the file `.venus/LOCK` is updated with any body, and unlocked after either a timeout of 5 seconds since the last request from this combination or the file `.venus/UNLOCK` is updated with any body.

View file

@ -10,13 +10,14 @@ object: A file storing differences from the previous mod.
.venus/objects: Object files(specified in [OBJECTS.md](./OBJECTS.md)) with the extension of `.venus-object`. They are named after the SHA512 hash stored in the object truncated to 16 characters and then the hexadecimal unix timestamp in nanoseconds of the object's creation. For example, `cf83e1357eefb8bd182e06194db125d7.venus-object` would be an object file with completely empty content created on Tuesday, March 18, 2025 at 10:26:52 PM GMT. This string of hexadecimal characters is also used to identify the mod.
.venus/branches: Branch files(specified in [BRANCHES.md](./BRANCHES.md)) with the extension of `.venus-branch`. They are named after the branch name(i.e. `main.venus-branch`), meaning that branch names have to be unique.
.venus/branches/LIST: A file listing all branches, each on it's own line
.venus/mods: Mods files(specified in [MODS.md](./MODS.md)) with the extension of `.venus-mod`. They are named with the SHA512 hash of them truncated to 16 characters and concatenated to the unix timestamp in hex of their creation date.
.venus/mods/NEW_MOD.venus-mod: A file similar to git's `COMMIT_MSG` file. Staging file while the user is creating a new mod.
.venus/active/BRANCH: A file containing only the active branch name.
.venus/active/MOD: A file containing only the active mod file name without the extension.
.venus/MOD_ORDER: A file containing a list of all mods with their respective branches in chronological order with oldest first(in the format `(branch name): (mod name)`). This excludes the file extension.
Files used by clients attempting to access remote HTTPS Venus repositories:
Files accessed by clients attempting to access remote HTTPS Venus repositories:
.venus/mods
.venus/objects
@ -24,3 +25,8 @@ Files used by clients attempting to access remote HTTPS Venus repositories:
.venus/default/BRANCH: A file containing only the default branch name.
.venus/default/MOD: A file containing only the default mod file name without the extension.
.venus/VERSION: A file containing the version of the files. This should be in the format `(name and version of protocol used)_(name and version of program that created the files)`, i.e. `venus-0.1_venus-0.1.0`.
Files stored by clients locally to store remote info:
.venus/mods/remote: A folder containing modules that don't have their corrosponding objects locally
.venus/REMOTES: A file containing a list of remotes in `(name): (url)` pairs.