-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgitea.sh
55 lines (43 loc) · 1.3 KB
/
gitea.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Declare site in YAML, as documented on the documentation: https://help.alwaysdata.com/en/marketplace/build-application-script/
# site:
# type: user_program
# working_directory: '{INSTALL_PATH_RELATIVE}'
# command: './gitea web'
# path_trim: true
# ssl_force: true
# database:
# type: postgresql
# requirements:
# disk: 115
set -e
# https://docs.gitea.io/en-us/install-from-binary/
# Download
wget --no-hsts -O gitea https://github.com/go-gitea/gitea/releases/download/v1.22.6/gitea-1.22.6-linux-amd64
chmod +x gitea
# Configuration
mkdir -p custom/conf data indexers public log
cat << EOF > custom/conf/app.ini
# More options https://docs.gitea.io/en-us/config-cheat-sheet/
RUN_MODE = prod
[server]
HTTP_ADDR = 0.0.0.0
HTTP_PORT = $PORT
ROOT_URL = https://$INSTALL_URL/
LOCAL_ROOT_URL = https://$INSTALL_URL/
ENABLE_GZIP = true
[database]
DB_TYPE = postgres
HOST = $DATABASE_HOST:5432
NAME = $DATABASE_NAME
USER = $DATABASE_USERNAME
PASSWD = \`$DATABASE_PASSWORD\`
[security]
INSTALL_LOCK = true
[mailer]
ENABLED = true
USE_SENDMAIL = true
SENDMAIL_PATH = /usr/sbin/sendmail
FROM = $USER@$RESELLER_DOMAIN
EOF
# This install does not create a Gitea admin user. The first registered user will have admin permissions and will be able to manage the instance.