aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-02-27 17:24:33 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2020-02-27 17:40:57 +0200
commitf08fb73d6ab98b26e738d89b59f21c2f72b432a6 (patch)
treef88790a80b9403c6afc8d8c4e149293b098ca814
parenta7d03cd5f6ab8884ee2f2ef89c3e514c811c2c9f (diff)
downloadping903-f08fb73d6ab98b26e738d89b59f21c2f72b432a6.tar.gz
ping903-f08fb73d6ab98b26e738d89b59f21c2f72b432a6.tar.bz2
Add missing copylefts; improve docs
-rw-r--r--examples/README47
-rwxr-xr-xexamples/dbload15
-rwxr-xr-xexamples/inspect15
-rw-r--r--lib/apr.c44
-rw-r--r--lib/base64.c16
-rw-r--r--lib/basicauth.c17
-rw-r--r--lib/md5.h17
-rw-r--r--src/defs.h17
-rw-r--r--src/json.c17
-rw-r--r--src/json.h17
-rw-r--r--src/mem.c17
-rw-r--r--src/ping903.conf21
-rw-r--r--src/ping903q.c16
-rw-r--r--src/strsplit.c16
-rw-r--r--src/wrapacl.c18
15 files changed, 306 insertions, 4 deletions
diff --git a/examples/README b/examples/README
new file mode 100644
index 0000000..f5a1c50
--- /dev/null
+++ b/examples/README
@@ -0,0 +1,47 @@
+* Overview
+
+This directory contains example Perl scripts that access ping903
+facilities via REST API. You can use them as templates for writing
+your own configuration system, or just run them as they are, if you
+prefer.
+
+* Programs
+
+ - inspect
+ Queries the daemon for its configuration settings and displays
+ them on stdout in the format of ping903 configuration file.
+
+ - ipadd
+ Adds IP address to the list of addresses monitored by ping903.
+
+ - ipdel
+ Removes IP address from the list of monitored addresses.
+
+ - dbload
+ Populates the list of monitored addresses from a SQL database.
+
+All these programs use the LWP::Ping903 module, which provides support
+for parsing the ".ping903.cred" file. The source file for the module is
+lib/LWP/Ping903.pm. To run the programs from the examples directory,
+define the following environment variable:
+
+ export PERL5LIB=lib
+
+If you don't plan to use basic authorization, you can get rid of this
+dependency using the following command:
+
+ sed -i 's/LWP::Ping903/LWP::UserAgent/' inspect ipadd ipdel dbload
+
+* Documentation
+
+Each example is self-documented. To access the description, run the
+script with the --help option, or do "perldoc PROG".
+
+
+Local Variables:
+mode: outline
+paragraph-separate: "[ ]*$"
+version-control: never
+End:
+
+
diff --git a/examples/dbload b/examples/dbload
index f3e9ec2..245ace2 100755
--- a/examples/dbload
+++ b/examples/dbload
@@ -2,6 +2,21 @@
#! -*-perl-*-
eval 'exec perl -x -S $0 ${1+"$@"}'
if 0;
+# This file is part of Ping903
+# Copyright (C) 2020 Sergey Poznyakoff
+#
+# Ping903 is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Ping903 is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Ping903. If not, see <http://www.gnu.org/licenses/>.
=head1 NAME
diff --git a/examples/inspect b/examples/inspect
index 6aacad4..8af9b25 100755
--- a/examples/inspect
+++ b/examples/inspect
@@ -2,6 +2,21 @@
#! -*-perl-*-
eval 'exec perl -x -S $0 ${1+"$@"}'
if 0;
+# This file is part of Ping903
+# Copyright (C) 2020 Sergey Poznyakoff
+#
+# Ping903 is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# Ping903 is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Ping903. If not, see <http://www.gnu.org/licenses/>.
=head1 NAME
diff --git a/lib/apr.c b/lib/apr.c
index 1036841..d7068e9 100644
--- a/lib/apr.c
+++ b/lib/apr.c
@@ -1,3 +1,47 @@
+/*
+ * This is work is derived from material Copyright RSA Data Security, Inc.
+ *
+ * The RSA copyright statement and Licence for that original material is
+ * included below. This is followed by the Apache copyright statement and
+ * licence for the modifications made to that material.
+ */
+
+/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm
+ */
+
+/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
+ rights reserved.
+ License to copy and use this software is granted provided that it
+ is identified as the "RSA Data Security, Inc. MD5 Message-Digest
+ Algorithm" in all material mentioning or referencing this software
+ or this function.
+ License is also granted to make and use derivative works provided
+ that such works are identified as "derived from the RSA Data
+ Security, Inc. MD5 Message-Digest Algorithm" in all material
+ mentioning or referencing the derived work.
+ RSA Data Security, Inc. makes no representations concerning either
+ the merchantability of this software or the suitability of this
+ software for any particular purpose. It is provided "as is"
+ without express or implied warranty of any kind.
+ These notices must be retained in any copies of any part of this
+ documentation and/or software.
+ */
+
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#include <config.h>
#include <sys/types.h>
#include <stdint.h>
diff --git a/lib/base64.c b/lib/base64.c
index ad07a5a..c7db410 100644
--- a/lib/base64.c
+++ b/lib/base64.c
@@ -1,3 +1,19 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
#include <config.h>
#include <stdlib.h>
#include <errno.h>
diff --git a/lib/basicauth.c b/lib/basicauth.c
index 4a94726..50b5585 100644
--- a/lib/basicauth.c
+++ b/lib/basicauth.c
@@ -1,3 +1,20 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include <errno.h>
#include <pthread.h>
diff --git a/lib/md5.h b/lib/md5.h
index ffbdfb3..19c6756 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -1,3 +1,20 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
+
struct MD5Context {
uint32_t buf[4];
uint32_t bits[2];
diff --git a/src/defs.h b/src/defs.h
index 3b4dbaf..85918ef 100644
--- a/src/defs.h
+++ b/src/defs.h
@@ -1,3 +1,20 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdarg.h>
#ifndef DEFAULT_ADDRESS
diff --git a/src/json.c b/src/json.c
index d65eb2c..510c7ce 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1,3 +1,20 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/json.h b/src/json.h
index 81f6db8..5e320a1 100644
--- a/src/json.h
+++ b/src/json.h
@@ -1,3 +1,20 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <stdlib.h>
enum json_value_type {
diff --git a/src/mem.c b/src/mem.c
index 744671e..dd607c5 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -1,3 +1,20 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
+
#include <config.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/ping903.conf b/src/ping903.conf
index ecc38bf..2f00aeb 100644
--- a/src/ping903.conf
+++ b/src/ping903.conf
@@ -65,3 +65,24 @@
#
#trusted-ip 127.0.0.1
+# It is highly recommended to protect your configuration from unauthorized
+# access. To do so, use the htpasswd(1) utility to create a database of
+# users that are allowed access to configuration. Supposing this database
+# file is /etc/ping903/htpasswd, add the following statement:
+#
+#auth basic * /config /etc/ping903/htpasswd Exopotamie
+#
+# The 'Exopotamie' word in the above statement is the authentication realm
+# name. Replace it with whatever name you deem appropriate.
+
+# To limit write access to the configuration while allowing anybody to read
+# the configuration, use the following
+#
+#auth basic POST /config /etc/ping903/htpasswd Exopotamie
+#auth basic PUT /config
+#auth basic DELETE /config
+
+# For more details about basic authorization, please see the following:
+# ping903.conf(5)
+# ping903q(1), subsection "Basic authorization"
+# ping903.cred(5) \ No newline at end of file
diff --git a/src/ping903q.c b/src/ping903q.c
index a9024c7..6f84250 100644
--- a/src/ping903q.c
+++ b/src/ping903q.c
@@ -1,3 +1,19 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/strsplit.c b/src/strsplit.c
index c2e1eac..3846cbf 100644
--- a/src/strsplit.c
+++ b/src/strsplit.c
@@ -1,3 +1,19 @@
+/* This file is part of Ping903
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
+*/
#include <config.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/wrapacl.c b/src/wrapacl.c
index f195f04..db336e4 100644
--- a/src/wrapacl.c
+++ b/src/wrapacl.c
@@ -1,8 +1,18 @@
/* This file is part of Ping903
-Copyright (C) 2020 Sergey Poznyakoff
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.
+ Copyright (C) 2020 Sergey Poznyakoff
+
+ Ping903 is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ Ping903 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Ping903. If not, see <http://www.gnu.org/licenses/>.
*/
#include <tcpd.h>
#include <microhttpd.h>

Return to:

Send suggestions and report system problems to the System administrator.