portables can only be 64 bit unless I find out something new about jpackage

This commit is contained in:
idk
2022-03-07 18:56:24 -05:00
parent 4602d7c92a
commit 9edebd1512
7 changed files with 609 additions and 37 deletions

View File

@ -1,11 +1,12 @@
VERSION=0.0.5 VERSION=0.0.5
#CGO_ENABLED=0 #CGO_ENABLED=0
#export CGO_ENABLED=0 #export CGO_ENABLED=0
export PKG_CONFIG_PATH=/usr/lib/$(uname -m)-linux-musl/pkgconfig
GOOS?=$(shell uname -s | tr A-Z a-z) GOOS?=$(shell uname -s | tr A-Z a-z)
GOARCH?="amd64" GOARCH?="amd64"
ARG=-v -tags netgo -ldflags '-w -extldflags "-static"' ARG=-v -tags netgo -ldflags '-w' # -extldflags "-static"'
#FLAGS=/usr/lib/x86_64-linux-gnu/libboost_system.a /usr/lib/x86_64-linux-gnu/libboost_date_time.a /usr/lib/x86_64-linux-gnu/libboost_filesystem.a /usr/lib/x86_64-linux-gnu/libboost_program_options.a /usr/lib/x86_64-linux-gnu/libssl.a /usr/lib/x86_64-linux-gnu/libcrypto.a /usr/lib/x86_64-linux-gnu/libz.a #FLAGS=/usr/lib/x86_64-linux-gnu/libboost_system.a /usr/lib/x86_64-linux-gnu/libboost_date_time.a /usr/lib/x86_64-linux-gnu/libboost_filesystem.a /usr/lib/x86_64-linux-gnu/libboost_program_options.a /usr/lib/x86_64-linux-gnu/libssl.a /usr/lib/x86_64-linux-gnu/libcrypto.a /usr/lib/x86_64-linux-gnu/libz.a
#ARG=-ldflags '-w -linkmode=external -extldflags "-static -ldl $(FLAGS)"' #ARG=-ldflags '-w -linkmode=external -extldflags "-static -ldl $(FLAGS)"'
#NOSTATIC=-v -tags netgo -ldflags '-w -extldflags "-ldl $(FLAGS)"' #NOSTATIC=-v -tags netgo -ldflags '-w -extldflags "-ldl $(FLAGS)"'
@ -62,13 +63,14 @@ clean:
all: windows linux osx bsd all: windows linux osx bsd
portable.zip: all portable.zip: all
zip -r portable.zip $(BINARY)-linux-amd64 \ cp $(BINARY)-windows-amd64 $(BINARY)-windows-amd64.exe
$(BINARY)-windows-amd64.exe \ cp $(BINARY)-windows-386 $(BINARY)-windows-386.exe
$(BINARY)-osx-amd64 \ zip -r portable.zip browse.cmd \
$(BINARY)-linux-386 \ $(BINARY)-linux-amd64 \
$(BINARY)-windows-386.exe \ $(BINARY)-windows-amd64 \
$(BINARY)-osx-arm64 \ #$(BINARY)-darwin-amd64 \
browse.cmd #$(BINARY)-darwin-arm64 \
backup-embed: backup-embed:
mkdir -p ../../../github.com/eyedeekay/go-I2P-jpackage.bak mkdir -p ../../../github.com/eyedeekay/go-I2P-jpackage.bak
@ -94,8 +96,11 @@ winplugin:
linplugin: linplugin:
GOOS=linux make backup-embed build unbackup-embed GOOS=linux make backup-embed build unbackup-embed
linplugin-nosystray:
GOOS=linux make backup-embed nosystray unbackup-embed
osxplugin: osxplugin:
GOOS=darwin make backup-embed build unbackup-embed GOOS=darwin make backup-embed nosystray unbackup-embed
windows: windows:
GOOS=windows GOARCH=amd64 make winplugin su3 unembed-linux build unbackup-embed GOOS=windows GOARCH=amd64 make winplugin su3 unembed-linux build unbackup-embed
@ -104,11 +109,11 @@ windows:
linux: linux:
GOOS=linux GOARCH=amd64 make linplugin su3 unembed-windows build unbackup-embed GOOS=linux GOARCH=amd64 make linplugin su3 unembed-windows build unbackup-embed
# GOOS=linux GOARCH=arm64 make linplugin su3 unembed-windows build unbackup-embed # GOOS=linux GOARCH=arm64 make linplugin su3 unembed-windows build unbackup-embed
GOOS=linux GOARCH=386 make linplugin su3 unembed-windows build unbackup-embed PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig GOOS=linux GOARCH=386 make linplugin-nosystray su3 unembed-windows nosystray unbackup-embed
osx: osx:
GOOS=darwin GOARCH=amd64 make osxplugin su3 unembed-windows unembed-linux build unbackup-embed GOOS=darwin GOARCH=amd64 make osxplugin su3 unembed-windows unembed-linux nosystray unbackup-embed
GOOS=darwin GOARCH=arm64 make osxplugin su3 unembed-windows unembed-linux build unbackup-embed GOOS=darwin GOARCH=arm64 make osxplugin su3 unembed-windows unembed-linux nosystray unbackup-embed
bsd: bsd:
# GOOS=freebsd GOARCH=amd64 make build su3 # GOOS=freebsd GOARCH=amd64 make build su3

