我正在使用sail 并尝试以root 身份使用shell,这是不可能的。切换到 root 用户要求输入密码,我不知道。
我尝试更改 dockerfile:
ARG WWWROOTGROUP
RUN groupadd --force -g $WWWROOTGROUP sailRoot
RUN useradd -ms /bin/bash --no-user-group -g $WWWROOTGROUP -u 1337 sailRoot
RUN usermod -aG sudo sail
RUN usermod -aG sudo sailRoot
Run Code Online (Sandbox Code Playgroud)
我试图添加一个新用户并给他和标准的sail 用户root 权限,但它不起作用。容器内没有sailRoot 用户。当然,我用那个 dockerfile 重建容器。据我所知,更改后的 dockerfile 已正确执行。
有人知道如何使用sail将用户更改为root吗?
我想要做的是将 imagemagick 安装到容器中。我已经在 dockerfile 中添加了“apt-get install imagemagick imagemagick-doc”,但它没有安装在容器内。如果你知道怎么做,我真的很感激!
谢谢。
我想允许一些用户输入路线,而其他用户则不允许。
我使用simple auth进行身份验证,它会使用承诺加载用户数据。问题是willTransition()不会等到我的用户被加载,所以它会显示索引路由,然后我才能检查用户是否有权访问它。
所以在 router.js 我有:
willTransition(oldRoute, nextRoute, transition) {
return this.get('session').authenticate('authenticator:application').then(() => {
if(this.get('user.isAdmin')) return true
else alert('not allowed to enter')
})
}
Run Code Online (Sandbox Code Playgroud)
这只是一个真实的例子,我有更多的喜欢user.isCat和 cat 被允许进入 /cats 和 /cute 路线。
我知道,我可以检查user.isAdmin也beforeModel()路线,但我有很多其他的路线和权限组,所以我想在路由器一个地方来管理。