Add the support for mysql and postgres databases and documentation

This commit is contained in:
Thomas Maurice 2017-01-11 08:01:37 +01:00
parent 59d3cfc7c8
commit 9d685ab7a5
No known key found for this signature in database
GPG key ID: 81A080685D4FDB96
3 changed files with 25 additions and 9 deletions

View file

@ -89,6 +89,16 @@ The following have been tested with Debian 8, it should work on Ubuntu as well.
* `gitea_start_ssh`: Do you start the SSH server ? (true/false) * `gitea_start_ssh`: Do you start the SSH server ? (true/false)
* `gitea_ssh_port`: SSH bind port * `gitea_ssh_port`: SSH bind port
### Database configuration
* `gitea_db_type`: Database type, can be `mysql`, `postgres` or `sqlite3`
* `gitea_db_host`: Database host string `host:port`
* `gitea_db_name`: Database name
* `gitea_db_user`: Database username
* `gitea_db_passord`: Database password
* `gitea_db_ssl`: Use SSL ? (postgres only!). Can be `required`, `disable`, `verify-full`
* `gitea_db_path`: DB path, if you use `sqlite3`. The default is good enough to work though.
## Disclaimer ## Disclaimer
This module is currently a work in progress. For now it is only able to install This module is currently a work in progress. For now it is only able to install
gitea from the Github Release, in a fixed version for Linux amd64, on systems gitea from the Github Release, in a fixed version for Linux amd64, on systems
@ -97,8 +107,6 @@ using systemd.
This said, it should work on every major Linux distribution, it has been tested This said, it should work on every major Linux distribution, it has been tested
successfully on Debian Jessie 64 bits. successfully on Debian Jessie 64 bits.
Also it only supports the sqlite3 driver for now, but I'll improve soon.
## Contributing ## Contributing
Do not hesitate to make me a pull request, and when in doubt you can reach me on Do not hesitate to make me a pull request, and when in doubt you can reach me on
Twitter [@thomas_maurice](https://twitter.com/thomas_maurice). Twitter [@thomas_maurice](https://twitter.com/thomas_maurice).

View file

@ -12,6 +12,14 @@ gitea_http_port: 3000
gitea_disable_http_git: false gitea_disable_http_git: false
gitea_offline_mode: true gitea_offline_mode: true
gitea_db_type: sqlite3
gitea_db_host: 127.0.0.0:3306
gitea_db_name: root
gitea_db_user: gitea
gitea_db_passord: lel
gitea_db_ssl: disable
gitea_db_path: "{{ gitea_home }}/data/gitea.db"
gitea_ssh_listen: 0.0.0.0 gitea_ssh_listen: 0.0.0.0
gitea_ssh_domain: localhost gitea_ssh_domain: localhost
gitea_start_ssh: true gitea_start_ssh: true

View file

@ -148,15 +148,15 @@ DSA = 1024
[database] [database]
; Either "mysql", "postgres" or "sqlite3", it's your choice ; Either "mysql", "postgres" or "sqlite3", it's your choice
DB_TYPE = sqlite3 DB_TYPE = {{ gitea_db_type }}
HOST = 127.0.0.1:3306 HOST = {{ gitea_db_host }}
NAME = gitea NAME = {{ gitea_db_name }}
USER = root USER = {{ gitea_db_user }}
PASSWD = PASSWD = {{ gitea_db_passord }}
; For "postgres" only, either "disable", "require" or "verify-full" ; For "postgres" only, either "disable", "require" or "verify-full"
SSL_MODE = disable SSL_MODE = {{ gitea_db_ssl }}
; For "sqlite3" and "tidb", use absolute path when you start as service ; For "sqlite3" and "tidb", use absolute path when you start as service
PATH = {{ gitea_home }}/data/gitea.db PATH = {{ gitea_db_path }}
[admin] [admin]