Skip to content

Commit

Permalink
add dependabot.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
qy-zh authored and qy-zh committed Sep 11, 2023
1 parent ab62161 commit 0b37908
Show file tree
Hide file tree
Showing 232 changed files with 10,843 additions and 12,904 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ updates:
schedule:
interval: "daily" # Check for updates once a day



10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
goVer: [1.20]
goVer: [1.16, 1.17, 1.18]

steps:
- name: Set up Go ${{ matrix.goVer }}
Expand All @@ -17,18 +17,18 @@ jobs:
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
go get gopkg.in/check.v1
- name: Build
run: go build -v .

- name: Format
run: diff -u <(echo -n) <(gofmt -d .)

- name: Test
run: go test -v ./...
run: go test -v ./...
76 changes: 0 additions & 76 deletions .github/workflows/codeql.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN gulp


# Build Golang binary
FROM golang:1.21.1 AS build-golang
FROM golang:1.15.2 AS build-golang

WORKDIR /go/src/github.com/gophish/gophish
COPY . .
Expand All @@ -23,7 +23,7 @@ FROM debian:stable-slim
RUN useradd -m -d /opt/gophish -s /bin/bash app

RUN apt-get update && \
apt-get install --no-install-recommends -y jq libcap2-bin && \
apt-get install --no-install-recommends -y jq libcap2-bin ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Expand Down
27 changes: 27 additions & 0 deletions context/context-legacy.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//go:build !go1.7
// +build !go1.7

package context

import (
"net/http"

"github.com/gorilla/context"
)

func Get(r *http.Request, key interface{}) interface{} {
return context.Get(r, key)
}

func Set(r *http.Request, key, val interface{}) *http.Request {
if val == nil {
return r
}

context.Set(r, key, val)
return r
}

func Clear(r *http.Request) {
context.Clear(r)
}
27 changes: 27 additions & 0 deletions context/context.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//go:build go1.7
// +build go1.7

package context

import (
"net/http"

"context"
)

// Get retrieves a value from the request context
func Get(r *http.Request, key interface{}) interface{} {
return r.Context().Value(key)
}

// Set stores a value on the request context
func Set(r *http.Request, key, val interface{}) *http.Request {
if val == nil {
return r
}

return r.WithContext(context.WithValue(r.Context(), key, val))
}

// Clear is a null operation, since this is handled automatically in Go > 1.7
func Clear(r *http.Request) {}
29 changes: 29 additions & 0 deletions context/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
gophish - Open-Source Phishing Framework
The MIT License (MIT)
Copyright (c) 2013 Jordan Wright
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

// Package context provides the ability to store request-scoped values on an http.Request instance. These values are cleared after every request.
// This package was created due to Go v1.7 moving the context package into the stdlib, which had a net effect of breaking some functionality from the existing gorilla/context.
package context
48 changes: 0 additions & 48 deletions dev.Dockerfile

This file was deleted.

80 changes: 0 additions & 80 deletions docker/run-dev.sh

This file was deleted.

8 changes: 8 additions & 0 deletions docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ if [ -n "${CONTACT_ADDRESS+set}" ] ; then
cat config.json.tmp > config.json
fi

# db_name has to be changed to mysql for mysql connection to work
if [ -n "${DB_NAME+set}" ] ; then
jq -r \
--arg DB_NAME "${DB_NAME}" \
'.db_name = $DB_NAME' config.json > config.json.tmp && \
cat config.json.tmp > config.json
fi

if [ -n "${DB_FILE_PATH+set}" ] ; then
jq -r \
--arg DB_FILE_PATH "${DB_FILE_PATH}" \
Expand Down
Loading

0 comments on commit 0b37908

Please sign in to comment.