finalize.sh 962 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. set -xe
  3. # Install gosu
  4. if [ "$(uname -m)" = "aarch64" ]; then
  5. export arch='arm64'
  6. export checksum='73244a858f5514a927a0f2510d533b4b57169b64d2aa3f9d98d92a7a7df80cea'
  7. elif [ "$(uname -m)" = "armv7l" ]; then
  8. export arch='armhf'
  9. export checksum='abb1489357358b443789571d52b5410258ddaca525ee7ac3ba0dd91d34484589'
  10. else
  11. export arch='amd64'
  12. export checksum='bd8be776e97ec2b911190a82d9ab3fa6c013ae6d3121eea3d0bfd5c82a0eaf8c'
  13. fi
  14. wget --quiet https://github.com/tianon/gosu/releases/download/1.14/gosu-${arch} -O /usr/sbin/gosu
  15. echo "${checksum} /usr/sbin/gosu" | sha256sum -cs
  16. chmod +x /usr/sbin/gosu
  17. # Create git user for Gogs
  18. addgroup -S git
  19. adduser -G git -H -D -g 'Gogs Git User' git -h /data/git -s /bin/bash && usermod -p '*' git && passwd -u git
  20. echo "export GOGS_CUSTOM=${GOGS_CUSTOM}" >> /etc/profile
  21. # Final cleaning
  22. rm -rf /app/gogs/build
  23. rm -rf /app/gogs/docker/build
  24. rm /app/gogs/docker/nsswitch.conf
  25. rm /app/gogs/docker/README.md