11 Commits

Author SHA1 Message Date
idk
7b097119b3 Bump, update changelog, re-release 2021-12-14 19:13:23 -05:00
idk
59fefebb3b Bump version 2021-12-14 16:20:04 -05:00
idk
5fcf1a9ebd Remove console URL from su3 generator 2021-12-14 16:19:35 -05:00
idk
d4bdf43bfe Bump for re-release 2021-12-13 13:25:38 -05:00
idk
c792d21e93 Fix index 2021-12-13 13:23:28 -05:00
idk
48a91b87cb Fix index 2021-12-13 10:01:29 -05:00
idk
4045bbb373 fix updateurl 2021-12-11 21:09:39 -05:00
idk
a22f7d20d5 fix updateurl 2021-12-11 21:07:46 -05:00
idk
66473209bd upgrade 2021-12-11 19:28:35 -05:00
idk
7bffda6818 give it a page too 2021-12-11 15:38:45 -05:00
idk
73fe81d8d1 give it a page too 2021-12-11 15:18:06 -05:00
6 changed files with 44 additions and 21 deletions

View File

@@ -1,3 +1,8 @@
# 0.0.07
- restart changelog.
- fix websiteURL in plugin.
# 1.14.0 # 1.14.0
* Stop publishing arm releases. * Stop publishing arm releases.

View File

@@ -1,4 +1,4 @@
VERSION=0.0.02 VERSION=0.0.07
CGO_ENABLED=0 CGO_ENABLED=0
export CGO_ENABLED=0 export CGO_ENABLED=0
@@ -10,6 +10,7 @@ ARG=-v -tags netgo -ldflags '-w -extldflags "-static"'
BINARY=terrarium BINARY=terrarium
SIGNER=hankhill19580@gmail.com SIGNER=hankhill19580@gmail.com
CONSOLEPOSTNAME=IRC CONSOLEPOSTNAME=IRC
USER_GH=eyedeekay
build: dep build: dep
go build $(ARG) -tags="netgo" -o $(BINARY)-$(GOOS)-$(GOARCH) ./cmd/$(BINARY) go build $(ARG) -tags="netgo" -o $(BINARY)-$(GOOS)-$(GOARCH) ./cmd/$(BINARY)
@@ -49,12 +50,13 @@ su3:
-autostart=true \ -autostart=true \
-clientname=$(BINARY)-$(GOOS)-$(GOARCH) \ -clientname=$(BINARY)-$(GOOS)-$(GOARCH) \
-consolename="$(BINARY) - $(CONSOLEPOSTNAME)" \ -consolename="$(BINARY) - $(CONSOLEPOSTNAME)" \
-consoleurl="http://127.0.0.1:8084" \
-name="$(BINARY)-$(GOOS)-$(GOARCH)" \ -name="$(BINARY)-$(GOOS)-$(GOARCH)" \
-delaystart="1" \ -delaystart="1" \
-desc="`cat desc`" \ -desc="`cat desc`" \
-exename=$(BINARY)-$(GOOS)-$(GOARCH) \ -exename=$(BINARY)-$(GOOS)-$(GOARCH) \
-icondata=icon/icon.png \ -icondata=icon/icon.png \
-updateurl="http://idk.i2p/terrarium/$(BINARY)-$(GOOS)-$(GOARCH).su3" \
-website="http://idk.i2p/terrarium/" \
-command="$(BINARY)-$(GOOS)-$(GOARCH) -conf \"\$$PLUGIN/catbox-i2p.conf\"" \ -command="$(BINARY)-$(GOOS)-$(GOARCH) -conf \"\$$PLUGIN/catbox-i2p.conf\"" \
-license=MIT \ -license=MIT \
-res=conf/ -res=conf/
@@ -64,10 +66,10 @@ sum:
sha256sum $(BINARY)-$(GOOS)-$(GOARCH).su3 sha256sum $(BINARY)-$(GOOS)-$(GOARCH).su3
version: version:
@echo gothub release -u eyedeekay -r terrarium -t "$(VERSION)" -d "`cat desc`"; true gothub release -u eyedeekay -r terrarium -t "$(VERSION)" -d "`cat desc`"; true
upload: upload:
@echo gothub upload -u eyedeekay -r terrarium -t "$(VERSION)" -f $(BINARY)-$(GOOS)-$(GOARCH).su3 -n $(BINARY)-$(GOOS)-$(GOARCH).su3 -l "`sha256sum $(BINARY)-$(GOOS)-$(GOARCH).su3`" gothub upload -R -u eyedeekay -r terrarium -t "$(VERSION)" -f $(BINARY)-$(GOOS)-$(GOARCH).su3 -n $(BINARY)-$(GOOS)-$(GOARCH).su3 -l "`sha256sum $(BINARY)-$(GOOS)-$(GOARCH).su3`"
upload-windows: upload-windows:
GOOS=windows GOARCH=amd64 make upload GOOS=windows GOARCH=amd64 make upload
@@ -90,10 +92,17 @@ upload-all: upload-windows upload-linux upload-osx upload-bsd
download-su3s: download-su3s:
GOOS=windows GOARCH=amd64 make download-single-su3 GOOS=windows GOARCH=amd64 make download-single-su3
GOOS=windows GOARCH=386 make download-single-su3
GOOS=linux GOARCH=amd64 make download-single-su3 GOOS=linux GOARCH=amd64 make download-single-su3
GOOS=linux GOARCH=arm64 make download-single-su3
GOOS=linux GOARCH=386 make download-single-su3
GOOS=darwin GOARCH=amd64 make download-single-su3
GOOS=darwin GOARCH=arm64 make download-single-su3
GOOS=freebsd GOARCH=amd64 make download-single-su3
GOOS=openbsd GOARCH=amd64 make download-single-su3
download-single-su3: download-single-su3:
wget -N -c "https://github.com/$(USER_GH)/$(REPO_NAME)/releases/download/$(VERSION)/$(BINARY)-$(GOOS).su3" wget -N -c "https://github.com/$(USER_GH)/$(BINARY)/releases/download/$(VERSION)/$(BINARY)-$(GOOS)-$(GOARCH).su3"
release: clean all version upload-all release: clean all version upload-all

