-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerfile that builds with poetry #493
Conversation
To test: ``` DOCKER_BUILDKIT=1 docker build . -t sydent && docker run sydent ``` To inspect the container while it's running, get the container id with `docker ps` and then: ``` $ docker exec -it 001f9bfc6a54 bash sydent@001f9bfc6a54:/home/sydent$ ls src venv sydent@001f9bfc6a54:/home/sydent$ ls src README.rst poetry.lock pyproject.toml requirements.txt res scripts sydent sydent@001f9bfc6a54:/home/sydent$ ls venv bin lib pyvenv.cfg ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good :)
@@ -39,15 +47,16 @@ RUN addgroup --system --gid 993 sydent \ | |||
&& mkdir /data \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realise this isn't yours, but on the line above, why are we creating a password for the sydent user?
It originally has a disabled password. There's no reason to set a static password ... is there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered about this too. I removed this from the builder step (see line -13).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reckon we just remove it here as well. A password that is the same for every Sydent container doesn't seem to afford any security anyway.
I also notice --disabled-login
is an option rather than --disabled-password
Excerpt from /etc/shadow
:
dpass:*:19033:0:99999:7:::
dlogin:!:19033:0:99999:7:::
If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log in (but the user may log in the system by other means).
—
man shadow
--disabled-login
sounds like it (!
) will also prevent SSH login using authorised keys. I guess we're not running an SSH daemon anyway, so it probably doesn't matter which one we use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A password that is the same for every Sydent container doesn't seem to afford any security anyway.
The password comes from /dev/random so I would expect it to be different every time you run build this container. I still think it's odd though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if it gets uploaded to Docker Hub or something, everyone can then pull that and even crack the password hash if they're so keen. I'd pull it out — the password isn't even being given to anyone so I can't see how it's useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see---good point. Yes, let's excise it
Co-authored-by: reivilibre <oliverw@matrix.org>
Co-authored-by: Shay <hillerys@element.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
To test:
I've seen this print sydent's startup lines and persist data to the
/data
volume. I could make a GET request to localhost:8090/ and got a 404 error page for my troubles, together with an entry in Sydent's log. I haven't tested this any more thoroughly than that.To inspect the container while it's running, get the container id with
docker ps
and then:Pull Request Checklist
EventStore
toEventWorkerStore
.".code blocks
.