-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:yuki-kimoto/gitprep
- Loading branch information
Showing
7 changed files
with
154 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 4,6 @@ deny from all | |
allow from all | ||
</Files> | ||
|
||
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 | ||
|
||
DirectoryIndex index.cgi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,76 @@ | ||
FROM alpine:3.9 | ||
|
||
# Update OS and install dependencies | ||
RUN set -x \ | ||
&& apk update \ | ||
&& apk upgrade \ | ||
&& apk --no-cache add \ | ||
tini \ | ||
bash \ | ||
shadow \ | ||
perl \ | ||
git \ | ||
openssh-server \ | ||
perl-dev \ | ||
gcc \ | ||
g \ | ||
curl \ | ||
wget \ | ||
make | ||
|
||
# Create user gitprep | ||
RUN set -x \ | ||
&& useradd -m gitprep \ | ||
&& mkdir -m 700 /home/gitprep/.ssh \ | ||
&& usermod -p '*' gitprep \ | ||
&& touch /home/gitprep/.ssh/authorized_keys \ | ||
&& chmod 600 /home/gitprep/.ssh/authorized_keys \ | ||
&& chown -R gitprep:gitprep /home/gitprep/.ssh \ | ||
&& sed -i 's/#PasswordAuthentication yes.*/PasswordAuthentication no/' /etc/ssh/sshd_config \ | ||
&& sed -i 's/#ChallengeResponseAuthentication yes.*/ChallengeResponseAuthentication no /' /etc/ssh/sshd_config | ||
|
||
USER gitprep | ||
|
||
# Install GitPrep | ||
RUN set -x \ | ||
&& git --version \ | ||
&& perl -v \ | ||
&& curl -kL https://github.com/yuki-kimoto/gitprep/archive/latest.tar.gz \ | ||
> /home/gitprep/gitprep-latest.tar.gz \ | ||
&& mkdir /home/gitprep/gitprep \ | ||
&& tar -zxf /home/gitprep/gitprep-latest.tar.gz \ | ||
--strip-components=1 -C /home/gitprep/gitprep \ | ||
&& rm -f /home/gitprep/gitprep-latest.tar.gz \ | ||
&& cd /home/gitprep/gitprep \ | ||
&& PERL_USE_UNSAFE_INC=1 ./setup_module \ | ||
&& prove t \ | ||
&& ./setup_database | ||
|
||
USER root | ||
|
||
# Clean obsolete Packages | ||
RUN set -x \ | ||
&& apk del --no-cache \ | ||
perl-dev \ | ||
gcc \ | ||
g \ | ||
curl \ | ||
wget \ | ||
make | ||
|
||
# Copy start script | ||
COPY ./docker-entrypoint.sh /docker-entrypoint.sh | ||
RUN chmod 700 /docker-entrypoint.sh | ||
|
||
# Expose default HTTP connector port. | ||
EXPOSE 10020 | ||
EXPOSE 22 | ||
|
||
# Set volume mount point | ||
VOLUME ["/home/gitprep"] | ||
|
||
# Set the default working directory as the installation directory. | ||
WORKDIR /home/gitprep | ||
|
||
# Set entrypoint to invoke tini as PID1 | ||
ENTRYPOINT ["/sbin/tini","--","/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,18 @@ | ||
version: "3" | ||
|
||
services: | ||
gitprep: | ||
image: yuki-kimoto/gitprep:latest | ||
container_name: gitprep | ||
hostname: gitprep | ||
restart: always | ||
ports: | ||
- "10020:10020" | ||
- "0.0.0.0:2222:22" | ||
volumes: | ||
- gitprep:/home/gitprep | ||
- sshd:/etc/ssh | ||
|
||
volumes: | ||
gitprep: | ||
sshd: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,20 @@ | ||
#!/bin/sh | ||
|
||
# Making all required files if they are not existing. | ||
test -f /etc/ssh/ssh_host_ecdsa_key || \ | ||
/usr/bin/ssh-keygen -q -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -C '' -N '' | ||
test -f /etc/ssh/ssh_host_rsa_key || \ | ||
/usr/bin/ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key -C '' -N '' | ||
test -f /etc/ssh/ssh_host_ed25519_key || \ | ||
/usr/bin/ssh-keygen -q -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -C '' -N '' | ||
|
||
# Now start SSH daemon. | ||
/usr/sbin/sshd | ||
|
||
# GitPrep restrict max post message size 10MB(This is default of Mojolicious) | ||
# We overwrite the value to 1GB : | ||
export MOJO_MAX_MESSAGE_SIZE=1024000000 | ||
|
||
# Start GitPrep and tail log file | ||
su - gitprep -s /bin/bash -c '/home/gitprep/gitprep/gitprep' | ||
tail -f /home/gitprep/gitprep/log/production.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters