Fossil Forum

Can't add user to remote repository and remote login questions
Login

Can't add user to remote repository and remote login questions

Can't add user to remote repository and remote login questions

(1) By Sil (Silhalnor) on 2022-01-12 17:06:15 [source]

I'm learning to use Fossil remotely (specifically via Chisel) so I can teach it to my teammate but I find myself confused by its behavior.

First of all, when I clone and run fossil user ls I find the userlist is different depending on who I clone as. (Not the actual names, by the way.)

fossil clone https://${USER}@chiselapp.com/user/Silhalnor/repository/XYZ xyz.fossil

  • As superuser X, who created the repository, I see everything I expect PLUS my Chisel account name. That was auto-added as a user??
  • As superuser Y, added later, no users are visible but myself. (And anonymous, developer, nobody, and reader which I infer are some kind of defaults.)
  • As no one, auto-generating a superuser based on my OS account name (shouldn't I be nobody...?), I again see no users but myself and the four defaults.
  • As user Sil, my Chisel repository account name—if I understand what's happened correctly—I see Sil, Y (but as a user, not a superuser), and the defaults but not X.

Questions,

  • Why did Chisel add an account?
  • Why does only X see the full userlist?
  • Why does failing to specify a user add a user? And why is it a superuser?
  • Why does the Chisel account see some but not all users and why do they not have the capabilities seen during other clones?

Lastly, I tried adding an admin user (while signed in as Y) and syncing it. Proceeding to clone the remote repository as the new user fails, citing that the user doesn't exist.

I conclude from all this that user info is not—or is inconsistently—transferred between repositories.

Why is that? Is there anything else that also fails to be transferred? What precisely is skipped or modified during a clone, a sync, and other remote operations?

For completion's sake I also made a forum post and synced that. The result was expected and successful.

Sorry for the length but I'm just really confused. Maybe this is some kind of security measure under the assumption that teammates are more private than code repositories...?

(2) By Sil (Silhalnor) on 2022-01-12 17:13:23 in reply to 1 [link] [source]

Ah, it says so when I create the repository on Chisel. Alright less concerned about that now, though still confused why it thinks that is necessary.

Please fill out the form below to upload an existing repository. A new super-user will be created that matches your chisel username and the password you provide below. Limit 8M in size. If your repository is larger than this, create a new empty project and push to it instead.

(3) By Stephan Beal (stephan) on 2022-01-13 03:21:37 in reply to 1 [link] [source]

Why did Chisel add an account?

Note that Chisel is a 3rd-party service not directly associated with or supported by this project.

Lastly, I tried adding an admin user (while signed in as Y) and syncing it. Proceeding to clone the remote repository as the new user fails, citing that the user doesn't exist.

Sync itself does not copy the users. You need to pull those separately:

fossil config pull user

But see below...

Why does only X see the full userlist?

You'll need to show us that Y is not also getting that list on a fresh clone. To the best of my recollection, "s" users ("s" is for "setup", not "superuser") can all clone the complete user list. That said...

Cloning the user list is in no way necessary for normal repo operations. It's "just a list" and is in no way tied to those same user names in checkins. Also, the login data for those users is invalid in any clone because the password is, in part, hashed against random bytes which are specific to each clone. Thus a hash from one repository clone won't work in another.

FWIW, i've been using fossil since 2007 and have never once had a genuine need to clone the user list. It serves literally no function in a local clone. In a local clone, the only truly relevant user is the one who performed the clone (the name under which checkins and whatnot will be made).

(4) By Sil (Silhalnor) on 2022-01-13 04:21:48 in reply to 3 [link] [source]

So it turns out Y wasn't actually a setup user, it just reported being one when I cloned as that user. I still consider this all baffling but at least that explains some discrepancies. I hope syncing will give some error if I try to sync something I don't actually have permissions for.

Also, the login data for those users is invalid in any clone because the password is, in part, hashed against random bytes which are specific to each clone. Thus a hash from one repository clone won't work in another.

Ooohh so the userlist info is... fake? As far as clones are concerned? Okay so the bottom line here is that I have to interact directly with the remote repository for some actions. Namely, creating users and modifying their privileges. I can't exclusively use clones as an interface like I'd assumed. Are users and editing users the only thing that is not cloned & synced or are there other details I must keep in mind? Is the issue tracker synced? The chatroom? The forum? Etcetera?

Note that Chisel is a 3rd-party service not directly associated with or supported by this project.

That's fair. I asked on the off chance it was some builtin feature of remote fossils that Chisel has a convenience UI for. Well, that and to be thorough.

("s" is for "setup", not "superuser")

Oh sorry I mistook the mnemonic to mean they're interchangeable. Unsure whether to consider that a documentation bug or my fault for putting stock in a mnemonic.


PS. Fossil neither transfers user lists nor indicates that the local repository's userlist is uncorrelated with the remote userlist. Is this behavior considered a bug that just isn't worth fixing or is it somehow a feature? That is to say, do I ever have a reason to run fossil user ls now that I know it's uncorrelated with remote?

(5.1) By Stephan Beal (stephan) on 2022-01-13 05:18:48 edited from 5.0 in reply to 4 [link] [source]

Ooohh so the userlist info is... fake? As far as clones are concerned?

It's not fake, except for the passwords, but it is 100% irrelevant for all SCM-related features. None of the actual SCM features rely on that list for local usage. When running in local mode, the user automatically has all privileges (because it's their copy they're working on).

Okay so the bottom line here is that I have to interact directly with the remote repository for some actions. Namely, creating users and modifying their privileges.

You need to set up users on any copies of the repositories in which those users will interact. If that's the Chisel copy then that's where they need to be set up. They can do all the interacting they want with their local copies, but the permission on the Chisel copy will be the one which determines what exactly those users are permitted to do on that copy.

Are users and editing users the only thing that is not cloned & synced or are there other details I must keep in mind? Is the issue tracker synced? The chatroom? The forum? Etcetera?

  • Users can be synced with the config option, but administering users in clones is unnecessary and ineffective because copying a user "breaks" the password on that clone.

  • Tickets, wiki, and forum state are transparently synced via all push/pull/sync operations.

  • Chatroom is 100% transient and not synced. We have no builtin mechanism for porting the /chat content from one clone to another. It can be done using the right sequence of db commands and SSH access, but it's not (by design) a feature of /chat itself.

In short, all SCM-relevant data is synced as needed and non-SCM-relevant data is either not synchable or requires specific command invocations to sync (see (fossil help config) for examples).

In practice, all you have to do is the usual push/pull/sync, which are automatically performed if autosync is on (which it is by default). Don't worry about cloning users or some such: do all user management on the "central" copy. There are other config-related things which can be synched but rarely, if ever, need to be. The example which comes readily to mind as something i've ever synched from my clone to a central repo is the site skin. Sometimes it's useful to do site skin management locally and then push it to a remote using (fossil config push skin).

Oh sorry I mistook the mnemonic to mean they're interchangeable. Unsure whether to consider that a documentation bug or my fault for putting stock in a mnemonic.

FWIW, you're not the only person to have tripped over that and certainly won't be the last!

PS. Fossil neither transfers user lists nor indicates that the local repository's userlist is uncorrelated with the remote userlist. Is this behavior considered a bug that just isn't worth fixing or is it somehow a feature?

That is by design. The user list controls only access to a given clone and is not SCM-relevant. If the complete and functional user list, permissions, and password hashes were to be copied to any given clone, it would effectively get other users access to your copy, which is definitely not something fossil will enable by itself. It would also give you, a remote user, enough information with which to brute-force decrypt those passwords, whereas fossil makes part of the hashing equation private to each clone of a repo so that leaked hashes are effectively useless for such purposes.

That is to say, do I ever have a reason to run fossil user ls now that I know it's uncorrelated with remote?

Nope. None whatsoever unless, perhaps, you are operating directly on the repository copy which other users access. (That is never the case when using Chisel.) The user list only comes into play when accessing your clone via (fossil server) or similar. When using (fossil ui), which is a variant of fossil server, it will log in automatically as the same user under whose name checkins and such are performed.

As a long-time fossil developer, literally the only time i have to manipulate a given clone's user list is when hacking on the /chat page and needing a few dummy user accounts to test it with.

(6) By Sil (Silhalnor) on 2022-01-13 10:29:14 in reply to 5.1 [link] [source]

Alright I believe I've got this down now. Thanks for all the info! You're a much appreciated resource.

(10) By Andy Bradford (andybradford) on 2022-01-13 15:52:07 in reply to 5.1 [link] [source]

> Users can be synced with the config option, but administering users in
> clones is unnecessary and ineffective  because copying a user "breaks"
> the password on that clone.

Are you saying that  if I make modifications in the  local clone that it
"breaks" the user? I ask because  I have no problem cloning a repository
that has users  and then successfully performing login using  one of the
users in the clone. Clearly if I  make changes to my local copy of those
users then it  will be different than  what's in the remote  copy, but I
can use "fossil configuration sync" to clean that up.

At any  rate, my  point is, after  clone (using a  setup user),  all the
users in the remote  copy are also now in my local copy  and I can login
with them. So they don't appear to be broken.

What am I missing?

Thanks,

Andy

(12) By Stephan Beal (stephan) on 2022-01-13 19:14:58 in reply to 10 [link] [source]

Are you saying that if I make modifications in the local clone that it "breaks" the user?

No, i meant basically that doing a clone copies over user accounts which cannot be logged in to unless their password is reset because the password hashes are "broken" (will no longer hash the same for the clone as for the original). "Break" was too strong a word on my part.

That said...

At any rate, my point is, after clone (using a setup user), all the users in the remote copy are also now in my local copy and I can login with them. So they don't appear to be broken.

What am I missing?

It might be me that's missing something. i was under the recollection (apparently wrong) that the "secret" bytes used for hashing those never leave that repo except via the "backup" command. (Writing from bed, though, so i'm not going to dig through the sources to straighten out my understanding at the moment!)

(14) By Andy Bradford (andybradford) on 2022-01-13 19:53:12 in reply to 12 [link] [source]

> i  was under  the recollection  (apparently wrong)  that the  "secret"
> bytes used  for hashing  those never  leave that  repo except  via the
> "backup" command.

I believe you are right that the secret remains local.

Therefore, if I have  2 clones of the same repository  and the same user
in each, if I change the password  via the admin pages on each one, even
if the password that I set was the same, they will hash differently.

So  the only  way  to  really keep  them  synchronized  is with  "fossil
configuration" or a backup will have them.

Thanks,

Andy

(15) By Andy Bradford (andybradford) on 2022-01-13 19:56:18 in reply to 12 [link] [source]

I too could be  misremembering so I may have to dig  through the code to
straighten out my understanding. :-)

Andy

(8.1) By Andy Bradford (andybradford) on 2022-01-13 15:43:29 edited from 8.0 in reply to 4 [link] [source]

> PS. Fossil neither  transfers user lists nor indicates  that the local
> repository's  userlist is  uncorrelated with  the remote  userlist. Is
> this behavior considered  a bug that just isn't worth  fixing or is it
> somehow a  feature? That is  to say,  do I ever  have a reason  to run
> fossil user ls now that I know it's uncorrelated with remote?

