Add ability for owner and administrator to modify hgrc through web interface

Issue #176 resolved
DRayX
created an issue

It would be really useful to be able to modify the .hg/hgrc, .git/config, and conf/svnserve.conf files through the web interface.

Comments (12)

  1. Sebastian Sebastian repo owner

    Please keep in mind that SCM-Manager is for Git, Mercurial and Subversion. Functions which are special to one of them must be placed in a extra plugin and they will never be part of the core. But i will write a extra plugin for this, if i have the time or it is possible that you write a plugin by yourself (i would help with the basic structure)?

  2. DRayX reporter

    Ya, I wasn't trying to be particularly specific to mercurial, more so I was trying to convey that the ability to set per repository configurations (like .hg/hgrc and .git/config) would be useful. I suppose I also should have listed conf/svnserve.conf, but I couldn't remember the name of it. All three of these are ini files used to configure the repository, but right now to modify them the only option is to ssh (or rdp) into the system and modify the files. I could definitely look into writing a plugin for the hgrc, but it has been a while since I have done java. I will look at the example plugin and see where I can get from there.

  3. Sebastian Sebastian repo owner

    hi @corux and thanks for your work. But modifying the configurations is very dangerous, if everyone removes one of the lines from the mercurial config, the repository will be broken.

    I've looked at the plugin and there are some small bugs to fix:

    • The WebConfigResource is accessible from every user which has read permissions for the repository. I think the resource should only be accessible for owners and administrators.
    • You have to close the RepositoryService in a final block, because it frees resources. In the case of mercurial a python process is running until you close the repository service.
  4. corux

    Thanks for your feedback! I've fixed the bugs and pushed it to github. Additionally, a confirm dialog is now displayed before saving.

  5. burak cetin

    Hi corux Thank you for scm-webcongif-plugin. I have a problem while editing Mercurial hgrc files. When I look into the hgrc file of an imported mercurial repo (not initiated in SCM manager) in SCM manager as admin, it deletes my current users under "allow_push =" and "allow_read =" lines and shows * (* asterix) instead of the user names.

    For example; my original hgrc file is:

    [web] allow_push = cetin00b allow_read = cetin00b allow_archive = zip description = Design contact = ctnbrkctn@gmail.com push_ssl = false

    [extensions] largefiles =

    After I imported the repo in SCM manager, my hgrc file seems as:

    [web] allow_push = * (asterix) allow_read = * (asterix)* allow_archive = zip description = Design contact = ctnbrkctn@gmail.com push_ssl = false

    [extensions] largefiles =

    [hooks] changegroup.scm = python:scmhooks.callback pretxnchangegroup.scm = python:scmhooks.callback

    How can I solve that problem? Thank you very much in advance.

  6. corux

    Hi @burak cetin. SCM-Manager handles authentication and permission management internally. It does not use allow_push / allow_read to determine repository access. Setting these values to "*" on import is by design.

  7. Log in to comment