generated from aboutcode-org/skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add docs for how to run the app #38
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| .. _run-application: | ||
|
|
||
| How to Run the Application | ||
| =========================== | ||
|
|
||
| This section provides an example of how to run the Federated Code application. | ||
|
|
||
|
|
||
| Step 1: Create a Superuser | ||
| --------------------------- | ||
| Run the following command to create a superuser: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| python manage.py createsuperuser | ||
|
|
||
|
|
||
| Step 2: Create a Service Account | ||
| --------------------------------- | ||
| Only superusers can create a Service account (e.g., VCIO or SCIO). | ||
|
|
||
| 1. Access the Django admin panel. | ||
| http://127.0.0.1:8000/admin/ | ||
|
|
||
| 2. Create a new user through the admin interface. | ||
| http://127.0.0.1:8000/admin/auth/user/add/ | ||
|
|
||
| 3. Assign the newly created user as a Service account. | ||
| http://127.0.0.1:8000/admin/fedcode/service/ | ||
|
|
||
|
|
||
| Step 3: Service Login and Git Repository Creation | ||
| -------------------------------------------------- | ||
| Now you have a Service login ex `VCIO` use this credential to create a Git Repository | ||
| https://github.com/aboutcode-org/vulnerablecode-data | ||
|
|
||
| Visit http://127.0.0.1:8000/create-repo | ||
|
|
||
| Step 4: | ||
| -------- | ||
| To initiate a sync of the master branch, you can either click on the sync request | ||
| button in the app or send an HTTP request directly to the endpoint using the auth service. | ||
| The endpoint is: `repository/<uuid:repository_id>/sync-repo/` | ||
|
|
||
| Visit http://127.0.0.1:8000/repo-list. | ||
|
|
||
|
|
||
| Alternatively, you can integrate this action with GitHub Actions or any other | ||
| CI tool to trigger the sync automatically whenever new data is pushed to the | ||
| master branch. | ||
|
|
||
| Here’s an example of how to send the request manually using curl: | ||
| ex: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| curl -v -X POST \ | ||
| -H "Authorization: Token your-auth-token" \ | ||
| http://127.0.0.1:8000/repository/<uuid:repository_id>/sync-repo/ | ||
|
|
||
|
|
||
| **Note:** You can retrieve the service token after authenticating via the endpoint | ||
| `api/v0/users/@<str:username>`. | ||
|
|
||
| Step 5: | ||
| -------- | ||
| The admin should regularly run the following commands, either manually or in a loop: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| python manage.py sync && python manage.py federate | ||
|
|
||
| Users can now log in or sign up, create and review metadata, and vote for packages. | ||
|
|
||
| Happy Federation, everyone! | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keshav-space This is a typo. It should be corrected to
api/v0/users/@<str:username>/outboxand the body should be the SyncActivity body