Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/separate server from site #67

Merged
merged 4 commits into from
Apr 26, 2021
Merged

Feature/separate server from site #67

merged 4 commits into from
Apr 26, 2021

Conversation

lreading
Copy link
Collaborator

Summary
Separate the front-end code from the back-end code

Description for the changelog
Created a separate directory at the root of the project for td.site, and moved td to td.server. Updated all local file references including scripts in package.json.

Other info
I think it would make sense to move the front-end to its own directory. This will allow us to migrate the back-end code to ES6 independently from any front-end code changes (eg Vue migration, e2e tests, etc). The front-end is using browserify and is slated to be migrated to Vue in the future. Having the front-end code fully separated from the back-end allows more options when moving to ES6, using transpalation tools like babel. It will also allow for more of a pragmatic approach to refactoring the back-end, where less work will need to be done in a single sweep.

I'm very open to feedback and discussion on this.

@lreading lreading requested a review from jgadsden April 25, 2021 17:30
@lreading lreading self-assigned this Apr 25, 2021
@lreading lreading added the enhancement New feature or request label Apr 25, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #67 (a8df2b1) into main (2b94784) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #67   +/-   ##
=======================================
  Coverage   97.98%   97.98%           
=======================================
  Files          26       26           
  Lines         545      546    +1     
  Branches       31       31           
=======================================
+ Hits          534      535    +1     
  Misses         11       11           
Impacted Files Coverage Δ
td.server/config/env.config.js 100.00% <ø> (ø)
td.server/config/loggers.config.js 100.00% <ø> (ø)
td.server/config/parsers.config.js 100.00% <ø> (ø)
td.server/config/passport.config.js 100.00% <ø> (ø)
td.server/config/routes.config.js 100.00% <ø> (ø)
td.server/config/securityheaders.config.js 100.00% <ø> (ø)
td.server/config/session.config.js 85.71% <ø> (ø)
td.server/controllers/githublogincontroller.js 100.00% <ø> (ø)
td.server/controllers/threatmodelcontroller.js 100.00% <ø> (ø)
td.server/helpers/encryption.helper.js 100.00% <ø> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b94784...a8df2b1. Read the comment docs.

"copy-fonts": "./node_modules/.bin/copyfiles -f ./node_modules/font-awesome/fonts/*.* ./node_modules/bootstrap/dist/fonts/*.* ./td/public/fonts",
"bundle-css": "./node_modules/.bin/rework-npm ./td/public/content/app.css -o ./td/public/content/threatdragon.css",
"minify-css": "./node_modules/.bin/uglifycss ./td/public/content/threatdragon.css > ./td/public/content/threatdragon.min.css",
"build-templates": "browserify -t [browserify-ng-html2js --module templates] ./td.site/app/templates.build.js -o ./td.site/app/templates.js",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this script needed anymore? I couldn't find templates.js or templates.build.js

Copy link
Collaborator

@jgadsden jgadsden Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed, this can be safely removed.
It is a left over from when threat dragon was a single project before it was split off into core, desktop and webapp

Copy link
Collaborator

@jgadsden jgadsden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very good to see, many thanks to @lreading . Tested it just now it works as before.

This is one of the first steps in the version 2.0 roadmap, which will make it easier to provide an API to Threat Dragon. This has been requested in some verbal conversation I have had with users, which will help them use it in CI / CD pipelines and the like

@jgadsden
Copy link
Collaborator

There are two errors from the code scanning. I do not think these were introduced in this pull request, they seem to have always been present. @lreading did you want to confirm this?

Looks good to me for merging

@lreading
Copy link
Collaborator Author

It looks to be complaining about the front-end threatdragon.js: there weren't any substantial changes there (if any). My guess is that where the file is in a different path it's identifying it as a new file and alerting on that?

@jgadsden
Copy link
Collaborator

Agreed, we should go ahead and merge. We will be probably be revising all this code for version 2.0 so it may not be in the scan when that time comes.

@jgadsden jgadsden merged commit 59f2a1f into OWASP:main Apr 26, 2021
@lreading lreading deleted the feature/separate-server-from-site branch April 26, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants