commit 3d0a68f3deaf5ec958ffad57f68e4a2cb2fede4c Author: Captain ALM Date: Wed Jul 13 16:16:47 2022 +0100 Initial commit. diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..55a244b --- /dev/null +++ b/.drone.yml @@ -0,0 +1,8 @@ +kind: pipeline +name: default + +steps: +- name: build + image: golang + commands: + - make build diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2ec00d --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# Environment variables file +.env + +# Distributable directory +dist/ + +# Test data and logs folders +.data/ +.idea/dataSources.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/cityuni-webserver.iml b/.idea/cityuni-webserver.iml new file mode 100644 index 0000000..5e764c4 --- /dev/null +++ b/.idea/cityuni-webserver.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..d8e9561 --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..283b9b4 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..ae79333 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..7fbe392 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2022, Captain ALM +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c851e51 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +SHELL := /bin/bash +BIN := dist/wappcityuni +ENTRY_POINT := ./cmd/wappcityuni +HASH := $(shell git rev-parse --short HEAD) +COMMIT_DATE := $(shell git show -s --format=%ci ${HASH}) +BUILD_DATE := $(shell date '+%Y-%m-%d %H:%M:%S') +VERSION := ${HASH} +LD_FLAGS := -s -w -X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}' +COMP_BIN := go + +ifeq ($(OS),Windows_NT) + BIN := $(BIN).exe +endif + +.PHONY: build dev test clean + +build: + mkdir -p dist/ + ${COMP_BIN} build -o "${BIN}" -ldflags="${LD_FLAGS}" ${ENTRY_POINT} + +dev: + mkdir -p dist/ + ${COMP_BIN} build -tags debug -o "${BIN}" -ldflags="${LD_FLAGS}" ${ENTRY_POINT} + ./${BIN} + +test: + go test + +clean: + go clean + rm -r -f dist/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..9aab2a3 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Captain ALM Cityuni subdomain WebServer + +[![Build Status](https://ci.mrmelon54.xyz/api/badges/alfred/cityuni-webserver/status.svg)](https://ci.mrmelon54.xyz/alfred/cityuni-webserver) + +This provides my template and cache supporting web / application server for my city university portfolio subdomain. + +Maintainer: +[Captain ALM](https://code.mrmelon54.xyz/alfred) + +License: +[BSD 3-Clause](https://code.mrmelon54.xyz/alfred/GOPackageHeaderServer/src/branch/master/LICENSE) diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b317df0 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module golang.captainalm.com/cityuni-webserver + +go 1.18