diff --git a/.gitignore b/.gitignore index 7847b3f..a3f6afc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ data/ vieter dvieter pvieter -dvieterctl -vieterctl +suvieter +afvieter vieter.c # Ignore testing files diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml index e68c4c9..66ae5a0 100644 --- a/.woodpecker/.build.yml +++ b/.woodpecker/.build.yml @@ -18,6 +18,8 @@ pipeline: - make debug when: event: push + branch: + exclude: [main, dev] prod: image: 'chewingbever/vlang:latest' diff --git a/src/server/git.v b/src/server/git.v index a9d6f50..a7655fe 100644 --- a/src/server/git.v +++ b/src/server/git.v @@ -8,7 +8,7 @@ import response { new_data_response, new_response } const repos_file = 'repos.json' -['/api/repos'; get] +['/api/repos'; get; markused] fn (mut app App) get_repos() web.Result { if !app.is_authorized() { return app.json(http.Status.unauthorized, new_response('Unauthorized.')) @@ -25,7 +25,7 @@ fn (mut app App) get_repos() web.Result { return app.json(http.Status.ok, new_data_response(repos)) } -['/api/repos/:id'; get] +['/api/repos/:id'; get; markused] fn (mut app App) get_single_repo(id string) web.Result { if !app.is_authorized() { return app.json(http.Status.unauthorized, new_response('Unauthorized.')) @@ -48,7 +48,7 @@ fn (mut app App) get_single_repo(id string) web.Result { return app.json(http.Status.ok, new_data_response(repo)) } -['/api/repos'; post] +['/api/repos'; post; markused] fn (mut app App) post_repo() web.Result { if !app.is_authorized() { return app.json(http.Status.unauthorized, new_response('Unauthorized.')) @@ -86,7 +86,7 @@ fn (mut app App) post_repo() web.Result { return app.json(http.Status.ok, new_response('Repo added successfully.')) } -['/api/repos/:id'; delete] +['/api/repos/:id'; delete; markused] fn (mut app App) delete_repo(id string) web.Result { if !app.is_authorized() { return app.json(http.Status.unauthorized, new_response('Unauthorized.')) @@ -113,7 +113,7 @@ fn (mut app App) delete_repo(id string) web.Result { return app.json(http.Status.ok, new_response('Repo removed successfully.')) } -['/api/repos/:id'; patch] +['/api/repos/:id'; patch; markused] fn (mut app App) patch_repo(id string) web.Result { if !app.is_authorized() { return app.json(http.Status.unauthorized, new_response('Unauthorized.')) diff --git a/src/server/routes.v b/src/server/routes.v index 4f6c4f0..b048f76 100644 --- a/src/server/routes.v +++ b/src/server/routes.v @@ -11,12 +11,12 @@ import response { new_response } // healthcheck just returns a string, but can be used to quickly check if the // server is still responsive. -['/health'; get] +['/health'; get; markused] pub fn (mut app App) healthcheck() web.Result { return app.json(http.Status.ok, new_response('Healthy.')) } -['/:repo/:arch/:filename'; get; head] +['/:repo/:arch/:filename'; get; head; markused] fn (mut app App) get_repo_file(repo string, arch string, filename string) web.Result { mut full_path := '' @@ -54,7 +54,7 @@ fn (mut app App) get_repo_file(repo string, arch string, filename string) web.Re return app.file(full_path) } -['/:repo/publish'; post] +['/:repo/publish'; post; markused] fn (mut app App) put_package(repo string) web.Result { if !app.is_authorized() { return app.json(http.Status.unauthorized, new_response('Unauthorized.'))