Documentation ¶
Overview ¶
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- Variables
- type AccessLog
- type AccessLogLite
- type CloudStorage
- func (s *CloudStorage) Add() (pk interface{}, err error)
- func (s *CloudStorage) BaseURL() string
- func (s *CloudStorage) Edit(mw func(db.Result) db.Result, args ...interface{}) (err error)
- func (s *CloudStorage) Get(mw func(db.Result) db.Result, args ...interface{}) error
- func (s *CloudStorage) RawSecret() string
- type Code
- func (c *Code) AddVerificationCode() (interface{}, error)
- func (c *Code) CheckFrequency(ownerID uint64, ownerType string, sendMethod string, frequencyCfg echo.H) error
- func (c *Code) CheckVerificationCode(code string, purpose string, ownerID uint64, ownerType string, ...) (err error)
- func (c *Code) CountTodayVerificationCode(ownerID uint64, ownerType string, sendMethod string) (int64, error)
- func (c *Code) LastVerificationCode(ownerID uint64, ownerType string, sendMethod string) (err error)
- func (c *Code) UseInvitationCode(m *dbschema.CodeInvitation, usedUid uint) (err error)
- func (c *Code) UseVerificationCode(m *dbschema.CodeVerification) (err error)
- func (c *Code) VerfyInvitationCode(code string) (err error)
- type CollectorExport
- type CollectorExportAndGroup
- type CollectorGroup
- type CollectorHistory
- type CollectorPage
- type CollectorPageAndGroup
- type CollectorRule
- type Command
- type Config
- func (f *Config) Add() (pk interface{}, err error)
- func (f *Config) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (f *Config) EditByPK(mw func(db.Result) db.Result, group string, key string) error
- func (f *Config) ListAllMapByGroup() (echo.H, error)
- func (f *Config) ListByGroup(group string) (func() int64, error)
- func (f *Config) ListMapByGroup(group string) (echo.H, error)
- func (f *Config) Upsert() (pk interface{}, err error)
- func (f *Config) ValueByKey(group, key string) string
- type DbAccount
- type DbSync
- func (a *DbSync) Add() (interface{}, error)
- func (a *DbSync) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (a *DbSync) HidePassword(dsn string) string
- func (a *DbSync) ParseDSN(dsn string) (user string, pwd string, host string, dbName string)
- func (a *DbSync) ToDSN(user, pwd, host, db string) string
- func (a *DbSync) ToDSNFromAccount(acc *dbschema.DbAccount) string
- type DbSyncLog
- type DbSyncWithAccount
- type ForeverProcess
- func (u *ForeverProcess) Add() (pk interface{}, err error)
- func (u *ForeverProcess) ArgsSlice() []string
- func (u *ForeverProcess) Edit(mw func(db.Result) db.Result, args ...interface{}) error
- func (u *ForeverProcess) EnvSlice() []string
- func (u *ForeverProcess) Exists(name string) (bool, error)
- func (u *ForeverProcess) Exists2(name string, excludeID uint) (bool, error)
- type FrpClient
- type FrpClientAndGroup
- type FrpGroup
- type FrpServer
- type FrpServerAndGroup
- type FtpUser
- type FtpUserAndGroup
- type FtpUserGroup
- type Invitation
- type SendingLog
- type SshUser
- type SshUserAndGroup
- type SshUserGroup
- type Task
- type TaskAndGroup
- type TaskGroup
- type TaskLog
- type User
- func (u *User) Add() (err error)
- func (u *User) CheckPasswd(username string, password string) (exists bool, err error)
- func (u *User) ClearPasswordData(users ...*dbschema.User) dbschema.User
- func (u *User) Exists(username string) (bool, error)
- func (u *User) Exists2(username string, excludeUID uint) (bool, error)
- func (u *User) GetUserAllU2F(uid uint) ([]*dbschema.UserU2f, error)
- func (u *User) NeedCheckU2F(uid uint) bool
- func (u *User) Register(user, pass, email string) error
- func (u *User) SetSession(users ...*dbschema.User)
- func (u *User) U2F(uid uint, typ string) (u2f *dbschema.UserU2f, err error)
- func (u *User) UnsetSession()
- func (u *User) UpdateField(uid uint, set map[string]interface{}) (err error)
- func (u *User) VerifySession(users ...*dbschema.User) error
- type UserRole
- func (u *UserRole) CheckCmdPerm(permPath string) bool
- func (u *UserRole) CheckCmdPerm2(roleList []*dbschema.UserRole, perm string) (hasPerm bool)
- func (u *UserRole) CheckPerm(permPath string) bool
- func (u *UserRole) CheckPerm2(roleList []*dbschema.UserRole, perm string) (hasPerm bool)
- func (u *UserRole) CleanPermAction(values []string) *UserRole
- func (u *UserRole) Exists(name string) (bool, error)
- func (u *UserRole) Exists2(name string, excludeID uint) (bool, error)
- func (u *UserRole) FilterNavigate(roleList []*dbschema.UserRole, navList *navigate.List) navigate.List
- func (u *UserRole) ListByUser(user *dbschema.User) (roleList []*dbschema.UserRole)
- type Verification
- type Vhost
- type VhostAndGroup
Constants ¶
This section is empty.
Variables ¶
var ( // SMSWaitingSeconds 短信发送后等待秒数 SMSWaitingSeconds int64 = 60 // SMSMaxPerDay 短信每人每天发送上限 SMSMaxPerDay int64 = 10 )
var ( ErrNoneFtpDirectory = errors.New(`No accessible directory`) ErrBannedFtpUser = errors.New(`The current account has been disabled`) )
var CaddyLogRegexpList = sync.Map{}
var (
Decode = func(r string) string { return r }
)
var DefaultSalt = ``
Functions ¶
This section is empty.
Types ¶
type AccessLog ¶
func NewAccessLog ¶
func (*AccessLog) ToLite ¶
func (m *AccessLog) ToLite() *AccessLogLite
type AccessLogLite ¶
type CloudStorage ¶
type CloudStorage struct { *dbschema.CloudStorage // contains filtered or unexported fields }
func NewCloudStorage ¶
func NewCloudStorage(ctx echo.Context) *CloudStorage
func (*CloudStorage) Add ¶
func (s *CloudStorage) Add() (pk interface{}, err error)
func (*CloudStorage) BaseURL ¶
func (s *CloudStorage) BaseURL() string
func (*CloudStorage) RawSecret ¶
func (s *CloudStorage) RawSecret() string
type Code ¶
type Code struct { Verification *dbschema.CodeVerification Invitation *dbschema.CodeInvitation *base.Base }
func (*Code) AddVerificationCode ¶
func (*Code) CheckFrequency ¶
func (*Code) CheckVerificationCode ¶
func (*Code) CountTodayVerificationCode ¶
func (*Code) LastVerificationCode ¶
func (*Code) UseInvitationCode ¶
func (c *Code) UseInvitationCode(m *dbschema.CodeInvitation, usedUid uint) (err error)
func (*Code) UseVerificationCode ¶
func (c *Code) UseVerificationCode(m *dbschema.CodeVerification) (err error)
func (*Code) VerfyInvitationCode ¶
type CollectorExport ¶
type CollectorExport struct { *dbschema.CollectorExport *base.Base }
func NewCollectorExport ¶
func NewCollectorExport(ctx echo.Context) *CollectorExport
func (*CollectorExport) Add ¶
func (c *CollectorExport) Add() (pk interface{}, err error)
func (*CollectorExport) Export ¶
func (c *CollectorExport) Export() (int64, error)
type CollectorExportAndGroup ¶
type CollectorExportAndGroup struct { *dbschema.CollectorExport Group *dbschema.CollectorGroup }
type CollectorGroup ¶
type CollectorGroup struct { *dbschema.CollectorGroup *base.Base }
func NewCollectorGroup ¶
func NewCollectorGroup(ctx echo.Context) *CollectorGroup
type CollectorHistory ¶
type CollectorHistory struct { *dbschema.CollectorHistory *base.Base }
func NewCollectorHistory ¶
func NewCollectorHistory(ctx echo.Context) *CollectorHistory
func (*CollectorHistory) Reset ¶
func (c *CollectorHistory) Reset() *CollectorHistory
type CollectorPage ¶
type CollectorPage struct { *dbschema.CollectorPage *base.Base }
func NewCollectorPage ¶
func NewCollectorPage(ctx echo.Context) *CollectorPage
type CollectorPageAndGroup ¶
type CollectorPageAndGroup struct { *dbschema.CollectorPage Group *dbschema.CollectorGroup }
type CollectorRule ¶
type CollectorRule struct { *dbschema.CollectorRule *base.Base }
func NewCollectorRule ¶
func NewCollectorRule(ctx echo.Context) *CollectorRule
type Command ¶
func NewCommand ¶
type DbAccount ¶ added in v1.3.0
func NewDbAccount ¶ added in v1.3.0
func (*DbAccount) SetOptions ¶
type DbSyncLog ¶
func NewDbSyncLog ¶
type DbSyncWithAccount ¶
type ForeverProcess ¶
type ForeverProcess struct { *dbschema.ForeverProcess *base.Base }
func NewForeverProcess ¶
func NewForeverProcess(ctx echo.Context) *ForeverProcess
func (*ForeverProcess) Add ¶
func (u *ForeverProcess) Add() (pk interface{}, err error)
func (*ForeverProcess) ArgsSlice ¶
func (u *ForeverProcess) ArgsSlice() []string
func (*ForeverProcess) EnvSlice ¶
func (u *ForeverProcess) EnvSlice() []string
type FrpClient ¶
func NewFrpClient ¶
type FrpClientAndGroup ¶
type FrpGroup ¶
func NewFrpGroup ¶
type FrpServer ¶
func NewFrpServer ¶
type FrpServerAndGroup ¶
type FtpUserAndGroup ¶
type FtpUserAndGroup struct { *dbschema.FtpUser Group *dbschema.FtpUserGroup }
type FtpUserGroup ¶
type FtpUserGroup struct { *dbschema.FtpUserGroup *base.Base }
func NewFtpUserGroup ¶
func NewFtpUserGroup(ctx echo.Context) *FtpUserGroup
func (*FtpUserGroup) ExistsOther ¶
func (f *FtpUserGroup) ExistsOther(name string, id uint) (bool, error)
func (*FtpUserGroup) ListByActive ¶
func (f *FtpUserGroup) ListByActive(page int, size int) (func() int64, []*dbschema.FtpUserGroup, error)
type Invitation ¶
type Invitation struct { *dbschema.CodeInvitation *base.Base }
func NewInvitation ¶
func NewInvitation(ctx echo.Context) *Invitation
type SendingLog ¶
type SendingLog struct { *dbschema.SendingLog *base.Base }
func NewSendingLog ¶
func NewSendingLog(ctx echo.Context) *SendingLog
func (*SendingLog) Add ¶
func (c *SendingLog) Add() (interface{}, error)
type SshUser ¶
func NewSshUser ¶
type SshUserAndGroup ¶
type SshUserAndGroup struct { *dbschema.SshUser Group *dbschema.SshUserGroup }
type SshUserGroup ¶
type SshUserGroup struct { *dbschema.SshUserGroup *base.Base }
func NewSshUserGroup ¶
func NewSshUserGroup(ctx echo.Context) *SshUserGroup
func (*SshUserGroup) ExistsOther ¶
func (f *SshUserGroup) ExistsOther(name string, id uint) (bool, error)
type TaskGroup ¶
func NewTaskGroup ¶
type TaskLog ¶
func NewTaskLog ¶
type User ¶
func (*User) CheckPasswd ¶
func (*User) ClearPasswordData ¶
func (*User) NeedCheckU2F ¶
func (*User) SetSession ¶
func (*User) UnsetSession ¶
func (u *User) UnsetSession()
func (*User) UpdateField ¶
type UserRole ¶
func NewUserRole ¶
func (*UserRole) CheckCmdPerm ¶
func (*UserRole) CheckCmdPerm2 ¶
func (*UserRole) CheckPerm2 ¶
func (*UserRole) CleanPermAction ¶
type Verification ¶
type Verification struct { *dbschema.CodeVerification *base.Base }
func NewVerification ¶
func NewVerification(ctx echo.Context) *Verification
type VhostAndGroup ¶
type VhostAndGroup struct { *dbschema.Vhost Group *dbschema.VhostGroup }
Source Files ¶
- accessLog.go
- accessLog_caddy.go
- accessLog_pattern.go
- accessLog_schema.go
- cloudStorage.go
- code.go
- collectorExport.go
- collectorGroup.go
- collectorHistory.go
- collectorPage.go
- collectorRule.go
- command.go
- config.go
- dbAccount.go
- dbSync.go
- dbSyncLog.go
- foreverProcess.go
- frpClient.go
- frpGroup.go
- frpServer.go
- ftpUser.go
- ftpUserGroup.go
- invitation.go
- sendingLog.go
- sshUser.go
- sshUserGroup.go
- task.go
- taskGroup.go
- taskLog.go
- user.go
- userRole.go
- verification.go
- vhost.go