Skip to content

Commit

Permalink
Merge pull request #135 from server-status-project/master
Browse files Browse the repository at this point in the history
Merge new updates
  • Loading branch information
Yiğit Kerem Oktay authored Nov 5, 2020
2 parents e96df70 + 46c0b55 commit 8d57154
Show file tree
Hide file tree
Showing 44 changed files with 268 additions and 5,690 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: yigitkeremoktay

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE-REQUEST]"
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Was this considered before?**

**Additional context**
Add any other context or screenshots about the feature request here.
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/help-needed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Help Needed
about: If this is not a bug but you need help
title: "[HELP-NEEDED]"
labels: help wanted
assignees: yigitkeremoktay

---

**Describe the problem**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**What you tried?**

**Was this mentioned before?**
**Additional context**
Add any other context about the problem here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/pr-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: PR Template
about: If you have submitted a PR,fill this for to help us!
title: "[PR-INFO]"
labels: PR
assignees: ''

---

## Link to your PR:

## Is this from a feature request? Please link it

## Are there any known bugs or security issues

## Precisely describe what this does

## Give us an example use case
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue has been automatically closed because it has not had
recent activity.
39 changes: 13 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
# Server Status Beta (Official)
## This is the official beta fork of Server Status by the contributors.
![License](https://img.shields.io/github/license/Pryx/server-status.svg) ![Current release](https://img.shields.io/badge/version-2-blue)
![Beta-Build](https://img.shields.io/badge/latest_beta-Developmet_Beta_7-black)
![Beta-Stability](https://img.shields.io/badge/Beta_Stability-Fully_Stable_with_Visual_Imperfections-red)
![Stability](https://img.shields.io/badge/master_stability-Stable-red)
![Build](https://img.shields.io/badge/build-success-green)

## What does **contributor beta** mean?
It means the beta that is heavily unstable that is meant for contributors to make changes and use as a recovery point.
### Other Beta Type
#### Development Beta
##### This beta has some bugs that are noticeable and is sometimes unstable. Best for new contributors
#### Public Beta
##### This beta has some bugs that are not really noticeable and mostly exist as bugs. Best for trying the new features before updating!
# Server status page
![License](https://img.shields.io/github/license/Pryx/server-status.svg) ![Current release](https://img.shields.io/github/release/Pryx/server-status.svg) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b82d62fa6d8b41119f68fd9eca3c3a08)](https://www.codacy.com/app/sajdl.vojtech/server-status?utm_source=github.com&utm_medium=referral&utm_content=Pryx/server-status&utm_campaign=Badge_Grade) [![Discord](https://img.shields.io/discord/742703112590065745?logo=discord)](https://discord.gg/Wgxnxz4)

![screenshot](https://status.trucksbook.eu/img/screenshot.png)

Very simple server status page written in PHP that can run on **PHP 5.4+** - even on **shared webhosting** even without shell access. Because why waste your money on another server (or host on a server that you might want to do maintenance on), when you can use cheap webhosting? And as a cherry on top - it works even without javascript!

## How do I install this thing?
Simply put the files on your server and access it from your browser. There will be a simple install dialog waiting for you.
If you prefer you can install manually by filling the info in config.php.template and renaming it to config.php.
As this **does not** run installation scripts you need to head to your install directory and run create-server-config.php and then delete it.
If you don't want to allow php to access your files or you have permission issues, use the following instructions.
### FOR IIS:
// Rename IISWebConfig to web.config
### FOR Apache and Nginx
// Rename ApacheHtaccess to .htaccess

### Creating server config:
* **IIS**: Rename IISWebConfig to web.config
* **Apache**: Rename ApacheHtaccess to .htaccess
* **Nginx**: You can run with php-fpm no additional modifications required.

You can find more info on [our wiki page](https://github.com/Pryx/server-status/wiki)
You can find more info on [our wiki page](https://github.com/server-status-project/server-status/wiki)

## Contributing
Anyone is welcome to make pull request with new features or security patches / bug fixes.
Expand All @@ -36,7 +25,7 @@ You may create a pull request anytime or you can join our discord here(https://d
### Translations
Any help with translations is much welcome! You can join us at https://poeditor.com/join/project/37SpmJtyOm. You can even add your own language. Just let me know when you're done and I'm going to include the language in the next release.

[List of contributors](https://github.com/Pryx/server-status/wiki/contributors)
[List of contributors](https://github.com/server-status-project/server-status/graphs/contributors)

### Does it actually run somewhere?
Yes it does!
Expand Down Expand Up @@ -68,10 +57,8 @@ Please note that changes are reverted every hour.
### I noticed there is a new release. How do I update?
Updating server status is fairly straightforward. Download your config.php from the server. Delete all files. Upload the new release with config.php you downloaded earlier. You need to manually run install scripts. For that head to your domain and run create-server-config.php deleting it afterwards.
If you don't want to allow php to access your files or you have permission issues, use the following instructions.
#### FOR IIS:
// Rename IISWebConfig to web.config
#### FOR Apache and Nginx
// Rename ApacheHtaccess to .htaccess
#### Updating server config
Follow the instructions for installation without giving the app write access. Keep in mind that you will need to re-apply any modifications you made.

### Is there any way to do this automatically?
We are working on it but it is not yet included. Stay tuned!
Expand Down
11 changes: 4 additions & 7 deletions admin/dashboard.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
$offset = 0;
if (isset($_GET['ajax']))
{
Expand All @@ -18,11 +18,8 @@
{
Incident::delete($_GET['delete']);
}
if (isset($_GET['tasks'])) {
Queue::process_queue();
}

Template::render_header(_("Dashboard"), true);
Template::render_header(_("Dashboard"), true);
?>

<div class="text-center">
Expand All @@ -48,7 +45,7 @@
<?php
} ?>
<div id="status-container" class="clearfix">
<?php
<?php
if (isset($_POST['services']) && !is_array($_POST['services']))
{
$post_services = array($_POST['services']);
Expand Down Expand Up @@ -85,7 +82,7 @@
</div>
</div>
<select class="form-control pull-left" id="type" name="type">
<?php
<?php
if (isset($_POST['type']))
{
$selected_status = $_POST['type'];
Expand Down
71 changes: 3 additions & 68 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,58 +7,7 @@
else{
require_once("../config.php");
require_once("../classes/constellation.php");
require_once("../classes/mailer.php");
require_once("../classes/notification.php");
require_once("../template.php");
require_once("../libs/parsedown/Parsedown.php");
require_once("../classes/queue.php");
require_once("../classes/db-class.php");
$db = new SSDB();
define("NAME", $db->getSetting($mysqli,"name"));
define("TITLE", $db->getSetting($mysqli,"title"));
define("WEB_URL", $db->getSetting($mysqli,"url"));
define("MAILER_NAME", $db->getSetting($mysqli,"mailer"));
define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email"));

define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli, "google_recaptcha"));
define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli, "google_recaptcha_secret"));
define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli, "google_recaptcha_sitekey"));
define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli, "subscribe_email"));
define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli, "subscribe_telegram"));
define("TG_BOT_USERNAME", $db->getSetting($mysqli, "tg_bot_username"));
define("TG_BOT_API_TOKEN", $db->getSetting($mysqli, "tg_bot_api_token"));
define("PHP_MAILER", $db->getBooleanSetting($mysqli, "php_mailer"));
define("PHP_MAILER_SMTP", $db->getBooleanSetting($mysqli, "php_mailer_smtp"));
define("PHP_MAILER_PATH", $db->getSetting($mysqli, "php_mailer_path"));
define("PHP_MAILER_HOST", $db->getSetting($mysqli, "php_mailer_host"));
define("PHP_MAILER_PORT", $db->getSetting($mysqli, "php_mailer_port"));
define("PHP_MAILER_SECURE", $db->getBooleanSetting($mysqli, "php_mailer_secure"));
define("PHP_MAILER_USER", $db->getSetting($mysqli, "php_mailer_user"));
define("PHP_MAILER_PASS", $db->getSetting($mysqli, "php_mailer_pass"));
define("CRON_SERVER_IP", $db->getSetting($mysqli, "cron_server_ip"));

// Process the subscriber notification queue
// If CRON_SERVER_IP is not set, call notification once incident has been saved
if ( empty(CRON_SERVER_IP) )
{
if ( isset($_GET['sent']) && $_GET['sent'] == true )
{
Queue::process_queue();
}
}
else if ( isset($_GET['task']) && $_GET['task'] == 'cron' )
{
// Else, base it on call to /admin?task=cron being called from IP defined by CRON_SERVER_IP
if (! empty(CRON_SERVER_IP) && $_SERVER['REMOTE_ADDR'] == CRON_SERVER_IP )
{
Queue::process_queue();
syslog(1, "CRON server processed");
}
else {
syslog(1, "CRON called from unauthorised server");
}
}


if(isset($_COOKIE['user'])&&!isset($_SESSION['user']))
{
Expand All @@ -80,7 +29,7 @@
require_once("login-form.php");
}
}
else
else
{
$user = new User($_SESSION['user']);
if (!$user->is_active())
Expand All @@ -101,7 +50,7 @@
case 'user':
require_once("user.php");
break;

case 'settings':
require_once("settings.php");
break;
Expand All @@ -110,20 +59,6 @@
require_once("new-user.php");
break;

case 'new-service':
case 'edit-service':
require_once('service.php');
break;

case 'new-service-group':
case 'edit-service-group':
require_once('service-group.php');
break;

case 'options':
require_once("options.php");
break;

case 'logout':
User::logout();
break;
Expand All @@ -135,4 +70,4 @@

Template::render_footer(true);
}
}
}
Loading

0 comments on commit 8d57154

Please sign in to comment.