This file contains hidden or 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_backend_bucket" "foo_backend" { | |
| name = "foo-backend-bucket" | |
| description = "FOO frontend" | |
| custom_response_headers = ["X-foo: bar"] | |
| bucket_name = google_storage_bucket.editor.name | |
| enable_cdn = true | |
| edge_security_policy = google_compute_security_policy.waf-security-policy.id | |
| cdn_policy { | |
| serve_while_stale = 86400 | |
| client_ttl = 60 |
This file contains hidden or 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
| data "google_iam_policy" "viewer" { | |
| binding { | |
| role = "roles/storage.objectViewer" | |
| members = [ | |
| "allUsers", | |
| ] | |
| } | |
| } | |
| resource "google_storage_bucket_iam_policy" "foo-public-read" { | |
| bucket = google_storage_bucket.editor.name |
This file contains hidden or 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_storage_bucket" "foo-bucket" { | |
| name = "${var.project}-foo" | |
| location = "US" | |
| website { | |
| main_page_suffix = "index.html" | |
| not_found_page = "404.html" | |
| } | |
| uniform_bucket_level_access = true |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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" | |
| } |