Skip to content

Commit

Permalink
Merge pull request #68 from capcom6/docs/move-to-another-repo
Browse files Browse the repository at this point in the history
Remove web pages from backend
  • Loading branch information
capcom6 authored Jun 6, 2024
2 parents 6825865 + d96ff66 commit ebb97a8
Show file tree
Hide file tree
Showing 47 changed files with 23 additions and 1,686 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ docker-dev:

api-docs:
swag fmt -g ./cmd/$(project_name)/main.go \
&& swag init -g ./cmd/$(project_name)/main.go -o ./api
&& swag init --parseDependency -g ./cmd/$(project_name)/main.go -o ./api

view-docs:
php -S 127.0.0.1:8080 -t ./api
Expand Down
4 changes: 2 additions & 2 deletions api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
],
"swagger": "2.0",
"info": {
"description": "End-user authentication key",
"description": "Provides an API for (Android) SMS Gateway",
"title": "SMS Gateway - API",
"contact": {
"name": "Aleksandr Soloshenko",
"email": "[email protected]"
},
"version": "1.0.0"
"version": "{APP_VERSION}"
},
"host": "sms.capcom.me",
"basePath": "/api",
Expand Down
4 changes: 2 additions & 2 deletions api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ info:
contact:
email: [email protected]
name: Aleksandr Soloshenko
description: End-user authentication key
description: Provides an API for (Android) SMS Gateway
title: SMS Gateway - API
version: 1.0.0
version: '{APP_VERSION}'
paths:
/3rdparty/v1/device:
get:
Expand Down
24 changes: 10 additions & 14 deletions build/package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ARG APP_VERSION=1.0.0
ARG APP_RELEASE_ID=1
WORKDIR /go/src

# Install swag
RUN go install github.com/swaggo/swag/cmd/swag@latest

# Copy go.mod and go.sum
COPY go.* ./

Expand All @@ -15,23 +18,16 @@ RUN go mod download
# Copy all the Code and stuff to compile everything
COPY . .

# Replace {APP_VERSION} with the actual version
RUN sed -i "s/{APP_VERSION}/${APP_VERSION}/g" ./cmd/${APP}/main.go

# Generate swagger docs
RUN swag init --parseDependency -g ./cmd/${APP}/main.go -o ./api

# Builds the application as a staticly linked one, to allow it to run on alpine
# RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o app .
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags="-w -s -X github.com/capcom6/${APP}/internal/version.AppVersion=${APP_VERSION} -X github.com/capcom6/${APP}/internal/version.AppRelease=${APP_RELEASE_ID}" -o app ./cmd/${APP}/main.go

# Build MkDocs
FROM squidfunk/mkdocs-material:9.5.15 AS mkdocs

WORKDIR /docs

RUN pip install --no-cache-dir mkdocs-render-swagger-plugin

COPY web/mkdocs/fonts ./.cache/plugin/social/fonts/Roboto
COPY web/mkdocs .

RUN mkdocs build


# Moving the binary to the 'final Image' to make it smaller
FROM alpine:3 as prod

Expand All @@ -41,7 +37,7 @@ RUN apk add --no-cache tzdata

COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh

COPY --from=mkdocs /docs/site /app/static
COPY --from=build /go/src/api /app/api
COPY --from=build /go/src/app /app

# Exposes port 3000 because our program listens on that port
Expand Down
16 changes: 7 additions & 9 deletions cmd/sms-gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,19 @@ import (
smsgateway "github.com/capcom6/sms-gateway/internal/sms-gateway"
)

// @title SMS Gateway - API
// @version 1.0.0
// @description Provides API for (Android) SMS Gateway

// @contact.name Aleksandr Soloshenko
// @contact.email [email protected]
// @securitydefinitions.basic ApiAuth

// @securitydefinitions.apikey MobileToken
// @in header
// @name Authorization
// @description Mobile device token

// @securitydefinitions.basic ApiAuth
// @in header
// @description End-user authentication key
// @title SMS Gateway - API
// @version {APP_VERSION}
// @description Provides an API for (Android) SMS Gateway

// @contact.name Aleksandr Soloshenko
// @contact.email [email protected]

// @host localhost:3000
// @host sms.capcom.me
Expand Down
2 changes: 1 addition & 1 deletion internal/sms-gateway/handlers/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type rootHandler struct {

func (h *rootHandler) Register(app *fiber.App) {
h.healthHandler.Register(app)
app.Static("/", "static")
app.Static("/api", "api")
}

func newRootHandler(healthHandler *healthHandler) *rootHandler {
Expand Down
3 changes: 0 additions & 3 deletions web/mkdocs/.dockerignore

This file was deleted.

3 changes: 0 additions & 3 deletions web/mkdocs/.gitignore

This file was deleted.

17 changes: 0 additions & 17 deletions web/mkdocs/Pipfile

This file was deleted.

781 changes: 0 additions & 781 deletions web/mkdocs/Pipfile.lock

This file was deleted.

13 changes: 0 additions & 13 deletions web/mkdocs/docs/api.md

This file was deleted.

Binary file removed web/mkdocs/docs/assets/cloud-server-arch.png
Binary file not shown.
Binary file removed web/mkdocs/docs/assets/cloud-server.png
Binary file not shown.
Binary file removed web/mkdocs/docs/assets/local-server-arch.png
Binary file not shown.
Binary file removed web/mkdocs/docs/assets/local-server.png
Binary file not shown.
Binary file removed web/mkdocs/docs/assets/logo.png
Binary file not shown.
Binary file removed web/mkdocs/docs/assets/private-server-arch.png
Binary file not shown.
Binary file removed web/mkdocs/docs/assets/private-server.png
Binary file not shown.
Binary file removed web/mkdocs/docs/assets/screenshot.png
Binary file not shown.
12 changes: 0 additions & 12 deletions web/mkdocs/docs/contributing.md

This file was deleted.

11 changes: 0 additions & 11 deletions web/mkdocs/docs/faq/errors.md

This file was deleted.

67 changes: 0 additions & 67 deletions web/mkdocs/docs/faq/general.md

This file was deleted.

Binary file removed web/mkdocs/docs/favicon.ico
Binary file not shown.
11 changes: 0 additions & 11 deletions web/mkdocs/docs/getting-started/index.md

This file was deleted.

22 changes: 0 additions & 22 deletions web/mkdocs/docs/getting-started/local-server.md

This file was deleted.

49 changes: 0 additions & 49 deletions web/mkdocs/docs/getting-started/private-server.md

This file was deleted.

22 changes: 0 additions & 22 deletions web/mkdocs/docs/getting-started/public-cloud-server.md

This file was deleted.

Loading

0 comments on commit ebb97a8

Please sign in to comment.