这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ Let's take a quick look at the current dokku nginx plugin that's shipped with do
## Installing a plugin

```shell
cd /var/lib/dokku/plugins/available
# This command requires `root` permissions as the `install` and `install-dependencies`
# plugin triggers may utilize commands such as `apt-get`. For non-core plugins, please
# inspect those plugins before running the following command as `root` user.
sudo plugin:install <git_url>

# previous versions (0.3.x and below) of dokku require a manual process to install plugins
cd /var/lib/dokku/plugins
git clone <git url>
dokku plugin:install
dokku plugins-install
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you still need root to clone the plugin in the first place.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily. You could clone it if you run plugn install as the dokku user. However plugn trigger install will fail with the reported error.

root@dokku:/var/lib/dokku# ls -lad ./*/{available,enabled}
drwxr-xr-x 21 dokku dokku 4096 Sep 19 00:27 ./core-plugins/available
drwxr-xr-x  2 dokku dokku 4096 Sep 19 00:27 ./core-plugins/enabled
drwxr-xr-x  2 dokku dokku 4096 Sep 22 16:01 ./plugins/available
drwxr-xr-x  2 dokku dokku 4096 Sep 22 16:01 ./plugins/enabled

EDIT: We no longer sudo -u dokku for plugin:*install* so we can do root things like apt-get.
https://github.com/progrium/dokku/blob/f8c9d9b8239cf5b20020366ecec2e2c799185718/dokku#L44-L47

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, my dokku dir is owned by root...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/var/lib/dokku is owned by root. However we don't install plugins in that directory anymore.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically I think this comment outside of the codeblock should be inside the codeblock and we should have sudo prefix on the command. Something like this:

# This command requires `root` permissions as the `install` and `install-dependencies`
# plugin triggers may utilize commands such as `apt-get`. For non-core plugins, please
# inspect those plugins before running the following command as `root` user.
sudo plugin:install <git_url>

# previous versions (0.3.x and below) of dokku require a manual process to install plugins
cd /var/lib/dokku/plugins/available
sudo git clone <git url>
sudo dokku plugin:install

Does that make sense? Keeping the root notes outside of the codeblock is an easy way for users to get confused and complain that the docs are bad because they can't read ;)

## Creating your own plugin

[See the full documentation](http://progrium.viewdocs.io/dokku/development/plugin-creation).
Expand Down