Работа над конфигом repko, работа над интеграцией в deb пакет repko
This commit is contained in:
parent
58b258be29
commit
d3fd4f5858
7 changed files with 101 additions and 11 deletions
|
|
@ -86,6 +86,15 @@ variables:
|
|||
- name: "gpg_mail"
|
||||
type: "string"
|
||||
default: "admin@repko.com"
|
||||
- name: "gpg_key_id"
|
||||
type: "string"
|
||||
default: "123ABCD"
|
||||
- name: "repko_login"
|
||||
type: "string"
|
||||
default: "admin_repko"
|
||||
- name: "repko_pass"
|
||||
type: "string"
|
||||
default: "admin_repko"
|
||||
- name: "debian_root"
|
||||
type: "string"
|
||||
default: "/var/www/repko/debian"
|
||||
|
|
@ -181,7 +190,7 @@ sections:
|
|||
- name: "Set rights 750"
|
||||
type: "command"
|
||||
command: "chmod 750 /opt/repko/repko"
|
||||
error: "Ошибка установки прав 640"
|
||||
error: "Ошибка установки прав 750"
|
||||
- name: "Set rights 640"
|
||||
type: "command"
|
||||
command: "chmod 640 /opt/repko/.env /etc/repko/config.ini"
|
||||
|
|
@ -415,8 +424,59 @@ sections:
|
|||
error: "Не удалось создать ключ"
|
||||
- name: "get gpg key id"
|
||||
type: "command"
|
||||
command: "sudo -u {{.repko_user}} gpg --homedir /var/lib/repko/gnupg --list-keys --with-colons | grep pub | cut -d: -f5 > /etc/repko/keyid"
|
||||
command: "sudo -u {{.repko_user}} gpg --homedir /var/lib/repko/gnupg --list-keys --with-colons | grep pub | cut -d: -f5"
|
||||
error: "Не удалось получить и сохранить id gpg ключа"
|
||||
assign-to: "gpg_key_id"
|
||||
- name: "export gpg key"
|
||||
type: "command"
|
||||
command: "sudo -u {{.repko_user}} gpg --homedir /var/lib/repko/gnupg --armor --export {{.gpg_key_id}} > /usr/share/keyrings/repko.asc"
|
||||
error: "Не удалось экспортировать gpg ключ"
|
||||
- name: "write gpg key id"
|
||||
type: "command"
|
||||
command: "echo {{.gpg_key_id}} > /etc/repko/keyid"
|
||||
error: "не удалось записать gpg key id в файл keyid"
|
||||
- name: "set owner for exported key"
|
||||
type: "command"
|
||||
command: "chown -R root:root /usr/share/keyrings/repko.asc"
|
||||
error: "Ошибка установки владельца файла экспортированного ключа"
|
||||
- name: "set owner for keyid file"
|
||||
type: "command"
|
||||
command: "chown -R {{.repko_user}}:{{.repko_user}} /etc/repko/keyid"
|
||||
error: "Ошибка установки владельца файла id ключа"
|
||||
- name: "set rights for keys"
|
||||
type: "command"
|
||||
command: "chmod 644 /usr/share/keyrings/repko.asc /etc/repko/keyid"
|
||||
error: "Ошибка установки прав для ключей"
|
||||
- name: "basic auth"
|
||||
description: "Настройка базовой аутентификации"
|
||||
fields:
|
||||
- name: "repko login"
|
||||
variable-name: "repko_login"
|
||||
field-type: "input"
|
||||
description: "Логин для входа на сайт"
|
||||
validate:
|
||||
- rule: "regex_match(repko_login,`^[a-zA-Z0-9_-]+$`"
|
||||
message: "Только строчные латинские буквы, цифры, _, -"
|
||||
- name: "repko pass"
|
||||
variable-name: "repko_pass"
|
||||
field-type: "input"
|
||||
description: "Пароль для входа на сайт"
|
||||
validate:
|
||||
- rule: "repko_pass!=''"
|
||||
message: "Пароль не должен быть пустым"
|
||||
actions:
|
||||
- name: "generate htpasswd"
|
||||
type: "command"
|
||||
command: "htpasswd -c -b /etc/repko/.htpasswd {{.repko_login}} {{.repko_pass}}"
|
||||
error: "Не удалось создать файл htpasswd"
|
||||
- name: "set htpasswd owner"
|
||||
type: "command"
|
||||
command: "chown {{.repko_user}}:{{.repko_user}} /etc/repko/.htpasswd"
|
||||
error: "Ошибка установки владельца файла "
|
||||
- name: "set rights for htpasswd "
|
||||
type: "command"
|
||||
command: "chmod 640 /etc/repko/.htpasswd"
|
||||
error: "Ошибку установки прав для файла"
|
||||
- name: "paths"
|
||||
description: "Настройка директорий"
|
||||
fields:
|
||||
|
|
@ -427,6 +487,13 @@ sections:
|
|||
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: "Папка не существует"
|
||||
- name: "finale"
|
||||
description: "Последний этап, проверьте правильность введенных данных"
|
||||
type: "final"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue