Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Annoraaq committed Jan 10, 2025
2 parents 1c4dc59 + 8e4df47 commit beac3d8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion api_client/python/timesketch_api_client/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def from_graph(self, graph_obj):
self._updated_at = time

def from_manual(
self, data, **kwargs
self, data=None, **kwargs
): # pylint: disable=arguments-differ; pytype: disable=signature-mismatch
"""Generate a new graph using a dictionary.
Expand Down
1 change: 1 addition & 0 deletions docker/dev/build/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if [ "$1" = 'timesketch' ]; then
ln -s /usr/local/src/timesketch/data/dfiq /etc/timesketch/
ln -s /usr/local/src/timesketch/data/context_links.yaml /etc/timesketch/context_links.yaml
ln -s /usr/local/src/timesketch/data/plaso_formatters.yaml /etc/timesketch/plaso_formatters.yaml
ln -s /usr/local/src/timesketch/data/nl2q /etc/timesketch/

# Set SECRET_KEY in /etc/timesketch/timesketch.conf if it isn't already set
if grep -q "SECRET_KEY = '<KEY_GOES_HERE>'" /etc/timesketch/timesketch.conf; then
Expand Down
33 changes: 21 additions & 12 deletions utils/tsdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Display a help message and exit
help(){
echo
echo "Usage: tsdev.sh [OPTIONS] COMMAND"
echo "Usage: tsdev.sh [OPTIONS] COMMAND [FRONTEND]"
echo
echo "Run commands to manage resources on your Timesketch development docker container"
echo
Expand All @@ -16,13 +16,20 @@ help(){
echo " logs Follow docker container logs "
echo " shell Open a shell in the docker container"
echo " test Execute run_tests.py --coverage"
echo " vue-build Build the vue frontend"
echo " vue-dev Serve the vue frontend"
echo " vue-install-deps Install vue frontend dependencies"
echo " vue-test Test the vue frontend"
echo " vue-build Build the vue frontend. Default: 'frontend-ng'"
echo " vue-dev Serve the vue frontend on port 5001. Default: 'frontend-ng'"
echo " vue-install-deps Install vue frontend dependencies. Default: 'frontend-ng'"
echo " vue-test Test the vue frontend. Default: 'frontend-ng'"
echo " web Start the web frontend bound to port 5000"
echo " postgres Connect to the Timesketch postgres database."
echo
echo "Frontend:"
echo " frontend The old v1 frontend (deprecated)."
echo " frontend-ng The current v2 frontend (vue2)."
echo " frontend-v3 The future v3 frontend (vue3)."
echo
echo "Examples:"
echo " tsdev.sh vue-dev frontend-v3"
echo " tsdev.sh logs"
echo " tsdev.sh test"
exit 0
Expand All @@ -46,6 +53,11 @@ fi
CONTAINER_ID="$($s docker container list --filter name='timesketch-dev' --quiet)"
frontend="frontend-ng"

# Check if a second frontend argument is provided
if [ $# -eq 2 ]; then
frontend="$2"
fi

# Run the provided command
case "$1" in
build-api-cli)
Expand All @@ -72,22 +84,19 @@ case "$1" in
$s docker exec --interactive --tty $CONTAINER_ID yarn run --cwd=/usr/local/src/timesketch/timesketch/$frontend build
;;
vue-dev)
$s docker exec --interactive --tty $CONTAINER_ID yarn run --cwd=/usr/local/src/timesketch/timesketch/$frontend serve
$s docker exec --interactive --tty $CONTAINER_ID yarn run --cwd=/usr/local/src/timesketch/timesketch/$frontend $(if [ "$frontend" == "frontend-v3" ]; then echo "dev"; else echo "serve"; fi)
;;
vue-install-deps)
$s docker exec --interactive --tty $CONTAINER_ID yarn install --cwd=/usr/local/src/timesketch/timesketch/$frontend
;;
vue-test)
$s docker exec --interactive --tty $CONTAINER_ID yarn run --cwd=/usr/local/src/timesketch/timesketch/frontend-ng test
$s docker exec --interactive --tty $CONTAINER_ID yarn run --cwd=/usr/local/src/timesketch/timesketch/$frontend test
;;
web)
$s docker exec --interactive --tty $CONTAINER_ID gunicorn --reload --bind 0.0.0.0:5000 --log-level debug --capture-output --timeout 600 timesketch.wsgi:application
;;
v3-dev)
$s docker exec --interactive --tty $CONTAINER_ID yarn run --cwd=/usr/local/src/timesketch/timesketch/frontend-v3 dev
;;
v3-install-deps)
$s docker exec --interactive --tty $CONTAINER_ID yarn install --cwd=/usr/local/src/timesketch/timesketch/frontend-v3
postgres)
$s docker exec --interactive --tty postgres bash -c "psql -U timesketch -d timesketch"
;;
*)
echo \""$1"\" is not a valid command.; help
Expand Down

0 comments on commit beac3d8

Please sign in to comment.