Skip to content

Commit

Permalink
Change docs to use decidim_system:create_admin command (decidim#9372)
Browse files Browse the repository at this point in the history
* Change docs to use decidim_system:create_admin command

* Add docs on how to reset system admin password

* Add links to env var and initializer docs pages

* Apply suggestion from review

Co-authored-by: Antti Hukkanen <[email protected]>

* Add the maps services link again

Co-authored-by: Antti Hukkanen <[email protected]>
  • Loading branch information
2 people authored and eliegaboriau committed Oct 25, 2022
1 parent 33d83c1 commit 23987be
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
30 changes: 21 additions & 9 deletions decidim-system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,34 @@ When using Decidim as multi-tenant, you should keep these in mind:

## Managing System admins

Currently Decidim doesn't provide a way to create the first System Admin in a new deployment. To do it, you should open a Rails console in your application and
create it:
For logging in to this dashboard, you'll need to create a system admin account from your terminal:

```ruby
Decidim::System::Admin.create!(
email: "[email protected]",
password: "your-safe-password",
password_confirmation: "your-safe-password"
)
```bash
bin/rails decidim_system:create_admin
```

Once you have created your first admin you can access the system dashboard at `https://your-decidim-deployment-host/system` and login with your newly created user.
You'll be asked for an email and a password. For security, the password will not get displayed back at you and you'll need to confirm it.

Once you have created your first admin you can access the system dashboard at `/system`. For instance, if you have Decidim running at `https://example.org`, this URL would be `https://example.org/system`.
You'll be able to login with your newly created user.

From the system dashboard you can add new admins.

⚠️ If you need to reset your administrator password you'll need to do it by entering the Rails console and changing it manually. ⚠️

. Open the rails console:
```bash
bin/rails console
```
. Run the following instructions, changing them accordingly:
```ruby
system_admin = Decidim::System::Admin.order(:id).first # for the first system admin
system_admin = Decidim::System::Admin.find_by_email "[email protected]" # if you already know the email
system_admin.password = "decidim1234567890" # change for something secure
system_admin.password_confirmation = "decidim1234567890"
system_admin.save
```

## Managing organizations

Once you have your system admin setup you can also start managing the organizations in your deploy. To do it, login at the system dashboard and create a new organization
Expand Down
18 changes: 9 additions & 9 deletions docs/modules/install/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Visit http://localhost:3000 to see your app running.

== Configuration & setup

Decidim comes pre-configured with some safe defaults, but can be changed through the `config/initializers/decidim.rb` file in your app. Check the comments there or read the comments in https://github.com/decidim/decidim/blob/develop/decidim-core/lib/decidim/core.rb[the source file] (the part with the `config_accessor` calls) for more up-to-date info.
Decidim comes pre-configured with some safe defaults, but can be changed through xref:configure:environment_variables.adoc[Environment Variables] or the xref:configure:initializer.adoc[Initializer] file in your app.

=== Scheduled tasks

Expand Down Expand Up @@ -120,27 +120,27 @@ You can configure it with `crontab -e`, for instance if you've created your Deci

=== Further configuration

We also have other guides on how to configure some extra components:
We also have other guides on how to configure some extra mandatory components:

* xref:services:activejob.adoc[ActiveJob]: For background jobs (like sending emails).
* xref:services:maps.adoc[Maps]: How to enable geocoding for proposals and meetings.
* xref:services:smtp.adoc[SMTP]: For sending emails for account registrations, password reminders, notifications, etc.
* xref:services:social_providers.adoc[Social providers integration]: Enable sign up from social networks.

== Deploy

Once you've successfully deployed your app to your favorite platform, you'll need to create your `System` user. First you'll need to create your `Decidim::System` user in your production Ruby on Rails console:
Once you've successfully deployed your app to your favorite platform, you'll need to create your `System` user. First you'll need to create your `Decidim::System` user in your terminal:

[source,ruby]
[source,console]
----
email = <your email>
password = <a secure password>
user = Decidim::System::Admin.new(email: email, password: password, password_confirmation: password)
user.save!
bin/rails decidim_system:create_admin
----

You'll be asked for an email and a password. For security, the password will not get displayed back at you and you'll need to confirm it.

This will create a system user with the email and password you set. We recommend using a random password generator and saving it to a password manager, so you have a more secure login.

Then, visit the `/system` dashboard and login with the email and passwords you just entered and create your organization. You're done! :tada:
Then, visit the `/system` dashboard and login with the email and passwords you just entered and create your organization. You're done! 🎉

You can check the https://github.com/decidim/decidim/tree/develop/decidim-system/README.md[`decidim-system` README file] for more info on how organizations work.

Expand Down

0 comments on commit 23987be

Please sign in to comment.