Skip to content

Commit 2fccbe8

Browse files
committed
Merge branch 'master' into fix-13175-switch-to-report-errors-on-checking-exists
2 parents 7cd5cad + 00ec651 commit 2fccbe8

File tree

787 files changed

+107205
-14493
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

787 files changed

+107205
-14493
lines changed

.drone.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,28 @@ steps:
667667
exclude:
668668
- pull_request
669669

670+
- name: publish-rootless
671+
pull: always
672+
image: plugins/docker:linux-amd64
673+
settings:
674+
dockerfile: Dockerfile.rootless
675+
auto_tag: true
676+
auto_tag_suffix: linux-amd64-rootless
677+
repo: gitea/gitea
678+
build_args:
679+
- GOPROXY=off
680+
password:
681+
from_secret: docker_password
682+
username:
683+
from_secret: docker_username
684+
environment:
685+
PLUGIN_MIRROR:
686+
from_secret: plugin_mirror
687+
when:
688+
event:
689+
exclude:
690+
- pull_request
691+
670692
---
671693
kind: pipeline
672694
name: docker-linux-arm64-dry-run
@@ -696,6 +718,9 @@ steps:
696718
tags: linux-arm64
697719
build_args:
698720
- GOPROXY=off
721+
environment:
722+
PLUGIN_MIRROR:
723+
from_secret: plugin_mirror
699724
when:
700725
event:
701726
- pull_request
@@ -740,6 +765,31 @@ steps:
740765
from_secret: docker_password
741766
username:
742767
from_secret: docker_username
768+
environment:
769+
PLUGIN_MIRROR:
770+
from_secret: plugin_mirror
771+
when:
772+
event:
773+
exclude:
774+
- pull_request
775+
776+
- name: publish-rootless
777+
pull: always
778+
image: plugins/docker:linux-arm64
779+
settings:
780+
dockerfile: Dockerfile.rootless
781+
auto_tag: true
782+
auto_tag_suffix: linux-arm64-rootless
783+
repo: gitea/gitea
784+
build_args:
785+
- GOPROXY=off
786+
password:
787+
from_secret: docker_password
788+
username:
789+
from_secret: docker_username
790+
environment:
791+
PLUGIN_MIRROR:
792+
from_secret: plugin_mirror
743793
when:
744794
event:
745795
exclude:
@@ -754,6 +804,18 @@ platform:
754804
arch: amd64
755805

756806
steps:
807+
- name: manifest-rootless
808+
pull: always
809+
image: plugins/manifest
810+
settings:
811+
auto_tag: true
812+
ignore_missing: true
813+
spec: docker/manifest.rootless.tmpl
814+
password:
815+
from_secret: docker_password
816+
username:
817+
from_secret: docker_username
818+
757819
- name: manifest
758820
pull: always
759821
image: plugins/manifest

.eslintrc

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ parserOptions:
1111
plugins:
1212
- eslint-plugin-unicorn
1313
- eslint-plugin-import
14+
- eslint-plugin-vue
15+
16+
extends:
17+
- plugin:vue/recommended
1418

1519
env:
1620
es2021: true
@@ -24,7 +28,7 @@ globals:
2428
u2fApi: false
2529

