Skip to content

Commit

Permalink
Improve test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
roleoroleo committed Mar 20, 2024
1 parent 9a002b4 commit 74f374e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ The onvif server instead runs as CGI and therefore needs an http server that sup
- [Donation](#donation)

## Build
- Open the Makefile and edit the path to the libtomcrypt library to suit your needs
- Run make

Or:

- Open the extras folder.
- Customize build.sh script
- Run build.sh
- Open the `Makefile` and edit the path to the libtomcrypt library to suit your needs
- Run `make`

## Create a working example with lighttpd
- Open extras folder
- Customize `build.sh` script, if you want
- Run `./build.sh`
- Copy the content of the `_install` folder to `/usr/local`
- Run `/usr/local/bin/lighttpd -f /usr/local/etc/lighttpd.conf`
- Run your preferred client and test the address `http://YOUR_IP:8080/onvif/device_service`

## Configuration
### onvif_simple_server
Expand Down
4 changes: 4 additions & 0 deletions extras/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ LIGHTTPD=lighttpd-1.4.73

# Don't edit below this line

cd ../..
patch -p0 < onvif_simple_server/extras/path.patch
cd onvif_simple_server/extras

mkdir -p $INSTALL_DIR/bin
mkdir -p $INSTALL_DIR/etc/onvif_notify_server
mkdir -p $INSTALL_DIR/etc/wsd_simple_server
Expand Down
45 changes: 45 additions & 0 deletions extras/path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff -Naur onvif_simple_server.ori/onvif_notify_server.c onvif_simple_server/onvif_notify_server.c
--- onvif_simple_server.ori/onvif_notify_server.c 2023-12-09 22:58:35.403631631 +0100
+++ onvif_simple_server/onvif_notify_server.c 2023-12-09 22:59:34.011730308 +0100
@@ -39,10 +39,10 @@
#include "log.h"
#include "onvif_simple_server.h"

-#define DEFAULT_CONF_FILE "/etc/onvif_simple_server.conf"
-#define DEFAULT_LOG_FILE "/var/log/onvif_notify_server.log"
+#define DEFAULT_CONF_FILE "/usr/local/etc/onvif_simple_server.conf"
+#define DEFAULT_LOG_FILE "/var/log/onvif_notify_server.log"
#define DEFAULT_PID_FILE "/var/run/onvif_notify_server.pid"
-#define TEMPLATE_DIR "/etc/onvif_notify_server"
+#define TEMPLATE_DIR "/usr/local/etc/onvif_notify_server"
#define INOTIFY_DIR "/tmp/onvif_notify_server"

#define ALARM_OFF 0
diff -Naur onvif_simple_server.ori/onvif_simple_server.c onvif_simple_server/onvif_simple_server.c
--- onvif_simple_server.ori/onvif_simple_server.c 2023-12-09 22:57:18.935503114 +0100
+++ onvif_simple_server/onvif_simple_server.c 2023-12-09 23:00:26.871819429 +0100
@@ -36,8 +36,8 @@
#include "utils.h"
#include "log.h"

-#define DEFAULT_CONF_FILE "/etc/onvif_simple_server.conf"
-#define DEFAULT_LOG_FILE "/var/log/onvif_simple_server.log"
+#define DEFAULT_CONF_FILE "/usr/local/etc/onvif_simple_server.conf"
+#define DEFAULT_LOG_FILE "/var/log/onvif_simple_server.log"
#define DEBUG_FILE "/tmp/onvif_simple_server.debug"

#define ROTATION_LOG_LENGTH 3
diff -Naur onvif_simple_server.ori/wsd_simple_server.c onvif_simple_server/wsd_simple_server.c
--- onvif_simple_server.ori/wsd_simple_server.c 2023-12-09 22:57:18.935503114 +0100
+++ onvif_simple_server/wsd_simple_server.c 2023-12-09 23:01:06.899886974 +0100
@@ -38,8 +38,8 @@
#define PORT 3702
#define TYPE "NetworkVideoTransmitter"

-#define DEFAULT_LOG_FILE "/var/log/wsd_simple_server.log"
-#define TEMPLATE_DIR "/etc/wsd_simple_server"
+#define DEFAULT_LOG_FILE "/var/log//wsd_simple_server.log"
+#define TEMPLATE_DIR "/usr/local/etc/etc/wsd_simple_server"

#define RECV_BUFFER_LEN 4096

0 comments on commit 74f374e

Please sign in to comment.