Browse Source

adding mac and windows install pages, ready for pre-alpha testing

master
forest 1 month ago
parent
commit
6c39d33afc
19 changed files with 341 additions and 16 deletions
  1. +1
    -1
      build-docker.sh
  2. +14
    -1
      frontend.go
  3. +7
    -7
      frontend/alpha-profile.gotemplate.html
  4. +30
    -1
      frontend/install-linux.gotemplate.html
  5. +179
    -0
      frontend/install-mac.gotemplate.html
  6. +77
    -0
      frontend/install-windows.gotemplate.html
  7. +1
    -1
      frontend/page.gotemplate.html
  8. +4
    -1
      frontend/static/greenhouse.css
  9. +4
    -0
      frontend/static/image-sources/generate_webp.sh
  10. BIN
      frontend/static/images/mac-architechture.png
  11. BIN
      frontend/static/images/mac-architechture.webp
  12. BIN
      frontend/static/images/mac-are-you-sure.png
  13. BIN
      frontend/static/images/mac-are-you-sure.webp
  14. BIN
      frontend/static/images/mac-right-click.png
  15. BIN
      frontend/static/images/mac-right-click.webp
  16. BIN
      frontend/static/images/mascot-confused.png
  17. BIN
      frontend/static/images/mascot-confused.webp
  18. +14
    -0
      frontend_howto.go
  19. +10
    -4
      readme/ALPHA.md

+ 1
- 1
build-docker.sh View File

@ -1,6 +1,6 @@
#!/bin/bash -e
VERSION="0.0.31"
VERSION="0.0.36"
rm -rf dockerbuild || true
mkdir dockerbuild


+ 14
- 1
frontend.go View File

