Skip to content

Instantly share code, notes, and snippets.

View Qolzam's full-sized avatar
💭
I may be slow to respond.

Amir Movahedi Qolzam

💭
I may be slow to respond.
View GitHub Profile
# Install client-side tool into /usr/local/bin/
$ wget https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.8.3/kubeseal-$(go env GOOS)-$(go env GOARCH) -O kubeseal
$ sudo install -m 755 kubeseal /usr/local/bin/kubeseal
faas-cli cloud seal --name red-gold-secrets \
--literal password="password" --literal email="example@gmail.com" --literal sign-secret="slack_signing_secret"
cd $HOME/mail-of-slack
curl -O https://raw.githubusercontent.com/openfaas/cloud-functions/master/pub-cert.pem
// Email callback handler
const emailCallback = (emailResult) => {
let result = null
if (emailResult.error) {
result = {
"text": "There is problem!",
"attachments": [
{
"text": JSON.stringify(emailResult.error)
}
"use strict"
const qs = require('qs');
const utils = require('./utils')
module.exports = (context, callback) => {
// Parse query string
const data = qs.parse(context)
const crypto = require('crypto');
const qs = require('qs');
const fs = require('fs');
const nodemailer = require('nodemailer');
const md = require('markdown-it')({
html: true,
linkify: true,
breaks: true,
typographer: true
});
cd $HOME/mail-of-slack/slack-mail
npm install --save markdown-it@9.1.0 markdown-it-emoji@1.4.0 nodemailer@6.3.0 qs@6.8.0
version: 1.0
provider:
name: openfaas
gateway: http://127.0.0.1:8080
functions:
slack-mail:
lang: node
handler: ./slack-mail
image: slack-mail:latest
labels:
# Call OpenFaaS API
curl https://red-gold.o6s.io/slack-mail
git init
git add .
git commit -sm 'Init test'
# Set remote to my github account repository
git remote add origin git@github.com:red-gold/slack-of-mail.git
# Push to repository
git push --set-upstream origin master -f