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

Fetch all URLs from a single URL, fix #46 #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

illwieckz
Copy link
Member

@illwieckz illwieckz commented Jan 19, 2021

Only one URL is hardcoded, which is a json file telling everything else.

The format is meant to be able to update the paths after a release, and to improve the updater to support multiple mirrors in the future. See #46

@slipher
Copy link
Contributor

slipher commented Jan 20, 2021

The overall concept is good. Besides permitting flexibility in the server configuration, this will be helpful when testing the updater.

However, I think some more work will be needed to correctly deal with the asynchronous nature of the versions.json request: the results are not always available when you want them. For example, if the game update page is opened while we still don't have the news URL (this will be especially important with the feature I am working on for Windows to relaunch as administrator, in which the splash screen will be skipped on the second launch).

@illwieckz
Copy link
Member Author

We may postpone the news part, right? For the updater and game URLs I don't believe this PR adds more issue than there was before since those URLs were computed from fetched version numbers anyway.

@slipher
Copy link
Contributor

slipher commented Jan 20, 2021

It doesn't introduce an issue for the updater URL, since updater update can only be initiated when the versions request has succeeded.

It does create new problems for the game update. The game URL actually doesn't depend on the version number currently.

@illwieckz
Copy link
Member Author

The game URL actually doesn't depend on the version number currently.

Ah, yes… 😕

@illwieckz
Copy link
Member Author

illwieckz commented Jul 23, 2024

So I rebased, and race conditions should now be avoided.

Here is an example of current.json: https://cdn.unvanquished.net/current.json

{
	"news": {
		"version": "rolling",
		"mirrors": [ "https://unvanquished.net" ],
		"parcels": {
			"all-all": {
				"path": "api/get_recent_posts",
				"content": "raw",
				"container": "json"
			}
		}
	},
	"game": {
		"version": "0.54.1",
		"mirrors": [ "https://cdn.unvanquished.net" ],
		"parcels": {
			"all-all": {
				"path": "unvanquished_0.54.1.torrent",
				"content": "mixed-files",
				"container": "torrent"
			}
		}
	},
	"updater": {
		"version": "0.2.0",
		"mirrors": [ "https://github.com/Unvanquished/updater/releases/download/v0.2.0" ],
		"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"
			}
		}
	}
}

This new file is already generated by default on release (I added generation code for it in release scripts in 2021 when I opened this PR).

Some command line changed, the --internalcommand updateupdater will reinstall the updater from the current known version if --updaterurl is not set, or the one from --updaterurl if provided.

The json file already supports multiple mirrors, but the updater code doesn't for now. In the future I want it to.

@illwieckz illwieckz force-pushed the currentjson branch 2 times, most recently from ef4580b to 14215fc Compare July 23, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants