Skip to content
This repository was archived by the owner on Sep 27, 2021. It is now read-only.

Commit d3c803b

Browse files
committed
Automate password reset of root user
1 parent 60039c0 commit d3c803b

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.docker/entrypoint

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ fi
2424

2525
if [ "$RAILS_ENV" == "development" ]; then
2626
if [ ! -f /seed/done ]; then
27-
echo "⚙️ Seeding DB"
27+
echo "⚙️ Seeding DB and resetting root user password"
2828
bundle exec rake db:seed wagon:seed && date > /seed/done
29-
echo "✅ Seeding done"
29+
echo 'p=Person.first; p.update(password: "password"); "You can now login under http://localhost:3000 as #{p.email} with the password '"'"'password'"'"'"' | rails c
30+
echo "✅ Seeding and password reset done"
3031
else
3132
echo "↪️ Skipping seeding because already done on $(cat /seed/done)"
3233
fi

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,7 @@ In order to "receive" emails, you can open mailcatcher under [http://localhost:1
6161
It will initially take a while to prepare the initial Docker images, to prepare the database and to start the application.
6262
The process will be shorter on subsequent starts.
6363

64-
## First Login
65-
66-
Get the login information via the Rails console.
67-
68-
```bash
69-
echo 'p=Person.first; p.update(password: "password"); "You can now login under http://localhost:3000 as #{p.email} with the password \'password\'"' | \
70-
docker-compose run --rm -T app rails c
71-
```
72-
73-
Now you should be able to log-in with the email address in the output and the password _password_.
64+
Once this is done, you should be able to log-in with the email address in the output and the password _password_.
7465

7566
## Debug
7667

@@ -113,6 +104,12 @@ If you need to re-seed your db, use the following command:
113104
docker-compose run --rm app rake db:seed wagon:seed
114105
```
115106

107+
After that, you might need to reset the root user's password again:
108+
```
109+
echo 'p=Person.first; p.update(password: "password"); "You can now login under http://localhost:3000 as #{p.email} with the password '"'"'password'"'"'"' | \
110+
docker-compose run --rm -T app rails c
111+
```
112+
116113
## Full-text search
117114

118115
Hitobito relies on Sphinx Search for indexing Persons, Events and Groups.

0 commit comments

Comments
 (0)