Skip to content

Commit

Permalink
Fixes splunkbase validation errors and renames flare_splunk_integrati…
Browse files Browse the repository at this point in the history
…on references to flare
  • Loading branch information
markkasaboski authored and Mark Kasaboski committed Oct 28, 2024
1 parent 7d8c9d2 commit c6e25e8
Show file tree
Hide file tree
Showing 30 changed files with 59 additions and 32 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
*.DS_Store
flare_splunk_integration.tar.gz
flare.tar.gz
venv
venv-tools
flare_splunk_integration/local
flare_splunk_integration/metadata/local.meta
flare/local
flare/metadata/local.meta
__pycache__/
.vscode/

flare_splunk_integration/bin/vendor/*
flare/bin/vendor/*
44 changes: 22 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ build:
venv: requirements.txt
python -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install --target flare_splunk_integration/bin/vendor -r requirements.txt
@find flare_splunk_integration/bin/vendor -type d -name "*.dist-info" -exec rm -r {} +
@find flare_splunk_integration/bin/vendor -type d -name "__pycache__" -exec rm -r {} +
@rm -rf flare_splunk_integration/bin/vendor/bin
@rm -rf flare_splunk_integration/bin/vendor/packaging
@rm -rf flare_splunk_integration/bin/vendor/*-stubs
venv/bin/pip install --target flare/bin/vendor -r requirements.txt
@find flare/bin/vendor -type d -name "*.dist-info" -exec rm -r {} +
@find flare/bin/vendor -type d -name "__pycache__" -exec rm -r {} +
@rm -rf flare/bin/vendor/bin
@rm -rf flare/bin/vendor/packaging
@rm -rf flare/bin/vendor/*-stubs

venv-tools: requirements.tools.txt venv
rm -rf venv-tools
Expand All @@ -24,33 +24,33 @@ clean:
@echo "Removing venv and venv-tools."
@rm -rf venv
@rm -rf venv-tools
@rm -rf flare_splunk_integration/bin/vendor
@unlink "/Applications/Splunk/etc/apps/flare_splunk_integration" || true
@rm -rf flare/bin/vendor
@unlink "/Applications/Splunk/etc/apps/flare" || true
@echo "Done."

.PHONY: package
package: flare_splunk_integration/bin/vendor
-@rm flare_splunk_integration.tar.gz
@find flare_splunk_integration/bin -type d -name "__pycache__" -exec rm -r {} +
package: flare/bin/vendor
-@rm flare.tar.gz
@find flare/bin -type d -name "__pycache__" -exec rm -r {} +
COPYFILE_DISABLE=1 tar \
--exclude='flare_splunk_integration/local' \
--exclude='flare_splunk_integration/metadata/local.meta' \
--exclude='flare/local' \
--exclude='flare/metadata/local.meta' \
--format ustar \
-cvzf \
"flare_splunk_integration.tar.gz" \
"flare_splunk_integration"
"flare.tar.gz" \
"flare"

# This will not work until we get an APPID - need to submit in Splunkbase UI first.
.PHONY: publish
publish: flare_splunk_integration.tar.gz
curl -u flaresystems --request POST https://splunkbase.splunk.com/api/v1/app/<APPID>/new_release/ -F "files[]=@./flare_splunk_integration.tar.gz" -F "filename=flare_splunk_integration.tar.gz" -F "cim_versions=4.9,4.7" -F "splunk_versions=9.3" -F "visibility=true"
publish: flare.tar.gz
curl -u flaresystems --request POST https://splunkbase.splunk.com/api/v1/app/<APPID>/new_release/ -F "files[]=@./flare.tar.gz" -F "filename=flare.tar.gz" -F "cim_versions=4.9,4.7" -F "splunk_versions=9.3" -F "visibility=true"

# A manual review from the Splunk team will be required to know if we need to fix any of these tag warnings.
.PHONY: validate
validate: venv-tools
@echo "Running Splunk AppInspect..."
@echo "If you get an error about \"libmagic\", run \"brew install libmagic\""
@venv-tools/bin/splunk-appinspect inspect --ci "flare_splunk_integration" || \
@venv-tools/bin/splunk-appinspect inspect --ci "flare" || \
if test "$$?" -eq "102" || "$$?" -eq "103" ; then \
exit 0 ; \
else \
Expand All @@ -63,7 +63,7 @@ TAGS = advanced_xml alert_actions_conf ast bias cloud csv custom_search_commands
inspect-tags:
@for TAG in $(TAGS); do \
echo "Tag: $$TAG" ; \
venv-tools/bin/splunk-appinspect inspect --ci --included-tags $$TAG "flare_splunk_integration" ; \
venv-tools/bin/splunk-appinspect inspect --ci --included-tags $$TAG "flare" ; \
done

.PHONY: test
Expand All @@ -87,7 +87,7 @@ lint: mypy format-check

.PHONY: mypy
mypy: venv-tools
venv-tools/bin/mypy flare_splunk_integration
venv-tools/bin/mypy flare

.PHONY: splunk-local
splunk-local: venv
Expand All @@ -97,5 +97,5 @@ splunk-local: venv
exit 1; \
fi

@unlink "/Applications/Splunk/etc/apps/flare_splunk_integration" || true
@ln -s "$(CURDIR)/flare_splunk_integration" "/Applications/Splunk/etc/apps/flare_splunk_integration"
@unlink "/Applications/Splunk/etc/apps/flare" || true
@ln -s "$(CURDIR)/flare" "/Applications/Splunk/etc/apps/flare"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

var appName = "flare_splunk_integration";
var appName = "flare";

require.config({
paths: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { promisify } from './util.js'
import * as SplunkHelpers from './configurationFileHelper.js'

const appName = "flare_splunk_integration";
const appName = "flare";
const storageRealm = "flare_integration_realm";
const applicationNameSpace = {
owner: "nobody",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from urllib.error import HTTPError
from vendor.flareio import FlareApiClient

APP_NAME = "flare_splunk_integration"
APP_NAME = "flare"


class FlareAPI(AuthBase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from flare import FlareAPI

APP_NAME = "flare_splunk_integration"
APP_NAME = "flare"
HOST = "localhost"
SPLUNK_PORT = 8089
REALM = APP_NAME + "_realm"
Expand Down
27 changes: 27 additions & 0 deletions flare/default/app.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Splunk app configuration file
#

[author=Flare Systems, Inc.]
email = [email protected]
company = Flare Systems, Inc.

[package]
id = flare

[install]
is_configured = 0

[ui]
is_visible = 1
label = Flare
setup_view = configuration
supported_themes = light, dark

[launcher]
author = Flare Systems
description = The Flare app allows you to integrate your Flare alerts with the Splunk platform.
version = 0.1.0

[triggers]
reload.flare = simple
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[script://$SPLUNK_HOME/etc/apps/flare_splunk_integration/bin/input.py]
[script://$SPLUNK_HOME/etc/apps/flare/bin/input.py]
interval = * * * * *
python.version = python3
source = Flare
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[mypy]
exclude = (vendor*)/$
follow_imports = skip
mypy_path = flare_splunk_integration/bin/vendor
mypy_path = flare/bin/vendor

0 comments on commit c6e25e8

Please sign in to comment.