Skip to content

Commit

Permalink
Merge branch 'fordevio:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
suja1956 authored Sep 25, 2024
2 parents 42ae88c + 1591a70 commit 3d072eb
Show file tree
Hide file tree
Showing 33 changed files with 655 additions and 142 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
docs
bin
assets
.github
.gitignore
LICENSE
README.md
client/node-modules
client/.prettierrc
39 changes: 39 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Description

Fixes: #

_Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue._



## Type of change

_What type of changes does your code introduce to the wharf? Put an `x` in the box that apply._

- [ ] `CHANGE` (fix or feature that would cause existing functionality to not work as expected)
- [ ] `FEATURE` (non-breaking change which adds functionality)
- [ ] `BUGFIX` (non-breaking change which fixes an issue)
- [ ] `ENHANCEMENT` (non-breaking change which improves existing functionality)
- [ ] `NONE` (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

## Verification
<!-- How you tested it? How do you know it works? -->
Please check the [testing guidelines](../docs/TESTING.md) for recommendations about automated tests.

## Changelog entry

_Please put a one-line changelog entry below. This will be copied to the changelog file during the release process._

<!--
Your release note should be written in clear and straightforward sentences. Most often, users aren't familiar with
the technical details of your PR, so consider what they need to know when you write your release note.
Some brief examples of release notes:
- Add metadataConfig field to the Prometheus CRD for configuring how remote-write sends metadata information.
- Generate correct scraping configuration for Probes with empty or unset module parameter.
-->

```release-note
```
42 changes: 42 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: publish
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for master branch
push:
branches: [publish]


#Allow you to run this workflow manually from the actions tab workflow_dispatch;

workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that eill be executed as part of the jobs
steps:
- uses: actions/checkout@v2

name: Loginn to DOcker Hub
- uses: docker/login-action@v1
with:
username: fordevio
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1

-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./deployment/Dockerfile
push: true
tags: fordevio/wharf:latest

36 changes: 36 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
run:
deadline: 10m

linters:
enable:
- revive
- gci
- depguard
- godot
- testifylint
- unconvert

issues:
exclude-rules:
# Disable errcheck linter for test files.
- path: _test.go
linters:
- errcheck

linters-settings:
errcheck:
exclude-functions:
# Any error in HTTP handlers is handled by the server itself.
- (net/http.ResponseWriter).Write
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
gci:
sections:
- standard
- default
depguard:
rules:
forbid-pkg-errors:
deny:
- pkg: "github.com/pkg/errors"
dsc: Should be replaced with standard lib errors or fmt.Errorf
48 changes: 48 additions & 0 deletions DCO
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
weight: 503
toc: true
title: DCO
menu:
docs:
parent: community
lead: ""
images: []
draft: false
---

Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
23 changes: 23 additions & 0 deletions MAINTAINER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Maintainers of Prometheus Operator organization

| Name | Email | Kubernetes Slack | GitHub | Company |
|-------------------|---------------------------|----------------------|------------------------------------------------------|--------------------------------|
| Yash Patel | [email protected] | `@yp969803` | [@yp969803](https://github.com/yp969803) | ForDEV-io |

Please reach any of the maintainers on slack (#wharf) or email if you want to help.



## How to be maintainer?

Any contributor that shows effort, consistentcy and willingness in maintaining a repository will be invited to join the Maintainers team.

Open Source is all about the trust, which is the key factor in decision to add write permissions.

Reach us if you have any questions on how to join maintainer team.

## Notes

This document is heavily inspired by Thanos MANTAINERS.md file. <3
If you find anything not clear in this file feel free to open an issue or reach out to one of the maintainers.
61 changes: 14 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
![Wharf](./assets/wharf.png)
# wharf

![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white) ![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA)
![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)
![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)
![Go](https://img.shields.io/badge/go-%2300ADD8.svg?style=for-the-badge&logo=go&logoColor=white)
## Overview
Wharf is tool which make organizing your monolithic server easy. The purpose of the project to simplify the server management for the team or organization.

Expand All @@ -15,61 +18,25 @@ Currently wharf includes following features:
## Project Status
Currently the first version of the project is in development phase, the api's has been be created, development of some components of user interface is left.

## Quickstart
## ⭐️ Support

If you find this project helpful or interesting, please give it a ⭐️ on [GitHub](https://github.com/fordevio/wharf)! Your support helps the project grow and motivates community to keep improving it.
Also join the [#wharf](https://fordev-io.slack.com/archives/C07NTF2R6KF) slack channel.

### Using source code
## Quickstart

Prerequisite:
* Install and configure path of [go1.22](https://go.dev/doc/install)
* Install [make](https://ioflood.com/blog/install-make-command-linux/)
* Install node and npm
* Install [docker](https://docs.docker.com/engine/install/)
* Install and run [docker](https://docs.docker.com/engine/install/)
* Add docker user to sudo group

```
cd $GOPATH/src/github.com/fordevio
## Clone the git repository
git clone https://github.com/fordevio/wharf.git
## Go to the wharf directory
cd wharf
## Install dependencies
make get
## Build application
make
## Run the application with root privileges
sudo make run
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
```

The application can be acessed by the url `http://localhost:9001`

### Using docker

Prerequisite:
* Install [docker](https://docs.docker.com/engine/install/)
* Add docker user to sudo group

```
## Clone the git repository
git clone https://github.com/fordevio/wharf.git
## Go to the wharf directory
cd wharf
## Make docker image
make dockerImage
## Run docker container
docker run -v /var/lib/wharf:/var/lib/wharf -v /var/run/docker.sock:/var/run/docker.sock -dp 9001:9001 wharf --name wharf
## You can also run docker container using make (skip if done the previous step)
make runDockerWharf
docker run -v /var/lib/wharf:/var/lib/wharf -v /var/run/docker.sock:/var/run/docker.sock -dp 9001:9001 fordevio/wharf:latest --name wharf
```

The application can be acessed by the url `http://localhost:9001`

## Testing
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func main() {

api := router.Group("/api/protected")
{
api.Use(auth.AuthMiddleWare())
api.Use(auth.MiddleWare())
routes.UserRoutes(api)
routes.ContainerRoutes(api)
routes.ImageRoutes(api)
Expand Down
52 changes: 52 additions & 0 deletions code-of-conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
weight: 505
toc: true
title: Code of Conduct
menu:
docs:
parent: community
lead: ""
images: []
draft: false
---

## Community Code of Conduct

### Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing others' private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct. By adopting this Code of Conduct,
project maintainers commit themselves to fairly and consistently applying these
principles to every aspect of managing this project. Project maintainers who do
not follow or enforce the Code of Conduct may be permanently removed from the
project team.

This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer listed in the MAINTAINERS.md file.

This Code of Conduct is adapted from the Contributor Covenant
(http://contributor-covenant.org), version 1.2.0, available at
http://contributor-covenant.org/version/1/2/0/
2 changes: 1 addition & 1 deletion conf/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package conf

import "github.com/wharf/wharf/pkg/cache"

var Cache *cache.LRUCache = nil
var Cache *cache.LRUCache

func InitCache() {
Cache = cache.New(10)
Expand Down
2 changes: 0 additions & 2 deletions conf/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ func InitDir() {
err := os.MkdirAll(DirPath, 0755)
if err != nil {
log.Fatalf("Error creating configuration directory: %s", err)
panic(err)
}
log.Printf("Config directory created: %s", DirPath)
} else if err != nil {
log.Fatalf("Error checking config directory: %s", err)
panic(err)
} else {
log.Printf("Directory already exists: %s", DirPath)
}
Expand Down
Loading

0 comments on commit 3d072eb

Please sign in to comment.