-
Notifications
You must be signed in to change notification settings - Fork 20
ref T586 support any writefreely instance #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
found a small bug I missed, unsynced posts are stored in one file at the root, not at each host level. fix incoming. |
just waiting for writeas/go-writeas#18 to verify things work as expected |
this creates a second binary, wf, which will have additonal functionality for hosts other than write.as. also moves global flags into their own slice in new file adds `host, H` global flag inlcudes gitignore for binary
only if host flag supplied for writefreely binary, writeas unaffected
some changes resulted in the data directory initialization creating the .writeas/.writefreely directory in the current working directory.
- 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
- 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
full support, auth and actions working by use of flags or defaults maintains backwards compatibility with write.as
this get's the wf binary up to date with the writeas functionality
only on wf, writeas still stores in root user config directory
there was a bug where a default user at the config directory root was not being used for calls not including a flag or host level config.ini
also update CmdClaim for new LoadUser signiture
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
also CmdPost should return an exit error if there is one
for inclusion of collection in post parameters
new posts, when no flag is specified for blog or collection, will now default to the user collection. that is the username.
if the user flag is provided auth should attempt to authenticate with that user.
ready for final testing and review @thebaer |
Okay, we're getting very close. This may be the last issue we need to solve. The situation is: I'm logged in under multiple accounts, but don't have a default user set (I logged out of it, so it was removed from the config). Now when I run
This is confusing, because I am authenticated --
I started trying to implement this, but it looks like it's going to need a bit more work. It looks like we're getting very close to needing the What do you think? |
I'll take a look quick, we might be able to get this without adding the accounts command, then add that after. Unless you want it all in for the CLI release. |
Let's try to go without it for this initial release and add it later. |
ok got it, just going to clean up some redundancy quick |
this adds a check for any logged in users on any host when neither the user or host flag are passed and not default pair is configured
I didn't bother to refactor, it would only save three lines in two places. |
Awesome, will test when I'm back at my computer. |
Just tested latest changes and now I'm unable to post anything:
To be sure, I'm authenticated as matt on team.write.as. Is everything working for you? |
Also some odd behavior when I do have a default account:
Probably because we store the schema in the configuration. Which is probably correct, e.g. if someone logs in with the |
this changes DoUpdate and DoDelete to load the user and set the access token in the client when no edit token is provided.
Looks really, really good! I think the very last thing is that we should undo the change where I also fixed some weird language when trying to run commands while being unauthenticated. |
Sure, I can revert the default collection thing. |
Great. Though now I don't seem to be able to post at all:
|
silly question, are you logged in? I tried with both |
Hmm yeah, I authenticated right after I pulled in those changes. But then I re-authenticated with the same exact account and now it's all working. Weird. But draft publishing works 👍 Doing one last run-through and then we'll merge! |
There are still some very small places where we can improve the UX, but we can address them in the next update. Great work! Merging now. |
This one is a bit huge.
First this creates a new binary
wf
which supports additional features not needed on write.as. Namely different hosts and multiple users, as many user accounts can be authenticated as you wish. Just pass a-u <username>
global flag to select the one to use for an action. i.e.wf -u rob posts
This would be v1.0 for wf.
ref T592, T593, T594, T595, T597, T634, T635, T645