Skip to content
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

Docker entrypoint fixes #753

Merged
merged 15 commits into from
May 29, 2023
Merged

Conversation

tcely
Copy link
Contributor

@tcely tcely commented May 12, 2023

Here are most of the changes from my previously NACK'd rewrite PR. #746

Capitalized environment variables still needs to be done and the README will need updates for that part.

That work was done in #750 instead.

@tcely tcely marked this pull request as ready for review May 12, 2023 09:17
@tcely tcely requested a review from shumvgolove as a code owner May 12, 2023 09:17
@shumvgolove
Copy link
Collaborator

Hey, could you rebase your changes against master? After that, I'll make a review.

tcely added 8 commits May 13, 2023 17:14
Don't Repeat Yourself

Set a variable for the full path to the source file.

Create the backup path by appending an extension from `date` output.

Also fixed quoting and switched to an `if` block.

Clean up block level variables.
The previous format discards information about the local time zone.
Now the format always ends in +00:00, and we can ignore that part again.
Present a leading zero before the month:
YYYY-0MM-DD

Both YYYY-MM-DD and YYYY-DD-MM are used by people and can be confusing in the beginning of the month.
Without avoiding field splitting a password containing a space changes the number of arguments being set.
Make the intentions clear and don't assume the user knows the special cases for when variables won't be extended.

Example:
word=animal
words=mistake
echo "$words vs $word vs ${word}s"
@tcely
Copy link
Contributor Author

tcely commented May 13, 2023

@shumvgolove Rebased and I also made similar changes for the new entrypoint file you added.

scripts/docker/entrypoint-smp-server Show resolved Hide resolved
scripts/docker/entrypoint-smp-server Outdated Show resolved Hide resolved
tcely added 4 commits May 16, 2023 01:01
* switched from long to short option to date for POSIX

* docker entrypoint-smp-server: explain date format

* docker entrypoint-xftp-server: explain date format
I fixed the case to match the date format letters.

Also, use words to explain since I don't want everyone to need to read about date formats to understand.
I was either going to quote the dashes too or stop quoting the colons.

Having less quotes was more readable.
@tcely tcely requested a review from shumvgolove May 17, 2023 05:38
@tcely
Copy link
Contributor Author

tcely commented May 20, 2023

@shumvgolove GitHub did not seem to track this PR state correctly.

The date format has been reverted and appropriate comments are included.

@shumvgolove
Copy link
Collaborator

Sorry, got a little busy last week.

It appears that %F isn't POSIX complaint either, because there isn't any mention of it in the specification. So we're probably need to change it to %Y-%m-%d, as hinted by coreutils page.

* docker entrypoint-smp-server: remove %F

Used part of the explicit ISO 8601 format,
provided by the coreutils date invocation guide.

* docker entrypoint-xftp-server: remove %F

Used part of the explicit ISO 8601 format,
provided by the coreutils date invocation guide.
@shumvgolove shumvgolove merged commit 20f7b53 into simplex-chat:master May 29, 2023
1 of 2 checks passed
@shumvgolove
Copy link
Collaborator

Thanks!

@tcely tcely deleted the docker-entrypoint branch May 30, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants