forked from IceWhaleTech/CasaOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user authentication module, Login page and initialization page. Fixed the problem that the application could not start after the system restarted.
- Loading branch information
Showing
18 changed files
with
155 additions
and
43 deletions.
There are no files selected for viewing
Submodule UI
updated
34 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,16 +11,16 @@ import ( | |
loger2 "github.com/IceWhaleTech/CasaOS/pkg/utils/loger" | ||
"github.com/IceWhaleTech/CasaOS/route" | ||
"github.com/IceWhaleTech/CasaOS/service" | ||
"github.com/gin-gonic/gin" | ||
"github.com/robfig/cron" | ||
"gorm.io/gorm" | ||
) | ||
|
||
var sqliteDB *gorm.DB | ||
|
||
var swagHandler gin.HandlerFunc | ||
var configFlag = flag.String("c", "", "config address") | ||
|
||
var showUserInfo = flag.Bool("show-user-info", false, "show user info") | ||
|
||
func init() { | ||
flag.Parse() | ||
config.InitSetup(*configFlag) | ||
|
@@ -31,21 +31,27 @@ func init() { | |
service.MyService = service.NewService(sqliteDB, loger2.NewOLoger()) | ||
} | ||
|
||
// @title Oasis API | ||
// @title casaOS API | ||
// @version 1.0.0 | ||
// @contact.name lauren.pan | ||
// @contact.url https://www.zimaboard.com | ||
// @contact.email [email protected] | ||
// @description Oasis v1版本api | ||
// @host 192.168.2.114:8089 | ||
// @description casaOS v1版本api | ||
// @host 192.168.2.217:8089 | ||
// @securityDefinitions.apikey ApiKeyAuth | ||
// @in header | ||
// @name Authorization | ||
// @BasePath /v1 | ||
func main() { | ||
if *showUserInfo { | ||
fmt.Println("CasaOS User Info") | ||
fmt.Println("UserName:" + config.UserInfo.UserName) | ||
fmt.Println("Password:" + config.UserInfo.PWD) | ||
return | ||
} | ||
//model.Setup() | ||
//gredis.Setup() | ||
r := route.InitRouter(swagHandler) | ||
r := route.InitRouter() | ||
//service.SyncTask(sqliteDB) | ||
cron2 := cron.New() //创建一个cron实例 | ||
//执行定时任务(每5秒执行一次) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
//go:build doc | ||
// +build doc | ||
|
||
package route | ||
|
||
import ( | ||
_ "github.com/IceWhaleTech/CasaOS/docs" | ||
ginSwagger "github.com/swaggo/gin-swagger" | ||
"github.com/swaggo/gin-swagger/swaggerFiles" | ||
swaggerFiles "github.com/swaggo/gin-swagger/swaggerFiles" | ||
) | ||
|
||
func init() { | ||
// swagHandler = ginSwagger.WrapHandler(swaggerFiles.Handler) | ||
swagHandler = ginSwagger.WrapHandler(swaggerFiles.Handler) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.