Glad to see new work in this space. Sorcia looks very clean, and well implemented.
I only noticed one issue, which is very much an edge case: when trying to view a file with third party JS disabled (i.e. the Cloudflare JS sourced script), the file is rendered quite poorly. Would be nice if the service degraded gracefully and used a simple pre tag or similar.
I must also admit that I am interested in a more "non-technical" git frontend -- one that puts the file tree up front and center, leaving details like remotes and commits in out of the way views.
If anyone is interested in other options, see also:
Wow, did not expect to see grarr mentioned on HN. I should mention that it's basically dead at this point, and IMO would need a full rewrite to resurrect (the web framework it's built on is unmaintained and has been superseded by much nicer ones, the templating it uses is based on a compiler plugin that only works with a few years old nightly compiler).
"sorcio" is a synonym (Centre Italy dialectal version, but understandable everywhere) for mouse (topo, in standard Italian), "sorcia" is the feminine and the feminine of mouse is often used (in the various dialectal versions) to refer to prostitutes or (as a proxy) to "easy women" (the latter meaning is, fortunately, slowly disappearing from the culture).
Tangential: lastly I was searching for an easy to deploy, easy to use readonly html frontend for git repositories that could be reached via an URL subpath behind a reverse proxy, served from a container.
The use case is to let website owners see what their developers are changing in the source code that I'm hosting for those owners, and to embed this in the existing dashboard of mine where the owners can see what's happening on their servers. I would handle myself the part where the source code modifications are committed to the underlining git repositories, and a nice bonus would be that those repositories would act an additional backup strategy.
Unfortunately nothing came close to this simple wishlist, I was unable to get the likes of git-web or gitiles working under those constraints, I tried 4 or 5 at least.
Very cool! Although I noticed (at least in Safari and iOS) the contributors page has 23px widths for the profile pictures.
Front-ends like these are really cool. They allow simple, self hosted solutions strictly for code that can then be mirrored to other, more complex solutions if desired. Or if you like working with very minimal tooling.
- I need help on generating a docker image. Would be great if someone contributes to this.
- Sure, I was thinking about that. Being this a self-hosted software, I should have used those vendor js libraries directly. But it was hyper fast when I used Cloudflare CDN that blinded my eyes. Anyways, I'll release a patch version today using the js libraries directly.
Hello, it's been a few days, I hope you can still receive this.
I cloned your project and made a Dockerfile for it. It works on my Arm32 based board so I guess it should work on other platforms as well.
The file is here, should be a good starting point if you want to further develop the Docker image, please test it:
# This is an experimental Dockerfile for Sorcia Git front-end
# This image allows both easy deployment and use. The deployer
# can operate the resulting container via Docker remote management
# with command such as:
# `docker -H <docker_server> exec sorcia /home/git/sorcia/sorcia usermod`
# to manage the service rather than having to login onto the Docker
# To build the image, use command
# `docker build --tag <final_image_name> .`
# Or, setup a hook on Docker cloud, let it do the hard job for you.
# To run the image, use command:
# `docker run \
# --detach \
# --restart always \
# --name sorcia \
# --publish 1937:1937 \ # You may have to change this port number
# --publish 2222:2222 \ # iptables maybe needed if you want port 22
# <final_image_name> web`
# To run usermod, when the container is running, run:
# `docker exec -it <container_name> /home/git/sorcia/sorcia usermod`
# Notice: This image does not contain Nginx, if you need it, put it in
# a separate container.
# Step 1: Initialize the build enviroment and build the application
# Here we are using the golang:alpine which is the latest Go but
# is compiled for Alpine. This is necessary because we will later
# run the service on an Alpine base (musl based).
# Step 1.0: Copy all source file into the container
# Step 1.1: Install Git to download go modules, and build-base to
# build the dependencies
# Step 1.2: Print the version of the bulitin Go
# Step 1.3: Goto /sorcia directory and start the building process
FROM golang:alpine as builder
COPY . /sorcia
RUN set -ex && \
until apk add build-base git sqlite-dev; do sleep 1; done && \
([ -z "$HTTP_PROXY" ] || (git config --global http.proxy "$HTTP_PROXY")) && \
([ -z "$HTTPS_PROXY" ] || (git config --global https.proxy "$HTTPS_PROXY")) && \
go version && \
cd /sorcia && \
until CGO_ENABLED=1 go build; do sleep 1; done
# Step 2: Setup the image that will actually run the service
# Step 2.0: Copy the generated binary along with source file into
# the container
# Step 2.1: Install the dependencies: Git and Sqlite
# Step 2.2: Create user and user group git and sorcia, we'll run the
# service application under user sorcia
# Step 2.3: Initialize the enviroment (Directory and other stuff)
COPY --from=builder /sorcia /home/git/sorcia
RUN set -ex && \
ls -l /home/git/sorcia && \
cp /home/git/sorcia/config/app.ini.sample /home/git/sorcia/config/app.ini && \
sed -i -E "s/ssh_port.+\=.+/ssh_port = 2222/" /home/git/sorcia/config/app.ini && \
echo && cat /home/git/sorcia/config/app.ini && echo && \
until apk add --no-cache openssh git sqlite; do sleep 1; done && \
addgroup -S sorcia && adduser -S -G sorcia sorcia && \
mkdir -p /home/git/data && chown sorcia:sorcia /home/git/data && \
chmod +x /home/git/sorcia/sorcia && \
(cd /home/git/sorcia; rm error.log -f; ln -s /tmp/error.log error.log; ./sorcia version)
EXPOSE 1937 2222
ENTRYPOINT [ "/home/git/sorcia/sorcia" ]
- add tests (I couldn't find a simple _test.go file)
- relative imports aren't recommended in Go (pkgs like "sorcia/model")
- please rethink/avoid global (package) variables like middlewareDB (https://git.mysticmode.org/r/sorcia/tree/master/middleware/m...)
- avoid adding logic in the init() functions