Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.git
.gitignore
vendor
node_modules
Dockerfile
docker-compose.yml
*.md
*.log
tests
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,45 @@
# CHANGELOG

## v8.3.1

* Removed deprecated `app` attribute from `general` section within `app.json`
* Fixed issue stating that the account got disabled when logging out or when accessing the web UI

## v8.3

**This update requires DB migration** - see `README.md` section `Database`

* Fixed an issue causing the plugin system to be always enabled
* Sickness and vacation entries can now have a type like worktime entries
* Fixed dispatching of `WorktimeAddedEvent` event with incorrect parameters
* Added Database migration instructions when using Docker within the `README.md` `Database` section
* Removed the `setup` folder entirely (deprecated)
* Fixed DB migrations for Docker setups

## v8.2.3

**This update requires DB migration** - see `README.md` section `Database`

* Fixed missing `status` i18n entries
* Fixed incorrect theme loading within error pages
* Removed outdated `index.css` file
* Added missing footer to project management pages
* Admins can now enable or disable users within the `userdetail` plugin

## v8.2.2

* Fixed deprecation warning for `WorktimeAddedEvent` event
* Dockerized TimeTrack:
* Added `Dockerfile` and `docker-compose.yml` to run TimeTrack within Docker
* Added `entrypoint.sh` to handle database migrations and start Apache
* Updated `README.md` with Docker instructions

## v8.2.1

* Added events for worktime correction proposals: `WorktimeCorrectionProposed`
* Sanitized outputs to prevent XSS attacks
* Added a link to the documentation within the settings page

## v8.2

* Users are now able to propose corrections to worktimes when they have been marked as for "in review".
Expand Down
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
github@openducks.org.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
86 changes: 86 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# ---- Base image ------------------------------------------------------------
FROM php:8.2-apache

# ---- System packages & PHP extensions -------------------------------------
RUN apt-get update && apt-get install -y \
libcurl4-openssl-dev \
libgd-dev \
libgmp-dev \
libicu-dev \
libonig-dev \
libxml2-dev \
libxslt1-dev \
libldap2-dev \
libzip-dev \
zip \
unzip \
git \
locales \
&& docker-php-ext-configure intl \
&& docker-php-ext-configure gd --with-jpeg --with-freetype \
&& docker-php-ext-install \
curl \
gd \
gmp \
intl \
mbstring \
mysqli \
pdo \
pdo_mysql \
xsl \
gettext \
dom \
ldap \
zip \
&& a2enmod rewrite

RUN apt-get update && apt-get install -y default-mysql-client


# ---- Add Python and smartcard support --------------------------------------
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
pcscd \
pcsc-tools \
libpcsclite-dev \
&& pip3 install pyscard \
&& systemctl enable pcscd || true \
&& rm -rf /var/lib/apt/lists/*


RUN { \
echo "display_errors = Off"; \
echo "display_startup_errors = Off"; \
echo "log_errors = On"; \
echo "error_reporting = E_ALL & ~E_DEPRECATED & ~E_WARNING & ~E_NOTICE"; \
echo "error_log = /var/log/php_errors.log"; \
} > /usr/local/etc/php/conf.d/99-production.ini


# ---- Locale configuration --------------------------------------------------
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen

# ---- Working directory -----------------------------------------------------
WORKDIR /var/www/html

# ---- Copy application files ------------------------------------------------
COPY . /var/www/html

# ---- Permissions -----------------------------------------------------------
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html

# ---- Apache vHost ----------------------------------------------------------
COPY docker/apache2.conf /etc/apache2/sites-available/000-default.conf

# ---- Composer --------------------------------------------------------------
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN composer install --no-dev --no-interaction --optimize-autoloader

# ---- Entry point -----------------------------------------------------------
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ TimeTrack aims to be an easy-to-use time recording software for small enterprise

## Installation

### Quick Install with Docker

You can quickly get started with TimeTrack using Docker. Follow these steps:

* Ensure you have Docker and Docker Compose installed on your system.
* Clone the TimeTrack repository: `git clone https://github.com/Ente/timetrack.git` & `cd timetrack`
* Build the Docker image: `docker build -t openducks/timetrack .`
* Create a `app.json` configuration file based on the provided sample below: `cp api/v1/inc/app.json.sample api/v1/inc/app.json` and edit it to fit your needs.
* Adjust the database settings if needed (at least `db_password`)
* Change the base_url to match your setup (e.g. `localhost:8080`)
* **Change the DB password before using in production within the `docker-compose.yml` and `app.json` file!**
* Start the services using Docker Compose: `docker-compose up -d`
* Access TimeTrack in your web browser at `http://localhost:8080`
* Login with username `admin` and password `admin`

Certain features, like the NFC login may require additional setup for parsing the USB device.

### Requirements

- PHP 8.2 (`curl|gd|gmp|intl|mbstring|mysqli|openssl|xsl|gettext|dom|ldap`) - tested with PHP 8.2.26
Expand Down Expand Up @@ -101,8 +118,6 @@ LDAP authentication works with OpenLDAP and Active Directory.

If done correctly, you should now be able to access the application via http://BASE_URL/ - redirects to http://BASE_URL/suite/

**Please delete the whole `/setup/` folder after installation**

After configuring, please rename the `app.json.sample` to `app.json` (`mv app.json.sample app.json`)

## Maintenance Mode
Expand Down Expand Up @@ -210,6 +225,7 @@ If downloaded any other way, just make sure to copy and paste the new files into
### Database

You can update the database by using `vendor/bin/phinx migrate` to migrate to latest release or `vendor/bin/phinx rollback` to rollback.
If you are using docker, you can just restart the container after updating the files, as the entrypoint will try to do the migration automatically.

## Managed Hosting

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.2
8.3.1
2 changes: 1 addition & 1 deletion api/v1/class/arbeitszeit.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ public function add_worktime($start, $end, $location, $date, $username, $type, $
Exceptions::error_rep("An error occurred while creating an worktime entry. See previous message for more information.");
return false;
} else {
EventDispatcherService::get()->dispatch(new WorktimeAddedEvent($username, ["start" => $start, "end" => $end], $Wtype), WorktimeAddedEvent::NAME);
EventDispatcherService::get()->dispatch(new WorktimeAddedEvent($username, $Wtype, ["start" => $start, "end" => $end]), WorktimeAddedEvent::NAME);
Exceptions::error_rep("Worktime entry for user '{$username}' created successfully.");
return true;
}
Expand Down
Loading
Loading