Update Gogs to 0.12.0

This commit is contained in:
Martchus 2020-08-24 16:07:28 +02:00
parent 1989565c2f
commit 19a9334353
3 changed files with 68 additions and 63 deletions

View File

@ -1,40 +1,26 @@
From 25d1ec73cde6321e90bb6088fd6409dd95b310fa Mon Sep 17 00:00:00 2001 From 371b5cfba7b3fa111cc24807b77b12b983f6f9b1 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net> From: Martchus <martchus@gmx.net>
Date: Sun, 19 Mar 2017 18:03:36 +0100 Date: Sun, 19 Mar 2017 18:03:36 +0100
Subject: [PATCH 1/2] Adjust config for Arch Linux package Subject: [PATCH 1/2] Adjust config for Arch Linux package
--- ---
conf/app.ini | 31 +++++++++++++++++++------------ conf/app.ini | 20 ++++++++++----------
1 file changed, 19 insertions(+), 12 deletions(-) 1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/conf/app.ini b/conf/app.ini diff --git a/conf/app.ini b/conf/app.ini
index 0c6512b17..42723cfd5 100644 index f58e60d4e..690273b38 100644
--- a/conf/app.ini --- a/conf/app.ini
+++ b/conf/app.ini +++ b/conf/app.ini
@@ -1,11 +1,18 @@ @@ -6,7 +6,7 @@
-# !!! NEVER EVER MODIFY THIS FILE !!! BRAND_NAME = Gogs
-# !!! PLEASE MAKE CHANGES ON CORRESPONDING CUSTOM CONFIG FILE !!! ; The system user who should be running the applications. It has no effect on Windows,
-# !!! IF YOU ARE PACKAGING PROVIDER, PLEASE MAKE OWN COPY OF IT !!! ; otherwise, it should match the value of $USER environment variable.
+# Feel free to modify this file!
+# In case a new version of this file is availabe, pacman will notify automatically when
+# updating and creates the new version as app.ini.pacnew. You can use diff or a similar
+# tool to see the changes between your configuration and the new default configuration.
+
+# There is also a copy of this file under /usr/share/gogs/conf/app.ini in case
+# you need to go back.
+
+# It is also possible to remove all default values and just specify what you want
+# to change because /usr/share/gogs/conf/app.ini also serves as fallback.
; App name that shows on every page title
APP_NAME = Gogs
; The name of the system user that runs Gogs
-RUN_USER = git -RUN_USER = git
+RUN_USER = gogs +RUN_USER = gogs
; Either "dev", "prod" or "test" ; The running mode of the application, can be either "dev", "prod" or "test".
RUN_MODE = dev RUN_MODE = dev
@@ -56,16 +63,16 @@ DISABLE_ROUTER_LOG = false @@ -29,8 +29,8 @@ HTTP_PORT = 3000
; not forget to export the private key): ; not forget to export the private key):
; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys ; $ openssl pkcs12 -in cert.pfx -out cert.pem -nokeys
; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes ; $ openssl pkcs12 -in cert.pfx -out key.pem -nocerts -nodes
@ -42,55 +28,72 @@ index 0c6512b17..42723cfd5 100644
-KEY_FILE = custom/https/key.pem -KEY_FILE = custom/https/key.pem
+CERT_FILE = /var/lib/gogs/cert/cert.pem +CERT_FILE = /var/lib/gogs/cert/cert.pem
+KEY_FILE = /var/lib/gogs/cert/key.pem +KEY_FILE = /var/lib/gogs/cert/key.pem
; Allowed TLS version values: SSL30, TLS10, TLS11, TLS12 ; The minimum allowed TLS version, currently supports "TLS10", "TLS11", "TLS12", and "TLS13".
TLS_MIN_VERSION = TLS10 TLS_MIN_VERSION = TLS12
; File permission when serve traffic via Unix domain socket.
@@ -48,7 +48,7 @@ DISABLE_ROUTER_LOG = true
ENABLE_GZIP = false
; Upper level of template and static file path ; The path for storing application specific data.
; default is the path where Gogs is executed
-STATIC_ROOT_PATH =
+STATIC_ROOT_PATH = /usr/share/gogs
; Default path for App data
-APP_DATA_PATH = data -APP_DATA_PATH = data
+APP_DATA_PATH = /var/lib/gogs/data +APP_DATA_PATH = /var/lib/gogs/data
; Application level GZIP support ; Whether to enable to load assets (i.e. "conf", "templates", "public") from disk instead of embedded bindata.
ENABLE_GZIP = false LOAD_ASSETS_FROM_DISK = false
; Landing page for non-logged users, can be "home" or "explore"
@@ -73,7 +80,7 @@ LANDING_PAGE = home @@ -91,7 +91,7 @@ DSA = 1024
[repository] [repository]
; Root path for storing repositories's data, default is "~/<username>/gogs-repositories" ; The root path for storing managed repositories, default is "~/gogs-repositories"
-ROOT = -ROOT =
+ROOT = /var/lib/gogs/repos +ROOT = /var/lib/gogs/repos
; The script type server supports, sometimes could be "sh" ; The script type server supports, sometimes could be "sh".
SCRIPT_TYPE = bash SCRIPT_TYPE = bash
; Default ANSI charset for an unrecognized charset ; Default ANSI charset for an unrecognized charset.
@@ -113,7 +120,7 @@ PREVIEWABLE_FILE_MODES = markdown @@ -126,7 +126,7 @@ PREVIEWABLE_FILE_MODES = markdown
; Enable repository file uploads. ; Whether to enable repository file uploads.
ENABLED = true ENABLED = true
; Path to temporarily store uploads (default path gets cleaned by Gogs in every start) ; The path to temporarily store uploads (content under this path gets wiped out on every start).
-TEMP_PATH = data/tmp/uploads -TEMP_PATH = data/tmp/uploads
+TEMP_PATH = /var/cache/gogs +TEMP_PATH = /var/cache/gogs
; File types that are allowed to be uploaded, e.g. image/jpeg|image/png. Leave empty means allow any file type ; File types that are allowed to be uploaded, e.g. "image/jpeg|image/png". Leave empty to allow any file type.
ALLOWED_TYPES = ALLOWED_TYPES =
; Maximum size of each file in MB ; The maximum size of each file in MB.
@@ -172,7 +179,7 @@ PASSWD = @@ -145,7 +145,7 @@ PASSWORD =
; For "postgres" only, either "disable", "require" or "verify-full" ; For "postgres" only, either "disable", "require" or "verify-full".
SSL_MODE = disable SSL_MODE = disable
; For "sqlite3" and "tidb", use absolute path when you start as service ; For "sqlite3" only, make sure to use absolute path.
-PATH = data/gogs.db -PATH = data/gogs.db
+PATH = /var/lib/gogs/gogs.db +PATH = /var/lib/gogs/gogs.db
; The maximum open connections of the pool.
MAX_OPEN_CONNS = 30
; The maximum idle connections of the pool.
@@ -273,7 +273,7 @@ OBJECTS_PATH = data/lfs-objects
; Whether to enabled upload attachments in general.
ENABLED = true
; The path to store attachments on the file system.
-PATH = data/attachments
+PATH = /var/lib/gogs/attachments
; File types that are allowed to be uploaded, e.g. "image/jpeg|image/png". Leave empty to allow any file type.
ALLOWED_TYPES = image/jpeg|image/png
; The maximum size of each file in MB.
@@ -300,7 +300,7 @@ FORMAT = RFC1123
[admin] [picture]
; Disable regular (non-admin) users to create organizations ; The path to store user avatars on the file system.
@@ -319,7 +326,7 @@ FORMAT = -AVATAR_UPLOAD_PATH = data/avatars
+AVATAR_UPLOAD_PATH = /var/lib/gogs/avatars
; General settings of loggers ; The path to store repository avatars on the file system.
REPOSITORY_AVATAR_UPLOAD_PATH = data/repo-avatars
; Chinese users can use a custom avatar source, such as http://cn.gravatar.com/avatar/.
@@ -347,7 +347,7 @@ PAGING_NUM = 10
; General settings of loggers.
[log] [log]
; The root path for all log files, default is "log/" subdirectory.
-ROOT_PATH = -ROOT_PATH =
+ROOT_PATH = /var/log/gogs +ROOT_PATH = /var/log/gogs
; Can be "console" and "file", default is "console" ; Can be "console", "file", "slack" and "discord".
; Use comma to separate multiple modes, e.g. "console, file" ; Use comma to separate multiple modes, e.g. "console, file"
MODE = console MODE = console
-- --
2.19.0 2.28.0

