mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 13:32:25 -05:00
[feature] Set default header and avatar for API accounts to GtS ones (#799)
* validate web-asset-base-dir * move default icons into converter * always ensure avatar + header on api accounts * update tests * add default header * don't return error from web module creation anymore * tidy a bit * use pngs for default avatars rather than svgs
This commit is contained in:
parent
4e13408fd4
commit
006c8b604b
30 changed files with 205 additions and 1039 deletions
|
|
@ -62,6 +62,11 @@ func Validate() error {
|
|||
errs = append(errs, fmt.Errorf("%s must be set to either http or https, provided value was %s", ProtocolFlag(), proto))
|
||||
}
|
||||
|
||||
webAssetsBaseDir := GetWebAssetBaseDir()
|
||||
if webAssetsBaseDir == "" {
|
||||
errs = append(errs, fmt.Errorf("%s must be set", WebAssetBaseDirFlag()))
|
||||
}
|
||||
|
||||
if len(errs) > 0 {
|
||||
errStrings := []string{}
|
||||
for _, err := range errs {
|
||||
|
|
|
|||
|
|
@ -103,6 +103,15 @@ func (suite *ConfigValidateTestSuite) TestValidateConfigNoProtocol() {
|
|||
suite.EqualError(err, "protocol must be set")
|
||||
}
|
||||
|
||||
func (suite *ConfigValidateTestSuite) TestValidateConfigNoWebAssetBaseDir() {
|
||||
testrig.InitTestConfig()
|
||||
|
||||
config.SetWebAssetBaseDir("")
|
||||
|
||||
err := config.Validate()
|
||||
suite.EqualError(err, "web-asset-base-dir must be set")
|
||||
}
|
||||
|
||||
func (suite *ConfigValidateTestSuite) TestValidateConfigNoProtocolOrHost() {
|
||||
testrig.InitTestConfig()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue