Skip to content

Github Management

ThaPwned edited this page Oct 15, 2020 · 2 revisions

Warcraft: Source allows you to install certain races and items (which can be found on the content repository) directly on the server with a simple click. To enable this, you have to install PyGithub and all of its dependencies. Once you've installed PyGithub properly, you can start using the functionality. However, as there's a limit (60 for unauthenticated and 5000 for authenticated) to the amount of requests, that gets reset once an hour, it is therefore recommended to use it while being authenticated. To do so, you'll have to edit cfg/source-python/wcs/github.json. By default, it'll look like this:

{
    "username": null,
    "password": null,
    "access_token": null,
    "repositories": []
}

You can use either username and password or access_token to enable the Github functionality. Either method requires you to have a Github account. Your username and password is just the username and password you use to login to Github. To generate an access token, while being logged in on your Github account, go to Settings -> Developer settings -> Personal access tokens. From there, you press Generate new token. Give the token a description, so you can remember what it's used for. You then enable public_repo and press the green Generate token at the bottom. Copy your newly created token in the access_token key. Once you've done one of these steps, it'd look something like this (note the single quotes around the newly added text):

{
    "username": "myusername",
    "password": "mypassword",
    "access_token": "1q2w3e4r5tfaketoken6y7u8i9o0p",
    "repositories": []
}

When you have done this, add yourself as an wcsadmin by enabling the wcsadmin and wcsadmin_githubaccess privileges. Restart the server, and you should have access to it. repositories is used if you have a separate repository with races or items you want to use together with the default. As an example on how to add repositories, we use the default one, which is located at github.com/ThaPwned/WCS-Contents:

    "repositories": ["ThaPwned/WCS-Contents"]

And that is it. If you were to add multiple repositories, remember to add a comma (,) after each new repository you're going to add except the last one:

    "repositories": ["ThaPwned/WCS-Contents", "MyImaginary/Repository", "NotRealRepository/Hopefully"]
Clone this wiki locally