run 502 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. USER=git
  3. if ! test -d /data/gogs; then
  4. mkdir -p /data/gogs/data /data/gogs/conf /data/gogs/log /data/git
  5. fi
  6. if ! test -d ~git/.ssh; then
  7. mkdir ~git/.ssh
  8. chmod 700 ~git/.ssh
  9. fi
  10. if ! test -f ~git/.ssh/environment; then
  11. echo "GOGS_CUSTOM=${GOGS_CUSTOM}" > ~git/.ssh/environment
  12. chmod 600 ~git/.ssh/environment
  13. fi
  14. cd /app/gogs
  15. ln -sf /data/gogs/log ./log
  16. ln -sf /data/gogs/data ./data
  17. chown -R git:git /data /app/gogs ~git/
  18. export USER
  19. exec gosu $USER /app/gogs/gogs web