Markus Hennecke 535870f832 PostgreSQL 16 requires libm when linking | hai 11 meses | |
---|---|---|
htdocs | hai 1 ano | |
input | hai 11 meses | |
output | hai 11 meses | |
sql | hai 1 ano | |
.gitignore | %!s(int64=6) %!d(string=hai) anos | |
Makefile | %!s(int64=6) %!d(string=hai) anos | |
README.md | %!s(int64=6) %!d(string=hai) anos | |
cflags.mk | %!s(int64=4) %!d(string=hai) anos | |
cgiconfig.mk | %!s(int64=6) %!d(string=hai) anos | |
db.c | hai 11 meses | |
db.h | hai 1 ano | |
util.c | hai 1 ano | |
util.h | hai 1 ano |
CGIs for adding and retrieving weatherdata, at this time temperature and humidity.
Create database user weatherdata:
createuser -U postgres -D -l -R -S --pwprompt weatherdata
Create the database and make the weatherdata user the owner:
createdb -U postgres -E UTF8 -O weatherdata weatherdata
Add the data table to the database:
psql -U weatherdata -f sql/database.sql weatherdata
An optional make include named 'localconfig.mk' may be used to overwrite variables defined in 'cgiconfig.mk'. Possible configuration settings and their default settings are:
DATABASE_HOSTNAME: 127.0.0.1
DATABASE_PORT: 5432
DATABASE_USER: weatherdata
DATABASE_PASSWORD: The password the weatherdata user is connecting to the database. This will end up in 'localconfig.mk' most likely.
HTDOCS_PATH: Path to the document root the webserver uses to serve HTML,
defaults to /var/www/htdocs
.
WWW_USER: The user that will own the installed files, defaults to www
.
WWW_GROUP: The group the files will be installed with, defaults to www
.
The make files are valid on OpenBSD systems, the postgresql-client and kcgi packages needs to be installed to build the CGIs.
It is assumed that the slowcgi(8) daemon is running.
make all
As root issue make install
.