This file contains 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
resource "google_compute_global_address" "foo_ip_address" { | |
name = "foo-static-ip" | |
address_type = "EXTERNAL" | |
description = "editor ip" | |
} | |
resource "google_dns_record_set" "loomi-editor" { | |
managed_zone = google_dns_managed_zone.hosted-zone.name | |
name = "f.${google_dns_managed_zone.hosted-zone.dns_name}" | |
type = "A" | |
rrdatas = [google_compute_global_address.editor_ip_address.address] |
This file contains 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
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> | |
<link href='https://fonts.googleapis.com/css?family=Lato:300,400|Montserrat:700' rel='stylesheet' type='text/css'> | |
<style> | |
@import url(//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css); | |
@import url(//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css); |
This file contains 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
SELECT event.USER_ANONYMOUS_ID || '-' || sha1(event._TIMESTAMP) as session_id | |
, event.USER_ANONYMOUS_ID | |
, event._TIMESTAMP as session_start_at | |
, lead(_TIMESTAMP) over | |
(partition by event.USER_ANONYMOUS_ID order by event._TIMESTAMP) as next_session_start_at | |
FROM (SELECT e.USER_ANONYMOUS_ID | |
, e._TIMESTAMP | |
, IFF(DATEDIFF(days | |
, LAG(e._TIMESTAMP) OVER (PARTITION BY e.USER_ANONYMOUS_ID ORDER BY e._TIMESTAMP) | |
, e._TIMESTAMP) = 0 |
This file contains 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
func (this *usersService) IsMagicLinkVerified(ctx context.Context, in *users.IsMagicLinkVerifiedRequest) (*users.IsMagicLinkVerifiedResponse, error) { | |
c, _ := context.WithDeadline(ctx, time.Now().Add(25*time.Second)) | |
ticker := ImmediateTicker(c, time.Second) | |
for { | |
select { | |
case <-c.Done(): | |
return &users.IsMagicLinkVerifiedResponse{Status: users.MagicLinkStatus_unknown}, nil | |
case <-ticker: | |
status, token := this.tokensRepo.IsMagicLinkVerified(in.SessionId) | |
if status != users.MagicLinkStatus_unknown { |
This file contains 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
- name: clean ssh key | |
if: always() | |
run: rm -rf github_id_rsa |
This file contains 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
echo -n "${PRIVATE_KEY}" | base64 --decode > github_id_rsa | |
sudo chmod 600 github_id_rsa |
This file contains 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
resource "google_service_account" "bastion" { | |
project = var.project | |
account_id = "bastion" | |
display_name = "ssh bastion" | |
} | |
locals { | |
bastion = "bastion" | |
} |
This file contains 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
ssh -o StrictHostKeyChecking=no -t -t \ | |
-i ./github_id_rsa "${SHH_USER}@${BASTION_IP}" \ | |
-L "3306:${MYSQL_IP}:3306" & |
This file contains 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
package reverse_proxy | |
import ( | |
"bytes" | |
"fmt" | |
"github.com/viggin/svc-api-gateway/internal/models" | |
"github.com/gin-gonic/gin" | |
"github.com/google/uuid" | |
"github.com/palantir/stacktrace" | |
"github.com/sirupsen/logrus" |
This file contains 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": 18, | |
"totalPrice": { | |
"type": "centPrecision", | |
"fractionDigits": 2, | |
"currencyCode": "USD", | |
"centAmount": 77600 | |
}, | |
"taxRoundingMode": "HalfEven", | |
"taxMode": "External", |