base:~# docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE nginx alpine 91ca84b4f577 2 days ago 52.5MB base:~# docker swarm init Swarm initialized: current node (zkz4753ejmuuqr0jpzsyymk6j) is now a manager.
To add a worker to this swarm, run the following command:
base:~# acme.sh --register-account -m email=acme@guzal.cc [Fri Nov 29 18:47:49 CST 2024] Create account key ok. [Fri Nov 29 18:47:49 CST 2024] No EAB credentials found for ZeroSSL, let's get one [Fri Nov 29 18:47:51 CST 2024] Registering account: https://acme.zerossl.com/v2/DV90 [Fri Nov 29 18:47:55 CST 2024] Registered [Fri Nov 29 18:47:55 CST 2024] ACCOUNT_THUMBPRINT='2LgV4qGN_FZP1AftbqQO_JGYld2A6zi-kMixp11ov3I' base:~# acme.sh --issue -d guzal.cc -d *.guzal.cc --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please [Fri Nov 29 18:48:15 CST 2024] Using CA: https://acme.zerossl.com/v2/DV90 [Fri Nov 29 18:48:15 CST 2024] Creating domain key [Fri Nov 29 18:48:15 CST 2024] The domain key is here: /root/.acme.sh/guzal.cc_ecc/guzal.cc.key [Fri Nov 29 18:48:15 CST 2024] Multi domain='DNS:guzal.cc,DNS:*.guzal.cc' [Fri Nov 29 18:48:15 CST 2024] Getting domain auth token for each domain [Fri Nov 29 18:48:25 CST 2024] Getting webroot for domain='guzal.cc' [Fri Nov 29 18:48:25 CST 2024] Getting webroot for domain='*.guzal.cc' [Fri Nov 29 18:48:25 CST 2024] Add the following TXT record: [Fri Nov 29 18:48:25 CST 2024] Domain: '_acme-challenge.guzal.cc' [Fri Nov 29 18:48:25 CST 2024] TXT value: 'Q35pkQjHEFw_7bgYnucjA7mA89GZohYiesyo1GvUxrM' [Fri Nov 29 18:48:25 CST 2024] Please be aware that you prepend _acme-challenge. before your domain [Fri Nov 29 18:48:25 CST 2024] so the resulting subdomain will be: _acme-challenge.guzal.cc [Fri Nov 29 18:48:25 CST 2024] Add the following TXT record: [Fri Nov 29 18:48:25 CST 2024] Domain: '_acme-challenge.guzal.cc' [Fri Nov 29 18:48:25 CST 2024] TXT value: 'bg9jbOU4aSpdWXhIsovbwGaSiIozn0uhuC4JfM9IgxA' [Fri Nov 29 18:48:25 CST 2024] Please be aware that you prepend _acme-challenge. before your domain [Fri Nov 29 18:48:25 CST 2024] so the resulting subdomain will be: _acme-challenge.guzal.cc [Fri Nov 29 18:48:25 CST 2024] Please add the TXT records to the domains, and re-run with --renew. [Fri Nov 29 18:48:25 CST 2024] Please add '--debug' or '--log' to check more details. [Fri Nov 29 18:48:25 CST 2024] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh base:~# acme.sh --renew -d guzal.cc -d *.guzal.cc --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please [Fri Nov 29 18:50:53 CST 2024] The domain 'guzal.cc' seems to have a ECC cert already, lets use ecc cert. [Fri Nov 29 18:50:53 CST 2024] Renew: 'guzal.cc' [Fri Nov 29 18:50:53 CST 2024] Renew to Le_API=https://acme.zerossl.com/v2/DV90 [Fri Nov 29 18:50:54 CST 2024] Using CA: https://acme.zerossl.com/v2/DV90 [Fri Nov 29 18:50:54 CST 2024] Multi domain='DNS:guzal.cc,DNS:*.guzal.cc' [Fri Nov 29 18:50:54 CST 2024] Getting domain auth token for each domain [Fri Nov 29 18:50:54 CST 2024] Verifying: guzal.cc [Fri Nov 29 18:51:00 CST 2024] Processing, The CA is processing your order, please just wait. (1/30) [Fri Nov 29 18:51:05 CST 2024] Success [Fri Nov 29 18:51:05 CST 2024] Verifying: *.guzal.cc [Fri Nov 29 18:51:08 CST 2024] Processing, The CA is processing your order, please just wait. (1/30) [Fri Nov 29 18:51:12 CST 2024] Pending, The CA is processing your order, please just wait. (2/30) .... [Fri Nov 29 18:53:30 CST 2024] Pending, The CA is processing your order, please just wait. (29/30) [Fri Nov 29 18:53:44 CST 2024] *.guzal.cc:Timeout [Fri Nov 29 18:53:44 CST 2024] Please add '--debug' or '--log' to check more details. [Fri Nov 29 18:53:44 CST 2024] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh [Fri Nov 29 18:53:51 CST 2024] The dns manual mode can not renew automatically, you must issue it again manually. You'd better use the other modes instead. base:~# acme.sh --renew -d guzal.cc -d *.guzal.cc --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please [Fri Nov 29 18:53:59 CST 2024] The domain 'guzal.cc' seems to have a ECC cert already, lets use ecc cert. [Fri Nov 29 18:53:59 CST 2024] Renew: 'guzal.cc' [Fri Nov 29 18:53:59 CST 2024] Renew to Le_API=https://acme.zerossl.com/v2/DV90 [Fri Nov 29 18:54:01 CST 2024] Using CA: https://acme.zerossl.com/v2/DV90 [Fri Nov 29 18:54:01 CST 2024] Multi domain='DNS:guzal.cc,DNS:*.guzal.cc' [Fri Nov 29 18:54:01 CST 2024] Getting domain auth token for each domain [Fri Nov 29 18:54:09 CST 2024] Getting webroot for domain='guzal.cc' [Fri Nov 29 18:54:09 CST 2024] Getting webroot for domain='*.guzal.cc' [Fri Nov 29 18:54:09 CST 2024] guzal.cc is already verified, skip dns-01. [Fri Nov 29 18:54:09 CST 2024] *.guzal.cc is already verified, skip dns-01. [Fri Nov 29 18:54:09 CST 2024] Verify finished, start to sign. [Fri Nov 29 18:54:09 CST 2024] Lets finalize the order. [Fri Nov 29 18:54:09 CST 2024] Le_OrderFinalize='https://acme.zerossl.com/v2/DV90/order/IioDL2UzBaSJ-yuxNQmxfw/finalize' [Fri Nov 29 18:54:11 CST 2024] Order status is processing, lets sleep and retry. [Fri Nov 29 18:54:11 CST 2024] Retry after: 15 [Fri Nov 29 18:54:27 CST 2024] Polling order status: https://acme.zerossl.com/v2/DV90/order/IioDL2UzBaSJ-yuxNQmxfw [Fri Nov 29 18:54:30 CST 2024] Downloading cert. [Fri Nov 29 18:54:30 CST 2024] Le_LinkCert='https://acme.zerossl.com/v2/DV90/cert/PXeKFpKqP4QpvZgjBWx5pg' [Fri Nov 29 18:54:31 CST 2024] Cert success. -----BEGIN CERTIFICATE----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jpU3AAAEAwBGMEQCIBxtQSN/DyGM szYrq3alOo7q2kdjX0hgPEfeawEdAOBvAiBFwPlznIVyRm5HF22U6zEuNynENfhc el0SrOLqOSLJtjAfBgNVHREEGDAWgghndXphbC5jY4IKKi5ndXphbC5jYzAKBggq hkjOPQQDAwNoADBlAjEAwgRhABAtmOqZ8KXibZu/NVr3B1CSXTyAXg4IVPzc0LpK KSGByqat3/BprAZU1t9sAjAYNTQRcPtNrlBc+Kbd1rQYUNnW/sHcT2SZ8nL3BN7G yLkkWhF7mzULuBHFrN2dIcs= -----END CERTIFICATE----- [Fri Nov 29 18:54:31 CST 2024] Your cert is in: /root/.acme.sh/guzal.cc_ecc/guzal.cc.cer [Fri Nov 29 18:54:31 CST 2024] Your cert key is in: /root/.acme.sh/guzal.cc_ecc/guzal.cc.key [Fri Nov 29 18:54:31 CST 2024] The intermediate CA cert is in: /root/.acme.sh/guzal.cc_ecc/ca.cer [Fri Nov 29 18:54:31 CST 2024] And the full chain certs is there: /root/.acme.sh/guzal.cc_ecc/fullchain.cer
http { include /etc/nginx/mime.types; default_type application/octet-stream;
log_format json_analytics '{' '"msec": "$msec", ' # request unixtime in seconds with a milliseconds resolution '"connection": "$connection", ' # connection serial number '"connection_requests": "$connection_requests", ' # number of requests made in connection '"pid": "$pid", ' # process pid '"request_id": "$request_id", ' # the unique request id '"request_length": "$request_length", ' # request length (including headers and body) '"remote_addr": "$remote_addr", ' # client IP '"remote_user": "$remote_user", ' # client HTTP username '"remote_port": "$remote_port", ' # client port '"time_local": "$time_local", ' '"time_iso8601": "$time_iso8601", ' # local time in the ISO 8601 standard format '"request": "$request", ' # full path no arguments if the request '"request_uri": "$request_uri", ' # full path and arguments if the request '"args": "$args", ' # args '"status": "$status", ' # response status code '"body_bytes_sent": "$body_bytes_sent", ' # the number of body bytes exclude headers sent to a client '"bytes_sent": "$bytes_sent", ' # the number of bytes sent to a client '"http_referer": "$http_referer", ' # HTTP referer '"http_user_agent": "$http_user_agent", ' # user agent '"http_x_forwarded_for": "$http_x_forwarded_for", ' # http_x_forwarded_for '"http_host": "$http_host", ' # the request Host: header '"server_name": "$server_name", ' # the name of the vhost serving the request '"request_time": "$request_time", ' # request processing time in seconds with msec resolution '"upstream": "$upstream_addr", ' # upstream backend server for proxied requests '"upstream_status":"$upstream_status"' '"upstream_connect_time": "$upstream_connect_time", ' # upstream handshake time incl. TLS '"upstream_header_time": "$upstream_header_time", ' # time spent receiving upstream headers '"upstream_response_time": "$upstream_response_time", ' # time spend receiving upstream body '"upstream_response_length": "$upstream_response_length", ' # upstream response length '"upstream_cache_status": "$upstream_cache_status", ' # cache HIT/MISS where applicable '"ssl_protocol": "$ssl_protocol", ' # TLS protocol '"ssl_cipher": "$ssl_cipher", ' # TLS cipher '"scheme": "$scheme", ' # http or https '"request_method": "$request_method", ' # request method '"server_protocol": "$server_protocol", ' # request protocol, like HTTP/1.1 or HTTP/2.0 '"pipe": "$pipe", ' # "p" if request was pipelined, "." otherwise '"gzip_ratio": "$gzip_ratio", ' '"http_cf_ray": "$http_cf_ray"' '}';
location / { proxy_pass http://gitea:3000$request_uri; proxy_set_header X-Real-IP $remote_addr; # pass on real client's IP } }
启动 Git Server
1
docker stack deploy --detach=false -c docker-compose.yml base
检查启动情况
1 2 3
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a3d16a1527f0 nginx:alpine "/docker-entrypoint.…" 15 hours ago Up 15 hours 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp server_nginx.1.0x3uxtku5ih97t23aj5spybxa c28db9684db8 gitea/gitea:1.24.2 "/usr/bin/entrypoint…" 17 hours ago Up 17 hours 22/tcp, 3000/tcp server_gitea.1.vxpu78m7sk3l564r6eazjgf27
Gitea Runner (可选)
若需要 Gitea 添加 CI/CD 自动化流程支持,可以参考该章节;
OS:Ubuntu 24.04.2 LTS (Noble Numbat)
Gitea Runner
初始化 Runner
To find a listing of our public images on supported Clouds, please use the Cloud Image Locator: Ubuntu 24.04 LTS (Noble Numbat) Noble Numbat