View File

@ -1,4 +1,4 @@
From 4ba92ebea6847998ef6c9183062004ba98b6d945 Mon Sep 17 00:00:00 2001 From 9fdb1880402d6c1712eb2fe6624a59279be01add Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net> From: Martchus <martchus@gmx.net>
Date: Sun, 19 Mar 2017 18:04:48 +0100 Date: Sun, 19 Mar 2017 18:04:48 +0100
Subject: [PATCH 2/2] Adjust service file for Arch Linux package Subject: [PATCH 2/2] Adjust service file for Arch Linux package
@ -8,7 +8,7 @@ Subject: [PATCH 2/2] Adjust service file for Arch Linux package
1 file changed, 5 insertions(+), 5 deletions(-) 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/systemd/gogs.service b/scripts/systemd/gogs.service diff --git a/scripts/systemd/gogs.service b/scripts/systemd/gogs.service
index 3a89662a8..790a94e80 100644 index 3a89662a8..aeb7bbbc3 100644
--- a/scripts/systemd/gogs.service --- a/scripts/systemd/gogs.service
+++ b/scripts/systemd/gogs.service +++ b/scripts/systemd/gogs.service
@@ -12,12 +12,12 @@ After=mariadb.service mysqld.service postgresql.service memcached.service redis. @@ -12,12 +12,12 @@ After=mariadb.service mysqld.service postgresql.service memcached.service redis.
@ -25,10 +25,10 @@ index 3a89662a8..790a94e80 100644
+ExecStart=/usr/bin/gogs web --config /etc/gogs/app.ini +ExecStart=/usr/bin/gogs web --config /etc/gogs/app.ini
Restart=always Restart=always
-Environment=USER=git HOME=/home/git -Environment=USER=git HOME=/home/git
+Environment=USER=gogs HOME=/var/lib/gogs GOGS_CUSTOM=/var/lib/gogs/custom +Environment=USER=gogs HOME=/var/lib/gogs
# Some distributions may not support these hardening directives. If you cannot start the service due # Some distributions may not support these hardening directives. If you cannot start the service due
# to an unknown option, comment out the ones not supported by your version of systemd. # to an unknown option, comment out the ones not supported by your version of systemd.
-- --
2.19.0 2.28.0

