mirror of https://github.com/gogits/gogs.git
无闻
9 years ago
8 changed files with 62 additions and 37 deletions
@ -1,26 +1,8 @@
|
||||
#!/bin/sh |
||||
USER=git |
||||
|
||||
if ! test -d /data/gogs; then |
||||
mkdir -p /data/gogs/data /data/gogs/conf /data/gogs/log /data/git |
||||
if test -f ./setup; then |
||||
source ./setup |
||||
fi |
||||
|
||||
if ! test -d ~git/.ssh; then |
||||
mkdir ~git/.ssh |
||||
chmod 700 ~git/.ssh |
||||
fi |
||||
|
||||
if ! test -f ~git/.ssh/environment; then |
||||
echo "GOGS_CUSTOM=${GOGS_CUSTOM}" > ~git/.ssh/environment |
||||
chmod 600 ~git/.ssh/environment |
||||
fi |
||||
|
||||
cd /app/gogs |
||||
|
||||
ln -sf /data/gogs/log ./log |
||||
ln -sf /data/gogs/data ./data |
||||
|
||||
chown -R git:git /data /app/gogs ~git/ |
||||
|
||||
export USER |
||||
export USER=git |
||||
exec gosu $USER /app/gogs/gogs web |
||||
|
@ -0,0 +1,22 @@
|
||||
#!/bin/sh |
||||
|
||||
if ! test -d /data/gogs; then |
||||
mkdir -p /data/gogs/data /data/gogs/conf /data/gogs/log /data/git |
||||
fi |
||||
|
||||
if ! test -d ~git/.ssh; then |
||||
mkdir ~git/.ssh |
||||
chmod 700 ~git/.ssh |
||||
fi |
||||
|
||||
if ! test -f ~git/.ssh/environment; then |
||||
echo "GOGS_CUSTOM=${GOGS_CUSTOM}" > ~git/.ssh/environment |
||||
chmod 600 ~git/.ssh/environment |
||||
fi |
||||
|
||||
cd /app/gogs |
||||
|
||||
ln -sf /data/gogs/log ./log |
||||
ln -sf /data/gogs/data ./data |
||||
|
||||
chown -R git:git /data /app/gogs ~git/ |
@ -1,15 +1,7 @@
|
||||
#!/bin/sh |
||||
|
||||
if ! test -d /data/ssh |
||||
then |
||||
mkdir -p /data/ssh |
||||
ssh-keygen -q -f /data/ssh/ssh_host_key -N '' -t rsa1 |
||||
ssh-keygen -q -f /data/ssh/ssh_host_rsa_key -N '' -t rsa |
||||
ssh-keygen -q -f /data/ssh/ssh_host_dsa_key -N '' -t dsa |
||||
ssh-keygen -q -f /data/ssh/ssh_host_ecdsa_key -N '' -t ecdsa |
||||
ssh-keygen -q -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519 |
||||
chown -R root:root /data/ssh/* |
||||
chmod 600 /data/ssh/* |
||||
if test -f ./setup; then |
||||
source ./setup |
||||
fi |
||||
|
||||
exec gosu root /usr/sbin/sshd -D -f /app/gogs/docker/sshd_config |
||||
|
@ -0,0 +1,12 @@
|
||||
#!/bin/sh |
||||
|
||||
if ! test -d /data/ssh; then |
||||
mkdir -p /data/ssh |
||||
ssh-keygen -q -f /data/ssh/ssh_host_key -N '' -t rsa1 |
||||
ssh-keygen -q -f /data/ssh/ssh_host_rsa_key -N '' -t rsa |
||||
ssh-keygen -q -f /data/ssh/ssh_host_dsa_key -N '' -t dsa |
||||
ssh-keygen -q -f /data/ssh/ssh_host_ecdsa_key -N '' -t ecdsa |
||||
ssh-keygen -q -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519 |
||||
chown -R root:root /data/ssh/* |
||||
chmod 600 /data/ssh/* |
||||
fi |
Loading…
Reference in new issue