1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-11-03 04:27:16 -05:00

Renamed gobbs -> neonmodem

This commit is contained in:
マリウス 2023-01-06 19:46:41 -05:00
parent 1e47aa4bce
commit 7001fc3f61
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
40 changed files with 130 additions and 130 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
/TODO.md
/gobbs
/neonmodem
/posts.db

View File

@ -4,7 +4,7 @@ VERSION := $(shell git describe --tags 2> /dev/null || git rev-parse --short HEA
all: install-deps build
build:
go build -ldflags "-X github.com/mrusme/gobbs/config.VERSION=$(VERSION)"
go build -ldflags "-X github.com/mrusme/neonmodem/config.VERSION=$(VERSION)"
install-deps: install-deps-go

View File

@ -1,4 +1,4 @@
gobbs
neonmodem
-----

View File

@ -6,10 +6,10 @@ import (
"sort"
"strings"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/ui/ctx"
)
type Aggregator struct {
@ -55,7 +55,7 @@ func (a *Aggregator) ListPosts() ([]post.Post, []error) {
var posts []post.Post
// TODO: Clean up implementation
if os.Getenv("GOBBS_TEST") == "true" {
if os.Getenv("neonmodem_TEST") == "true" {
jsonPosts, err := os.ReadFile("posts.db")
if err == nil {
err = json.Unmarshal(jsonPosts, &posts)

View File

@ -4,8 +4,8 @@ import (
"fmt"
"os"
"github.com/mrusme/gobbs/config"
"github.com/mrusme/gobbs/system"
"github.com/mrusme/neonmodem/config"
"github.com/mrusme/neonmodem/system"
"github.com/spf13/cobra"
)

View File

@ -7,10 +7,10 @@ import (
"runtime"
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/config"
"github.com/mrusme/gobbs/system"
"github.com/mrusme/gobbs/ui"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/neonmodem/config"
"github.com/mrusme/neonmodem/system"
"github.com/mrusme/neonmodem/ui"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.uber.org/zap"
@ -102,12 +102,12 @@ func loadSystems(c *ctx.Ctx) []error {
}
var rootCmd = &cobra.Command{
Use: "gobbs",
Use: "neonmodem",
SuggestFor: []string{"bbs", "discourse", "lemmy"},
Short: "Gobbs, the bulletin board system TUI",
Long: "Gobbs is a bulletin board system (BBS) text user interface written " +
Short: "neonmodem, the bulletin board system TUI",
Long: "neonmodem is a bulletin board system (BBS) text user interface written " +
"in Go, supporting Discourse and Lemmy.\n" +
"More info available on https://xn--gckvb8fzb.com/projects/gobbs",
"More info available on https://xn--gckvb8fzb.com/projects/neonmodem",
Run: func(cmd *cobra.Command, args []string) {
var err error

View File

@ -132,12 +132,12 @@ func Load() (Config, error) {
SetDefaults(cacheDir)
viper.SetConfigName("gobbs")
viper.SetConfigName("neonmodem")
viper.SetConfigType("toml")
viper.AddConfigPath(cfgDir)
viper.AddConfigPath(homeDir)
viper.SetEnvPrefix("gobbs")
viper.SetEnvPrefix("neonmodem")
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.AutomaticEnv()
@ -164,7 +164,7 @@ func (cfg *Config) Save() error {
if err != nil {
return err
}
cfgFile = path.Join(cfgDir, "gobbs.toml")
cfgFile = path.Join(cfgDir, "neonmodem.toml")
}
fd, err := os.OpenFile(cfgFile, os.O_WRONLY|os.O_CREATE, 0600)
@ -182,7 +182,7 @@ func (cfg *Config) Save() error {
func SetDefaults(cacheDir string) {
viper.SetDefault("Debug", "false")
viper.SetDefault("Log", path.Join(cacheDir, "gobbs.log"))
viper.SetDefault("Log", path.Join(cacheDir, "neonmodem.log"))
viper.SetDefault("RenderImages", "true")

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/mrusme/gobbs
module github.com/mrusme/neonmodem
go 1.19

View File

@ -3,7 +3,7 @@ package main
import (
"embed"
"github.com/mrusme/gobbs/cmd"
"github.com/mrusme/neonmodem/cmd"
)
//go:embed splashscreen.png

View File

@ -6,9 +6,9 @@ import (
"time"
"github.com/mergestat/timediff"
"github.com/mrusme/gobbs/models/author"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/neonmodem/models/author"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/models/reply"
)
type Post struct {

View File

@ -3,7 +3,7 @@ package reply
import (
"time"
"github.com/mrusme/gobbs/models/author"
"github.com/mrusme/neonmodem/models/author"
)
type Reply struct {

View File

@ -4,10 +4,10 @@ import (
"errors"
"fmt"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/system/adapter"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/system/adapter"
"go.uber.org/zap"
)

View File

@ -131,7 +131,7 @@ func (c *Client) NewRequest(
return nil, err
}
req.Header.Add("User-Agent", "gobbs")
req.Header.Add("User-Agent", "neonmodem")
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("User-Api-Client-Id", c.credentials["client_id"])

View File

@ -80,7 +80,7 @@ func (sys *System) Connect(sysURL string) error {
// URL
baseURL := fmt.Sprintf("%s/user-api-key/new", sysURL)
values := url.Values{}
values.Set("application_name", "gobbs")
values.Set("application_name", "neonmodem")
values.Set("client_id", clientID)
values.Set("scopes", "read,write")
values.Set("public_key", publicKeyPEM)

View File

@ -10,12 +10,12 @@ import (
md "github.com/JohannesKaufmann/html-to-markdown"
"github.com/araddon/dateparse"
"github.com/mrusme/gobbs/models/author"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/system/adapter"
"github.com/mrusme/gobbs/system/discourse/api"
"github.com/mrusme/neonmodem/models/author"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/system/adapter"
"github.com/mrusme/neonmodem/system/discourse/api"
"go.uber.org/zap"
)

View File

@ -9,11 +9,11 @@ import (
md "github.com/JohannesKaufmann/html-to-markdown"
hn "github.com/hermanschaaf/hackernews"
"github.com/mrusme/gobbs/models/author"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/system/adapter"
"github.com/mrusme/neonmodem/models/author"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/system/adapter"
"go.uber.org/zap"
)

View File

@ -6,11 +6,11 @@ import (
"net/url"
"strconv"
"github.com/mrusme/gobbs/models/author"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/system/adapter"
"github.com/mrusme/neonmodem/models/author"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/system/adapter"
"go.arsenm.dev/go-lemmy"
"go.arsenm.dev/go-lemmy/types"
"go.uber.org/zap"

View File

@ -6,7 +6,7 @@ import (
"regexp"
"github.com/eliukblau/pixterm/pkg/ansimage"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/neonmodem/ui/ctx"
)
func RenderInlineImages(c *ctx.Ctx, s string, w int) string {

View File

@ -128,7 +128,7 @@ func (c *Client) NewRequest(
return nil, err
}
req.Header.Add("User-Agent", "gobbs")
req.Header.Add("User-Agent", "neonmodem")
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")

View File

@ -9,12 +9,12 @@ import (
md "github.com/JohannesKaufmann/html-to-markdown"
"github.com/araddon/dateparse"
"github.com/mrusme/gobbs/models/author"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/system/adapter"
"github.com/mrusme/gobbs/system/lobsters/api"
"github.com/mrusme/neonmodem/models/author"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/system/adapter"
"github.com/mrusme/neonmodem/system/lobsters/api"
"go.uber.org/zap"
)

View File

@ -3,15 +3,15 @@ package system
import (
"errors"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/system/adapter"
"github.com/mrusme/gobbs/system/all"
"github.com/mrusme/gobbs/system/discourse"
"github.com/mrusme/gobbs/system/hackernews"
"github.com/mrusme/gobbs/system/lemmy"
"github.com/mrusme/gobbs/system/lobsters"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/system/adapter"
"github.com/mrusme/neonmodem/system/all"
"github.com/mrusme/neonmodem/system/discourse"
"github.com/mrusme/neonmodem/system/hackernews"
"github.com/mrusme/neonmodem/system/lemmy"
"github.com/mrusme/neonmodem/system/lobsters"
"go.uber.org/zap"
)

View File

@ -3,10 +3,10 @@ package ctx
import (
"embed"
"github.com/mrusme/gobbs/config"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/system"
"github.com/mrusme/gobbs/ui/theme"
"github.com/mrusme/neonmodem/config"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/system"
"github.com/mrusme/neonmodem/ui/theme"
"go.uber.org/zap"
)

View File

@ -3,7 +3,7 @@ package header
import (
"fmt"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/charmbracelet/bubbles/spinner"
tea "github.com/charmbracelet/bubbletea"

View File

@ -2,7 +2,7 @@ package theme
import (
"github.com/charmbracelet/lipgloss"
"github.com/mrusme/gobbs/config"
"github.com/mrusme/neonmodem/config"
)
type Theme struct {

View File

@ -5,7 +5,7 @@ import (
"github.com/charmbracelet/bubbles/key"
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/neonmodem/ui/cmd"
)
type MsgHandlingKeymapKey struct {

View File

@ -2,7 +2,7 @@ package toolkit
import (
"github.com/charmbracelet/bubbles/key"
"github.com/mrusme/gobbs/ui/theme"
"github.com/mrusme/neonmodem/ui/theme"
"go.uber.org/zap"
)

View File

@ -5,21 +5,21 @@ import (
"strings"
"github.com/mrusme/gobbs/aggregator"
"github.com/mrusme/gobbs/models/forum"
"github.com/mrusme/gobbs/system"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/gobbs/ui/header"
"github.com/mrusme/gobbs/ui/views/posts"
"github.com/mrusme/gobbs/ui/views/splash"
"github.com/mrusme/gobbs/ui/windowmanager"
"github.com/mrusme/gobbs/ui/windows/msgerror"
"github.com/mrusme/gobbs/ui/windows/popuplist"
"github.com/mrusme/gobbs/ui/windows/postcreate"
"github.com/mrusme/gobbs/ui/windows/postshow"
"github.com/mrusme/neonmodem/aggregator"
"github.com/mrusme/neonmodem/models/forum"
"github.com/mrusme/neonmodem/system"
"github.com/mrusme/neonmodem/ui/cmd"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/mrusme/neonmodem/ui/header"
"github.com/mrusme/neonmodem/ui/views/posts"
"github.com/mrusme/neonmodem/ui/views/splash"
"github.com/mrusme/neonmodem/ui/windowmanager"
"github.com/mrusme/neonmodem/ui/windows/msgerror"
"github.com/mrusme/neonmodem/ui/windows/popuplist"
"github.com/mrusme/neonmodem/ui/windows/postcreate"
"github.com/mrusme/neonmodem/ui/windows/postshow"
"github.com/mrusme/gobbs/ui/views"
"github.com/mrusme/neonmodem/ui/views"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/list"

View File

@ -8,12 +8,12 @@ import (
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/mrusme/gobbs/aggregator"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/gobbs/ui/windows/postcreate"
"github.com/mrusme/gobbs/ui/windows/postshow"
"github.com/mrusme/neonmodem/aggregator"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/ui/cmd"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/mrusme/neonmodem/ui/windows/postcreate"
"github.com/mrusme/neonmodem/ui/windows/postshow"
)
var (

View File

@ -7,9 +7,9 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/eliukblau/pixterm/pkg/ansimage"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/gobbs/ui/views/posts"
"github.com/mrusme/neonmodem/ui/cmd"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/mrusme/neonmodem/ui/views/posts"
)
var (

View File

@ -2,10 +2,10 @@ package windowmanager
import (
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/gobbs/ui/helpers"
"github.com/mrusme/gobbs/ui/windows"
"github.com/mrusme/neonmodem/ui/cmd"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/mrusme/neonmodem/ui/helpers"
"github.com/mrusme/neonmodem/ui/windows"
)
type StackItem struct {

View File

@ -3,7 +3,7 @@ package msgerror
import (
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/neonmodem/ui/cmd"
)
func handleViewResize(mi interface{}) (bool, []tea.Cmd) {

View File

@ -4,9 +4,9 @@ import (
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/mrusme/gobbs/aggregator"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/gobbs/ui/toolkit"
"github.com/mrusme/neonmodem/aggregator"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/mrusme/neonmodem/ui/toolkit"
)
var (

View File

@ -3,7 +3,7 @@ package popuplist
import (
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/neonmodem/ui/cmd"
)
func handleSelect(mi interface{}) (bool, []tea.Cmd) {

View File

@ -3,9 +3,9 @@ package popuplist
import (
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/aggregator"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/gobbs/ui/toolkit"
"github.com/mrusme/neonmodem/aggregator"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/mrusme/neonmodem/ui/toolkit"
)
var (

View File

@ -5,9 +5,9 @@ import (
"time"
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/ui/cmd"
)
func handleTab(mi interface{}) (bool, []tea.Cmd) {

View File

@ -4,9 +4,9 @@ import (
"github.com/charmbracelet/bubbles/textarea"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/aggregator"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/gobbs/ui/toolkit"
"github.com/mrusme/neonmodem/aggregator"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/mrusme/neonmodem/ui/toolkit"
)
var (

View File

@ -4,8 +4,8 @@ import (
"fmt"
"github.com/charmbracelet/lipgloss"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/ui/helpers"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/ui/helpers"
)
func (m Model) View() string {

View File

@ -7,9 +7,9 @@ import (
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/gobbs/ui/windows/postcreate"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/ui/cmd"
"github.com/mrusme/neonmodem/ui/windows/postcreate"
"github.com/pkg/browser"
)

View File

@ -7,12 +7,12 @@ import (
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/glamour"
"github.com/charmbracelet/lipgloss"
"github.com/mrusme/gobbs/aggregator"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/ui/cmd"
"github.com/mrusme/gobbs/ui/ctx"
"github.com/mrusme/gobbs/ui/toolkit"
"github.com/mrusme/neonmodem/aggregator"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/ui/cmd"
"github.com/mrusme/neonmodem/ui/ctx"
"github.com/mrusme/neonmodem/ui/toolkit"
)
var (

View File

@ -6,9 +6,9 @@ import (
"github.com/charmbracelet/glamour"
"github.com/charmbracelet/lipgloss"
"github.com/mrusme/gobbs/models/post"
"github.com/mrusme/gobbs/models/reply"
"github.com/mrusme/gobbs/system/lib"
"github.com/mrusme/neonmodem/models/post"
"github.com/mrusme/neonmodem/models/reply"
"github.com/mrusme/neonmodem/system/lib"
)
func (m Model) View() string {