loading...
Cover image for Time Tracking: Kimai1 on OpenBSD

Time Tracking: Kimai1 on OpenBSD

nabbisen profile image Heddi Nabbisen Originally published at dev.to ・3 min read

Introducation

Kimai is open source time-tracking app.
There are two major versions: Kimai1, which is GPLv3 licensed, and Kimai2, which is MIT licensed.
I'll show how to install Kimai1 in this post.

I tried to install both of Kimai1 and Kimai2.
Why also Kimai1?
It's because Kimai2 didn't have Japanese translation!
(Besides, I made pull request about it today. Aha.)

Environment

Tutorial

The official installation manual is here.

Requirements

First of all, you have to have:

Additionally, HTTPS is recommended.

DB server

Create database and user:

CREATE DATABASE <database> CHARACTER SET = 'utf8mb4';
GRANT ALL PRIVILEGES ON <database>.* TO <dbuser> IDENTIFIED BY '<dbpass>';

App server

Get the package:

$ ftp https://github.com/kimai/kimai/releases/download/1.3.1/kimai_1.3.1.zip

$ unzip kimai_1.3.1.zip -d kimai1

Then modify the permissions:

$ cd kimai1

# chown -R :www .
# chmod -R g+r .
# chmod -R g+rw {temporary,temporary/logfile.txt,includes}

Web server

Add configuration:

server "<fqdn>" {
        listen on $ext_addr port 80
        block return 301 "https://$SERVER_NAME$REQUEST_URI"
}
server "<fqdn>" {
        listen on $ext_addr tls port 443
        tls {
                certificate     "/etc/letsencrypt/live/<fqdn>/fullchain.pem"
                key             "/etc/letsencrypt/live/<fqdn>/privkey.pem"
        }

        root "/<...>/kimai1"
        directory index index.php

        location "/*.php" { 
                fastcgi socket "/run/php-fpm.sock"
        } 
        location "/*.php[/?]*" {
                fastcgi socket "/run/php-fpm.sock"
        }
}

Then restart the web server:

# rcctl restart httpd

Now we can run the web installer with browsers.
Let's go to https://<fqdn>.

Web Installer

Follow the guidance:

web install
web install
web install
web install
web install
web install
web install

* Caution: Replace localhost with 127.0.0.1 as needed.

web install
web install

Installation is now ready.
It starts by clicking the "Install" button.

login form

We have reached the login form.
The initial settings are:

  • Username: admin
  • Password: changeme

succeeded

OK!
Remove the installer:

$ rm -rf installer

Than's all!

Conclusion

These are usage screenshot examples.
Unique and cool design. I sometimes feel kinda nostalgia somehow... :)

usage
usage
usage

Thank you for your reading.
Happy computing.

Posted on by:

nabbisen profile

Heddi Nabbisen

@nabbisen

An ICT designer/developer and a security monk. "With a cool brain and a warm heart", I am challenging unsolved problems in our society. I use OpenBSD/Rust/etc.

Discussion

pic
Editor guide