@ -3,6 +3,7 @@ package main
import (
"bytes"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
@ -20,9 +21,11 @@ import (
"sync"
"time"
errors "git.sequentialread.com/forest/pkg-errors"
markdown "github.com/gomarkdown/markdown"
markdown_to_html "github.com/gomarkdown/markdown/html"
"github.com/gorilla/mux"
"github.com/shengdoushi/base58"
)
type Session struct {
@ -63,12 +66,20 @@ type FrontendApp struct {
AdminTenantId int
httpClient *http.Client
homepageHTML string
cssHash string
basicURLPathRegex *regexp.Regexp
applicationAuthSessions map[string]*ApplicationAuthSession
}
func initFrontend(workingDirectory string, config *Config, model *DBModel, backend *BackendApp, emailService *EmailService, ingress *IngressService) FrontendApp {
cssBytes, err := ioutil.ReadFile(filepath.Join(".", "frontend", "static", "greenhouse.css"))
if err != nil {
panic(errors.Wrap(err, "can't initFrontend because can't read cssBytes:"))
}
hashArray := sha256.Sum256(cssBytes)
cssHash := base58.Encode(hashArray[:6], base58.BitcoinAlphabet)
app := FrontendApp{
Port: config.FrontendPort,
TLSCertificate: config.FrontendTLSCertificate,
@ -92,6 +103,7 @@ func initFrontend(workingDirectory string, config *Config, model *DBModel, backe
basicURLPathRegex: regexp.MustCompile("(?i)[a-z0-9/?&_+-]+"),
applicationAuthSessions: map[string]*ApplicationAuthSession{},
homepageHTML: "<h3>Error: <code>homepageMarkdown</code> is missing</h3>",
cssHash: cssHash,
httpClient: &http.Client{
Timeout: time.Second * 5,
},
@ -391,7 +403,8 @@ func (app *FrontendApp) buildPage(responseWriter http.ResponseWriter, request *h
Highlight template.HTML
Page template.HTML
PageClass string
}{session, highlight, page, pageClass},
CSSHash string
}{session, highlight, page, pageClass, app.cssHash},
)
app.deleteCookie(responseWriter, "flash")


+ 7
- 7
frontend/alpha-profile.gotemplate.html View File

@ -123,13 +123,13 @@
You may download our installer:
</p>
<blockquote>
<a class="horizontal align-center" href="/releases/greenhouse-setup-alpha-rc0.exe">
<a class="horizontal align-center" href="/releases/greenhouse-setup-alpha-rc1.exe">
<picture>
<source srcset="/static/images/windows-installer.webp" type="image/webp">
<source srcset="/static/images/windows-installer.png" type="image/png">
<img class="os-image" src="/static/images/windows-installer.png" alt="installer icon">
</picture>
greenhouse-setup-alpha-rc0.exe
greenhouse-setup-alpha-rc1.exe
</a>
</blockquote>
<br/>
@ -219,16 +219,16 @@
</label>
<div class="vertical tab-content">
<p>
During the alpha test phase, we're only offering a simple application download for MacOS.
Download Greenhouse for Mac here:
</p>
<blockquote>
<a class="horizontal align-center" href="/releases/greenhouse-desktop-alpha-rc0.dmg">
<a class="horizontal align-center" href="/releases/greenhouse-desktop-alpha-rc1.dmg">
<picture>
<source srcset="/static/images/macos_disk_image.webp" type="image/webp">
<source srcset="/static/images/macos_disk_image.png" type="image/png">
<img class="download-image" src="/static/images/macos_disk_image.png" alt="dmg">
<img class="download-image" src="/static/images/macos_disk_image.png" alt="disk image icon">
</picture>
greenhouse-desktop-alpha-rc0.dmg
greenhouse-desktop-alpha-rc1.dmg
</a>
</blockquote>
<br/>
@ -238,7 +238,7 @@
<picture>
<source srcset="/static/images/mascot-sad.webp" type="image/webp">
<source srcset="/static/images/mascot-sad.png" type="image/png">
<img class="download-image" src="/static/images/mascot-sad.png" alt="Pitney the Pineapple frowns and sheds a single tear">
<img src="/static/images/mascot-sad.png" alt="Pitney the Pineapple frowns and sheds a single tear">
</picture>
</div>
<p>


+ 30
- 1
frontend/install-linux.gotemplate.html View File

@ -12,6 +12,7 @@
<li><a href="#uninstaller">uninstalling the greenhouse self-hosting software</a></li>
<li><a href="#docker">using greenhouse with docker</a></li>
<li><a href="#installing-manually">installing manually</a></li>
<li><a href="#technical-diagram">technical diagram</a></li>
</ul>
<br/>
@ -255,8 +256,36 @@
</a> as a template. You will only have to change step 3, where it installs the service.
How you do this depends on your init system.
</p>
<br/>
<br/>
<h2 id="technical-diagram">technical diagram</h2>
<p>
The following is a technical diagram showing how all of this works:
</p>
<picture>
<source srcset="/static/images/linux-architechture.webp" type="image/webp">
<source srcset="/static/images/linux-architechture.png" type="image/png">
<img src="/static/images/linux-architechture.png" alt="diagram showing the way the daemon and CLI are installed via the shell script installer, while the desktop app is distributed separately">
</picture>
<p>
Creating a dedicated user account for greenhouse is better for security.
This way the process we are publically exposing on the internet has the minimal
amount of permissions it needs in order to operate.
</p>
<p>
Also, at the same time, it runs in its own isolated space, and it can have exclusive ownership over files
that it needs to keep secret,
like the encryption keys it uses for TLS (what's used to serve websites securely with <code>https://...</code>)
</p>
<br/>
<br/>
</div>
</div>
</div>

+ 179
- 0
frontend/install-mac.gotemplate.html View File

@ -0,0 +1,179 @@
<div class="horizontal wrap justify-center">
<div class="box pagewidth">
<h1>installing the greenhouse self-hosting software on MacOS</h1>
<div>
<h3>table of contents</h3>
<ul>
<li><a href="#desktop-app">installing the desktop application</a></li>
<li><a href="#background-service">why do I have to install a background service?</a></li>
<li><a href="#uninstall-background-service">uninstalling the background service</a></li>
</ul>
<br/>
<h2 id="desktop-app">installing the desktop application</h2>
<p>
Download Greenhouse for Mac here:
</p>
<blockquote>
<a class="horizontal align-center" href="/releases/greenhouse-desktop-alpha-rc1.dmg">
<picture>
<source srcset="/static/images/macos_disk_image.webp" type="image/webp">
<source srcset="/static/images/macos_disk_image.png" type="image/png">
<img class="download-image" src="/static/images/macos_disk_image.png" alt="disk image icon">
</picture>
greenhouse-desktop-alpha-rc1.dmg
</a>
</blockquote>
<br/>
<br/>
<div class="mascot admonition">
<div class="emoji-icon">
<picture>
<source srcset="/static/images/mascot-sad.webp" type="image/webp">
<source srcset="/static/images/mascot-sad.png" type="image/png">
<img src="/static/images/mascot-sad.png" alt="Pitney the Pineapple frowns and sheds a single tear">
</picture>
</div>
<p>
Unfortunately Apple has made it very hard to run applications that did not come from their App Store.
</p>
<p>
The Greenhouse application is also not "code-signed" by Apple yet, making it a 3rd-class citizen on thier platform.
</p>
</div>
<p>
After you you drag and drop the Greenhouse app into your applications folder,
you will have to right-click (or hold down the control key and then click) on the Greenhouse app and choose "Open":
</p>
<picture>
<source srcset="/static/images/mac-right-click.webp" type="image/webp">
<source srcset="/static/images/mac-right-click.png" type="image/png">
<img src="/static/images/mac-right-click.png" alt='The right-click menu for the Greenhouse app with "Open" highlighted'>
</picture>
<p>
After this, MacOS will ask you if you are sure you want to open it, choose "Open" again:
</p>
<picture>
<source srcset="/static/images/mac-are-you-sure.webp" type="image/webp">
<source srcset="/static/images/mac-are-you-sure.png" type="image/png">
<img src="/static/images/mac-are-you-sure.png" alt='The MacOS confirmation dialog for programs downloaded from the internet'>
</picture>
<p>
For more information, see Apple Support:
<a href="https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac">
Open a Mac app from an unidentified developer</a>.
</p>
<br/>
<br/>
<h2 id="background-service">why do I have to install a background service?</h2>
<div class="emoji-icon">
<picture>
<source srcset="/static/images/mascot-confused.webp" type="image/webp">
<source srcset="/static/images/mascot-confused.png" type="image/png">
<img src="/static/images/mascot-confused.png" alt="Pitney the Pineapple is confused">
</picture>
</div>
<p>
After you open the Greenhouse application for the first time, it will ask you to enter an administrator
password to install a background service.
</p>
<p>
Because the <a href="https://build-system.fman.io/">
tool we used to build this application
</a> doesn't support the creation of fully fledged installers for MacOS,
we don't have a way to automatically install the server components of Greenhouse on your computer.
</p>
<p>
Greenhouse contains system service called a
<a href="https://git.sequentialread.com/forest/greenhouse-daemon/">
daemon
</a>
which runs in the background all the time.
The daemon is responsible for serving any websites or services that you choose to publish to the internet.
</p>
<p>
The following is a technical diagram showing how all of this works:
</p>
<picture>
<source srcset="/static/images/mac-architechture.webp" type="image/webp">
<source srcset="/static/images/mac-architechture.png" type="image/png">
<img src="/static/images/mac-architechture.png" alt="diagram showing the way the Greenhouse app elevates to root and then executes a shell script to create the greenhouse user and install the greenhouse launchd system daemon">
</picture>
<p>
In this case, the administrator access is required to create the service user account for greenhouse,
as well as define the daemon configuration using <code>launchd</code>, the MacOS system service manager.
</p>
<p>
Creating a dedicated user account for greenhouse is better for security.
This way the process we are publically exposing on the internet has the minimal
amount of permissions it needs in order to operate.
</p>
<p>
Also, at the same time, it runs in its own isolated space, and it can have exclusive ownership over files
that it needs to keep secret,
like the encryption keys it uses for TLS (what's used to serve websites securely with <code>https://...</code>)
</p>
<br/>
<br/>
<h2 id="uninstall-background-service">uninstalling the background service</h2>
<div class="emoji-icon">
<picture>
<source srcset="/static/images/mascot-dead.webp" type="image/webp">
<source srcset="/static/images/mascot-dead.png" type="image/png">
<img src="/static/images/mascot-dead.png" alt="Pitney the Pineapple Fucking Dies dot png">
</picture>
</div>
<p>
Unfortunately right now there's no way to uninstall the background service through the Greenhouse app.
</p>
<p>
However, it fairly trivial to at least stop it and disable it using the Terminal. To do this, first open
the Terminal app (it's inside <code>/Applications/Utilities</code>)
</p>
<p>
Then run the following two commands. Again, you will have to enter your Administrator password to do this.
This command will stop it from running:
</p>
<p>
<pre class="install-command">sudo launchctl unload /Library/LaunchDaemons/garden.server.greenhouse-daemon.plist</pre>
</p>
<p>
and this command will disable it so it does not start again when you restart your computer:
</p>
<p>
<pre class="install-command">sudo launchctl disable system/garden.server.greenhouse-daemon</pre>
</p>
<br/>
<br/>
</div>
</div>
</div>

+ 77
- 0
frontend/install-windows.gotemplate.html View File

@ -0,0 +1,77 @@
<div class="horizontal wrap justify-center">
<div class="box pagewidth">
<h1>installing the greenhouse self-hosting software on Windows</h1>
<div>
<h3>table of contents</h3>
<ul>
<li><a href="#installing">installing the greenhouse</a></li>
<li><a href="#uninstalling">uninstalling the greenhouse</a></li>
</ul>
<br/>
<h2 id="installing">installing the greenhouse application</h2>
<p>
Download Greenhouse for Windows here:
</p>
<blockquote>
<a class="horizontal align-center" href="/releases/greenhouse-setup-alpha-rc1.exe">
<picture>
<source srcset="/static/images/windows-installer.webp" type="image/webp">
<source srcset="/static/images/windows-installer.png" type="image/png">
<img class="os-image" src="/static/images/windows-installer.png" alt="installer icon">
</picture>
greenhouse-setup-alpha-rc1.exe
</a>
</blockquote>
<br/>
<br/>
<div class="mascot admonition">
<div class="emoji-icon">
<picture>
<source srcset="/static/images/mascot-sad.webp" type="image/webp">
<source srcset="/static/images/mascot-sad.png" type="image/png">
<img src="/static/images/mascot-sad.png" alt="Pitney the Pineapple frowns and sheds a single tear">
</picture>
</div>
<p>
Some computers ship with the windows operating system pre-configured to only allow applications from the Microsoft Store.
This is called "Windows S Mode". If your computer is like this, you won't be able to run our installer until you turn S Mode off.
</p>
<p>
Microsoft Support:
<a href="https://support.microsoft.com/en-us/windows/switching-out-of-s-mode-in-windows-4f56d9be-99ec-6983-119f-031bfb28a307#WindowsVersion=Windows_10">
Switching out of S mode in Windows</a>.
</p>
</div>
<h2 id="uninstalling">uninstalling the greenhouse application</h2>
<div class="emoji-icon">
<picture>
<source srcset="/static/images/mascot-dead.webp" type="image/webp">
<source srcset="/static/images/mascot-dead.png" type="image/png">
<img src="/static/images/mascot-dead.png" alt="Pitney the Pineapple Fucking Dies dot png">
</picture>
</div>
<p>
You may uninstall greenhouse just like any other app;
simply go to the Control Panel, then go to Programs and Features, find greenhouse in the list,
and choose "Uninstall/Change"
</p>
<br/>
<br/>
</div>
</div>
</div>

+ 1
- 1
frontend/page.gotemplate.html View File

@ -8,7 +8,7 @@
<link rel="shortcut icon" href="/static/favicon.png" />
<!-- <link rel="apple-touch-icon" href="/static/icon.png" /> -->
<link href="/static/greenhouse.css?v=2" rel="stylesheet">
<link href="/static/greenhouse.css?v={{.CSSHash}}" rel="stylesheet">
<link href="/static/vendor/normalize.css" rel="stylesheet">
<link href="/static/vendor/nunito.css" rel="stylesheet">


+ 4
- 1
frontend/static/greenhouse.css View File

@ -1,5 +1,5 @@
html {
height: 100%;
min-height: 100%;
}
body {
@ -118,6 +118,9 @@ header .session-status a {
font-weight: 600;
color: white;
}
header .session-status a {
text-decoration-thickness: 2px;
}
header .session-status {
margin-top: 0.2em;
margin-right: 0.8em;


+ 4
- 0
frontend/static/image-sources/generate_webp.sh View File

@ -45,6 +45,7 @@ pngToWebp () {
# svgToWebp "blah.svg" "$quality" "120" "105"
pngToWebp "mascot-angry.png" "$lowerquality" "icon"
pngToWebp "mascot-confused.png" "$lowerquality" "icon"
pngToWebp "mascot-dead.png" "$lowerquality" "icon"
pngToWebp "mascot-dancing.png" "$lowerquality" "icon"
pngToWebp "mascot-laptop.png" "$lowerquality" "icon"
@ -69,4 +70,7 @@ pngToWebp "windows-installer.png" "$quality" "icon"
# pngToWebp "arm.png" "$quality" "text"
pngToWebp "raspberrypi.png" "$quality" "icon"
pngToWebp "debian-package.png" "$quality" "icon"
pngToWebp "mac-are-you-sure.png" "$quality" "text"
pngToWebp "mac-right-click.png" "$quality" "text"
pngToWebp "mac-architechture.png" "$quality" "text"

BIN
frontend/static/images/mac-architechture.png View File

Before After
Width: 879  |  Height: 449  |  Size: 85 KiB

BIN
frontend/static/images/mac-architechture.webp View File

Before After

BIN
frontend/static/images/mac-are-you-sure.png View File

Before After
Width: 523  |  Height: 205  |  Size: 26 KiB

BIN
frontend/static/images/mac-are-you-sure.webp View File

Before After

BIN
frontend/static/images/mac-right-click.png View File

Before After
Width: 479  |  Height: 155  |  Size: 30 KiB

BIN
frontend/static/images/mac-right-click.webp View File

Before After

BIN
frontend/static/images/mascot-confused.png View File

Before After
Width: 256  |  Height: 256  |  Size: 23 KiB

BIN
frontend/static/images/mascot-confused.webp View File

Before After

+ 14
- 0
frontend_howto.go View File

@ -41,6 +41,20 @@ func registerHowtoRoutes(app *FrontendApp) {
},
)
app.handleWithSessionNotRequired(
"/install-greenhouse-self-hosting-software-mac",
func(responseWriter http.ResponseWriter, request *http.Request, session Session) {
app.buildPageFromTemplate(responseWriter, request, session, "install-mac.html", struct{}{})
},
)
app.handleWithSessionNotRequired(
"/install-greenhouse-self-hosting-software-windows",
func(responseWriter http.ResponseWriter, request *http.Request, session Session) {
app.buildPageFromTemplate(responseWriter, request, session, "install-windows.html", struct{}{})
},
)
serveScripts := []string{
"install.sh",
"uninstall.sh",


+ 10
- 4
readme/ALPHA.md View File

@ -1,5 +1,5 @@
## Terms of Service / Privacy Policy / License
## terms of service / privacy policy / license
Registering a Greenhouse account constitutes your agreement to the following terms:
@ -11,12 +11,12 @@ Registering a Greenhouse account constitutes your agreement to the following ter
* This data is stored on our server, and will never be copied or shared outside of our physical premises. We intend to delete it permanently after the alpha test program completes
Greenhouse is currently [licensed under the GNU General Public License v3](https://git.sequentialread.com/forest/greenhouse/src/branch/master/LICENSE.md).
Greenhouse's source code is currently [licensed under the GNU General Public License v3](https://git.sequentialread.com/forest/greenhouse/src/branch/master/LICENSE.md).
This means you are allowed to modify it, create your own version of it, etc, as long as you publish your work on the internet.
GREENHOUSE AND ITS CLIENT SOFTWARE PACKAGES ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND
## Feedback / Bug Reports
## feedback / bug reports
Please use the comments form below to leave feedback or report issues.
@ -24,13 +24,19 @@ Please use the comments form below to leave feedback or report issues.
If you wish to contact the developer directly, you may email `forest@sequentialread.com`, contact `@forestjohnson:cyberia.club` on [matrix](https://cyberia.club/matrix), or get in touch [on the Fediverse](https://social.pixie.town/web/accounts/74557)
## Known Issues
## known issues
```
- the UI text on the mac version of the desktop app is a bit too small.. ?
- the greenhouse web app will log you out randomly if you use it for a long time (refresh session does not work)
- change personal subdomain is somewhat buggy, requires you to restart the desktop app / re-create your tunnels
- the desktop app listening port chooser is kinda jacked up right now
- it always displays "test" for the program name
- need some way to sudo it on mac and linux so it can actually get the pids and program names from the sockets.
- desktop app constantly scrolling to the top of the tunnels list (so far fixed with heuristic method)
- when greenhouse cloud is down, the cli fails(ish) silently (status returns null for client statuses)


Loading…
Cancel
Save