Earlier quoted context omitted.
Hmm, name will raise a few eyebrows in Italy.
What does it refer to in Italy?
Show HN: Sorcia – Self-hosted web front end for Git repositories, written in Go
31–33 of 33 posts
Re: Show HN: Sorcia – Self-hosted web front end for Git repositories, written in Go
#32Glad 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-techn…
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).
Re: Show HN: Sorcia – Self-hosted web front end for Git repositories, written in Go
#33This kind of simple design has grown on me after I tried sourcehut. I kind like it, it's light and snappy, no extra loading bar is needed. My questions: - Can you make it a drop-and-play Docker image? - Why not host JavaScripts like `highlight.js` directly on the Sorcia server? That way LAN-only user will be able use this software as well.
- 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.
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 exec sorcia /home/git/sorcia/sorcia usermod`
#
# to manage the service rather than having to login onto the Docker
# host.
#
# To build the image, use command
#
# `docker build --tag .`
#
# 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
# web`
#
# To run usermod, when the container is running, run:
#
# `docker exec -it /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)
#
FROM alpine:latest
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)
WORKDIR /home/git/sorcia
USER sorcia
EXPOSE 1937 2222
ENTRYPOINT [ "/home/git/sorcia/sorcia" ]
CMD []