View File

@@ -1,4 +1,4 @@
![terrarium](doc/terrarium-with-text.png) # ![terrarium](doc/terrarium-with-text.png)
[![Build [![Build
Status](https://travis-ci.org/eyedeekay/terrarium.svg)](https://travis-ci.org/eyedeekay/terrarium) Status](https://travis-ci.org/eyedeekay/terrarium.svg)](https://travis-ci.org/eyedeekay/terrarium)
@@ -33,8 +33,8 @@ and provide more flexible security.
### Inside I2P ### Inside I2P
- [Windows (In-I2P)](http://idk.i2p/terrarium/snowflake-windows.su3) - [Windows (In-I2P)](http://idk.i2p/terrarium/terrarium-windows-amd64.su3)
- [Linux (In-I2P)](http://idk.i2p/terrarium/snowflake-linux.su3) - [Linux (In-I2P)](http://idk.i2p/terrarium/terrarium-linux-amd64.su3)
### Outside I2P ### Outside I2P

6
desc
View File

@@ -1,5 +1 @@
terrarium is an IRC server with a focus on being small and understandable, terrarium is an IRC server with a focus on being small, understandable, and private. It builds all of it's connections using SAM, and is capable of linking with other I2P IRC servers.
originally forked from [horgh/catbox](https://github.com/horgh/catbox). The
goal is to create an easy-to-configure I2P IRC server which is highly stable
and secure, while retaining the ability to link with non-I2P IRC servers using
TLS in order to bridge anonymous and non-anonymous chat.

View File

@@ -5,9 +5,7 @@
<link rel="stylesheet" type="text/css" href ="/style.css" /> <link rel="stylesheet" type="text/css" href ="/style.css" />
</head> </head>
<body> <body>
<figure> <h1 id="terrarium"><img src="doc/terrarium-with-text.png" alt="terrarium" /></h1>
<img src="doc/terrarium-with-text.png" alt="" /><figcaption>terrarium</figcaption>
</figure>
<p><a href="https://travis-ci.org/eyedeekay/terrarium"><img src="https://travis-ci.org/eyedeekay/terrarium.svg" alt="Build Status" /></a> <a href="https://goreportcard.com/report/i2pgit.org/idk/terrarium"><img src="https://goreportcard.com/badge/i2pgit.org/idk/terrarium" alt="Go Report Card" /></a></p> <p><a href="https://travis-ci.org/eyedeekay/terrarium"><img src="https://travis-ci.org/eyedeekay/terrarium.svg" alt="Build Status" /></a> <a href="https://goreportcard.com/report/i2pgit.org/idk/terrarium"><img src="https://goreportcard.com/badge/i2pgit.org/idk/terrarium" alt="Go Report Card" /></a></p>
<p>terrarium is an IRC server with a focus on being small and understandable, originally forked from <a href="https://github.com/horgh/catbox">horgh/catbox</a>. The goal is to create an easy-to-configure I2P IRC server which is highly stable and secure, while retaining the ability to link with non-I2P IRC servers using TLS in order to bridge anonymous and non-anonymous chat. For now, Bridged servers are not anonymous, this may change in the future as I evaluate the feasibility of outproxies or Tor.</p> <p>terrarium is an IRC server with a focus on being small and understandable, originally forked from <a href="https://github.com/horgh/catbox">horgh/catbox</a>. The goal is to create an easy-to-configure I2P IRC server which is highly stable and secure, while retaining the ability to link with non-I2P IRC servers using TLS in order to bridge anonymous and non-anonymous chat. For now, Bridged servers are not anonymous, this may change in the future as I evaluate the feasibility of outproxies or Tor.</p>
<h1 id="features">Features</h1> <h1 id="features">Features</h1>
@@ -24,8 +22,8 @@
<p><a href="https://geti2p.net/en/docs/plugins">A guide to installing I2P plugins can be found on the I2P web site.</a></p> <p><a href="https://geti2p.net/en/docs/plugins">A guide to installing I2P plugins can be found on the I2P web site.</a></p>
<h3 id="inside-i2p">Inside I2P</h3> <h3 id="inside-i2p">Inside I2P</h3>
<ul> <ul>
<li><a href="http://idk.i2p/terrarium/snowflake-windows.su3">Windows (In-I2P)</a></li> <li><a href="http://idk.i2p/terrarium/terrarium-windows-amd64.su3">Windows (In-I2P)</a></li>
<li><a href="http://idk.i2p/terrarium/snowflake-linux.su3">Linux (In-I2P)</a></li> <li><a href="http://idk.i2p/terrarium/terrarium-linux-amd64.su3">Linux (In-I2P)</a></li>
</ul> </ul>
<h3 id="outside-i2p">Outside I2P</h3> <h3 id="outside-i2p">Outside I2P</h3>
<ul> <ul>

21
main.go
View File

@@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log" "log"
"math/rand"
"net" "net"
"os" "os"
"os/signal" "os/signal"
@@ -204,7 +205,18 @@ const ExcessFloodThreshold = 50
// from a user. // from a user.
const ChanModesPerCommand = 4 const ChanModesPerCommand = 4
func randString() string {
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
n := 3
b := make([]rune, n)
for i := range b {
b[i] = letterRunes[rand.Intn(len(letterRunes))]
}
return string(b)
}
func NewCatbox(configFile string) (*Catbox, error) { func NewCatbox(configFile string) (*Catbox, error) {
rand.Seed(time.Now().UnixNano())
cb := Catbox{ cb := Catbox{
ConfigFile: configFile, ConfigFile: configFile,
LocalClients: make(map[uint64]*LocalClient), LocalClients: make(map[uint64]*LocalClient),
@@ -228,6 +240,9 @@ func NewCatbox(configFile string) (*Catbox, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("configuration problem: %s", err) return nil, fmt.Errorf("configuration problem: %s", err)
} }
if cfg.ServerName == "irc.terrarium.i2p" {
cfg.ServerName = randString() + ".dirt.i2p"
}
cb.Config = cfg cb.Config = cfg
if cb.Config.ListenPortTLS != "-1" || cb.Config.CertificateFile != "" || if cb.Config.ListenPortTLS != "-1" || cb.Config.CertificateFile != "" ||
@@ -357,18 +372,18 @@ func (cb *Catbox) Start(listenFD int) error {
// I2P Listener with TLS // I2P Listener with TLS
if cb.Config.ListenI2PTLS != "-1" { if cb.Config.ListenI2PTLS != "-1" {
ln, err := sam.I2PListener(cb.Config.ListenI2P, cb.Config.SAMAddress, cb.Config.ListenI2P) ln, err := sam.I2PListener(cb.Config.ListenI2PTLS, cb.Config.SAMAddress, cb.Config.ListenI2PTLS)
if err != nil { if err != nil {
return fmt.Errorf("unable to listen (I2P): %s", err) return fmt.Errorf("unable to listen (I2P): %s", err)
} }
tlsln := tls.NewListener(ln, cb.TLSConfig) tlsln := tls.NewListener(ln, cb.TLSConfig)
cb.I2PListenerTLS = tlsln cb.I2PListenerTLS = tlsln
err = ioutil.WriteFile(cb.Config.ListenI2P+".i2paddresshelper", []byte("http://"+cb.Config.ListenI2P+"?i2paddresshelper="+cb.I2PListener.Addr().String()), 0644) err = ioutil.WriteFile(cb.Config.ListenI2PTLS+".tls.i2paddresshelper", []byte("http://"+cb.Config.ListenI2PTLS+"?i2paddresshelper="+cb.I2PListener.Addr().String()), 0644)
if err != nil { if err != nil {
return fmt.Errorf("unable to write I2P addresshelper link to file: %s", err) return fmt.Errorf("unable to write I2P addresshelper link to file: %s", err)
} }
if strings.HasSuffix(cb.Config.ServerName, ".i2p") { if strings.HasSuffix(cb.Config.ServerName, ".i2p") {
err = ioutil.WriteFile(cb.Config.ServerName+".i2paddresshelper", []byte("http://"+cb.Config.ServerName+"?i2paddresshelper="+cb.I2PListener.Addr().String()), 0644) err = ioutil.WriteFile(cb.Config.ServerName+".tls.i2paddresshelper", []byte("http://"+cb.Config.ServerName+"?i2paddresshelper="+cb.I2PListener.Addr().String()), 0644)
if err != nil { if err != nil {
return fmt.Errorf("unable to write I2P addresshelper link to file: %s", err) return fmt.Errorf("unable to write I2P addresshelper link to file: %s", err)
} }