Revert back to sqlite

This commit is contained in:
Nemo 2018-04-07 17:39:23 +05:30
parent 5cbc438ff6
commit 1f515b36f0
7 changed files with 26 additions and 13 deletions

View File

@ -83,28 +83,20 @@ SSH_SERVER_MACS = hmac-sha2-512-etm@openssh.com, hmac-sha2-256-etm@openssh.com,
; TODO
; ; Either "mysql", "postgres", "mssql" or "sqlite3", it's your choice
; DB_TYPE = mysql
; HOST = 127.0.0.1:3306
DB_TYPE = sqlite3
; HOST = mariadb:3306
; NAME = gitea
; USER = root
; PASSWD =
; USER = gitea
; PASSWD = "${mysql-password}"
; ; For "postgres" only, either "disable", "require" or "verify-full"
; SSL_MODE = disable
; ; For "sqlite3" and "tidb", use absolute path when you start as service
; PATH = data/gitea.db
PATH = data/gitea.db
; ; For "sqlite3" only. Query timeout
; SQLITE_TIMEOUT = 500
; ; For iterate buffer, default is 50
; ITERATE_BUFFER_SIZE = 50
PATH = /data/gitea/gitea.db
DB_TYPE = sqlite3
HOST = localhost:3306
NAME = gitea
USER = root
PASSWD =
SSL_MODE = disable
[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER = file

View File

@ -15,5 +15,6 @@ data "template_file" "gitea-config-file" {
internal_token = "${var.internal-token}"
smtp_password = "${var.smtp-password}"
lfs-jwt-secret = "${var.lfs-jwt-secret}"
mysql-password = "${var.mysql-password}"
}
}

View File

@ -61,6 +61,7 @@ resource "docker_container" "gitea" {
must_run = true
links = [
"gitea-redis",
"mariadb",
]
}

16
gitea/mysql.tf Normal file
View File

@ -0,0 +1,16 @@
resource "mysql_database" "gitea" {
name = "gitea"
}
resource "mysql_user" "gitea" {
user = "gitea"
host = "%"
plaintext_password = "${var.mysql-password}"
}
resource "mysql_grant" "gitea" {
user = "${mysql_user.gitea.user}"
host = "${mysql_user.gitea.host}"
database = "${mysql_database.gitea.name}"
privileges = ["ALL"]
}

View File

@ -12,3 +12,4 @@ variable "secret-key" {}
variable "internal-token" {}
variable "smtp-password" {}
variable "lfs-jwt-secret" {}
variable "mysql-password" {}

View File

@ -43,6 +43,7 @@ module "gitea" {
internal-token = "${var.gitea-internal-token}"
smtp-password = "${var.gitea-smtp-password}"
lfs-jwt-secret = "${var.gitea-lfs-jwt-secret}"
mysql-password = "${var.gitea-mysql-password}"
}
module "radicale" {

View File

@ -22,6 +22,7 @@ variable "mysql_airsonic_password" {}
variable "mysql_kodi_password" {}
variable "mysql-ttrss-password" {}
variable "gitea-mysql-password" {}
variable "wiki_session_secret" {
type = "string"