Switch gitea to TLS
Gitea supports internal TLS termination as well as redirection of http to https. That may be simpler than terminating in a reverse proxy. Let's try it. Also, make the dockerfile match the expectation of the job that there will be a gitea-init stage. Also, fix the repository root setting in app.ini. Change-Id: Ia6b66b53cebdb1afa49fef89a0559615f98052f1
This commit is contained in:
parent
1c7032b859
commit
4ae46fd9c3
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
FROM opendevorg/jinja-init
|
FROM opendevorg/jinja-init as gitea-init
|
||||||
|
|
||||||
COPY entrypoint.sh /
|
COPY entrypoint.sh /
|
||||||
|
|
||||||
|
@ -21,6 +21,12 @@ chown 1000:1000 /data/git
|
|||||||
mkdir -p /data/gitea
|
mkdir -p /data/gitea
|
||||||
chown 1000:1000 /data/gitea
|
chown 1000:1000 /data/gitea
|
||||||
|
|
||||||
|
mkdir -p /data/gitea/ssl
|
||||||
|
chown 1000:1000 /data/gitea/ssl
|
||||||
|
chmod 0500 /data/gitea/ssl
|
||||||
|
cp /secrets/gitea_tls_cert /data/gitea/ssl/cert.pem
|
||||||
|
cp /secrets/gitea_tls_key /data/gitea/ssl/key.pem
|
||||||
|
|
||||||
# This one is used by openssh and can remain root-owned
|
# This one is used by openssh and can remain root-owned
|
||||||
mkdir -p /data/ssh
|
mkdir -p /data/ssh
|
||||||
|
|
||||||
|
@ -5,8 +5,9 @@ RUN_USER = git
|
|||||||
[server]
|
[server]
|
||||||
APP_DATA_PATH = /data/gitea
|
APP_DATA_PATH = /data/gitea
|
||||||
SSH_DOMAIN = localhost
|
SSH_DOMAIN = localhost
|
||||||
|
PROTOCOL = https
|
||||||
HTTP_PORT = 3000
|
HTTP_PORT = 3000
|
||||||
ROOT_URL = http://38.108.68.64/
|
ROOT_URL = https://38.108.68.64/
|
||||||
DISABLE_SSH = false
|
DISABLE_SSH = false
|
||||||
SSH_PORT = 22
|
SSH_PORT = 22
|
||||||
LFS_CONTENT_PATH = /data/git/lfs
|
LFS_CONTENT_PATH = /data/git/lfs
|
||||||
@ -14,6 +15,10 @@ DOMAIN = localhost
|
|||||||
LFS_START_SERVER = true
|
LFS_START_SERVER = true
|
||||||
LFS_JWT_SECRET = {{ lfs_jwt_secret }}
|
LFS_JWT_SECRET = {{ lfs_jwt_secret }}
|
||||||
OFFLINE_MODE = false
|
OFFLINE_MODE = false
|
||||||
|
CERT_FILE = /data/gitea/ssl/cert.pem
|
||||||
|
KEY_FILE = /data/gitea/ssl/key.pem
|
||||||
|
REDIRECT_OTHER_PORT = true
|
||||||
|
PORT_TO_REDIRECT = 3080
|
||||||
|
|
||||||
[database]
|
[database]
|
||||||
DB_TYPE = mysql
|
DB_TYPE = mysql
|
||||||
@ -24,6 +29,9 @@ PASSWD = {{ db_password }}
|
|||||||
SSL_MODE = disable
|
SSL_MODE = disable
|
||||||
LOG_SQL = false
|
LOG_SQL = false
|
||||||
|
|
||||||
|
[repository]
|
||||||
|
ROOT = /data/git/repositories
|
||||||
|
|
||||||
[indexer]
|
[indexer]
|
||||||
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
|
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve
|
||||||
REPO_INDEXER_ENABLED = true
|
REPO_INDEXER_ENABLED = true
|
||||||
@ -50,7 +58,7 @@ SECRET_KEY = {{ secret_key }}
|
|||||||
INTERNAL_TOKEN = {{ internal_token }}
|
INTERNAL_TOKEN = {{ internal_token }}
|
||||||
|
|
||||||
[service]
|
[service]
|
||||||
DISABLE_REGISTRATION = false
|
DISABLE_REGISTRATION = true
|
||||||
REQUIRE_SIGNIN_VIEW = false
|
REQUIRE_SIGNIN_VIEW = false
|
||||||
REGISTER_EMAIL_CONFIRM = false
|
REGISTER_EMAIL_CONFIRM = false
|
||||||
ENABLE_NOTIFY_MAIL = false
|
ENABLE_NOTIFY_MAIL = false
|
||||||
|
@ -34,6 +34,7 @@ spec:
|
|||||||
value: '2' # Increment to trigger a deployment.
|
value: '2' # Increment to trigger a deployment.
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
|
- containerPort: 3080
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: gitea-data
|
- name: gitea-data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
@ -10,3 +10,5 @@ stringData:
|
|||||||
lfs_jwt_secret: {{ gitea_lfs_jwt_secret }}
|
lfs_jwt_secret: {{ gitea_lfs_jwt_secret }}
|
||||||
db_username: {{ gitea_db_username }}
|
db_username: {{ gitea_db_username }}
|
||||||
db_password: {{ gitea_db_password }}
|
db_password: {{ gitea_db_password }}
|
||||||
|
gitea_tls_cert: {{ gitea_tls_cert }}
|
||||||
|
gitea_tls_key: {{ gitea_tls_key }}
|
||||||
|
@ -9,6 +9,10 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 80
|
port: 80
|
||||||
|
targetPort: 3080
|
||||||
|
name: http
|
||||||
|
- protocol: TCP
|
||||||
|
port: 443
|
||||||
targetPort: 3000
|
targetPort: 3000
|
||||||
name: http
|
name: http
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
|
Loading…
Reference in New Issue
Block a user