Skip to content

insanj/insane.pink

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

insane.pink

๐ŸŽณ website for insane.jpg siege youtube videos.

๐Ÿš€ Production ๐Ÿ‘พ Development ๐Ÿ“บ Video Material ๐Ÿ† Support ๐Ÿ”จ Issues ๐Ÿ†˜ Help
insane.pw insane.pink youtube.com/insanj patreon.com/insanj github.com/insanj contact
Google Cloud Github Pages Youtube Patreon Github Email

Table of Contents

  1. Usage
  2. Setup
  3. About

Usage

  • install with bundle install (install Bundler)
  • serve with npm start (bundle exec jekyll serve) to see your development site
  • build with npm run build (bundle exec jekyll build) to get a production ready site
  • sync with npm run youtube (node insane_sync.js) to create a new post from the latest insane.jpg youtube video
  • deploy with jekyll build --destination docs && gcloud app deploy which both generates a static site for Github Pages and Google Cloud

NOTE: insane.pw uses the barber-jekyll theme

Components

๐Ÿœ Steam API Integration

Setup

  1. register a new api key with the steam dev community
  2. lookup your steam username and get the identifier in the steamID64 format (mine is 76561198017375926). steamidfinder.com works well for this
  3. build a url using the following format:
http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=<API_KEY>&steamids=<STEAM_ID>
  1. parse the JSON response to extract the important info displayed below:
{"response":
	{"players":
		[{
			"lastlogoff":1541446073,
			"profileurl":"https://steamcommunity.com/id/insanj/",
			"avatarfull":"https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/8f/8f80c9dae4338b1c83ed5e4b3a0da663e0d51b14_full.jpg",
			"personastate":1,
			"timecreated":1259700378,
			"gameextrainfo":"Tom Clancy's Rainbow Six Siege",
			"gameid":"359550",
			"loccountrycode":"US"
		}]
	}
}
  1. ๐ŸŽ‰ render and ship it! great documentation is here for all the API metadata responses

Setup

Google Cloud

๐Ÿฎ Jekyll-App-Engine

  1. https://github.com/jamesramsay/jekyll-app-engine

NOTE: ๐ŸŽ‰ the current deployment uses this plugin! check out the app.yaml and _config.yml, which both include very important details

๐Ÿ’Ž Custom (Docker) Environment App

  1. install docker on your local machine in order to test the custom environment
  2. ensure the docker service is running (may require running the following command on Linux/Ubuntu subsystem: sudo nohup docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock &)
  3. create a Dockerfile that will run automatically once your app.yaml has env: custom:
# NODEJS
FROM gcr.io/google_appengine/nodejs
COPY . /app/
RUN npm install --unsafe-perm || \
  ((if [ -f npm-debug.log ]; then \
      cat npm-debug.log; \
    fi) && false)

# RUBY
FROM gcr.io/google_appengine/ruby
COPY . /app/
RUN bundle install

RUN bundle exec jekyll serve --host=216.239.36.21

๐ŸŽ Ruby App

  1. clone this repository (or create your own jekyll-based repo)
  2. create a new project in the Google Cloud Console and a new Ruby app in the App Engine section
  3. add a new custom domain (if desired) in the settings area
  4. update the advanced dns records of your domain name (which can be bought through Google, Namecheap, etc) to add the A and CNAME records, which look something like this:
A @ 216.239.32.21
AAAA @ 2001:4860:4802:32::15
CNAME www ghs.googlehosted.com	
  1. install the gcloud sdk on your local machine and run gcloud init to setup a new configuration for the project you've just made
  2. run gcloud app deploy which will upload and serve your files (make sure the _config.yml and app.yaml are setup to your liking). the default config looks like this:
runtime: ruby
env: flex
entrypoint: bundle exec jekyll serve

NOTE: certain config values are extremely important to hosting a jekyll server, such as the 3 listed above in the app.yaml, and the excludes: [vendor] line in the _config.yml, the crux of the issue reported here

  1. enable websocket use by running the following command:
gcloud compute firewall-rules create default-allow-jekyll --allow tcp:4000 --target-tags jekyll --description "allow jekyll traffic on port 4000"

๐Ÿ’ง Bucket

  1. clone this repository (or create your own jekyll-based repo)
  2. create a new project in the Google Cloud Console and Create a Bucket under the Storage section in the sidebar
  3. install the gcloud sdk on your local machine and run gcloud auth login
  4. run jekyll build && gsutil -m rsync -d -r _site gs://<BUCKET_URL>.com, which will upload and serve your files (make sure the _config.yml and app.yaml are setup to your liking)
  5. select the bucket from the main Bucket Browser menu and change its Permissions (sometimes in the Info Panel on the right)
  6. expose bucket perhaps through the App Engine Application Settings, Default Cloud Storage Bucket area, or using instructions here

๐Ÿ“Ÿ Github Pages

  1. clone this repository
  2. either (1) trust github to properly build jekyll based on the existing _config.yml or (2) run jekyll build --destination docs
  3. enable Github Pages in the settings area of your Github repository, and point it to master or your docs directory

About