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

[fix]: permissions for keploy folder #1699

Open
wants to merge 378 commits into
base: main
Choose a base branch
from

Conversation

AhmedLotfy02
Copy link
Contributor

Related Issue

  • Unable to delete keploy generated folder due to permission

Closes: #1696

Describe the changes you've made

  • Adding permissions to the folder

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Please let us know if any test cases are added

Please describe the tests(if any). Provide instructions how its affecting the coverage.

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

A clear and concise description of it.

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Screenshots (if any)

Original Updated
original screenshot updated screenshot

PranshuSrivastava and others added 30 commits October 6, 2023 13:24
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
…cker (keploy#963)

* fix: add comm chan in docker

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: add check on channel

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
* refactor: removed commented code
Signed-off-by: Yash Singh <yashdsingh2004@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Co-authored-by: Ritik Jain <60597329+re-Tick@users.noreply.github.com>
Co-authored-by: Neha Gupta <gneha21@yahoo.in>
* fix: https mock for node v18.x.x not generating

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

* fix: make client acc to conn status

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

---------

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
* fix remove channel

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: remove self-hosted actions

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
Co-authored-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
* feat: support for running a given test-sets

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Co-authored-by: Ritik Jain <60597329+re-Tick@users.noreply.github.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
* bug: check build for arm architecture

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* bug: changed version to v4 and added arch=arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* bug: add arm build for other workflows

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: removed arch arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: add arm64 in arch

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: add run-on-arch

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: github actions

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: arm build

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: build arm arm-runner-action complete

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: added build arm in build job with GOARCH=arm

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: check architecture

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: rename binary

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: list files

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: check arch

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: final commit

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: revert to v2

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

---------

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
* feat: added sentry for telemetry

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* feat: added all events for telemetry

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* feat: added all telemetry events except mocktest

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* style: merged main

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* feat: almost completed the integration

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* feat: added cmd field in the events and updated the README for the docker command

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: removed unnecessary changes

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: added tests and records in one ping

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* feat: added env variables for docker and sentry

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* feat: added support for arch

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: checking for the value of Dsn

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: update goreleaser

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: update approach

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: addressed all the comments on the PR

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: fixed goreleaser and docker build issues

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: fix dsn

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: updated sentry logging mechanism

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: made changes according to the finalisation

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: added if checks before sending events and changed the logger

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

* fix: added additional mount directory for docker

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>

---------

Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
* feat:one touch install

* update:cli refactor

* update:add support of colima

* refactor:removal of sudo

* update: colimma update

* refactor:adding echo

* update:add exit

* update:lyes no to y/n

* update:example

* update: keploy command to install

* update:path for record

* update:readme

* update:alias for docker

* update:location of keploy download

* update:zshrc and bash saving

* update: text

* fix:text

* refactor:removing continious append

* update: alias

* update:zsh command

* fix command

* update sudo mount

* update:alias

* updating readme

* update:readme

* update readme

* update:readme
Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
Signed-off-by: Pranshu Srivastava <iampranshu24@gmail.com>
* fix remove channel

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: log user errors

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: remove commented code

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
* added port proxy as a flag

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* added custom proxy port flag to commands

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* fixed review issues for proxy port

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* fixed review issues for proxy port

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* removed proxy port as a parameter

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* removed proxy port as a parameter

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* fixed some syntax error

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

* added proxy port as a flag

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>

---------

Signed-off-by: EraKin575 <tejaskumar574@gmail.com>
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: EraKin575 <tejaskumar574@gmail.com>
* feat: add link to test-reports and test summary

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* feat: add log statement

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* feat: add custom color encoder to zap

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: remove comments

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: added clone method

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* feat: add comments

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

* fix: optimisation

Signed-off-by: Akash Kumar <meakash7902@gmail.com>

---------

Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Co-authored-by: Sarthak Shyngle <50234097+Sarthak160@users.noreply.github.com>
Co-authored-by: Animesh Pathak <53110238+Sonichigo@users.noreply.github.com>
Co-authored-by: Neha Gupta <gneha21@yahoo.in>
Fixed typos and missing commas
charankamarapu and others added 4 commits March 14, 2024 12:30
* fix: linter github action and issues

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: linter github action and issues

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: linter github action and issues

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: linter issues

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: add only-new-issues in linter

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: keploy-config name in workflows

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: sudo issue

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: yaml to yml

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: Remove print statements

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: golang workflow

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: golang workflow

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: golang workflow

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: golang workflow

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: debug

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: golang workflow

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: debug

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: config

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: remove debug

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: python-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: python-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: python-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: node-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: node-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: node-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: node-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: node-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: node-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: node-on-linux

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: enable telemetry

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: add testReports backward compatability

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
* fix: add selectedTests feat

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: add selectedTests feat

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: add selectedTests feat

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: linter

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: spelling

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
* fix: dns resolution in fedora

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
---------

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
Signed-off-by: AhmedLotfy02 <ahmadlotfygamersfield@gmail.com>
@@ -155,6 +157,14 @@
utils.LogError(Logger, err, "failed to close the yaml file", zap.String("path directory", path), zap.String("yaml", fileName))
return false, err
}

basePath := path[:strings.LastIndex(path, "/")]
cmd := exec.Command("sudo", "chmod", "-R", "777", basePath)

Check failure

Code scanning / CodeQL

Command built from user-controlled sources Critical

