Permalink
Browse files

fix #71: review init script for database

  • Loading branch information...
kamilsk committed Nov 23, 2018
1 parent 50c2619 commit 42ed6e7f94e85edc629fb433a08ce0666f13e408
Showing with 16 additions and 8 deletions.
  1. +1 βˆ’1 .goreleaser.yml
  2. +6 βˆ’2 README.md
  3. +1 βˆ’1 env/.env.example
  4. +1 βˆ’1 env/api/common.proto
  5. +1 βˆ’1 env/api/swagger.json
  6. +2 βˆ’0 env/docker/compose/docker-compose.base.yml
  7. +2 βˆ’0 env/docker/db/context/initdb.d/guard.sh
  8. +1 βˆ’1 env/docker/service/.env
  9. +1 βˆ’1 pkg/cmd/config.go
@@ -18,7 +18,7 @@ brew:
commit_author:
name: Kamil Samigullin
email: kamil@samigullin.info
description: Access Control as a Service
description: Paywall as a Service
folder: Formula
github:
name: homebrew-tap
@@ -1,6 +1,6 @@
> # πŸ’‚β€β™‚οΈ Guard [![Tweet][icon_twitter]][twitter_publish] <img align="right" width="126" src=".github/character.png">
> [![Analytics][analytics_pixel]][page_promo]
> Access Control as a Service &mdash; your personal paywall to protect any API or site's content.
> Paywall as a Service &mdash; your personal guard to restrict access to content via a paid subscription.
[![Patreon][icon_patreon]](https://www.patreon.com/octolab)
[![Build Status][icon_build]][page_build]
@@ -12,7 +12,7 @@
- [**October 20, 2018**][project_v1_dl]
- Main concepts and working prototype.
- [ ] v2: [Rate limiting][project_v2]
- [**December 16, 2018**][project_v2_dl]
- [**Someday, 20xx**][project_v2_dl]
- Request rate limiting and metrics related to license checking.

## Motivation
@@ -39,11 +39,15 @@ guard_server_1 nginx -g daemon off; Up 0.0.0.0:443->443/tcp,
guard_service_1 service run --with-profili ... Up 8080/tcp, 8090/tcp, 8091/tcp, 8092/tcp, 8093/tcp
guard_spec_1 sh /usr/share/nginx/docker ... Up 80/tcp, 8080/tcp
$ make install
$ ./env/client/rpc/install.sh localhost:443
$ open http://spec.127.0.0.1.xip.io/
$ make help
$ make demo destroy
```

## Specification
@@ -45,7 +45,7 @@ READ_HEADER_TIMEOUT=0
WRITE_TIMEOUT=0
IDLE_TIMEOUT=0

DB_DSN=postgres://postgres:postgres@db:5432/postgres?connect_timeout=1&sslmode=disable
DB_DSN=postgres://guard:guard@db:5432/guard?connect_timeout=1&sslmode=disable
DB_OPEN_CONN=1
DB_IDLE_CONN=1
DB_CONN_MAX_LT=0
@@ -6,7 +6,7 @@ import "protoc-gen-swagger/options/annotations.proto";

option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
info: {
title: "Access Control as a Service";
title: "Paywall as a Service";
version: "dev";
contact: {
name: "Guard project of Hugs Platform";
@@ -1,7 +1,7 @@
{
"swagger": "2.0",
"info": {
"title": "Access Control as a Service",
"title": "Paywall as a Service",
"version": "dev",
"contact": {
"name": "Guard project of Hugs Platform",
@@ -8,6 +8,8 @@ services:
# context: ../db/context
# dockerfile: ../Dockerfile
env_file: ../db/.env
volumes:
- ../db/context/initdb.d:/docker-entrypoint-initdb.d

legacy:
image: php:fpm-alpine
@@ -6,4 +6,6 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE USER "guard" WITH PASSWORD 'guard';
CREATE DATABASE "guard";
GRANT ALL PRIVILEGES ON DATABASE "guard" TO "guard";
\c "guard";
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
EOSQL
@@ -11,7 +11,7 @@ READ_HEADER_TIMEOUT=0
WRITE_TIMEOUT=0
IDLE_TIMEOUT=0

DB_DSN=postgres://postgres:postgres@db:5432/postgres?connect_timeout=1&sslmode=disable
DB_DSN=postgres://guard:guard@db:5432/guard?connect_timeout=1&sslmode=disable
DB_OPEN_CONN=1
DB_IDLE_CONN=1
DB_CONN_MAX_LT=0
@@ -24,7 +24,7 @@ var (
"read_header_timeout": time.Duration(0),
"write_timeout": time.Duration(0),
"idle_timeout": time.Duration(0),
"dsn": "postgres://postgres:postgres@127.0.0.1:5432/postgres?connect_timeout=1&sslmode=disable",
"dsn": "postgres://guard:guard@127.0.0.1:5432/guard?connect_timeout=1&sslmode=disable",
"open_conn": runtime.GOMAXPROCS(0),
"idle_conn": runtime.GOMAXPROCS(0),
"conn_max_lt": 0,

0 comments on commit 42ed6e7

Please sign in to comment.