While Fossil does not do this as part of the clone, because remote users
are not relevant to local repository  usage, it is certainly possible to
pull the user database so that you  can have a backup copy of the users,
or even synchronize it if you intend on hosting another mirror using the
same set of users users. This isn't  likely what you really want. But if
so, look at:

https://www.fossil-scm.org/home/help/configuration

Andy

(9) By Warren Young (wyoung) on 2022-01-13 15:50:05 in reply to 8.1 [link] [source]

(7) By Andy Bradford (andybradford) on 2022-01-13 15:26:01 in reply to 3 [link] [source]

> Cloning  the  user  list  is  in no  way  necessary  for  normal  repo
> operations. It's  "just a list"  and is in no  way tied to  those same
> user  names in  checkins.  Also, the  login data  for  those users  is
> invalid in any clone because the  password is, in part, hashed against
> random bytes which are specific to each clone.

Doesn't Fossil's  own self-hosted  repositories clone the  users between
the  different  sites   so  that  one  can  sync  against   any  of  the
repositories?  Or  is   the  synchronization  fo  the   user  data  done
differently?

https://www.fossil-scm.org/home/doc/trunk/www/selfhost.wiki

Perhaps  this  document  could  be  updated  to  reflect  how  the  user
information is synchronized?

If I wanted to  setup my own mirror of a Chiselapp  hosted Fossil, I may
want to clone the users for that purpose. Or I may want to have a backup
of the  users so I  don't have  to recreate them  all. As far  as Fossil
tracking who makes  what commit, they aren't relevant,  but for granting
access they may be.

Or am I missing the point?

Thanks,

Andy

(11) By Richard Hipp (drh) on 2022-01-13 15:55:56 in reply to 7 [link] [source]

Fossil makes a distinction between universal content that is shared with all repositories for the same project, and local content. The universal content includes things like the check-ins and wiki pages and forum posts. Local content is skin configuration, display preferences, email notification setup, and the users and passwords.

The "fossil sync" command only synchronizes the universal content. This is intentional. Separate repositories might be run by different people, who have difference display and configuration preferences. Also, things like email addresses might be considered PII, and you don't necessarily want to make that kind of thing available to every random passer-by on the internet.

The local content can be synced, if you have sufficient privilege, using the "fossil config pull/push/sync" command. Typically you need admin privilege on the remote repository for this to work fully. Low-privilege users can often do "fossil config pull skin" to bring down the skin setup of a server. But higher privileges are needed to bring down other configuration settings or to push configuration settings.

(13) By Andy Bradford (andybradford) on 2022-01-13 19:50:11 in reply to 11 [link] [source]

> The "fossil sync" command only synchronizes the universal content.

Yes, understood.

The "fossil  clone" command, on  the other  hand, will bring  down users
(local  content) if  the  user  being used  has  the (s)etup  privilege.
Additionally,  the users  that  are in  the local  clone  have the  same
credentials and do work.

Thereafter, "fossil configuration"  must be used to  bring in additional
users.

Unless I'm mistaken, this is how Fossil's own servers are configured.

Thanks,

Andy