summaryrefslogtreecommitdiff
path: root/internal/config
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-09-04 14:41:42 +0200
committerLibravatar GitHub <noreply@github.com>2022-09-04 14:41:42 +0200
commit006c8b604b88fdddf1a2319e44aa37dd8777efd9 (patch)
treed1562a40f437005031405525a51a8003c2fd39d7 /internal/config
parent[bugfix] Fix status fields `in_reply_to_id` and `in_reply_to_account_id` not ... (diff)
downloadgotosocial-006c8b604b88fdddf1a2319e44aa37dd8777efd9.tar.xz
[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
Diffstat (limited to 'internal/config')
-rw-r--r--internal/config/validate.go5
-rw-r--r--internal/config/validate_test.go9
2 files changed, 14 insertions, 0 deletions
diff --git a/internal/config/validate.go b/internal/config/validate.go
index b68cb2c62..064eae07a 100644
--- a/internal/config/validate.go
+++ b/internal/config/validate.go
@@ -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 {
diff --git a/internal/config/validate_test.go b/internal/config/validate_test.go
index 6b832de36..c3a998a4a 100644
--- a/internal/config/validate_test.go
+++ b/internal/config/validate_test.go
@@ -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()