0
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2025-10-21 19:44:57 -04:00

317 Commits

Author SHA1 Message Date
Samuel Tyler
c7e4316bf5 Merge pull request #133 from abbrev/fix-sample-gophermap
Fix subdir entry in sample gophermap
2025-10-01 18:25:15 +10:00
Christopher Williams
09c5011638 Fix subdir entry in sample gophermap 2025-06-30 16:37:39 -07:00
Samuel Tyler
d5926c9d50 Fix -a option, Fixes #105 2024-12-29 11:42:28 +11:00
Samuel Tyler
4c8c45aed1 Fixes #92 2024-12-29 11:36:51 +11:00
Samuel Tyler
9538f73d65 Autodetect HAVE_PASSWD support
Fixes #122
2024-12-29 11:35:19 +11:00
Samuel Tyler
1f2ca97c1d Robustify and improve platform detection on Gentoo 2024-12-29 11:27:57 +11:00
Samuel Tyler
1819f2eb06 Merge pull request #126 from seifferth/whitelist_gemini
Add gemini:// to redirection whitelist
2024-12-29 10:37:37 +11:00
Samuel Tyler
655af737e7 Merge pull request #125 from seifferth/html_encode
Explicitly terminate dest string in html_encode
2024-12-29 10:35:06 +11:00
Samuel Tyler
b1fd65a0a5 Merge pull request #120 from zcrayfish/patch-1
Update platform.c: Detect Alpine Linux properly.
2024-12-29 10:33:05 +11:00
Samuel Tyler
fe1deb674b Merge pull request #102 from omar-polo/simplify-pledge
tightens pledge(2) promises
2024-12-29 10:30:27 +11:00
Frank Seifferth
c88585237d Add gemini:// to redirection whitelist 2024-10-24 12:31:18 +02:00
Frank Seifferth
db7e82dfd3 Explicitly terminate dest string in html_encode
This fixes an issue introduced in commit a00fa5330d. As the
destination string produced by html_escape is not explicitly
terminated by the function as introduced in this commit, the
escaped URL in dest continues with characters found in memory
that have not been overwritten, which essentially breaks the
encoded URL. The behaviour prior to commit a00fa5330d was as
follows:

    $ src/gophernicus <<<URL:https://example.com | grep Refresh
      <META HTTP-EQUIV="Refresh" content="1;URL=https://example.com">

The broken behaviour since commit a00fa5330d is this:

    $ src/gophernicus <<<URL:https://example.com | grep Refresh
      <META HTTP-EQUIV="Refresh" content="1;URL=https://example.comtps://example.com"">