View File

@ -10,7 +10,7 @@ _confdir=conf
_scriptsdir=scripts _scriptsdir=scripts
pkgname=$_pkgname pkgname=$_pkgname
pkgver=0.11.91 pkgver=0.12.0
pkgrel=1 pkgrel=1
epoch=1 epoch=1
pkgdesc='Self Hosted Git Service written in Go' pkgdesc='Self Hosted Git Service written in Go'
@ -31,9 +31,9 @@ backup=("etc/$_pkgname/app.ini")
source=("$_pkgname-$pkgver::https://github.com/$_orga/$_pkgname/archive/v${pkgver}.tar.gz" source=("$_pkgname-$pkgver::https://github.com/$_orga/$_pkgname/archive/v${pkgver}.tar.gz"
'0001-Adjust-config-for-Arch-Linux-package.patch' '0001-Adjust-config-for-Arch-Linux-package.patch'
'0002-Adjust-service-file-for-Arch-Linux-package.patch') '0002-Adjust-service-file-for-Arch-Linux-package.patch')
sha512sums=('9c92d198f48e879a783f0e2e066db946a67a52d6ce3429a9ffeb531c53657b0dd81962e3e1e7fac0871eb9689c94538c9678d6cf56360b670ea020951c995dbb' sha512sums=('e682df4609e47d7db60a9cec19cf771c372b5028ae3ed43dd8fa0cfcd8292f13cfc833c50698bb5cd0872fabb472b0ee84f3f0ba45ab559d84b39cd7d9519770'
'b1ae473eba5bfb693e507ce82f2a81beb066ab5869d8d089963f8d4740cc77e203b8653cbeeb196a86e65d04e2a288056fb3196364e247dd11906b77fd7ace8b' '763ea6857a2bd28d1e6d95f58d67de0503b3f36ee1419dd1efce6ae187d7f529e4f1674b160a5902f16bc180983f3b29bcbe4ec8fc3c0d32de7374939ea364c5'
'71c38f86b3e351f8f69504835082618cf5f63897246ee0691f1b7d518e164bd68681e14134e97fcfb369c960c6a81da92c86bc40b5c9ee6f171af1f1a1a7e8a4') '162c9dd3b5c5f2910b3887109d460dcb82631b2e5b8d906699e5a581c3350a9b0511ccc470621828f8839ad7bac240439d01461ae5fb3efdee948307ef195c2d')
_goroot='/usr/lib/go' _goroot='/usr/lib/go'
prepare() { prepare() {
@ -102,8 +102,10 @@ package() {
mkdir -p "$pkgdir/usr/share/${_pkgname}" mkdir -p "$pkgdir/usr/share/${_pkgname}"
cp -r "$srcdir/build/src/${_gourl}/${_confdir}" "$pkgdir/usr/share/${_pkgname}" cp -r "$srcdir/build/src/${_gourl}/${_confdir}" "$pkgdir/usr/share/${_pkgname}"
cp -r "$srcdir/build/src/${_gourl}/public" "$pkgdir/usr/share/${_pkgname}" if [[ $pkgname != 'gogs' ]]; then
cp -r "$srcdir/build/src/${_gourl}/templates" "$pkgdir/usr/share/${_pkgname}" cp -r "$srcdir/build/src/${_gourl}/public" "$pkgdir/usr/share/${_pkgname}"
cp -r "$srcdir/build/src/${_gourl}/templates" "$pkgdir/usr/share/${_pkgname}"
fi
mkdir -p "$pkgdir/etc/$_pkgname" mkdir -p "$pkgdir/etc/$_pkgname"
chmod 775 "$pkgdir/etc/$_pkgname" chmod 775 "$pkgdir/etc/$_pkgname"