SHA256
1
0
forked from pool/darkhttpd

Accepting request 1135745 from home:dheidler

New Package

OBS-URL: https://build.opensuse.org/request/show/1135745
OBS-URL: https://build.opensuse.org/package/show/server:http/darkhttpd?expand=0&rev=1
This commit is contained in:
2024-01-01 12:45:56 +00:00
committed by Git OBS Bridge
commit c65f5aefa8
8 changed files with 190 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
_service Normal file
View File

@@ -0,0 +1,3 @@
<services>
<service name="download_files"/>
</services>

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e063de9efa5635260c8def00a4d41ec6145226a492d53fa1dac436967670d195
size 37662

17
darkhttpd.changes Normal file
View File

@@ -0,0 +1,17 @@
-------------------------------------------------------------------
Tue Dec 26 22:14:03 UTC 2023 - Dominik Heidler <dheidler@suse.de>
- Version 1.14:
* Add support for logging with syslog.
* Fix hung connection from consecutive keep-alive requests.
* Fix high CPU usage when timeout is disabled.
* Add --forward-https.
* Make header parsing case insensitive, to work behind an HTTP2 reverse proxy.
* Add trailing slash to links for directories.
* Fix crash when a file has a large (year 10,000+) mtime.
- Add config and systemd unit
-------------------------------------------------------------------
Thu Jun 2 12:17:49 UTC 2022 - leedagee <leedageea@gmail.com>
- darkhttpd v1.13

25
darkhttpd.service Normal file
View File

@@ -0,0 +1,25 @@
[Unit]
Description=Darkhttpd Daemon
After=network-online.target
[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=read-only
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
Type=simple
EnvironmentFile=-/etc/sysconfig/darkhttpd
ExecStart=/usr/bin/darkhttpd $DARKHTTPD_PARAMS
Restart=on-failure
[Install]
WantedBy=multi-user.target

107
darkhttpd.spec Normal file
View File

@@ -0,0 +1,107 @@
#
# spec file for package darkhttpd
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define pkg_home %{_localstatedir}/lib/%{name}
Name: darkhttpd
Version: 1.14
Release: 0
Summary: When you need a web server in a hurry
License: ISC
Group: Productivity/Networking/Web/Servers
URL: https://unix4lyfe.org/darkhttpd
Source: https://github.com/emikulic/darkhttpd/archive/v%{version}.tar.gz
Source1: %{name}.sysconfig
Source2: %{name}.service
BuildRequires: gcc
BuildRequires: make
Requires(post): %fillup_prereq
Provides: http_daemon
Provides: httpd
%description
Features:
Simple to set up:
Single binary, no other files, no installation needed.
Standalone, doesn't need inetd or ucspi-tcp.
No messing around with config files - all you have to specify is the www root.
Written in C - efficient and portable.
Small memory footprint.
Event loop, single threaded - no fork() or pthreads.
Generates directory listings.
Supports HTTP GET and HEAD requests.
Supports Range / partial content. (try streaming music files or resuming a download)
Supports If-Modified-Since.
Supports Keep-Alive connections.
Supports IPv6.
Can serve 301 redirects based on Host header.
Uses sendfile() on FreeBSD, Solaris and Linux.
Can use acceptfilter on FreeBSD.
At some point worked on FreeBSD, Linux, OpenBSD, Solaris.
ISC license.
suckless.org says darkhttpd sucks less.
Small Docker image (<100KB)
Security:
Can log accesses, including Referer and User-Agent.
Can chroot.
Can drop privileges.
Impervious to /../ sniffing.
Times out idle connections.
Drops overly long requests.
Limitations:
Only serves static content - no CGI.
%prep
%autosetup
%build
export CFLAGS="%{optflags}"
%make_build
%install
install -D -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}
install -D -m 0644 %{SOURCE1} %{buildroot}%{_fillupdir}/sysconfig.%{name}
install -D -m 0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/systemd/system/%{name}.service
mkdir -p %{buildroot}%{_sbindir}
ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%pre
%{_sbindir}/groupadd -r %{name} >/dev/null 2>&1 ||:
%{_sbindir}/useradd -g %{name} -s %{_sbindir}/nologin -r -c "user for %{name}" -d %{pkg_home} %{name} >/dev/null 2>&1 ||:
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%{fillup_only -n darkhttpd}
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%doc README.md
%license COPYING
%{_fillupdir}/sysconfig.%{name}
%{_prefix}/lib/systemd/system/%{name}.service
%{_bindir}/%{name}
%{_sbindir}/rcdarkhttpd
%changelog

11
darkhttpd.sysconfig Normal file
View File

@@ -0,0 +1,11 @@
## Path: Network/WWW/darkhttpd
## Description: start parameters for darkhttpd.
## Type: string
## Default: "/srv/www/htdocs/ --port 80 --uid darkhttpd --gid darkhttpd --syslog"
## Config: darkhttpd
#
# start parameters for darkhttpd.
#
# see darkhttpd README for more
#
DARKHTTPD_PARAMS="/srv/www/htdocs/ --port 80 --uid darkhttpd --gid darkhttpd --syslog"