2630
overrides:
27-
- files: ["web_src/**/*.js"]
31+
- files: ["web_src/**/*.js", "web_src/**/*.vue"]
2832
env:
2933
browser: true
3034
jquery: true
@@ -99,7 +103,7 @@ rules:
99103
import/no-amd: [0]
100104
import/no-anonymous-default-export: [0]
101105
import/no-commonjs: [0]
102-
import/no-cycle: [0]
106+
import/no-cycle: [2, {ignoreExternal: true}]
103107
import/no-default-export: [0]
104108
import/no-deprecated: [0]
105109
import/no-dynamic-require: [0]
@@ -117,7 +121,7 @@ rules:
117121
import/no-self-import: [2]
118122
import/no-unassigned-import: [0]
119123
import/no-unresolved: [2, {commonjs: true}]
120-
import/no-unused-modules: [0]
124+
import/no-unused-modules: [2, {unusedExports: true}]
121125
import/no-useless-path-segments: [2, {commonjs: true}]
122126
import/no-webpack-loader-syntax: [2]
123127
import/order: [0]
@@ -211,7 +215,7 @@ rules:
211215
no-mixed-operators: [0]
212216
no-mixed-spaces-and-tabs: [2]
213217
no-multi-assign: [0]
214-
no-multi-spaces: [2, {ignoreEOLComments: true, exceptions: {Property: true, VariableDeclarator: true}}]
218+
no-multi-spaces: [2, {ignoreEOLComments: true, exceptions: {Property: true}}]
215219
no-multi-str: [2]
216220
no-negated-condition: [0]
217221
no-nested-ternary: [0]
@@ -336,6 +340,7 @@ rules:
336340
unicorn/explicit-length-check: [0]
337341
unicorn/filename-case: [0]
338342
unicorn/import-index: [0]
343+
unicorn/import-style: [0]
339344
unicorn/new-for-builtins: [2]
340345
unicorn/no-abusive-eslint-disable: [0]
341346
unicorn/no-array-instanceof: [0]
@@ -356,11 +361,13 @@ rules:
356361
unicorn/no-useless-undefined: [0]
357362
unicorn/no-zero-fractions: [2]
358363
unicorn/number-literal-case: [0]
364+
unicorn/numeric-separators-style: [0]
359365
unicorn/prefer-add-event-listener: [2]
360366
unicorn/prefer-array-find: [2]
361367
unicorn/prefer-dataset: [2]
362368
unicorn/prefer-event-key: [2]
363369
unicorn/prefer-includes: [2]
370+
unicorn/prefer-math-trunc: [2]
364371
unicorn/prefer-modern-dom-apis: [0]
365372
unicorn/prefer-negative-index: [2]
366373
unicorn/prefer-node-append: [0]
@@ -374,6 +381,7 @@ rules:
374381
unicorn/prefer-spread: [0]
375382
unicorn/prefer-starts-ends-with: [2]
376383
unicorn/prefer-string-slice: [0]
384+
unicorn/prefer-ternary: [0]
377385
unicorn/prefer-text-content: [2]
378386
unicorn/prefer-trim-start-end: [2]
379387
unicorn/prefer-type-error: [0]
@@ -383,6 +391,11 @@ rules:
383391
use-isnan: [2]
384392
valid-typeof: [2, {requireStringLiterals: true}]
385393
vars-on-top: [0]
394+
vue/attributes-order: [0]
395+
vue/component-definition-name-casing: [0]
396+
vue/html-closing-bracket-spacing: [0]
397+
vue/max-attributes-per-line: [0]
398+
vue/one-component-per-file: [0]
386399
wrap-iife: [2, inside]
387400
wrap-regex: [0]
388401
yield-star-spacing: [2, after]

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* text=auto eol=lf
22
/vendor/** -text -eol linguist-vendored
33
/public/vendor/** -text -eol linguist-vendored
4+
/templates/**/*.tmpl linguist-language=Handlebars

.github/issue_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
- Gitea version (or commit ref):
1313
- Git version:
1414
- Operating system:
15+
<!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package -->
16+
<!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. --->
17+
<!-- If you are using a package or systemd tell us what distribution you are using -->
1518
- Database (use `[x]`):
1619
- [ ] PostgreSQL
1720
- [ ] MySQL
@@ -21,6 +24,9 @@
2124
- [ ] Yes (provide example URL)
2225
- [ ] No
2326
- Log gist:
27+
<!-- It really is important to provide pertinent logs -->
28+
<!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems -->
29+
<!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini -->
2430

2531
## Description
2632