View File

@ -74,7 +74,7 @@ The plugin will not start a Tor instance if a SOCKS proxy is open on port 9050.
4. Use Bittorrent-over-I2P to download the Tor Browser software 4. Use Bittorrent-over-I2P to download the Tor Browser software
- Not Done, but pretty trivial. Fetch it from "somewhere", and drop it in the Snark directory. - Not Done, but pretty trivial. Fetch it from "somewhere", and drop it in the Snark directory.
5. Embed jpackaged I2P routers and manage them internally 5. Embed jpackaged I2P routers and manage them internally
- Works on Windows and Linux. Can be done on OSX but needs to be different. - Works on Windows and Linux. Can be done on OSX but needs to be different. AMD64 only.
6. Encrypt the "Working directory" with all the plugin data using a password. 6. Encrypt the "Working directory" with all the plugin data using a password.
- Works on Windows, Linux, and OSX. - Works on Windows, Linux, and OSX.
7. Use a transparently encrypted filesystem to interact with the host system. 7. Use a transparently encrypted filesystem to interact with the host system.

30
brb.go Normal file
View File

@ -0,0 +1,30 @@
package main
import (
"log"
"os"
"path/filepath"
trayirc "i2pgit.org/idk/libbrb"
)
func BRBClient(directory, server string) {
brbdirectory := filepath.Join(directory, "brb")
brbdirectory, err := filepath.Abs(brbdirectory)
if err != nil {
log.Println(err)
return
}
os.MkdirAll(brbdirectory, 0755)
brb, err := trayirc.NewBRBFromOptions(
trayirc.SetBRBConfigDirectory(brbdirectory),
trayirc.SetBRBServerName(server),
trayirc.SetBRBServerConfig("ircd.yml"),
)
if err != nil {
log.Fatal(err)
}
if err = brb.IRC(); err != nil {
log.Fatal(err)
}
}

72
go.mod
View File

