-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
552 changed files
with
96,826 additions
and
11,668 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
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
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 |
---|---|---|
|
@@ -37,7 +37,6 @@ RUN apk --no-cache add \ | |
openssh \ | ||
s6 \ | ||
sqlite \ | ||
socat \ | ||
su-exec \ | ||
gnupg | ||
|
||
|
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,68 @@ | ||
|
||
################################### | ||
#Build stage | ||
FROM golang:1.15-alpine3.12 AS build-env | ||
|
||
ARG GOPROXY | ||
ENV GOPROXY ${GOPROXY:-direct} | ||
|
||
ARG GITEA_VERSION | ||
ARG TAGS="sqlite sqlite_unlock_notify" | ||
ENV TAGS "bindata timetzdata $TAGS" | ||
ARG CGO_EXTRA_CFLAGS | ||
|
||
#Build deps | ||
RUN apk --no-cache add build-base git nodejs npm | ||
|
||
#Setup repo | ||
COPY . ${GOPATH}/src/code.gitea.io/gitea | ||
WORKDIR ${GOPATH}/src/code.gitea.io/gitea | ||
|
||
#Checkout version if set | ||
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ | ||
&& make clean-all build | ||
|
||
FROM alpine:3.12 | ||
LABEL maintainer="maintainers@gitea.io" | ||
|
||
EXPOSE 2222 3000 | ||
|
||
RUN apk --no-cache add \ | ||
bash \ | ||
ca-certificates \ | ||
gettext \ | ||
git \ | ||
gnupg | ||
|
||
RUN addgroup \ | ||
-S -g 1000 \ | ||
git && \ | ||
adduser \ | ||
-S -H -D \ | ||
-h /var/lib/gitea/git \ | ||
-s /bin/bash \ | ||
-u 1000 \ | ||
-G git \ | ||
git && \ | ||
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd | ||
|
||
RUN mkdir -p /var/lib/gitea /etc/gitea | ||
RUN chown git:git /var/lib/gitea /etc/gitea | ||
|
||
COPY docker/rootless / | ||
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /usr/local/bin/gitea | ||
RUN chown root:root /usr/local/bin/* && chmod 755 /usr/local/bin/* | ||
|
||
USER git:git | ||
ENV GITEA_WORK_DIR /var/lib/gitea | ||
ENV GITEA_CUSTOM /var/lib/gitea/custom | ||
ENV GITEA_TEMP /tmp/gitea | ||
#TODO add to docs the ability to define the ini to load (usefull to test and revert a config) | ||
ENV GITEA_APP_INI /etc/gitea/app.ini | ||
ENV HOME "/var/lib/gitea/git" | ||
VOLUME ["/var/lib/gitea", "/etc/gitea"] | ||
WORKDIR /var/lib/gitea | ||
|
||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] | ||
CMD [] | ||
|
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,61 @@ | ||
// Copyright 2020 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"strings" | ||
|
||
"github.com/urfave/cli" | ||
) | ||
|
||
// CmdDocs represents the available docs sub-command. | ||
var CmdDocs = cli.Command{ | ||
Name: "docs", | ||
Usage: "Output CLI documentation", | ||
Description: "A command to output Gitea's CLI documentation, optionally to a file.", | ||
Action: runDocs, | ||
Flags: []cli.Flag{ | ||
&cli.BoolFlag{ | ||
Name: "man", | ||
Usage: "Output man pages instead", | ||
}, | ||
&cli.StringFlag{ | ||
Name: "output, o", | ||
Usage: "Path to output to instead of stdout (will overwrite if exists)", | ||
}, | ||
}, | ||
} | ||
|
||
func runDocs(ctx *cli.Context) error { | ||
docs, err := ctx.App.ToMarkdown() | ||
if ctx.Bool("man") { | ||
docs, err = ctx.App.ToMan() | ||
} | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if !ctx.Bool("man") { | ||
// Clean up markdown. The following bug was fixed in v2, but is present in v1. | ||
// It affects markdown output (even though the issue is referring to man pages) | ||
// https://github.com/urfave/cli/issues/1040 | ||
docs = docs[strings.Index(docs, "#"):] | ||
} | ||
|
||
out := os.Stdout | ||
if ctx.String("output") != "" { | ||
fi, err := os.Create(ctx.String("output")) | ||
if err != nil { | ||
return err | ||
} | ||
defer fi.Close() | ||
out = fi | ||
} | ||
|
||
_, err = fmt.Fprintln(out, docs) | ||
return err | ||
} |
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
Oops, something went wrong.