Explicitly terminating the destination string by adding a zero
byte seems to fix this; yet, since I am not a C programmer myself,
I may well have missed some ramifications of this change. In any
case, the output produced by gophernicus since commit a00fa5330d
is essentially broken, so this is probably still an improvement.
2024-10-24 11:44:15 +02:00
Zachary Lee Andrews
f9fe06fadf Update platform.c: Detect Alpine Linux properly.
Gophernicus currently thinks that Alpine Linux is called "Welcome/6.7" (seems to be extracting the OS name from /etc/issue and the version it's grabbing the kernel version)

This commit allows gophernicus to read /etc/alpine-release and display the OS name and version correctly (e.g. "Alpine Linux/3.20")
2024-02-28 10:19:03 -05:00
fosslinux
4e06fd96ba Merge pull request #119 from zcrayfish/jpeg
Update menu.c: Fix JPEG detection.
2024-02-28 07:43:37 +00:00
Zachary Lee Andrews
6206c24b7e Update menu.c: Fix JPEG detection.
The existing JPEG detection logic is too restrictive because it checks for the file header "FF D8 FF E0", which only matches JFIF-type JPEG images... Meanwhile EXIF JPEG images are more common these days.

For reference:
FF D8 = JPEG SOI (Start of Image) header
FF-D8-FF-E0 = JFIF
FF-D8-FF-E1 = EXIF
FF-D8-FF-E2 = CIFF
FF-D8-FF-E8 = SPIFF

As you can see checking for the SOI and then FF matches all extent types of JPEG images. \o/
2024-02-27 12:23:16 -05:00
fosslinux
d7c297ae5f Merge pull request #108 from augfab/fix/106
Fix part of issue #106 (option -d)
2024-02-27 11:16:32 +00:00
fosslinux
f845dd97f6 Merge pull request #116 from ryandesign/ryandesign-stderr
Suppress stderr output when checking for install
2024-02-27 11:15:26 +00:00
fosslinux
1a089816fa Merge pull request #103 from omar-polo/missing-die-fixes
fix call to die with NULL as an argument forgot in #100
2024-02-27 11:15:15 +00:00
fosslinux
a00fa5330d Fix URI inserting aribitary scripts
Fixes #118
Fixes #117

Encodes characters using html percent encoding.

I hope this is correct, I'm pretty sure it is, but can't be certain
right now.
2024-02-27 22:12:52 +11:00
fosslinux
ac249aaeef Merge pull request #110 from RileyInkTheCat/master
Fix #92 properly
2024-02-27 10:29:09 +00:00
fosslinux
4407583da3 Merge pull request #112 from ryandesign/patch-1
Fix spelling of "receive"
2024-02-27 10:28:52 +00:00
fosslinux
af1aafbe0b Merge pull request #113 from ryandesign/ryandesign-available
Fix spelling of "available"
2024-02-27 10:28:25 +00:00
fosslinux
103f21f50b Merge pull request #115 from ryandesign/ryandesign-distributions
Fix spelling of "distributions"
2024-02-27 10:28:10 +00:00
fosslinux
7f1f3515f1 Merge pull request #114 from ryandesign/ryandesign-doesnt
Fix spelling of "doesn't"
2024-02-27 10:27:58 +00:00
Ryan Schmidt
02fc3c3dc4 Suppress stderr output when checking for install
When checking the features of the install program, send any output on
stderr to /dev/null rather than to stdout.
2023-01-18 02:22:22 -06:00
Ryan Schmidt
e318b1b294 Fix spelling of "distributions" 2023-01-18 01:25:11 -06:00
Ryan Schmidt
3a8d4f007b Fix spelling of "receive" 2023-01-18 01:21:01 -06:00
Ryan Schmidt
d2007f675f Fix spelling of "available" 2023-01-18 01:18:28 -06:00
Ryan Schmidt
5fd9e72ed3 Fix spelling of "doesn't" 2023-01-18 01:14:28 -06:00
Mustached Squid
1d79de712d Previous attempt at fixing 'make install-root' had a tiny bug, which is
now solved
2022-06-17 15:26:52 +01:00
Mustached Squid
1d6aeecfc7 fix 'make install-root' clobbering existing gophermaps 2022-06-17 15:09:47 +01:00
Augustin Fabre
74b3b0adfa Fix description of `-d' in manual page
Setting option `-d' has no effect on /server-status.
2022-05-29 14:32:13 +02:00
Augustin Fabre
9e7885f00f Stop sending log messages to client when in debug mode
inetd(8) sends the contents of stdout AND stderr to the client. This means that
configuring syslog(3) with LOG_PERROR (print messages to stderr) is a bad idea.
2022-05-29 14:27:32 +02:00
Omar Polo
9f2767fde7 fix call to die with NULL as an argument forgot in #100 2022-01-22 18:44:55 +01:00
Omar Polo
a5fcd38896 move libwrap bit before calling pledge(2)
Just to make sure we don't fail due to libwrap calling syscall not
permitted by pledge.
2022-01-22 18:22:06 +01:00
Omar Polo
78dbbc1711 tightens pledge(2) promises
* `sendfd' and `recvfd' are not needed: gophernicus doesn't use
      sendmsg(2) nor recvmsg(2).

    * `inet' its needed only for getpeername(2), but it's only called
      from init_state and is *before* pledging.

    * `proc' is needed only when st.opt_exec is set.
2022-01-22 18:07:52 +01:00
fosslinux
da3390089c Merge pull request #100 from omar-polo/master
fix all call to die() with NULL as an argument
2022-01-22 11:59:19 +11:00
fosslinux
d4ed70f218 Merge pull request #101 from omar-polo/manpage
some manpage fixes
2022-01-22 11:57:46 +11:00
Omar Polo
5ce302d516 simplify -u description 2022-01-21 18:06:03 +01:00
Omar Polo
7ca1bf85a0 fix usage of mandoc Pa macro
The Pa macro is intended to be "an absolute or relative file system
path, or a file or directory name"
2022-01-21 17:50:52 +01:00
Omar Polo
65f0107646 fix various mandoc errors
This fixes all applicable reports from `mandoc -Tlint -l gophernicus.8'
2022-01-21 17:44:53 +01:00
Omar Polo
f3f637311c document -nu 2022-01-21 17:36:24 +01:00
Omar Polo
f35631e8e2 fix all call to die() with NULL as an argument
This fixes all the calls to die so they pass a proper string and not
NULL.  die blindly pass its arguments to log_fatal, which in turns
relays on vprintf or such.  At least on OpenBSD, giving NULL instead
of a string for %s yields a log entry in syslog:

Jan 21 09:35:22 venera gophernicus: vfprintf %s NULL in "Error: %s %s\^M "

As a side effect, now some errors from pledge and unveil are slightly
more clear.
2022-01-21 09:43:32 +01:00
Ben Harris
2d3182ac63 Move to libera.chat (#98) 2021-05-28 07:06:07 +10:00
fosslinux
d601ca93e3 Merge pull request #93 from nikdoof/nikdoof-listener-makefile-patch
Don't use DESTDIR for binary paths in listener
2021-05-26 19:57:56 +10:00
fosslinux
bc5feea397 Merge pull request #96 from augfab/getcwd
Really check success of getcwd(3)
2021-05-26 19:54:35 +10:00
Augustin Fabre
f2ae5e80fc Really check success of getcwd(3)
`getcwd(3)' returns a NULL pointer when it fails, and a pointer to the buffer
when it succeeds. The array of characters (allocated on the stack) is not NULL,
so it cannot be used to check if `getcwd(3)' succeeded. Use the pointer
returned by `getcwd(3)' to check success.
2021-04-07 18:57:27 +02:00
Andrew Williams
0de9ccd963 Don't use DESTDIR for binary paths in listener
DESTDIR when used in packaging can represent a temporary directory or fake root used for packaging the application, so using this value for modifying the listener config is not ideal, as the binary path will be incorrect.
2021-02-03 15:53:02 +00:00
fosslinux
0dc47480f1 Release 3.1.1 3.1.1 2021-01-03 12:44:44 +11:00
fosslinux
ca567a8cb7 Add better install message 2021-01-03 12:44:44 +11:00