@ -29,7 +29,7 @@ require (
github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.17.0 // indirect github.com/onsi/gomega v1.17.0 // indirect
github.com/otiai10/copy v1.7.0 github.com/otiai10/copy v1.7.0
github.com/russross/blackfriday v1.6.0 github.com/russross/blackfriday v2.0.0+incompatible
github.com/ulikunitz/xz v0.5.10 github.com/ulikunitz/xz v0.5.10
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
howett.net/plist v1.0.0 // indirect howett.net/plist v1.0.0 // indirect
@ -39,8 +39,23 @@ require (
git.torproject.org/pluggable-transports/snowflake.git v1.1.1-0.20211028140501-0a2598a1e854 // indirect git.torproject.org/pluggable-transports/snowflake.git v1.1.1-0.20211028140501-0a2598a1e854 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20220113124808-70ae35bab23f // indirect github.com/ProtonMail/go-crypto v0.0.0-20220113124808-70ae35bab23f // indirect
github.com/ProtonMail/go-mime v0.0.0-20190923161245-9b5a4261663a // indirect github.com/ProtonMail/go-mime v0.0.0-20190923161245-9b5a4261663a // indirect
github.com/RoaringBitmap/roaring v0.4.23 // indirect
github.com/akavel/rsrc v0.10.2 // indirect github.com/akavel/rsrc v0.10.2 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blevesearch/bleve v1.0.9 // indirect
github.com/blevesearch/go-porterstemmer v1.0.3 // indirect
github.com/blevesearch/mmap-go v1.0.2 // indirect
github.com/blevesearch/segment v0.9.0 // indirect
github.com/blevesearch/snowballstem v0.9.0 // indirect
github.com/blevesearch/zap/v11 v11.0.9 // indirect
github.com/blevesearch/zap/v12 v12.0.9 // indirect
github.com/blevesearch/zap/v13 v13.0.1 // indirect
github.com/blevesearch/zap/v14 v14.0.0 // indirect
github.com/boreq/friendlyhash v0.0.0-20190522010448-1ca64b3ca69e // indirect github.com/boreq/friendlyhash v0.0.0-20190522010448-1ca64b3ca69e // indirect
github.com/caddyserver/certmagic v0.11.2 // indirect
github.com/cenkalti/backoff/v4 v4.0.2 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/couchbase/vellum v1.0.1 // indirect
github.com/cretz/bine v0.2.0 // indirect github.com/cretz/bine v0.2.0 // indirect
github.com/dchest/jsmin v0.0.0-20160823214000-faeced883947 // indirect github.com/dchest/jsmin v0.0.0-20160823214000-faeced883947 // indirect
github.com/dsnet/compress v0.0.1 // indirect github.com/dsnet/compress v0.0.1 // indirect
@ -48,7 +63,8 @@ require (
github.com/emirpasic/gods v1.12.0 // indirect github.com/emirpasic/gods v1.12.0 // indirect
github.com/eyedeekay/go-i2cp v0.0.0-20190716135428-6d41bed718b0 // indirect github.com/eyedeekay/go-i2cp v0.0.0-20190716135428-6d41bed718b0 // indirect
github.com/eyedeekay/goSam v0.32.31-0.20210415231611-c6d9c0e340b8 // indirect github.com/eyedeekay/goSam v0.32.31-0.20210415231611-c6d9c0e340b8 // indirect
github.com/eyedeekay/sam-forwarder v0.0.0-20190908210105-71ca8cd65fda // indirect github.com/eyedeekay/sam-forwarder v0.32.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gen2brain/dlgs v0.0.0-20211108104213-bade24837f0b // indirect github.com/gen2brain/dlgs v0.0.0-20211108104213-bade24837f0b // indirect
github.com/getlantern/context v0.0.0-20190109183933-c447772a6520 // indirect github.com/getlantern/context v0.0.0-20190109183933-c447772a6520 // indirect
github.com/getlantern/errors v1.0.1 // indirect github.com/getlantern/errors v1.0.1 // indirect
@ -56,24 +72,46 @@ require (
github.com/getlantern/hex v0.0.0-20190417191902-c6586a6fe0b7 // indirect github.com/getlantern/hex v0.0.0-20190417191902-c6586a6fe0b7 // indirect
github.com/getlantern/hidden v0.0.0-20201229170000-e66e7f878730 // indirect github.com/getlantern/hidden v0.0.0-20201229170000-e66e7f878730 // indirect
github.com/getlantern/ops v0.0.0-20200403153110-8476b16edcd6 // indirect github.com/getlantern/ops v0.0.0-20200403153110-8476b16edcd6 // indirect
github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a // indirect
github.com/go-acme/lego/v3 v3.7.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect github.com/go-stack/stack v1.8.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect github.com/golang/snappy v0.0.4 // indirect
github.com/google/uuid v1.3.0 // indirect github.com/google/uuid v1.3.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 // indirect
github.com/gorilla/websocket v1.4.2 // indirect github.com/gorilla/websocket v1.4.2 // indirect
github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940 // indirect
github.com/goshuirc/irc-go v0.0.0-20180430075055-8d136c4f9287 // indirect
github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 // indirect github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/janosgyerik/portping v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josephspurrier/goversioninfo v1.3.0 // indirect github.com/josephspurrier/goversioninfo v1.3.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/khlieng/dispatch v0.6.5-0.20201210080608-721492cae225 // indirect
github.com/kjk/betterguid v0.0.0-20170621091430-c442874ba63a // indirect
github.com/klauspost/cpuid v1.3.1 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/kr/pretty v0.3.0 // indirect github.com/kr/pretty v0.3.0 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mailru/easyjson v0.7.2-0.20200424172602-f0a000e7a8e0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mholt/archiver v3.1.1+incompatible // indirect github.com/mholt/archiver v3.1.1+incompatible // indirect
github.com/miekg/dns v1.1.29 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.3.2 // indirect
github.com/mmcloughlin/professor v0.0.0-20170922221822-6b97112ab8b3 // indirect
github.com/mschoch/smat v0.2.0 // indirect
github.com/mwitkow/go-http-dialer v0.0.0-20161116154839-378f744fb2b8 // indirect github.com/mwitkow/go-http-dialer v0.0.0-20161116154839-378f744fb2b8 // indirect
github.com/ncruces/zenity v0.7.12 // indirect github.com/ncruces/zenity v0.7.12 // indirect
github.com/nwaples/rardecode v1.1.2 // indirect github.com/nwaples/rardecode v1.1.2 // indirect
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
github.com/pelletier/go-toml v1.8.0 // indirect
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 // indirect github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 // indirect
github.com/philhofer/fwd v1.0.0 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pion/datachannel v1.5.2 // indirect github.com/pion/datachannel v1.5.2 // indirect
github.com/pion/dtls/v2 v2.0.10 // indirect github.com/pion/dtls/v2 v2.0.10 // indirect
@ -93,22 +131,48 @@ require (
github.com/pion/udp v0.1.1 // indirect github.com/pion/udp v0.1.1 // indirect
github.com/pion/webrtc/v3 v3.1.11 // indirect github.com/pion/webrtc/v3 v3.1.11 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/prologic/eris v1.6.7-0.20210430033226-64d4acc46ca7 // indirect
github.com/prometheus/client_golang v1.10.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.18.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/randall77/makefat v0.0.0-20210315173500-7ddd0e42c844 // indirect github.com/randall77/makefat v0.0.0-20210315173500-7ddd0e42c844 // indirect
github.com/sergi/go-diff v1.0.0 // indirect github.com/sergi/go-diff v1.0.0 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect github.com/sethvargo/go-password v0.2.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.0 // indirect
github.com/src-d/gcfg v1.4.0 // indirect github.com/src-d/gcfg v1.4.0 // indirect
github.com/steveyen/gtreap v0.1.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/tdewolff/minify/v2 v2.7.6 // indirect
github.com/tdewolff/parse/v2 v2.4.3 // indirect
github.com/tinylib/msgp v1.1.2 // indirect
github.com/willf/bitset v1.1.10 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/xdg-go/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
github.com/xdg/stringprep v1.0.0 // indirect
github.com/xgfone/bt v0.4.1 // indirect github.com/xgfone/bt v0.4.1 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/zieckey/goini v0.0.0-20180118150432-0da17d361d26 // indirect github.com/zieckey/goini v0.0.0-20180118150432-0da17d361d26 // indirect
go.etcd.io/bbolt v1.3.4 // indirect
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d // indirect golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d // indirect
golang.org/x/text v0.3.6 // indirect golang.org/x/text v0.3.6 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/ini.v1 v1.57.0 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
i2pgit.org/idk/blizzard v0.0.0-20220227235230-3195113af0da // indirect i2pgit.org/idk/blizzard v0.0.0-20220227235230-3195113af0da // indirect
i2pgit.org/idk/libbrb v0.0.0-20220307233356-c3d096b02f9e
) )
//replace github.com/getlantern/systray v1.1.0 => github.com/eyedeekay/systray v1.1.1-0.20220213191004-800d7458fdfd //replace github.com/getlantern/systray v1.1.0 => github.com/eyedeekay/systray v1.1.1-0.20220213191004-800d7458fdfd

465
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -96,6 +96,7 @@ var (
torrent = flag.Bool("torrent", tbget.TorrentReady(), "Create a torrent of the downloaded files and seed it over I2P using an Open Tracker") torrent = flag.Bool("torrent", tbget.TorrentReady(), "Create a torrent of the downloaded files and seed it over I2P using an Open Tracker")
destruct = flag.Bool("destruct", false, "Destructively delete the working directory when finished") destruct = flag.Bool("destruct", false, "Destructively delete the working directory when finished")
password = flag.String("password", Password(), "Password to encrypt the working directory with. Implies -destruct, only the encrypted container will be saved.") password = flag.String("password", Password(), "Password to encrypt the working directory with. Implies -destruct, only the encrypted container will be saved.")
chat = flag.Bool("chat", false, "Open a WebChat client")
/*ptop = flag.Bool("p2p", false, "Use bittorrent over I2P to download the initial copy of Tor Browser")*/ /*ptop = flag.Bool("p2p", false, "Use bittorrent over I2P to download the initial copy of Tor Browser")*/
) )
@ -275,6 +276,10 @@ func main() {
} }
} }
client.TBS.RunTorWithLang() client.TBS.RunTorWithLang()
if *chat {
log.Println("Starting I2P chat")
go BRBClient(*directory, "brb")
}
if *i2pbrowser { if *i2pbrowser {
if err := client.TBS.RunI2PBWithLang(); err != nil { if err := client.TBS.RunI2PBWithLang(); err != nil {
log.Fatal(err) log.Fatal(err)

View File

@ -66,56 +66,59 @@ func (m *Client) PageHTML() []byte {
dir := filepath.Dir(m.TBD.DownloadPath) dir := filepath.Dir(m.TBD.DownloadPath)
mdpath := filepath.Join(dir, m.TBD.Lang, "index.md") mdpath := filepath.Join(dir, m.TBD.Lang, "index.md")
mdbytes, err := ioutil.ReadFile(mdpath) mdbytes, err := ioutil.ReadFile(mdpath)
markdown := blackfriday.New()
if err != nil { if err != nil {
htmlbytes := blackfriday.MarkdownCommon(defaultmd) htmlbytes := markdown.Parse(defaultmd)
return htmlbytes return []byte(htmlbytes.String())
} }
htmlbytes := blackfriday.MarkdownCommon(mdbytes) htmlbytes := markdown.Parse(mdbytes)
return htmlbytes return []byte(htmlbytes.String())
} }
// TorOnStatusHTML returns the HTML for "Tor Status" section the page // TorOnStatusHTML returns the HTML for "Tor Status" section the page
func (m *Client) TorOnStatusHTML(ours bool) []byte { func (m *Client) TorOnStatusHTML(ours bool) []byte {
dir := filepath.Dir(m.TBD.DownloadPath) dir := filepath.Dir(m.TBD.DownloadPath)
markdown := blackfriday.New()
if ours { if ours {
mdpath := filepath.Join(dir, m.TBD.Lang, "stoptor.md") mdpath := filepath.Join(dir, m.TBD.Lang, "stoptor.md")
torbytes, err := ioutil.ReadFile(mdpath) torbytes, err := ioutil.ReadFile(mdpath)
if err != nil { if err != nil {
htmlbytes := blackfriday.MarkdownCommon(torstop) htmlbytes := markdown.Parse(torstop)
return htmlbytes return []byte(htmlbytes.String())
} }
htmlbytes := blackfriday.MarkdownCommon(torbytes) htmlbytes := markdown.Parse(torbytes)
return htmlbytes return []byte(htmlbytes.String())
} }
mdpath := filepath.Join(dir, m.TBD.Lang, "torstarted.md") mdpath := filepath.Join(dir, m.TBD.Lang, "torstarted.md")
toron, err := ioutil.ReadFile(mdpath) toron, err := ioutil.ReadFile(mdpath)
if err != nil { if err != nil {
htmlbytes := blackfriday.MarkdownCommon(torrunning) htmlbytes := markdown.Parse(torrunning)
return htmlbytes return []byte(htmlbytes.String())
} }
htmlbytes := blackfriday.MarkdownCommon(toron) htmlbytes := markdown.Parse(toron)
return htmlbytes return []byte(htmlbytes.String())
} }
// TorOffStatusHTML returns the HTML for "Tor Status" section the page // TorOffStatusHTML returns the HTML for "Tor Status" section the page
func (m *Client) TorOffStatusHTML(ours bool) []byte { func (m *Client) TorOffStatusHTML(ours bool) []byte {
dir := filepath.Dir(m.TBD.DownloadPath) dir := filepath.Dir(m.TBD.DownloadPath)
markdown := blackfriday.New()
if ours { if ours {
mdpath := filepath.Join(dir, m.TBD.Lang, "startor.md") mdpath := filepath.Join(dir, m.TBD.Lang, "startor.md")
torbytes, err := ioutil.ReadFile(mdpath) torbytes, err := ioutil.ReadFile(mdpath)
if err != nil { if err != nil {
htmlbytes := blackfriday.MarkdownCommon(torstart) htmlbytes := markdown.Parse(torstart)
return htmlbytes return []byte(htmlbytes.String())
} }
htmlbytes := blackfriday.MarkdownCommon(torbytes) htmlbytes := markdown.Parse(torbytes)
return htmlbytes return []byte(htmlbytes.String())
} }
mdpath := filepath.Join(dir, m.TBD.Lang, "torstopped.md") mdpath := filepath.Join(dir, m.TBD.Lang, "torstopped.md")
toroff, err := ioutil.ReadFile(mdpath) toroff, err := ioutil.ReadFile(mdpath)
if err != nil { if err != nil {
htmlbytes := blackfriday.MarkdownCommon(torstopped) htmlbytes := markdown.Parse(torstopped)
return htmlbytes return []byte(htmlbytes.String())
} }
htmlbytes := blackfriday.MarkdownCommon(toroff) htmlbytes := markdown.Parse(toroff)
return htmlbytes return []byte(htmlbytes.String())
} }