Skip to content

Commit

Permalink
Initial Gitpod configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
DukeManh authored and humphd committed Nov 1, 2021
1 parent 49f8d2a commit 276ceb9
Show file tree
Hide file tree
Showing 6 changed files with 439 additions and 4 deletions.
85 changes: 85 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Learn more about this file at https://www.gitpod.io/docs/references/gitpod-yml
tasks:
- name: Service Server
# Get Web API urls for use in Next build
before: |
eval $(gp env -e GITPOD_API_URL=$(gp url 3000))
eval $(gp env -e GITPOD_WEB_URL=$(gp url 8000))
eval $(gp env -e GITPOD_MICROSERVICE_URL=$(gp url 8443))
init: |
npm install
docker-compose --env-file config/env.gitpod build
# GitPod workspace urls are not stable, we have to look up urls and build again
command: |
docker-compose --env-file config/env.gitpod up -d
npm run start
- name: Terminal
openMode: tab-after

ports:
# NextJS frontend
- port: 8000
visibility: public
onOpen: open-preview
# Microservice
- port: 8443
visibility: public
onOpen: ignore
# Web API
- port: 3000
visibility: public
onOpen: ignore
# Redis server
- port: 6379
visibility: public
onOpen: ignore
# Elasticsearch server
- port: 9200
visibility: public
onOpen: ignore
# Firebase emulator
- port: 4000
visibility: public
onOpen: ignore
# Firestore emulator
- port: 8088
visibility: public
onOpen: ignore
# Traefik UI
- port: 8080
visibility: public
onOpen: ignore
# Login Page
- port: 8081
visibility: public
onOpen: ignore
# Static Web Content test
- port: 8888
visibility: public
onOpen: ignore

github:
prebuilds:
# enable for the default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: true
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: false

# Install recommended extension
vscode:
extensions:
- editorconfig.editorconfig
- dbaeumer.vscode-eslint
- esbenp.prettier-vscode
- streetsidesoftware.code-spell-checker
245 changes: 245 additions & 0 deletions config/env.gitpod
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
################################################################################
# Environment Variables for Development in Gitpod
#
# Copy this file to `.env` for use by docker-compose.
################################################################################

COMPOSE_PROJECT_NAME=telescope_api

# Compose files to use together during development. NOTE: we specify separator below
# so it will work on Windows and Unix, see
# https://docs.docker.com/compose/reference/envvars/#compose_file
COMPOSE_PATH_SEPARATOR=;
COMPOSE_FILE=docker/docker-compose.yml;docker/gitpod.yml


# The host where the Telescope 1.0 front-end and back-end are run.
TELESCOPE_HOST=http://localhost:3000

# The host where all the microservices run (e.g., http://localhost)
# NOTE: if you change this, change all other occurrences below too.
API_HOST=http://localhost:8443

# Front-end web URL (entry point to the next.js app). Make sure that the
# ALLOWED_APP_ORIGINS variable below includes this URL, so that the Auth
# service will allow redirects back to this origin.
WEB_URL=http://localhost:8000

# The API Version, used as a prefix on all routes: /v1
API_VERSION=v1


################################################################################
# Auth Service
################################################################################

# Auth Service Port (default is 7777)
AUTH_PORT=7777

# Auth Service URL
AUTH_URL=http://localhost:8443/v1/auth

# The Single Sign On (SSO) login service URL
SSO_LOGIN_URL=http://localhost:8081/simplesaml/saml2/idp/SSOService.php

# The callback URL endpoint to be used by the SSO login service (see the /auth route)
SSO_LOGIN_CALLBACK_URL=http://localhost:8443/v1/auth/login/callback

# The Single Logout (SLO) service URL
SLO_LOGOUT_URL=http://localhost:8081/simplesaml/saml2/idp/SingleLogoutService.php

# The callback URL endpoint to be used by the SLO logout service (see the /auth route)
SLO_LOGOUT_CALLBACK_URL=http://localhost:8443/v1/auth/logout/callback

# The SSO Identity Provider's public key certificate. NOTE: this is the public
# key cert of the test login IdP docker container. Update for staging and prod.
SSO_IDP_PUBLIC_KEY_CERT=MIIDXTCCAkWgAwIBAgIJALmVVuDWu4NYMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRl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Q==

# Our apps's Entity ID, which is also the URL to our metadata.
SAML_ENTITY_ID=http://localhost:8443/v1/auth/sp

# SECRET = cookie session SECRET. If left empty, one will be set automatically
SECRET=secret-sauce

# ADMINISTRATORS is a list (space delimited) of users who have administrator
# rights. Use the user's nameID (user2@example.com) or hashed version of
# nameID (2b3b2b9ce8). Either will work.
ADMINISTRATORS=user1@example.com

# Origins of web apps that we'll allow for redirects. See src/api/auth/test
ALLOWED_APP_ORIGINS=http://localhost:8000 http://localhost:8888

# The URI of the auth server
JWT_ISSUER=http://localhost:8443/v1/auth

# The microservices origin
JWT_AUDIENCE=http://localhost

# How long should a JWT work before it expires
JWT_EXPIRES_IN=1h


################################################################################
# Image Service
################################################################################

# Image Service Port (default is 4444)
IMAGE_PORT=4444

# Image Service URL
IMAGE_URL=http://localhost:8443/v1/image

