SHA256
1
0
forked from pool/caddy

Accepting request 889343 from home:avicenzi

Add Caddy

OBS-URL: https://build.opensuse.org/request/show/889343
OBS-URL: https://build.opensuse.org/package/show/server:http/caddy?expand=0&rev=1
This commit is contained in:
Marguerite Su 2021-05-05 09:08:17 +00:00 committed by Git OBS Bridge
commit 81a622221b
13 changed files with 1866 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

25
Caddyfile Normal file
View File

@ -0,0 +1,25 @@
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace the line below with your
# domain name.
:80
# Set this path to your site's directory.
root * /usr/share/caddy
# Enable the static file server.
file_server
# Another common task is to set up a reverse proxy:
# reverse_proxy localhost:8080
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

166
_caddy Normal file
View File

@ -0,0 +1,166 @@
#compdef caddy
function _caddy {
local _line
_arguments -C \
"1: :(adapt build-info environ file-server fmt hash-password help list-modules reload reverse-proxy run start stop trust untrust validate version)" \
"*::arg:->args"
case $line[1] in
adapt)
__caddy_adapt
;;
build-info)
__caddy_build-info
;;
environ)
__caddy_environ
;;
file-server)
__caddy_file-server
;;
fmt)
__caddy_fmt
;;
hash-password)
__caddy_hash-password
;;
help)
__caddy_help
;;
list-modules)
__caddy_list-modules
;;
reload)
__caddy_reload
;;
reverse-proxy)
__caddy_reverse-proxy
;;
run)
__caddy_run
;;
start)
__caddy_start
;;
stop)
__caddy_stop
;;
trust)
__caddy_trust
;;
untrust)
__caddy_untrust
;;
validate)
__caddy_validate
;;
version)
__caddy_version
;;
esac
}
function __caddy_adapt {
_arguments \
"--pretty: :" \
"--validate: :" \
"--adapter: :_files" \
"--config: :_files" \
}
function __caddy_build-info {
}
function __caddy_environ {
}
function __caddy_file-server {
_arguments \
"--browse: :" \
"--templates: :" \
"--domain: :_files" \
"--listen: :_files" \
"--root: :_dirs" \
}
function __caddy_fmt {
_arguments \
"--overwrite: :" \
}
function __caddy_hash-password {
_arguments \
"--algorithm: :_files" \
"--plaintext: :_files" \
"--salt: :_files" \
}
function __caddy_help {
}
function __caddy_list-modules {
_arguments \
"--versions: :" \
}
function __caddy_reload {
_arguments \
"--adapter: :_files" \
"--config: :_files" \
"--address: :_files" \
}
function __caddy_reverse-proxy {
_arguments \
"--change-host-header: :" \
"--from: :_files" \
"--to: :_files" \
}
function __caddy_run {
_arguments \
"--environ: :" \
"--resume: :" \
"--watch: :" \
"--adapter: :_files" \
"--config: :_files" \
"--pingback: :_files" \
"--pidfile: :_files" \
}
function __caddy_start {
_arguments \
"--watch: :" \
"--adapter: :_files" \
"--config: :_files" \
"--pidfile: :_files" \
}
function __caddy_stop {
_arguments \
"--address: :_files" \
}
function __caddy_trust {
}
function __caddy_untrust {
_arguments \
"--ca: :_files" \
"--cert: :_files" \
}
function __caddy_validate {
_arguments \
"--config: :_files" \
"--adapter: :_files" \
}
function __caddy_version {
}
_caddy

20
_service Normal file
View File

@ -0,0 +1,20 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/caddyserver/caddy.git</param>
<param name="scm">git</param>
<param name="filename">caddy</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="revision">v2.3.0</param>
<param name="changesgenerate">enable</param>
</service>
<service mode="disabled" name="set_version">
</service>
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service name="go_modules" mode="disabled">
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/caddyserver/caddy.git</param>
<param name="changesrevision">1b453dd4fbea2f3a54362fb4c2115bab85cad1b7</param></service></servicedata>

1210
bash-completion Normal file

File diff suppressed because it is too large Load Diff

3
caddy-2.3.0.tar.gz Normal file
View File

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

4
caddy.changes Normal file
View File

@ -0,0 +1,4 @@
-------------------------------------------------------------------
Wed Apr 28 15:47:43 UTC 2021 - Alexandre Vicenzi <alexandre.vicenzi@suse.com>
- Create Caddy package

20
caddy.service Normal file
View File

@ -0,0 +1,20 @@
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --resume --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target

118
caddy.spec Normal file
View File

@ -0,0 +1,118 @@
#
# spec file for package caddy
#
# Copyright (c) 2021 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 project github.com/caddyserver/caddy
Name: caddy
Version: 2.3.0
Release: 0
Summary: Fast, multi-platform web server with automatic HTTPS
License: Apache-2.0
Group: Productivity/Networking/Web/Proxy
URL: https://caddyserver.com/
Source0: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
Source2: Caddyfile
Source3: caddy.service
Source4: index.html
Source5: bash-completion
Source6: _caddy
BuildRequires: golang-packaging
BuildRequires: golang(API) >= 1.15
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%{go_provides}
# Make sure that the binary is not getting stripped.
%{go_nostrip}
%description
Caddy is a powerful, extensible platform to serve your sites, services, and
apps, written in Go.
It operates primarily at L4 (transport layer) and L7 (application layer) of
the OSI model, though it has the ability to work with other layers.
%prep
%setup -q
%build
%{goprep} %{project}
# tarball causes "inconsistent vendoring"
tar -xf vendor.tar.gz
rm -rf vendor.tar.gz
CGO_ENABLED=0
go build -v -buildmode=pie -mod=vendor -ldflags "-s -w" -o caddy cmd/caddy/main.go
%install
install -d %{buildroot}/%{_sbindir}
install -D -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
# configuration
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/%{name}/Caddyfile
# service
install -D -p -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
# data directory
install -d -m 0750 %{buildroot}%{_sharedstatedir}/%{name}
# welcome page
install -D -p -m 0644 %{SOURCE4} %{buildroot}%{_datadir}/%{name}/index.html
# bash completion
install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_datadir}/bash-completion/completions/%{name}
install -D -p -m 0644 %{SOURCE6} %{buildroot}%{_datadir}/zsh/site-functions/_%{name}
%pre
getent group %{name} >/dev/null || %{_sbindir}/groupadd -r %{name}
getent passwd %{name} >/dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /bin/false -c "Caddy web server" %{name}
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%{fillup_only -n %{name}}
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%license LICENSE
%doc AUTHORS README.md
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_unitdir}/%{name}.service
%{_sbindir}/rc%{name}
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/Caddyfile
%attr(0750,%{name},%{name}) %dir %{_sharedstatedir}/%{name}
# filesystem owns all the parent directories here
%{_datadir}/bash-completion/completions/%{name}
# own parent directories in case zsh is not installed
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_%{name}
%changelog

269
index.html Normal file

File diff suppressed because one or more lines are too long

3
vendor.tar.gz Normal file
View File

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