- 誰かだけが触れるコードを無くす
 
  
    
      This file contains hidden or 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
    
  
  
    
  | CREATE ROLE read_only WITH LOGIN PASSWORD 'PASSWORD'; | |
| GRANT CONNECT ON DATABASE "DB_NAME" TO read_only; | |
| GRANT USAGE ON SCHEMA public TO read_only; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_only; | |
| -- [Optional] Use with care | |
| GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO read_only; | |
| REVOKE CREATE ON SCHEMA public FROM PUBLIC; | 
  
    
      This file contains hidden or 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
    
  
  
    
  | # output inspired by reading: | |
| # https://tech.buysell-technologies.com/entry/2021/09/21/095238 | |
| require 'yaml' | |
| api = YAML.load_file('openapi/schema.yml') | |
| api_refs = api.dup | |
| api['paths'].each do |path, value| | |
| schema_name = "paths/#{path.gsub('/api/v1/', '')}" | 
  
    
      This file contains hidden or 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
    
  
  
    
  | git diff --quiet HEAD $REF -- $DIR || echo changed | 
  
    
      This file contains hidden or 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
    
  
  
    
  | events { | |
| worker_connections 4000; | |
| use epoll; | |
| } | |
| http { | |
| include mime.types; | |
| default_type application/octet-stream; | |
| sendfile on; | 
  
    
      This file contains hidden or 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
    
  
  
    
  | import os | |
| import flask | |
| from werkzeug.debug import DebuggedApplication | |
| app = Flask(__name__) | |
| app.config['debug'] = bool(os.environ.get('DEBUG')) | |
| if app.config.get('debug'): | |
| app.wsgi_app = DebuggedApplication(app.wsgi_app, evalex=True) | 
  
    
      This file contains hidden or 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
    
  
  
    
  | FROM python:3.7-alpine | |
| RUN apk update &&\ | |
| apk add mariadb-dev build-base &&\ | |
| pip3 install --upgrade pip &&\ | |
| pip3 install mysqlclient | |
| COPY ./requirements.txt /requirements.txt | |
| RUN pip3 install -r /requirements.txt | |
| COPY . /app | 
  
    
      This file contains hidden or 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
    
  
  
    
  | version: "3.3" | |
| services: | |
| web: | |
| build: | |
| context: ./webapp/ | |
| dockerfile: Dockerfile | |
| depends_on: | |
| - db | |
| volumes: | |
| - ./webapp/:/app |