-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
only hardcode one url in updater #46
Comments
So I suggest a {
"posts": "https://unvanquished.net/api/get_recent_posts/",
"game": {
"version": "0.51.1",
"torrent": "https://cdn.unvanquished.net/unvanquished_0.51.1.torrent"
},
"updater": {
"version": "0.0.5",
"zip": {
"linux-amd64": "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterLinux.zip",
"macos-amd64": "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterOSX.zip",
"windows-amd64": "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterWin.zip"
}
}
} Note the url are unique ones, we can because we would be able to properly produce the json file server side, the same way we already have to do it for the |
So I wrote a tool named This
|
Sounds good. Where can we see this publish.sh and friends? |
it's currently stored in server, we may have to make a git repo for those |
We should. It should be easy. |
This is the current proposal (see https://cdn.unvanquished.net/current.json): {
"newsfeed": {
"urls": [ "https://unvanquished.net/api/get_recent_posts/" ],
"format": "wordpress-json-recent-posts"
},
"game": {
"name": "Unvanquished",
"version": "0.51.1",
"parcels": {
"universal": {
"urls": [ "https://cdn.unvanquished.net/unvanquished_0.51.1.torrent" ],
"content": "mixed-files",
"container": "torrent"
}
}
},
"updater": {
"version": "0.0.5",
"parcels": {
"linux-amd64": {
"urls": [ "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterLinux.zip" ],
"content": "single-binary",
"container": "zip"
},
"windows-amd64": {
"urls": [ "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterWin.zip" ],
"content": "single-binary",
"container": "zip"
},
"macos-amd64": {
"urls": [ "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterOSX.zip" ],
"content": "single-macos-appdir",
"container": "zip"
}
}
}
} Note that Thinking about them helped me to design a format that would be future-proof and enable us to change many things in future updaters without breaking the format itself. For example we may also think about including Also the |
For a start, updater would only have to read that: {
"newsfeed": {
"urls": [ "https://unvanquished.net/api/get_recent_posts/" ]
},
"game": {
"version": "0.51.1",
"parcels": {
"universal": {
"urls": [ "https://cdn.unvanquished.net/unvanquished_0.51.1.torrent" ]
}
}
},
"updater": {
"version": "0.0.5",
"parcels": {
"linux-amd64": {
"urls": [ "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterLinux.zip" ]
},
"windows-amd64": {
"urls": [ "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterWin.zip" ]
},
"macos-amd64": {
"urls": [ "https://github.com/Unvanquished/updater/releases/download/v0.0.5/UnvUpdaterOSX.zip" ]
}
}
}
} |
After having implemented it in #78, this is the current format: {
"news": {
"version": "rolling",
"mirrors": [ "https://unvanquished.net" ],
"parcels": {
"all-all": {
"path": "api/get_recent_posts",
"content": "raw",
"container": "json"
}
}
},
"game": {
"version": "0.51.1",
"mirrors": [ "https://cdn.unvanquished.net" ],
"parcels": {
"all-all": {
"path": "unvanquished_0.51.1.torrent",
"content": "mixed-files",
"container": "torrent"
}
}
},
"updater": {
"version": "0.0.5",
"mirrors": [ "https://github.com/Unvanquished/updater/releases/download/v0.0.5" ],
"parcels": {
"linux-amd64": {
"path": "UnvUpdaterLinux.zip",
"content": "single-file",
"container": "zip"
},
"windows-i686": {
"path": "UnvUpdaterWin.zip",
"content": "single-file",
"container": "zip"
},
"macos-amd64": {
"path": "UnvUpdaterOSX.zip",
"content": "single-directory",
"container": "zip"
}
}
}
} The format is meant to use a same reusable function for both news, updater and the game, it would even works if we added an option to download a level editor or things like that as an addition. Keys like Support of mirrors is not implemented but nothing in the format prevents to do it one day. |
Currently, those url are hardcoded in updater:
versions.json
)Once the updater is built and ship, we loose all control on those url, and we are vulnerable to any change or redirect (some parts in updater does not support redirects for sure), for example github may redirect the HTTP url to HTTPS and may break the updater update.
The idea would be to only hardcode one url in updater (basically a json file like
version.json
one) and put the other ones in that json file.Note that our web server already knows the full path to the latest updater, so we may store the full updater url in that json file instead of a prefix url. That would also allow us to quit github, change the zip name, or do strong things like that.
I suggest to extend the
versions.json
file (perhaps under another name).Edit: Here is the new ones: http://cdn.unvanquished.net/current.torrent
The text was updated successfully, but these errors were encountered: