Adds documentation for manual installation on Ubuntu LTS 16.04#2887
Adds documentation for manual installation on Ubuntu LTS 16.04#2887
Conversation
Instructions for: * rbenv * PostgreSQL * git * figaro
| git commit -m "Adds figaro configuration management" | ||
| ``` | ||
|
|
||
| ### Initializing your app for local development |
There was a problem hiding this comment.
Maybe here we should link to this section on getting started, so we don't duplicate the text, but the idea here was to be able to explain more what and where exactly you can log in and what can do every user.
docs/manual-installation.md
Outdated
|
|
||
| ## Step by step | ||
|
|
||
| We're starting with an Ubuntu 16.04 LTS. This is an opinionated guy and YMMV, so if you're free to use the technology that you fell most comfortable on. If you have any doubts and you're blocked you can go and ask on [our Gitter](https://gitter.im/decidim/decidim). We recommend that you follow some Ruby on Rails tutorials (like [Getting Started with Ruby on Rails](http://guides.rubyonrails.org/getting_started.html)) and have some knowledge on how gems and engines work. |
|
|
||
| ```bash | ||
| git init . | ||
| git commit -m "Initial commit. Generated with Decidim 0.X https://decidim.org" |
There was a problem hiding this comment.
Add something like "Where Decidim 0.X is your Decidim version (see your Gemfile)"
There was a problem hiding this comment.
We can add this to the generator, it's cool! :)
|
I feel like we should direct the newcomers to some other official guide on how to setup their environment, outside our repo, instead of offering the guide ourselves. Otherwise we'll end up adding guides on how to install the environment in Mac & Windows too, and we'll have to keep them up to date. Also, what is |
docs/manual-installation.md
Outdated
| ```bash | ||
| decidim decidim_application | ||
| cd decidim_application | ||
| bundle install |
There was a problem hiding this comment.
I think our generator automatically runs bundle install on the generated application.
|
|
||
| ```bash | ||
| git add . | ||
| git commit -m "Adds figaro configuration management" |
There was a problem hiding this comment.
Modern rails provide encrypted secrets out of the box now, maybe we should explore that so these tweaks are not necessary.
There was a problem hiding this comment.
Ok, I forgot that was the Rails official way now. I've really didn't use it yet, the idea here was only to show the gist of handling secrets. I'll add a comment and link on a guide on using/handling the secrets.
There was a problem hiding this comment.
Added the comment regarding secrets. As I said, I didn't try it (yet), although I've read that on 5.1 was secrets and now on 5.2 is call credentials, so I think it's still moving. After I try and test it on staging/production I'll update this.
There was a problem hiding this comment.
@deivid-rodriguez we use rails-secrets and figaro in our projects but we use them differently, maybe we're doing it the wrong way:
- rails-secrets only for data that can go to version control
- figaro for data that can not be checked into version control.
There was a problem hiding this comment.
Not sure, the idea in modern rails versions in that everything is checked into version control, but secret data is commited encrypted.
docs/manual-installation.md
Outdated
| Now we're going to install PostgreSQL for the database: | ||
|
|
||
| ```bash | ||
| sudo apt-get install -y postgresql libpq-dev |
There was a problem hiding this comment.
If libpq-dev is not installed, the previous bundle install will fail so probably this step should be before the generation of the application...
There was a problem hiding this comment.
You can do this with a oneliner :)
sudo -u postgres psql -c "CREATE USER decidim_app WITH SUPERUSER CREATEDB NOCREATEROLE PASSWORD 'decidim_app'"Not that I used NOCREATEROLE because the DB user does not need role creation privileges.
There was a problem hiding this comment.
Ok, great feedback, I'll change it
There was a problem hiding this comment.
If libpq-dev is not installed, the previous bundle install will fail so probably this step should be before the generation of the application...
I've moved the postgres installation so it's before decidim installation
There was a problem hiding this comment.
You can do this with a oneliner :)
Changed it!
|
I kind of share a similar feeling to @mrcasals as to where these docs should live, but if @andreslucena is committed to maintaining these docs up to date, it could be a useful resource for newcomers... |
|
Regarding figaro, it's just an example on how to handle secrets. I'll add other proposed alternatives, just so it's clear that it could be done on others ways. Regarding if we should/shouldn't have this kind of documentation, please see https://consul_docs.gitbooks.io/docs/content/en/getting_started/prerequisites/linux.html - also check all the manual, I think it's much better and with much detail documentation than ours. |
It is very important for the democratic nature of the project to make it easy to install on GNU/Linux (not so much on Mac or Win, not really that many servers running win or mac). And I think it is very convenient to have the instructions included here, particularly if they are just a couple of command line options (or 7 for the same matter). We should hope for something like this: https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md I know many organizations with competent admin who could not install Decidim. The more help we provide and clearer instructions the better. Not all environment installs work equal, and it is good to provide the way it works. |
|
@xabier I agree that we need better setup/deployment docs, but I think @mrcasals had a good point here. If your read the patch, these are not 7 commands, but a recipe that can get quite complex, get outdated or change over time. In my opinion discourse is indeed a fantastic model to follow because it satisfies both concerns:
@josepjaume's input is very valuable here since I suspect he knows a lot about deploying docker images :) |
|
@deivid-rodriguez I'm with you regarding that we should have something similar to what Discourse offers (or something that at least doesn't have that much steps as the instructions on this PR). Also this is going to be needed for another kind of applications that we want to integrate to (ie see #3166 ) This PR is only a set of instructions that wants to bridge the gap of what @xabier said:
|
|
I don't use Ubuntu, so I can't commit to keep this updated, that's why I still think that all the part on how to install Ruby should be delegated to somewhere else... Maybe pointing to the |
…id-rodriguez * Change typo on guy/guide * PostgreSQL installation before installing Decidim * Removing bundle install on Decidim installation * Adds sekrets/encrypted secrets mention on secrets handling * Change postgreSQL database/user creation
Codecov Report
@@ Coverage Diff @@
## master #2887 +/- ##
=========================================
Coverage ? 98.72%
=========================================
Files ? 1651
Lines ? 39195
Branches ? 0
=========================================
Hits ? 38697
Misses ? 498
Partials ? 0 |
The general idea of this guide is about downgrading the knowledge to at least install Decidim locally, by an Ubuntu sysadmin/user. I think the full instructions is important, although I also added a mention to RVM as an alternative. |
Yes, we have that on the roadmap, this is just a quick patch on the doc side until we have something working on this area. Discourse model seems like a good candidate for this problem, although there are some important differences with what Decidim is at the moment: for instance, Discourse is a full blown app (ie you can modify CSS/HTML/JS through the admin panel) and Decidim is a framework where you work directly with the Ruby on Rails application. Maybe the decidim-launcher would also need to point to a generated app? We hope to talk about this (Decidim installation/development/deployment flows) on the near future. |
|
I think that all the doubts/changes that were discussed are already responded or changed. @deivid-rodriguez @mrcasals could you say something and merge (or give more feedback)? Thanks! |
deivid-rodriguez
left a comment
There was a problem hiding this comment.
@andreslucena I left some more feedback but it looks almost ready to me! I'm still afraid this will get outdated and get misleading instead of useful but I'm happy to be proven wrong!
docs/manual-installation.md
Outdated
| gem install decidim | ||
| ``` | ||
|
|
||
| Afterwards, we can create an application with the nice `decidim` executable, where `decidim_application` is your application name (ie DecidimBarcelona): |
There was a problem hiding this comment.
Camelizing is a bit weird here I think, maybe decidim.barcelona is better.
| rbenv global 2.5.0 | ||
| echo "gem: --no-document" > ~/.gemrc | ||
| gem install bundler | ||
| ``` |
There was a problem hiding this comment.
This still looks too specific to me... For example, it's already outdated and it's now recommending an potentially insecure ruby version without all the latest security patches (2.5.1 is out).
I would probably remove these instructions and mention that you need an up to date ruby and point out to official docs on installing it (or maybe even to our docker image).
But if we want to keep it in the repo we need to commit to keeping it up to date, so we should get that version updated.
|
@deivid-rodriguez I agree with all your comments regarding the short live of this doc, specially regarding software versions, ie Ubuntu LTS now is 18.04 😅 We hope to have a better installation/deployment method with @gmarpons - probably something based on Discourse scripts or something like that. If you know any other RoR open source projects that have a nice installation/deploy method that'd be awesome. |
deivid-rodriguez
left a comment
There was a problem hiding this comment.
Ok, let's add this an iterate on better solutions later!
…im#2887) * Adds documentation for manual installation on Ubuntu LTS 16.04. Instructions for: * rbenv * PostgreSQL * git * figaro * Update manual installation doc with feedback from @mrcasals and @deivid-rodriguez * Change typo on guy/guide * PostgreSQL installation before installing Decidim * Removing bundle install on Decidim installation * Adds sekrets/encrypted secrets mention on secrets handling * Change postgreSQL database/user creation * Removing trailing white space * Adding servers/technologies on manual installation * Markdown format: Adds language to fenced code block * Adds mention to rvm * Remove white trailing space :/ * Changes details with feedback from @deivid-rodriguez
|
Thank you very much for the guide. With the help of it, plus GoRails guide and ImageMagick guide I finally managed to launch a first shaky Ukrainian deployment. On one hand, GoRails guide is indispensable, since it gives precise, updated, and version-sensitive instructions. On the other hand, I needed PostgreSQL instructions from your guide, since they are app-specific. GoRails PostgreSQL instructions weren't suitable. IMHO some parts of the guide can be outsourced, with links to appropriate resources, e.g.: Install Ruby, NodeJS and Nginx As described at (URLs) Install PostgreSQL etc. Install ImageMagick As described at (URLs) Install Decidim Configure Nginx and hide the secrets As described at (URLs). IMHO, local setup guide and deployment guide should be separate. |
Instructions for:
🎩 What? Why?
There are some newcommers to the project that don't understand that well the manual installation instructions. This tries to fix that and also show some good practices on Ruby on Rails development (ie using git, figaro, etc).
📌 Related Issues
None
📋 Subtasks
None
📷 Screenshots (optional)
None