Редактирование файла конфига repko
This commit is contained in:
parent
0ac19f6c8f
commit
1a71525075
1 changed files with 45 additions and 10 deletions
|
|
@ -215,6 +215,18 @@ sections:
|
|||
variable-name: "server_address"
|
||||
field-type: "input"
|
||||
description: "Адрес сервера"
|
||||
validate:
|
||||
- rule: "regex_match(server_address,`^[a-zA-Z.-]+:[0-9]+$`)"
|
||||
message: "Неверный формат, host:port, host только латиница,цифры, тире, '.', port только цифры"
|
||||
- rule: "port_free( regex(server_address, `^.*:([0-9]+)$`, `$1`) )"
|
||||
message: "Порт занят"
|
||||
- name: "trusted_proxy"
|
||||
variable-name: "trusted_proxy"
|
||||
description: "Доверенные прокси"
|
||||
field-type: "compute"
|
||||
parent:
|
||||
- "server_address"
|
||||
compute: split(server_address,":")[0]
|
||||
- name: "ssl"
|
||||
description: "Настройка ssl"
|
||||
condition: "is_secure == true"
|
||||
|
|
@ -262,7 +274,7 @@ sections:
|
|||
condition: "ssl_type == 'self-signed'"
|
||||
run-as: "root"
|
||||
error: "Ошибка при создании директории для сертификатов"
|
||||
- name: "generate_self_signed"
|
||||
- name: "generate_self_signed" #тут
|
||||
type: "command"
|
||||
command: |
|
||||
openssl req -x509 -nodes -days 365 \
|
||||
|
|
@ -272,7 +284,17 @@ sections:
|
|||
-subj "/CN={{api_domain}}"
|
||||
condition: "ssl_type == 'self-signed'"
|
||||
run-as: "root"
|
||||
error: "Ошибка при генерации самоподписанного сертификата"
|
||||
error: "Не удалось сгенерировать сертификат через openssl"
|
||||
- name: "Set owner for key"
|
||||
type: "command"
|
||||
command: "chown root:root {{.ssl_key_path}}"
|
||||
condition: "ssl_type == 'self-signed'"
|
||||
error: "Ошибка установки владельца ключа"
|
||||
- name: "Set rights 600 for key"
|
||||
type: "command"
|
||||
command: "chmod 600 {{.ssl_key_path}}"
|
||||
condition: "ssl_type == 'self-signed'"
|
||||
error: "Ошибка установки прав ключа"
|
||||
- name: "run_certbot"
|
||||
type: "command"
|
||||
command: "certbot --nginx -d {{api_domain}} -d {{panel_domain}} --non-interactive --agree-tos -m admin@{{api_domain}}"
|
||||
|
|
@ -282,14 +304,12 @@ sections:
|
|||
- "certbot"
|
||||
run-as: "root"
|
||||
error: "Ошибка при генерации сертификата через lets encrypt"
|
||||
# - name: "update_ca_certificates"
|
||||
# type: "command"
|
||||
# command: "update_ca_certificates"
|
||||
# run-as: "root"
|
||||
# error: "Не удалось обновить сертификаты"
|
||||
# condition: "ssl_type != 'path later'"
|
||||
# require-packages:
|
||||
# - "dont know what"
|
||||
- name: "update_ca_certificates"
|
||||
type: "command"
|
||||
command: "update_ca_certificates"
|
||||
run-as: "root"
|
||||
error: "Не удалось обновить сертификаты"
|
||||
condition: "ssl_type != 'path later'"
|
||||
- name: "database"
|
||||
description: "Настройка используемой базы данных"
|
||||
fields:
|
||||
|
|
@ -307,6 +327,9 @@ sections:
|
|||
condition: "database_type=='postgres'"
|
||||
parent:
|
||||
- "database_type"
|
||||
validate:
|
||||
- rule: "regex_match(database_host,`^[a-zA-Z0-9.-]+$`"
|
||||
message: "Только латинские буквы, цифры, -, '.'"
|
||||
- name: "database_port"
|
||||
variable-name: "database_port"
|
||||
field-type: "input"
|
||||
|
|
@ -314,6 +337,9 @@ sections:
|
|||
condition: "database_type=='postgres'"
|
||||
parent:
|
||||
- "database_type"
|
||||
validate:
|
||||
- rule: "regex_match(database_host,`^[0-9]+$`"
|
||||
message: "Только цифры"
|
||||
- name: "database_name"
|
||||
variable-name: "database_name"
|
||||
field-type: "input"
|
||||
|
|
@ -321,6 +347,9 @@ sections:
|
|||
condition: "database_type=='postgres'"
|
||||
parent:
|
||||
- "database_type"
|
||||
validate:
|
||||
- rule: "regex_match(database_name,`^[a-zA-Z0-9_-]+$`"
|
||||
message: "Только латинские буквы, цифры, -, _"
|
||||
- name: "database_user"
|
||||
variable-name: "database_user"
|
||||
field-type: "input"
|
||||
|
|
@ -328,6 +357,9 @@ sections:
|
|||
condition: "database_type=='postgres'"
|
||||
parent:
|
||||
- "database_type"
|
||||
validate:
|
||||
- rule: "regex_match(database_user,`^[a-zA-Z0-9_-]+$`"
|
||||
message: "Только латинские буквы, цифры, -, _"
|
||||
- name: "database_password"
|
||||
variable-name: "database_password"
|
||||
field-type: "input"
|
||||
|
|
@ -335,6 +367,9 @@ sections:
|
|||
condition: "database_type=='postgres'"
|
||||
parent:
|
||||
- "database_type"
|
||||
validate:
|
||||
- rule: "database_password!=''"
|
||||
message: "Поле не может быть пустым"
|
||||
- name: "paths"
|
||||
description: "Настройка директорий"
|
||||
fields:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue