forked from Plemya-x/ALR
wip
This commit is contained in:
@ -20,4 +20,5 @@ const (
|
||||
SystemConfigPath = "/etc/alr/alr.toml"
|
||||
SystemCachePath = "/var/cache/alr"
|
||||
AlrRunDir = "/var/run/alr"
|
||||
PrivilegedGroup = "wheel"
|
||||
)
|
||||
|
@ -30,34 +30,42 @@ msgid ""
|
||||
"Build package from scratch even if there's an already built package available"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:71
|
||||
#: build.go:75
|
||||
msgid "Error getting working directory"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:99
|
||||
#: build.go:103
|
||||
msgid "Unable to detect a supported package manager on the system"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:105
|
||||
#: build.go:109
|
||||
msgid "Error parsing os release"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:143 build.go:184
|
||||
msgid "Error building package"
|
||||
#: build.go:121
|
||||
msgid "Cannot get absolute script path"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:160
|
||||
#: build.go:153
|
||||
msgid "Package not found"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:187
|
||||
#: build.go:174
|
||||
msgid "Nothing to build"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:196
|
||||
#: build.go:212
|
||||
msgid "Error building package"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:220
|
||||
msgid "Error moving the package"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:224
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#: fix.go:38
|
||||
msgid "Attempt to fix problems with ALR"
|
||||
msgstr ""
|
||||
@ -86,10 +94,6 @@ msgstr ""
|
||||
msgid "Unable to create new cache directory"
|
||||
msgstr ""
|
||||
|
||||
#: fix.go:98
|
||||
msgid "Done"
|
||||
msgstr ""
|
||||
|
||||
#: gen.go:34
|
||||
msgid "Generate a ALR script from a template"
|
||||
msgstr ""
|
||||
@ -307,14 +311,18 @@ msgstr ""
|
||||
msgid "ERROR"
|
||||
msgstr ""
|
||||
|
||||
#: internal/utils/cmd.go:86
|
||||
#: internal/utils/cmd.go:87
|
||||
msgid "Error dropping capabilities"
|
||||
msgstr ""
|
||||
|
||||
#: internal/utils/cmd.go:93
|
||||
#: internal/utils/cmd.go:94
|
||||
msgid "You need to be root to perform this action"
|
||||
msgstr ""
|
||||
|
||||
#: internal/utils/cmd.go:136
|
||||
msgid "You need to be a %s member to perform this action"
|
||||
msgstr ""
|
||||
|
||||
#: list.go:41
|
||||
msgid "List ALR repo packages"
|
||||
msgstr ""
|
||||
|
@ -37,35 +37,43 @@ msgid ""
|
||||
"Build package from scratch even if there's an already built package available"
|
||||
msgstr "Создайте пакет с нуля, даже если уже имеется готовый пакет"
|
||||
|
||||
#: build.go:71
|
||||
#: build.go:75
|
||||
msgid "Error getting working directory"
|
||||
msgstr "Ошибка при получении рабочего каталога"
|
||||
|
||||
#: build.go:99
|
||||
#: build.go:103
|
||||
msgid "Unable to detect a supported package manager on the system"
|
||||
msgstr "Не удалось обнаружить поддерживаемый менеджер пакетов в системе"
|
||||
|
||||
#: build.go:105
|
||||
#: build.go:109
|
||||
msgid "Error parsing os release"
|
||||
msgstr "Ошибка при разборе файла выпуска операционной системы"
|
||||
|
||||
#: build.go:143 build.go:184
|
||||
msgid "Error building package"
|
||||
msgstr "Ошибка при сборке пакета"
|
||||
#: build.go:121
|
||||
msgid "Cannot get absolute script path"
|
||||
msgstr ""
|
||||
|
||||
#: build.go:160
|
||||
#: build.go:153
|
||||
msgid "Package not found"
|
||||
msgstr "Пакет не найден"
|
||||
|
||||
#: build.go:187
|
||||
#: build.go:174
|
||||
#, fuzzy
|
||||
msgid "Nothing to build"
|
||||
msgstr "Исполнение build()"
|
||||
|
||||
#: build.go:196
|
||||
#: build.go:212
|
||||
msgid "Error building package"
|
||||
msgstr "Ошибка при сборке пакета"
|
||||
|
||||
#: build.go:220
|
||||
msgid "Error moving the package"
|
||||
msgstr "Ошибка при перемещении пакета"
|
||||
|
||||
#: build.go:224
|
||||
msgid "Done"
|
||||
msgstr "Сделано"
|
||||
|
||||
#: fix.go:38
|
||||
msgid "Attempt to fix problems with ALR"
|
||||
msgstr "Попытка устранить проблемы с ALR"
|
||||
@ -98,10 +106,6 @@ msgstr "Восстановление кэша"
|
||||
msgid "Unable to create new cache directory"
|
||||
msgstr "Не удалось создать новый каталог кэша"
|
||||
|
||||
#: fix.go:98
|
||||
msgid "Done"
|
||||
msgstr "Сделано"
|
||||
|
||||
#: gen.go:34
|
||||
msgid "Generate a ALR script from a template"
|
||||
msgstr "Генерация скрипта ALR из шаблона"
|
||||
@ -322,15 +326,19 @@ msgstr "%s %s загружается — %s/с\n"
|
||||
msgid "ERROR"
|
||||
msgstr "ОШИБКА"
|
||||
|
||||
#: internal/utils/cmd.go:86
|
||||
#: internal/utils/cmd.go:87
|
||||
#, fuzzy
|
||||
msgid "Error dropping capabilities"
|
||||
msgstr "Ошибка при открытии базы данных"
|
||||
|
||||
#: internal/utils/cmd.go:93
|
||||
#: internal/utils/cmd.go:94
|
||||
msgid "You need to be root to perform this action"
|
||||
msgstr ""
|
||||
|
||||
#: internal/utils/cmd.go:136
|
||||
msgid "You need to be a %s member to perform this action"
|
||||
msgstr ""
|
||||
|
||||
#: list.go:41
|
||||
msgid "List ALR repo packages"
|
||||
msgstr "Список пакетов репозитория ALR"
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/cliutils"
|
||||
"gitea.plemya-x.ru/Plemya-x/ALR/internal/constants"
|
||||
)
|
||||
|
||||
func GetUidGidAlrUserString() (string, string, error) {
|
||||
@ -111,13 +112,13 @@ func EnuseIsAlrUser() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func EnuseIsWheelMember() error {
|
||||
func EnuseIsPrivilegedGroupMember() error {
|
||||
currentUser, err := user.Current()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
group, err := user.LookupGroup("wheel")
|
||||
group, err := user.LookupGroup(constants.PrivilegedGroup)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -132,7 +133,7 @@ func EnuseIsWheelMember() error {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return errors.New("looks like is not wheel member")
|
||||
return cliutils.FormatCliExit(gotext.Get("You need to be a %s member to perform this action", constants.PrivilegedGroup), nil)
|
||||
}
|
||||
|
||||
func EscalateToRootGid() error {
|
||||
|
Reference in New Issue
Block a user