Commit 491d6d04 authored by ale's avatar ale

Remove unused environment flag overrides

parent 870324b7
Pipeline #688 passed with stages
in 1 minute and 17 seconds
......@@ -40,25 +40,25 @@ and the *analysis* API.
`/api/add_log` (*AddLogRequest*)
Stores a new log entry for a user in the database. The request must
be a `LogEntry` object. The method returns an empty response. If
the log entry contains device information, the list of devices for
the specified user is updated with that information.
Stores a new log entry for a user in the database. The request must be
a `LogEntry` object. The method returns an empty response. If the log
entry contains device information, the list of devices for the
specified user is updated with that information.
`/api/get_user_logs` (*GetUserLogsRequest*) -> *GetUserLogsResponse*
Returns recent logs for a specific user.
Returns recent logs for a specific user.
`/api/get_user_devices` (*GetUserDevicesRequest*) -> *GetUserDevicesResponse*
Returns the list of known devices for a user
Returns the list of known devices for a user.
## Analysis API
`/api/check_device` (*CheckDeviceRequest*) -> *CheckDeviceResponse*
Returns information about a device, whether we have seen it before,
if the localization information matches the historical trend, etc.
Returns information about a device, whether we have seen it before, if
the localization information matches the historical trend, etc.
# Configuration
......
......@@ -4,8 +4,6 @@ import (
"flag"
"io/ioutil"
"log"
"os"
"strings"
"git.autistici.org/ai3/go-common/serverutil"
"gopkg.in/yaml.v2"
......@@ -31,19 +29,8 @@ func loadConfig() (*server.Config, error) {
return &config, nil
}
// Set defaults for command-line flags using variables from the environment.
func setFlagDefaultsFromEnv() {
flag.VisitAll(func(f *flag.Flag) {
envVar := "USERMETADB_" + strings.ToUpper(strings.Replace(f.Name, "-", "_", -1))
if value := os.Getenv(envVar); value != "" {
f.DefValue = value
f.Value.Set(value)
}
})
}
func main() {
setFlagDefaultsFromEnv()
log.SetFlags(0)
flag.Parse()
config, err := loadConfig()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment