Skip to content
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

Open
illwieckz opened this issue Aug 28, 2019 · 4 comments

Comments

@illwieckz
Copy link
Member

commented Aug 28, 2019

Currently, those url are hardcoded in updater:

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 redirects the http url to https and may breaks 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).

@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Aug 28, 2019

So I suggest a release.json file with a content like that:

{
    "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 versions.json file.

@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Aug 29, 2019

So I wrote a tool named announce.sh which is expected to live alongside existing get.sh and publish.sh.

This announce.sh tool reads a config file and produces this:

@slipher

This comment has been minimized.

Copy link

commented Aug 29, 2019

Sounds good. Where can we see this publish.sh and friends?

@illwieckz

This comment has been minimized.

Copy link
Member Author

commented Aug 29, 2019

it's currently stored in server, we may have to make a git repo for those

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.