[WIP] Blacklist command #14

Черновик
CptainObvious хочет влить 1 коммит(ов) из CptainObvious/occweb:master в master
CptainObvious прокомментировал(а) 2020-03-02 09:19:44 +00:00
First-time contributor

Implement a blacklist with command that we want to prevent being run from occweb like maintenance mode:on

Return a 403 forbidden with a json response

{ "error": "command blacklisted"} ```


The error message is formatted for term but nextcloud is escaping color code \u001b -> \\u001b in the response

Will see to move the formatting of the error in the js 
Implement a blacklist with command that we want to prevent being run from occweb like ```maintenance mode:on``` Return a 403 forbidden with a json response ``` { "error": "command blacklisted"} ``` The error message is formatted for term but nextcloud is escaping color code \u001b -> \\u001b in the response Will see to move the formatting of the error in the js
adphi прокомментировал(а) 2020-03-03 08:26:14 +00:00
Владелец

The blacklisted command is not correct (see occ docs): maintenance:mode --on.
I would change the error message to something more meaningful as "command not supported in occweb" with maybe a link to the docs.
In some cases, I think it can be useful in the future to be able to bypass the blacklist with --force and -f or a custom flag if not available.

The [blacklisted command](https://git.adphi.net/adphi/occweb/pulls/14/files#diff-c62a13695dd9007bbfeca860cb9f55cf0ab59beR30) is not correct (see [occ docs](https://docs.nextcloud.com/server/18/admin_manual/configuration_server/occ_command.html#maintenance-commands)): `maintenance:mode --on`. I would change the [error message](https://git.adphi.net/adphi/occweb/pulls/14/files#diff-c62a13695dd9007bbfeca860cb9f55cf0ab59beR75) to something more meaningful as "command not supported in occweb" with maybe a link to the docs. In some cases, I think it can be useful in the future to be able to bypass the blacklist with `--force` and `-f` or a custom flag if not available.
Этот запрос на слияние помечен как в процессе работы.
Эта ветка отстает от базовой ветки
Вы также можете просмотреть инструкции командной строки.

Шаг 1:

В репозитории вашего проекта посмотрите новую ветку и протестируйте изменения.
git checkout -b CptainObvious-master master
git pull master

Шаг 2:

Объединить изменения и обновить на Gitea.
git checkout master
git merge --no-ff CptainObvious-master
git push origin master
Войдите, чтобы присоединиться к обсуждению.
Нет рецензентов
Нет этапа
Нет назначенных лиц
2 участников
Уведомления
Срок выполнения
Срок действия недействителен или находится за пределами допустимого диапазона. Пожалуйста, используйте формат 'гггг-мм-дд'.

Срок выполнения не установлен.

Зависимости

Зависимостей нет.

Ссылка: adphi/occweb#14
Описание отсутствует.