Skip to content

Commit

Permalink
Move fleetdm.com into main Fleet repo (#83)
Browse files Browse the repository at this point in the history
* rename dir

* no need to install website or docs from npm

At some point, would also be nice to be able to exclude assets/ as well, and to only install a pre-built version of Fleet's frontend code

* Bring in fleetdm.com website

From https://github.com/fleetdm/fleetdm.com as of https://github.com/fleetdm/fleetdm.com/releases/tag/v0.0.21

* add procfile for heroku

Using https://github.com/timanovsky/subdir-heroku-buildpack

* avoid getting anybody's hopes up

* Create deploy-fleet-website.yml (#82)

* Create deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* update pjs with SPDX-like license expressions.  also fix repo URL

and remove package lock

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* remove dummy uri

* Dissect deploy script

* Update deploy-fleet-website.yml

* workaround for eslintrc nesting issue

* lint fixes

* forgot the .js

* add per-commit git config

* Update deploy-fleet-website.yml

* might as well remove that

* cleanup

* connect w/ heroku app and have it actually push

* fix bug I introduced in 578a1a0

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* the beauty, the glory, of javascript

* GH actions don't like "\n"

* Update deploy-fleet-website.yml

* restore \n chars from 0d45e56

hoping I was wrong in 0d45e56 but see also https://github.community/t/what-is-the-correct-character-escaping-for-workflow-command-values-e-g-echo-xxxx/118465/5

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* Update deploy-fleet-website.yml

* rename script to prevent duplicate building

* Configure the real website

* clean up

* a test of the deploy workflow

* add handbook to npmignore

* I guess you could call this fixing a typo

* point workflow at master branch

* now clearly bogus: this completely unused version string
  • Loading branch information
mikermcneil committed Dec 2, 2020
1 parent 47b4f07 commit 27eae20
Show file tree
Hide file tree
Showing 213 changed files with 65,658 additions and 10 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/deploy-fleet-website.yml
@@ -0,0 +1,71 @@
name: Deploy Fleet website

on:
push:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

# Configure our access credentials for the Heroku CLI
- uses: akhileshns/heroku-deploy@v3.6.8
with:
heroku_api_key: ${{secrets.HEROKU_API_TOKEN_FOR_BOT_USER}}
heroku_app_name: "" # this has to be blank or it doesn't work
heroku_email: ${{secrets.HEROKU_EMAIL_FOR_BOT_USER}}
justlogin: true
- run: heroku auth:whoami

# Set the Node.js version
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

# Now start building!
# > …but first, get a little crazy for a sec and delete the top-level package.json file
# > i.e. the one used by the Fleet server. This is because require() in node will go
# > hunting in ancestral directories for missing dependencies, and since some of the
# > bundled transpiler tasks sniff for package availability using require(), this trips
# > up when it encounters another Node universe in the parent directory.
- run: rm -rf package.json package-lock.json node_modules/
# > Turns out there's a similar issue with how eslint plugins are looked up, so we
# > delete the top level .eslintrc file too.
- run: rm -f .eslintrc.js

# Get dependencies (including dev deps)
- run: cd website/ && npm install

# Run sanity checks
- run: cd website/ && npm test

# Compile assets
- run: cd website/ && npm run build-for-prod

# Commit newly-built assets locally so we can push them to Heroku below.
# (This commit will never be pushed to GitHub- only to Heroku.)
# > The local config flags make this work in GitHub's environment.
- run: git add website/.www
- run: git -c "user.name=Fleetwood" -c "user.email=github@example.com" commit -am 'AUTOMATED COMMIT - Deployed the latest, including modified HTML layouts and .sailsrc file that reference minified assets.'

# Configure the Heroku app we'll be deploying to
- run: heroku git:remote -a production-fleetdm-website
- run: git remote -v

# Deploy to Heroku (by pushing)
# > Since a shallow clone was grabbed, we have to "unshallow" it before forcepushing.
- run: echo "Unshallowing local repository…"
- run: git fetch --prune --unshallow
- run: echo "Deploying branch '${GITHUB_REF##*/}' to Heroku…"
- run: git push heroku +${GITHUB_REF##*/}:master
- name: 🌐 https://fleetdm.com
run: echo '' && echo '--' && echo 'OK, done. It should be live momentarily.' && echo '(if you get impatient, check the Heroku dashboard for status)' && echo && echo ' 🌐–• https://fleetdm.com'
3 changes: 3 additions & 0 deletions .npmignore
@@ -0,0 +1,3 @@
website
docs
handbook
10 changes: 5 additions & 5 deletions package.json
@@ -1,8 +1,7 @@
{
"name": "@kolide/fleet",
"version": "0.1.0",
"description": "Kolide, Black Box Security. Unboxed",
"author": "Kolide, Inc.",
"name": "@fleetdm/fleet",
"version": "0.99.99",
"description": "The premier osquery fleet manager.",
"private": true,
"sasslintConfig": ".sass-lint.yml",
"scripts": {
Expand Down Expand Up @@ -195,5 +194,6 @@
],
"clearMocks": true,
"testURL": "http://localhost:8080"
}
},
"license": "SEE LICENSE IN ./LICENSE"
}
31 changes: 31 additions & 0 deletions website/.editorconfig
@@ -0,0 +1,31 @@
################################################
# ╔═╗╔╦╗╦╔╦╗╔═╗╦═╗┌─┐┌─┐┌┐┌┌─┐┬┌─┐
# ║╣ ║║║ ║ ║ ║╠╦╝│ │ ││││├┤ ││ ┬
# o╚═╝═╩╝╩ ╩ ╚═╝╩╚═└─┘└─┘┘└┘└ ┴└─┘
#
# > Formatting conventions for your Sails app.
#
# This file (`.editorconfig`) exists to help
# maintain consistent formatting throughout the
# files in your Sails app.
#
# For the sake of convention, the Sails team's
# preferred settings are included here out of the
# box. You can also change this file to fit your
# team's preferences (for example, if all of the
# developers on your team have a strong preference
# for tabs over spaces),
#
# To review what each of these options mean, see:
# http://editorconfig.org/
#
################################################
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions website/.eslintignore
@@ -0,0 +1,3 @@
assets/dependencies/**/*.js
views/**/*.ejs

90 changes: 90 additions & 0 deletions website/.eslintrc
@@ -0,0 +1,90 @@
{
// ╔═╗╔═╗╦ ╦╔╗╔╔╦╗┬─┐┌─┐
// ║╣ ╚═╗║ ║║║║ ║ ├┬┘│
// o╚═╝╚═╝╩═╝╩╝╚╝ ╩ ┴└─└─┘
// A set of basic code conventions designed to encourage quality and consistency
// across your Sails app's code base. These rules are checked against
// automatically any time you run `npm test`.
//
// > An additional eslintrc override file is included in the `assets/` folder
// > right out of the box. This is specifically to allow for variations in acceptable
// > global variables between front-end JavaScript code designed to run in the browser
// > vs. backend code designed to run in a Node.js/Sails process.
//
// > Note: If you're using mocha, you'll want to add an extra override file to your
// > `test/` folder so that eslint will tolerate mocha-specific globals like `before`
// > and `describe`.
// Designed for ESLint v4.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// For more information about any of the rules below, check out the relevant
// reference page on eslint.org. For example, to get details on "no-sequences",
// you would visit `http://eslint.org/docs/rules/no-sequences`. If you're unsure
// or could use some advice, come by https://sailsjs.com/support.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

"env": {
"node": true
},

"parserOptions": {
"ecmaVersion": 2018
},

"globals": {
// If "no-undef" is enabled below, be sure to list all global variables that
// are used in this app's backend code (including the globalIds of models):
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Promise": true,
"sails": true,
"_": true,

// Models:
"User": true

// …and any others.
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
},

"rules": {
"block-scoped-var": ["error"],
"callback-return": ["error", ["done", "proceed", "next", "onwards", "callback", "cb"]],
"camelcase": ["warn", {"properties":"always"}],
"comma-style": ["warn", "last"],
"curly": ["warn"],
"eqeqeq": ["error", "always"],
"eol-last": ["warn"],
"handle-callback-err": ["error"],
"indent": ["warn", 2, {
"SwitchCase": 1,
"MemberExpression": "off",
"FunctionDeclaration": {"body":1, "parameters":"off"},
"FunctionExpression": {"body":1, "parameters":"off"},
"CallExpression": {"arguments":"off"},
"ArrayExpression": 1,
"ObjectExpression": 1,
"ignoredNodes": ["ConditionalExpression"]
}],
"linebreak-style": ["error", "unix"],
"no-dupe-keys": ["error"],
"no-duplicate-case": ["error"],
"no-extra-semi": ["warn"],
"no-labels": ["error"],
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"no-redeclare": ["warn"],
"no-return-assign": ["error", "always"],
"no-sequences": ["error"],
"no-trailing-spaces": ["warn"],
"no-undef": ["error"],
"no-unexpected-multiline": ["warn"],
"no-unreachable": ["warn"],
"no-unused-vars": ["warn", {"caughtErrors":"all", "caughtErrorsIgnorePattern": "^unused($|[A-Z].*$)", "argsIgnorePattern": "^unused($|[A-Z].*$)", "varsIgnorePattern": "^unused($|[A-Z].*$)" }],
"no-use-before-define": ["error", {"functions":false}],
"one-var": ["warn", "never"],
"prefer-arrow-callback": ["warn", {"allowNamedFunctions":true}],
"quotes": ["warn", "single", {"avoidEscape":false, "allowTemplateLiterals":true}],
"semi": ["warn", "always"],
"semi-spacing": ["warn", {"before":false, "after":true}],
"semi-style": ["warn", "last"]
}

}
134 changes: 134 additions & 0 deletions website/.gitignore
@@ -0,0 +1,134 @@
################################################
# ┌─┐┬┌┬┐╦╔═╗╔╗╔╔═╗╦═╗╔═╗
# │ ┬│ │ ║║ ╦║║║║ ║╠╦╝║╣
# o└─┘┴ ┴ ╩╚═╝╝╚╝╚═╝╩╚═╚═╝
#
# > Files to exclude from your app's repo.
#
# This file (`.gitignore`) is only relevant if
# you are using git.
#
# It exists to signify to git that certain files
# and/or directories should be ignored for the
# purposes of version control.
#
# This keeps tmp files and sensitive credentials
# from being uploaded to your repository. And
# it allows you to configure your app for your
# machine without accidentally committing settings
# which will smash the local settings of other
# developers on your team.
#
# Some reasonable defaults are included below,
# but, of course, you should modify/extend/prune
# to fit your needs!
#
################################################


################################################
# Local Configuration
#
# Explicitly ignore files which contain:
#
# 1. Sensitive information you'd rather not push to
# your git repository.
# e.g., your personal API keys or passwords.
#
# 2. Developer-specific configuration
# Basically, anything that would be annoying
# to have to change every time you do a
# `git pull` on your laptop.
# e.g. your local development database, or
# the S3 bucket you're using for file uploads
# during development.
#
################################################

config/local.js


################################################
# Dependencies
#
#
# When releasing a production app, you _could_
# hypothetically include your node_modules folder
# in your git repo, but during development, it
# is always best to exclude it, since different
# developers may be working on different kernels,
# where dependencies would need to be recompiled
# anyway.
#
# Most of the time, the node_modules folder can
# be excluded from your code repository, even
# in production, thanks to features like the
# package-lock.json file / NPM shrinkwrap.
#
# But no matter what, since this is a Sails app,
# you should always push up the package-lock.json
# or shrinkwrap file to your repository, to avoid
# accidentally pulling in upgraded dependencies
# and breaking your code.
#
# That said, if you are having trouble with
# dependencies, (particularly when using
# `npm link`) this can be pretty discouraging.
# But rather than just adding the lockfile to
# your .gitignore, try this first:
# ```
# rm -rf node_modules
# rm package-lock.json
# npm install
# ```
#
# [?] For more tips/advice, come by and say hi
# over at https://sailsjs.com/support
#
################################################

node_modules


################################################
#
# > Do you use bower?
# > re: the bower_components dir, see this:
# > http://addyosmani.com/blog/checking-in-front-end-dependencies/
# > (credit Addy Osmani, @addyosmani)
#
################################################


################################################
# Temporary files generated by Sails/Waterline.
################################################

.tmp


################################################
# Miscellaneous
#
# Common files generated by text editors,
# operating systems, file systems, dbs, etc.
################################################

*~
*#
.DS_STORE
.netbeans
nbproject
.idea
*.iml
.vscode
.node_history
dump.rdb

npm-debug.log
lib-cov
*.seed
*.log
*.out
*.pid

27 changes: 27 additions & 0 deletions website/.htmlhintrc
@@ -0,0 +1,27 @@
{
"alt-require": true,
"attr-lowercase": ["viewBox"],
"attr-no-duplication": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": true,
"attr-value-not-empty": false,
"csslint": false,
"doctype-first": false,
"doctype-html5": true,
"head-script-disabled": false,
"href-abs-or-rel": false,
"id-class-ad-disabled": true,
"id-class-value": false,
"id-unique": true,
"inline-script-disabled": true,
"inline-style-disabled": false,
"jshint": false,
"space-tab-mixed-disabled": "space",
"spec-char-escape": false,
"src-not-empty": true,
"style-disabled": false,
"tag-pair": true,
"tag-self-close": false,
"tagname-lowercase": true,
"title-require": false
}

0 comments on commit 27eae20

Please sign in to comment.