From b089afe8fe0c17c003b72bbea856f9232bc04176 Mon Sep 17 00:00:00 2001 From: JaegerwaldDev <86529399+JaegerwaldDev@users.noreply.github.com> Date: Wed, 3 Jan 2024 00:59:09 +0100 Subject: [PATCH] updated bastioncmd api --- api/cmd/LICENSE | 21 +++++ api/cmd/index.html | 185 +++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 200 insertions(+), 6 deletions(-) create mode 100644 api/cmd/LICENSE diff --git a/api/cmd/LICENSE b/api/cmd/LICENSE new file mode 100644 index 0000000..4146d79 --- /dev/null +++ b/api/cmd/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Bastion + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/api/cmd/index.html b/api/cmd/index.html index 7fe2446..d384009 100644 --- a/api/cmd/index.html +++ b/api/cmd/index.html @@ -4,18 +4,191 @@ BastionCMD API - + - Oh hey. This is the directory used for hosting BastionCMD data. -

- Files:
+

Oh, hello! This is the API for BastionCMD. + It is used to host files for actions that need to frequently change, without the program needing to download an update.

+

This API is, like the client, fully open source! So you can host it yourself, if Bastion doesn't exist anymore. + (Which hopefully won't happen any time soon...)

+ +

JSON API Files:

-
- v1.0 • Licensed under the • © BastionMC 2024 + +

How to host the API yourself (Using GitHub Pages)

+
+ 1. + + Download BastionCMD's source, and unzip the folder. + Copy the server folder to a location where you can keep it temporarily. + +
+
+ 2. + + Create a GitHub Pages Repository. + After you've done that, use git to clone that repository to your device. + Delete all the files that are in the repository folder. + +
+
+ 3. + + Open the server folder that you have saved. Hit CTRL + A to select all files, then use CTRL + X to cut all the files. + +
+
+ 4. + + Open your repository folder, and use CTRL + V to paste the server files in your repository. + +
+
+ 5. + + Commit your changes to the repository, then push them. + You'll have to wait a bit for GitHub Pages to update, so go to your site's URL and hit refresh until you see this page. + Done! The API should work now. + +
+ +

This tutorial was last updated on the 3rd of January, 2024.

+ +

Get the client to use your API

+

The client will still use the old API. + We'll have to modify the client's code to redirect it to the server you have just created. + Don't worry, this should be easy; even for someone who doesn't know how to code.

+
+ 1. + + Go to the unzipped folder that you've downloaded before. + Now copy the client folder, and paste it somewhere, where you can find it again, so you can use it later. + +
+

(You can, alternatively, also modify the already exisiting client. + Just navigate to it's folder - the tutorial will still work.)

+
+ 2. + + In the client folder, you'll see a whole bunch of files. + We're looking for one named server.py. + Open this file in a text editor of your choice. (Notepad also works.) + +
+
+ 3. + + Locate the line that says server_url = "...". + Change the URL in the quotation marks to your server's URL. + Don't forget to add the / at the end, its important! + +
+
+ 4. + + Now we'll test if everything works. + If you are on Windows, run the start.bat file. + If you are on Linux, run the main.py file. + Select one of the actions marked with an !, those are the ones that use internet. + If they start up without any problem, then congratulations! + Your API is now interacting with the client. + +
+ +

This tutorial was last updated on the 3rd of January, 2024.

+ + \ No newline at end of file