Code Monkey home page Code Monkey logo

fms-logviewer-backend's Introduction

fms-logviewer-backend

Table of Contents

About the Project

The Project is the backend for the FileMaker Server LogViewer.

Since FileMaker Server 17 there is no convenient way for reading the log files. This project helps to overcome this circumstance.

Update: Since FileMaker Server 19.3.* there is a possibility to read and analyze log files directly in the FileMaker Server user interface. In my opinion, it is still not a good way to do it.

Prerequirements

Node.js >= 12.x

Instructions

Setup

  1. Download zip file from here or
git clone https://github.com/agametis/fms-logviewer-backend.git
  1. Unpack the file into a directory at any location on the machine where FileMaker Server is installed or go to the folder created by git
  2. Replace or modify all files in the "encryption" subdirectory
  3. Rename file ".env-example" to ".env" on the command line
  • on Windows:
ren .env-example .env
  • on macOS:
vm .env-example .env
  1. Adapt file ".env"
    • password for private key ("PASSPHRASE")
    • if needed, change port, if 3050 can not be used
  2. Customize "server.js" with correct certificate files. Alternatively, the files in the "encryption" directory can be renamed, then this step is omitted.
    • Constants "key", "cert" and "ca" ("key" is the private key, "cert" is the certificate, "ca" is the intermidiate certificate from the CA)
  3. To install all node modules dependencies run in the root directory of the application
npm install
  1. Start the server with
npm start

Firewall on Linux

In the standard configuration port 3050 is usually not open for incomming traffic. Therefore, you need to add rules to your firewall configuration. At the moment, FileMaker Server is running on Ubuntu 18.04 LTS. To open port 3050 in the firewall, the following procedure is recommended:

  1. Open a super user session in your terminal on the server
sudo su
  1. Check if port 3050 is free
firewall-cmd --list-all

In the output you will see the missing port 3050

public
  target: default
  icmp-block-inversion: no
  interfaces:
  sources:
  services: ssh dhcpv6-client
  ports: 80/tcp 443/tcp 5003/tcp 16000/tcp 2399/tcp
  protocols:
  masquerade: no
  forward-ports:
  source-ports:
  icmp-blocks:
  rich rules:

As you can see, port 3050 is not open

  1. To open port 3050 use
firewall-cmd --zone=public --permanent --add-port=3050/tcp

In case, the port should not be open to the public, you need to apply the rule to your preferred zone.

  1. Apply the new rule
firewall-cmd --reload
  1. Check the status
firewall-cmd --list-all

The output lists the newly open port 3050.

...
  services: ssh dhcpv6-client
  ports: 80/tcp 443/tcp 5003/tcp 16000/tcp 2399/tcp 3050/tcp
  protocols:
...

The new rule is permanently stored, so a reboot of the Linux server preserves the new rule.

Remark for command iptables. With the command iptables -L you will get

...
Chain IN_public_allow (1 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:5003 ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:16000 ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:2399 ctstate NEW
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:gds-db ctstate NEW
...

where gds-db is indicating the open port 3050.

Additional Info

  • The firewall of your operating system or network must allow communication on the port specified in ".env" (default is 3050)
  • The user running the Node.js server must have read permissions for the FileMaker Server "Logs" directory.
  • To test the functionality, the address "https://localhost:3050/event" can be called locally in your browser. In the sucessfull response you will see the content of "Event.log" in JSON format in the browser window.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Adam Augustin - @agametis - [email protected]

Project Link: https://github.com/agametis/fms-logviewer-backend

Anleitung

Inbetriebnahme

  1. Download Zip-Datei von hier oder
git clone https://github.com/agametis/fms-logviewer-backend.git
  1. Entpacke in ein Verzeichnis an beliebiger Stelle auf dem Rechner, auf dem der FileMaker Server installiert ist oder gehe in das mit git erzeugte Verzeichnis
  2. Ersetze/bearbeite alle Dateien im "encryption" Unterverzeichnis
  3. Im Hauptverzeichnis der Anwendung die Datei ".env-example" auf der Kommandozeile in ".env" umbenennen
  • unter Windows:
ren .env-example .env
  • unter MacOS:
mv .env-example .env
  1. Datei ".env" anpassen
    • Passwort fürs den privaten Schlüssel ("PASSPHRASE")
    • eventuell Port, wenn die Nutzung von 3050 nicht möglich ist
  2. "server.js" mit korrekten Zertifikatsdateien anpassen. Alternativ können die Dateien im Verzeichnis "encryption" umbenannt werden, dann entfällt dieser Schritt
    • Konstanten "key", "cert" und "ca" ("key" ist der private Schlüssel, "cert" ist das Zertifikat, "ca" ist das Zwischenzertifikate der CA)
  3. Im Hauptverzeichnis der Anwendung alle Node-Module installieren
npm install
  1. Server starten mit
npm start

Firewall unter Linux

Im Moment läuft FileMaker Server auf Ubuntu 18.04 LTS. In der Standardkonfiguration is der Port 3050 geschlossen. Um den Port 3050 in der Firewall zu öffnen, siehe die Anleitung oben.

Allgemeine Infos

  • Die Firewall des Betriebssystems bzw. des Netztwerkes muss die Kommunikation auf dem Port (standard ist 3050) zulassen, welcher in ".env" definiert ist
  • Der User, unter dem der Node.js Server läuft, muss Leserechte für das "Logs"-Verzeichnis des FileMaker Server haben
  • Zum Testen der Funktionalität kann lokal die Adresse "https://localhost:3050/event" im Browser aufrufen werden. Als Antwort muss man den Inhalt von "Event.log" im JSON-Format im Browser sehen

fms-logviewer-backend's People

Contributors

agametis avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.