################################################################################
# Search Service
################################################################################

# Search Service Port (default is 4445)
SEARCH_PORT=4445

# Search Service URL
SEARCH_URL=http://localhost:8443/v1/search

################################################################################
# Users Service
################################################################################

# Users Service Port (default is 7000)
USERS_PORT=7000

# Users Service URL
USERS_URL=http://localhost:8443/v1/users
FIRESTORE_EMULATOR_HOST=firebase:8088


################################################################################
# Posts Service
################################################################################

# Posts Service Port (default is 5555)
POSTS_PORT=5555

# Posts Service URL
POSTS_URL=http://localhost:8443/v1/posts

# Redis Mock info
MOCK_REDIS=


################################################################################
# Feed Discovery Service
################################################################################

# Feed Discovery Service Port (default is 9999)
FEED_DISCOVERY_PORT=9999

# Feed Discovery Service URL
FEED_DISCOVERY_URL=http://localhost:8443/v1/feed-discovery


################################################################################
# Parser Service
################################################################################

# Parser Service Port (default is 10000)
PARSER_PORT=10000

# Parser Service URL
PARSER_URL=http://localhost:8443/v1/parser


################################################################################
# Telescope 1.0 Legacy Environment
################################################################################

# NODE_ENV should be one of "development" or "production"
NODE_ENV=development

# PORT is the port used by the web server
PORT=3000

# API_URL is the URL of the Telescope Web API server. Change this to
# pick which backend server our frontend uses. If you are developing
# locally, this will be localhost:{PORT}, probably http://localhost:3000.
# Other possible values include:
#
# (local development)
# API_URL=http://localhost:3000
# (our staging server)
# API_URL=https://dev.telescope.cdot.systems
# (our production server)
# API_URL=https://telescope.cdot.systems
API_URL=http://localhost:3000

# PROXY_FRONTEND=1 will allow proxying the Next dev server (http://localhost:8000)
# through our node server (http://localhost:3000). Useful for testing locally.
# To run:
#
# 1. set PROXY_FRONTEND=1 in the .env
# 2. run the web server: `npm start`
# 3. run the Next dev server: `npm run develop`
# 4. open http://localhost:3000/ and you'll get content from http://localhost:8000
PROXY_FRONTEND=

# LOG_LEVEL is used to set the level of debugging for the logs.
# info, error and debug are commonly used levels. See http://getpino.io/#/docs/api?id=level for more info on levels.
# to completely disable all logs, use silent.
LOG_LEVEL=debug

# LOG_FILE is used to set a destination path to write logs. Works in production mode only.
#LOG_FILE=

# Used to set if Pino should log are indexed to ElasticSearch, LOG_ELASTIC=1 to enable, if LOG_FILE and LOG_ELASTIC is set,
# LOG_ELASTIC will take priority
#LOG_ELASTIC=
# Following are used to set up Pino-Elastic
# Index name for logs to be stored under
#INDEX_NAME=logs
# Determines consistency of the write, valid values are: one, quorum or all
#CONSISTENCY=one
# Elasticsearch Version
#ELASTIC_VERSION=7
# The number of bytes for each bulk insert
#FLUSH_BYTES=1000

# MOCK_ELASTIC=1 will use an in-memory, mock Elastic instance. Useful for testing.
MOCK_ELASTIC=

# Redis Server info, password may be optional (e.g., leave empty if you don't set one)
#REDIS_URL=redis://127.0.0.1
#REDIS_PORT=6379
#REDIS_PASSWORD=

# MOCK_REDIS=1 will use an in-memory, mock Redis instance. Useful for testing.
MOCK_REDIS=

# Elasticsearch info
ELASTIC_URL=http://127.0.0.1
ELASTIC_PORT=9200
# Max number of results per query
ELASTIC_MAX_RESULTS_PER_PAGE=5
# Delay to check connectivity with Elasticsearch in ms
ELASTIC_DELAY_MS=10000

# FEED_URL url used to access feed list
FEED_URL=https://wiki.cdot.senecacollege.ca/wiki/Planet_CDOT_Feed_List

# Milliseconds to wait after attempting to fetch the feed list when the server is not available
FEED_URL_INTERVAL_MS=30000

# Period of time (seconds) that an unprocessed feed must wait before its
# next processing attempt (due to previous attempt responding with HTTP 429)
FEED_PROCESSING_DELAY_SEC=3600

# Feed job queue attempts
FEED_QUEUE_ATTEMPTS=5

# Feed job queue delay(ms)
FEED_QUEUE_DELAY_MS=60000

# Number of concurrent worker processors to run. Use * if you want to run
# one per CPU. Use a number if you want to set it manually, up to a max
# of the CPU count. If not set, we'll assume 1.
FEED_QUEUE_PARALLEL_WORKERS=1

# Max number of posts per page
MAX_POSTS_PER_PAGE=5
4 changes: 4 additions & 0 deletions docker/development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ services:
elasticsearch:
ports:
- '9200:9200'
ulimits:
memlock:
soft: -1
hard: -1

users:
environment:
Expand Down
4 changes: 0 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,3 @@ services:
# See the following:
# - https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html,
# - https://github.com/deviantony/docker-elk/issues/243
ulimits:
memlock:
soft: -1
hard: -1
Loading

0 comments on commit 276ceb9

Please sign in to comment.