fix caddy-git

This commit is contained in:
bgme 2023-05-20 01:13:26 +08:00
parent 6e40671010
commit d44e52c3ca
4 changed files with 96 additions and 4 deletions

View file

@ -1 +0,0 @@
../caddy/Caddyfile

40
repo/caddy-git/Caddyfile Normal file
View file

@ -0,0 +1,40 @@
# The Caddyfile is an easy way to configure your Caddy web server.
#
# https://caddyserver.com/docs/caddyfile
#
# The configuration below serves a welcome page over HTTP on port 80.
# 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.
#
# https://caddyserver.com/docs/caddyfile/concepts#addresses
{
# Restrict the admin interface to a local unix file socket whose directory
# is restricted to caddy:caddy. By default the TCP socket allows arbitrary
# modification for any process and user that has access to the local
# interface. If admin over TCP is turned on one should make sure
# implications are well understood.
admin "unix//run/caddy/admin.socket"
}
http:// {
# 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 directive documentation for more options.
# https://caddyserver.com/docs/caddyfile/directives
}
# Import additional caddy config files in /etc/caddy/conf.d/
import /etc/caddy/conf.d/*

View file

@ -1 +0,0 @@
../caddy/caddy.sysusers

View file

@ -0,0 +1 @@
u caddy - "caddy daemon" /var/lib/caddy

View file

@ -1 +0,0 @@
../caddy/caddy.tmpfiles

View file

@ -0,0 +1,3 @@
d /var/lib/caddy 0750 caddy caddy
d /var/log/caddy 0750 caddy caddy
d /run/caddy 0750 caddy caddy

View file

@ -1 +0,0 @@
../caddy/main.go

52
repo/caddy-git/main.go Normal file
View file

@ -0,0 +1,52 @@
// Copyright 2015 Matthew Holt and The Caddy Authors
//
// Licensed 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.
// Package main is the entry point of the Caddy application.
// Most of Caddy's functionality is provided through modules,
// which can be plugged in by adding their import below.
//
// There is no need to modify the Caddy source code to customize your
// builds. You can easily build a custom Caddy with these simple steps:
//
// 1. Copy this file (main.go) into a new folder
// 2. Edit the imports below to include the modules you want plugged in
// 3. Run `go mod init caddy`
// 4. Run `go install` or `go build` - you now have a custom binary!
//
// Or you can use xcaddy which does it all for you as a command:
// https://github.com/caddyserver/xcaddy
package main
import (
caddycmd "github.com/caddyserver/caddy/v2/cmd"
// plug in Caddy modules here
_ "github.com/caddyserver/caddy/v2/modules/standard"
_ "github.com/caddyserver/forwardproxy"
_ "github.com/mholt/caddy-ratelimit"
_ "github.com/caddyserver/replace-response"
_ "github.com/silinternational/certmagic-storage-dynamodb/v3"
_ "github.com/abiosoft/caddy-json-schema"
_ "github.com/fvbommel/caddy-combine-ip-ranges"
_ "github.com/fvbommel/caddy-dns-ip-range"
_ "github.com/WeidiDeng/caddy-cloudflare-ip"
_ "github.com/zhangjiayin/caddy-geoip2"
_ "github.com/corazawaf/coraza-caddy"
)
func main() {
caddycmd.Main()
}