Работа над описанием приложени, запрет закрытия листа через q/esc, правки конфига
This commit is contained in:
parent
953575e03f
commit
3084dce4e2
13 changed files with 147 additions and 45 deletions
|
|
@ -54,10 +54,9 @@ variables:
|
|||
default: "path now"
|
||||
- name: "ssl_cert_path"
|
||||
type: "string"
|
||||
default: "/usr/share/ca-certificates/repko/repko.crt"
|
||||
default: "/etc/repko/ssl/repko.crt"
|
||||
- name: "ssl_key_path"
|
||||
type: "string"
|
||||
#default: "/usr/share/ca-certificates/repko/repko.key"
|
||||
default: "/etc/repko/ssl/repko.key"
|
||||
- name: "database_type"
|
||||
type: "string"
|
||||
|
|
@ -79,10 +78,10 @@ variables:
|
|||
default: "admin"
|
||||
- name: "gpg_full_name"
|
||||
type: "string"
|
||||
default: "Repko Reposiory"
|
||||
default: "Repko Repository"
|
||||
- name: "gpg_note"
|
||||
type: "string"
|
||||
default: "notee"
|
||||
default: "noe"
|
||||
- name: "gpg_mail"
|
||||
type: "string"
|
||||
default: "admin@repko.com"
|
||||
|
|
@ -124,11 +123,6 @@ sections:
|
|||
/usr/share/keyrings \
|
||||
/usr/share/ca-certificates/repko"
|
||||
error: "не удалось создать необходимые директории"
|
||||
- name: "Sleep 1"
|
||||
type: "command"
|
||||
#command: "touch /etc/repko/{{.api_domain}}.txt"
|
||||
command: "sleep 1"
|
||||
error: "ошибка создания файла"
|
||||
- name: "user"
|
||||
description: "Настройка данных пользователя"
|
||||
fields:
|
||||
|
|
@ -169,7 +163,7 @@ sections:
|
|||
error: "Ошибка при создании пользователя"
|
||||
- name: "Set directories ownership"
|
||||
type: "command"
|
||||
command: "chown -R {{.repko_user}}:{{.repko_user}} /var/log/repko /var/lib/repko /var/www/repko /etc/repko /var/lib/gnupg"
|
||||
command: "chown -R {{.repko_user}}:{{.repko_user}} /var/log/repko /var/lib/repko /var/www/repko /etc/repko /var/lib/repko/gnupg"
|
||||
error: "Ошибка установка владельца для директорий"
|
||||
- name: "Set rights 755"
|
||||
type: "command"
|
||||
|
|
@ -234,7 +228,7 @@ sections:
|
|||
field-type: "input"
|
||||
description: "Адрес сервера"
|
||||
validate:
|
||||
- rule: "regex_match(server_address,`^[a-zA-Z.-]+:[0-9]+$`)"
|
||||
- rule: "regex_match(server_address,`^[a-zA-Z0-9.-]+:[0-9]+$`)"
|
||||
message: "Неверный формат, host:port, host только латиница,цифры, тире, '.', port только цифры"
|
||||
- rule: "port_free( regex(server_address, `^.*:([0-9]+)$`, `$1`) )"
|
||||
message: "Порт занят"
|
||||
|
|
@ -297,9 +291,9 @@ sections:
|
|||
command: |
|
||||
openssl req -x509 -nodes -days 365 \
|
||||
-newkey rsa:2048 \
|
||||
-keyout {{ssl_key_path}} \
|
||||
-out {{ssl_cert_path}} \
|
||||
-subj "/CN={{api_domain}}"
|
||||
-keyout {{.ssl_key_path}} \
|
||||
-out {{.ssl_cert_path}} \
|
||||
-subj "/CN={{.api_domain}}"
|
||||
condition: "ssl_type == 'self-signed'"
|
||||
run-as: "root"
|
||||
error: "Не удалось сгенерировать сертификат через openssl"
|
||||
|
|
@ -315,7 +309,7 @@ sections:
|
|||
error: "Ошибка установки прав ключа"
|
||||
- name: "run_certbot"
|
||||
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}}"
|
||||
condition: "ssl_type == 'lets encrypt'"
|
||||
require-packages:
|
||||
- "nginx"
|
||||
|
|
@ -484,25 +478,23 @@ sections:
|
|||
variable-name: "debian_root"
|
||||
field-type: "directory"
|
||||
description: "Директория debian"
|
||||
validate:
|
||||
- rule: "dir_exists(debian_root)"
|
||||
message: "Папка не существует"
|
||||
- name: "archive_root"
|
||||
variable-name: "archive_root"
|
||||
field-type: "directory"
|
||||
description: "Директория архива debian"
|
||||
validate:
|
||||
- rule: "dir_exists(archive_root)"
|
||||
message: "Папка не существует"
|
||||
actions:
|
||||
- name: "create debian dir"
|
||||
- name: "create debian and archive dir"
|
||||
type: "command"
|
||||
command: "mkdir -p {{.debian_root}}"
|
||||
error: "Ошибка создания папки debian"
|
||||
- name: "create archive dir"
|
||||
command: "mkdir -p {{.debian_root}} {{.archive_root}}"
|
||||
error: "Ошибка создания папок debian и archive"
|
||||
- name: "set ownership for debian and archive dir"
|
||||
type: "command"
|
||||
command: "mkdir -p {{.archive_root}}"
|
||||
error: "Ошибка создания папки archive"
|
||||
command: "chown -R {{.repko_user}}:{{.repko_user}} {{.debian_root}} {{.archive_root}}"
|
||||
error: "ошибка установки владельца для папок debian и archive"
|
||||
- name: "set rights for debian and archive dir"
|
||||
type: "command"
|
||||
command: "chmod -R 755 {{.debian_root}} {{.archive_root}}"
|
||||
error: "ошибка установки прав для папок debian и archive"
|
||||
- name: "finale"
|
||||
description: "Последний этап, проверьте правильность введенных данных"
|
||||
type: "final"
|
||||
|
|
@ -510,25 +502,27 @@ sections:
|
|||
- name: "update_united_nginx_conf"
|
||||
type: "file_template"
|
||||
condition: "api_domain==panel_domain"
|
||||
file-source: "/home/test/Projects/Personal/GoSetup/_public/files/donor/united.repko.donor.conf"
|
||||
file-target: "/home/test/Projects/Personal/GoSetup/_public/files/target/united.repko.needy.conf"
|
||||
error: "Ошибка при создании файла united.repko.needy.conf"
|
||||
file-source: "/opt/repko/donors/united.repko.conf"
|
||||
file-target: "/etc/nginx/sites-available/repko.conf"
|
||||
error: "Ошибка при создании файла united nginx conf"
|
||||
- name: "update_separated_nginx_conf"
|
||||
type: "file_template"
|
||||
condition: "api_domain !=panel_domain"
|
||||
file-source: "/home/test/Projects/Personal/GoSetup/_public/files/donor/separated.repko.donor.conf"
|
||||
file-target: "/home/test/Projects/Personal/GoSetup/_public/files/target/separated.repko.needy.conf"
|
||||
error: "Ошибка при создании файла separated.repko.needy.conf"
|
||||
file-source: "/opt/repko/donors/separated.repko.conf"
|
||||
file-target: "/etc/nginx/sites-available/repko.conf"
|
||||
error: "Ошибка при создании файла separated nginx conf"
|
||||
- name: "update_repko_service"
|
||||
type: "file_template"
|
||||
file-source: "/home/test/Projects/Personal/GoSetup/_public/files/donor/repko.donor.service"
|
||||
file-target: "/home/test/Projects/Personal/GoSetup/_public/files/target/repko.target.service"
|
||||
error: "Ошибка при создании файла repko.target.service"
|
||||
file-source: "/opt/repko/donors/repko.service"
|
||||
file-target: "/etc/systemd/system/repko.service"
|
||||
error: "Ошибка при создании файла repko service"
|
||||
- name: "update_repko_ini"
|
||||
type: "file_template"
|
||||
# file-source: "/home/test/Projects/Personal/GoSetup/_public/files/donor/config.donor.ini"
|
||||
# file-target: "/home/test/Projects/Personal/GoSetup/_public/files/target/config.target.ini"
|
||||
file-source: "http://gsg.site/_public/config.donor.ini"
|
||||
file-target: "/home/test/Projects/Personal/GoSetup/_public/files/target/http.config.ini"
|
||||
error: "Ошибка при создании файла repko.target.service"
|
||||
root: true
|
||||
file-source: "/opt/repko/donors/config.ini"
|
||||
file-target: "/etc/repko/config.ini"
|
||||
error: "Ошибка при создании файла repko config"
|
||||
- name: "update_web_config"
|
||||
type: "file_template"
|
||||
file-source: "/opt/repko/donors/config.json"
|
||||
file-target: "/var/www/repko/web/config.json"
|
||||
error: "Ошибка при создании файла repko web config"
|
||||
Loading…
Add table
Add a link
Reference in a new issue