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

Patch #3

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
4ef5171
react
nikoladavitkovski Aug 30, 2022
bc3a07d
Update yarn-error.log
nikoladavitkovski Aug 30, 2022
733dfdd
SECURITY.mk
nikoladavitkovski Aug 30, 2022
4b06947
Squashed commit of the following:
nikoladavitkovski Aug 30, 2022
acd005d
Create .gitignore
nikoladavitkovski Aug 30, 2022
d42cc01
Squashed commit of the following:
nikoladavitkovski Aug 30, 2022
6976bf6
Merge branch 'patch-1'
nikoladavitkovski Aug 30, 2022
52d8376
Create .gitignore
nikoladavitkovski Aug 30, 2022
8060402
Merge branch 'patch-1' of https://github.com/nikoladavitkovski/YelpCa…
nikoladavitkovski Aug 30, 2022
02d8e95
Merge branch 'master' into patch-1
nikoladavitkovski Aug 30, 2022
21fc0ab
Create desktop.ini
nikoladavitkovski Aug 31, 2022
c106b9b
Merge branch 'master' of https://github.com/nikoladavitkovski/YelpCam…
nikoladavitkovski Aug 31, 2022
c064fd4
Revert "Merge branch 'master' of https://github.com/nikoladavitkovski…
nikoladavitkovski Sep 1, 2022
7d284d7
Signed-off-by: n.davitkovski <ndavitkovski@yahoo.com>
nikoladavitkovski Sep 1, 2022
6039014
Signed-off-by: n.davitkovski <ndavitkovski@yahoo.com>
nikoladavitkovski Sep 1, 2022
10f9dd4
Merge remote-tracking branch 'origin/patch-1' into patch-1
nikoladavitkovski Sep 1, 2022
3f5f077
react
nikoladavitkovski Sep 1, 2022
0aaf37c
Revert "react"
nikoladavitkovski Sep 1, 2022
2b7ad74
Update app.js
nikoladavitkovski Sep 9, 2022
26c73cf
react
nikoladavitkovski Sep 10, 2022
f7723e7
Update .gitignore
nikoladavitkovski Sep 10, 2022
fbea747
Update index.js
nikoladavitkovski Sep 16, 2022
a9e5c0b
Create settings.json
nikoladavitkovski Sep 18, 2022
1a0c3e4
Update campground.js
nikoladavitkovski Sep 23, 2022
b21fe8a
Add files via upload
nikoladavitkovski Sep 29, 2022
32c0767
Update index.js
nikoladavitkovski Oct 4, 2022
0515cc4
Create stat.js-19.0.0.tgz
nikoladavitkovski Oct 11, 2022
28135c3
Merge branch 'patch-1' of https://github.com/nikoladavitkovski/YelpCa…
nikoladavitkovski Oct 11, 2022
43a514b
app.js
nikoladavitkovski Oct 11, 2022
4072218
Merge branch 'patch' of https://github.com/nikoladavitkovski/YelpCamp…
nikoladavitkovski Oct 11, 2022
6b6f749
Create azure-webapps-node.yml
nikoladavitkovski Oct 14, 2022
33a2021
Add files via upload
nikoladavitkovski Oct 14, 2022
f57de30
Create apisec-scan.yml
nikoladavitkovski Oct 14, 2022
0ff2c68
README
nikoladavitkovski Oct 14, 2022
4520cd1
Merge branch 'master' into patch
nikoladavitkovski Oct 14, 2022
56a82f8
Merge branch 'master' into patch
nikoladavitkovski Oct 14, 2022
837aacf
Merge branch 'patch' of https://github.com/nikoladavitkovski/YelpCamp…
nikoladavitkovski Oct 14, 2022
63b53f2
Merge branch 'master' into patch-1
nikoladavitkovski Oct 24, 2022
53197af
Merge branch 'patch' into patch-1
nikoladavitkovski Oct 26, 2022
5546d17
Update campground.js
nikoladavitkovski Dec 1, 2022
9ae4b28
require
nikoladavitkovski Jan 4, 2023
6f430eb
Merge branch 'patch'
nikoladavitkovski Jan 4, 2023
4e075de
Update SECURITY.mk
nikoladavitkovski Jan 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/SECURITY.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#github.au
#README
#name.space
8 changes: 8 additions & 0 deletions .github/workflows/YelpCamp_refactored.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": "../.."
}
],
"settings": {}
}
70 changes: 70 additions & 0 deletions .github/workflows/apisec-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# APIsec addresses the critical need to secure APIs before they reach production.
# APIsec provides the industry’s only automated and continuous API testing platform that uncovers security vulnerabilities and logic flaws in APIs.
# Clients rely on APIsec to evaluate every update and release, ensuring that no APIs go to production with vulnerabilities.

# How to Get Started with APIsec.ai
# 1. Schedule a demo at https://www.apisec.ai/request-a-demo .
#
# 2. Register your account at https://cloud.fxlabs.io/#/signup .
#
# 3. Register your API . See the video (https://www.youtube.com/watch?v=MK3Xo9Dbvac) to get up and running with APIsec quickly.
#
# 4. Get GitHub Actions scan attributes from APIsec Project -> Configurations -> Integrations -> CI-CD -> GitHub Actions
#
# apisec-run-scan
#
# This action triggers the on-demand scans for projects registered in APIsec.
# If your GitHub account allows code scanning alerts, you can then upload the sarif file generated by this action to show the scan findings.
# Else you can view the scan results from the project home page in APIsec Platform.
# The link to view the scan results is also displayed on the console on successful completion of action.

