Skip to content
This repository was archived by the owner on May 3, 2020. It is now read-only.
This repository was archived by the owner on May 3, 2020. It is now read-only.

make first_time.rb init script safe to run multiple times #400

@schrnz

Description

@schrnz

Bug/Feature Request

The file first_time.rb is used for first time setup like creating the first (administrator) user or importing issue templates.

For the above mentioned cases, the scripts actually checks if this has been done before and skips the corresponding init code accordingly. However, for creating a self-signed certificate and copying over the default config, no such checks exist.

From a design perspective, this is a bug b/c half of the measures are safe to redo and the other half is not. One could argue that a one time init scripts does not have to be save, but why have the checks for half of the code then?

Of course this is only important in cases where we invoke the script multiple times, so let me give you the use case where I encountered this problem: docker

Why this is interesting for using Serpico with docker

In my understanding of docker and best practices, we should not have the initialization of data at build time (possible problems with volumes or folder mounts and data loss) but at runtime, hence it must be placed somehow in the CMD or ENTRYPOINT. In this case, it is executed everytime a container is (re)started and therefore a safe init command would solve the problem. This can also be solved by implementing a script wrapper that does those checks, but why then not directly implementing it where it belongs? In addition, just requiring a user to execute it once by hand seems to be not docker'ish, b/c then it does not work out of the box.

I would assume the required changes are minimal, but I am new to Serpico so this is just an estimation. Maybe there are hidden dependencies =)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions