- Go 86%
- HTML 8.1%
- CSS 3%
- Makefile 2.9%
| addstaff | ||
| config | ||
| database | ||
| mailwages | ||
| server | ||
| wageadd | ||
| wagedump | ||
| wageserver | ||
| COPYING | ||
| go.mod | ||
| go.sum | ||
| Makefile | ||
| README.md | ||
wageserver
wageserver manages employee wages for businesses.
It will:
- interface with the employee to record when they begin or end a shift
- track hours for the current pay period in a database
- log shift start+finish times for each employee
- email the employer a list of hours from each employee when the configured pay period has elapsed
To implement:
- send a list of shifts as part of the email to employers
- clear the wage database after the pay period is over
- notify whenever a shift is started/ended with total hours
- employer dashboard
- public holiday pay
- mobile friendly layout
Build
With the Go toolchain installed, use
make
sudo make install
Usage
First, create a file wageserver.conf and fill it with the following:
bind-address = 127.0.0.1
bind-port = 8090
database-host = 127.0.0.1
database-name = wageserver
database-password =
database-port = 5432
database-user = wageserver
instance-name = Untitled wage server
period-length = 14
period-start = 2026-05-11
mailer-email =
smtp-host =
smtp-port = 465
smtp-user =
smtp-password =
The values presented here are the defaults; if you remove one of these lines, it will still be implied. Thus you can run the program with an empty configuration file if you wish, as long as the file is still there.
A simple installation can be achieved by leaving pretty much
everything on the defaults. The only values you should really need to
change are database-password, instance-name, and the mailer/SMTP
options, unless you want to set it up differently. On my setup I leave
the port set to 8090 because I run the program behind a reverse proxy
to get SSL. All of the fields should make it pretty obvious what they
do.
To set up a proper SMTP configuration (for sending wage emails to the employer), set:
mailer-addressto your mailer's email address (e.g. wages@business.com)smtp-hostandsmtp-portto your SMTP server address and portsmtp-userto your SMTP username (probably the same asmailer-address)smtp-passwordto your SMTP password.
In theory you could run wageserver without setting up SMTP, but when
your first pay period is due the program will try to send an email
using invalid settings. To test whether you have set up SMTP properly,
you can use the mailwages tool which is called on schedule by the
server to mail wages to the employer.
After that, make sure to set up the database properly:
$ sudo -u postgres psql
postgres=# CREATE ROLE wageserver WITH LOGIN PASSWORD 'mypassword';
postgres=# CREATE DATABASE wageserver OWNER wageserver;
Now we can add our employees to the database:
$ addstaff Joe joe@blogs.com
New password for Joe:
$ addstaff Jane jane@blogs.com
New password for Jane:
Now that everything is all set up run the program in the directory with wageserver.conf:
$ wageserver
Other binaries
The wageserver suite provides other binaries that can enable administration tasks, such as:
addstaff: create a new staff membermailwages: write an email to the employer containing wages for this pay periodwageadd: add wages for a staff member manuallywagedump: dump the current wage database to standard output
Accessing the site
Point your web browser to the address specified in your configuration. Or, if you have a reverse proxy then use that.
When prompted to enter a username and password, let the employees simply enter their passkey in the password field. Usernames are ignored.
The interface is very simple, consisting of either a "start shift" button or an "end shift" button. It also tells the employee how many hours they have in total for this pay period.
Licence
Thank you for using wageserver. You are free to use or redistribute wageserver in any way you please, in accordance with the GNU Affero General Public License version 3 distributed with the program in the file COPYING.