Skip to content

Commit

Permalink
Merge pull request #42 from patrickhener/cli-mode
Browse files Browse the repository at this point in the history
Cli mode
  • Loading branch information
patrickhener authored Jun 1, 2023
2 parents 12c72ea + 39523be commit 1885895
Show file tree
Hide file tree
Showing 23 changed files with 1,041 additions and 1,041 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Version](https://img.shields.io/badge/Version-v0.3.3-green)
![Version](https://img.shields.io/badge/Version-v0.3.4-green)
[![GitHub](https://img.shields.io/github/license/patrickhener/goshs)](https://github.com/patrickhener/goshs/blob/master/LICENSE)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/patrickhener/goshs)
[![GitHub issues](https://img.shields.io/github/issues-raw/patrickhener/goshs)](https://github.com/patrickhener/goshs/issues)
Expand Down Expand Up @@ -31,6 +31,8 @@ goshs is a replacement for Python's `SimpleHTTPServer`. It allows uploading and
* Themes
* Dark Mode
* Light Mode
* Command Line
* Run Commands on the system hosting `goshs`

# Installation

Expand Down Expand Up @@ -59,7 +61,7 @@ make build
```bash
> goshs -h

goshs v0.3.3
goshs v0.3.4
Usage: goshs [options]

Web server options:
Expand All @@ -71,6 +73,7 @@ Web server options:
-ro, --read-only Read only mode, no upload possible (default: false)
-uo, --upload-only Upload only mode, no download possible (default: false)
-si, --silent Running without dir listing (default: false)
-c, --cli Enable cli (only with auth and tls) (default: false)

TLS options:
-s, --ssl Use TLS
Expand All @@ -94,6 +97,7 @@ Usage examples:
Start with custom cert: ./goshs -s -sk <path to key> -sc <path to cert>
Start with basic auth: ./goshs -b secret-user:$up3r$3cur3
Start with basic auth empty user: ./goshs -b :$up3r$3cur3
Start with cli enabled: ./goshs -b secret-user:$up3r$3cur3 -s -ss -c
```

# Examples
Expand Down Expand Up @@ -213,6 +217,11 @@ root 35975 0.0 0.0 10828 5028 pts/0 S+ 11:56 0:00 sudo ./goshs
user 35976 0.0 0.1 1166136 8460 pts/0 Sl+ 11:56 0:00 ./goshs -p 80 --u user
```
**Run with cli mode enabled**
CLI mode will let you run commands on the system hosting `goshs` and return the output to you.
`goshs -b secret-user:$up3r$3cur3 -s -ss -c`
# Credits
A special thank you goes to *sc0tfree* for inspiring this project with his project [updog](https://github.com/sc0tfree/updog) written in Python.
102 changes: 102 additions & 0 deletions assets/css/dark_theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// dark_theme.scss

// ---- DARK THEME ----
@include color-mode(dark) {
#header {
border-bottom: 5px solid $dark-light-color;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
color: $dark-color;
background-color: $tableHoverColor;
border-color: $tableHoverColor;
}

.btn-primary {
background-color: $primary-color-light;
border-color: $primary-color-light;
}

.table {
tbody {
td {
color: $dark-light-color;
}

a {
color: $dark-light-color;
}
}

.file_ic {
color: $dark-light-color;
}

.thead-dark {
th {
color: $dark-light-color;
background-color: $dark-dark-color;
}
}
}

.table-hover {
tbody {
tr:hover,
tr:active,
tr:visited,
tr:focus {
color: $dark-color;
background-color: $tableHoverColor;
}

a:hover,
a:active,
a:visited,
a:focus {
color: $dark-light-color;
}

.file_ic {
color: $primary-color-light;
}

i {
color: $primary-color-light;
}
}

.table-primary:hover {
color: $dark-color;
background-color: $tableHoverColor;
}
}

.dataTables_filter {
color: $dark-light-color;
}

.del_button {
color: $dark-light-color;
}

.error-code {
color: $dark-light-color;
background-color: $dark-dark-color;
border: solid 2px $dark-light-color;
border-radius: 8px;
}

textarea:focus {
border-color: $primary-color-light;
box-shadow: 0 0 0 0.25rem rgba($color: #3d7892, $alpha: 0.25);
}

textarea:disabled {
background-color: $dark-dark-color;
}
}
163 changes: 163 additions & 0 deletions assets/css/general_theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
// general_theme.scss

body {
font-family: 'Fira Code VF', monospace, sans-serif !important;
font-weight: 300;
line-height: 1.625;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
width: 100%;
height: 100%;
position: absolute;
z-index: -1;
min-height: 100vh;
}

a,
a:hover,
a:active,
a:visited {
text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 600;
margin: 0;
line-height: 1.2;
}

h1 {
font-size: 36px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 15px;
}
h6 {
font-size: 13px;
}

.card-body {
pre {
white-space: pre-wrap;
word-break: break-all;
}
}

.container {
flex: 1 0 auto;
}

// ---- Tables ----
.table {
td {
font-size: 0.95em;
vertical-align: middle;
}

.file_ic {
font-size: 1.5em;
}
}

.table-hover {
tbody {
tr:hover,
tr:active,
tr:visited,
tr:focus {
font-weight: bold;
}

a:hover,
a:active,
a:visited,
a:focus {
font-weight: bold;
}

.file_ic {
font-weight: bold;
}
}
}

.disable-scrollbars {
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE 10+ */
&::-webkit-scrollbar {
width: 0px;
background: transparent; /* Chrome/Safari/Webkit */
}
}

// ---- header ----
#header {
margin: 0px 0;
margin-left: 20px;
padding-bottom: 20px;

@include mQ($tablet) {
justify-content: center;
}

@include mQ($mobile) {
margin-left: 10px;
flex-direction: column;
}

// ---- logo -----
.logo {
display: flex;
justify-content: center;
align-items: center;

img {
width: 65px;
}
}

// ---- heading ----
.heading_title {
margin-left: 20px;

@include mQ($mobile) {
margin-left: 0px;
margin-top: 20px;
}

h2 {
font-size: 22px;

@include mQ($mobile) {
text-align: center;
}
}
}
}

// ---- Footer ----
footer {
text-align: center;
font-size: 0.8em;
font-weight: bold;
margin: 30px 0;
margin-bottom: 0;
}

.flex-fill {
flex: 1 1 auto;
}
Loading

0 comments on commit 1885895

Please sign in to comment.