Code Monkey home page Code Monkey logo

favoextend's Introduction

favoExtend

This is backend-builder of Website favorite(like) and develop extend feature.

Setup

Register service

Create Accounts and publish tokens

  • Upstash
  • Cloudflare
    • Create API Token from User API Token
      • NOT API Key
    • Set allocation of...
      • Account-Workers Script-Edit
      • Zone-Workers Route-Edit (Only if you use workers route)

Install terraform

Install terraform CLI. Reference is here.

Manage tfstate configuration

This product use R2 storage as tfstate backend.

If you use R2 backend, setup terraform.tfbackend

If you use save tfstate on Cloudflare R2, you need to get R2 Access key, Access secret and endpoint url from https://dash.cloudflare.com/<CLOUDFLARE_ACCOUNT_ID>/r2/api-tokens

After you got Access key, Access secret and endpoint url, edit terraform.tfbackend from terraform.tfbackend.template

If you manage tfstate on local, you don't need to setup terraform.tfbackend.

No need to tfstate or only try, reduce provider.tf

If you don't need to manage tfstate on Cloudflare R2, edit provider.tf, remove backend "s3" block or delete provider.tf.

terraform {
-   backend "s3" {
-     bucket                      = "tfstate"
-     key                         = "extendfavorite.tfstate"
-    region                      = "auto"
-     skip_credentials_validation = true
-     skip_region_validation      = true
-     skip_requesting_account_id  = true
-     skip_metadata_api_check     = true
-     skip_s3_checksum            = true
-   }
}

Prepair terraform.tfvars

Prepair terraform.tfvars file from terraform.tfvars.template

!Attention

For LAZINESS or ANNOY of Cloudflare Developper team, workers route of workers.dev zone cannot enable with terraform deploy.

3 Issue about this problem but it closed with any resolve.

Enable the default route for cloudflare workers #2892 (Closed with NO support)

Support Worker Domains #1921 (Closed with NO support)

Support for Workers.dev route #1013 (Closed with NO support)

So favoExtend only support workers route of domains you managed in cloudflare domain.

If you wanna use workers.dev, manually setup by dashboard.

dashboard

Deploy extendfavorite

Initialize environment

terraform init -backend-config terraform.tfbackend

Plan deploy

terraform plan

Deploy

terraform apply

Stop use

Destroy

terraform destroy

Extend API

If you need to Extend API, see Extend Guide(README.md).

Reference

Install Terraform | Terraform | HashiCorp Developer
Support Cloudflare r2 for storing Terraform state #33847
Japanese Reference(Zenn/favoExtend マニュアル)

favoextend's People

Contributors

nkte8 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.