Skip to content

Commit

Permalink
Merge pull request #201 from activecm/dev
Browse files Browse the repository at this point in the history
Update RITA Official Version to v1.0.0
  • Loading branch information
ethack authored Apr 17, 2018
2 parents 7944e4e + 70becf0 commit 7df8a29
Show file tree
Hide file tree
Showing 91 changed files with 4,860 additions and 2,180 deletions.
22 changes: 14 additions & 8 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ there.

Just be sure to do the following:
* Check if the bug is already accounted for on the
[Github issue tracker](https://github.com/ocmdev/rita/issues)
[Github issue tracker](https://github.com/activecm/rita/issues)
* If an issue already exists, add the following info in a comment
* If not, create an issue, and include the following info
* Give very specific descriptions of how to reproduce the bug
Expand All @@ -34,23 +34,29 @@ There are several ways to contribute code to the RITA project.
* All too often code is developed to meet milestones which only undergoes
empirical, human testing
* We would love to see unit tests throughout RITA
* Currently we only have unit tests for Beacon check under analysis/beacon to
see how tests can be written neatly and easily
* Also when writing tests it is advisable to work backwards, start with what
result you want to get and then work backwards through the code
* When you're ready to test code run `go test ./...` from the root directory
of the project
* Feel free to refactor code to increase our ability to test it
* Join our [IRC](https://github.com/ocmdev/rita/wiki/RITA-Gittiquette) to
* Join our [IRC](https://github.com/activecm/rita/wiki/RITA-Gittiquette) to
learn more
* Add new features:
* If you would like to become involved in the development effort, please hop
on our [OFTC channel at #ocmdev](https://webchat.oftc.net/?channels=ocmdev)
on our [OFTC channel at #activecm](https://webchat.oftc.net/?channels=activecm)
and chat about what is currently being worked on.

All of these tasks ultimately culminate in a pull request being issued,
reviewed, and merged. When interacting with RITA through Git please check out
the
[RITA Gittiquette page](https://github.com/ocmdev/rita/wiki/RITA-Gittiquette).
[RITA Gittiquette page](https://github.com/activecm/rita/wiki/RITA-Gittiquette).
Go limits the ways you may use Git with an open source project such as RITA, so
it is important that you understand the procedures laid out here.

### Gittiquette Summary
* We currently have a dev and master branch on OCMDev
* We currently have a dev and master branch on activecm
* Master is our tagged release branch
* Dev is our development and staging branch
* As more users come to rely on RITA, we will introduce a release-testing branch
Expand All @@ -66,9 +72,9 @@ your feature branch off of it
* Submit a pull request on Github

### Switching to the `dev` Branch
* Install RITA using either the [installer](https://raw.githubusercontent.com/ocmdev/rita/master/install.sh) or
[manually](https://github.com/ocmdev/rita/wiki/Installation)
* `cd $GOPATH/src/github.com/ocmdev/rita`
* Install RITA using either the [installer](https://raw.githubusercontent.com/activecm/rita/master/install.sh) or
[manually](https://github.com/activecm/rita/wiki/Installation)
* `cd $GOPATH/src/github.com/activecm/rita`
* `git checkout dev`
* `make install`
* Configure a config file for the dev branch
Expand Down
43 changes: 23 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
#RITA runs in Docker!
#However, it needs a little help.
#In order to run rita in Docker, two volume mounts are needed.
#One for logs, and another for the config file.
#Alternatively you may extend this dockerfile and add in these files.
#Make sure your Dockerized RITA config file points to the correct bro log location.
#Additionally, make sure that RITA has access to a MongoDB server.

#Ex: docker run -it --rm -v /path/to/bro/logs:/logs/:ro -v /path/to/rita/config.yaml:/root/.rita/config.yaml:ro rita import
#RITA works best with docker-compose. Docker-compose lets you set these mounts
#and additionally connect it to MongoDB with ease.
FROM golang:1.8-alpine as rita-builder
RUN apk update && apk upgrade && apk add --no-cache git make ca-certificates wget
FROM golang:1.10-alpine as rita-builder
RUN apk add --no-cache git make ca-certificates wget build-base
RUN wget -q -O /go/bin/dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 && chmod +x /go/bin/dep
WORKDIR /go/src/github.com/ocmdev/rita
WORKDIR /go/src/github.com/activecm/rita
COPY . .
RUN make

FROM alpine:latest
# Change ARGs with --build-arg to target other architectures
# Produce a self-contained statically linked binary
ARG CGO_ENABLED=0
# Set the build target architecture and OS
ARG GOARCH=amd64
ARG GOOS=linux
# Passing arguments in to make result in them being set as
# environment variables for the call to go build
RUN make CGO_ENABLED=$CGO_ENABLED GOARCH=$GOARCH GOOS=$GOOS

FROM scratch

# Use WORKDIR to create /var/lib/rita since "mkdir" doesn't exist in scratch
# /var/lib/rita is required for the safebrowsing cache in the default config
WORKDIR /var/lib/rita

WORKDIR /
COPY --from=rita-builder /go/src/github.com/activecm/rita/etc/rita.yaml /etc/rita/config.yaml
COPY --from=rita-builder /go/src/github.com/activecm/rita/rita /rita

WORKDIR /root
RUN mkdir .rita
COPY --from=rita-builder /go/src/github.com/ocmdev/rita/rita .
ENTRYPOINT ["./rita"]
ENTRYPOINT ["/rita"]
69 changes: 37 additions & 32 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,16 @@


[[constraint]]
branch = "master"
name = "github.com/Zalgo2462/mgorus"
name = "github.com/activecm/mgorus"
version = "0.1.0"

[[constraint]]
branch = "master"
name = "github.com/alecthomas/template"

[[constraint]]
branch = "master"
name = "github.com/google/safebrowsing"
name = "github.com/activecm/mgosec"
version = "0.1.0"

[[constraint]]
branch = "master"
name = "github.com/ocmdev/rita-blacklist"
name = "github.com/activecm/rita-bl"

[[constraint]]
branch = "master"
Expand Down
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
VERSION := $(shell git describe --always --long --dirty --tags)
VERSION := $(shell git describe --abbrev=0 --tags)
EXACT_VERSION := $(shell git describe --always --long --dirty --tags)
GOPATH := $(GOPATH)
BINARY := rita

LDFLAGS=-ldflags="-X github.com/ocmdev/rita/config.VERSION=${VERSION}"
LDFLAGS=-ldflags="-X github.com/activecm/rita/config.Version=${VERSION} -X github.com/activecm/rita/config.ExactVersion=${EXACT_VERSION}"


default:
dep ensure
go build ${LDFLAGS}

# Having issues with 'go install' + LDFLAGS using sudo and the
# install script. This is a workaround.
install:
dep ensure
go build ${LDFLAGS} -o ${GOPATH}/bin/${BINARY}

Loading

0 comments on commit 7df8a29

Please sign in to comment.