weixin_39941262
weixin_39941262
2021-01-11 15:05

Web Interface Idea

On my server where I host my git repos for sparkleshare I have been running git-web (served by mini-httpd, a light-weight http server). Git-Web (https://git.wiki.kernel.org/index.php/Gitweb) is a simple cgi script (the code is available in the git git repo). It is obviously optimized for version control and source code applications but it is still useful in its current state to view/download files and monitor changes to sparkleshare git repos, however, I think with some modifications it would be a really good addition to sparkleshare's server (comparable to dropbox's website, where you can view/upload/track/see old version. Since its just a perl/cgi script most platforms where git runs should be able to run this as well.

I don't know that much perl/cgi but maybe this is something worse pursuing, I would be happy to try and help out. It would also be pretty simple to re-brand the images to sparkleshare art work! I'm not sure about the whole license thing but since this is GPL code, can we effectively fork git-web and make it a sparkleshare server perl script?

see here:

http://git.kernel.org/?p=git/git.git;a=tree;f=gitweb;h=ab808b0ac71f07402156ba71f5e2f6079737f65d;hb=HEAD

for an example of git-web in operation and the git-web files themselves!

I use a simple password (htpasswd) authentication through the mini-httpd, something more secure would be better.

There are also other possibilities like cgit but this seemed the most straightforward.

-Lyle

该提问来源于开源项目:hbons/SparkleShare

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

16条回答

  • weixin_39941262 weixin_39941262 4月前

    Well you could use git-web (a cgi/perl script) that provides access to the files in the repo, see the OP.

    点赞 评论 复制链接分享
  • weixin_39876592 weixin_39876592 4月前

    Closing as this clutters the tracker. Better to have this discussion on the wiki. Also, it's unlikely that i'll be working on this anytime soon :)

    点赞 评论 复制链接分享
  • weixin_39664995 weixin_39664995 4月前

    +1

    点赞 评论 复制链接分享
  • weixin_39941262 weixin_39941262 4月前

    I think this is something that dashboard can handle.

    点赞 评论 复制链接分享
  • weixin_39886238 weixin_39886238 4月前

    Yes, good idea. This also matches the functionality of Ubuntu One. I know a little Perl and could help out, time permitting.

    点赞 评论 复制链接分享
  • weixin_39825722 weixin_39825722 4月前

    Cool idea, but I don't really care about the web access, my question to this feature would be a dropbox like public folder, that's accessible from "the Internet" =)

    点赞 评论 复制链接分享
  • weixin_39941262 weixin_39941262 4月前

    I guess not everyone would want web access but often I find it useful when I'm not on my own computer to have access to the files stored in sparkleshare without need to install git and sparkleshare.

    Having a public dropbox could probably be created, I'm not exactly sure how but there must be web upload scripts that could be modified to drop the file into the git repo.

    点赞 评论 复制链接分享
  • weixin_39941262 weixin_39941262 4月前

    something like:

    http://www.seaglass.com/file-upload-pl.html

    along with git-fast-import should work without having to actually clone and push the entire repo on the server side http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html

    点赞 评论 复制链接分享
  • weixin_39825722 weixin_39825722 4月前

    PS: How can I actually access the files on the server from the server? There is only this cryptic .git dir, but I have not clue about git...

    点赞 评论 复制链接分享
  • weixin_39876592 weixin_39876592 4月前

    This is the plan, but I don't have a lot of time to do it. We should design a web API that can be the base for the web UI, Android, iPhone etc. as those apps wil basically be just custom web browser. Something based on REST or SOAP would be nice and flexible. Of course all sparkleshare branded and very usable. :)

    Best way to start would be to create a wiki page, I've already made some notes in my scrapbook this week that i will add.

    点赞 评论 复制链接分享
  • weixin_39941262 weixin_39941262 4月前

    first question: public server, you could use git-web and just not use any authentication and this would expose the all the repositories (which git-web points too) and the revision history publically, probably the best way to do this. You could put the public repo in /git/public/public.git and the others in /git/blah/blah.git then set git-web to point only to the public folder, then you can access the files there.

    git-web isn't very elegant for this since its clearly meant for revision tracking of code.

    2nd question: to access the files you can use git-web!, alternatively you can clone the repo in a local folder but this seems somewhat redundant. There obviously is a way to access the files since git-web can read the files, maybe some git command can be used to access the files, maybe something like git-fast-export

    http://www.kernel.org/pub/software/scm/git/docs/git-fast-export.html

    点赞 评论 复制链接分享
  • weixin_39876592 weixin_39876592 4月前

    You have to do a 'git checkout' like you would do with non-bare repositories. Git will complain about being a non-bare repo that people push to though, there is a config option to circumvent this, but i forgot what it was.

    点赞 评论 复制链接分享
  • weixin_39825722 weixin_39825722 4月前

    Hmm, so the easiest automatically updating solution would be, that the server also had a SparkleShare client running, right? ;-)

    点赞 评论 复制链接分享
  • weixin_39825722 weixin_39825722 4月前

    : Doing a "git clone xxx.git" in an empty dir does the job, but it's not optimal though redundancywaring =)

    点赞 评论 复制链接分享
  • weixin_39941262 weixin_39941262 4月前

    , this would create duplicates of the git repos, wasting a bit of space. Do you need to read/write the files on the server?

    点赞 评论 复制链接分享
  • weixin_39825722 weixin_39825722 4月前

    : Yes true and I only need reading, so I can point my apache to a specific sub folder of SparkleShare to share the data there, but maybe my knowledge is too limited to see how git could provide that in other ways.

    点赞 评论 复制链接分享

相关推荐