This command depends on a
user-provided value
.
This command depends on a
user-provided value
.
@EraKin575
Copy link
Contributor

@AhmedLotfy02 the CI is failing. please check

Signed-off-by: AhmedLotfy02 <ahmadlotfygamersfield@gmail.com>
Signed-off-by: AhmedLotfy02 <ahmadlotfygamersfield@gmail.com>
Copy link
Contributor Author

@AhmedLotfy02 AhmedLotfy02 left a comment

Choose a reason for hiding this comment

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

@EraKin575 I added path validation and sanitization but still the same.

@AhmedLotfy02
Copy link
Contributor Author

AhmedLotfy02 commented Mar 16, 2024

I checked os.Chmod instead of exec.Command but it gives permissions to the directory but not for the inside folders
image

gouravkrosx and others added 15 commits March 18, 2024 18:44
* chore: refactored code for unit test integrations

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

* chore: rename serve file

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

* chore: uncomment setupCA function

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

* fix: waiting for hooks cancel

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

* fix: capture variable

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

---------

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
* fix: color schema and update cmd

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: color schema and update cmd

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: remove debug log

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: go mod tidy

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
…guide (keploy#1714)

Signed-off-by: Neha Gupta <gneha21@yahoo.in>
…a test-set (keploy#1713)

* feat(test): adds clearUnusedMocks flag to remove the unused mocks of test-set

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

---------

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
…er (keploy#1718)

* fix(cli): adds config as a field in cmdConfigurator and serviceProvider

the config is present in the function signature due to which different implementations of the
interface is restricted to use the oss config type. This makes a challenge in the enterprise to add
its own config type for enterprise flags. Thats why the config is now a member field of the struct
that implements cmdConfigurator and serviceProvider interfaces.

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

* style: removes linting errors

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

---------

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
* refactor: sync parsers acc to latest refactor changes

Signed-off-by: Sarthak160 <rocksarthak45@gmail.com>

* chore: remove comments

Signed-off-by: Sarthak160 <rocksarthak45@gmail.com>

* chore: remove linter errors

Signed-off-by: Sarthak160 <rocksarthak45@gmail.com>

* chore: fix linters

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* chore: fix linters

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* chore: fix linters

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: channel and conn closing

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* chore: fix linters

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: Sarthak160 <rocksarthak45@gmail.com>
Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
Co-authored-by: charankamarapu <kamarapucharan@gmail.com>
* fix: removeUnusedMocks

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: removeUnusedMocks

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: removeUnused Mocks

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* chore: fix EOF

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* chore: fix EOF

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* Revert "chore: fix EOF"

This reverts commit f9bc0f7.

* Revert "chore: fix EOF"

This reverts commit e457191.

* fix: removeUnusedMocks

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
* fix(cli): adds config as a field in cmdConfigurator and serviceProvider

the config is present in the function signature due to which different implementations of the
interface is restricted to use the oss config type. This makes a challenge in the enterprise to add
its own config type for enterprise flags. Thats why the config is now a member field of the struct
that implements cmdConfigurator and serviceProvider interfaces.

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

* fix(mongo): passes the password in arguments instead of global variable

the password global variable in the integrations/mongo results in race conditions. To fix this now,
the password is passed in the function arguments

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

* style: removes commented code from mongo parser

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

* fix(mongo): uses sync map for authMessage global variable to prevent race conditions

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

* style(mongo): removes commented code

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

* style: fixes linting issues

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

---------

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
* fix: enable auto env config using viper

Signed-off-by: Shubham Jain <shubhamkjain@outlook.com>

* refactor:dokcer command of record and test

* refactor:changing events of docker

* refactor:channels  for record and test

* fix:alias

* refactor:increse delay

* chore: fix lint

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

* chore: remove todo

Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>

* refactor:kill unique processes

* refactror:error check for unique proces

* refactor:inode found condition for test

* refactor:check for ip address

* refactor:eventCaptured

* refactor:kill process groups

* refactor:docker image build

* refactor:pgid func

* refactor:pipeline docker and path

* replace:binary path

* refactor:go path for keploy go binary

* fix:binary path

* refactor:tty check

* refactor:remove repeating viper

* refactor:space in var

* refactor: adding unique names

* remove:gin app

* refactor:name  for ginapp

* refactor:name to test

* increase time out

* adding logs

* refactor:killing pid of docker containers

* refactor:remove unused functions

* refactor:remove mandatoru name check

* refactor: return error incase of network not found

---------

Signed-off-by: Shubham Jain <shubhamkjain@outlook.com>
Signed-off-by: gouravkrosx <gouravgreatkr@gmail.com>
Co-authored-by: Shubham Jain <shubhamkjain@outlook.com>
Co-authored-by: gouravkrosx <gouravgreatkr@gmail.com>
* fix: generic matching

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

* fix: generic matching

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>

---------

Signed-off-by: charankamarapu <kamarapucharan@gmail.com>
* fix: fixes the race condition in the mongo parser and cmd run

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>

---------

Signed-off-by: re-Tick <jain.ritik.1001@gmail.com>
@shivamsouravjha
Copy link
Contributor

tried this locally, doesn't work, not only does the Keploy folder isn't deleted, even normal keploy doesn't work
image

@shivamsouravjha
Copy link
Contributor

image solve this as well

@shivamsouravjha
Copy link
Contributor

@AhmedLotfy02 please update the PR as pipeline is failing, also fix the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: unable to delete keploy generated folder due to permission