diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 808307e77..8a73c7c51 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,9 +6,15 @@ on: - 'release/**' paths: - '**.go' + - 'go.mod' + - '.golangci.yml' + - '.github/workflows/go.yml' pull_request: paths: - '**.go' + - 'go.mod' + - '.golangci.yml' + - '.github/workflows/go.yml' env: GOPROXY: "https://proxy.golang.org" @@ -17,37 +23,48 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout code + uses: actions/checkout@v2 - name: Run golangci-lint - uses: actions-contrib/golangci-lint@v1 + uses: golangci/golangci-lint-action@v2 with: - args: 'run --timeout=30m' + version: latest + args: --timeout=30m test: name: Test strategy: matrix: - go-version: [1.14.x, 1.15.x] - platform: [ubuntu-latest, macos-latest, windows-latest] + go-version: [ 1.14.x, 1.15.x, 1.16.x, 1.17.x ] + platform: [ ubuntu-latest, macos-latest, windows-latest ] runs-on: ${{ matrix.platform }} steps: - name: Install Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v2 - - name: Run unit tests + - name: Run tests with coverage run: go test -v -race -coverprofile=coverage -covermode=atomic ./... - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v1.0.6 + uses: codecov/codecov-action@v1.5.0 with: file: ./coverage flags: unittests - - name: Cache downloaded modules - uses: actions/cache@v1 + - name: Send email on failure + uses: dawidd6/action-send-mail@v3 + if: ${{ failure() && github.event_name == 'push' && github.ref == 'refs/heads/main' }} with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + server_address: smtp.mailgun.org + server_port: 465 + username: ${{ secrets.SMTP_USERNAME }} + password: ${{ secrets.SMTP_PASSWORD }} + subject: GitHub Actions (${{ github.repository }}) job result + to: github-actions-8ce6454@unknwon.io + from: GitHub Actions (${{ github.repository }}) + reply_to: noreply@unknwon.io + body: | + The job "${{ github.job }}" of ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} completed with "${{ job.status }}". + + View the job run at: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/.github/workflows/lsif.yml b/.github/workflows/lsif.yml index 20136b788..c77c089f1 100644 --- a/.github/workflows/lsif.yml +++ b/.github/workflows/lsif.yml @@ -1,11 +1,19 @@ name: LSIF -on: [push] +on: + push: + paths: + - '**.go' + - 'go.mod' + - '.github/workflows/lsif.yml' +env: + GOPROXY: "https://proxy.golang.org" + jobs: lsif-go: if: github.repository == 'gogs/gogs' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Generate LSIF data uses: sourcegraph/lsif-go-action@master - name: Upload LSIF data to sourcegraph.com diff --git a/.github/workflows/shell.yml b/.github/workflows/shell.yml index 1926472ce..e0826296c 100644 --- a/.github/workflows/shell.yml +++ b/.github/workflows/shell.yml @@ -1,13 +1,14 @@ name: Shell on: push: - branches: [master] + branches: [ main ] pull_request: + jobs: shellcheck: name: Shellcheck runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Run ShellCheck uses: ludeeus/action-shellcheck@master diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 000000000..b7256bae1 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,21 @@ +linters-settings: + nakedret: + max-func-lines: 0 # Disallow any unnamed return statement + +linters: + enable: + - deadcode + - errcheck + - gosimple + - govet + - ineffassign + - staticcheck + - structcheck + - typecheck + - unused + - varcheck + - nakedret + - gofmt + - rowserrcheck + - unconvert + - goimports diff --git a/docker/Dockerfile.aarch64 b/docker/Dockerfile.aarch64 deleted file mode 100644 index 88daf7293..000000000 --- a/docker/Dockerfile.aarch64 +++ /dev/null @@ -1,44 +0,0 @@ -FROM arm64v8/golang:1.14-alpine3.11 AS binarybuilder -RUN apk --no-cache --no-progress add --virtual \ - build-deps \ - build-base \ - git \ - linux-pam-dev - -WORKDIR /gogs.io/gogs -COPY . . -RUN make build-no-gen TAGS="cert pam" - -FROM arm64v8/alpine:3.11 -ADD https://github.com/tianon/gosu/releases/download/1.11/gosu-arm64 /usr/sbin/gosu -RUN chmod +x /usr/sbin/gosu \ - && echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories \ - && apk --no-cache --no-progress add \ - bash \ - ca-certificates \ - curl \ - git \ - linux-pam \ - openssh \ - s6 \ - shadow \ - socat \ - tzdata \ - rsync - -ENV GOGS_CUSTOM /data/gogs - -# Configure LibC Name Service -COPY docker/nsswitch.conf /etc/nsswitch.conf - -WORKDIR /app/gogs -COPY docker ./docker -COPY --from=binarybuilder /gogs.io/gogs/gogs . - -RUN ./docker/finalize.sh - -# Configure Docker Container -VOLUME ["/data", "/backup"] -EXPOSE 22 3000 -ENTRYPOINT ["/app/gogs/docker/start.sh"] -CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"] diff --git a/docker/Dockerfile.rpi b/docker/Dockerfile.rpi index a9a1d2956..148e22b17 100644 --- a/docker/Dockerfile.rpi +++ b/docker/Dockerfile.rpi @@ -1,4 +1,4 @@ -FROM arm32v7/golang:1.14-alpine3.11 AS binarybuilder +FROM arm32v7/golang:1.14-alpine3.14 AS binarybuilder RUN apk --no-cache --no-progress add --virtual \ build-deps \ build-base \ @@ -7,11 +7,11 @@ RUN apk --no-cache --no-progress add --virtual \ WORKDIR /gogs.io/gogs COPY . . -RUN make build-no-gen TAGS="cert pam" +RUN make build TAGS="cert pam" -FROM arm32v7/alpine:3.11 -ADD https://github.com/tianon/gosu/releases/download/1.12/gosu-armhf /usr/sbin/gosu -RUN chmod +x /usr/sbin/gosu \ +FROM arm32v7/alpine:3.14 +RUN wget https://github.com/tianon/gosu/releases/download/1.12/gosu-armhf -O /usr/sbin/gosu \ + && chmod +x /usr/sbin/gosu \ && echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories \ && apk --no-cache --no-progress add \ bash \ @@ -28,7 +28,7 @@ RUN chmod +x /usr/sbin/gosu \ ENV GOGS_CUSTOM /data/gogs -# Configure LibC Name Service +# Configure LibC Name Service COPY docker/nsswitch.conf /etc/nsswitch.conf WORKDIR /app/gogs @@ -37,8 +37,9 @@ COPY --from=binarybuilder /gogs.io/gogs/gogs . RUN ./docker/finalize.sh -# Configure Docker Container +# Configure Docker Container VOLUME ["/data", "/backup"] EXPOSE 22 3000 +HEALTHCHECK CMD (nc -z -w 3 localhost 22 && curl -o /dev/null -sS http://localhost:3000/healthcheck) || exit 1 ENTRYPOINT ["/app/gogs/docker/start.sh"] CMD ["/bin/s6-svscan", "/app/gogs/docker/s6/"] diff --git a/docker/README.md b/docker/README.md index 50bc5f228..4cf612928 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,8 +1,8 @@ # Docker for Gogs -![Docker pulls](https://img.shields.io/docker/pulls/gogs/gogs?logo=docker&style=for-the-badge) ![Docker image size](https://img.shields.io/microbadger/image-size/gogs/gogs?logo=docker&style=for-the-badge) +![Docker pulls](https://img.shields.io/docker/pulls/gogs/gogs?logo=docker&style=for-the-badge) -Visit [Docker Hub](https://hub.docker.com/u/gogs) see all available images and tags. +Visit [Docker Hub](https://hub.docker.com/u/gogs) or [GitHub Container registry](https://github.com/gogs/gogs/pkgs/container/gogs) to see all available images and tags. ## Usage @@ -18,13 +18,13 @@ $ docker pull gogs/gogs $ mkdir -p /var/gogs # Use `docker run` for the first time. -$ docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs +$ docker run --name=gogs -p 10022:22 -p 10880:3000 -v /var/gogs:/data gogs/gogs # Use `docker start` if you have stopped it. $ docker start gogs ``` -Note: It is important to map the Gogs ssh service from the container to the host and set the appropriate SSH Port and URI settings when setting up Gogs for the first time. To access and clone Gogs Git repositories with the above configuration you would use: `git clone ssh://git@hostname:10022/username/myrepo.git` for example. +Note: It is important to map the SSH service from the container to the host and set the appropriate SSH Port and URI settings when setting up Gogs for the first time. To access and clone Git repositories with the above configuration you would use: `git clone ssh://git@hostname:10022/username/myrepo.git` for example. Files will be store in local path `/var/gogs` in my case. @@ -40,50 +40,38 @@ Directory `/var/gogs` keeps Git repositories and Gogs data: |-- data |-- log -#### Custom Directory +#### Custom directory The "custom" directory may not be obvious in Docker environment. The `/var/gogs/gogs` (in the host) and `/data/gogs` (in the container) is already the "custom" directory and you do not need to create another layer but directly edit corresponding files under this directory. -### Volume With Data Container - -If you're more comfortable with mounting data to a data container, the commands you execute at the first time will look like as follows: - -```sh -# Create data container -docker run --name=gogs-data --entrypoint /bin/true gogs/gogs - -# Use `docker run` for the first time. -docker run --name=gogs --volumes-from gogs-data -p 10022:22 -p 10080:3000 gogs/gogs -``` - -#### Using Docker 1.9 Volume Command +#### Using Docker volumes ```sh # Create docker volume. $ docker volume create --name gogs-data # Use `docker run` for the first time. -$ docker run --name=gogs -p 10022:22 -p 10080:3000 -v gogs-data:/data gogs/gogs +$ docker run --name=gogs -p 10022:22 -p 10880:3000 -v gogs-data:/data gogs/gogs ``` ## Settings ### Application -Most of settings are obvious and easy to understand, but there are some settings can be confusing by running Gogs inside Docker: +Most of the settings are obvious and easy to understand, but there are some settings can be confusing by running Gogs inside Docker: - **Repository Root Path**: keep it as default value `/home/git/gogs-repositories` because `start.sh` already made a symbolic link for you. - **Run User**: keep it as default value `git` because `finalize.sh` already setup a user with name `git`. - **Domain**: fill in with Docker container IP (e.g. `192.168.99.100`). But if you want to access your Gogs instance from a different physical machine, please fill in with the hostname or IP address of the Docker host machine. - **SSH Port**: Use the exposed port from Docker container. For example, your SSH server listens on `22` inside Docker, **but** you expose it by `10022:22`, then use `10022` for this value. **Builtin SSH server is not recommended inside Docker Container** -- **HTTP Port**: Use port you want Gogs to listen on inside Docker container. For example, your Gogs listens on `3000` inside Docker, **and** you expose it by `10080:3000`, but you still use `3000` for this value. -- **Application URL**: Use combination of **Domain** and **exposed HTTP Port** values (e.g. `http://192.168.99.100:10080/`). +- **HTTP Port**: Use port you want Gogs to listen on inside Docker container. For example, your Gogs listens on `3000` inside Docker, **and** you expose it by `10880:3000`, but you still use `3000` for this value. +- **Application URL**: Use combination of **Domain** and **exposed HTTP Port** values (e.g. `http://192.168.99.100:10880/`). -Full documentation of application settings can be found [here](https://github.com/gogs/gogs/blob/master/conf/app.ini). +Full documentation of application settings can be found [here](https://github.com/gogs/gogs/blob/main/conf/app.ini). -### Container Options +### Container options -This container have some options available via environment variables, these options are opt-in features that can help the administration of this container: +This container has some options available via environment variables, these options are opt-in features that can help the administration of this container: - **SOCAT_LINK**: - Possible value: @@ -135,7 +123,8 @@ This container have some options available via environment variables, these opti Used by backup system. If defined, supplies `--exclude-repos` argument to `gogs backup`.\ See: [Backup System](#backup-system) -## Backup System +## Backup system + Automated backups with retention policy: - `BACKUP_INTERVAL` controls how often the backup job runs and supports interval in hours (h), days (d), and months (M), eg. `3h`, `7d`, `3M`. The lowest possible value is one hour (`1h`). @@ -152,10 +141,10 @@ Steps to upgrade Gogs with Docker: - `docker rm gogs` - Finally, create a container for the first time and don't forget to do the same for the volume and port mapping. -## Known Issues +## Known issues - The docker container cannot currently be built on Raspberry 1 (armv6l) as our base image `alpine` does not have a `go` package available for this platform. -## Useful Links +## Useful links - [Share port 22 between Gogs inside Docker & the local system](http://www.ateijelo.com/blog/2016/07/09/share-port-22-between-docker-gogs-ssh-and-local-system) diff --git a/docker/finalize.sh b/docker/finalize.sh old mode 100755 new mode 100644 diff --git a/docker/runtime/backup-init.sh b/docker/runtime/backup-init.sh index 07298c5d1..f4e21a1b5 100644 --- a/docker/runtime/backup-init.sh +++ b/docker/runtime/backup-init.sh @@ -30,7 +30,9 @@ parse_generate_cron_expression() { CRON_EXPR_DAYS="*" CRON_EXPR_MONTHS="*" + # shellcheck disable=SC2001 TIME_INTERVAL=$(echo "${BACKUP_INTERVAL}" | sed -e 's/[hdM]$//') + # shellcheck disable=SC2001 TIME_UNIT=$(echo "${BACKUP_INTERVAL}" | sed -e 's/^[0-9]\+//') if [ "${TIME_UNIT}" = "h" ]; then @@ -74,7 +76,9 @@ parse_generate_cron_expression() { parse_generate_retention_expression() { FIND_TIME_EXPR='mtime' + # shellcheck disable=SC2001 TIME_INTERVAL=$(echo "${BACKUP_RETENTION}" | sed -e 's/[mhdM]$//') + # shellcheck disable=SC2001 TIME_UNIT=$(echo "${BACKUP_RETENTION}" | sed -e 's/^[0-9]\+//') if [ "${TIME_UNIT}" = "m" ]; then diff --git a/docker/runtime/backup-rotator.sh b/docker/runtime/backup-rotator.sh index 51665f57a..3b6d10abf 100644 --- a/docker/runtime/backup-rotator.sh +++ b/docker/runtime/backup-rotator.sh @@ -17,10 +17,11 @@ main() { fi if [ ! -d "${BACKUP_PATH}" ]; then - echo "Error: BACKUP_PATH does't exist or is not a directory" 1>&2 + echo "Error: BACKUP_PATH doesn't exist or is not a directory" 1>&2 exit 1 fi + # shellcheck disable=SC2086 find "${BACKUP_PATH}/" -type f -name "gogs-backup-*.zip" -${FIND_EXPRESSION} -print -exec rm "{}" + } diff --git a/docker/s6/.s6-svscan/finish b/docker/s6/.s6-svscan/finish old mode 100755 new mode 100644 index 3fab7f42e..518b5d9bc --- a/docker/s6/.s6-svscan/finish +++ b/docker/s6/.s6-svscan/finish @@ -1,5 +1,5 @@ #!/bin/sh # Cleanup SOCAT services and s6 event folder -rm -rf $(find /app/gogs/docker/s6/ -name 'event') +rm -rf "$(find /app/gogs/docker/s6/ -name 'event')" rm -rf /app/gogs/docker/s6/SOCAT_* diff --git a/docker/s6/crond/run b/docker/s6/crond/run old mode 100755 new mode 100644 index 9aa9fb9f2..6232dd263 --- a/docker/s6/crond/run +++ b/docker/s6/crond/run @@ -3,6 +3,7 @@ # The default configuration is also calling all the scripts in /etc/periodic/${period} if test -f ./setup; then + # shellcheck disable=SC2039,SC1091,SC3046 source ./setup fi diff --git a/docker/s6/gogs/run b/docker/s6/gogs/run old mode 100755 new mode 100644 index edcf49cec..eae716e70 --- a/docker/s6/gogs/run +++ b/docker/s6/gogs/run @@ -1,7 +1,8 @@ #!/bin/sh if test -f ./setup; then + # shellcheck disable=SC2039,SC1091,SC3046 source ./setup fi -exec gosu $USER /app/gogs/gogs web +exec gosu "$USER" /app/gogs/gogs web diff --git a/docker/s6/gogs/setup b/docker/s6/gogs/setup old mode 100755 new mode 100644 index b361495b5..bb77aa705 --- a/docker/s6/gogs/setup +++ b/docker/s6/gogs/setup @@ -1,16 +1,16 @@ #!/bin/sh if ! test -d ~git/.ssh; then - gosu $USER mkdir -p ~git/.ssh + gosu "$USER" mkdir -p ~git/.ssh chmod 700 ~git/.ssh fi if ! test -f ~git/.ssh/environment; then - gosu $USER echo "GOGS_CUSTOM=${GOGS_CUSTOM}" > ~git/.ssh/environment + gosu "$USER" echo "GOGS_CUSTOM=${GOGS_CUSTOM}" > ~git/.ssh/environment chmod 600 ~git/.ssh/environment fi -cd /app/gogs +cd /app/gogs || exit 1 # Link volumed data with app data ln -sfn /data/gogs/log ./log diff --git a/docker/s6/openssh/run b/docker/s6/openssh/run old mode 100755 new mode 100644 index 99172aab6..c293e67b2 --- a/docker/s6/openssh/run +++ b/docker/s6/openssh/run @@ -1,6 +1,7 @@ #!/bin/sh if test -f ./setup; then + # shellcheck disable=SC2039,SC1091,SC3046 source ./setup fi diff --git a/docker/s6/openssh/setup b/docker/s6/openssh/setup old mode 100755 new mode 100644 index 5333d3c06..4d71e2220 --- a/docker/s6/openssh/setup +++ b/docker/s6/openssh/setup @@ -1,6 +1,6 @@ #!/bin/sh -# Check if host keys are present, else create them +# Check if host keys are present, else create them if ! test -f /data/ssh/ssh_host_rsa_key; then ssh-keygen -q -f /data/ssh/ssh_host_rsa_key -N '' -t rsa fi @@ -17,7 +17,7 @@ if ! test -f /data/ssh/ssh_host_ed25519_key; then ssh-keygen -q -f /data/ssh/ssh_host_ed25519_key -N '' -t ed25519 fi -# Set correct right to ssh keys +# Set correct right to ssh keys chown -R root:root /data/ssh/* chmod 0700 /data/ssh chmod 0600 /data/ssh/* diff --git a/docker/s6/syslogd/run b/docker/s6/syslogd/run old mode 100755 new mode 100644 index f7bdbe36d..de605fcee --- a/docker/s6/syslogd/run +++ b/docker/s6/syslogd/run @@ -1,6 +1,7 @@ #!/bin/sh if test -f ./setup; then + # shellcheck disable=SC2039,SC1091,SC3046 source ./setup fi diff --git a/docker/start.sh b/docker/start.sh old mode 100755 new mode 100644 index 77418e18a..b37acfe27 --- a/docker/start.sh +++ b/docker/start.sh @@ -3,17 +3,18 @@ create_socat_links() { # Bind linked docker container to localhost socket using socat USED_PORT="3000:22" - while read NAME ADDR PORT; do + while read -r NAME ADDR PORT; do if test -z "$NAME$ADDR$PORT"; then continue elif echo $USED_PORT | grep -E "(^|:)$PORT($|:)" > /dev/null; then echo "init:socat | Can't bind linked container ${NAME} to localhost, port ${PORT} already in use" 1>&2 else SERV_FOLDER=/app/gogs/docker/s6/SOCAT_${NAME}_${PORT} - mkdir -p ${SERV_FOLDER} + mkdir -p "${SERV_FOLDER}" CMD="socat -ls TCP4-LISTEN:${PORT},fork,reuseaddr TCP4:${ADDR}:${PORT}" - echo -e "#!/bin/sh\nexec $CMD" > ${SERV_FOLDER}/run - chmod +x ${SERV_FOLDER}/run + # shellcheck disable=SC2039,SC3037 + echo -e "#!/bin/sh\nexec $CMD" > "${SERV_FOLDER}"/run + chmod +x "${SERV_FOLDER}"/run USED_PORT="${USED_PORT}:${PORT}" echo "init:socat | Linked container ${NAME} will be binded to localhost on port ${PORT}" 1>&2 fi @@ -23,20 +24,20 @@ EOT } cleanup() { - # Cleanup SOCAT services and s6 event folder + # Cleanup SOCAT services and s6 event folder # On start and on shutdown in case container has been killed - rm -rf $(find /app/gogs/docker/s6/ -name 'event') + rm -rf "$(find /app/gogs/docker/s6/ -name 'event')" rm -rf /app/gogs/docker/s6/SOCAT_* } create_volume_subfolder() { # Modify the owner of /data dir, make $USER(git) user have permission to create sub-dir in /data. - chown -R $USER:$USER /data + chown -R "$USER:$USER" /data # Create VOLUME subfolder for f in /data/gogs/data /data/gogs/conf /data/gogs/log /data/git /data/ssh; do if ! test -d $f; then - gosu $USER mkdir -p $f + gosu "$USER" mkdir -p $f fi done } @@ -54,19 +55,19 @@ cleanup create_volume_subfolder LINK=$(echo "$SOCAT_LINK" | tr '[:upper:]' '[:lower:]') -if [ "$LINK" = "false" -o "$LINK" = "0" ]; then +if [ "$LINK" = "false" ] || [ "$LINK" = "0" ]; then echo "init:socat | Will not try to create socat links as requested" 1>&2 else create_socat_links fi CROND=$(echo "$RUN_CROND" | tr '[:upper:]' '[:lower:]') -if [ "$CROND" = "true" -o "$CROND" = "1" ]; then +if [ "$CROND" = "true" ] || [ "$CROND" = "1" ]; then echo "init:crond | Cron Daemon (crond) will be run as requested by s6" 1>&2 rm -f /app/gogs/docker/s6/crond/down /bin/sh /app/gogs/docker/runtime/backup-init.sh "${PUID}" else - # Tell s6 not to run the crond service + # Tell s6 not to run the crond service touch /app/gogs/docker/s6/crond/down fi diff --git a/go.mod b/go.mod index 2cee1c4bb..d417a805e 100644 --- a/go.mod +++ b/go.mod @@ -58,6 +58,7 @@ require ( github.com/urfave/cli v1.22.4 golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582 + golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/text v0.3.3 gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect diff --git a/go.sum b/go.sum index d93015d0c..bc18f6dcb 100644 --- a/go.sum +++ b/go.sum @@ -17,6 +17,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc h1:biVzkmvwrH8WK8raXaxBx6fRVTlJILwEwQGL1I/ByEI= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= @@ -47,6 +48,7 @@ github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFP github.com/editorconfig/editorconfig-core-go/v2 v2.3.2 h1:j9GLz0kWF9+1T3IX0MOhhvzLtqhFOvIKLhZFxtY95Qc= github.com/editorconfig/editorconfig-core-go/v2 v2.3.2/go.mod h1:+u4rFiKVvlbukHyJM76GYXqQcnHScxvQCuKpMLRtJVw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= @@ -78,6 +80,7 @@ github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:9wScpmSP5A3Bk8V3XHWUcJmYTh+ZnlHVyc+A4oZYS3Y= github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -85,14 +88,13 @@ github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561 h1:aBzukfDxQlCTVS0NBU github.com/gogs/chardet v0.0.0-20150115103509-2404f7772561/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 h1:yXtpJr/LV6PFu4nTLgfjQdcMdzjbqqXMEnHfq0Or6p8= github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk= -github.com/gogs/git-module v1.1.1 h1:/taoHtOHLorlmQJ7zLBQvJGGgM9LRIoGGH1et4Upzvo= -github.com/gogs/git-module v1.1.1/go.mod h1:oN37FFStFjdnTJXsSbhIHKJXh2YeDsEcXPATVz/oeuQ= github.com/gogs/git-module v1.1.2 h1:30jO+rKEmCDk/O6Mnl7MVrw6rI1qLDByXpkRB+bpYwM= github.com/gogs/git-module v1.1.2/go.mod h1:oN37FFStFjdnTJXsSbhIHKJXh2YeDsEcXPATVz/oeuQ= github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4 h1:C7NryI/RQhsIWwC2bHN601P1wJKeuQ6U/UCOYTn3Cic= github.com/gogs/go-gogs-client v0.0.0-20200128182646-c69cb7680fd4/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU= github.com/gogs/go-libravatar v0.0.0-20191106065024-33a75213d0a0 h1:K02vod+sn3M1OOkdqi2tPxN2+xESK4qyITVQ3JkGEv4= github.com/gogs/go-libravatar v0.0.0-20191106065024-33a75213d0a0/go.mod h1:Zas3BtO88pk1cwUfEYlvnl/CRwh0ybDxRWSwRjG8I3w= +github.com/gogs/minwinsvc v0.0.0-20170301035411-95be6356811a h1:8DZwxETOVWIinYxDK+i6L+rMb7eGATGaakD6ZucfHVk= github.com/gogs/minwinsvc v0.0.0-20170301035411-95be6356811a/go.mod h1:TUIZ+29jodWQ8Gk6Pvtg4E09aMsc3C/VLZiVYfUhWQU= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= @@ -114,6 +116,7 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= @@ -125,6 +128,7 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= @@ -132,6 +136,7 @@ github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/issue9/assert v1.3.1 h1:L8pRpbnzMIPFJqrMKR/oG03uWrtVeZyYBpI2U2Jx1JE= github.com/issue9/assert v1.3.1/go.mod h1:9Ger+iz8X7r1zMYYwEhh++2wMGWcNN2oVI+zIQXxcio= github.com/issue9/identicon v1.0.1 h1:pCDfjMDM6xWK0Chxo8Lif+ST/nOEtmXgMITgV1YA9Og= github.com/issue9/identicon v1.0.1/go.mod h1:UKNVkUFI68RPz/RlLhsAr1aX6bBSaYEWRHVfdjrMUmk= @@ -142,14 +147,15 @@ github.com/jinzhu/gorm v1.9.12 h1:Drgk1clyWT9t9ERbzHza6Mj/8FY/CqMyVzOiHviMo6Q= github.com/jinzhu/gorm v1.9.12/go.mod h1:vhTjlKSJUTWNtcbQtrMBFCxy7eXTzeCAzfL5fBZT/Qs= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M= github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -159,8 +165,10 @@ github.com/klauspost/cpuid v1.2.1 h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -188,8 +196,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/mcuadros/go-version v0.0.0-20190308113854-92cdf37c5b75/go.mod h1:76rfSfYPWj01Z85hUf/ituArm797mNKcvINh1OlsZKo= github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2 h1:YocNLcTBdEdvY3iDK6jfWXvEaM5OCKkjxPKoJRdB3Gg= github.com/mcuadros/go-version v0.0.0-20190830083331-035f6764e8d2/go.mod h1:76rfSfYPWj01Z85hUf/ituArm797mNKcvINh1OlsZKo= -github.com/microcosm-cc/bluemonday v1.0.2 h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s= -github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/microcosm-cc/bluemonday v1.0.4 h1:p0L+CTpo/PLFdkoPcJemLXG+fpMD7pYOoDEq1axMbGg= github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -247,6 +253,7 @@ github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNue github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca h1:NugYot0LIVPxTvN8n+Kvkn6TrbMyxQiuvKdEwFdR9vI= github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= @@ -262,22 +269,20 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= github.com/smartystreets/assertions v1.0.1/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo= github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= -github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= @@ -294,6 +299,7 @@ github.com/unknwon/paginater v0.0.0-20170405233947-45e5d631308e h1:Qf3QQl/zmEbWD github.com/unknwon/paginater v0.0.0-20170405233947-45e5d631308e/go.mod h1:TBwoao3Q4Eb/cp+dHbXDfRTrZSsj/k7kLr2j1oWRWC0= github.com/urfave/cli v1.22.4 h1:u7tSpNPPswAFymm8IehJhy4uJMlUuU/GmqSkvJ1InXA= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -334,6 +340,7 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -350,8 +357,9 @@ golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f h1:gWF768j/LaZugp8dyS4UwsslYCYz9XgFxvlgsn0n9H8= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -370,6 +378,7 @@ golang.org/x/tools v0.0.0-20190805222050-c5a2fd39b72a/go.mod h1:jcCCGcm9btYwXyDq golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -388,6 +397,7 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= @@ -395,6 +405,7 @@ gopkg.in/bufio.v1 v1.0.0-20140618132640-567b2bfa514e h1:wGA78yza6bu/mWcc4QfBuIEH gopkg.in/bufio.v1 v1.0.0-20140618132640-567b2bfa514e/go.mod h1:xsQCaysVCudhrYTfzYWe577fCe7Ceci+6qjO2Rdc0Z4= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE= @@ -416,6 +427,7 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/gogs.go b/gogs.go index 683c2f48d..3127b0008 100644 --- a/gogs.go +++ b/gogs.go @@ -1,3 +1,4 @@ +//go:build go1.14 // +build go1.14 // Copyright 2014 The Gogs Authors. All rights reserved. diff --git a/internal/auth/pam/pam_stub.go b/internal/auth/pam/pam_stub.go index 33ac751a3..289505cad 100644 --- a/internal/auth/pam/pam_stub.go +++ b/internal/auth/pam/pam_stub.go @@ -1,3 +1,4 @@ +//go:build !pam // +build !pam // Copyright 2014 The Gogs Authors. All rights reserved. diff --git a/internal/cmd/cert_stub.go b/internal/cmd/cert_stub.go index 6164c83e9..275ff3f95 100644 --- a/internal/cmd/cert_stub.go +++ b/internal/cmd/cert_stub.go @@ -1,3 +1,4 @@ +//go:build !cert // +build !cert // Copyright 2009 The Go Authors. All rights reserved. diff --git a/internal/cron/cron.go b/internal/cron/cron.go index 9d45cd15a..2228b6a46 100644 --- a/internal/cron/cron.go +++ b/internal/cron/cron.go @@ -11,8 +11,8 @@ import ( "github.com/gogs/cron" - "gogs.io/gogs/internal/db" "gogs.io/gogs/internal/conf" + "gogs.io/gogs/internal/db" ) var c = cron.New() diff --git a/internal/db/action.go b/internal/db/action.go index 3300ffd51..3681064f5 100644 --- a/internal/db/action.go +++ b/internal/db/action.go @@ -11,7 +11,7 @@ import ( "time" "unicode" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" "github.com/unknwon/com" log "unknwon.dev/clog/v2" "xorm.io/xorm" diff --git a/internal/db/backup.go b/internal/db/backup.go index a02d70d66..5c57e6594 100644 --- a/internal/db/backup.go +++ b/internal/db/backup.go @@ -87,7 +87,7 @@ func dumpTable(db *gorm.DB, table interface{}, w io.Writer) error { return errors.Wrap(err, "encode JSON") } } - return nil + return rows.Err() } func dumpLegacyTables(dirPath string, verbose bool) error { diff --git a/internal/db/migrations/v13.go b/internal/db/migrations/v13.go index 1097956eb..b5bd3c21c 100644 --- a/internal/db/migrations/v13.go +++ b/internal/db/migrations/v13.go @@ -8,9 +8,9 @@ import ( "fmt" "strings" + jsoniter "github.com/json-iterator/go" "github.com/unknwon/com" "xorm.io/xorm" - "github.com/json-iterator/go" ) func ldapUseSSLToSecurityProtocol(x *xorm.Engine) error { diff --git a/internal/db/migrations/v18.go b/internal/db/migrations/v18.go index ceeb5c7ac..760ab4e35 100644 --- a/internal/db/migrations/v18.go +++ b/internal/db/migrations/v18.go @@ -20,15 +20,15 @@ func updateRepositoryDescriptionField(x *xorm.Engine) error { return nil } switch { - case conf.UseMySQL: - _, err = x.Exec("ALTER TABLE `repository` MODIFY `description` VARCHAR(512);") - case conf.UseMSSQL: - _, err = x.Exec("ALTER TABLE `repository` ALTER COLUMN `description` VARCHAR(512);") - case conf.UsePostgreSQL: - _, err = x.Exec("ALTER TABLE `repository` ALTER COLUMN `description` TYPE VARCHAR(512);") - case conf.UseSQLite3: - // Sqlite3 uses TEXT type by default for any string type field. - // Keep this comment to mention that we don't missed any option. + case conf.UseMySQL: + _, err = x.Exec("ALTER TABLE `repository` MODIFY `description` VARCHAR(512);") + case conf.UseMSSQL: + _, err = x.Exec("ALTER TABLE `repository` ALTER COLUMN `description` VARCHAR(512);") + case conf.UsePostgreSQL: + _, err = x.Exec("ALTER TABLE `repository` ALTER COLUMN `description` TYPE VARCHAR(512);") + case conf.UseSQLite3: + // Sqlite3 uses TEXT type by default for any string type field. + // Keep this comment to mention that we don't missed any option. } return err } diff --git a/internal/db/models.go b/internal/db/models.go index ed7fe7bcc..145003d28 100644 --- a/internal/db/models.go +++ b/internal/db/models.go @@ -224,7 +224,7 @@ func GetStatistic() (stats Statistic) { stats.Counter.HookTask, _ = x.Count(new(HookTask)) stats.Counter.Team, _ = x.Count(new(Team)) stats.Counter.Attachment, _ = x.Count(new(Attachment)) - return + return stats } func Ping() error { diff --git a/internal/db/perms.go b/internal/db/perms.go index 129f2187b..195ab3b9a 100644 --- a/internal/db/perms.go +++ b/internal/db/perms.go @@ -6,7 +6,7 @@ package db import ( "github.com/jinzhu/gorm" - "github.com/t-tiger/gorm-bulk-insert" + gormbulk "github.com/t-tiger/gorm-bulk-insert" log "unknwon.dev/clog/v2" ) diff --git a/internal/db/ssh_key.go b/internal/db/ssh_key.go index 49cee17af..1428f167a 100644 --- a/internal/db/ssh_key.go +++ b/internal/db/ssh_key.go @@ -221,7 +221,7 @@ func SSHKeyGenParsePublicKey(key string) (string, int, error) { func SSHNativeParsePublicKey(keyLine string) (string, int, error) { fields := strings.Fields(keyLine) if len(fields) < 2 { - return "", 0, fmt.Errorf("not enough fields in public key line: %s", string(keyLine)) + return "", 0, fmt.Errorf("not enough fields in public key line: %s", keyLine) } raw, err := base64.StdEncoding.DecodeString(fields[1]) diff --git a/internal/db/two_factors.go b/internal/db/two_factors.go index aa90c2ff1..241739aab 100644 --- a/internal/db/two_factors.go +++ b/internal/db/two_factors.go @@ -12,7 +12,7 @@ import ( "github.com/jinzhu/gorm" "github.com/pkg/errors" - "github.com/t-tiger/gorm-bulk-insert" + gormbulk "github.com/t-tiger/gorm-bulk-insert" log "unknwon.dev/clog/v2" "gogs.io/gogs/internal/cryptoutil" diff --git a/internal/db/webhook.go b/internal/db/webhook.go index 080b73fd3..e64db14f4 100644 --- a/internal/db/webhook.go +++ b/internal/db/webhook.go @@ -14,7 +14,7 @@ import ( "strings" "time" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" gouuid "github.com/satori/go.uuid" log "unknwon.dev/clog/v2" "xorm.io/xorm" diff --git a/internal/db/webhook_dingtalk.go b/internal/db/webhook_dingtalk.go index e747ae140..88246ca9d 100644 --- a/internal/db/webhook_dingtalk.go +++ b/internal/db/webhook_dingtalk.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" "github.com/gogs/git-module" api "github.com/gogs/go-gogs-client" @@ -18,7 +18,7 @@ const ( DingtalkNotificationTitle = "Gogs Notification" ) -//Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1 +// Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1 type DingtalkActionCard struct { Title string `json:"title"` Text string `json:"text"` @@ -28,13 +28,13 @@ type DingtalkActionCard struct { SingleURL string `json:"singleURL"` } -//Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1 +// Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1 type DingtalkAtObject struct { AtMobiles []string `json:"atMobiles"` IsAtAll bool `json:"isAtAll"` } -//Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1 +// Refer: https://open-doc.dingtalk.com/docs/doc.htm?treeId=257&articleId=105735&docType=1 type DingtalkPayload struct { MsgType string `json:"msgtype"` At DingtalkAtObject `json:"at"` @@ -57,7 +57,7 @@ func NewDingtalkActionCard(singleTitle, singleURL string) DingtalkActionCard { } } -//TODO: add content +// TODO: add content func GetDingtalkPayload(p api.Payloader, event HookEventType) (payload *DingtalkPayload, err error) { switch event { case HOOK_EVENT_CREATE: @@ -255,7 +255,7 @@ func getDingtalkReleasePayload(p *api.ReleasePayload) (*DingtalkPayload, error) return &DingtalkPayload{MsgType: "actionCard", ActionCard: actionCard}, nil } -//Format link addr and title into markdown style +// Format link addr and title into markdown style func MarkdownLinkFormatter(link, text string) string { return "[" + text + "](" + link + ")" } diff --git a/internal/db/webhook_discord.go b/internal/db/webhook_discord.go index 4725f867b..f149b11e1 100644 --- a/internal/db/webhook_discord.go +++ b/internal/db/webhook_discord.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" "github.com/gogs/git-module" api "github.com/gogs/go-gogs-client" diff --git a/internal/db/webhook_slack.go b/internal/db/webhook_slack.go index f824e9bcd..a42fb8d80 100644 --- a/internal/db/webhook_slack.go +++ b/internal/db/webhook_slack.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" "github.com/gogs/git-module" api "github.com/gogs/go-gogs-client" diff --git a/internal/httplib/httplib.go b/internal/httplib/httplib.go index 19f54ce6d..a09bd849f 100644 --- a/internal/httplib/httplib.go +++ b/internal/httplib/httplib.go @@ -24,7 +24,7 @@ import ( "sync" "time" - "github.com/json-iterator/go" + jsoniter "github.com/json-iterator/go" ) var defaultSetting = Settings{false, "GogsServer", 60 * time.Second, 60 * time.Second, nil, nil, nil, false} @@ -270,7 +270,7 @@ func (r *Request) getResponse() (*http.Response, error) { if err != nil { log.Fatal(err) } - //iocopy + // iocopy _, err = io.Copy(fileWriter, fh) _ = fh.Close() if err != nil { diff --git a/internal/markup/markup.go b/internal/markup/markup.go index e82a74d64..ae19ddeb5 100644 --- a/internal/markup/markup.go +++ b/internal/markup/markup.go @@ -216,7 +216,7 @@ func wrapImgWithLink(urlPrefix string, buf *bytes.Buffer, token html.Token) { buf.WriteString(`">`) if needPrepend { - src = strings.Replace(urlPrefix+string(src), " ", "%20", -1) + src = strings.Replace(urlPrefix+src, " ", "%20", -1) buf.WriteString(`