adjust path

This commit is contained in:
a 2022-02-21 03:53:13 +00:00
parent e1a3ec1f1d
commit 77d85278a2
170 changed files with 2326 additions and 2305 deletions

View File

@ -2,17 +2,17 @@
package main package main
import ( import (
"context" "context"
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"errors" "errors"
"log" "log"
"os" "os"
"strconv" "strconv"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
"github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"gopkg.in/olivere/elastic.v6" "gopkg.in/olivere/elastic.v6"
) )
func main() { func main() {

View File

@ -1,16 +1,17 @@
//go:build hookgen
// +build hookgen // +build hookgen
package main // import "github.com/Azareal/Gosora/hook_gen" package main // import "git.tuxpa.in/a/gosora/hook_gen"
import ( import (
"fmt" "fmt"
"log" "log"
"runtime/debug" "runtime/debug"
"strings" "strings"
h "github.com/Azareal/Gosora/cmd/common_hook_gen" h "git.tuxpa.in/a/gosora/cmd/common_hook_gen"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
_ "github.com/Azareal/Gosora/extend" _ "git.tuxpa.in/a/gosora/extend"
) )
// TODO: Make sure all the errors in this file propagate upwards properly // TODO: Make sure all the errors in this file propagate upwards properly

View File

@ -1,12 +1,12 @@
package main // import "github.com/Azareal/Gosora/hook_stub_gen" package main // import "git.tuxpa.in/a/gosora/hook_stub_gen"
import ( import (
"fmt" "fmt"
"log" "log"
"strings" "runtime/debug"
"runtime/debug" "strings"
h "github.com/Azareal/Gosora/cmd/common_hook_gen" h "git.tuxpa.in/a/gosora/cmd/common_hook_gen"
) )
// TODO: Make sure all the errors in this file propagate upwards properly // TODO: Make sure all the errors in this file propagate upwards properly

View File

@ -7,15 +7,15 @@
package main package main
import ( import (
"bufio" "bufio"
"errors" "errors"
"fmt" "fmt"
"os" "os"
"runtime/debug" "runtime/debug"
"strconv" "strconv"
"strings" "strings"
"github.com/Azareal/Gosora/install" "git.tuxpa.in/a/gosora/install"
) )
var scanner *bufio.Scanner var scanner *bufio.Scanner

View File

@ -1,17 +1,17 @@
/* WIP Under Construction */ /* WIP Under Construction */
package main // import "github.com/Azareal/Gosora/query_gen" package main // import "git.tuxpa.in/a/gosora/query_gen"
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"log" "log"
"os" "os"
"runtime/debug" "runtime/debug"
"strconv" "strconv"
"strings" "strings"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// TODO: Make sure all the errors in this file propagate upwards properly // TODO: Make sure all the errors in this file propagate upwards properly

View File

@ -1,7 +1,10 @@
package main package main
import "strings" import (
import "github.com/Azareal/Gosora/query_gen" "strings"
qgen "git.tuxpa.in/a/gosora/query_gen"
)
type PrimaryKeySpitter struct { type PrimaryKeySpitter struct {
keys map[string]string keys map[string]string

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Activity ActivityStream var Activity ActivityStream

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var ActivityMatches ActivityStreamMatches var ActivityMatches ActivityStreamMatches

View File

@ -7,16 +7,16 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"strconv" "strconv"
"strings" "strings"
"time" "time"
//"fmt" //"fmt"
"github.com/Azareal/Gosora/common/phrases" "git.tuxpa.in/a/gosora/common/phrases"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
type Alert struct { type Alert struct {

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"log" "log"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Analytics AnalyticsStore var Analytics AnalyticsStore

View File

@ -1,15 +1,15 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
//"fmt" //"fmt"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Attachments AttachmentStore var Attachments AttachmentStore

View File

@ -1,10 +1,10 @@
package common package common
import ( import (
"database/sql" "database/sql"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var ModLogs LogStore var ModLogs LogStore

View File

@ -7,20 +7,20 @@
package common package common
import ( import (
"crypto/sha256" "crypto/sha256"
"crypto/subtle" "crypto/subtle"
"database/sql" "database/sql"
"encoding/hex" "encoding/hex"
"errors" "errors"
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
"github.com/Azareal/Gosora/common/gauth" "git.tuxpa.in/a/gosora/common/gauth"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
//"golang.org/x/crypto/argon2" //"golang.org/x/crypto/argon2"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
) )
// TODO: Write more authentication tests // TODO: Write more authentication tests

View File

@ -4,23 +4,23 @@
* Copyright Azareal 2018 - 2020 * Copyright Azareal 2018 - 2020
* *
*/ */
package common // import "github.com/Azareal/Gosora/common" package common // import "git.tuxpa.in/a/gosora/common"
import ( import (
"database/sql" "database/sql"
"io" "io"
"log" "log"
"net" "net"
"net/http" "net/http"
"os" "os"
"runtime/debug" "runtime/debug"
"strconv" "strconv"
"strings" "strings"
"sync/atomic" "sync/atomic"
"time" "time"
meta "github.com/Azareal/Gosora/common/meta" meta "git.tuxpa.in/a/gosora/common/meta"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var SoftwareVersion = Version{Major: 0, Minor: 3, Patch: 0, Tag: "dev"} var SoftwareVersion = Version{Major: 0, Minor: 3, Patch: 0, Tag: "dev"}

View File

@ -1,15 +1,15 @@
package common package common
import ( import (
"errors" "errors"
"time" "time"
//"log" //"log"
"database/sql" "database/sql"
"strconv" "strconv"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Convos ConversationStore var Convos ConversationStore

View File

@ -4,8 +4,8 @@ import (
"database/sql" "database/sql"
"sync/atomic" "sync/atomic"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -4,8 +4,8 @@ import (
"database/sql" "database/sql"
"sync" "sync"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -4,8 +4,8 @@ import (
"database/sql" "database/sql"
"sync/atomic" "sync/atomic"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -6,8 +6,8 @@ import (
"sync" "sync"
"time" "time"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -5,8 +5,8 @@ import (
"math" "math"
"time" "time"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -4,8 +4,8 @@ import (
"database/sql" "database/sql"
"sync/atomic" "sync/atomic"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -5,8 +5,8 @@ import (
"sync" "sync"
"sync/atomic" "sync/atomic"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -4,8 +4,8 @@ import (
"database/sql" "database/sql"
"sync/atomic" "sync/atomic"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -6,9 +6,9 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/Azareal/Gosora/uutils" "git.tuxpa.in/a/gosora/uutils"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -4,8 +4,8 @@ import (
"database/sql" "database/sql"
"sync/atomic" "sync/atomic"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -4,8 +4,8 @@ import (
"database/sql" "database/sql"
"sync/atomic" "sync/atomic"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -8,8 +8,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )

View File

@ -1,13 +1,13 @@
package common package common
import ( import (
"crypto/tls" "crypto/tls"
"fmt" "fmt"
"net/mail" "net/mail"
"net/smtp" "net/smtp"
"strings" "strings"
p "github.com/Azareal/Gosora/common/phrases" p "git.tuxpa.in/a/gosora/common/phrases"
) )
func SendActivationEmail(username, email, token string) error { func SendActivationEmail(username, email, token string) error {

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Emails EmailStore var Emails EmailStore

View File

@ -1,15 +1,15 @@
package common package common
import ( import (
"fmt" "fmt"
"log" "log"
"net/http" "net/http"
"runtime/debug" "runtime/debug"
"strings" "strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
p "github.com/Azareal/Gosora/common/phrases" p "git.tuxpa.in/a/gosora/common/phrases"
) )
type ErrorItem struct { type ErrorItem struct {

View File

@ -8,14 +8,14 @@ package common
// TODO: Break this file up into multiple files to make it easier to maintain // TODO: Break this file up into multiple files to make it easier to maintain
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"log" "log"
"net/http" "net/http"
"sync" "sync"
"sync/atomic" "sync/atomic"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var ErrPluginNotInstallable = errors.New("This plugin is not installable") var ErrPluginNotInstallable = errors.New("This plugin is not installable")

View File

@ -1,25 +1,25 @@
package common package common
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256" "crypto/sha256"
"encoding/base64" "encoding/base64"
"encoding/hex" "encoding/hex"
"errors" "errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"mime" "mime"
"net/http" "net/http"
"net/url" "net/url"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
tmpl "github.com/Azareal/Gosora/tmpl_client" tmpl "git.tuxpa.in/a/gosora/tmpl_client"
"github.com/andybalholm/brotli" "github.com/andybalholm/brotli"
) )
//type SFileList map[string]*SFile //type SFileList map[string]*SFile

View File

@ -1,14 +1,14 @@
package common package common
import ( import (
//"log" //"log"
"database/sql" "database/sql"
"errors" "errors"
"strconv" "strconv"
"strings" "strings"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
) )
// TODO: Do we really need this? // TODO: Do we really need this?

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"fmt" "fmt"
"strconv" "strconv"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var ForumActionStore ForumActionStoreInt var ForumActionStore ForumActionStoreInt

View File

@ -1,10 +1,10 @@
package common package common
import ( import (
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// ? - Can we avoid duplicating the items in this list in a bunch of places? // ? - Can we avoid duplicating the items in this list in a bunch of places?

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"sync" "sync"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var FPStore ForumPermsStore var FPStore ForumPermsStore

View File

@ -7,16 +7,16 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"log" "log"
//"fmt" //"fmt"
"sort" "sort"
"sync" "sync"
"sync/atomic" "sync/atomic"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var forumCreateMutex sync.Mutex var forumCreateMutex sync.Mutex

View File

@ -1,10 +1,10 @@
package common package common
import ( import (
"database/sql" "database/sql"
"encoding/json" "encoding/json"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var blankGroup = Group{ID: 0, Name: ""} var blankGroup = Group{ID: 0, Name: ""}

View File

@ -2,15 +2,15 @@
package common package common
import ( import (
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"errors" "errors"
"log" "log"
"sort" "sort"
"strconv" "strconv"
"sync" "sync"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Groups GroupStore var Groups GroupStore

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var IPSearch IPSearcher var IPSearch IPSearcher

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Likes LikeStore var Likes LikeStore

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"strconv" "strconv"
"sync/atomic" "sync/atomic"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Menus *DefaultMenuStore var Menus *DefaultMenuStore

View File

@ -1,17 +1,17 @@
package common package common
import ( import (
"bytes" "bytes"
"database/sql" "database/sql"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
"strconv" "strconv"
"strings" "strings"
"github.com/Azareal/Gosora/common/phrases" "git.tuxpa.in/a/gosora/common/phrases"
tmpl "github.com/Azareal/Gosora/common/templates" tmpl "git.tuxpa.in/a/gosora/common/templates"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
type MenuItemList []MenuItem type MenuItemList []MenuItem

View File

@ -3,7 +3,7 @@ package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// MetaStore is a simple key-value store for the system to stash things in when needed // MetaStore is a simple key-value store for the system to stash things in when needed

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"strings" "strings"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var MFAstore MFAStore var MFAstore MFAStore

View File

@ -1,10 +1,10 @@
package common package common
import ( import (
"database/sql" "database/sql"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var RegLogs RegLogStore var RegLogs RegLogStore

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"strconv" "strconv"
"strings" "strings"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
type CustomPageStmts struct { type CustomPageStmts struct {

View File

@ -1,13 +1,13 @@
package common package common
import ( import (
"html/template" "html/template"
"net/http" "net/http"
"runtime" "runtime"
"sync" "sync"
"time" "time"
p "github.com/Azareal/Gosora/common/phrases" p "git.tuxpa.in/a/gosora/common/phrases"
) )
/*type HResource struct { /*type HResource struct {

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"crypto/subtle" "crypto/subtle"
"database/sql" "database/sql"
"errors" "errors"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var PasswordResetter *DefaultPasswordResetter var PasswordResetter *DefaultPasswordResetter

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"encoding/json" "encoding/json"
"log" "log"
"github.com/Azareal/Gosora/common/phrases" "git.tuxpa.in/a/gosora/common/phrases"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// TODO: Refactor the perms system // TODO: Refactor the perms system

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var pollStmts PollStmts var pollStmts PollStmts

View File

@ -1,13 +1,13 @@
package common package common
import ( import (
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"errors" "errors"
"log" "log"
"strconv" "strconv"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Polls PollStore var Polls PollStore

View File

@ -1,12 +1,12 @@
package common package common
import ( import (
"database/sql" "database/sql"
"html" "html"
"strconv" "strconv"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var profileReplyStmts ProfileReplyStmts var profileReplyStmts ProfileReplyStmts

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Prstore ProfileReplyStore var Prstore ProfileReplyStore

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
//"log" //"log"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var GroupPromotions GroupPromotionStore var GroupPromotions GroupPromotionStore

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
//"log" //"log"
"strconv" "strconv"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Recalc RecalcInt var Recalc RecalcInt

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var UserBlocks BlockStore var UserBlocks BlockStore

View File

@ -7,13 +7,13 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"html" "html"
"strconv" "strconv"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
type ReplyUser struct { type ReplyUser struct {

View File

@ -2,9 +2,9 @@ package common
//import "log" //import "log"
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Rstore ReplyStore var Rstore ReplyStore

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"strconv" "strconv"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// TODO: Make the default report forum ID configurable // TODO: Make the default report forum ID configurable

View File

@ -1,19 +1,19 @@
package common package common
import ( import (
"crypto/subtle" "crypto/subtle"
"html" "html"
"io" "io"
"net" "net"
"net/http" "net/http"
"os" "os"
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/Azareal/Gosora/common/phrases" "git.tuxpa.in/a/gosora/common/phrases"
"github.com/Azareal/Gosora/uutils" "git.tuxpa.in/a/gosora/uutils"
) )
// nolint // nolint

View File

@ -1,11 +1,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"strconv" "strconv"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var RepliesSearch Searcher var RepliesSearch Searcher

View File

@ -1,13 +1,13 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"strconv" "strconv"
"strings" "strings"
"sync/atomic" "sync/atomic"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var SettingBox atomic.Value // An atomic value pointing to a SettingBox var SettingBox atomic.Value // An atomic value pointing to a SettingBox

View File

@ -1,9 +1,9 @@
package common package common
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Subscriptions SubscriptionStore var Subscriptions SubscriptionStore

View File

@ -7,11 +7,11 @@
package common package common
import ( import (
"database/sql" "database/sql"
"log" "log"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
type TaskStmts struct { type TaskStmts struct {

View File

@ -1,23 +1,23 @@
package common package common
import ( import (
"fmt" "fmt"
"html/template" "html/template"
"io" "io"
"io/ioutil" "io/ioutil"
"log" "log"
"path/filepath" "path/filepath"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"time" "time"
"github.com/Azareal/Gosora/common/alerts" "git.tuxpa.in/a/gosora/common/alerts"
p "github.com/Azareal/Gosora/common/phrases" p "git.tuxpa.in/a/gosora/common/phrases"
tmpl "github.com/Azareal/Gosora/common/templates" tmpl "git.tuxpa.in/a/gosora/common/templates"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/Azareal/Gosora/uutils" "git.tuxpa.in/a/gosora/uutils"
) )
var Ctemplates []string // TODO: Use this to filter out top level templates we don't need var Ctemplates []string // TODO: Use this to filter out top level templates we don't need
@ -182,7 +182,7 @@ func CompileTemplates() error {
c.SetConfig(config) c.SetConfig(config)
c.SetBaseImportMap(map[string]string{ c.SetBaseImportMap(map[string]string{
"io": "io", "io": "io",
"github.com/Azareal/Gosora/common": "c github.com/Azareal/Gosora/common", "git.tuxpa.in/a/gosora/common": "c git.tuxpa.in/a/gosora/common",
}) })
c.SetBuildTags("!no_templategen") c.SetBuildTags("!no_templategen")
c.SetOverrideTrack(overriden) c.SetOverrideTrack(overriden)
@ -520,7 +520,7 @@ func compileJSTemplates(wg *sync.WaitGroup, c *tmpl.CTemplateSet, themeName stri
c.SetBaseImportMap(map[string]string{ c.SetBaseImportMap(map[string]string{
"io": "io", "io": "io",
"github.com/Azareal/Gosora/common/alerts": "github.com/Azareal/Gosora/common/alerts", "git.tuxpa.in/a/gosora/common/alerts": "git.tuxpa.in/a/gosora/common/alerts",
}) })
// TODO: Check what sort of path is sent exactly and use it here // TODO: Check what sort of path is sent exactly and use it here
@ -532,7 +532,7 @@ func compileJSTemplates(wg *sync.WaitGroup, c *tmpl.CTemplateSet, themeName stri
c.SetBaseImportMap(map[string]string{ c.SetBaseImportMap(map[string]string{
"io": "io", "io": "io",
"github.com/Azareal/Gosora/common": "c github.com/Azareal/Gosora/common", "git.tuxpa.in/a/gosora/common": "c git.tuxpa.in/a/gosora/common",
}) })
// TODO: Fix the import loop so we don't have to use this hack anymore // TODO: Fix the import loop so we don't have to use this hack anymore
c.SetBuildTags("!no_templategen,tmplgentopic") c.SetBuildTags("!no_templategen,tmplgentopic")

View File

@ -20,7 +20,7 @@ import (
var textOverlapList = make(map[string]int) var textOverlapList = make(map[string]int)
// TODO: Stop hard-coding this here // TODO: Stop hard-coding this here
var langPkg = "github.com/Azareal/Gosora/common/phrases" var langPkg = "git.tuxpa.in/a/gosora/common/phrases"
type VarItem struct { type VarItem struct {
Name string Name string
@ -241,7 +241,7 @@ func (c *CTemplateSet) CompileByLoggedin(name, fileDir, expects string, expectsI
} }
fname += "_" + c.themeName fname += "_" + c.themeName
} }
c.importMap["github.com/Azareal/Gosora/common"] = "c github.com/Azareal/Gosora/common" c.importMap["git.tuxpa.in/a/gosora/common"] = "c git.tuxpa.in/a/gosora/common"
c.fsb.Reset() c.fsb.Reset()
stub = `package ` + c.config.PackageName + "\n" + importList + "\n" stub = `package ` + c.config.PackageName + "\n" + importList + "\n"
@ -1319,7 +1319,7 @@ ArgLoop:
// TODO: Validate that this is actually a time.Time // TODO: Validate that this is actually a time.Time
//litString("time.Since("+leftParam+").String()", false) //litString("time.Since("+leftParam+").String()", false)
c.importMap["time"] = "time" c.importMap["time"] = "time"
c.importMap["github.com/Azareal/Gosora/uutils"] = "github.com/Azareal/Gosora/uutils" c.importMap["git.tuxpa.in/a/gosora/uutils"] = "git.tuxpa.in/a/gosora/uutils"
litString("time.Duration(uutils.Nanotime() - "+leftParam+").String()", false) litString("time.Duration(uutils.Nanotime() - "+leftParam+").String()", false)
break ArgLoop break ArgLoop
case "dock": case "dock":

View File

@ -2,26 +2,26 @@
package common package common
import ( import (
"bytes" "bytes"
"crypto/sha256" "crypto/sha256"
"database/sql" "database/sql"
"encoding/base64" "encoding/base64"
"encoding/hex" "encoding/hex"
"errors" "errors"
htmpl "html/template" htmpl "html/template"
"io" "io"
"io/ioutil" "io/ioutil"
"log" "log"
"mime" "mime"
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
"reflect" "reflect"
"strconv" "strconv"
"strings" "strings"
"text/template" "text/template"
p "github.com/Azareal/Gosora/common/phrases" p "git.tuxpa.in/a/gosora/common/phrases"
) )
var ErrNoDefaultTheme = errors.New("The default theme isn't registered in the system") var ErrNoDefaultTheme = errors.New("The default theme isn't registered in the system")

View File

@ -1,21 +1,21 @@
package common package common
import ( import (
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"errors" "errors"
"html/template" "html/template"
"io" "io"
"io/ioutil" "io/ioutil"
"log" "log"
"net/http" "net/http"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// TODO: Something more thread-safe // TODO: Something more thread-safe

View File

@ -1,17 +1,17 @@
package common package common
import ( import (
"image" "image"
"image/gif" "image/gif"
"image/jpeg" "image/jpeg"
"image/png" "image/png"
"os" "os"
"strconv" "strconv"
"golang.org/x/image/tiff" "golang.org/x/image/tiff"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
func ThumbTask(thumbChan chan bool) { func ThumbTask(thumbChan chan bool) {

View File

@ -1,16 +1,16 @@
package common package common
import ( import (
"fmt" "fmt"
"log" "log"
"strconv" "strconv"
"strings" "strings"
"sync/atomic" "sync/atomic"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/Azareal/Gosora/uutils" "git.tuxpa.in/a/gosora/uutils"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
var CTickLoop *TickLoop var CTickLoop *TickLoop

View File

@ -7,18 +7,18 @@
package common package common
import ( import (
"database/sql" "database/sql"
"html" "html"
"html/template" "html/template"
"strconv" "strconv"
"strings" "strings"
"time" "time"
//"log" //"log"
p "github.com/Azareal/Gosora/common/phrases" p "git.tuxpa.in/a/gosora/common/phrases"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// This is also in reply.go // This is also in reply.go

View File

@ -1,13 +1,13 @@
package common package common
import ( import (
"database/sql" "database/sql"
"fmt" "fmt"
"strconv" "strconv"
"sync" "sync"
"time" "time"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var TopicList TopicListInt var TopicList TopicListInt

View File

@ -7,12 +7,12 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"strconv" "strconv"
"strings" "strings"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// TODO: Add the watchdog goroutine // TODO: Add the watchdog goroutine

View File

@ -7,16 +7,16 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"strconv" "strconv"
"strings" "strings"
"time" "time"
//"log" //"log"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"github.com/go-sql-driver/mysql" "github.com/go-sql-driver/mysql"
) )
// TODO: Replace any literals with this // TODO: Replace any literals with this

View File

@ -1,12 +1,12 @@
package common package common
import ( import (
"database/sql" "database/sql"
"errors" "errors"
"strconv" "strconv"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
) )
// TODO: Add the watchdog goroutine // TODO: Add the watchdog goroutine

View File

@ -1,3 +1,4 @@
//go:build !no_ws
// +build !no_ws // +build !no_ws
/* /*
@ -9,20 +10,20 @@
package common package common
import ( import (
"bytes" "bytes"
"errors" "errors"
"fmt" "fmt"
"net/http" "net/http"
"runtime" "runtime"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"time" "time"
p "github.com/Azareal/Gosora/common/phrases" p "git.tuxpa.in/a/gosora/common/phrases"
"github.com/Azareal/gopsutil/cpu" "github.com/Azareal/gopsutil/cpu"
"github.com/Azareal/gopsutil/mem" "github.com/Azareal/gopsutil/mem"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
) )
// TODO: Disable WebSockets on high load? Add a Control Panel interface for disabling it? // TODO: Disable WebSockets on high load? Add a Control Panel interface for disabling it?

View File

@ -1,13 +1,13 @@
package common package common
import ( import (
"database/sql" "database/sql"
"encoding/json" "encoding/json"
"strconv" "strconv"
"strings" "strings"
"sync/atomic" "sync/atomic"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
type WidgetStmts struct { type WidgetStmts struct {

View File

@ -1,12 +1,12 @@
package common package common
import ( import (
"bytes" "bytes"
//"log" //"log"
"net/http/httptest" "net/http/httptest"
p "github.com/Azareal/Gosora/common/phrases" p "git.tuxpa.in/a/gosora/common/phrases"
min "github.com/Azareal/Gosora/common/templates" min "git.tuxpa.in/a/gosora/common/templates"
) )
type wolUsers struct { type wolUsers struct {

View File

@ -1,29 +1,29 @@
package common package common
import "github.com/Azareal/Gosora/common/phrases" import "git.tuxpa.in/a/gosora/common/phrases"
func wolContextRender(widget *Widget, hvars interface{}) (string, error) { func wolContextRender(widget *Widget, hvars interface{}) (string, error) {
header := hvars.(*Header) header := hvars.(*Header)
if header.Zone != "view_topic" { if header.Zone != "view_topic" {
return "", nil return "", nil
} }
var ucount int var ucount int
var users []*User var users []*User
topicMutex.RLock() topicMutex.RLock()
topic, ok := topicWatchers[header.ZoneID] topic, ok := topicWatchers[header.ZoneID]
if ok { if ok {
ucount = len(topic) ucount = len(topic)
if ucount < 30 { if ucount < 30 {
users = make([]*User, len(topic)) users = make([]*User, len(topic))
i := 0 i := 0
for wsUser, _ := range topic { for wsUser, _ := range topic {
users[i] = wsUser.User users[i] = wsUser.User
i++ i++
} }
} }
} }
topicMutex.RUnlock() topicMutex.RUnlock()
wol := &wolUsers{header, phrases.GetTmplPhrase("widget.online_view_topic_name"), users, ucount} wol := &wolUsers{header, phrases.GetTmplPhrase("widget.online_view_topic_name"), users, ucount}
e := header.Theme.RunTmpl("widget_online", wol, header.Writer) e := header.Theme.RunTmpl("widget_online", wol, header.Writer)
return "", e return "", e
} }

View File

@ -2,17 +2,17 @@
package common package common
import ( import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt" "fmt"
"html/template" "html/template"
"strings" "strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
min "github.com/Azareal/Gosora/common/templates" min "git.tuxpa.in/a/gosora/common/templates"
"github.com/Azareal/Gosora/uutils" "git.tuxpa.in/a/gosora/uutils"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
// TODO: Clean this file up // TODO: Clean this file up

View File

@ -1,10 +1,10 @@
package common package common
import ( import (
"database/sql" "database/sql"
"sync/atomic" "sync/atomic"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
// TODO: Move some features into methods on this? // TODO: Move some features into methods on this?

View File

@ -1,11 +1,11 @@
package main package main
import ( import (
"database/sql" "database/sql"
"log" "log"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
var stmts *Stmts var stmts *Stmts

View File

@ -14,9 +14,9 @@ Dev is for a few flags which help out with the development of Gosora.
Plugin which you may not have run into is a category in which plugins can define their own custom configuration settings. Plugin which you may not have run into is a category in which plugins can define their own custom configuration settings.
An example of what the file might look like: https://github.com/Azareal/Gosora/blob/master/config/config_example.json An example of what the file might look like: https://git.tuxpa.in/a/gosora/blob/master/config/config_example.json
Other configuration files: [config/weakpass.json](https://github.com/Azareal/Gosora/blob/master/docs/weak_passwords.md), [config/emoji.json](https://github.com/Azareal/Gosora/blob/master/docs/emoji.md) (WIP) Other configuration files: [config/weakpass.json](https://git.tuxpa.in/a/gosora/blob/master/docs/weak_passwords.md), [config/emoji.json](https://git.tuxpa.in/a/gosora/blob/master/docs/emoji.md) (WIP)
# Site # Site
@ -36,7 +36,7 @@ EnableEmails - Determines whether the SMTP mail subsystem is enabled. The experi
HasProxy - Brittle, but lets you set whether you're sitting behind a proxy like Cloudflare. Unknown effects with reverse-proxies like Nginx. HasProxy - Brittle, but lets you set whether you're sitting behind a proxy like Cloudflare. Unknown effects with reverse-proxies like Nginx.
Language - The language you want to use. Defaults to english. Please consult [internationalisation](https://github.com/Azareal/Gosora/blob/master/docs/internationalisation.md) for details. Language - The language you want to use. Defaults to english. Please consult [internationalisation](https://git.tuxpa.in/a/gosora/blob/master/docs/internationalisation.md) for details.
# Config # Config

View File

@ -17,7 +17,7 @@ First, we need somewhere for the software to live, if you're familiar with Linux
First, we'll navigate to our home folder by typing: `cd ~` First, we'll navigate to our home folder by typing: `cd ~`
And then, we'll going to pull a copy of Gosora off the git server with: `git clone https://github.com/Azareal/Gosora gosora` And then, we'll going to pull a copy of Gosora off the git server with: `git clone https://git.tuxpa.in/a/gosora gosora`
We can now hop into the newly created folder with the same command we used for getting to the home folder: We can now hop into the newly created folder with the same command we used for getting to the home folder:
@ -63,7 +63,7 @@ mkdir gosora
cd gosora cd gosora
git clone https://github.com/Azareal/Gosora src git clone https://git.tuxpa.in/a/gosora src
chown -R gosora ../gosora chown -R gosora ../gosora
@ -99,7 +99,7 @@ We will also want to setup a service:
# Additional Configuration # Additional Configuration
For things like HTTPS, you might also need to [modify your config.json](https://github.com/Azareal/Gosora/blob/master/docs/configuration.md) file after installing Gosora to get it working. For things like HTTPS, you might also need to [modify your config.json](https://git.tuxpa.in/a/gosora/blob/master/docs/configuration.md) file after installing Gosora to get it working.
You can get a free private key and certificate pair from Let's Encrypt or Cloudflare. You can get a free private key and certificate pair from Let's Encrypt or Cloudflare.
@ -125,7 +125,7 @@ For more info, you might want to take a gander inside the `./run-linux` and `./i
Linux: Linux:
```bash ```bash
git clone https://github.com/Azareal/Gosora gosora git clone https://git.tuxpa.in/a/gosora gosora
cd gosora cd gosora
@ -181,7 +181,7 @@ easyjson -pkg common
Windows: Windows:
```batch ```batch
git clone https://github.com/Azareal/Gosora gosora git clone https://git.tuxpa.in/a/gosora gosora
cd gosora cd gosora

View File

@ -2,7 +2,7 @@
The update system is currently under development, but you can run `dev-update.bat` to update your instance to the latest commit and to update the associated database schema, etc. The update system is currently under development, but you can run `dev-update.bat` to update your instance to the latest commit and to update the associated database schema, etc.
If you run into any issues doing so, please open an issue: https://github.com/Azareal/Gosora/issues/new If you run into any issues doing so, please open an issue: https://git.tuxpa.in/a/gosora/issues/new
If you want to manually patch Gosora rather than relying on the above scripts to do it, you'll first want to save your changes with `git stash`, and then, you'll overwrite the files with the new ones with `git pull origin master`, and then, you can re-apply your custom changes with `git stash apply` If you want to manually patch Gosora rather than relying on the above scripts to do it, you'll first want to save your changes with `git stash`, and then, you'll overwrite the files with the new ones with `git pull origin master`, and then, you can re-apply your custom changes with `git stash apply`
@ -14,7 +14,7 @@ Once you've done that, you just need to run `patcher.exe` to apply the latest pa
The update system is currently under development, but you can run `dev-update-linux` to update your instance to the latest commit and to update the associated database schema, etc. The update system is currently under development, but you can run `dev-update-linux` to update your instance to the latest commit and to update the associated database schema, etc.
If you run into any issues doing so, please open an issue: https://github.com/Azareal/Gosora/issues/new If you run into any issues doing so, please open an issue: https://git.tuxpa.in/a/gosora/issues/new
If you want to manually patch Gosora rather than relying on the above scripts to do it, you'll first want to save your changes with `git stash`, and then, you'll overwrite the files with the new ones with `git pull origin master`, and then, you'll re-apply your changes with `git stash apply`. If you want to manually patch Gosora rather than relying on the above scripts to do it, you'll first want to save your changes with `git stash`, and then, you'll overwrite the files with the new ones with `git pull origin master`, and then, you'll re-apply your changes with `git stash apply`.
@ -29,7 +29,7 @@ You will first want to follow the instructions in the section for updating depen
The update system is currently under development, but you can run `quick-update-linux` in `/home/gosora/src`to update your instance to the latest commit and to update the associated database schema, etc. The update system is currently under development, but you can run `quick-update-linux` in `/home/gosora/src`to update your instance to the latest commit and to update the associated database schema, etc.
If you run into any issues doing so, please open an issue: https://github.com/Azareal/Gosora/issues/new If you run into any issues doing so, please open an issue: https://git.tuxpa.in/a/gosora/issues/new
If you're using a systemd service, then you might want to switch to the `gosora` user with `su gosora` (you may be prompted for the password to the user), you can switch back by typing `exit`. If you're using a systemd service, then you might want to switch to the `gosora` user with `su gosora` (you may be prompted for the password to the user), you can switch back by typing `exit`.
If this is the first time you've done an update as the `gosora` user, then you might have to configure Git, simply do: If this is the first time you've done an update as the `gosora` user, then you might have to configure Git, simply do:

View File

@ -1,20 +1,22 @@
package main package main
import c "github.com/Azareal/Gosora/common" import (
import "github.com/oschwald/geoip2-golang" c "git.tuxpa.in/a/gosora/common"
"github.com/oschwald/geoip2-golang"
)
var geoipDB *geoip.DB var geoipDB *geoip2.Reader
var geoipDBLocation = "geoip_db.mmdb" var geoipDBLocation = "geoip_db.mmdb"
func init() { func init() {
c.Plugins.Add(&c.Plugin{UName: "geoip", Name: "Geoip", Author: "Azareal", Init: initGeoip, Deactivate: deactivateGeoip}) c.Plugins.Add(&c.Plugin{UName: "geoip", Name: "Geoip", Author: "Azareal", Init: initGeoip, Deactivate: deactivateGeoip})
} }
func initGeoip(plugin *c.Plugin) (err error) { func initGeoip(plugin *c.Plugin) (err error) {
geoipDB, err = geoip2.Open(geoipDBLocation) geoipDB, err = geoip2.Open(geoipDBLocation)
return err return err
} }
func deactivateGeoip(plugin *c.Plugin) { func deactivateGeoip(plugin *c.Plugin) {
geoipDB.Close() geoipDB.Close()
} }

View File

@ -1,17 +1,17 @@
package main package main
import ( import (
"errors" "errors"
"io" "io"
"os/exec" "os/exec"
"runtime" "runtime"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
) )
/* /*
Sending emails in a way you really shouldn't be sending them. Sending emails in a way you really shouldn't be sending them.
This method doesn't require a SMTP server, but has higher chances of an email being rejected or being seen as spam. Use at your own risk. Only for Linux as Windows doesn't have Sendmail. This method doesn't require a SMTP server, but has higher chances of an email being rejected or being seen as spam. Use at your own risk. Only for Linux as Windows doesn't have Sendmail.
*/ */
func init() { func init() {
// Don't bother registering this plugin on platforms other than Linux // Don't bother registering this plugin on platforms other than Linux

View File

@ -2,6 +2,6 @@
"UName":"adventure", "UName":"adventure",
"Name":"Adventure", "Name":"Adventure",
"Author":"Azareal", "Author":"Azareal",
"URL":"https://github.com/Azareal/Gosora", "URL":"https://git.tuxpa.in/a/gosora",
"Skip":true "Skip":true
} }

View File

@ -3,7 +3,7 @@ package guilds
import ( import (
"database/sql" "database/sql"
qgen "github.com/Azareal/Gosora/query_gen" qgen "git.tuxpa.in/a/gosora/query_gen"
) )
var Gstore GuildStore var Gstore GuildStore

View File

@ -1,4 +1,4 @@
package guilds // import "github.com/Azareal/Gosora/extend/guilds/lib" package guilds // import "git.tuxpa.in/a/gosora/extend/guilds/lib"
import ( import (
"bytes" "bytes"
@ -10,8 +10,8 @@ import (
"strconv" "strconv"
"strings" "strings"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
"github.com/Azareal/Gosora/routes" "git.tuxpa.in/a/gosora/routes"
) )
// A blank list to fill out that parameter in Page for routes which don't use it // A blank list to fill out that parameter in Page for routes which don't use it
@ -62,6 +62,7 @@ type Page struct {
// ListPage is a page struct for constructing a list of every guild // ListPage is a page struct for constructing a list of every guild
type ListPage struct { type ListPage struct {
Title string Title string
User *c.User
Header *c.Header Header *c.Header
GuildList []*Guild GuildList []*Guild
} }

View File

@ -2,6 +2,6 @@
"UName":"guilds", "UName":"guilds",
"Name":"Guilds", "Name":"Guilds",
"Author":"Azareal", "Author":"Azareal",
"URL":"https://github.com/Azareal/Gosora", "URL":"https://git.tuxpa.in/a/gosora",
"Skip":true "Skip":true
} }

View File

@ -1,8 +1,8 @@
package main package main
import ( import (
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
guilds "github.com/Azareal/Gosora/extend/guilds/lib" guilds "git.tuxpa.in/a/gosora/extend/guilds/lib"
) )
// TODO: Add a better way of splitting up giant plugins like this // TODO: Add a better way of splitting up giant plugins like this

View File

@ -2,6 +2,6 @@
"UName":"heytherejs", "UName":"heytherejs",
"Name":"HeythereJS", "Name":"HeythereJS",
"Author":"Azareal", "Author":"Azareal",
"URL":"https://github.com/Azareal/Gosora", "URL":"https://git.tuxpa.in/a/gosora",
"Main":"main.js" "Main":"main.js"
} }

View File

@ -1,23 +1,23 @@
// WIP - Experimental adventure plugin, this might find a new home soon, but it's here to stress test Gosora's extensibility for now // WIP - Experimental adventure plugin, this might find a new home soon, but it's here to stress test Gosora's extensibility for now
package extend package extend
import c "github.com/Azareal/Gosora/common" import c "git.tuxpa.in/a/gosora/common"
func init() { func init() {
c.Plugins.Add(&c.Plugin{ c.Plugins.Add(&c.Plugin{
UName: "adventure", UName: "adventure",
Name: "Adventure", Name: "Adventure",
Tag: "WIP", Tag: "WIP",
Author: "Azareal", Author: "Azareal",
URL: "https://github.com/Azareal", URL: "https://github.com/Azareal",
Init: initAdventure, Init: initAdventure,
Deactivate: deactivateAdventure, Deactivate: deactivateAdventure,
Install: installAdventure, Install: installAdventure,
}) })
} }
func initAdventure(pl *c.Plugin) error { func initAdventure(pl *c.Plugin) error {
return nil return nil
} }
// TODO: Change the signature to return an error? // TODO: Change the signature to return an error?
@ -25,5 +25,5 @@ func deactivateAdventure(pl *c.Plugin) {
} }
func installAdventure(pl *c.Plugin) error { func installAdventure(pl *c.Plugin) error {
return nil return nil
} }

View File

@ -1,13 +1,13 @@
package extend package extend
import ( import (
"bytes" "bytes"
"math/rand" "math/rand"
"regexp" "regexp"
"strconv" "strconv"
"time" "time"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
) )
var bbcodeRandom *rand.Rand var bbcodeRandom *rand.Rand

View File

@ -1,26 +1,26 @@
package extend package extend
import c "github.com/Azareal/Gosora/common" import c "git.tuxpa.in/a/gosora/common"
func init() { func init() {
c.Plugins.Add(&c.Plugin{UName: "heythere", Name: "Hey There", Author: "Azareal", URL: "https://github.com/Azareal", Init: initHeythere, Deactivate: deactivateHeythere}) c.Plugins.Add(&c.Plugin{UName: "heythere", Name: "Hey There", Author: "Azareal", URL: "https://github.com/Azareal", Init: initHeythere, Deactivate: deactivateHeythere})
} }
// initHeythere is separate from init() as we don't want the plugin to run if the plugin is disabled // initHeythere is separate from init() as we don't want the plugin to run if the plugin is disabled
func initHeythere(plugin *c.Plugin) error { func initHeythere(plugin *c.Plugin) error {
plugin.AddHook("topic_reply_row_assign", heythereReply) plugin.AddHook("topic_reply_row_assign", heythereReply)
return nil return nil
} }
func deactivateHeythere(plugin *c.Plugin) { func deactivateHeythere(plugin *c.Plugin) {
plugin.RemoveHook("topic_reply_row_assign", heythereReply) plugin.RemoveHook("topic_reply_row_assign", heythereReply)
} }
func heythereReply(data ...interface{}) interface{} { func heythereReply(data ...interface{}) interface{} {
currentUser := data[0].(*c.TopicPage).Header.CurrentUser currentUser := data[0].(*c.TopicPage).Header.CurrentUser
reply := data[1].(*c.ReplyUser) reply := data[1].(*c.ReplyUser)
reply.Content = "Hey there, " + currentUser.Name + "!" reply.Content = "Hey there, " + currentUser.Name + "!"
reply.ContentHtml = "Hey there, " + currentUser.Name + "!" reply.ContentHtml = "Hey there, " + currentUser.Name + "!"
reply.Tag = "Auto" reply.Tag = "Auto"
return nil return nil
} }

View File

@ -2,18 +2,18 @@
package extend package extend
import ( import (
//"log" //"log"
"bytes" "bytes"
"errors" "errors"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"strconv" "strconv"
"strings" "strings"
"sync/atomic" "sync/atomic"
"time" "time"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
"github.com/Azareal/Gosora/routes" "git.tuxpa.in/a/gosora/routes"
) )
var hyperspace *Hyperspace var hyperspace *Hyperspace

View File

@ -1,9 +1,9 @@
package extend package extend
import ( import (
"strings" "strings"
c "github.com/Azareal/Gosora/common" c "git.tuxpa.in/a/gosora/common"
) )
var markdownMaxDepth = 25 // How deep the parser will go when parsing Markdown strings var markdownMaxDepth = 25 // How deep the parser will go when parsing Markdown strings

Some files were not shown because too many files have changed in this diff Show More