Review of dashohoxha's docker script

This is a followup on Make FSFE gitea available for the general public - #6 by dashohoxha that i decided to put in a new post to avoid going off-topic and to show how the community review could work as discussed in FSFE-defined coding standards? - #14 by kreyren

Review about scripts/gitea.sh · master · docker-scripts / gitea · GitLab


Consider POSIX as it makes your shell script more functional

Shell is not C/C++/Rustlang this is a bad practice imho

This task should be called only once and as such function definition is bloat

Consider:

cat <<-CONFIG ...
    [Unit]
    Description=Gitea (Git with a cup of tea)
    After=syslog.target
CONFIG

For better readability

I would be checking for content there instead of file for it to be more robust

Also by wrapping everything in script instead of using RUN you are making the whole work harder to work with as the steps are cached.

Also consider using shellcheck GitHub - koalaman/shellcheck: ShellCheck, a static analysis tool for shell scripts to lint the code.

You are also using various scripts to set up databases which i consider a bad design as the databases should be deployed using a docker-compose set up using environment variables e.g. http://ix.io/2Ph5 so that you can deploy them on demand.

Consider looking on my rework in Docker: Rework by Kreyren · Pull Request #14626 · go-gitea/gitea · GitHub with design decisions and i recommend proposing the changes to upstream so that they can be maintained and deployed there.

Thanks for your quick reply.
However I don’t think that coding standards are a good idea. Especially trying to enforce them is a bad idea, IMHO. I think that coding is a kind of art, and it would be crazy to impose standards on what is a good music, or a good painting, or a good literature. I don’t know why people try to impose their humble opinions on others, when instead they can try to show the best way by their good example.

Anyway, I hope that you will try to install Gitea using these scripts and see whether they make the process a little bit easier (instead of adding another layer of complexity).

I love that you are contributing to Gitea code. But please allow me to refrain myself from commenting on your coding style.

Lets move that in the relevant discussion.

I am considering them, was hoping to discuss your design decisions ^-^