Coder Social home page Coder Social logo

Database not persistent? about kimai2 HOT 7 CLOSED

tobybatch avatar tobybatch commented on July 30, 2024 1
Database not persistent?

from kimai2.

Comments (7)

tobybatch avatar tobybatch commented on July 30, 2024

@davidbeijer If you don't mount the DB into a persistent store somewhere then it will not survive restarts.

I'd suggest using the docker compose method. This will start a mysql DB alongside the kimai app. The data from that mysql instance will be in ./mysql

from kimai2.

davidbeijer avatar davidbeijer commented on July 30, 2024

@tobybatch first of all thanks for quick response! I've found the yml file for the docker compose method. Despite that option missing from the kimai documentation (I would volunteer to add that once I understand it) I have figured out how to launch the app as described here: https://docs.docker.com/get-started/part3/. While it is running and claiming that the ports are exposed, those ports do not show up if I nmap the host and I can not connect to the app.

I am unsure if this is a problem with the .yml file, googling on topics related to "docker app ports not opening up" and similar did result in usable results for me.

from kimai2.

tobybatch avatar tobybatch commented on July 30, 2024

@davidbeijer Can supply the command you are using to start the container please?

Have you looked at this page?

https://github.com/tobybatch/kimai2/blob/master/prod/README.md

from kimai2.

davidbeijer avatar davidbeijer commented on July 30, 2024

@tobybatch, yes I saw the README.md for prod. I can run it, it comes up, the port shows up if I nmap the host, however the datastorage is not persistent, and hence me going for the compose-approach.

The commands I run are (assuming a clean install, a clean pull from the github repository, and ip address using the public IP address of the host machine):
docker swarm init --advertise-addr xx.xx.xx.xx:8080
docker stack deploy -c docker-compose.yml kimai2

After that, "docker service ls" returns:

ID NAME MODE REPLICAS IMAGE PORTS
tdcs0nrsgwdi kimai2_kimai replicated 0/1 kimai/kimai2:prod *:8080->8080/tcp
4te16zutqnqe kimai2_mydb replicated 0/1 mysql:5.6

however nmap does not show an open port at 8080 (both when nmap from the host machine to localhost as from my PC towards the server).

from kimai2.

tobybatch avatar tobybatch commented on July 30, 2024

@davidbeijer Thanks you've found a bug in the doc's :(

The port number in the docs should have been 8001 not 8080. Please try to move to that port and restart the containers.

from kimai2.

davidbeijer avatar davidbeijer commented on July 30, 2024

Hi Toby,

Thanks for the support! I donated to the project via Kevin, couldn't find you specifically on the Kimai2 website.

I got it running today with a persistent database. One problem was the ports as set in the docs, on the other hand my method of bringing the compose entity up did not expose the ports to the outside world. Using "docker-compose up" however did work. I'll write that off to me being relatively new with docker. Could be useful to add to the documentation to avoid other newbies run into this.

One feature suggestion I would have would be the ability to disable the "register new user" link as soon as the first user has registered, or having a tick option somewhere in the configuration window. That would greatly increase the security of the app, without the owner having to manage with configuration files.

from kimai2.

kevinpapst avatar kevinpapst commented on July 30, 2024

Hi David, first of all: thanks!
Now we are mixing docker and non-docker issues, but well ... here we go:
Some configs are so deeply integrated, that having them on the UI would introduce a couple of problems from a development perspective.
Also: I would have to spent a lot of time into things which don't bring any benefit to the actually time-tracking - that's why I decided that everyone can simply create a local.yaml and configure the stuff he needs once.
There were a lot of discussion about the "Register new user" link, but to summarize it: even though it is possible to create your first user via command line, it is not possible for the folks who do not have a bash (👎 for shared hosting, but that is still the case for many people out there).
So having that link activated by default is the only option to allow these users to create their first account.
Yes its contrary to "security by default" and maybe I can change it later on, when there is an installer and different packages existing. But for now, please create your local.yaml config: https://github.com/kevinpapst/kimai2/blob/master/var/docs/configurations.md#security

Maybe its an idea to have a separate docu chapter about "first time configurations" or some sample local.yaml to provide help with the first steps.

from kimai2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.