Archived
1
0

remove gx stuff

This commit is contained in:
Jeff Becker 2017-04-04 08:27:03 -04:00
parent e87d739392
commit 665849e016
4 changed files with 0 additions and 148 deletions

View File

@ -1 +0,0 @@
0.1.3: QmZ4eWYhbtDuKG53VxbPhgDAE4ztqy63cy5oswJMBTbTtw

View File

@ -1,33 +0,0 @@
#
# .gxignore for nntpchan repo
#
# emacs temp files
*~
\#*
.\#*
# srnd config files
srnd.ini
feeds.ini
# default article store directory
articles/
# generated files
webroot/
# built binaries
go/
srndv2
# private key
*.key
*.txt
# certificates
certs/
rebuild.sh
.git

View File

@ -1,17 +0,0 @@
{
"name": "nntpchan",
"author": "jeff",
"version": "0.1.3",
"gxDependencies": [
{
"author": "jeff",
"name": "srndv2",
"hash": "QmQTYzJdhpSCYb314zgP5XT24uQghDB3npxHj2TzjinQWt",
"version": "0.1.2"
}
],
"language": "go",
"issues_url": "https://github.com/majestrate/nntpchan",
"gx_version": "0.4.0",
"gx": {}
}

97
srnd.go
View File

@ -1,97 +0,0 @@
package main
import (
"fmt"
"gx/ipfs/QmPAqM7anxdr1ngPmJz9J9AAxDLinDz2Eh9aAzLF9T7LNa/srndv2/src/srnd"
"log"
"os"
"os/signal"
"syscall"
)
func main() {
daemon := new(srnd.NNTPDaemon)
if len(os.Args) > 1 {
action := os.Args[1]
if action == "setup" {
log.Println("Setting up SRNd base...")
daemon.Setup()
log.Println("\nSetup Completed.")
} else if action == "run" {
log.Printf("Starting up %s...", srnd.Version())
daemon.Setup()
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
signal.Notify(c, syscall.SIGTERM)
go func() {
<-c
log.Println("Shutting down...")
daemon.End()
os.Exit(0)
}()
daemon.Run()
} else if action == "tool" {
if len(os.Args) > 2 {
tool := os.Args[2]
if tool == "mod" {
if len(os.Args) >= 5 {
action := os.Args[3]
if action == "add" {
pk := os.Args[4]
daemon.Setup()
db := daemon.GetDatabase()
err := db.MarkModPubkeyGlobal(pk)
if err != nil {
log.Fatal(err)
}
} else if action == "del" {
pk := os.Args[4]
daemon.Setup()
db := daemon.GetDatabase()
err := db.UnMarkModPubkeyGlobal(pk)
if err != nil {
log.Fatal(err)
}
}
} else {
fmt.Fprintf(os.Stdout, "usage: %s tool mod [add|del] pubkey\n", os.Args[0])
}
} else if tool == "rethumb" {
srnd.ThumbnailTool()
} else if tool == "keygen" {
srnd.KeygenTool()
} else if tool == "nntp" {
if len(os.Args) >= 5 {
action := os.Args[3]
if action == "del-login" {
daemon.Setup()
daemon.DelNNTPLogin(os.Args[4])
} else if action == "add-login" {
if len(os.Args) == 6 {
username := os.Args[4]
passwd := os.Args[5]
daemon.Setup()
daemon.AddNNTPLogin(username, passwd)
} else {
fmt.Fprintf(os.Stdout, "Usage: %s tool nntp add-login username password\n", os.Args[0])
}
} else {
fmt.Fprintf(os.Stdout, "Usage: %s tool nntp [add-login|del-login]\n", os.Args[0])
}
} else {
fmt.Fprintf(os.Stdout, "Usage: %s tool nntp [add-login|del-login]\n", os.Args[0])
}
} else {
fmt.Fprintf(os.Stdout, "Usage: %s tool [rethumb|keygen|nntp|mod]\n", os.Args[0])
}
} else {
fmt.Fprintf(os.Stdout, "Usage: %s tool [rethumb|keygen|nntp|mod]\n", os.Args[0])
}
} else {
log.Println("Invalid action:", action)
}
} else {
fmt.Fprintf(os.Stdout, "Usage: %s [setup|run|tool]\n", os.Args[0])
}
}