diff --git a/net/server/internal/api_addAccount.go b/net/server/internal/api_addAccount.go index 14131f9b..bdb385ce 100644 --- a/net/server/internal/api_addAccount.go +++ b/net/server/internal/api_addAccount.go @@ -72,7 +72,7 @@ func AddAccount(w http.ResponseWriter, r *http.Request) { fingerprint := hex.EncodeToString(hash[:]) // create path for account data - path := getStrConfigValue(CONFIG_ASSETPATH, APPDefaultPath) + "/" + fingerprint + path := getStrConfigValue(CNFAssetPath, APPDefaultPath) + "/" + fingerprint if err := os.Mkdir(path, os.ModePerm); err != nil { ErrResponse(w, http.StatusInternalServerError, err) } @@ -121,7 +121,7 @@ func AddAccount(w http.ResponseWriter, r *http.Request) { Image: detail.Image, Revision: account.ProfileRevision, Version: APPVersion, - Node: getStrConfigValue(CONFIG_DOMAIN, ""), + Node: getStrConfigValue(CNFDomain, ""), } // send response diff --git a/net/server/internal/api_addAccountApp.go b/net/server/internal/api_addAccountApp.go index f025a40c..78ac4157 100644 --- a/net/server/internal/api_addAccountApp.go +++ b/net/server/internal/api_addAccountApp.go @@ -37,7 +37,7 @@ func AddAccountApp(w http.ResponseWriter, r *http.Request) { Name: appData.Name, Description: appData.Description, Image: appData.Image, - Url: appData.Url, + URL: appData.URL, Token: access, }; diff --git a/net/server/internal/api_addChannelTopicAsset.go b/net/server/internal/api_addChannelTopicAsset.go index 60053e42..dc1d95f9 100644 --- a/net/server/internal/api_addChannelTopicAsset.go +++ b/net/server/internal/api_addChannelTopicAsset.go @@ -70,7 +70,7 @@ func AddChannelTopicAsset(w http.ResponseWriter, r *http.Request) { // save new file id := uuid.New().String() - path := getStrConfigValue(CONFIG_ASSETPATH, APPDefaultPath) + "/" + channelSlot.Account.GUID + "/" + id + path := getStrConfigValue(CNFAssetPath, APPDefaultPath) + "/" + channelSlot.Account.GUID + "/" + id if err := r.ParseMultipartForm(32 << 20); err != nil { ErrResponse(w, http.StatusBadRequest, err) return @@ -172,7 +172,7 @@ func AddChannelTopicAsset(w http.ResponseWriter, r *http.Request) { func isStorageFull(act *store.Account) (full bool, err error) { - storage := getNumConfigValue(CONFIG_STORAGE, 0); + storage := getNumConfigValue(CNFStorage, 0); if storage == 0 { return } diff --git a/net/server/internal/api_clearCardNotes.go b/net/server/internal/api_clearCardNotes.go index 1b7f3296..42985ab9 100644 --- a/net/server/internal/api_clearCardNotes.go +++ b/net/server/internal/api_clearCardNotes.go @@ -38,7 +38,7 @@ func ClearCardNotes(w http.ResponseWriter, r *http.Request) { // save and update contact revision err = store.DB.Transaction(func(tx *gorm.DB) error { slot.Card.Notes = "" - slot.Card.DetailRevision += 1 + slot.Card.DetailRevision++ if res := tx.Save(&slot.Card).Error; res != nil { return res } diff --git a/net/server/internal/api_getAccountAvailable.go b/net/server/internal/api_getAccountAvailable.go index f3b7eb93..df09cec7 100644 --- a/net/server/internal/api_getAccountAvailable.go +++ b/net/server/internal/api_getAccountAvailable.go @@ -18,8 +18,8 @@ func GetAccountAvailable(w http.ResponseWriter, r *http.Request) { func getAvailableAccounts() (available int64, err error) { - open := getBoolConfigValue(CONFIG_OPENACCESS, true) - limit := getNumConfigValue(CONFIG_ACCOUNTLIMIT, 16) + open := getBoolConfigValue(CNFOpenAccess, true) + limit := getNumConfigValue(CNFAccountLimit, 16) var count int64 if err = store.DB.Model(&store.Account{}).Count(&count).Error; err != nil { diff --git a/net/server/internal/api_getAccountListing.go b/net/server/internal/api_getAccountListing.go index 8a71aa08..bdac038a 100644 --- a/net/server/internal/api_getAccountListing.go +++ b/net/server/internal/api_getAccountListing.go @@ -23,7 +23,7 @@ func GetAccountListing(w http.ResponseWriter, r *http.Request) { Location: account.AccountDetail.Location, ImageSet: account.AccountDetail.Image != "", Version: APPVersion, - Node: getStrConfigValue(CONFIG_DOMAIN, ""), + Node: getStrConfigValue(CNFDomain, ""), }) } diff --git a/net/server/internal/api_getAccountListingMessage.go b/net/server/internal/api_getAccountListingMessage.go index 9d58f557..b0bbc178 100644 --- a/net/server/internal/api_getAccountListingMessage.go +++ b/net/server/internal/api_getAccountListingMessage.go @@ -34,7 +34,7 @@ func GetAccountListingMessage(w http.ResponseWriter, r *http.Request) { Location: detail.Location, Image: detail.Image, Version: APPVersion, - Node: getStrConfigValue(CONFIG_DOMAIN, ""), + Node: getStrConfigValue(CNFDomain, ""), } msg, res := WriteDataMessage(detail.PrivateKey, detail.PublicKey, detail.KeyType, APPSignPKCS1V15, account.GUID, APPMsgIdentity, &identity) diff --git a/net/server/internal/api_getAccountStatus.go b/net/server/internal/api_getAccountStatus.go index e27b5b59..6d953410 100644 --- a/net/server/internal/api_getAccountStatus.go +++ b/net/server/internal/api_getAccountStatus.go @@ -21,7 +21,7 @@ func GetAccountStatus(w http.ResponseWriter, r *http.Request) { // construct response status := &AccountStatus{} - status.StorageAvailable = getNumConfigValue(CONFIG_STORAGE, 0); + status.StorageAvailable = getNumConfigValue(CNFStorage, 0); for _, asset := range assets { status.StorageUsed += asset.Size } diff --git a/net/server/internal/api_getChannelTopicAsset.go b/net/server/internal/api_getChannelTopicAsset.go index 515fdd4c..550813db 100644 --- a/net/server/internal/api_getChannelTopicAsset.go +++ b/net/server/internal/api_getChannelTopicAsset.go @@ -42,7 +42,7 @@ func GetChannelTopicAsset(w http.ResponseWriter, r *http.Request) { } // construct file path - path := getStrConfigValue(CONFIG_ASSETPATH, APPDefaultPath) + "/" + act.GUID + "/" + asset.AssetID + path := getStrConfigValue(CNFAssetPath, APPDefaultPath) + "/" + act.GUID + "/" + asset.AssetID http.ServeFile(w, r, path) } diff --git a/net/server/internal/api_getNodeConfig.go b/net/server/internal/api_getNodeConfig.go index c09b4d63..1d5aaa50 100644 --- a/net/server/internal/api_getNodeConfig.go +++ b/net/server/internal/api_getNodeConfig.go @@ -14,10 +14,10 @@ func GetNodeConfig(w http.ResponseWriter, r *http.Request) { // get node config fields var config NodeConfig; - config.Domain = getStrConfigValue(CONFIG_DOMAIN, ""); - config.AccountLimit = getNumConfigValue(CONFIG_ACCOUNTLIMIT, 16); - config.OpenAccess = getBoolConfigValue(CONFIG_OPENACCESS, true); - config.AccountStorage = getNumConfigValue(CONFIG_STORAGE, 0); + config.Domain = getStrConfigValue(CNFDomain, ""); + config.AccountLimit = getNumConfigValue(CNFAccountLimit, 16); + config.OpenAccess = getBoolConfigValue(CNFOpenAccess, true); + config.AccountStorage = getNumConfigValue(CNFStorage, 0); WriteResponse(w, config); } diff --git a/net/server/internal/api_getNodeStatus.go b/net/server/internal/api_getNodeStatus.go index 7a28c2bf..17afed65 100644 --- a/net/server/internal/api_getNodeStatus.go +++ b/net/server/internal/api_getNodeStatus.go @@ -9,7 +9,7 @@ import ( func GetNodeStatus(w http.ResponseWriter, r *http.Request) { var config store.Config - err := store.DB.Where("config_id = ?", CONFIG_CONFIGURED).First(&config).Error + err := store.DB.Where("config_id = ?", CNFConfigured).First(&config).Error if err != nil { if errors.Is(err, gorm.ErrRecordNotFound) { WriteResponse(w, true) diff --git a/net/server/internal/api_getOpenMessage.go b/net/server/internal/api_getOpenMessage.go index 49961012..f83a0ad6 100644 --- a/net/server/internal/api_getOpenMessage.go +++ b/net/server/internal/api_getOpenMessage.go @@ -50,7 +50,7 @@ func GetOpenMessage(w http.ResponseWriter, r *http.Request) { Location: detail.Location, Image: detail.Image, Version: APPVersion, - Node: getStrConfigValue(CONFIG_DOMAIN, ""), + Node: getStrConfigValue(CNFDomain, ""), } msg, err := WriteDataMessage(detail.PrivateKey, detail.PublicKey, detail.KeyType, diff --git a/net/server/internal/api_getProfileMessage.go b/net/server/internal/api_getProfileMessage.go index b76459ed..d10c7ebe 100644 --- a/net/server/internal/api_getProfileMessage.go +++ b/net/server/internal/api_getProfileMessage.go @@ -40,7 +40,7 @@ func GetProfileMessage(w http.ResponseWriter, r *http.Request) { Location: detail.Location, Image: detail.Image, Version: APPVersion, - Node: getStrConfigValue(CONFIG_DOMAIN, ""), + Node: getStrConfigValue(CNFDomain, ""), } msg, res := WriteDataMessage(detail.PrivateKey, detail.PublicKey, detail.KeyType, APPSignPKCS1V15, account.GUID, APPMsgIdentity, &identity) diff --git a/net/server/internal/api_removeAccount.go b/net/server/internal/api_removeAccount.go index c5da35fd..b42abd76 100644 --- a/net/server/internal/api_removeAccount.go +++ b/net/server/internal/api_removeAccount.go @@ -78,7 +78,7 @@ func RemoveAccount(w http.ResponseWriter, r *http.Request) { } // delete asset files - path := getStrConfigValue(CONFIG_ASSETPATH, APPDefaultPath) + "/" + account.GUID + path := getStrConfigValue(CNFAssetPath, APPDefaultPath) + "/" + account.GUID if err = os.RemoveAll(path); err != nil { ErrMsg(err) } diff --git a/net/server/internal/api_removeNodeAccount.go b/net/server/internal/api_removeNodeAccount.go index 0bb85a76..a4794bbf 100644 --- a/net/server/internal/api_removeNodeAccount.go +++ b/net/server/internal/api_removeNodeAccount.go @@ -98,7 +98,7 @@ func RemoveNodeAccount(w http.ResponseWriter, r *http.Request) { } // delete asset files - path := getStrConfigValue(CONFIG_ASSETPATH, APPDefaultPath) + "/" + account.GUID + path := getStrConfigValue(CNFAssetPath, APPDefaultPath) + "/" + account.GUID if err = os.RemoveAll(path); err != nil { ErrMsg(err) } diff --git a/net/server/internal/api_setAccountAccess.go b/net/server/internal/api_setAccountAccess.go index 80998fc8..8cc7d780 100644 --- a/net/server/internal/api_setAccountAccess.go +++ b/net/server/internal/api_setAccountAccess.go @@ -43,7 +43,7 @@ func SetAccountAccess(w http.ResponseWriter, r *http.Request) { Name: appData.Name, Description: appData.Description, Image: appData.Image, - Url: appData.Url, + URL: appData.URL, Token: access, }; diff --git a/net/server/internal/api_setCardNotes.go b/net/server/internal/api_setCardNotes.go index 8ef8af5c..1940e4d6 100644 --- a/net/server/internal/api_setCardNotes.go +++ b/net/server/internal/api_setCardNotes.go @@ -44,7 +44,7 @@ func SetCardNotes(w http.ResponseWriter, r *http.Request) { // save and update contact revision err = store.DB.Transaction(func(tx *gorm.DB) error { slot.Card.Notes = notes - slot.Card.DetailRevision += 1 + slot.Card.DetailRevision++ if res := tx.Save(&slot.Card).Error; res != nil { return res } diff --git a/net/server/internal/api_setCardStatus.go b/net/server/internal/api_setCardStatus.go index a938ee83..bbc791b7 100644 --- a/net/server/internal/api_setCardStatus.go +++ b/net/server/internal/api_setCardStatus.go @@ -108,7 +108,7 @@ func SetCardStatus(w http.ResponseWriter, r *http.Request) { slot.Card.NotifiedArticle = articleRevision slot.Card.NotifiedChannel = channelRevision slot.Card.NotifiedProfile = profileRevision - slot.Card.DetailRevision += 1 + slot.Card.DetailRevision++ // save and update contact revision err = store.DB.Transaction(func(tx *gorm.DB) error { diff --git a/net/server/internal/api_setNodeConfig.go b/net/server/internal/api_setNodeConfig.go index aee3f910..fe458708 100644 --- a/net/server/internal/api_setNodeConfig.go +++ b/net/server/internal/api_setNodeConfig.go @@ -29,7 +29,7 @@ func SetNodeConfig(w http.ResponseWriter, r *http.Request) { if res := tx.Clauses(clause.OnConflict{ Columns: []clause.Column{{Name: "config_id"}}, DoUpdates: clause.AssignmentColumns([]string{"str_value"}), - }).Create(&store.Config{ConfigID: CONFIG_DOMAIN, StrValue: config.Domain}).Error; res != nil { + }).Create(&store.Config{ConfigID: CNFDomain, StrValue: config.Domain}).Error; res != nil { return res } @@ -37,7 +37,7 @@ func SetNodeConfig(w http.ResponseWriter, r *http.Request) { if res := tx.Clauses(clause.OnConflict{ Columns: []clause.Column{{Name: "config_id"}}, DoUpdates: clause.AssignmentColumns([]string{"num_value"}), - }).Create(&store.Config{ConfigID: CONFIG_ACCOUNTLIMIT, NumValue: config.AccountLimit}).Error; res != nil { + }).Create(&store.Config{ConfigID: CNFAccountLimit, NumValue: config.AccountLimit}).Error; res != nil { return res } @@ -45,7 +45,7 @@ func SetNodeConfig(w http.ResponseWriter, r *http.Request) { if res := tx.Clauses(clause.OnConflict{ Columns: []clause.Column{{Name: "config_id"}}, DoUpdates: clause.AssignmentColumns([]string{"bool_value"}), - }).Create(&store.Config{ConfigID: CONFIG_ACCOUNTLIMIT, BoolValue: config.OpenAccess}).Error; res != nil { + }).Create(&store.Config{ConfigID: CNFAccountLimit, BoolValue: config.OpenAccess}).Error; res != nil { return res } @@ -53,7 +53,7 @@ func SetNodeConfig(w http.ResponseWriter, r *http.Request) { if res := tx.Clauses(clause.OnConflict{ Columns: []clause.Column{{Name: "config_id"}}, DoUpdates: clause.AssignmentColumns([]string{"num_value"}), - }).Create(&store.Config{ConfigID: CONFIG_STORAGE, NumValue: config.AccountStorage}).Error; res != nil { + }).Create(&store.Config{ConfigID: CNFStorage, NumValue: config.AccountStorage}).Error; res != nil { return res } diff --git a/net/server/internal/api_setNodeStatus.go b/net/server/internal/api_setNodeStatus.go index 95ed2cd8..a923be4b 100644 --- a/net/server/internal/api_setNodeStatus.go +++ b/net/server/internal/api_setNodeStatus.go @@ -10,7 +10,7 @@ import ( func SetNodeStatus(w http.ResponseWriter, r *http.Request) { var config store.Config - err := store.DB.Where("config_id = ?", CONFIG_CONFIGURED).First(&config).Error + err := store.DB.Where("config_id = ?", CNFConfigured).First(&config).Error if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) { w.WriteHeader(http.StatusInternalServerError) return @@ -27,10 +27,10 @@ func SetNodeStatus(w http.ResponseWriter, r *http.Request) { } err = store.DB.Transaction(func(tx *gorm.DB) error { - if res := tx.Create(&store.Config{ConfigID: CONFIG_TOKEN, StrValue: token}).Error; res != nil { + if res := tx.Create(&store.Config{ConfigID: CNFToken, StrValue: token}).Error; res != nil { return res } - if res := tx.Create(&store.Config{ConfigID: CONFIG_CONFIGURED, BoolValue: true}).Error; res != nil { + if res := tx.Create(&store.Config{ConfigID: CNFConfigured, BoolValue: true}).Error; res != nil { return res } return nil; diff --git a/net/server/internal/authUtil.go b/net/server/internal/authUtil.go index 411e6054..1f9ca2ff 100644 --- a/net/server/internal/authUtil.go +++ b/net/server/internal/authUtil.go @@ -78,12 +78,12 @@ func ParamAdminToken(r *http.Request) (int, error) { } // nothing to do if not configured - if !getBoolConfigValue(CONFIG_CONFIGURED, false) { + if !getBoolConfigValue(CNFConfigured, false) { return http.StatusUnauthorized, errors.New("node not configured") } // compare password - value := getStrConfigValue(CONFIG_TOKEN, ""); + value := getStrConfigValue(CNFToken, ""); if (value != token) { return http.StatusUnauthorized, errors.New("invalid admin token") } diff --git a/net/server/internal/configUtil.go b/net/server/internal/configUtil.go index 7241f244..f2575284 100644 --- a/net/server/internal/configUtil.go +++ b/net/server/internal/configUtil.go @@ -6,14 +6,14 @@ import ( "databag/internal/store" ) -const CONFIG_OPENACCESS = "open_access" -const CONFIG_ACCOUNTLIMIT = "account_limit" -const CONFIG_CONFIGURED = "configured" -const CONFIG_TOKEN = "token" -const CONFIG_DOMAIN = "domain" -const CONFIG_STORAGE = "storage" -const CONFIG_ASSETPATH = "asset_path" -const CONFIG_SCRIPTPATH = "script_path" +const CNFOpenAccess = "open_access" +const CNFAccountLimit = "account_limit" +const CNFConfigured = "configured" +const CNFToken = "token" +const CNFDomain = "domain" +const CNFStorage = "storage" +const CNFAssetPath = "asset_path" +const CNFScriptPath = "script_path" func getStrConfigValue(configID string, empty string) string { var config store.Config diff --git a/net/server/internal/garbageUtil.go b/net/server/internal/garbageUtil.go index e9fc30e6..b903d5b1 100644 --- a/net/server/internal/garbageUtil.go +++ b/net/server/internal/garbageUtil.go @@ -13,7 +13,7 @@ func garbageCollect(act *store.Account) { defer garbageSync.Unlock() // get all asset files - dir := getStrConfigValue(CONFIG_ASSETPATH, APPDefaultPath) + "/" + act.GUID + dir := getStrConfigValue(CNFAssetPath, APPDefaultPath) + "/" + act.GUID files, err := os.ReadDir(dir) if err != nil { ErrMsg(err) diff --git a/net/server/internal/keyUtil.go b/net/server/internal/keyUtil.go index 22141e70..6f172428 100644 --- a/net/server/internal/keyUtil.go +++ b/net/server/internal/keyUtil.go @@ -26,14 +26,14 @@ func GenerateRsaKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, string, error) { } func ExportRsaPrivateKeyAsPemStr(privkey *rsa.PrivateKey) string { - privkey_bytes := x509.MarshalPKCS1PrivateKey(privkey) - privkey_pem := pem.EncodeToMemory( + privkeyBytes := x509.MarshalPKCS1PrivateKey(privkey) + privkeyPEM := pem.EncodeToMemory( &pem.Block{ Type: "RSA PRIVATE KEY", - Bytes: privkey_bytes, + Bytes: privkeyBytes, }, ) - return string(privkey_pem) + return string(privkeyPEM) } func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error) { @@ -51,18 +51,18 @@ func ParseRsaPrivateKeyFromPemStr(privPEM string) (*rsa.PrivateKey, error) { } func ExportRsaPublicKeyAsPemStr(pubkey *rsa.PublicKey) (string, error) { - pubkey_bytes, err := x509.MarshalPKIXPublicKey(pubkey) + pubkeyBytes, err := x509.MarshalPKIXPublicKey(pubkey) if err != nil { return "", err } - pubkey_pem := pem.EncodeToMemory( + pubkeyPEM := pem.EncodeToMemory( &pem.Block{ Type: "RSA PUBLIC KEY", - Bytes: pubkey_bytes, + Bytes: pubkeyBytes, }, ) - return string(pubkey_pem), nil + return string(pubkeyPEM), nil } func ParseRsaPublicKeyFromPemStr(pubPEM string) (*rsa.PublicKey, error) { diff --git a/net/server/internal/main_test.go b/net/server/internal/main_test.go index ed74ea7e..c8d8656c 100644 --- a/net/server/internal/main_test.go +++ b/net/server/internal/main_test.go @@ -41,13 +41,13 @@ func TestMain(m *testing.M) { } // config data path - scripts := &store.Config{ ConfigID: CONFIG_SCRIPTPATH, StrValue: "./testscripts" } + scripts := &store.Config{ ConfigID: CNFScriptPath, StrValue: "./testscripts" } if err := store.DB.Save(scripts).Error; err != nil { panic("failed to configure scripts path") } // config data path - path := &store.Config{ ConfigID: CONFIG_ASSETPATH, StrValue: "./testdata" } + path := &store.Config{ ConfigID: CNFAssetPath, StrValue: "./testdata" } if err := store.DB.Save(path).Error; err != nil { panic("failed to configure data path") } diff --git a/net/server/internal/modelUtil.go b/net/server/internal/modelUtil.go index 29b79564..11b859ad 100644 --- a/net/server/internal/modelUtil.go +++ b/net/server/internal/modelUtil.go @@ -15,7 +15,7 @@ func getProfileModel(account *store.Account) *Profile { Image: account.AccountDetail.Image, Revision: account.ProfileRevision, Version: APPVersion, - Node: getStrConfigValue(CONFIG_DOMAIN, ""), + Node: getStrConfigValue(CNFDomain, ""), } } diff --git a/net/server/internal/models.go b/net/server/internal/models.go index 1ca6055e..38ceb34f 100644 --- a/net/server/internal/models.go +++ b/net/server/internal/models.go @@ -52,7 +52,7 @@ type AppData struct { Description string `json:"description,omitempty"` - Url string `json:"url,omitempty"` + URL string `json:"url,omitempty"` Image string `json:"image,omitempty"` diff --git a/net/server/internal/notify.go b/net/server/internal/notify.go index f4f09e25..154741e6 100644 --- a/net/server/internal/notify.go +++ b/net/server/internal/notify.go @@ -31,7 +31,7 @@ func SendNotifications() { for { select { case notification := <-notify: - node := getStrConfigValue(CONFIG_DOMAIN, "") + node := getStrConfigValue(CNFDomain, "") if notification.Node == node { SendLocalNotification(notification) } else { diff --git a/net/server/internal/store/schema.go b/net/server/internal/store/schema.go index b493aac0..a8d2ab71 100644 --- a/net/server/internal/store/schema.go +++ b/net/server/internal/store/schema.go @@ -91,7 +91,7 @@ type App struct { Name string Description string Image string - Url string + URL string Token string `gorm:"not null;index:appguid,unique"` Created int64 `gorm:"autoCreateTime"` Account Account `gorm:"references:GUID"` diff --git a/net/server/internal/testApp.go b/net/server/internal/testApp.go index 24884de3..5e74b043 100644 --- a/net/server/internal/testApp.go +++ b/net/server/internal/testApp.go @@ -13,7 +13,7 @@ import ( "github.com/gorilla/mux" ) -const TEST_TIMEOUT = 5 +const testTimeout = 5 type TestCondition struct { check func(*TestApp) bool @@ -810,7 +810,7 @@ func (a *TestApp) WaitFor(check func(*TestApp) bool) error { var wake = make(chan bool, 1) a.setCondition(&TestCondition{channel: done, check: check, }) go func(){ - time.Sleep(TEST_TIMEOUT * time.Second) + time.Sleep(testTimeout * time.Second) wake <- true }() select { diff --git a/net/server/internal/testUtil.go b/net/server/internal/testUtil.go index ef6a437d..60ef8891 100644 --- a/net/server/internal/testUtil.go +++ b/net/server/internal/testUtil.go @@ -612,7 +612,7 @@ func AddTestAccount(username string) (guid string, token string, err error) { app := AppData{ Name: "Appy", Description: "A test app", - Url: "http://app.coredb.org", + URL: "http://app.coredb.org", }; var claim Claim var msg DataMessage diff --git a/net/server/internal/transcodeUtil.go b/net/server/internal/transcodeUtil.go index 78b0c4cf..74d461da 100644 --- a/net/server/internal/transcodeUtil.go +++ b/net/server/internal/transcodeUtil.go @@ -88,8 +88,8 @@ func transcodeDefault() { func transcodeAsset(asset *store.Asset) { // prepare script path - data := getStrConfigValue(CONFIG_ASSETPATH, APPDefaultPath) - script := getStrConfigValue(CONFIG_SCRIPTPATH, ".") + data := getStrConfigValue(CNFAssetPath, APPDefaultPath) + script := getStrConfigValue(CNFScriptPath, ".") re := regexp.MustCompile("^[a-zA-Z0-9_]*$") if !re.MatchString(asset.Transform) {