Migrate deployment to Gitea Actions and Portainer
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff/internal/postgres"
|
||||
"github.com/dustinpianalto/goff/internal/services"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/postgres"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/services"
|
||||
)
|
||||
|
||||
// Guild management commands
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/goff/internal/postgres"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/postgres"
|
||||
)
|
||||
|
||||
func OnMessageUpdate(session *discordgo.Session, m *discordgo.MessageUpdate) {
|
||||
|
||||
@@ -2,15 +2,15 @@ package exts
|
||||
|
||||
import (
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff/internal/exts/fun"
|
||||
"github.com/dustinpianalto/goff/internal/exts/guild_management"
|
||||
"github.com/dustinpianalto/goff/internal/exts/roles"
|
||||
"github.com/dustinpianalto/goff/internal/exts/tags"
|
||||
"github.com/dustinpianalto/goff/internal/exts/tasks"
|
||||
"github.com/dustinpianalto/goff/internal/exts/user_management"
|
||||
"github.com/dustinpianalto/goff/internal/exts/utils"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/fun"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/guild_management"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/roles"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/tags"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/tasks"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/user_management"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/utils"
|
||||
|
||||
"github.com/dustinpianalto/goff/internal/exts/p_interpreter"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/p_interpreter"
|
||||
)
|
||||
|
||||
func AddCommandHandlers(h *disgoman.CommandManager) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/goff/internal/postgres"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/postgres"
|
||||
)
|
||||
|
||||
var LoggingChannel = make(chan *LogEvent, 10)
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff"
|
||||
"github.com/dustinpianalto/goff/internal/postgres"
|
||||
"github.com/dustinpianalto/goff/internal/services"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/postgres"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/services"
|
||||
)
|
||||
|
||||
var MakeRoleSelfAssignableCommand = &disgoman.Command{
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff"
|
||||
"github.com/dustinpianalto/goff/internal/postgres"
|
||||
"github.com/dustinpianalto/goff/internal/services"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/postgres"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/services"
|
||||
)
|
||||
|
||||
var AddTagCommand = &disgoman.Command{
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/goff/internal/postgres"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/postgres"
|
||||
)
|
||||
|
||||
type Task struct {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff/internal/postgres"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/postgres"
|
||||
"github.com/olebedev/when"
|
||||
"github.com/olebedev/when/rules/common"
|
||||
"github.com/olebedev/when/rules/en"
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/goff"
|
||||
"github.com/dustinpianalto/goff/internal/services"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/services"
|
||||
)
|
||||
|
||||
func OnGuildMemberAdd(s *discordgo.Session, member *discordgo.GuildMemberAdd) {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/goff/internal/discord_utils"
|
||||
"github.com/dustinpianalto/goff/internal/postgres"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/discord_utils"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/postgres"
|
||||
)
|
||||
|
||||
func OnGuildMemberAddLogging(s *discordgo.Session, member *discordgo.GuildMemberAdd) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff/internal/exts/logging"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/exts/logging"
|
||||
)
|
||||
|
||||
var KickUserCommand = &disgoman.Command{
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/goff/internal/discord_utils"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff/internal/discord_utils"
|
||||
)
|
||||
|
||||
var PingCommand = &disgoman.Command{
|
||||
@@ -80,9 +80,9 @@ var GitCommand = &disgoman.Command{
|
||||
|
||||
func gitCommandFunc(ctx disgoman.Context, _ []string) {
|
||||
embed := &discordgo.MessageEmbed{
|
||||
Title: "Hi there, My code is on Github",
|
||||
Title: "Hi there, my code is on Gitea",
|
||||
Color: 0,
|
||||
URL: "https://github.com/dustinpianalto/Goff",
|
||||
URL: "https://gitea.wayfinderak.com/wayfinderak/goff",
|
||||
}
|
||||
_, err := ctx.Session.ChannelMessageSendEmbed(ctx.Channel.ID, embed)
|
||||
if err != nil {
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
@@ -16,12 +17,18 @@ func ConnectDatabase(dbConnString string) {
|
||||
db, err := sql.Open("postgres", dbConnString)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Can't connect to the database. %v", err))
|
||||
} else {
|
||||
fmt.Println("Database Connected.")
|
||||
}
|
||||
db.SetMaxOpenConns(75) // The RDS instance has a max of 75 open connections
|
||||
db.SetMaxIdleConns(5)
|
||||
db.SetConnMaxLifetime(300)
|
||||
|
||||
db.SetMaxOpenConns(5)
|
||||
db.SetMaxIdleConns(2)
|
||||
db.SetConnMaxLifetime(30 * time.Minute)
|
||||
db.SetConnMaxIdleTime(5 * time.Minute)
|
||||
|
||||
if err = db.Ping(); err != nil {
|
||||
panic(fmt.Sprintf("Can't ping the database. %v", err))
|
||||
}
|
||||
|
||||
fmt.Println("Database Connected.")
|
||||
DB = db
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"database/sql"
|
||||
"log"
|
||||
|
||||
"github.com/dustinpianalto/goff"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff"
|
||||
)
|
||||
|
||||
type GuildService struct {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"database/sql"
|
||||
"log"
|
||||
|
||||
"github.com/dustinpianalto/goff"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff"
|
||||
)
|
||||
|
||||
type RoleService struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package postgres
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/dustinpianalto/goff"
|
||||
"gitea.wayfinderak.com/wayfinderak/goff"
|
||||
)
|
||||
|
||||
type UserService struct {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package services
|
||||
|
||||
import "github.com/dustinpianalto/goff"
|
||||
import "gitea.wayfinderak.com/wayfinderak/goff"
|
||||
|
||||
var UserService goff.UserService
|
||||
var GuildService goff.GuildService
|
||||
|
||||
Reference in New Issue
Block a user