Installation
Telar Social backend can be deployed to a variety of container orchestrators such as Kubernetes, OpenShift, Docker Swarm or to a single host with faasd and docker-compose. Frontend can be deployed to the same infrastructure or hosting on Firebase hosting, AWS web hosting, Netlify, Render, or Vercel separately.
#
Running locally (Development)#
Pre-required#
Setup- Clone repository
Add
[127.0.0.1 social.example.com]
domain into your host file. Doc you may refer toCopy
ts-ui/docker/config/.env.secrets.init
file and set the name.env.secrets
.Config email to receive email notification for signup, reset password, etc. Please refer to doc #2
- Set your smtp email
(e.g. for gmail is smtp.gmail.com:587)
and your email my@email.com
- Set your email password
- Set your smtp email
Run back-end
tip
If you want change other configuration like default URL or MongoDB host URL(form Secrets ) you can change all config in path-to-project/ts-ui/docker/config/
.
- Run front-end
#
Running on Kubernetes using Telar CLIcaution
Telar CLI is under development. Use manual setup instead!
#
Running on Kubernetes (Manually)#
Pre-required- Familiar with Kubernetes
- Know how to work with OpenFaaS
#
Setup- Clone Telar repositories
- Change projects config based on your requirements
- Set your Telar Web configuration in
path-to-project/telar-web/config/*.yml
- Set your Telar Scoial configuration in
path-to-project/ts-serverless/config/*.yml
- Set your User Interface configuration in
path-to-project/ts-serverless/.env.production
- Set your WebSocket server configuration in
path-to-project/ts-websocket/k8s/deploy.yml
- Set your Telar Web configuration in
note
For WebSocket server PAYLOAD_SECRET
, PUBLIC_KEY
in configuration, read from Kubernetes secret which you will create on next step.
- Create Secret for Kubernetes Telar Social use Kubernetes secrets to keep sensitive information safe. Set the environment variable (e.g. ) in terminal and run commnad below.
info
To know more about each secret field check here.
- Deploy
telar-wb
andts-serverless
We supposed you are familiar withOpenFaaS
. All you need now is moving to root of each project and change thestack.yml
file to your own docker user (e.g.qolzam/actions:v0.1.13
tomy_docker_user/actions:v0.1.0
). Then run command below to build/push/depoy each Microservice.
- Deploy WebScoket server You are able to run WebScoket server on any server(e.g. Heroku) but here we prefer to keep the WebSocket server on Kuberenetes cluster. Run command below to deploy WebSocet server.
- Deploy User Interface (
ts-ui
) User interface can be deployed on Kubernetes or web host providers like Firebase hosting.
- Hosting on web host providers, you can simply build the project using
npm run build
and deploy based on web host provider instruction. (e.g. Firebase hosting) - To host on Kebenetes change
stack.yml
file for your own docker user and run command below.
- To start go
https://your-social-domain/admin/login
page. Login with admin username/password and wait until you see welcome page. And we are done!
#
Running on faasdWe will add it soon :)
#
Expose Social Network to the internet from your localIn the case you need to make your social network available on the internet from your local PC/Server, you may consider options below.
inlets (Recommended): inlets uses a websocket to create a tunnel between a client and a server. The server is typically a machine with a public IP address, and the client is on a private network with no public address. inlets is considered production-ready, but you should do some testing before you depend on it. For a commercially-supported solution, see inlets PRO, which enables additional use-cases, has more thorough testing and secure defaults.
ngrok: ngrok provides a real-time web UI where you can introspect all HTTP traffic running over your tunnels. Replay any request against your tunnel with one click.
Cloudflare: You can connect applications, servers, and other resources to Cloudflare's network using Cloudflare Tunnel. When connected, Cloudflare can apply Zero Trust policies to determine who can reach the resource.
#
Config Traefik for Telar SocialTraefik is an open-source Edge Router that makes publishing your services a fun and easy experience. It receives requests on behalf of your system and finds out which components are responsible for handling them.
We also config DNS challenge to resolve certificate by Let's Encrypt. We used digitalocean
provider as an example but you can find your own provider here
#
Create secret for certificate resolverChange digitalocean
with your provider name and replace your_token
with your token.
#
Deploy Traefik on K8S clusterExcute command below to deploy Traefik. Before that, change my@email.com
to your email and digitalocean
to your provider.
In command below we use letsencrypt in
production
mode if you are in development statge you can change it tostaging
.letsencrypt production: https://acme-v02.api.letsencrypt.org/directory
letsencrypt staging: https://acme-staging-v02.api.letsencrypt.org/directory
#
Deploy Telar Social functions ingress routeTo have a pretty URL we use social-middleware-gateway
ingress route to have https://my.social.com/*
URL instead of https://my.social.com/function/*
. The ingress-route-social
ingress route will route requests to OpenFaaS
gateway service.
#
Deploy WebSocket ingress route⭐️ This page needs help. Please help with your contribution. To start click on edit button.