Compare commits
No commits in common. "3641acf94ad45c2a7e67d97c8a2a6ef046516781" and "5c8db180d05f61f304faff90d811a2c9b8dc6f2b" have entirely different histories.
3641acf94a
...
5c8db180d0
4 changed files with 6 additions and 15 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,4 +1,4 @@
|
|||
/config/config.json
|
||||
/config/
|
||||
/data/
|
||||
/modules/__pycache__
|
||||
/whitelist/paths.txt
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<b>For setup:</b><br>
|
||||
For setup:
|
||||
Run the setup.py file and follow the instructions.
|
||||
After this you should find some file named /whitelist/pterodactyl.txt there you need to insert the server id(s) of the server(s) you want to sync the whitelist with and the path for the whitelist (should be 'whitelist.json' for Minecraft). The server's id is the first part of its UUID / Docker Container ID or just https://[your-panel-url]/server/[this part] on its dashboard site.
|
||||
Finally, you just have to create a new schedule in your pterodactyl panel to execute the command <code>whitelist reload</code> every now and then to update the sync the whitelist on your server.
|
||||
After this you should find some file named /whitelist/pterodactyl.txt there you need to insert the server id(s) of the server(s) you want to sync the whitelist with and the path for the whitelist (should be 'whitelist.json' for Minecraft). The server's id is the first part of its UUID / Docker Container ID or just https://[your-panel-url]/server/[this part]
|
||||
|
||||
<b>Pterodactyl API-key:</b><br>
|
||||
Pterodactyl API-key:
|
||||
You have to go to https://[your-panel-url]/admin/api and create a new key. Read and Write acces for Servers should be enough but I recommend just checking it for every category. You also need to specify a description. You then want to go to https://[your-panel-url]/account/api and create another key, there you have to insert the same description as before. This is the key you need to copy and then use for your setup.
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"discord": [
|
||||
{
|
||||
"token": "discord bot token",
|
||||
"pterodactyl_domain": "https://panel.pterodactyl.com/",
|
||||
"pterodactyl_apikey": "user api key"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -93,4 +93,5 @@ async def syncWhitelistPterodactyl(whitelist):
|
|||
|
||||
async def pterodactylWriteFile(serverid, path, data, apikey):
|
||||
url = f'{init.config().get_pterodactyl_domain()}api/client/servers/{serverid}/files/write?file={urllib.parse.quote(path)}'
|
||||
requests.post(url, data=data, headers={"Accept": "application/json", "Authorization": f"Bearer {apikey}"})
|
||||
requests.post(url, data=data, headers={"Accept": "application/json", "Authorization": f"Bearer {apikey}"})
|
||||
print('Whitelist abgeschickt')
|
||||
Loading…
Add table
Reference in a new issue