# This is a starter workflow to help you get started with APIsec-Scan Actions

name: APIsec

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
# Customize trigger events based on your DevSecOps processes.
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '15 21 * * 4'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:


permissions:
contents: read

jobs:
Trigger APIsec scan:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest

steps:
- name: APIsec scan
uses: apisec-inc/apisec-run-scan@f62d0c6fae8a80f97b091a323befdb56e6ad9993
with:
# The APIsec username with which the scans will be executed
apisec-username: ${{ secrets.apisec_username }}
# The Password of the APIsec user with which the scans will be executed
apisec-password: ${{ secrets.apisec_password}}
# The name of the project for security scan
apisec-project: "VAmPI"
# The name of the sarif format result file The file is written only if this property is provided.
sarif-result-file: "apisec-results.sarif"
- name: Import results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ./apisec-results.sarif
78 changes: 78 additions & 0 deletions .github/workflows/azure-webapps-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# This workflow will build and push a node.js application to an Azure Web App when a commit is pushed to your default branch.
#
# This workflow assumes you have already created the target Azure App Service web app.
# For instructions see https://docs.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=linux&pivots=development-environment-cli
#
# To configure this workflow:
#
# 1. Download the Publish Profile for your Azure Web App. You can download this file from the Overview page of your Web App in the Azure Portal.
# For more information: https://docs.microsoft.com/en-us/azure/app-service/deploy-github-actions?tabs=applevel#generate-deployment-credentials
#
# 2. Create a secret in your repository named AZURE_WEBAPP_PUBLISH_PROFILE, paste the publish profile contents as the value of the secret.
# For instructions on obtaining the publish profile see: https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the-github-secret
#
# 3. Change the value for the AZURE_WEBAPP_NAME. Optionally, change the AZURE_WEBAPP_PACKAGE_PATH and NODE_VERSION environment variables below.
#
# For more information on GitHub Actions for Azure: https://github.com/Azure/Actions
# For more information on the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# For more samples to get started with GitHub Action workflows to deploy to Azure: https://github.com/Azure/actions-workflow-samples

on:
push:
branches: [ "master" ]
workflow_dispatch:

env:
AZURE_WEBAPP_NAME: your-app-name # set this to your application's name
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root
NODE_VERSION: '14.x' # set this to the node version to use

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present

- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: node-app
path: .

deploy:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
environment:
name: 'Development'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: node-app

- name: 'Deploy to Azure WebApp'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ env.AZURE_WEBAPP_NAME }}
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"public"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
Binary file added .vscode/stat.js-19.0.0.tgz
Binary file not shown.
118 changes: 8 additions & 110 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,8 @@
# YelpCamp

> A Node.js web application project from the Udemy course - [The Web Developer Bootcamp by Colt Steele](https://www.udemy.com/the-web-developer-bootcamp/)

## Live App

To see the app in action, go to [https://davidn-yelp-camp.herokuapp.com/](https://davidn-yelp-camp.herokuapp.com/)

## Features

* Authentication:

* User login with username and password

* Authorization:

* One cannot manage posts and view user profile without being authenticated

* One cannot edit or delete posts and comments created by other users


* Manage campground posts with basic functionalities:

* Create, edit and delete posts and comments

* Upload campground photos


* Manage user account with basic functionalities:
* Profile page setup with sign-up

* Flash messages responding to users' interaction with the app

* Ratings and reviews

* Pagination on campgrounds index

* Responsive web design

## Upcoming features

* Nice UI

* Authentication:
* Admin sign-up with admin code

* Authorization:
* Admin can manage all posts and comments


* Map API:
* Display campground location on Google Maps

* Fuzzy Search
* Search existing campgrounds

* Manage user account with basic functionalities:
* Password reset via email confirmation


## Getting Started

> This app contains API secrets and passwords that have been hidden deliberately, so the app cannot be run with its features on your local machine. However, feel free to clone this repository if necessary.

### Clone or download this repository

```sh
git clone https://github.com/lucasweng/yelp-camp.git
```

### Install dependencies

```sh
npm install
```

or

```sh
yarn install
```

### Comments in code

Some comments in the source code are course notes and therefore might not seem necessary from a developer's point of view.

## Built with

### Front-end

* [ejs](http://ejs.co/)
* [Bootstrap](https://getbootstrap.com/docs/3.3/)

### Back-end

* [express](https://expressjs.com/)
* [mongoDB](https://www.mongodb.com/)
* [mongoose](http://mongoosejs.com/)
* [passport](http://www.passportjs.org/)
* [passport-local](https://github.com/jaredhanson/passport-local#passport-local)
* [express-session](https://github.com/expressjs/session#express-session)
* [method-override](https://github.com/expressjs/method-override#method-override)
* [moment](https://momentjs.com/)
* [connect-flash](https://github.com/jaredhanson/connect-flash#connect-flash)

### Platforms

* [Heroku](https://www.heroku.com/)
* [Cloud9](https://aws.amazon.com/cloud9/?origin=c9io)

# pytest cache directory #

This directory contains data from the pytest's cache plugin,
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.

**Do not** commit this to version control.

See [the docs](https://docs.pytest.org/en/stable/how-to/cache.html) for more information.
4 changes: 4 additions & 0 deletions add/desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[ViewState]
Mode=
Vid=
FolderType=Generic
Loading