diff --git a/.gitignore b/.gitignore
index eadc8da3..62d21a6b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,5 @@ debian/rclone-browser*
/release
/bs0.cmd
/src/*.autosave
+*.appimage
+Dockerfile.appimage
diff --git a/ACKNOWLEDGMENTS.md b/ACKNOWLEDGMENTS.md
new file mode 100644
index 00000000..3af9f2b4
--- /dev/null
+++ b/ACKNOWLEDGMENTS.md
@@ -0,0 +1,32 @@
+# Acknowledgments
+
+This project is a front end for [rclone](https://rclone.org/), which has had a profound effect on educational and research communities by allowing financially constrained students and researchers to utilize cloud storage while working across multiple computational servers and institutions. We are grateful to the rclone developers and community for creating such a powerful and accessible tool that enables this work.
+
+This project also uses the following external tools and libraries during development and packaging. We acknowledge and thank their creators and maintainers:
+
+## Build and Packaging Tools
+
+- **[Inno Setup](https://github.com/jrsoftware/issrc)** - Windows installer creation tool by Jordan Russell and Martijn Laan
+- **[node-appdmg](https://github.com/LinusU/node-appdmg)** - macOS DMG creation tool by Linus Unnebäck
+- **[qcron](https://github.com/Mankalas/qcron)** - C++ cron-like library by Mankalas (used in earlier versions)
+- **[linuxdeploy](https://github.com/linuxdeploy/linuxdeploy)** - Linux AppImage deployment tool
+- **[linuxdeploy-plugin-qt](https://github.com/linuxdeploy/linuxdeploy-plugin-qt)** - Qt plugin for linuxdeploy
+- **[linuxdeploy-plugin-appimage](https://github.com/linuxdeploy/linuxdeploy-plugin-appimage)** - AppImage creation plugin
+- **[AppImageKit](https://github.com/AppImage/AppImageKit)** - AppImage format and tools
+
+## Development and Testing Tools
+
+- **[Docker](https://www.docker.com/)** - Containerization platform used for isolated build environments
+- **[Vagrant](https://www.vagrantup.com/)** - Virtual machine management tool (optional, used for testing VM environments)
+
+## Runtime Dependencies
+
+- **[Qt5](https://www.qt.io/)** - Cross-platform application framework (Core, Gui, Widgets, Network modules)
+- **[rclone](https://rclone.org/)** - Command-line program to manage files on cloud storage
+
+## Other Resources
+
+- Screenshots and images may reference or use resources from the original Rclone Browser project by Martins Mozeiko
+
+These tools are used as external dependencies and are not distributed as part of this software. Please refer to their respective licenses and documentation.
+
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 375904d5..eb75a236 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -125,15 +125,15 @@
- Mount and unmount folders on macOS and GNU/Linux
- Optionally minimizes to tray, with notifications when upload/download finishes
-[1.8.0]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.8.0
-[1.7.0]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.7.0
-[1.6.0]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.6.0
-[1.5.3]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.5.3
-[1.5.2]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.5.2
-[1.5.1]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.5.1
-[1.5]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.5
-[1.4.1]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.4.1
-[1.4]: https://github.com/kapitainsky/RcloneBrowser/releases/tag/1.4
+[1.8.0]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.8.0
+[1.7.0]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.7.0
+[1.6.0]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.6.0
+[1.5.3]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.5.3
+[1.5.2]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.5.2
+[1.5.1]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.5.1
+[1.5]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.5
+[1.4.1]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.4.1
+[1.4]: https://github.com/zaphodbeeblebrox3rd/RcloneBrowser/releases/tag/1.4
[1.2]: https://github.com/mmozeiko/RcloneBrowser/releases/tag/1.2
[1.1]: https://github.com/mmozeiko/RcloneBrowser/releases/tag/1.1
[1.0.0]: https://github.com/mmozeiko/RcloneBrowser/releases/tag/1.0.0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 160edfa1..08f519cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,31 @@
-project(rclone-browser)
+# CMake 3.5 is required for compatibility with modern CMake versions (4.0+)
+# which removed support for projects requiring < 3.5. CMake 3.5 was released
+# in 2016 and should be available on all supported platforms via package
+# managers (Homebrew, etc.) or direct download.
+# Note: This does NOT affect the minimum macOS version the app can run on
+# (controlled by CMAKE_OSX_DEPLOYMENT_TARGET in src/CMakeLists.txt).
+
+# Check CMake version and provide helpful error message if too old
+if(CMAKE_VERSION VERSION_LESS "3.5")
+ message(FATAL_ERROR "\n"
+ "CMake 3.5 or higher is required to build this project.\n"
+ "Your current CMake version is: ${CMAKE_VERSION}\n\n"
+ "To install CMake 3.5+ on your system:\n"
+ " macOS (Homebrew): brew install cmake\n"
+ " macOS (MacPorts): sudo port install cmake\n"
+ " Linux (Ubuntu/Debian): sudo apt-get install cmake\n"
+ " Linux (Fedora/RHEL): sudo dnf install cmake\n"
+ " Linux (Arch): sudo pacman -S cmake\n"
+ " Windows: Download from https://cmake.org/download/\n"
+ " Or build from source: https://cmake.org/download/\n\n"
+ "After installing, make sure the new CMake is in your PATH.\n"
+ "You can verify with: cmake --version\n"
+ )
+endif()
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.5)
+
+project(rclone-browser)
if(WIN32)
# link automatically to qtmain.lib on Windows
diff --git a/DEVELOPER_README.md b/DEVELOPER_README.md
new file mode 100644
index 00000000..404445ef
--- /dev/null
+++ b/DEVELOPER_README.md
@@ -0,0 +1,68 @@
+# Developer Guide
+
+## Building AppImage with Docker
+
+If you're building on Ubuntu 18.04+ but want to create an AppImage compatible with CentOS 7+ and Ubuntu 16.04+ (glibc 2.17+), you can use Docker to build in a CentOS 7 environment:
+
+1. Install Docker: `sudo apt install docker.io` (or use your distribution's package manager)
+2. Build the AppImage using Docker:
+ ```bash
+ ./scripts/build_AppImage_docker.sh
+ ```
+3. The AppImage will be created in the `release/` directory with glibc 2.17 compatibility
+
+This method allows you to build on modern systems (Ubuntu 20.04+, etc.) while ensuring the resulting AppImage works on older systems (CentOS 7+, Ubuntu 16.04+). The Docker container provides an isolated CentOS 7 build environment with glibc 2.17.
+
+**Note:** The regular build script (`scripts/release_AppImage.sh`) will warn you if you're building on a system with glibc > 2.17 and suggest using Docker for better compatibility.
+
+### Supported Distributions
+
+The AppImage built using this Docker method is compatible with:
+- CentOS 7+ (glibc 2.17+)
+- RHEL 7+ (glibc 2.17+)
+- Ubuntu 16.04+ (glibc 2.23+)
+- Debian Stretch+ (glibc 2.24+)
+- Most modern Linux distributions released after 2014
+
+### Troubleshooting
+
+If you encounter issues building the Docker image:
+- Ensure Docker is running: `sudo systemctl start docker` (or equivalent)
+- Check Docker permissions: You may need to add your user to the `docker` group or use `sudo`
+- Verify the Dockerfile is in the repository root: `Dockerfile.appimage`
+- Check available disk space: Docker images and builds can require several GB
+
+If the AppImage build fails inside the container:
+- Check that all source files are present in the repository
+- Verify that the build script has execute permissions: `chmod +x scripts/release_AppImage.sh`
+- Review the build output for specific error messages
+
+## Testing AppImage on CentOS 7
+
+After building the AppImage, you can test it on CentOS 7 to verify it works correctly. The `tests/` directory contains a script to run the AppImage in a CentOS 7 container with GUI support.
+
+### Quick Start
+
+1. **Build the AppImage** (if you haven't already):
+ ```bash
+ ./scripts/build_AppImage_docker.sh
+ ```
+
+2. **Run the AppImage in CentOS 7 container with VNC** (recommended):
+ ```bash
+ ./tests/run_test_container.sh --vnc
+ ```
+ Then connect to the VNC server at `localhost:5901` (password: `password`) to see the GUI.
+
+3. **Or use X11 forwarding** (Linux hosts only):
+ ```bash
+ ./tests/run_test_container.sh --x11
+ ```
+ The AppImage GUI will appear in your X server window.
+
+The script spins up a CentOS 7 container, mounts your AppImage, and launches it automatically so you can verify it works correctly.
+
+### Detailed Documentation
+
+For complete instructions, troubleshooting, and optional VM-based testing with Vagrant, see [tests/README.md](tests/README.md).
+
diff --git a/LICENSE b/LICENSE
index 17864a9b..76c670f3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -2,10 +2,6 @@ MIT License
Copyright (c) 2019-2020 kapitainsky (Rclone Browser)
Copyright (c) 2017 Martins Mozeiko (Rclone Browser)
-Copyright (c) 2015 Mankalas (qcron)
-Copyright (c) 2013 Linus Unnebäck (node-appdmg)
-Copyright (c) 1997-2020 Jordan Russell (Inno Setup - Windows Installer)
-Portions Copyright (c) 2000-2020 Martijn (Inno Setup - Windows Installer)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 62db534f..edc2cdc4 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-
+
-[![Travis CI Build Status][img1]][1] [![AppVeyor Build Status][img2]][2] [![Downloads][img3]][3] [![Release][img4]][4] [](https://www.codacy.com/manual/kapitainsky/RcloneBrowser?utm_source=github.com&utm_medium=referral&utm_content=kapitainsky/RcloneBrowser&utm_campaign=Badge_Grade) [![License][img5]][5] [](https://www.paypal.me/kapitainsky)
+[![Travis CI Build Status][img1]][1] [![AppVeyor Build Status][img2]][2] [![Downloads][img3]][3] [![Release][img4]][4]
[![License][img5]][5]
Rclone browser
==============
@@ -10,20 +10,19 @@ Supports macOS, GNU/Linux, BSD family and Windows.
Table of contents
-------------------
-* [Features](https://github.com/kapitainsky/RcloneBrowser#features)
-* [Sample screenshots](https://github.com/kapitainsky/RcloneBrowser#sample-screenshots)
-* [How to get it](https://github.com/kapitainsky/RcloneBrowser#how-to-get-it)
-* [Why AppImage only for Linux](https://github.com/kapitainsky/RcloneBrowser#why-appimage-only-for-linux)
-* [Build instructions](https://github.com/kapitainsky/RcloneBrowser#build-instructions)
- * [Linux](https://github.com/kapitainsky/RcloneBrowser#linux)
- * [FreeBSD](https://github.com/kapitainsky/RcloneBrowser#freebsd)
- * [OpenBSD](https://github.com/kapitainsky/RcloneBrowser#openbsd)
- * [NetBSD](https://github.com/kapitainsky/RcloneBrowser#netbsd)
- * [macOS](https://github.com/kapitainsky/RcloneBrowser#macos)
- * [Windows](https://github.com/kapitainsky/RcloneBrowser#windows)
-* [Portable vs standard mode](https://github.com/kapitainsky/RcloneBrowser#portable-vs-standard-mode)
-* [History](https://github.com/kapitainsky/RcloneBrowser#history)
-* [Code signing certificates donations](https://github.com/kapitainsky/RcloneBrowser#code-signing-certificates-donations)
+* [Features](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#features)
+* [Sample screenshots](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#sample-screenshots)
+* [How to get it](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#how-to-get-it)
+* [Why AppImage only for Linux](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#why-appimage-only-for-linux)
+* [Build instructions](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#build-instructions)
+ * [Linux](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#linux)
+ * [FreeBSD](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#freebsd)
+ * [OpenBSD](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#openbsd)
+ * [NetBSD](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#netbsd)
+ * [macOS](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#macos)
+ * [Windows](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#windows)
+* [Portable vs standard mode](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#portable-vs-standard-mode)
+* [History](https://github.com/zaphodbeeblebrox3rd/RcloneBrowser#history)
Features
--------
@@ -51,27 +50,27 @@ Sample screenshots
-------------------
**macOS**
-
-
+
+
-
+
-
+
-
+
-
+
Copyright © 2019
)" - R"(Current development and maintenance
kapitainsky
New features and fixes
contributors
New features and fixes
contributors
Original version
Martins Mozeiko
Visit releases page to download
)")); + R"(Visit releases page to download
)")); }; }; }; @@ -810,6 +809,7 @@ void MainWindow::rcloneListRemotes() { } #else // for Linux/BSD PM_ListViewIconSize stays the same + Q_UNUSED(darkModeIconScale); size = lightModeiconScale * style->pixelMetric(QStyle::PM_ListViewIconSize); #endif #else @@ -1108,12 +1108,59 @@ void MainWindow::addMount(const QString &remote, const QString &folder) { args.append(GetRcloneConf()); if (!opt.isEmpty()) { - args.append(opt.split(' ')); + args.append(opt.split(' ', Qt::SkipEmptyParts)); } args << remote << folder; UseRclonePassword(mount); + + // Connect error handler before starting + QObject::connect(mount, &QProcess::errorOccurred, this, [=](QProcess::ProcessError error) { + if (error == QProcess::FailedToStart) { + QMessageBox::critical( + this, "Mount Error", + QString("Failed to start rclone mount process.\n\n" + "Possible causes:\n" + "- rclone executable not found\n" + "- macFUSE not installed (required on macOS)\n" + "- Insufficient permissions\n\n" + "Error: %1").arg(mount->errorString())); + widget->deleteLater(); + line->deleteLater(); + if (--mJobCount == 0) { + ui.tabs->setTabText(1, "Jobs"); + } else { + ui.tabs->setTabText(1, QString("Jobs (%1)").arg(mJobCount)); + } + if (ui.jobs->count() == 2) { + ui.noJobsAvailable->show(); + } + } + }); + mount->start(GetRclone(), args, QIODevice::ReadOnly); + + // Check if process started successfully + if (!mount->waitForStarted(3000)) { + QMessageBox::critical( + this, "Mount Error", + QString("Failed to start rclone mount process.\n\n" + "Possible causes:\n" + "- rclone executable not found\n" + "- macFUSE not installed (required on macOS)\n" + "- Insufficient permissions\n\n" + "Error: %1").arg(mount->errorString())); + widget->deleteLater(); + line->deleteLater(); + if (--mJobCount == 0) { + ui.tabs->setTabText(1, "Jobs"); + } else { + ui.tabs->setTabText(1, QString("Jobs (%1)").arg(mJobCount)); + } + if (ui.jobs->count() == 2) { + ui.noJobsAvailable->show(); + } + } } void MainWindow::addStream(const QString &remote, const QString &stream) { @@ -1168,7 +1215,7 @@ void MainWindow::addStream(const QString &remote, const QString &stream) { ui.jobs->insertWidget(1, line); ui.tabs->setTabText(1, QString("Jobs (%1)").arg(++mJobCount)); - player->start(stream, QProcess::ReadOnly); + player->start(stream, QStringList(), QProcess::ReadOnly); UseRclonePassword(rclone); rclone->start(GetRclone(), QStringList() << "cat" << GetRcloneConf() << remote, diff --git a/src/mount_widget.cpp b/src/mount_widget.cpp index c34250dc..fb342125 100644 --- a/src/mount_widget.cpp +++ b/src/mount_widget.cpp @@ -68,6 +68,9 @@ MountWidget::MountWidget(QProcess *process, const QString &remote, ui.showDetails->setStyleSheet( "QToolButton { border: 0; color: red; }"); ui.showDetails->setText("Error"); + // Auto-expand details and show output on error + ui.showDetails->setChecked(true); + ui.showOutput->setChecked(true); } ui.cancel->setToolTip("Close"); emit finished(); diff --git a/tests/Dockerfile.test b/tests/Dockerfile.test new file mode 100644 index 00000000..4dc11908 --- /dev/null +++ b/tests/Dockerfile.test @@ -0,0 +1,79 @@ +# Dockerfile for testing AppImage on CentOS 7 with GUI support +# This allows testing the AppImage in a CentOS 7 environment with desktop GUI + +FROM centos:7 + +# CentOS 7 reached end-of-life, so we need to use vault.centos.org +# Update yum configuration to use vault repository +RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*.repo && \ + sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*.repo + +# Install EPEL repository +RUN yum install -y epel-release && yum clean all + +# Install desktop environment (Xfce - lightweight and suitable for testing) +# Install VNC server for remote GUI access +# Install FUSE (required for AppImage execution) +# Install X11 utilities for X11 forwarding +# Install wget, curl, and unzip for downloading and extracting rclone +RUN yum install -y \ + xfce4 \ + xfce4-terminal \ + tigervnc-server \ + fuse \ + xorg-x11-xauth \ + xorg-x11-utils \ + xorg-x11-server-Xvfb \ + which \ + wget \ + curl \ + unzip \ + && yum clean all + +# Install rclone (download binary directly since CentOS 7 repos don't have it) +# Using a recent stable version that works on CentOS 7 (glibc 2.17) +RUN RCLONE_VERSION="1.66.0" && \ + wget -q "https://github.com/rclone/rclone/releases/download/v${RCLONE_VERSION}/rclone-v${RCLONE_VERSION}-linux-amd64.zip" -O /tmp/rclone.zip && \ + unzip -q /tmp/rclone.zip -d /tmp && \ + cp /tmp/rclone-v${RCLONE_VERSION}-linux-amd64/rclone /usr/local/bin/ && \ + chmod +x /usr/local/bin/rclone && \ + rm -rf /tmp/rclone.zip /tmp/rclone-v${RCLONE_VERSION}-linux-amd64 && \ + rclone version + +# Set up VNC server +# Create VNC user directory and set password (default: password) +# You can change the password by mounting a custom .vnc/passwd file +RUN mkdir -p /root/.vnc && \ + echo "password" | vncpasswd -f > /root/.vnc/passwd && \ + chmod 600 /root/.vnc/passwd + +# Create VNC startup script +RUN echo '#!/bin/bash' > /root/.vnc/xstartup && \ + echo 'unset SESSION_MANAGER' >> /root/.vnc/xstartup && \ + echo 'unset DBUS_SESSION_BUS_ADDRESS' >> /root/.vnc/xstartup && \ + echo '[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources' >> /root/.vnc/xstartup && \ + echo 'xsetroot -solid grey' >> /root/.vnc/xstartup && \ + echo 'vncconfig -iconic &' >> /root/.vnc/xstartup && \ + echo 'export XKL_XMODMAP_DISABLE=1' >> /root/.vnc/xstartup && \ + echo 'export XDG_CURRENT_DESKTOP="XFCE"' >> /root/.vnc/xstartup && \ + echo 'export XDG_MENU_PREFIX="xfce-"' >> /root/.vnc/xstartup && \ + echo 'export XDG_SESSION_DESKTOP="xfce"' >> /root/.vnc/xstartup && \ + echo 'startxfce4 &' >> /root/.vnc/xstartup && \ + chmod +x /root/.vnc/xstartup + +# Set up environment for Xfce +ENV DISPLAY=:1 +ENV VNC_RESOLUTION=1024x768 + +# Create directory for AppImage +RUN mkdir -p /test + +# Set working directory +WORKDIR /test + +# Expose VNC port +EXPOSE 5901 + +# Default command (can be overridden) +CMD ["/bin/bash"] + diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 00000000..43be778f --- /dev/null +++ b/tests/README.md @@ -0,0 +1,134 @@ +# Testing AppImage on CentOS 7 + +This directory contains a script to run the AppImage in a CentOS 7 container with GUI support, allowing you to verify it works correctly on CentOS 7. + +## Prerequisites + +- Docker installed and running +- For X11 forwarding mode: X server running on Linux host +- For VNC mode: VNC viewer client (for GUI access) + +## Quick Start + +1. **Build the AppImage first:** + ```bash + ./scripts/build_AppImage_docker.sh + ``` + +2. **Run the AppImage in CentOS 7 container with VNC (recommended):** + ```bash + ./tests/run_test_container.sh --vnc + ``` + +3. **Connect to the GUI:** + ```bash + vncviewer localhost:5901 + ``` + Password: `password` + +4. **Or use X11 forwarding (Linux hosts only):** + ```bash + ./tests/run_test_container.sh --x11 + ``` + The AppImage GUI will appear in your X server window. + +## Usage Modes + +### VNC Mode (Default) + +VNC mode works on all platforms. It starts a VNC server inside the container that you can connect to from your host machine. + +**Usage:** +```bash +./tests/run_test_container.sh --vnc +``` + +**Connecting to the GUI:** +1. Install a VNC viewer if you don't have one: + - **Linux:** `sudo apt install tigervnc-viewer` or `sudo apt install remmina` + - **macOS:** Download from [RealVNC](https://www.realvnc.com/download/viewer/) or use built-in Screen Sharing + - **Windows:** Download [TigerVNC](https://tigervnc.org/) or [RealVNC Viewer](https://www.realvnc.com/download/viewer/) + +2. Connect to `localhost:5901` + - Password: `password` + +3. Or use command line: + ```bash + vncviewer localhost:5901 + ``` + +**Container Management:** +- View logs: `docker logs -f rclone-browser-test` +- Get a shell: `docker exec -it rclone-browser-test /bin/bash` +- Stop container: `docker stop rclone-browser-test` + +### X11 Forwarding Mode + +X11 forwarding allows the AppImage GUI to appear directly in your X server window. This only works on Linux hosts with an X server running. + +**Usage:** +```bash +./tests/run_test_container.sh --x11 +``` + +**Requirements:** +- X server running on host (most Linux desktop environments have this) +- X11 socket accessible at `/tmp/.X11-unix/X0` +- The script will automatically run `xhost +local:docker` to allow Docker access + +**Note:** If you get permission errors, you may need to run: +```bash +xhost +local:docker +``` + +## What It Does + +The script: +1. Finds your freshly built AppImage in the `release/` directory +2. Builds a CentOS 7 Docker image with desktop environment (Xfce) and VNC server +3. Starts a container with the AppImage mounted +4. Launches the AppImage automatically +5. Provides you with connection instructions to see the GUI + +The AppImage runs in a CentOS 7 environment (glibc 2.17), so you can verify it works correctly on CentOS 7+ and Ubuntu 16.04+ systems. + +## Troubleshooting + +### "No AppImage found" error +- Make sure you've built the AppImage first: `./scripts/build_AppImage_docker.sh` +- Check that the AppImage exists in `release/` directory + +### VNC connection refused +- Make sure the container is still running: `docker ps` +- Check if port 5901 is already in use: `netstat -an | grep 5901` +- Try a different port by modifying the script + +### X11 forwarding not working +- Verify X server is running: `echo $DISPLAY` +- Check X11 socket exists: `ls -l /tmp/.X11-unix/X0` +- Try VNC mode instead, which is more reliable + +### Container permissions issues +- You may need to use `sudo` with Docker commands +- Or add your user to the `docker` group: `sudo usermod -aG docker $USER` (requires logout/login) + +## Files + +- `Dockerfile.test` - Docker image definition for CentOS 7 test environment +- `run_test_container.sh` - Script to build and run the container with GUI support +- `Vagrantfile` - Optional Vagrant setup for VM-based testing (see below) + +## Optional: VM Testing with Vagrant + +For more comprehensive testing, you can use Vagrant to spin up a full CentOS 7 VM: + +1. Install Vagrant: https://www.vagrantup.com/downloads +2. Start the VM: + ```bash + cd tests + vagrant up + ``` +3. Connect via VNC or SSH +4. Copy AppImage to VM and test + +See `Vagrantfile` for details. diff --git a/tests/Vagrantfile b/tests/Vagrantfile new file mode 100644 index 00000000..f6701003 --- /dev/null +++ b/tests/Vagrantfile @@ -0,0 +1,143 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile for testing RcloneBrowser AppImage on CentOS 7 +# This creates a CentOS 7 VM with desktop environment for GUI testing + +Vagrant.configure("2") do |config| + # Use CentOS 7 box + config.vm.box = "centos/7" + + # VM configuration + config.vm.provider "virtualbox" do |vb| + # VM resources + vb.memory = "2048" + vb.cpus = 2 + vb.name = "rclone-browser-test-centos7" + + # Enable GUI (for VirtualBox) + vb.gui = true + end + + # Network configuration + # Forward VNC port for remote access + config.vm.network "forwarded_port", guest: 5901, host: 5901, auto_correct: true + + # Shared folder for AppImage + config.vm.synced_folder "../release", "/vagrant/release", type: "rsync", + rsync__exclude: [".git/", "build/", "*.o", "*.a"] + + # Provisioning script + config.vm.provision "shell", inline: <<-SHELL + # Update system + yum update -y + + # Install EPEL repository + yum install -y epel-release + + # Install desktop environment (Xfce - lightweight) + yum groupinstall -y "Xfce" + + # Install VNC server + yum install -y tigervnc-server + + # Install FUSE (required for AppImage) + yum install -y fuse + + # Install other useful tools + yum install -y wget curl vim firefox + + # Set up VNC server for root + mkdir -p /root/.vnc + echo "password" | vncpasswd -f > /root/.vnc/passwd + chmod 600 /root/.vnc/passwd + + # Create VNC startup script + cat > /root/.vnc/xstartup << 'EOF' +#!/bin/bash +unset SESSION_MANAGER +unset DBUS_SESSION_BUS_ADDRESS +exec /etc/X11/xinit/xinitrc +[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup +[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources +xsetroot -solid grey +vncconfig -iconic & +startxfce4 & +EOF + chmod +x /root/.vnc/xstartup + + # Create systemd service for VNC (optional) + cat > /etc/systemd/system/vncserver@:1.service << 'EOF' +[Unit] +Description=Remote desktop service (VNC) +After=syslog.target network.target + +[Service] +Type=forking +User=root +ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :' +ExecStart=/usr/bin/vncserver :1 -geometry 1024x768 -depth 24 +ExecStop=/usr/bin/vncserver -kill :1 + +[Install] +WantedBy=multi-user.target +EOF + + # Enable VNC service (optional - can start manually) + # systemctl daemon-reload + # systemctl enable vncserver@:1.service + + # Create test directory + mkdir -p /test + + # Copy AppImage if it exists + if [ -f /vagrant/release/*.AppImage ]; then + cp /vagrant/release/*.AppImage /test/ + chmod +x /test/*.AppImage + echo "AppImage copied to /test/" + else + echo "Warning: No AppImage found in release/ directory" + echo "Build the AppImage first, then run: vagrant rsync" + fi + + echo "" + echo "=== CentOS 7 Test VM Ready ===" + echo "" + echo "To start VNC server manually:" + echo " vncserver :1" + echo "" + echo "To connect from host:" + echo " vncviewer localhost:5901" + echo " Password: password" + echo "" + echo "AppImage location: /test/" + echo "" + SHELL + + # Post-up message + config.vm.post_up_message = <<-MESSAGE +=== CentOS 7 Test VM is Ready === + +The VM is now running. You can: + +1. Connect via SSH: + vagrant ssh + +2. Start VNC server (inside VM): + vagrant ssh -c "vncserver :1" + +3. Connect via VNC from host: + vncviewer localhost:5901 + Password: password + +4. Test the AppImage: + vagrant ssh -c "cd /test && ./rclone-browser-*.AppImage" + +5. Copy updated AppImage to VM: + vagrant rsync + +To stop the VM: vagrant halt +To destroy the VM: vagrant destroy +MESSAGE +end + diff --git a/tests/run_test_container.sh b/tests/run_test_container.sh new file mode 100755 index 00000000..03a63d5f --- /dev/null +++ b/tests/run_test_container.sh @@ -0,0 +1,302 @@ +#!/bin/bash + +# Script to run the AppImage in a CentOS 7 container with GUI support +# This spins up a container with the freshly built AppImage and presents it to the developer + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +DOCKERFILE="$SCRIPT_DIR/Dockerfile.test" +IMAGE_NAME="rclone-browser-test-centos7" +CONTAINER_NAME="rclone-browser-test" + +# Default mode - prefer X11 to avoid VNC dialog issues +# Check if X11 is available (check for any X socket, not just X0) +if [ -n "$DISPLAY" ] && ls /tmp/.X11-unix/X* >/dev/null 2>&1; then + MODE="x11" +else + # If X11 not available, warn user about VNC dialog issues + MODE="vnc" +fi + +# Parse arguments +while [[ $# -gt 0 ]]; do + case $1 in + --x11) + MODE="x11" + shift + ;; + --vnc) + MODE="vnc" + shift + ;; + --help|-h) + echo "Usage: $0 [--x11|--vnc]" + echo "" + echo "Spins up a CentOS 7 container with the AppImage and presents the GUI." + echo "" + echo "Options:" + echo " --x11 Use X11 forwarding (Linux hosts only, recommended - no dialogs!)" + echo " --vnc Use VNC server (works on all platforms, but may have dialog issues)" + echo " --help Show this help message" + echo "" + echo "Note: X11 mode is recommended on Linux as it avoids VNC viewer dialog issues." + exit 0 + ;; + *) + echo "Unknown option: $1" + echo "Use --help for usage information" + exit 1 + ;; + esac +done + +# Check if Docker is available +if ! command -v docker >/dev/null 2>&1; then + echo "Error: Docker is not installed or not in PATH" + echo "Please install Docker to use this script" + exit 1 +fi + +# Check if we can run Docker (might need sudo) +DOCKER_CMD="docker" +if ! docker info >/dev/null 2>&1; then + if sudo docker info >/dev/null 2>&1; then + DOCKER_CMD="sudo docker" + echo "Note: Using sudo for Docker commands" + else + echo "Error: Cannot access Docker. Please ensure Docker is running and you have permissions" + exit 1 + fi +fi + +# Check if AppImage exists +APPIMAGE=$(find "$ROOT_DIR/release" -name "*.AppImage" -type f 2>/dev/null | head -n 1) +if [ -z "$APPIMAGE" ]; then + echo "Error: No AppImage found in $ROOT_DIR/release/" + echo "Please build the AppImage first using: ./scripts/build_AppImage_docker.sh" + exit 1 +fi + +echo "Found AppImage: $(basename "$APPIMAGE")" + +# Build Docker image +echo "Building test container image..." +$DOCKER_CMD build -f "$DOCKERFILE" -t "$IMAGE_NAME" "$SCRIPT_DIR" >/dev/null 2>&1 || { + echo "Building test container image (this may take a few minutes)..." + $DOCKER_CMD build -f "$DOCKERFILE" -t "$IMAGE_NAME" "$SCRIPT_DIR" +} + +# Stop and remove existing container if it exists +if $DOCKER_CMD ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then + echo "Removing existing container..." + $DOCKER_CMD rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true +fi + +# Prepare Docker run command +DOCKER_RUN_ARGS=( + --rm + --name "$CONTAINER_NAME" + --cap-add SYS_ADMIN + --device /dev/fuse + -v "$APPIMAGE:/test/$(basename "$APPIMAGE"):ro" +) + +# Mount rclone config from host if it exists +HOST_RCLONE_CONFIG="${HOME}/.config/rclone" +if [ -d "$HOST_RCLONE_CONFIG" ] || [ -f "$HOST_RCLONE_CONFIG/rclone.conf" ]; then + # Mount the entire rclone config directory so the config file and any cached tokens are available + DOCKER_RUN_ARGS+=(-v "$HOST_RCLONE_CONFIG:/root/.config/rclone:ro") + echo "Mounting rclone config from host: $HOST_RCLONE_CONFIG" +else + echo "Note: No rclone config found at $HOST_RCLONE_CONFIG (you can configure rclone in the GUI)" +fi + +# AppImage name for use in container +APPIMAGE_NAME=$(basename "$APPIMAGE") + +if [ "$MODE" = "x11" ]; then + # X11 forwarding mode + if [ -z "$DISPLAY" ] || ! ls /tmp/.X11-unix/X* >/dev/null 2>&1; then + echo "Error: X11 not available" + echo "X11 forwarding requires an X server to be running and DISPLAY to be set" + echo "Try using --vnc mode instead, or start an X server" + exit 1 + fi + + # Extract display number from DISPLAY (e.g., :1 -> X1, :0 -> X0) + DISPLAY_NUM=$(echo "$DISPLAY" | sed 's/.*:\([0-9]*\).*/\1/') + X_SOCKET="/tmp/.X11-unix/X${DISPLAY_NUM}" + + if [ ! -S "$X_SOCKET" ]; then + echo "Warning: X11 socket $X_SOCKET not found, but will try anyway" + fi + + # Allow X11 connections from Docker + xhost +local:docker 2>/dev/null || echo "Warning: Could not run 'xhost +local:docker'. You may need to run this manually." + + DOCKER_RUN_ARGS+=( + -e DISPLAY="$DISPLAY" + -v /tmp/.X11-unix:/tmp/.X11-unix:rw + ) + + echo "" + echo "=== Starting container with X11 forwarding ===" + echo "The AppImage GUI should appear in your X server window" + echo "" + + # Run container with X11 forwarding + $DOCKER_CMD run -it "${DOCKER_RUN_ARGS[@]}" \ + "$IMAGE_NAME" \ + /bin/bash -c " + export DISPLAY=$DISPLAY + cd /test + # Copy AppImage to writable location and make it executable + cp '$APPIMAGE_NAME' appimage_copy + chmod +x appimage_copy + echo 'Starting AppImage...' + ./appimage_copy & + echo '' + echo 'AppImage started in background.' + echo 'You can also run it manually: ./appimage_copy' + echo 'Press Ctrl+C to exit the container' + /bin/bash + " + + # Restore X11 access control + xhost -local:docker 2>/dev/null || true + +elif [ "$MODE" = "vnc" ]; then + # VNC mode + VNC_PORT=5901 + + # Check if X11 is available and recommend it + if [ -n "$DISPLAY" ] && ls /tmp/.X11-unix/X* >/dev/null 2>&1; then + echo "" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo " ⚠️ RECOMMENDATION: Use X11 forwarding instead!" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo " X11 forwarding avoids VNC viewer dialog issues." + echo " To use X11 mode, stop this and run:" + echo " $0 --x11" + echo "" + echo " Continuing with VNC mode (you may encounter dialog issues)..." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" + sleep 2 + fi + + DOCKER_RUN_ARGS+=( + -p "$VNC_PORT:5901" + -e DISPLAY=:1 + ) + + echo "" + echo "=== Starting container with VNC server ===" + echo "" + + # Run container with VNC + $DOCKER_CMD run -d "${DOCKER_RUN_ARGS[@]}" \ + "$IMAGE_NAME" \ + /bin/bash -c " + # Start VNC server + vncserver :1 -geometry 1024x768 -depth 24 + sleep 5 + + # Wait for Xfce to fully start + export DISPLAY=:1 + for i in {1..30}; do + if xdpyinfo >/dev/null 2>&1; then + break + fi + sleep 1 + done + + # Copy AppImage to writable location and make it executable + cd /test + cp '$(basename "$APPIMAGE")' appimage_copy + chmod +x appimage_copy + + # Start AppImage in the VNC session + sleep 2 + ./appimage_copy >/tmp/appimage.log 2>&1 & + + echo 'AppImage started in VNC session' + echo '' + echo '=== VNC Server Running ===' + echo 'Connect with: vncviewer localhost:$VNC_PORT' + echo 'Password: password' + echo '' + echo 'Container is running in background.' + echo 'To stop: docker stop $CONTAINER_NAME' + echo 'To view logs: docker logs -f $CONTAINER_NAME' + echo 'To get a shell: docker exec -it $CONTAINER_NAME /bin/bash' + + # Keep container running + tail -f /dev/null + " >/dev/null + + echo "Container started!" + echo "" + + # Wait a moment for VNC server to be ready + sleep 3 + + # Show connection info and try to auto-launch Remmina + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo " VNC Connection Ready" + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo " Address: localhost:$VNC_PORT" + echo " Password: password" + echo "" + + # Try to auto-launch Remmina if available + if command -v remmina >/dev/null 2>&1; then + echo " Auto-launching Remmina..." + remmina -c vnc://:password@localhost:$VNC_PORT >/dev/null 2>&1 & + sleep 2 + echo " Remmina launched (if it didn't open, try manually)" + echo "" + fi + + echo " Connect using one of these methods:" + echo "" + + # Detect available viewers and show appropriate command + if command -v vncviewer >/dev/null 2>&1; then + echo " Option 1:" + echo " vncviewer localhost:$VNC_PORT" + echo "" + fi + + if command -v tigervnc-viewer >/dev/null 2>&1; then + echo " Option 2:" + echo " tigervnc-viewer localhost:$VNC_PORT" + echo "" + fi + + if [ -d "/Applications" ]; then + echo " Option 3 (macOS):" + echo " open vnc://localhost:$VNC_PORT" + echo "" + fi + + echo " Or use any VNC viewer and connect to: localhost:$VNC_PORT" + echo "" + echo " After connecting, you should see the Xfce desktop with the AppImage running." + echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + echo "" + + echo "Container management:" + echo " Stop: $DOCKER_CMD stop $CONTAINER_NAME" + echo " Logs: $DOCKER_CMD logs -f $CONTAINER_NAME" + echo " Shell: $DOCKER_CMD exec -it $CONTAINER_NAME /bin/bash" + echo "" + echo "Press Ctrl+C to stop the container when done." + + # Keep script running so container stays alive + # Wait for container to stop or user interrupt + trap "echo ''; echo 'Stopping container...'; $DOCKER_CMD stop $CONTAINER_NAME >/dev/null 2>&1; exit 0" INT TERM + $DOCKER_CMD wait $CONTAINER_NAME >/dev/null 2>&1 || wait +fi