.github/lock.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
2+
3+
# Number of days of inactivity before a closed issue or pull request is locked
4+
daysUntilLock: 60
5+
6+
# Skip issues and pull requests created before a given timestamp. Timestamp must
7+
# follow ISO 8601 (`YYYY-MM-DD`). `false` is disabled
8+
skipCreatedBefore: false
9+
10+
# Issues and pull requests with these labels will be ignored.
11+
exemptLabels: []
12+
13+
# Label to add before locking, such as `outdated`. `false` is disabled
14+
lockLabel: false
15+
16+
# Comment to post before locking.
17+
lockComment: >
18+
This thread has been automatically locked since there has not been
19+
any recent activity after it was closed. Please open a new issue for
20+
related bugs and link to relevant comments in this thread.
21+
22+
# Assign `resolved` as the reason for locking. Set to `false` to disable
23+
setLockReason: true

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,17 @@ coverage.all
8080
/public/css
8181
/public/fonts
8282
/public/img/webpack
83-
/web_src/fomantic/build
83+
/web_src/fomantic/build/*
84+
!/web_src/fomantic/build/semantic.js
85+
!/web_src/fomantic/build/semantic.css
86+
!/web_src/fomantic/build/themes
87+
/web_src/fomantic/build/themes/*
88+
!/web_src/fomantic/build/themes/default
89+
/web_src/fomantic/build/themes/default/assets/*
90+
!/web_src/fomantic/build/themes/default/assets/fonts
91+
/web_src/fomantic/build/themes/default/assets/fonts/*
92+
!/web_src/fomantic/build/themes/default/assets/fonts/icons.woff2
93+
!/web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2
8494
/VERSION
8595
/.air
8696

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ issues:
7070
- path: modules/log/
7171
linters:
7272
- errcheck
73-
- path: routers/routes/routes.go
73+
- path: routers/routes/macaron.go
7474
linters:
7575
- dupl
7676
- path: routers/api/v1/repo/issue_subscription.go

.stylelintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ rules:
1111
no-descending-specificity: null
1212
number-leading-zero: never
1313
rule-empty-line-before: null
14-
selector-pseudo-element-colon-notation: null
14+
selector-pseudo-element-colon-notation: double
1515
shorthand-property-no-redundant-values: true

Dockerfile.rootless

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
###################################
3+
#Build stage
4+
FROM golang:1.15-alpine3.12 AS build-env
5+
6+
ARG GOPROXY
7+
ENV GOPROXY ${GOPROXY:-direct}
8+
9+
ARG GITEA_VERSION
10+
ARG TAGS="sqlite sqlite_unlock_notify"
11+
ENV TAGS "bindata timetzdata $TAGS"
12+
ARG CGO_EXTRA_CFLAGS
13+
14+
#Build deps
15+
RUN apk --no-cache add build-base git nodejs npm
16+
17+
#Setup repo
18+
COPY . ${GOPATH}/src/code.gitea.io/gitea
19+
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
20+
21+
#Checkout version if set
22+
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
23+
&& make clean-all build
24+
25+
FROM alpine:3.12
26+
LABEL maintainer="[email protected]"
27+
28+
EXPOSE 2222 3000
29+
30+
RUN apk --no-cache add \
31+
bash \
32+
ca-certificates \
33+
gettext \
34+
git \
35+
gnupg
36+
37+
RUN addgroup \
38+
-S -g 1000 \
39+
git && \
40+
adduser \
41+
-S -H -D \
42+
-h /var/lib/gitea/git \
43+
-s /bin/bash \
44+
-u 1000 \
45+
-G git \
46+
git && \
47+
echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd
48+
49+
RUN mkdir -p /var/lib/gitea /etc/gitea
50+
RUN chown git:git /var/lib/gitea /etc/gitea
51+
52+
COPY docker/rootless /
53+
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /usr/local/bin/gitea
54+
55+
USER git:git
56+
ENV GITEA_WORK_DIR /var/lib/gitea
57+
ENV GITEA_CUSTOM /var/lib/gitea/custom
58+
ENV GITEA_TEMP /tmp/gitea
59+
#TODO add to docs the ability to define the ini to load (usefull to test and revert a config)
60+
ENV GITEA_APP_INI /etc/gitea/app.ini
61+
ENV HOME "/var/lib/gitea/git"
62+
VOLUME ["/var/lib/gitea", "/etc/gitea"]
63+
WORKDIR /var/lib/gitea
64+
65+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
66+
CMD []
67+

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ FOMANTIC_CONFIGS := semantic.json web_src/fomantic/theme.config.less web_src/fom
9494
FOMANTIC_DEST := web_src/fomantic/build/semantic.js web_src/fomantic/build/semantic.css
9595
FOMANTIC_DEST_DIR := web_src/fomantic/build
9696

97-
WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f) $(FOMANTIC_DEST)
97+
WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f)
9898
WEBPACK_CONFIGS := webpack.config.js
9999
WEBPACK_DEST := public/js/index.js public/css/index.css
100100
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack public/serviceworker.js
@@ -210,7 +210,7 @@ node-check:
210210

211211
.PHONY: clean-all
212212
clean-all: clean
213-
rm -rf $(WEBPACK_DEST_ENTRIES) $(FOMANTIC_DEST_DIR)
213+
rm -rf $(WEBPACK_DEST_ENTRIES)
214214

215215
.PHONY: clean
216216
clean:
@@ -312,8 +312,8 @@ lint: lint-frontend lint-backend
312312

313313
.PHONY: lint-frontend
314314
lint-frontend: node_modules
315-
npx eslint web_src/js build webpack.config.js
316-
npx stylelint web_src/less
315+
npx eslint --max-warnings=0 web_src/js build webpack.config.js
316+
npx stylelint --max-warnings=0 web_src/less
317317

318318
.PHONY: lint-backend
319319
lint-backend: golangci-lint revive vet
@@ -323,7 +323,7 @@ watch:
323323
bash tools/watch.sh
324324

325325
.PHONY: watch-frontend
326-
watch-frontend: node-check $(FOMANTIC_DEST) node_modules
326+
watch-frontend: node-check node_modules
327327
rm -rf $(WEBPACK_DEST_ENTRIES)
328328
NODE_ENV=development npx webpack --hide-modules --display-entrypoints=false --watch --progress
329329

@@ -541,7 +541,7 @@ install: $(wildcard *.go)
541541
build: frontend backend
542542

543543
.PHONY: frontend
544-
frontend: node-check $(FOMANTIC_DEST) $(WEBPACK_DEST)
544+
frontend: node-check $(WEBPACK_DEST)
545545

546546
.PHONY: backend
547547
backend: go-check generate $(EXECUTABLE)
@@ -638,8 +638,8 @@ fomantic: $(FOMANTIC_DEST)
638638

639639
$(FOMANTIC_DEST): $(FOMANTIC_CONFIGS) | node_modules
640640
rm -rf $(FOMANTIC_DEST_DIR)
641-
cp web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config
642-
cp -r web_src/fomantic/_site/* node_modules/fomantic-ui/src/_site/
641+
cp -f web_src/fomantic/theme.config.less node_modules/fomantic-ui/src/theme.config
642+
cp -rf web_src/fomantic/_site/* node_modules/fomantic-ui/src/_site/
643643
npx gulp -f node_modules/fomantic-ui/gulpfile.js build
644644
@touch $(FOMANTIC_DEST)
645645

0 commit comments

Comments
 (0)