yteraoka / blog-1q77-com

https://blog.1q77.com/
1 stars 0 forks source link

GitHub OAuth App + oauth2-proxy + s3-proxy #147

Open yteraoka opened 10 months ago

yteraoka commented 10 months ago

OAuth2 Proxy

https://oauth2-proxy.github.io/oauth2-proxy/

./oauth2-proxy \
  --provider=github \
  --github-user=yteraoka \
  --client-id=${GITHUB_OAUTH_APP_CLIENT_ID} \
  --client-secret=${GITHUB_OAUTH_APP_CLIENT_SECRET} \
  --cookie-secret=${COOKIE_SECRET} \
  --email-domain=\* \
  --http-address=0.0.0.0:8080 \
  --upstream=http://127.0.0.1:8000 \
  --redirect-url=http://localhost:8080/oauth2/callback \
  --scope=user:email \
  --cookie-secure=false

cookie-secret はランダムな文字列で 16, 24, 32 bytes のいずれかの長さで指定する。

S3 Proxy

https://oxyno-zeta.github.io/s3-proxy/

log:
  level: info
  format: json

server:
  listenAddr: 127.0.0.1
  port: 8000
  timeouts:
    readTimeout: 5s
    readHeaderTimeout: 10s
    writeTimeout: 60s
    idleTimeout: 10s
  compress:
    enabled: false

targets:
  first-bucket:
    mount:
      path:
        - /
    actions:
      GET:
        enabled: true
        config:
          indexDocument: index.html
          disableListing: true
      PUT:
        enabled: false
      DELETE:
        enabled: false
    bucket:
      name: ${S3_BUCKET_NAME}
      prefix: ""
      region: ap-northeast-1
      disableSSL: false