github.com/wanliu/go-oauth2-server@v0.0.0-20180817021415-f928fa1580df/docker-etcd-config-entrypoint.sh (about)

     1  #!/bin/sh
     2  
     3  set -e
     4  
     5  # to make sure etcd is ready (election ended and leader elected)
     6  while ! etcdctl endpoint health &>/dev/null; do :; done
     7  
     8  exec etcdctl put /config/go_oauth2_server.json '{
     9    "Database": {
    10      "Type": "postgres",
    11      "Host": "127.0.0.1",
    12      "Port": 5432,
    13      "User": "postgres",
    14      "Password": "postgres",
    15      "DatabaseName": "go_oauth2_server",
    16      "MaxIdleConns": 5,
    17      "MaxOpenConns": 5
    18    },
    19    "Oauth": {
    20      "AccessTokenLifetime": 3600,
    21      "RefreshTokenLifetime": 1209600,
    22      "AuthCodeLifetime": 3600
    23    },
    24    "Session": {
    25        "Secret": "test_secret",
    26        "Path": "/",
    27        "MaxAge": 604800,
    28        "HTTPOnly": true
    29    },
    30    "AssetsMappings": [
    31      {
    32        "Dir": "public/uploads",
    33        "Host": "http://localhost:8080/uploads"
    34      }
    35    ],
    36    "IsDevelopment": true
    37  }'