This commit is contained in:
tsmethurst 2021-09-07 18:18:21 +02:00
commit 9191e967a7
9 changed files with 47 additions and 47 deletions

View file

@ -40,18 +40,18 @@ func adminCommands() []*cli.Command {
Usage: "create a new account",
Flags: []cli.Flag{
&cli.StringFlag{
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Required: true,
},
&cli.StringFlag{
Name: config.EmailFlag,
Usage: config.EmailUsage,
Name: config.EmailFlag,
Usage: config.EmailUsage,
Required: true,
},
&cli.StringFlag{
Name: config.PasswordFlag,
Usage: config.PasswordUsage,
Name: config.PasswordFlag,
Usage: config.PasswordUsage,
Required: true,
},
},
@ -64,8 +64,8 @@ func adminCommands() []*cli.Command {
Usage: "confirm an existing account manually, thereby skipping email confirmation",
Flags: []cli.Flag{
&cli.StringFlag{
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Required: true,
},
},
@ -78,8 +78,8 @@ func adminCommands() []*cli.Command {
Usage: "promote an account to admin",
Flags: []cli.Flag{
&cli.StringFlag{
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Required: true,
},
},
@ -92,8 +92,8 @@ func adminCommands() []*cli.Command {
Usage: "demote an account from admin to normal user",
Flags: []cli.Flag{
&cli.StringFlag{
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Required: true,
},
},
@ -106,8 +106,8 @@ func adminCommands() []*cli.Command {
Usage: "prevent an account from signing in or posting etc, but don't delete anything",
Flags: []cli.Flag{
&cli.StringFlag{
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Required: true,
},
},
@ -120,8 +120,8 @@ func adminCommands() []*cli.Command {
Usage: "completely remove an account and all of its posts, media, etc",
Flags: []cli.Flag{
&cli.StringFlag{
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Required: true,
},
},
@ -134,13 +134,13 @@ func adminCommands() []*cli.Command {
Usage: "set a new password for the given account",
Flags: []cli.Flag{
&cli.StringFlag{
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Name: config.UsernameFlag,
Usage: config.UsernameUsage,
Required: true,
},
&cli.StringFlag{
Name: config.PasswordFlag,
Usage: config.PasswordUsage,
Name: config.PasswordFlag,
Usage: config.PasswordUsage,
Required: true,
},
},
@ -155,8 +155,8 @@ func adminCommands() []*cli.Command {
Usage: "export data from the database to file at the given path",
Flags: []cli.Flag{
&cli.StringFlag{
Name: config.TransPathFlag,
Usage: config.TransPathUsage,
Name: config.TransPathFlag,
Usage: config.TransPathUsage,
Required: true,
},
},

View file

@ -37,7 +37,7 @@ const (
PasswordFlag = "password"
PasswordUsage = "the password to set for this account"
TransPathFlag = "path"
TransPathFlag = "path"
TransPathUsage = "the path of the file to import from/export to"
)

View file

@ -36,7 +36,7 @@ type importer struct {
func NewImporter(db db.DB, log *logrus.Logger) Importer {
return &importer{
db: db,
log: log,
db: db,
log: log,
}
}

View file

@ -21,10 +21,10 @@ package trans
import "time"
type Block struct {
Type TransType `json:"type" bun:"-"`
ID string `json:"id"`
Type TransType `json:"type" bun:"-"`
ID string `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
URI string `json:"uri"`
AccountID string `json:"accountId"`
TargetAccountID string `json:"targetAccountId"`
URI string `json:"uri"`
AccountID string `json:"accountId"`
TargetAccountID string `json:"targetAccountId"`
}

View file

@ -21,10 +21,10 @@ package trans
import "time"
type Follow struct {
Type TransType `json:"type" bun:"-"`
ID string `json:"id"`
Type TransType `json:"type" bun:"-"`
ID string `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
URI string `json:"uri"`
AccountID string `json:"accountId"`
TargetAccountID string `json:"targetAccountId"`
URI string `json:"uri"`
AccountID string `json:"accountId"`
TargetAccountID string `json:"targetAccountId"`
}

View file

@ -21,10 +21,10 @@ package trans
import "time"
type FollowRequest struct {
Type TransType `json:"type" bun:"-"`
ID string `json:"id"`
Type TransType `json:"type" bun:"-"`
ID string `json:"id"`
CreatedAt *time.Time `json:"createdAt"`
URI string `json:"uri"`
AccountID string `json:"accountId"`
TargetAccountID string `json:"targetAccountId"`
URI string `json:"uri"`
AccountID string `json:"accountId"`
TargetAccountID string `json:"targetAccountId"`
}

View file

@ -29,7 +29,7 @@ type Instance struct {
Domain string `json:"domain"`
Title string `json:"title,omitempty" bun:",nullzero"`
URI string `json:"uri"`
SuspendedAt *time.Time `json:"suspendedAt,omitempty" bun:",nullzero"`
SuspendedAt *time.Time `json:"suspendedAt,omitempty" bun:",nullzero"`
DomainBlockID string `json:"domainBlockID,omitempty" bun:",nullzero"`
ShortDescription string `json:"shortDescription,omitempty" bun:",nullzero"`
Description string `json:"description,omitempty" bun:",nullzero"`

View file

@ -29,21 +29,21 @@ type User struct {
Email string `json:"email,omitempty" bun:",nullzero"`
AccountID string `json:"accountID"`
EncryptedPassword string `json:"encryptedPassword"`
CurrentSignInAt *time.Time `json:"currentSignInAt,omitempty" bun:",nullzero"`
LastSignInAt *time.Time `json:"lastSignInAt,omitempty" bun:",nullzero"`
CurrentSignInAt *time.Time `json:"currentSignInAt,omitempty" bun:",nullzero"`
LastSignInAt *time.Time `json:"lastSignInAt,omitempty" bun:",nullzero"`
InviteID string `json:"inviteID,omitempty" bun:",nullzero"`
ChosenLanguages []string `json:"chosenLanguages,omitempty" bun:",nullzero"`
FilteredLanguages []string `json:"filteredLanguage,omitempty" bun:",nullzero"`
Locale string `json:"locale" bun:",nullzero"`
LastEmailedAt time.Time `json:"lastEmailedAt,omitempty" bun:",nullzero"`
ConfirmationToken string `json:"confirmationToken,omitempty" bun:",nullzero"`
ConfirmationSentAt *time.Time `json:"confirmationTokenSentAt,omitempty" bun:",nullzero"`
ConfirmedAt *time.Time `json:"confirmedAt,omitempty" bun:",nullzero"`
ConfirmationSentAt *time.Time `json:"confirmationTokenSentAt,omitempty" bun:",nullzero"`
ConfirmedAt *time.Time `json:"confirmedAt,omitempty" bun:",nullzero"`
UnconfirmedEmail string `json:"unconfirmedEmail,omitempty" bun:",nullzero"`
Moderator bool `json:"moderator"`
Admin bool `json:"admin"`
Disabled bool `json:"disabled"`
Approved bool `json:"approved"`
ResetPasswordToken string `json:"resetPasswordToken,omitempty" bun:",nullzero"`
ResetPasswordSentAt *time.Time `json:"resetPasswordSentAt,omitempty" bun:",nullzero"`
ResetPasswordSentAt *time.Time `json:"resetPasswordSentAt,omitempty" bun:",nullzero"`
}

View file

@ -33,7 +33,7 @@ type TransTestSuite struct {
func (suite *TransTestSuite) SetupTest() {
suite.db = testrig.NewTestDB()
suite.log = testrig.NewTestLog()
suite.log = testrig.NewTestLog()
testrig.StandardDBSetup(suite.db, nil)
}