now that the scheme is not required in the configuration file, we can
assume the configured value is correct. as with other uses, the
configured value is only used when noth host and user are present.
Now when running `wf auth`, we'll automatically set the given host +
username as the default account in .writefreely/config.ini, so subsequent
requests without an explicit --host and --user will use this account.
Ref T635 T586
This automatically prepends https:// to any given --host value. It also
adds an --insecure flag, which will instead prepend http://
The goal with this is to save some typing and encourage operations over
HTTPS.
Ref T595
this changes all api calls to respect the flags for tor and tor-port
- config now has TorPort method to return flag value if set, or default
- api now only has newClient, this creates a tor client when flag is
present. does not need to be exported anymore
- no methods take a tor argument as no longer needed
- all commands now share the same behaviour logging tor messages
- api.torClient was removed as not used anywhere
- all calls to api.newClient now check for and return the error
- api.HandlePost was removed as redundant of api.DoPost
I had changed the global flags variable to only be those that are global
this broke some compatibility with piping from stdout into the binary.
also:
- binary specific configuration details have moved into the same map but
in main.go. only the configDir is OS dependent.
- a new key in the map is for the version so each binary can have their
own
- now allows authentication with more than one user per host, stored as
username.json inside the [host] directory.
- supports a default user and host in config.ini
- global flags will override the default
- adds new user/u flag to wf
- load and save user file based on username
- removed host flag from writeas
- adds hidden global flag for user to writeas to maintain
compatibility
this adds a configurable directory, currently within the users path for
the configuration, user and post data to be saved.
it is accessible down the stack of the application via the cli.Context,
specificaly c.App.ExtraData which is a function that returns a map of
[string]string under the key 'configDir".
this splits everything out into shared packages
- user config and application config share a package for now
- sync is part of the api package which includes the client, posts and
tor logic
- logging is it's own package
- commands are in their own package
first moving everything out into the base package
should be followed by some refactoring and reorganizing before creating
two different binaries for write.as and writefreely