mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 00:24:40 +01:00
makefile:
rename, remove unused targets trigger targets only when relevant files actually are changed git: do not track files which are generated during make github actions fix to not rely on a pre-built ui.pb.go
This commit is contained in:
parent
5e1a398bc6
commit
be0c051205
9 changed files with 48 additions and 3792 deletions
7
.github/workflows/go.yml
vendored
7
.github/workflows/go.yml
vendored
|
@ -27,5 +27,10 @@ jobs:
|
|||
|
||||
- name: Build
|
||||
run: |
|
||||
cd daemon
|
||||
export GOPATH=~/go
|
||||
export PATH=$PATH:$GOPATH/bin
|
||||
go get github.com/golang/protobuf/protoc-gen-go
|
||||
cd proto
|
||||
make ../daemon/ui/protocol/ui.pb.go
|
||||
cd ../daemon
|
||||
go build -v .
|
||||
|
|
11
Makefile
11
Makefile
|
@ -1,4 +1,4 @@
|
|||
all: protocol daemon/opensnitchd ui/resources_rc.py
|
||||
all: protocol opensnitch_daemon gui
|
||||
|
||||
install:
|
||||
@cd daemon && make install
|
||||
|
@ -7,19 +7,16 @@ install:
|
|||
protocol:
|
||||
@cd proto && make
|
||||
|
||||
daemon/opensnitchd:
|
||||
opensnitch_daemon:
|
||||
@cd daemon && make
|
||||
|
||||
ui/resources_rc.py:
|
||||
gui:
|
||||
@cd ui && make
|
||||
|
||||
deps:
|
||||
@cd daemon && make deps
|
||||
@cd ui && make deps
|
||||
|
||||
clean:
|
||||
@cd daemon && make clean
|
||||
@cd proto && make clean
|
||||
@cd ui && make clean
|
||||
|
||||
run:
|
||||
cd ui && pip3 install --upgrade . && cd ..
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#SRC contains all *.go *.c *.h files in daemon/ and its subfolders
|
||||
SRC := $(shell find . -type f -name '*.go' -o -name '*.h' -o -name '*.c')
|
||||
|
||||
all: opensnitchd
|
||||
|
||||
install:
|
||||
|
@ -8,7 +11,7 @@ install:
|
|||
@cp system-fw.json /etc/opensnitchd/
|
||||
@systemctl daemon-reload
|
||||
|
||||
opensnitchd:
|
||||
opensnitchd: $(SRC)
|
||||
@go build -o opensnitchd .
|
||||
|
||||
clean:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -8,10 +8,6 @@ opensnitch/resources_rc.py: translations deps
|
|||
|
||||
translations:
|
||||
@cd i18n ; make
|
||||
for lang in $$(ls i18n/locales/); do \
|
||||
if [ ! -d opensnitch/i18n/$$lang ]; then mkdir -p opensnitch/i18n/$$lang ; fi ; \
|
||||
cp i18n/locales/$$lang/opensnitch-$$lang.qm opensnitch/i18n/$$lang/ ; \
|
||||
done
|
||||
|
||||
deps:
|
||||
@pip3 install -r requirements.txt
|
||||
|
|
|
@ -1,7 +1,37 @@
|
|||
all: update_langs gen_qm
|
||||
SOURCES += ../opensnitch/service.py \
|
||||
../opensnitch/dialogs/prompt.py \
|
||||
../opensnitch/dialogs/preferences.py \
|
||||
../opensnitch/dialogs/ruleseditor.py \
|
||||
../opensnitch/dialogs/processdetails.py \
|
||||
../opensnitch/dialogs/stats.py
|
||||
|
||||
update_langs:
|
||||
FORMS += ../opensnitch/res/prompt.ui \
|
||||
../opensnitch/res/ruleseditor.ui \
|
||||
../opensnitch/res/preferences.ui \
|
||||
../opensnitch/res/process_details.ui \
|
||||
../opensnitch/res/stats.ui
|
||||
|
||||
#TSFILES contains all *.ts files in locales/ and its subfolders
|
||||
TSFILES := $(shell find locales/ -type f -name '*.ts')
|
||||
#QMFILES contains all *.qm files in locales/ and its subfolders
|
||||
QMFILES := $(shell find locales/ -type f -name '*.qm')
|
||||
#if QMFILES is empty, we set it to phony target to run unconditionally
|
||||
ifeq ($(QMFILES),)
|
||||
QMFILES := "qmfiles"
|
||||
endif
|
||||
|
||||
all: $(TSFILES) $(QMFILES)
|
||||
|
||||
#if any file from SOURCES or FORMS is older than any file from $(TSFILES)
|
||||
#or if opensnitch_i18n.pro was manually modified
|
||||
$(TSFILES): $(SOURCES) $(FORMS) opensnitch_i18n.pro
|
||||
@pylupdate5 opensnitch_i18n.pro
|
||||
|
||||
gen_qm:
|
||||
#if any of the *.ts files are older that any of the *.qm files
|
||||
#QMFILES may also be a phony target (when no *.qm exist yet) which will always run
|
||||
$(QMFILES):$(TSFILES)
|
||||
@./generate_i18n.sh
|
||||
for lang in $$(ls locales/); do \
|
||||
if [ ! -d ../opensnitch/i18n/$$lang ]; then mkdir -p ../opensnitch/i18n/$$lang ; fi ; \
|
||||
cp locales/$$lang/opensnitch-$$lang.qm ../opensnitch/i18n/$$lang/ ; \
|
||||
done
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,97 +0,0 @@
|
|||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
||||
import grpc
|
||||
|
||||
import ui_pb2 as ui__pb2
|
||||
|
||||
|
||||
class UIStub(object):
|
||||
# missing associated documentation comment in .proto file
|
||||
pass
|
||||
|
||||
def __init__(self, channel):
|
||||
"""Constructor.
|
||||
|
||||
Args:
|
||||
channel: A grpc.Channel.
|
||||
"""
|
||||
self.Ping = channel.unary_unary(
|
||||
'/protocol.UI/Ping',
|
||||
request_serializer=ui__pb2.PingRequest.SerializeToString,
|
||||
response_deserializer=ui__pb2.PingReply.FromString,
|
||||
)
|
||||
self.AskRule = channel.unary_unary(
|
||||
'/protocol.UI/AskRule',
|
||||
request_serializer=ui__pb2.Connection.SerializeToString,
|
||||
response_deserializer=ui__pb2.Rule.FromString,
|
||||
)
|
||||
self.Subscribe = channel.unary_unary(
|
||||
'/protocol.UI/Subscribe',
|
||||
request_serializer=ui__pb2.ClientConfig.SerializeToString,
|
||||
response_deserializer=ui__pb2.ClientConfig.FromString,
|
||||
)
|
||||
self.Notifications = channel.stream_stream(
|
||||
'/protocol.UI/Notifications',
|
||||
request_serializer=ui__pb2.NotificationReply.SerializeToString,
|
||||
response_deserializer=ui__pb2.Notification.FromString,
|
||||
)
|
||||
|
||||
|
||||
class UIServicer(object):
|
||||
# missing associated documentation comment in .proto file
|
||||
pass
|
||||
|
||||
def Ping(self, request, context):
|
||||
# missing associated documentation comment in .proto file
|
||||
pass
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def AskRule(self, request, context):
|
||||
# missing associated documentation comment in .proto file
|
||||
pass
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def Subscribe(self, request, context):
|
||||
# missing associated documentation comment in .proto file
|
||||
pass
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
def Notifications(self, request_iterator, context):
|
||||
# missing associated documentation comment in .proto file
|
||||
pass
|
||||
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
||||
context.set_details('Method not implemented!')
|
||||
raise NotImplementedError('Method not implemented!')
|
||||
|
||||
|
||||
def add_UIServicer_to_server(servicer, server):
|
||||
rpc_method_handlers = {
|
||||
'Ping': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.Ping,
|
||||
request_deserializer=ui__pb2.PingRequest.FromString,
|
||||
response_serializer=ui__pb2.PingReply.SerializeToString,
|
||||
),
|
||||
'AskRule': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.AskRule,
|
||||
request_deserializer=ui__pb2.Connection.FromString,
|
||||
response_serializer=ui__pb2.Rule.SerializeToString,
|
||||
),
|
||||
'Subscribe': grpc.unary_unary_rpc_method_handler(
|
||||
servicer.Subscribe,
|
||||
request_deserializer=ui__pb2.ClientConfig.FromString,
|
||||
response_serializer=ui__pb2.ClientConfig.SerializeToString,
|
||||
),
|
||||
'Notifications': grpc.stream_stream_rpc_method_handler(
|
||||
servicer.Notifications,
|
||||
request_deserializer=ui__pb2.NotificationReply.FromString,
|
||||
response_serializer=ui__pb2.Notification.SerializeToString,
|
||||
),
|
||||
}
|
||||
generic_handler = grpc.method_handlers_generic_handler(
|
||||
'protocol.UI', rpc_method_handlers)
|
||||
server.add_generic_rpc_handlers((generic_handler,))
|
Loading…
Add table
Reference in a new issue