brand: GohCMS -> GoCMS, project-wide

This commit is contained in:
Florian Sylvain
2024-05-15 19:34:38 +02:00
parent 7097d71f45
commit 29fce9a241
39 changed files with 68 additions and 68 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ HOST=example.com
PORT=8080 PORT=8080
JWT_SECRET=abc123 JWT_SECRET=abc123
CORS_ALLOWED_ORIGINS=* CORS_ALLOWED_ORIGINS=*
DB_FILE=./gohcms.db DB_FILE=./gocms.db
DOCKER_DB_FOLDER=./data DOCKER_DB_FOLDER=./data
SMTP_EMAIL=a@b.c SMTP_EMAIL=a@b.c
SMTP_PASSWORD=12341234 SMTP_PASSWORD=12341234
+2 -2
View File
@@ -1,4 +1,4 @@
# GohCMS # GoCMS
## 🚧 This project is under development ! ## 🚧 This project is under development !
@@ -46,7 +46,7 @@ of course required, but not necessarily via the `.env` file.
| PORT | int | port the API will use | required | | PORT | int | port the API will use | required |
| JWT_SECRET | string | secret for the jwt auth | required | | JWT_SECRET | string | secret for the jwt auth | required |
| CORS_ALLOWED_ORIGINS | string | allowed origins for CORS | required, semicolon separated list | | CORS_ALLOWED_ORIGINS | string | allowed origins for CORS | required, semicolon separated list |
| DB_FILE | string | path to the sqlite db file | required, can be at the root but name still required (e.g. `./gohcms.db`) ; have to end up with `.db` | | DB_FILE | string | path to the sqlite db file | required, can be at the root but name still required (e.g. `./gocms.db`) ; have to end up with `.db` |
| DOCKER_DB_FOLDER | string | path to the sqlite db file's folder | required with docker, this will basically be the host machine folder (e.g. `./data`) that contains the sqlite db file | | DOCKER_DB_FOLDER | string | path to the sqlite db file's folder | required with docker, this will basically be the host machine folder (e.g. `./data`) that contains the sqlite db file |
| SMTP_EMAIL | string | sender email | required | | SMTP_EMAIL | string | sender email | required |
| SMTP_PASSWORD | string | smtp account password | required | | SMTP_PASSWORD | string | smtp account password | required |
@@ -2,11 +2,11 @@
<html lang="en"> <html lang="en">
<body> <body>
<h1> <h1>
<img src="{{.Host}}/static/gohcms-favicon-128.png" alt="G" style="width: 2.5rem"/> <img src="{{.Host}}/static/gocms-favicon-128.png" alt="G" style="width: 2.5rem"/>
GohCMS GoCMS
</h1> </h1>
<main> <main>
<p>You or someone tried to create a GohCMS admin account with this e-mail address. If you are not responsible for <p>You or someone tried to create a GoCMS admin account with this e-mail address. If you are not responsible for
this, please do not validate the account creation.</p> this, please do not validate the account creation.</p>
<p><b>If you want to validate the account creation, please <a href="{{.Host}}/register/validate?c={{.VerificationCode}}" target="_blank">click HERE</a>.</b> <p><b>If you want to validate the account creation, please <a href="{{.Host}}/register/validate?c={{.VerificationCode}}" target="_blank">click HERE</a>.</b>
</p> </p>
@@ -1,7 +1,7 @@
package gateways package gateways
import ( import (
"GohCMS2/domain/gateways" "GoCMS/domain/gateways"
"bytes" "bytes"
"embed" "embed"
"gopkg.in/gomail.v2" "gopkg.in/gomail.v2"
@@ -39,12 +39,12 @@ func (m MailRepository) Send(receiverAddress string, templateName string, data i
msg := gomail.NewMessage() msg := gomail.NewMessage()
msg.SetHeaders(map[string][]string{ msg.SetHeaders(map[string][]string{
"From": {"GohCMS <" + from + ">"}, "From": {"GoCMS <" + from + ">"},
"To": {receiverAddress}, "To": {receiverAddress},
"MIME-version": {"1.0"}, "MIME-version": {"1.0"},
"Content-Type": {"text/html"}, "Content-Type": {"text/html"},
"charset": {"UTF-8"}, "charset": {"UTF-8"},
"Subject": {"GohCMS | Action required"}, "Subject": {"GoCMS | Action required"},
}) })
msg.SetBody("text/html", body.String()) msg.SetBody("text/html", body.String())
@@ -1,7 +1,7 @@
package gateways package gateways
import ( import (
"GohCMS2/domain/gateways" "GoCMS/domain/gateways"
"bytes" "bytes"
"embed" "embed"
"html/template" "html/template"
@@ -1,9 +1,9 @@
package gateways package gateways
import ( import (
entity "GohCMS2/adapters/secondary/gateways/models" entity "GoCMS/adapters/secondary/gateways/models"
"GohCMS2/domain/gateways" "GoCMS/domain/gateways"
domain "GohCMS2/domain/post" domain "GoCMS/domain/post"
"gorm.io/gorm" "gorm.io/gorm"
) )
@@ -1,10 +1,10 @@
package gateways package gateways
import ( import (
entity "GohCMS2/adapters/secondary/gateways/models" entity "GoCMS/adapters/secondary/gateways/models"
"GohCMS2/domain/gateways" "GoCMS/domain/gateways"
"GohCMS2/domain/user" "GoCMS/domain/user"
domain "GohCMS2/domain/user" domain "GoCMS/domain/user"
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
"gorm.io/gorm" "gorm.io/gorm"
) )
@@ -1,9 +1,9 @@
<nav class="navbar navbar-expand-lg bg-body-tertiary"> <nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container"> <div class="container">
<div class="d-flex gap-2 justify-content-center align-items-center"> <div class="d-flex gap-2 justify-content-center align-items-center">
<img src="/static/gohcms-favicon-128.png" alt="Logo" style="width: 2.5rem"/> <img src="/static/gocms-favicon-128.png" alt="Logo" style="width: 2.5rem"/>
<a class="navbar-brand h1 my-auto" href="https://github.com/Floriansylvain/GohCMS" target="_blank"> <a class="navbar-brand h1 my-auto" href="https://github.com/Floriansylvain/GoCMS" target="_blank">
GohCMS GoCMS
</a> </a>
</div> </div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
@@ -1,14 +1,14 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>GohCMS | Home</title> <title>GoCMS | Home</title>
{{.Head}} {{.Head}}
</head> </head>
<body class="text-dark"> <body class="text-dark">
{{.Navbar}} {{.Navbar}}
<div class="container mt-3 text-black-50"> <div class="container mt-3 text-black-50">
<h1>Accueil</h1> <h1>Accueil</h1>
<p>Welcome on GohCMS !</p> <p>Welcome on GoCMS !</p>
<a href="/post"> <a href="/post">
<button class="btn btn-outline-primary">Posts &raquo;</button> <button class="btn btn-outline-primary">Posts &raquo;</button>
</a> </a>
@@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>GohCMS | Login</title> <title>GoCMS | Login</title>
{{.Head}} {{.Head}}
<style> <style>
@@ -14,7 +14,7 @@
<div class="container"> <div class="container">
<div class="d-flex flex-column m-auto form-container"> <div class="d-flex flex-column m-auto form-container">
<div> <div>
<h1>GohCMS</h1> <h1>GoCMS</h1>
<h2>Login</h2> <h2>Login</h2>
</div> </div>
<form action="login" method="POST" class="mt-5" id="loginForm"> <form action="login" method="POST" class="mt-5" id="loginForm">
@@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>GohCMS | Post edition</title> <title>GoCMS | Post edition</title>
{{.Head}} {{.Head}}
</head> </head>
<body class="text-dark vh-100 d-flex flex-column"> <body class="text-dark vh-100 d-flex flex-column">
@@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>GohCMS | Posts</title> <title>GoCMS | Posts</title>
{{.Head}} {{.Head}}
</head> </head>
<body class="text-dark"> <body class="text-dark">
@@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>GohCMS | Setup</title> <title>GoCMS | Setup</title>
{{.Head}} {{.Head}}
<style> <style>
@@ -14,7 +14,7 @@
<div class="container"> <div class="container">
<div class="d-flex flex-column m-auto form-container"> <div class="d-flex flex-column m-auto form-container">
<div> <div>
<h1>GohCMS</h1> <h1>GoCMS</h1>
<h2>Admin account creation</h2> <h2>Admin account creation</h2>
</div> </div>
<form action="register" method="POST" class="mt-5" id="registerForm"> <form action="register" method="POST" class="mt-5" id="registerForm">
@@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>GohCMS | Setup</title> <title>GoCMS | Setup</title>
{{.Head}} {{.Head}}
<style> <style>
@@ -14,11 +14,11 @@
<div class="container"> <div class="container">
<div class="d-flex flex-column m-auto form-container"> <div class="d-flex flex-column m-auto form-container">
<div> <div>
<h1>GohCMS</h1> <h1>GoCMS</h1>
<h2>Verify your email</h2> <h2>Verify your email</h2>
</div> </div>
<p>An e-mail with the validation link was sent to the address you just registered.</p> <p>An e-mail with the validation link was sent to the address you just registered.</p>
<p>If you misspelled the address or just didn't receive any e-mails, please check your spams or cancel the <p>If you misspelled theF address or just didn't receive any e-mails, please check your spams or cancel the
account creation.</p> account creation.</p>
<form action="" method="post" class="d-flex"> <form action="" method="post" class="d-flex">
<button class="btn btn-outline-primary w-100" type="submit"> <button class="btn btn-outline-primary w-100" type="submit">
@@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>GohCMS | Setup</title> <title>GoCMS | Setup</title>
{{.Head}} {{.Head}}
<style> <style>
@@ -14,7 +14,7 @@
<div class="container"> <div class="container">
<div class="d-flex flex-column gap-5 m-auto form-container"> <div class="d-flex flex-column gap-5 m-auto form-container">
<div> <div>
<h1>GohCMS</h1> <h1>GoCMS</h1>
<h2>E-mail verification</h2> <h2>E-mail verification</h2>
</div> </div>
{{ if .PageError.IsError }} {{ if .PageError.IsError }}
+2 -2
View File
@@ -1,8 +1,8 @@
package api package api
import ( import (
"GohCMS2/domain/user" "GoCMS/domain/user"
"GohCMS2/useCases" "GoCMS/useCases"
"encoding/json" "encoding/json"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/go-chi/jwtauth/v5" "github.com/go-chi/jwtauth/v5"
+2 -2
View File
@@ -1,8 +1,8 @@
package api package api
import ( import (
"GohCMS2/adapters/secondary/gateways/models" "GoCMS/adapters/secondary/gateways/models"
"GohCMS2/useCases" "GoCMS/useCases"
"github.com/glebarez/sqlite" "github.com/glebarez/sqlite"
"go.uber.org/dig" "go.uber.org/dig"
"gorm.io/gorm" "gorm.io/gorm"
+1 -1
View File
@@ -1,7 +1,7 @@
package api package api
import ( import (
"GohCMS2/useCases" "GoCMS/useCases"
"encoding/json" "encoding/json"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"net/http" "net/http"

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

+1 -1
View File
@@ -7,6 +7,6 @@ services:
- ${DOCKER_DB_FOLDER}:/app/db/ - ${DOCKER_DB_FOLDER}:/app/db/
environment: environment:
- PORT=8080 - PORT=8080
- DB_FILE=/app/db/gohcms.db - DB_FILE=/app/db/gocms.db
env_file: env_file:
- ./.env - ./.env
+1 -1
View File
@@ -1,7 +1,7 @@
package gateways package gateways
import ( import (
"GohCMS2/domain/post" "GoCMS/domain/post"
) )
type IPostRepository interface { type IPostRepository interface {
+1 -1
View File
@@ -1,6 +1,6 @@
package gateways package gateways
import "GohCMS2/domain/user" import "GoCMS/domain/user"
type IUserRepository interface { type IUserRepository interface {
Get(id uint32) (user.User, error) Get(id uint32) (user.User, error)
+1 -1
View File
@@ -1,4 +1,4 @@
module GohCMS2 module GoCMS
go 1.20 go 1.20
+1 -1
View File
@@ -1,6 +1,6 @@
package main package main
import "GohCMS2/main/server" import "GoCMS/main/server"
func main() { func main() {
router := server.InitServer() router := server.InitServer()
+1 -1
View File
@@ -1,7 +1,7 @@
package route package route
import ( import (
"GohCMS2/api" "GoCMS/api"
"encoding/json" "encoding/json"
"github.com/MadAppGang/httplog" "github.com/MadAppGang/httplog"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
+2 -2
View File
@@ -1,8 +1,8 @@
package server package server
import ( import (
"GohCMS2/api" "GoCMS/api"
"GohCMS2/main/route" "GoCMS/main/route"
"fmt" "fmt"
"github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5"
"github.com/joho/godotenv" "github.com/joho/godotenv"
+1 -1
View File
@@ -4,7 +4,7 @@ export GOARCH=amd64
OUTPUT_DIR=./bin OUTPUT_DIR=./bin
GO_FILE_PATH="./main/main.go" GO_FILE_PATH="./main/main.go"
PROGRAM_NAME=GohCMS PROGRAM_NAME=GoCMS
# Compile for Windows # Compile for Windows
GOOS=windows go build -o "$OUTPUT_DIR/${PROGRAM_NAME}_windows.exe" "$GO_FILE_PATH" GOOS=windows go build -o "$OUTPUT_DIR/${PROGRAM_NAME}_windows.exe" "$GO_FILE_PATH"
+1 -1
View File
@@ -1,7 +1,7 @@
package test package test
import ( import (
"GohCMS2/domain/post" "GoCMS/domain/post"
"bytes" "bytes"
"encoding/json" "encoding/json"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
+3 -3
View File
@@ -1,9 +1,9 @@
package test package test
import ( import (
"GohCMS2/adapters/secondary/gateways/models" "GoCMS/adapters/secondary/gateways/models"
"GohCMS2/api" "GoCMS/api"
"GohCMS2/main/server" "GoCMS/main/server"
"github.com/glebarez/sqlite" "github.com/glebarez/sqlite"
"gorm.io/gorm" "gorm.io/gorm"
"io" "io"
+2 -2
View File
@@ -1,8 +1,8 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
"GohCMS2/domain/post" "GoCMS/domain/post"
"gorm.io/gorm" "gorm.io/gorm"
) )
+2 -2
View File
@@ -1,8 +1,8 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
"GohCMS2/domain/user" "GoCMS/domain/user"
"gorm.io/gorm" "gorm.io/gorm"
) )
+1 -1
View File
@@ -1,7 +1,7 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
"gorm.io/gorm" "gorm.io/gorm"
) )
+1 -1
View File
@@ -1,7 +1,7 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
) )
type GetPageUseCase struct { type GetPageUseCase struct {
+2 -2
View File
@@ -1,8 +1,8 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
"GohCMS2/domain/post" "GoCMS/domain/post"
"gorm.io/gorm" "gorm.io/gorm"
) )
+2 -2
View File
@@ -1,8 +1,8 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
"GohCMS2/domain/user" "GoCMS/domain/user"
"gorm.io/gorm" "gorm.io/gorm"
) )
+2 -2
View File
@@ -1,8 +1,8 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
"GohCMS2/domain/post" "GoCMS/domain/post"
"gorm.io/gorm" "gorm.io/gorm"
) )
+2 -2
View File
@@ -1,8 +1,8 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
"GohCMS2/domain/user" "GoCMS/domain/user"
"gorm.io/gorm" "gorm.io/gorm"
) )
+1 -1
View File
@@ -1,7 +1,7 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
) )
type SendMailUseCase struct { type SendMailUseCase struct {
+2 -2
View File
@@ -1,8 +1,8 @@
package useCases package useCases
import ( import (
"GohCMS2/adapters/secondary/gateways" "GoCMS/adapters/secondary/gateways"
"GohCMS2/domain/user" "GoCMS/domain/user"
"gorm.io/gorm" "gorm.io/gorm"
) )