From 02fd280693bea701cbf7603ddbf881817f4962c9 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 4 Jul 2025 23:10:58 +0530 Subject: [PATCH 1/3] fix(docker): Fixed Maven download failure in dev docker builds, removed redundant files and fixed broken link Maven download link is now changed to `repo.maven.apache.org`. MacOS docker build instruction file has been removed as it is live in the docs page. Broken link to docs about running Drifty in docker has been fixed and now points to Drifty docs. Signed-off-by: Saptarshi Sarkar --- Docker/dev/CLI/Dockerfile | 2 +- Docker/dev/GUI/Dockerfile | 2 +- Docker/dev/commons/base/Dockerfile | 2 +- Docker/macOS Docker Build Instructions.md | 116 ---------------------- 4 files changed, 3 insertions(+), 119 deletions(-) delete mode 100644 Docker/macOS Docker Build Instructions.md diff --git a/Docker/dev/CLI/Dockerfile b/Docker/dev/CLI/Dockerfile index 9fe2380c9..307ae8844 100644 --- a/Docker/dev/CLI/Dockerfile +++ b/Docker/dev/CLI/Dockerfile @@ -3,7 +3,7 @@ FROM drifty-base:latest AS build LABEL org.opencontainers.image.title="Drifty CLI (Development)" LABEL org.opencontainers.image.description="Drifty is an Open-Source Interactive File Downloader System built with Java" LABEL org.opencontainers.image.source="https://github.com/SaptarshiSarkar12/Drifty" -LABEL org.opencontainers.image.documentation="https://github.com/SaptarshiSarkar12/Drifty?tab=readme-ov-file#using-docker--for-development" +LABEL org.opencontainers.image.documentation="https://drifty.vercel.app/docs/usage/docker/drifty-in-docker" LABEL org.opencontainers.image.licenses="Apache-2.0" LABEL org.opencontainers.image.vendor="Saptarshi Sarkar" diff --git a/Docker/dev/GUI/Dockerfile b/Docker/dev/GUI/Dockerfile index 2fb1e94a4..c6fbe70ad 100644 --- a/Docker/dev/GUI/Dockerfile +++ b/Docker/dev/GUI/Dockerfile @@ -3,7 +3,7 @@ FROM drifty-base:latest AS build LABEL org.opencontainers.image.title="Drifty GUI (Development)" LABEL org.opencontainers.image.description="Drifty is an Open-Source Interactive File Downloader System built with Java" LABEL org.opencontainers.image.source="https://github.com/SaptarshiSarkar12/Drifty" -LABEL org.opencontainers.image.documentation="https://github.com/SaptarshiSarkar12/Drifty?tab=readme-ov-file#using-docker--for-development" +LABEL org.opencontainers.image.documentation="https://drifty.vercel.app/docs/usage/docker/drifty-in-docker" LABEL org.opencontainers.image.licenses="Apache-2.0" LABEL org.opencontainers.image.vendor="Saptarshi Sarkar" diff --git a/Docker/dev/commons/base/Dockerfile b/Docker/dev/commons/base/Dockerfile index e029d1f52..5d82bd116 100644 --- a/Docker/dev/commons/base/Dockerfile +++ b/Docker/dev/commons/base/Dockerfile @@ -17,7 +17,7 @@ ARG MAVEN_VERSION # Certificates are not checked to avoid issues with SSL. Both the domains are trusted and are not malicious. # Also, this is a development environment and not a production environment. -RUN wget --progress=bar:force --no-check-certificate https://dlcdn.apache.org/maven/maven-${MAVEN_MAJOR}/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz && \ +RUN wget --progress=bar:force --no-check-certificate https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${MAVEN_VERSION}/apache-maven-${MAVEN_VERSION}-bin.tar.gz && \ wget --progress=bar:force --no-check-certificate https://download.oracle.com/graalvm/${GRAALVM_VERSION_MAJOR}/latest/graalvm-jdk-${GRAALVM_VERSION_MAJOR}_linux-x64_bin.tar.gz && \ tar -xzf apache-maven-*.tar.gz -C /opt && \ tar -xzf graalvm-jdk-*.tar.gz -C /opt &&\ diff --git a/Docker/macOS Docker Build Instructions.md b/Docker/macOS Docker Build Instructions.md deleted file mode 100644 index 28e1ae225..000000000 --- a/Docker/macOS Docker Build Instructions.md +++ /dev/null @@ -1,116 +0,0 @@ -# Using the Drifty GUI Docker image on macOS - -There are some steps to follow if you're going to run the Drifty GUI Docker image in macOS. At the end of these instructions, we will have a single command that we can run to start the Docker image. - -## Prerequisites - -You will need these programs to follow these instructions: - -- [**Docker**](https://docs.docker.com/desktop/install/mac-install) -- [**HomeBrew**](https://brew.sh/) -- **Socat** (will be installed later in the instructions) -- **XQuartz** (will be installed later in the instructions) - -## Installing the necessary programs and building/pulling the Docker image - -Once you have Docker installed **(and running)**, open the terminal and follow these steps: - -- Update the local Homebrew repository and upgrade any outdated installations. This ensures that any libraries that might be needed will be up-to-date. - ```bash - brew update - brew upgrade - ``` -- Install `Socat` and `XQuartz` - ```bash - brew install socat - brew install xquartz - ``` -- If you are going to build **Drifty GUI** Docker image using your changed source code, then run this command in the directory where the project files are present: - ```bash - docker compose build gui - ``` -- If you are going to use the pre-built **Drifty GUI** Docker image from [**GitHub Container registry releases**](https://ghcr.io/saptarshisarkar12/drifty-gui), then run this command: - ```bash - docker pull ghcr.io/saptarshisarkar12/drifty-gui:master - ``` - Remember to change the tag to the version/branch you want to use. - -## Running the Docker image of Drifty GUI - -After the Docker image of Drifty GUI has been built/pulled, we need to provide a pathway for the Docker instance to access the display. This can be done by providing it the IP address of your Mac. For simplicity and ease of use, manually (or statically) assigning an IP address to your Mac is suggested. - -> [!NOTE] -> ->
-> -> Why static IP address is preferred for running Drifty GUI in Docker on macOS? -> -> Now that the image is built/pulled, we need to talk about how the GUI itself is going to be shown on your desktop. The only real relevant issue here pertains to your local IP address assigned to your network interface card on your Mac. You see, in a Linux environment (which macOS is modeled after), programs that run in the Terminal do not have direct access to your graphical environment (Graphical User Interface), so we are going to have to provide the Docker instance with a pathway to access the GUI and that has to be done by telling it what your local IP address is. -> -> On most home networks, the typical setup is to have a router where your computer is connected to the LAN (Local Area network) side of the router either via Wi-Fi or an Ethernet cable. And most people just make that connection, find that they can access the Internet and don't look back. -> -> We, however, need to look back... -> -> Routers use a service called DHCP (Dynamic Host Control Protocol) which uses a reserved pool of IP addresses. If any device connects to your network and when it is set up to use DHCP (which is always the default), it will send out a broadcast packet onto your network asking for an IP address. Your router will see that request, then it will take out an IP address from its pool, and it will give it to your device so that your device can talk on your network, access the Internet, etc. -> -> DHCP services are also designed to make that assigned IP address expire after some time (usually three days). In case a device that was on the network is no longer on the network, it can pull that IP address back and put it into the pool so that it doesn't run out of IP addresses. This means that it is possible your local IP address might change in a short period of time. We cannot build a command to run Drifty when your IP address is changing because docker needs to send the graphics to a known IP address. -> -> There are usually two generic ways to refer to your local ip address in a linux or Windows environment. The first way is to simply use the word `localhost` and the second way is to use the default home IP address of `127.0.0.1`. Unfortunately, neither of those generics will work in this case, so we have to give the command the exact IP address of your Mac. -> ->
- -### Manually assigning an IP address to your Mac - -We first need to know the IP address that the router has assigned to your Mac. Most of the routers will use an IP address that starts with `192.168` so let's see if we have that kind of address assigned to our Mac, by running this command: - -```bash -ifconfig | grep 192.168 -``` - -You should see something like this: - -> inet 192.168.1.123 netmask 0xffffff00 broadcast 192.168.1.255 - -The **IP address** that is after the word `inet` will be the address that your router assigned to your Mac. Since that address exists in the router's pool of IP addresses, so we cannot statically assign that address to your Mac. So I recommend assigning an address that is lower in value which has a better chance of being outside the router's address pool. I would use an address like `192.168.1.10`, so we will go with that. - -If you are not running at **_least macOS version 13 (Ventura)_**, then refer to [**this article**](https://www.macinstruct.com/tutorials/how-to-set-a-static-ip-address-on-a-mac/) to get the instructions for **statically assigning your IP address**. Otherwise, follow these instructions: - -- Go to `System Settings` by clicking on the Apple logo in the top left corner of your screen. -- Click on `Network` then click on your network adapter. - ![Network Settings' screenshot](https://github.com/SaptarshiSarkar12/Drifty/assets/105960032/f0a5f45e-4467-4b49-b35f-fb068bb928b2) -- Click on `Details` - ![Details of Network Adapter](https://github.com/SaptarshiSarkar12/Drifty/assets/105960032/21fd8165-82b7-4ef0-9ff3-996589cb1814) -- Now you need to change `Configure IPv4` to `Manually` and then type your **static IP address**, **subnet mask** and **gateway**. The subnet mask will look exactly like I have it here, regardless of your ip address and your router will always be `.1` (in most cases) as shown here. - ![Configuring IPv4 manually](https://github.com/SaptarshiSarkar12/Drifty/assets/105960032/23cbe0aa-d744-4bee-b980-3dcc0ff38f66) -- Click `OK` and then go back to your Terminal. - -### Change the XQuartz settings - -A small change in XQuartz is necessary for running **Drifty GUI** via _Docker_. Follow these steps: - -- Open **XQuartz** by running this command: - ```bash - open -a Xquartz - ``` -- When XQuartz loads, you will see a window that looks like this: - ![XQuartz initial window](https://github.com/SaptarshiSarkar12/Drifty/assets/105960032/081ab4f4-1274-43db-8697-1a997ed42e30) -- Click on the XQuartz menu at the top left of your screen just next to the Apple logo and select `Settings`. Click on the `Security` tab and then check `Allow connections from network clients` as shown below: - ![XQuartz Security window](https://github.com/SaptarshiSarkar12/Drifty/assets/105960032/691ee7f2-cf3e-4ac5-a00b-9a81ffa642b8) - -### Commands to run the Docker image - -We have finally set up everything required to run the Docker image of **Drifty GUI**. Now, we need to run the following commands in the Terminal: - -- If you want to run the **pre-built** docker image, then run these commands: - ```bash - socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"& - open -a Xquartz - docker run -e DISPLAY=192.168.1.10:0 ghcr.io/saptarshisarkar12/drifty-gui:master - ``` - Remember to change the tag to the version/branch you want to use. -- If you want to run the **docker image built from your changed source code** (by using `docker compose`), then run these commands: - ```bash - socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"& - open -a Xquartz - docker compose run -e DISPLAY=192.168.1.10:0 gui - ``` From cc7b2ad8db1fce62651170002cc3de62def42e05 Mon Sep 17 00:00:00 2001 From: Saptarshi Sarkar Date: Fri, 4 Jul 2025 23:52:09 +0530 Subject: [PATCH 2/3] fix: Fixed linter issue by applying prettier Signed-off-by: Saptarshi Sarkar --- Website/content/usage/cli/downloading-files-cli.md | 2 ++ Website/content/usage/gui/downloading-files-gui.mdx | 1 + 2 files changed, 3 insertions(+) diff --git a/Website/content/usage/cli/downloading-files-cli.md b/Website/content/usage/cli/downloading-files-cli.md index fd81c0d43..72f248ad9 100644 --- a/Website/content/usage/cli/downloading-files-cli.md +++ b/Website/content/usage/cli/downloading-files-cli.md @@ -13,6 +13,7 @@ Drifty CLI allows you to download files from the internet using a simple command ![Download Options Prompt](https://github.com/user-attachments/assets/c41e73d3-5181-4d20-b708-4d3c63ded67f) 3. Enter the URL of the video you want to download. 4. After validating the URL, Drifty will prompt you to choose a download destination folder. Enter + - `.` if you want to download the video in the default download directory (which is `user_home/Downloads{:sh}` in most cases). - `L` if you want to use the last used directory. - the absolute path of the directory where you want to save the video, e.g., `/home/user/Videos{:sh}`. @@ -42,6 +43,7 @@ Drifty CLI allows you to download files from the internet using a simple command ``` ![Batch File Prompt](https://github.com/user-attachments/assets/86d884ff-dd4c-40f1-a6b6-e2f3d98411e0) 4. The batch file will be processed, and if any of those files exist with the same name, or you have previously downloaded any, you will be prompted to skip or re-download them. + - Enter `Y` to continue downloading the file. A new file name will be generated, and you will be prompted to confirm the file name. - Enter `N` to skip downloading the file. diff --git a/Website/content/usage/gui/downloading-files-gui.mdx b/Website/content/usage/gui/downloading-files-gui.mdx index 79be91fc2..e9bf9a8cf 100644 --- a/Website/content/usage/gui/downloading-files-gui.mdx +++ b/Website/content/usage/gui/downloading-files-gui.mdx @@ -14,6 +14,7 @@ Drifty GUI allows you to download files from the internet with just a few clicks /> 4. If you have previously downloaded the file or a file with the same name exists in the download directory, Drifty will prompt you to skip or re-download the file. + - Click on **Yes** to continue downloading the file with a new name. You can rename the file by editing the textbox in the popup window. ![File rename textbox](https://github.com/user-attachments/assets/8aa593bb-e683-4eb4-aac6-bac7f9f355e2) - Click on **No** to skip downloading the file. From 53f02a384a84db4e66188a43dc6d473f04af4535 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Jul 2025 18:23:18 +0000 Subject: [PATCH 3/3] style: format codebase --- Website/content/usage/cli/downloading-files-cli.md | 2 -- Website/content/usage/gui/downloading-files-gui.mdx | 1 - 2 files changed, 3 deletions(-) diff --git a/Website/content/usage/cli/downloading-files-cli.md b/Website/content/usage/cli/downloading-files-cli.md index 72f248ad9..fd81c0d43 100644 --- a/Website/content/usage/cli/downloading-files-cli.md +++ b/Website/content/usage/cli/downloading-files-cli.md @@ -13,7 +13,6 @@ Drifty CLI allows you to download files from the internet using a simple command ![Download Options Prompt](https://github.com/user-attachments/assets/c41e73d3-5181-4d20-b708-4d3c63ded67f) 3. Enter the URL of the video you want to download. 4. After validating the URL, Drifty will prompt you to choose a download destination folder. Enter - - `.` if you want to download the video in the default download directory (which is `user_home/Downloads{:sh}` in most cases). - `L` if you want to use the last used directory. - the absolute path of the directory where you want to save the video, e.g., `/home/user/Videos{:sh}`. @@ -43,7 +42,6 @@ Drifty CLI allows you to download files from the internet using a simple command ``` ![Batch File Prompt](https://github.com/user-attachments/assets/86d884ff-dd4c-40f1-a6b6-e2f3d98411e0) 4. The batch file will be processed, and if any of those files exist with the same name, or you have previously downloaded any, you will be prompted to skip or re-download them. - - Enter `Y` to continue downloading the file. A new file name will be generated, and you will be prompted to confirm the file name. - Enter `N` to skip downloading the file. diff --git a/Website/content/usage/gui/downloading-files-gui.mdx b/Website/content/usage/gui/downloading-files-gui.mdx index e9bf9a8cf..79be91fc2 100644 --- a/Website/content/usage/gui/downloading-files-gui.mdx +++ b/Website/content/usage/gui/downloading-files-gui.mdx @@ -14,7 +14,6 @@ Drifty GUI allows you to download files from the internet with just a few clicks /> 4. If you have previously downloaded the file or a file with the same name exists in the download directory, Drifty will prompt you to skip or re-download the file. - - Click on **Yes** to continue downloading the file with a new name. You can rename the file by editing the textbox in the popup window. ![File rename textbox](https://github.com/user-attachments/assets/8aa593bb-e683-4eb4-aac6-bac7f9f355e2) - Click on **No** to skip downloading the file.