Skip to content

Commit

Permalink
Relax restriction on [admins] in dev local.ini
Browse files Browse the repository at this point in the history
Currently, `dev/run` relies on the `[admins]` section be last in
`local.ini`, or it will fail to start and log this message:
```
[info] 2023-12-02T21:50:40.510174Z node1@127.0.0.1 <0.262.0> --------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  No Admin Account Found, aborting startup.
  Please configure an admin account in your local.ini file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
```

This relaxes that restriction by inserting the admin user just after
the `[admin]` section line, rather than at the end of the file.
  • Loading branch information
jaydoane committed Dec 4, 2023
1 parent 326af35 commit 9d0e067
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dev/run
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,9 @@ def hack_local_ini(ctx, contents):
else:
user, pswd = ctx["admin"]

# this relies on [admin] being the last section at the end of the file
contents = contents + "\n%s = %s" % (user, hashify(pswd))
contents = contents.replace(
"\n[admins]\n", "\n[admins]\n%s = %s\n" % (user, hashify(pswd))
)

return contents + "\n\n[chttpd_auth]\nsecret = %s\n" % COMMON_SALT

Expand Down

0 comments on commit 9d0e067

Please sign in to comment.