Alec Hill
db3edec576
|
3 years ago | |
---|---|---|
readme | 3 years ago | |
requirements | 3 years ago | |
src | 3 years ago | |
.gitignore | 3 years ago | |
README.md | 3 years ago |
README.md
greenhouse-desktop
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
Getting Started (run from source)
In general, to run from source you will have to:
- Aquire Python 3.6 (fbs require this old python version)
- Download the source code
- Create the python virtual environment
venv
in the root of the source code directory - enter the virtual environment by sourcing the
activate
script - install the requirements using
pip
and the requirements filerequirements/linux.txt
- 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
- Install Python 3.6 from https://www.python.org/downloads/release/python-368/
- (you might have to manually add it to your %PATH%)
- install git for 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
-
build the install-helper.exe if its not already built
GOOS=windows go build -o src/installer/windows/install-helper.exe src/installer/windows/install-helper.go
-
install the Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC Security Update
-
install the Visual C++ Redistributable for Visual Studio 2012
-
install the Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019
- open file explorer and search
C:\
forapi-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
intoC:\Program Files (x86)\NSIS\Plugins\x86-unicode
- download the NSIS User Manager Plugin
- copy
UserMgr.dll
intoC:\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