Last active
January 28, 2023 03:07
-
-
Save earlgreyxxx/37eff359b344bd859776b4bd686ec960 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
REM CERTBOT MANUAL CLEANUP AUTH HOOK | |
REM CERTBOTから下記環境変数がセットされてこのファイルが実行されますので、この情報を使ってFTPなどで認証ファイル削除します。 | |
REM CERTBOT_DOMAIN : The domain being authenticated | |
REM CERTBOT_VALIDATION : The validation string | |
REM CERTBOT_TOKEN : Resource name part of the HTTP-01 challenge (HTTP-01 only) | |
REM CERTBOT_REMAINING_CHALLENGES : Number of challenges remaining after the current challenge | |
REM CERTBOT_ALL_DOMAINS : A comma-separated list of all domains challenged for the current certificate | |
SETLOCAL | |
REM FTPサーバーへのユーザー名とパスワードを記述します。 | |
REM 流石に平文をスクリプトに埋め込むのは危険ですが、サンプルなので、 | |
REM 自分で暗号化・復号化する処理は自分で実装してね。 | |
SET USER=xxxxxx | |
SET PASSWD=yyyyyyy | |
IF "%USER%"=="" ( | |
ECHO "NO USER IS GIVEN." | |
EXIT /B -1 | |
) | |
IF "%PASSWD%"=="" ( | |
ECHO "NO PASSWD IS GIVEN." | |
EXIT /B -1 | |
) | |
SET UPLOAD_URI=ftp://%CERTBOT_DOMAIN%/.well-known/acme-challenge/ | |
SET FILEPATH=%TEMP%\%CERTBOT_TOKEN% | |
SET DELETE_COMMAND="DELE %CERTBOT_TOKEN%" | |
DEL %FILEPATH% | |
curl --ssl -s -u %USER%:%PASSWD% -X %DELETE_COMMAND% %UPLOAD_URI% | |
ENDLOCAL | |
EXIT /B 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
REM CERTBOT MANUAL PPE AUTH HOOK | |
REM CERTBOTから下記環境変数がセットされてこのファイルが実行されますので、この情報を使ってFTPなどで認証ファイルをサーバーに放り込みます。 | |
REM CERTBOT_DOMAIN : The domain being authenticated | |
REM CERTBOT_VALIDATION : The validation string | |
REM CERTBOT_TOKEN : Resource name part of the HTTP-01 challenge (HTTP-01 only) | |
REM CERTBOT_REMAINING_CHALLENGES : Number of challenges remaining after the current challenge | |
REM CERTBOT_ALL_DOMAINS : A comma-separated list of all domains challenged for the current certificate | |
SETLOCAL | |
SET UPLOAD_URI=ftp://%CERTBOT_DOMAIN%/.well-known/acme-challenge/ | |
SET FILEPATH=%TEMP%\%CERTBOT_TOKEN% | |
ECHO %CERTBOT_VALIDATION% > %FILEPATH% | |
REM FTPサーバーへのユーザー名とパスワードを記述します。 | |
REM 流石に平文をスクリプトに埋め込むのは危険ですが、サンプルなので、 | |
REM 自分で暗号化・復号化する処理は自分で実装してね。 | |
SET USER=xxxxxx | |
SET PASSWD=yyyyyyy | |
IF "%USER%"=="" ( | |
ECHO "NO USER IS GIVEN." | |
EXIT /B -1 | |
) | |
IF "%PASSWD%"=="" ( | |
ECHO "NO PASSWD IS GIVEN." | |
EXIT /B -1 | |
) | |
curl -T %FILEPATH% -u %USER%:%PASSWD% --ftp-create-dirs --ssl -s %UPLOAD_URI% | |
ENDLOCAL | |
EXIT /B 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment