Skip to content

Commit

Permalink
Update project to follow template
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-rs committed Dec 27, 2024
1 parent bfab861 commit 4b3ed68
Show file tree
Hide file tree
Showing 25 changed files with 601 additions and 157 deletions.
23 changes: 23 additions & 0 deletions .cruft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"template": "https://github.com/CybercentreCanada/assemblyline-service-template.git",
"commit": "6d2fcb683f00eeda843cf2c40981e266679a97dc",
"checkout": null,
"context": {
"cookiecutter": {
"service_name": "swiffer",
"__svc_name": "swiffer",
"__repository": "assemblyline-service-swiffer",
"__pkg_name": "swiffer",
"__class_name": "Swiffer",
"short_description": "This Assemblyline service uses the Python pyswf library to extract metadata and perform anomaly detection on 'audiovisual/flash' files.",
"short_description_fr": "Ce service Assemblyline utilise la bibliothèque Python pyswf pour extraire des métadonnées et détecter des anomalies dans les fichiers 'audiovisuels/flash'.",
"stage": "EXTRACT",
"category": "Static Analysis",
"org_name_full": "CybercentreCanada",
"org_name_short": "cccs",
"license": "mit",
"_template": "https://github.com/CybercentreCanada/assemblyline-service-template.git"
}
},
"directory": null
}
14 changes: 12 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
Dockerfile
.idea
.git
.gitignore
.vscode
.dockerignore

pipelines
venv
.venv
env
.env
test
tests
exemples
examples
docs

build
dist
**/__pycache__
**/*.pyc

pip-log.txt
pip-delete-this-directory.txt
.tox
Expand All @@ -18,5 +28,5 @@ pip-delete-this-directory.txt
.cache
nosetests.xml
coverage.xml
*,cover
*.cover
*.log
144 changes: 138 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Created by https://www.toptal.com/developers/gitignore/api/python,vim,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=python,vim,visualstudiocode

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -6,11 +10,6 @@ __pycache__/
# C extensions
*.so

# IDE files
.pydevproject
.python-version
.idea

# Distribution / packaging
.Python
build/
Expand Down Expand Up @@ -60,6 +59,22 @@ cover/
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/
Expand All @@ -71,6 +86,43 @@ target/
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
Expand All @@ -80,5 +132,85 @@ ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json

### Vim ###
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# End of https://www.toptal.com/developers/gitignore/api/python,vim,visualstudiocode
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"args": [
"-d",
"swiffer.swiffer.Swiffer",
"{file}"
"${file}"
],
"justMyCode": false,
},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.organizeImports": "explicit"
},
"editor.formatOnSave": true,
"editor.rulers": [
Expand Down
56 changes: 50 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,68 @@

This guide covers the basics of how to contribute to the Assemblyline project.

Python code should follow the PEP8 guidelines defined here: [PEP8 Guidelines](https://www.python.org/dev/peps/pep-0008/).
Python code should follow the PEP8 guidelines defined here:
[PEP8 Guidelines](https://www.python.org/dev/peps/pep-0008/).

## Tell us want you want to build/fix
Before you start coding anything you should connect with the Assemblyline community via the [Assemblyline Discord server](https://discord.gg/GUAy9wErNu) and/or the [central Assemblyline GitHub project](https://github.com/CybercentreCanada/assemblyline/issues) to make sure no one else is working on the same thing and that whatever you are going to build still fits with the vision of the system.

Before you start coding anything you should connect with the Assemblyline community via the
[Assemblyline Discord server](https://discord.gg/GUAy9wErNu) and/or the
[central Assemblyline GitHub project](https://github.com/CybercentreCanada/assemblyline/issues) to make sure no one
else is working on the same thing and that whatever you are going to build still fits with the vision of the system.

## Git workflow

- Clone the repo to your own account
- Checkout and pull the latest commits from the master branch
- Make a branch
- Work in any way you like and make sure your changes actually work
- When you're satisfied with your changes, create a pull requests to the main assemblyline repo
- Work on your modifications and make sure your changes work as expected
- When you're satisfied with your changes, create a pull requests to the Assemblyline repo

#### Transfer your service repo
If you've worked on a new service that you want to be included in the default service selection you'll have to transfer the repo into our control.

If you've worked on a new service that you want to be included in the default service selection you'll have to transfer
the associated repo into our control.

#### You are not allow to merge:

Even if you try to merge in your pull request, you will be denied. Only a few people in our team are allowed to merge code into our repositories.
Even if you try to merge in your pull request, you will be denied. Only a few people in our team are allowed to merge
code into our repositories.

We check for new pull requests every day and will merge them in once they have been approved by someone in our team.

# Guide de contribution d'Assemblyline

Ce guide couvre les bases de la façon de contribuer au projet Assemblyline.

Le code Python doit suivre les directives PEP8 définies ici:
[Directives PEP8](https://www.python.org/dev/peps/pep-0008/).

## Dites-nous que vous voulez construire / réparer

Avant de commencer à coder quoi que ce soit, vous devriez vous connecter à la communauté Assemblyline via le
[Serveur Discord Assemblyline](https://discord.gg/GUAy9wErNu) et/ou le
[projet GitHub central Assemblyline](https://github.com/CybercentreCanada/assemblyline/issues) pour vous assurer que
personne d'autre ne travaille sur la même chose et que tout ce que vous allez construire correspond toujours à la vision
du système.

## Flux de travail avec Git

- Clonez le référentiel sur votre propre compte
- Changez de branche pour la branche principale et la synchroniser avec le serveur de référence
- Faire une nouvelle branche
- Travaillez sur ce que vous souhaitez et assurez-vous que vos modifications fonctionnent comme prévu
- Lorsque vous êtes satisfait de vos modifications, créez une demande de fusion sur le référentiel d'Assemblyline

#### Transférer votre référentiel de service

Si vous avez travaillé sur un nouveau service que vous souhaitez inclure dans la sélection de service par défaut, vous
devrez transférer le référentiel associé sous notre contrôle.

#### Vous n'êtes pas autorisé à compléter une fusion:

Même si vous tentez de compléter une demande de fusion, vous serez refusé. Seules quelques personnes de notre équipe
sont autorisées à fusionner dans nos référentiels.

Nous vérifions les nouvelles demande de fusion tous les jours et les fusionnerons une fois qu'elles auront été approuvées
par quelqu'un de notre équipe.
Loading

0 comments on commit 4b3ed68

Please sign in to comment.