Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Seneca-CDOT/telescope int…
Browse files Browse the repository at this point in the history
…o master
  • Loading branch information
rjayroso committed Mar 16, 2021
2 parents b3390bd + 3ee2423 commit 189be46
Show file tree
Hide file tree
Showing 107 changed files with 2,952 additions and 1,621 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module.exports = {
},
],
'import/extensions': 'off',
// Allow using TypeScript constructor shorthand: `Foo(public bar: string){}`
'no-useless-constructor': 'off',
'no-empty-function': 'off',
},
},

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/node-js-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
- name: Install dependencies and run tests with default env
run: |
npm install
cp env.example .env
npm run jest
# Run end-to-end tests along with the microservices in docker-compose on Linux
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
- name: Install dependencies and run tests with default env
run: |
npm install
cp env.example .env
npm run jest
# Run end-to-end tests along with the microservices in docker-compose on Linux
Expand Down
24 changes: 23 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
# Dockerfile
#
# -------------------------------------

# NEXT_PUBLIC_API_URL is needed by the next.js build, which we define
# as a build ARG in API_URL
ARG API_URL
# API Service URLs, set via ENV in docker or next build
ARG IMAGE_URL
ARG AUTH_URL

# Context: Build Context
FROM node:lts-alpine as build

Expand All @@ -23,13 +31,17 @@ WORKDIR "/telescope"

# Copy package.jsons for each service
COPY package.json .
COPY .env .
COPY ./src/web/package.json ./src/web/package.json

# -------------------------------------
# Context: Dependencies
FROM build AS backend_dependencies

# Forward the API_URL and Service URLs build ARGs from pervious stage
ARG API_URL
ARG IMAGE_URL
ARG AUTH_URL

# Install Production Modules!
# Disable postinstall hook in this case since we are being explict with installs
# `postinstall` typically goes on to install front-end and autodeployment modules
Expand All @@ -43,6 +55,16 @@ RUN cd ./src/web && npm install --no-package-lock
# Context: Front-end Builder
FROM frontend_dependencies as builder

# Copy the various API URLs build args over so next.js can see them in next.config.js
ARG API_URL
ENV NEXT_PUBLIC_API_URL ${API_URL}

ARG IMAGE_URL
ENV NEXT_PUBLIC_IMAGE_URL ${IMAGE_URL}

ARG AUTH_URL
ENV NEXT_PUBLIC_AUTH_URL ${AUTH_URL}

COPY ./src/web ./src/web
COPY ./.git ./.git

Expand Down
201 changes: 134 additions & 67 deletions env.example → config/env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,119 @@
################################################################################
# Environment Variables for Development
#
# 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/development.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

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


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

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

# Auth Service URL
AUTH_URL=http://localhost/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/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/v1/auth/logout/callback

# The SSO Identity Provider's public key certificate. NOTE: this is the public
# key cert of the test login IdP doc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FBC/jWf7NKUfJyX8qIG5md1YUeT6GBW9Bm2/1/RiO24JTaYlfLdKK9TYb8sG5B+OLab2DImG99CJ25RkAcSobWNF5zD0O6lgOo3cEdB/ksCq3hmtlC/DlLZ/D8CJ+7VuZnS1rR2naQ==

# Our apps's Entity ID, which is also the URL to our metadata.
SAML_ENTITY_ID=http://localhost/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 ([email protected]) or hashed version of
# nameID (2b3b2b9ce8). Either will work.
[email protected]

# 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/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/v1/image


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

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

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

# Redis Mock info
MOCK_REDIS=


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

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

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


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

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

Expand Down Expand Up @@ -33,79 +149,45 @@ PROXY_FRONTEND=
LOG_LEVEL=debug

# LOG_FILE is used to set a destination path to write logs. Works in production mode only.
LOG_FILE=
#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=
#LOG_ELASTIC=
# Following are used to set up Pino-Elastic
# Index name for logs to be stored under
INDEX_NAME=logs
#INDEX_NAME=logs
# Determines consistency of the write, valid values are: one, quorum or all
CONSISTENCY=one
#CONSISTENCY=one
# Elasticsearch Version
ELASTIC_VERSION=7
#ELASTIC_VERSION=7
# The number of bytes for each bulk insert
FLUSH_BYTES=1000
#FLUSH_BYTES=1000

# 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
# 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=
#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=

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

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

# Kibana info
# Default port # is 5601, change this if using another port #
KIBANA_PORT=5601
# If starting Kibana with Docker, default host is localhost, change this if using another host
KIBANA_HOST=localhost

# https://medium.com/disney-streaming/setup-a-single-sign-on-saml-test-environment-with-docker-and-nodejs-c53fc1a984c9 - is used for this current portion of code

# The Single Sign On (SSO) login service URL
SSO_LOGIN_URL=http://localhost:8080/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:3000/auth/login/callback

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

# The callback URL endpoint to be used by the SLO logout service (see the /auth route)
SLO_LOGOUT_CALLBACK_URL=http://localhost:3000/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=MIIDXTCCAkWgAwIBAgIJALmVVuDWu4NYMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwHhcNMTYxMjMxMTQzNDQ3WhcNNDgwNjI1MTQzNDQ3WjBFMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzUCFozgNb1h1M0jzNRSCjhOBnR+uVbVpaWfXYIR+AhWDdEe5ryY+CgavOg8bfLybyzFdehlYdDRgkedEB/GjG8aJw06l0qF4jDOAw0kEygWCu2mcH7XOxRt+YAH3TVHa/Hu1W3WjzkobqqqLQ8gkKWWM27fOgAZ6GieaJBN6VBSMMcPey3HWLBmc+TYJmv1dbaO2jHhKh8pfKw0W12VM8P1PIO8gv4Phu/uuJYieBWKixBEyy0lHjyixYFCR12xdh4CA47q958ZRGnnDUGFVE1QhgRacJCOZ9bd5t9mr8KLaVBYTCJo5ERE8jymab5dPqe5qKfJsCZiqWglbjUo9twIDAQABo1AwTjAdBgNVHQ4EFgQUxpuwcs/CYQOyui+r1G+3KxBNhxkwHwYDVR0jBBgwFoAUxpuwcs/CYQOyui+r1G+3KxBNhxkwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAAiWUKs/2x/viNCKi3Y6blEuCtAGhzOOZ9EjrvJ8+COH3Rag3tVBWrcBZ3/uhhPq5gy9lqw4OkvEws99/5jFsX1FJ6MKBgqfuy7yh5s1YfM0ANHYczMmYpZeAcQf2CGAaVfwTTfSlzNLsF2lW/ly7yapFzlYSJLGoVE+OHEu8g5SlNACUEfkXw+5Eghh+KzlIN7R6Q7r2ixWNFBC/jWf7NKUfJyX8qIG5md1YUeT6GBW9Bm2/1/RiO24JTaYlfLdKK9TYb8sG5B+OLab2DImG99CJ25RkAcSobWNF5zD0O6lgOo3cEdB/ksCq3hmtlC/DlLZ/D8CJ+7VuZnS1rR2naQ==

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

# SECRET = cookie session SECRET. If left empty, one will be set automatically
SECRET=
# FEED_URL url used to access feed list
FEED_URL=https://wiki.cdot.senecacollege.ca/wiki/Planet_CDOT_Feed_List

# ADMINISTRATORS is a list (space delimited) of users who have administrator
# rights. Use the user's nameID ([email protected]) or hashed version of
# nameID (2b3b2b9ce8). Either will work.
[email protected]
# 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)
Expand All @@ -124,18 +206,3 @@ FEED_QUEUE_PARALLEL_WORKERS=1

# Max number of posts per page
MAX_POSTS_PER_PAGE=5

# If you need to do a release, GitHub requires a Personal Access token.
# You can create one at https://github.com/settings/tokens, and get more info:
# https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line
#
# IMPORTANT: DO NOT SHARE OR COMMIT THIS TOKEN!
GITHUB_TOKEN=

# UNSPLASH API
# UNSPLASH_CLIENT_ID=""

# If we wish to override default collection
# UNSPLASH_COLLECTION_ID=""

IMAGE_PORT=4444
Loading

0 comments on commit 189be46

Please sign in to comment.