remi 3b2218e039 update to version 0.15.2.
input and ok tb@
2020-09-19 10:12:52 +00:00
..
2020-09-19 10:12:52 +00:00
2020-02-28 07:45:04 +00:00

$OpenBSD: README,v 1.2 2020/02/28 07:45:04 remi Exp $

+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-----------------------------------------------------------------------

Netshot requires a database which might be on the same server as Netshot
or remote. It supports PostgreSQL and MySQL/MariaDB. Below example uses
MariaDB on the same host.

- Install the package mariadb-server.
  See ${LOCALBASE}/share/doc/pkg-readmes/mariadb-server for the first
  steps after the installation.

- Create a database and a database user (change the password!):
  $ mysql -u root
  > CREATE DATABASE netshot01 CHARACTER SET utf8
    DEFAULT COLLATE utf8_general_ci;
  > GRANT ALL PRIVILEGES ON netshot01.*
    TO 'netshot'@'localhost' IDENTIFIED BY 'password';
  > quit

- Check the database connection config in ${SYSCONFDIR}/netshot.conf.
  Should netshot not start but log "The server time zone value 'CEST' is
  unreconized or represents more than one time zone" the connect string
  might be modified to look like this:
  netshot.db.url = jdbc:mysql://localhost/netshot01?serverTimezone=UTC

- Create a key and self-signed X509 certificate; alternatively you may
  use a CA-signed certificate, possibly from acme-client(1).
  # openssl req -new -x509 -days 825 \
    -subj '/CN=netshot.example.com' \
    -addext 'subjectAltName = DNS:netshot.example.com' \
    -keyout ${SYSCONFDIR}/ssl/private/netshot.key \
    -out ${SYSCONFDIR}/ssl/netshot.crt

- Export to PKCS#12 format for use with Java.
  # openssl pkcs12 -export -name netshot \
    -in ${SYSCONFDIR}/ssl/netshot.crt \
    -inkey ${SYSCONFDIR}/ssl/private/netshot.key \
    -out ${SYSCONFDIR}/netshot.pfx
  # chmod 640 ${SYSCONFDIR}/netshot.pfx
  # chgrp _netshot ${SYSCONFDIR}/netshot.pfx

- Enable and start Netshot to create the database tables.
  # rcctl enable netshot; rcctl start netshot

- Add an initial application user to the database:
  $ mysql -u root
  > USE netshot01;
  > INSERT INTO user (level, local, username, hashed_password)
    VALUES (1000, 1, 'netshot', '7htrot2BNjUV/g57h/HJ/C1N0Fqrj+QQ');

- Access Netshot with a browser on https://localhost:8443.
  (username 'netshot' with password 'netshot')