Редактирование файла конфига repko

This commit is contained in:
XeRo 2026-01-28 17:46:10 +05:00
parent 0ac19f6c8f
commit 1a71525075

View file

@ -215,6 +215,18 @@ sections:
variable-name: "server_address" variable-name: "server_address"
field-type: "input" field-type: "input"
description: "Адрес сервера" 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" - name: "ssl"
description: "Настройка ssl" description: "Настройка ssl"
condition: "is_secure == true" condition: "is_secure == true"
@ -262,7 +274,7 @@ sections:
condition: "ssl_type == 'self-signed'" condition: "ssl_type == 'self-signed'"
run-as: "root" run-as: "root"
error: "Ошибка при создании директории для сертификатов" error: "Ошибка при создании директории для сертификатов"
- name: "generate_self_signed" - name: "generate_self_signed" #тут
type: "command" type: "command"
command: | command: |
openssl req -x509 -nodes -days 365 \ openssl req -x509 -nodes -days 365 \
@ -272,7 +284,17 @@ sections:
-subj "/CN={{api_domain}}" -subj "/CN={{api_domain}}"
condition: "ssl_type == 'self-signed'" condition: "ssl_type == 'self-signed'"
run-as: "root" 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" - name: "run_certbot"
type: "command" type: "command"
command: "certbot --nginx -d {{api_domain}} -d {{panel_domain}} --non-interactive --agree-tos -m admin@{{api_domain}}" command: "certbot --nginx -d {{api_domain}} -d {{panel_domain}} --non-interactive --agree-tos -m admin@{{api_domain}}"
@ -282,14 +304,12 @@ sections:
- "certbot" - "certbot"
run-as: "root" run-as: "root"
error: "Ошибка при генерации сертификата через lets encrypt" error: "Ошибка при генерации сертификата через lets encrypt"
# - name: "update_ca_certificates" - name: "update_ca_certificates"
# type: "command" type: "command"
# command: "update_ca_certificates" command: "update_ca_certificates"
# run-as: "root" run-as: "root"
# error: "Не удалось обновить сертификаты" error: "Не удалось обновить сертификаты"
# condition: "ssl_type != 'path later'" condition: "ssl_type != 'path later'"
# require-packages:
# - "dont know what"
- name: "database" - name: "database"
description: "Настройка используемой базы данных" description: "Настройка используемой базы данных"
fields: fields:
@ -307,6 +327,9 @@ sections:
condition: "database_type=='postgres'" condition: "database_type=='postgres'"
parent: parent:
- "database_type" - "database_type"
validate:
- rule: "regex_match(database_host,`^[a-zA-Z0-9.-]+$`"
message: "Только латинские буквы, цифры, -, '.'"
- name: "database_port" - name: "database_port"
variable-name: "database_port" variable-name: "database_port"
field-type: "input" field-type: "input"
@ -314,6 +337,9 @@ sections:
condition: "database_type=='postgres'" condition: "database_type=='postgres'"
parent: parent:
- "database_type" - "database_type"
validate:
- rule: "regex_match(database_host,`^[0-9]+$`"
message: "Только цифры"
- name: "database_name" - name: "database_name"
variable-name: "database_name" variable-name: "database_name"
field-type: "input" field-type: "input"
@ -321,6 +347,9 @@ sections:
condition: "database_type=='postgres'" condition: "database_type=='postgres'"
parent: parent:
- "database_type" - "database_type"
validate:
- rule: "regex_match(database_name,`^[a-zA-Z0-9_-]+$`"
message: "Только латинские буквы, цифры, -, _"
- name: "database_user" - name: "database_user"
variable-name: "database_user" variable-name: "database_user"
field-type: "input" field-type: "input"
@ -328,6 +357,9 @@ sections:
condition: "database_type=='postgres'" condition: "database_type=='postgres'"
parent: parent:
- "database_type" - "database_type"
validate:
- rule: "regex_match(database_user,`^[a-zA-Z0-9_-]+$`"
message: "Только латинские буквы, цифры, -, _"
- name: "database_password" - name: "database_password"
variable-name: "database_password" variable-name: "database_password"
field-type: "input" field-type: "input"
@ -335,6 +367,9 @@ sections:
condition: "database_type=='postgres'" condition: "database_type=='postgres'"
parent: parent:
- "database_type" - "database_type"
validate:
- rule: "database_password!=''"
message: "Поле не может быть пустым"
- name: "paths" - name: "paths"
description: "Настройка директорий" description: "Настройка директорий"
fields: fields: