-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor hierarchy model classes and update file whitelist
Refactored hierarchy model classes in Gml.Web.Panel including new FileNode and FolderNode classes. Enhanced functionality to handle file whitelist including adding and removing files. Simplified README.md instructions for Gml Web API setup, included changes in Docker usage instructions. Updated other related files and methods as per the changes.
- Loading branch information
1 parent
ebcf71e
commit ffec1f9
Showing
15 changed files
with
213 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,24 @@ | ||
1. First, download the image: | ||
``` | ||
docker pull ghcr.io/gamervii-net/gml-web-api:master | ||
``` | ||
# Setup and Configuration of the Gml Web APi | ||
|
||
2. Check that the image has been downloaded: | ||
``` | ||
docker images | ||
``` | ||
### Step 1: Cloning the Repository | ||
Run the following command in your terminal: | ||
``` | ||
git clone --recursive https://github.com/GamerVII-NET/gml-web-api.git | ||
``` | ||
|
||
3. Configure the image: | ||
``` | ||
docker exec -it CONTAINER_ID bash | ||
``` | ||
### Step 2: Navigating into the project directory | ||
Run the following command in your terminal: | ||
``` | ||
cd gml-web-api | ||
``` | ||
|
||
4. Run the service: | ||
``` | ||
docker run -p 5000:8080 ghcr.io/gamervii-net/gml-web-api:master | ||
``` | ||
### Step 3: Running the Project Using Docker | ||
Run the following command in your terminal: | ||
``` | ||
docker-compose up | ||
``` | ||
|
||
5. Confirm that the server is running: | ||
``` | ||
info: Microsoft.Hosting.Lifetime[14] | ||
Now listening on: http://[::]:8080 | ||
... | ||
``` | ||
After executing the command, Docker will download the necessary images and start the project. Once the project is running, you can open it in a browser using the returned address. | ||
|
||
6. Enter the Docker OS, replacing CONTAINER_ID in the command: | ||
``` | ||
docker exec -it CONTAINER_ID bash | ||
``` | ||
|
||
7. Install the necessary components: | ||
``` | ||
apt-get update && apt-get install wget unzip curl nano -y | ||
``` | ||
8. Change the project name: | ||
``` | ||
nano /app/appsettings.json | ||
``` | ||
Press CTRL+X, then Y, and Enter. | ||
9. Restart the Docker container: | ||
``` | ||
docker restart CONTAINER_ID | ||
``` | ||
# Installing the client from an external file | ||
1. Create a profile. | ||
2. Enter the Docker OS, replacing CONTAINER_ID in the command: | ||
``` | ||
docker exec -it CONTAINER_ID bash | ||
cd /root/PROJECT_NAME/clients/ | ||
wget LINK_TO_ZIP_FILE | ||
unzip Client.zip | ||
rm -Rf Client.zip | ||
``` | ||
Please note that you should have Docker installed and running on your computer to execute this command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace GmlAdminPanel.Models.GmlApi; | ||
|
||
|
||
public class FileWhiteListDto | ||
{ | ||
public string ClientName { get; set; } | ||
public string FileHash { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,33 @@ | ||
namespace Gml.AdminPanel.Models.Hierarchy; | ||
|
||
public class File | ||
public class FileNode : Node | ||
{ | ||
public string Name { get; set; } | ||
public string Directory { get; set; } | ||
public long Size { get; set; } | ||
public string Hash { get; set; } | ||
public GmlApi.File CurrentFile { get; set; } | ||
} | ||
|
||
public class Folder | ||
public class FolderNode : Node | ||
{ | ||
public string Name { get; set; } | ||
public List<Folder> Subfolders { get; set; } | ||
public List<File> Files { get; set; } | ||
|
||
} | ||
|
||
public class Root | ||
public class Node | ||
{ | ||
public List<File> Files { get; set; } | ||
public List<Folder> Folders { get; set; } | ||
public string Name { get; set; } | ||
public string Directory { get; set; } | ||
public long Size { get; set; } | ||
public string Hash { get; set; } | ||
public Node Parent { get; set; } | ||
public List<FileNode> Files { get; set; } | ||
public List<FolderNode> Folders { get; set; } | ||
|
||
public string GetHierarchyPath(Node node) | ||
{ | ||
if (node == null) | ||
return string.Empty; | ||
|
||
if (node.Parent == null) | ||
return node.Directory; | ||
|
||
return string.Concat(GetHierarchyPath(node.Parent), "\\", node.Directory); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.