formatting
This commit is contained in:
		
							parent
							
								
									34ac340cad
								
							
						
					
					
						commit
						4082be54e2
					
				
					 9 changed files with 53 additions and 46 deletions
				
			
		| 
						 | 
					@ -3,4 +3,13 @@ services:
 | 
				
			||||||
    build: ./server/Dockerfile
 | 
					    build: ./server/Dockerfile
 | 
				
			||||||
    ports:
 | 
					    ports:
 | 
				
			||||||
      - "8080:8080"
 | 
					      - "8080:8080"
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - "./storage/files:/mnt/storage/files"
 | 
				
			||||||
 | 
					  ole:
 | 
				
			||||||
 | 
					    build: ./scanners/ole/Dockerfile
 | 
				
			||||||
 | 
					    ports:
 | 
				
			||||||
 | 
					      - "5000:5000"
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - "./storage/files:/mnt/storage/files"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
FROM python:3-alpine
 | 
					FROM python:3-alpine
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Set environment variables (these can be overridden in `docker-compose.yml` or `docker run`)
 | 
					# Set environment variables (these can be overridden in `docker-compose.yml` or `docker run`)
 | 
				
			||||||
ENV UPLOAD_FOLDER="/tmp/uploads"
 | 
					ENV FILE_DIRECTORY="/mnt/storage/files/"
 | 
				
			||||||
ENV HOST="127.0.0.1"
 | 
					ENV HOST="127.0.0.1"
 | 
				
			||||||
ENV PORT="5000"
 | 
					ENV PORT="5000"
 | 
				
			||||||
ENV DEBUG="True"
 | 
					ENV DEBUG="True"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -30,4 +30,3 @@ func Logging(next http.Handler) http.Handler {
 | 
				
			||||||
		slog.Info("webserver", "status", wrapped.statusCode, "method", r.Method, "path", r.URL.Path, "duration", time.Since(start))
 | 
							slog.Info("webserver", "status", wrapped.statusCode, "method", r.Method, "path", r.URL.Path, "duration", time.Since(start))
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,8 +1,8 @@
 | 
				
			||||||
package server
 | 
					package server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"net/http"
 | 
					 | 
				
			||||||
	"git.jmbit.de/jmb/scanfile/server/web"
 | 
						"git.jmbit.de/jmb/scanfile/server/web"
 | 
				
			||||||
 | 
						"net/http"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func RegisterRoutes() *http.ServeMux {
 | 
					func RegisterRoutes() *http.ServeMux {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,9 +2,9 @@ package server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
						"log/slog"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
  "log/slog"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"git.jmbit.de/jmb/scanfile/server/internal/middlewares"
 | 
						"git.jmbit.de/jmb/scanfile/server/internal/middlewares"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2,11 +2,11 @@ package session
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"encoding/json"
 | 
						"encoding/json"
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
	"log/slog"
 | 
						"log/slog"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"path"
 | 
						"path"
 | 
				
			||||||
  "fmt"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/gorilla/securecookie"
 | 
						"github.com/gorilla/securecookie"
 | 
				
			||||||
	"github.com/gorilla/sessions"
 | 
						"github.com/gorilla/sessions"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,6 @@ import (
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
	log.SetOutput(os.Stderr)
 | 
						log.SetOutput(os.Stderr)
 | 
				
			||||||
	slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, nil)))
 | 
						slog.SetDefault(slog.New(slog.NewTextHandler(os.Stderr, nil)))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue