Versions in this module Expand all Collapse all v0 v0.1.1 Oct 4, 2024 Changes in this version + const PageSize + const SoftwareVersion + var DBPath = "fishbb.db" + var Port = ":8080" + var SingleInstance = false + func Admin(handler http.Handler) http.Handler + func CSRFWrap(handler http.Handler) http.Handler + func CSRFWrapFunc(fn http.HandlerFunc) http.Handler + func ChangePassword(w http.ResponseWriter, r *http.Request) error + func ChangePostToHiddenMethod(next http.Handler) http.Handler + func CheckCSRF(r *http.Request) bool + func Checker(handler http.Handler) http.Handler + func GenerateRandomString(n int) (string, error) + func GetCSRF(r *http.Request) string + func GetConfigValue(key string) (string, error) + func GetCookieValue(r *http.Request, name string) (string, error) + func GetFlash(w http.ResponseWriter, r *http.Request, name string) (string, error) + func KeyByUserID(r *http.Request) (string, error) + func LimitByRealIP(requestLimit int, windowLength time.Duration) func(next http.Handler) http.Handler + func LimitByUser(requestLimit int, windowLength time.Duration) func(next http.Handler) http.Handler + func LoginFunc(w http.ResponseWriter, r *http.Request) + func LoginInit(args LoginInitArgs) + func LogoutFunc(w http.ResponseWriter, r *http.Request) + func Mod(handler http.Handler) http.Handler + func NewTOTP(username string) error + func PrepareStatements(db *sql.DB) + func Required(handler http.Handler) http.Handler + func Roles(handler http.Handler, roles []Role) http.Handler + func SaveConfig(c Config) error + func SendEmail() + func Serve() + func SetCookieValue(w http.ResponseWriter, name string, value string) + func SetLoginCookie() + func SetPassword(userid int, newpass string) error + func SetupGoogleOAuth() + func TokenRequired(handler http.Handler) http.Handler + func UpdateConfig(key string, value any) error + type Config struct + BoardDescription string + BoardName string + Domain string + GoogleOAuthClientID string + GoogleOAuthClientSecret string + RequiresApproval bool + SMTPPassword string + SMTPUsername string + func DefaultConfig() Config + func GetConfig() (Config, error) + type Forum struct + Description string + ID int + LastPost Post + Name string + ReadPermissions Role + Slug string + ThreadCount int + WritePermissions Role + type LoginInitArgs struct + Db *sql.DB + Insecure bool + SafariWorks bool + SameSiteStrict bool + type Notification struct + Created time.Time + ID int + Message string + type Post struct + Author User + Content string + Created time.Time + Edited *time.Time + ID int + ThreadID string + ThreadPostCount int + ThreadTitle string + func (p Post) BuildReply() string + func (p Post) Preview() string + func (p Post) Render() template.HTML + func (p Post) Slug() string + type Role string + var RoleAdmin Role = "admin" + var RoleInactive Role = "inactive" + var RoleMod Role = "mod" + var RoleNone Role = "" + var RoleUser Role = "user" + func (r Role) Can(req Role) bool + type SharedConfig struct + type Thread struct + Author User + Created time.Time + ForumID int + ID int + Latest Post + Locked bool + Pinned bool + Replies int + Title string + type User struct + About string + Created time.Time + Email string + EmailPublic bool + ID int + Posts int + Role Role + Username string + Website string + type UserInfo struct + Role Role + UserID int + Username string + func GetUserInfo(r *http.Request) *UserInfo