Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ type Config struct {
AppName string
BaseUrl string

Project string
ProjectDocumentation string
ProjectDownload string
ProjectExampleVideo string

JwtSecretKey string
Expand Down Expand Up @@ -138,9 +135,8 @@ type Config struct {
}

type PublicConfig struct {
AppName string
BaseUrl string
Project string
AppName string
BaseUrl string
EncodingEnabled bool
UploadEnabled bool

Expand Down Expand Up @@ -168,7 +164,6 @@ func (c Config) PublicConfig() PublicConfig {
return PublicConfig{
AppName: c.AppName,
BaseUrl: c.BaseUrl,
Project: c.Project,
EncodingEnabled: *c.EncodingEnabled,
UploadEnabled: *c.UploadEnabled,

Expand Down
3 changes: 0 additions & 3 deletions configdb/configdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ func Setup() {
config.ENV.AppName = getEnvDb(&setting.AppName, "VideoCMS")
config.ENV.BaseUrl = getEnvDb(&setting.BaseUrl, "http://127.0.0.1:3000")

config.ENV.Project = getEnvDb(&setting.Project, "https://github.com/notfound")
config.ENV.ProjectDocumentation = getEnvDb(&setting.ProjectDocumentation, "https://github.com/notfound")
config.ENV.ProjectDownload = getEnvDb(&setting.ProjectDownload, "https://github.com/notfound")
config.ENV.ProjectExampleVideo = getEnvDb(&setting.ProjectExampleVideo, "notfound")

config.ENV.JwtSecretKey = getEnvDb(&setting.JwtSecretKey, randomstring.CookieFriendlyString(64))
Expand Down
1 change: 0 additions & 1 deletion controllers/PlayerController.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ func PlayerController(c echo.Context) error {
"Webhooks": string(rawWebhooks),
"StreamIsReady": streamIsReady,
"UUID": requestValidation.UUID,
"PROJECTURL": config.ENV.Project,
"Folder": config.ENV.FolderVideoQualitysPub,
"JWT": tkn,
"AppName": config.ENV.AppName,
Expand Down
3 changes: 0 additions & 3 deletions controllers/UpdateSettingsController.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ func UpdateSettings(c echo.Context) error {
setting.ID = validation.ID
setting.AppName = validation.AppName
setting.BaseUrl = validation.BaseUrl
setting.Project = validation.Project
setting.ProjectDocumentation = validation.ProjectDocumentation
setting.ProjectDownload = validation.ProjectDownload
setting.ProjectExampleVideo = validation.ProjectExampleVideo
setting.JwtSecretKey = validation.JwtSecretKey
setting.JwtUploadSecretKey = validation.JwtUploadSecretKey
Expand Down
12 changes: 4 additions & 8 deletions controllers/ViewIndexController.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,12 @@ func ViewIndex(c echo.Context) error {
var link models.Link
if res := inits.DB.First(&link); res.Error != nil {
return c.Render(http.StatusOK, "index.html", echo.Map{
"ExampleVideo": fmt.Sprintf("/%v", "notfound"),
"AppName": config.ENV.AppName,
"ProjectDocumentation": config.ENV.ProjectDocumentation,
"ProjectDownload": config.ENV.ProjectDownload,
"ExampleVideo": fmt.Sprintf("/%v", "notfound"),
"AppName": config.ENV.AppName,
})
}
return c.Render(http.StatusOK, "index.html", echo.Map{
"ExampleVideo": fmt.Sprintf("/%v", link.UUID),
"AppName": config.ENV.AppName,
"ProjectDocumentation": config.ENV.ProjectDocumentation,
"ProjectDownload": config.ENV.ProjectDownload,
"ExampleVideo": fmt.Sprintf("/%v", link.UUID),
"AppName": config.ENV.AppName,
})
}
9 changes: 3 additions & 6 deletions models/Setting.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ type SettingValidation struct {

type Setting struct {
Model
AppName string `validate:"required,min=1,max=120" gorm:"size:120;"`
BaseUrl string `validate:"required,min=1,max=255" gorm:"size:255;"`
AppName string `validate:"required,min=1,max=120" gorm:"size:120;"`
BaseUrl string `validate:"required,min=1,max=120" gorm:"size:120;"`

Project string `validate:"required,min=1,max=512" gorm:"size:512;"`
ProjectDocumentation string `validate:"required,min=1,max=512" gorm:"size:512;"`
ProjectDownload string `validate:"required,min=1,max=512" gorm:"size:512;"`
ProjectExampleVideo string `validate:"required,min=1,max=512" gorm:"size:512;"`
ProjectExampleVideo string `validate:"required,min=1,max=512" gorm:"size:512;"`

JwtSecretKey string `validate:"required,min=8,max=512" gorm:"size:512;"`
JwtUploadSecretKey string `validate:"required,min=8,max=512" gorm:"size:512;"`
Expand Down
4 changes: 2 additions & 2 deletions views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ <h1>{{.AppName}}</h1>
<a target="_blank" href="{{.ExampleVideo}}">Example Video Player</a>
</li>
<li>
<a target="_blank" href="{{.ProjectDocumentation}}">Api Documentation</a>
<a target="_blank" href="https://videocms-docs.vercel.app/">Api Documentation</a>
</li>
<li>
<a target="_blank" href="{{.ProjectDownload}}">Docker Image / Download</a>
<a target="_blank" href="https://hub.docker.com/r/kirari04/videocms">Docker Image / Download</a>
</li>
<li>
<a target="_blank" href="examples/upload">Upload Example</a>
Expand Down
2 changes: 1 addition & 1 deletion views/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
if (Webhooks == null) Webhooks = [];
const JWT = "{{.JWT}}";
const UUID = "{{.UUID}}";
const PROJECTURL = "{{.PROJECTURL}}";

const TITLE = "{{.Title}}";
const StreamIsReady = ("{{.StreamIsReady}}" === "true");
const FOLDER = "{{.Folder}}";
Expand Down
Loading