Browse Source

Merge pull request #4 from LILiK-117bis/fix_gogs

fix gogs startup issues, enhance readability for gogs role
services
Edoardo Putti 8 years ago
parent
commit
8db1983251
2 changed files with 22 additions and 11 deletions
  1. +15
    -4
      roles/gogs/tasks/main.yaml
  2. +7
    -7
      roles/gogs/templates/app.ini

+ 15
- 4
roles/gogs/tasks/main.yaml View File

@ -1,12 +1,21 @@
- name: Generate database password
gen_passwd: length=20
register: db_password
- name: Generate random gogs password
gen_passwd: length=20
register: gogs_password
- block:
- postgresql_db: name=gogs
- postgresql_db:
# database name
name=gogs
state=present
- postgresql_user:
# the user
name: gogs
password: "{{ db_password.passwd }}"
# which db owns
db: gogs
# privileges on gogs db
priv: ALL
become: true
become_method: su
@ -23,9 +32,11 @@
apt_repository: repo='deb https://deb.packager.io/gh/pkgr/gogs jessie pkgr' state=present
- name: Install Gogs
apt: name=gogs update_cache=yes
- name: Custom Gogs configuration directory
file: path=/etc/gogs/custom/conf state=directory
- name: Copy Gogs configuration
template: dest=/etc/gogs/custom/conf/app.ini src=app.ini owner=gogs group=gogs
template:
dest=/etc/gogs/conf/app.ini
src=templates/app.ini
owner=gogs
group=gogs
- name: Start at boot
service: name=gogs state=started enabled=yes

+ 7
- 7
roles/gogs/templates/app.ini View File

@ -59,7 +59,7 @@ LOCAL_ROOT_URL = http://localhost:%(HTTP_PORT)s/
; Disable SSH feature when not available
DISABLE_SSH = false
; Whether use builtin SSH server or not. false default
START_SSH_SERVER = true
START_SSH_SERVER = false
; Domain name to be exposed in clone URL
SSH_DOMAIN = %(DOMAIN)s
; Port number to be exposed in clone URL
@ -67,7 +67,7 @@ SSH_PORT = 22
; Port number builtin SSH server listens on
SSH_LISTEN_PORT = %(SSH_PORT)s
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
SSH_ROOT_PATH = /home/git/.ssh
SSH_ROOT_PATH = /home/gogs/.ssh
; Directory to create temporary files when test publick key using ssh-keygen,
; default is system temporary directory.
SSH_KEY_TEST_PATH =
@ -121,7 +121,7 @@ PATH = data/gogs.db
[security]
INSTALL_LOCK = false
; !!CHANGE THIS TO KEEP YOUR USER DATA SAFE!!
SECRET_KEY = !#@FDEWREWR&*(
SECRET_KEY = {{ gogs_password.passwd }}
; Auto-login remember days
LOGIN_REMEMBER_DAYS = 7
COOKIE_USERNAME = gogs_awesome
@ -166,19 +166,19 @@ SUBJECT = %(APP_NAME)s
; Gmail: smtp.gmail.com:587
; QQ: smtp.qq.com:25
; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
HOST =
HOST = smtp.lilik.it:587
; Disable HELO operation when hostname are different.
DISABLE_HELO =
; Custom hostname for HELO operation, default is from system.
HELO_HOSTNAME =
; Do not verify the certificate of the server. Only use this for self-signed certificates
SKIP_VERIFY =
SKIP_VERIFY = false
; Use client certificate
USE_CERTIFICATE = false
USE_CERTIFICATE = true
CERT_FILE = custom/mailer/cert.pem
KEY_FILE = custom/mailer/key.pem
; Mail from address, RFC 5322. This can be just an email address, or the `"Name" <email@example.com>` format
FROM =
FROM = projects@lilik.it
; Mailer user name and password
USER =
PASSWD =


Loading…
Cancel
Save