arduosoft / RawCMS

RawCMS is the headless CMS written in asp.net core build for developers that embraces API first technology. Please give us a feedback!
https://forms.gle/wvu1HF9P52ZdXujv6
GNU General Public License v3.0
173 stars 72 forks source link

Initial user setup #226

Open zeppaman opened 4 years ago

zeppaman commented 4 years ago

User story

When rawcms starts for the first time creates a new user. This user as a fixed username and passwro. This may bring to security issue.

task

Use environment variables to get it form the docker container or from OS. In case this variable wont be set, we will use default values ( username: admin password: rawcmsrocks)


IdentityUser userToAdd = new IdentityUser()
                {
                    UserName = "bob",
                    NormalizedUserName = "BOB",
                    Email = "test@test.it",
                    NormalizedEmail = "test@test.it",
                    NewPassword = "XYZ",//password will be hashed by service

                };
``
https://github.com/arduosoft/RawCMS/blob/master/Plugins/RawCMS.Plugins.Core/Stores/RawUserStore.cs

The env variables will be:
RAWCMS_INITIAL_USER, RAWCMS_INITIAL_PASSWORD, RAWCMS_INITIAL_EMAIL

Update documentation accordingly

## acceptance criteria
The following test is perfomend
- set values for RAWCMS_INITIAL_USER, RAWCMS_INITIAL_PASSWORD, RAWCMS_INITIAL_EMAIL different than the default one
- delete db
- start rawcms
- you can log in with the credential provided into env variables

- the documentation on deploy is updated
Dansr81 commented 4 years ago

@zeppaman I can work on this task

zeppaman commented 4 years ago

assigned