Install a Plugin


#99

That’s weird. Yes you have to add this line. When adding a plugin, it should look like this

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git

(Mittineague) #100

It might depend on the way it was set-up.

My localhost file doesn’t have that line yet works fine

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-data-explorer.git
          - git clone https://github.com/Mittineague/discourse-plugin-outlet-lo$
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-staff-notes.git
          - git clone https://github.com/Mittineague/discourse-kinder-guardian.$
#          - git clone https://github.com/Mittineague/test-plugin.git
          - git clone https://github.com/iunctis/discourse-formatting-toolbar.g$



(EW 👌) #101

My setup is on Digital Ocean droplet with one-click-install then updated to the last (v1.7.0.beta5 +192) version.

I’m going to add it. I just worried that it may be differ from version to version.

I appreciate your fast support dear @Steven and @Mittineague :sparkles:


(Mittineague) #102

If I’m understanding the mkdir --help correctly, having the line whether needed or not shouldn’t hurt any.

mittineague@ubuntu:/var/discourse$ mkdir --help
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.

Mandatory arguments to long options are mandatory for short options too.
  -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask
  -p, --parents     no error if existing, make parent directories as needed
  -v, --verbose     print a message for each created directory
  -Z                   set SELinux security context of each created directory
                         to the default type
      --context[=CTX]  like -Z, or if CTX is specified then set the SELinux
                         or SMACK security context to CTX
      --help     display this help and exit
      --version  output version information and exit

(Jeff Atwood) #103

7 posts were split to a new topic: Can I share the /plugins folder to make rebuild faster?


Can I share the /plugins folder to make rebuild faster?
(Dmitry Demenchuk) #104

The problem is, because you’re using the HTTPS clone URL for your repository, it requires username and password authorisation.


(Jeff Atwood) #105

3 posts were split to a new topic: Syntax error in my YAML file


(Jeff Atwood) #106

5 posts were split to a new topic: Plugin with custom gems


(kaja santro) #107

Sorry, but we are not having a container. Do we need that or is there a way to install a plugin without using a container?


(Jay Pfaffman) #108

If you are planning to use Discourse, you should follow the cloud install instructions.


(Kyle Boyce) #109

@sam did this ever get solved?


(Jeff Atwood) #110

No, perhaps by 2020, there is a lot of stuff on the plate.


(Jay Pfaffman) #111

If you separate the data and web containers you can bootstrap a new image without shutting down the running one.


(Kyle Boyce) #112

I have no clue what that means :man_shrugging:t2:


(Jay Pfaffman) #113

If you search for “data container” you’ll find


#116

Hi, is this post still valid? I got the error below that the /user/.ssh directory doesn’t exist:

I, [2017-10-02T11:09:05.337068 #13]  INFO -- : > echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /user/.ssh/config
sh: 1: cannot create /user/.ssh/config: Directory nonexistent
I, [2017-10-02T11:09:05.344774 #13]  INFO -- : 


FAILED
--------------------
Pups::ExecError: echo "Host github.com\n\tStrictHostKeyChecking no\n" >> /user/.ssh/config failed with return #<Process::Status: pid 13963 exit 2>
Location of failure: /pups/lib/pups/exec_command.rb:108:in `spawn'
exec failed with the params "echo \"Host github.com\\n\\tStrictHostKeyChecking no\\n\" >> /user/.ssh/config"
6..[sanitized]....3
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one

Adding mkdir /user/.ssh before that didn’t work, so I’m honestly not even sure if my docker is running as user (having it run a whoami shows it’s running as root so I’m trying to change things to reflect that)…

UPDATE: Got it working

  1. Change all mentions of /user/ to /root/ (unless it’s not supposed to be running as root?!)
  2. Add mkdir /root/.ssh and chmod 700 ./root/.ssh before the .ssh/config file creation

So now I’m wondering if my docker running as root is a bad thing, or if the instructions above need to be updated just slightly.


#117

^^^ The above post just stopped working for me, and now my forum is hosed.

I, [2017-11-30T06:18:58.231418 #13]  INFO -- : > cd /var/www/discourse && sudo -E -u discourse bundle exec rake db:migrate
I, [2017-11-30T06:19:15.940308 #13]  INFO -- : `/root` is not writable.
Bundler will use `/tmp/bundler/home/discourse' as your home directory temporarily.

Not sure why /root is not writeable, especially since my user is root… I’m going to try to chmod 700 it first. Otherwise I need to remove some of these custom commands I guess.

These are the commands that stopped working, it seems, from this comment:

  - exec: cd $home && sudo -E -u discourse bundle exec rake db:migrate
  - exec: cd $home && rm -fr tmp/cache
  - exec: cd $home &&  sudo -E -u discourse bundle exec rake assets:precompile

Confirmed. Remove those three commands above and we’re back in business. Hopefully the plugins I was installing are still working. They seem to be.


(Jay Pfaffman) #118

Hey @sam, I just did a ./launcher bootstrap multy on a multisite instance and it failed the same way.

I’ve not checked any other instances yet, but it may be worth a look.

edit: I had about 5.5GB of space after the last rebuild. I did a ./launcher cleanup and rebuilt again and it was successful.


#119

Think this was the real fix? run a cleanup? And I can uncomment my above three lines causing problems and try again?


(Jay Pfaffman) #120

I don’t know. It was for me. If you’ve got many plugins it could be that the 5GB guestimate of necessary space is wrong.

How much space do you have?