🌱🏠🖥️ Cross-platform desktop application for greenhouse -- share your local servers or files on the internet in seconds! https://greenhouse.server.garden/ https://greenhouse.server.garden/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Alec Hill db3edec576 Architechture == Architecture 2 years ago
readme Architechture == Architecture 2 years ago
requirements remove mac specific python package requirements 2 years ago
src bump daemon version 2 years ago
.gitignore 1st attempt at installing greenhouse-background-service on windows 3 years ago
README.md fixing word things 2 years ago

README.md

greenhouse-desktop

Pitney the Pineapple waving at you from behind a laptop

This is the desktop application for the Greenhouse cloud service (in development).

greenhouse-desktop is a cross-platform fbs (fman build system) python/QT application with an accompanying daemon (background service) written in Go. The python app will display status to the user and allow them to configure their tunnels, while the daemon will manage the embedded threshold and caddy processes.

Screenshots

screenshot of splash screen

screenshot of tunnel configuration screen highlighting listening port chooser

Getting Started (run from source)

In general, to run from source you will have to:

  1. Aquire Python 3.6 (fbs require this old python version)
  2. Download the source code
  3. Create the python virtual environment venv in the root of the source code directory
  4. enter the virtual environment by sourcing the activate script
  5. install the requirements using pip and the requirements file requirements/linux.txt
  6. run fbs run

Please note that the greenhouse-desktop application can't do anything on its own, it needs the 🌱🏠😈 greenhouse-daemon installed first. The Mac version is the only one that bundles the daemon installer inside the application itself.

On Windows, the greenhouse-daemon installer is a part of the NSIS (Nullsoft Scriptable Installation System) installer that the release process builds.

On Linux, the greenhouse-daemon installer is a separate shell script that gets served by the greenhouse web application

Run from Source on Linux

# Download python 3.6 with security updates from https://www.python.org/downloads/release/python-3613/
cd Python-3.6.13/
./configure --enable-shared
make test
# note some tests will fail because of openssl being newer since python 3.6 is very old.  https://bugs.python.org/issue32947
# for now i ignored this 😬

sudo make install
git clone https://git.sequentialread.com/forest/greenhouse-desktop.git
cd greenhouse-desktop
python3.6 -m venv venv
source venv/bin/activate
pip install -r requirements/linux.txt
fbs run

Run from Source on MacOS

Install Python 3.6 from https://www.python.org/downloads/release/python-368/

Note that the first-run daemon installer feature doesn't work under fbs run. So if you want that, you will have to run fbs freeze and then run the resulting application:

git clone https://git.sequentialread.com/forest/greenhouse-desktop.git
cd greenhouse-desktop
python3.6 -m venv venv
source venv/bin/activate
pip install -r requirements/linux.txt
fbs freeze
target/Greenhouse.app/Contents/MacOS/Greenhouse

Run from Source on Windows

First make sure that your python version is correct:

C:\Users\my-user>python --version
Python 3.6.8
git clone https://git.sequentialread.com/forest/greenhouse-desktop.git
cd greenhouse-desktop
python -m venv venv
./venv/Scripts/activate.bat
pip install -r requirements/linux.txt
fbs run

Architecture Diagrams for Install and Setup Process

These diagrams were created with https://app.diagrams.net/. To edit them, download the png file edit it with the https://app.diagrams.net/ web application, or you may run the application from source if you wish.

Linux Architecture

Windows Architecture

MacOS Architecture

Building a Release

See https://build-system.fman.io/manual/#releasing

Building Linux Package

Note:

  • venv/lib/python3.6/site-packages/fbs/
  • venv/lib/python3.6/site-packages/fbs/_defaults
sudo su
source venv/bin/activate
fbs buildvm ubuntu
fbs runvm ubuntu

# you should be inside the docker container now.
# note there is a bug where the fbs .bashrc fails to source the venv properly.
# so you have to do it yourself:

source venv/bin/activate && pip install -r requirements/linux.txt && fbs freeze && fbs release 0.0.1

exit

# now target/ubuntu/greenhouse-desktop.deb should exist!
# since right now root owns all this stuff, lets give it to the normal login user
# for me, that's user #1000 (forest)

mkdir -p my_dist
chown 1000:1000 my_dist
cp target/ubuntu/greenhouse-desktop.deb my_dist/greenhouse-desktop.deb
chown 1000:1000 my_dist/greenhouse-desktop.deb

Building a Windows Installer

  • open file explorer and search C:\ for api-ms-win-crt-multibyte-l1-1-0.dll
  • Start Menu > search for "Edit the System Environment Variables"
    • Environment Variables... > System Variables > Path > Edit...
    • Choose "New" and enter C:\Program Files (x86)\Windows Kits\10\Redist\10.0.19041.0\ucrt\DLLs\x64
      • (or some other path where this dll appears... ????)
  • install Nullsoft Scriptable Install System (NSIS)
  • download the NSIS Simple Service Plugin
  • copy SimpleSC.dll into C:\Program Files (x86)\NSIS\Plugins\x86-unicode
  • download the NSIS User Manager Plugin
  • copy UserMgr.dll into C:\Program Files (x86)\NSIS\Plugins\x86-unicode
  • Start Menu > search for "Edit the System Environment Variables"
    • Environment Variables... > System Variables > Path > Edit...
    • Choose "New" and enter C:\Users\venie\AppData\Local\Programs\Python\Python36
    • Choose "New" and enter C:\Users\venie\AppData\Local\Programs\Python\Python36\Scripts
    • Choose "New" and enter C:\Program Files (x86)\NSIS
  • install git for windows
  • git clone https://git.sequentialread.com/forest/greenhouse-desktop.git
  • cd greenhouse-desktop
  • download / set up the greenhouse-background-service files if its not done already
    • cd src/installer/windows
    • ./get-background-service-installer-files.sh
    • enter the windows cmd.exe shell instead of git bash
  • python --version
  • python -m venv venv
  • ./venv/Scripts/activate.bat
  • pip install -r requirements/linux.txt
  • fbs run
  • fbs freeze
  • fbs release 0.0.0

TODO it throws the logs away https://stackoverflow.com/questions/20523480/windows-service-output

Building a MacOS Application

  • create a MacOS virtual machine
  • get python 3.8.6
  • git clone https://git.sequentialread.com/forest/greenhouse-desktop.git
  • cd greenhouse-desktop
  • python3.6 -m venv venv
  • source venv/bin/activate
  • pip3.6 install -r requirements/linux.txt
  • fbs run
  • fbs freeze
  • fbs release 0.0.0