Compare commits

...

210 Commits
1.0 ... 1.2

Author SHA1 Message Date
Graham Campbell
2311d67624 Updated dependencies 2015-09-04 15:01:16 +01:00
Graham Campbell
715d65f464 Laravel fixes 2015-09-04 14:44:48 +01:00
Graham Campbell
1ac4b7a64a Updated dependencies 2015-09-04 11:45:44 +01:00
Graham Campbell
941809037a Lock on laravel 5.1.12 2015-09-04 11:33:14 +01:00
Graham Campbell
0b8ce37e84 Merge pull request #935 from cachethq/fix-scheduled-items-timeline
Fixes #934 - Scheduled items now drop into the right days
2015-09-04 11:11:51 +01:00
James Brooks
0851427f2d Fixes #934 - Scheduled items now drop into the right days 2015-09-04 08:18:10 +01:00
Graham Campbell
860457bfae Rebuilt css 2015-08-18 16:37:47 +01:00
Graham Campbell
9112e2a58f Updated dependencies 2015-08-18 16:17:24 +01:00
James Brooks
b1600bdbee Update dependencies 2015-08-14 23:25:25 +01:00
Graham Campbell
2ef8b8411f Bumped min versions 2015-08-14 23:20:54 +01:00
James Brooks
a55bcb8c48 Update dependencies 2015-08-14 22:37:54 +01:00
James Brooks
5c8369344d Always use HTTPS for Google Fonts 2015-08-13 23:06:57 +01:00
Graham Campbell
8589089a04 Updated dependencies 2015-08-09 19:20:19 +01:00
Graham Campbell
324f8703ce Removed old docker files 2015-08-08 17:38:09 +01:00
Graham Campbell
9df14837b9 Updated phpunit 2015-08-08 17:37:25 +01:00
James Brooks
e3a3f97957 Condensed the readme further 2015-08-08 17:31:44 +01:00
James Brooks
fbfa62d087 Show y axis labels in metrics. Closes #824 2015-08-08 17:31:18 +01:00
James Brooks
1c7fb1a434 Merge pull request #887 from cachethq/api-request-sort
Added the ability to sort and order API results
2015-08-08 12:58:11 +01:00
Graham Campbell
02f069cdc1 Backport all readme changes 2015-08-07 12:14:38 +01:00
James Brooks
1779ac40c9 Added the ability to sort and order API results. Closes #756 2015-08-07 12:08:25 +01:00
Graham Campbell
e8d3c013a1 Merge pull request #883 from cachethq/removals
Remove docker/homestead/vagrant stuff
2015-08-07 12:04:48 +01:00
Graham Campbell
85efb7d114 Updated lock file 2015-08-07 11:59:42 +01:00
Graham Campbell
11d77328dc Remove docker/homestead/vagrant stuff 2015-08-07 11:59:37 +01:00
Graham Campbell
c05e9d9867 Updated phpunit 2015-08-07 11:56:15 +01:00
Graham Campbell
f9f2e5c18a Bumped version 2015-08-06 21:51:31 +01:00
Graham Campbell
2ac9d3b23e Updated dependencies 2015-08-06 20:00:53 +01:00
Graham Campbell
848fb3b607 Rebuilt css 2015-08-06 20:00:38 +01:00
Graham Campbell
7d21a7682c Updated elixir 2015-08-06 20:00:31 +01:00
Graham Campbell
e3c38c7461 Updated emoji package 2015-08-06 20:00:22 +01:00
James Brooks
8dd762184e Update CONTRIBUTING.md 2015-08-05 08:47:09 +01:00
Graham Campbell
578d4befef Fixed typo 2015-08-03 22:00:49 +01:00
Graham Campbell
549c4e1594 Fixed seeder 2015-08-03 21:49:45 +01:00
Graham Campbell
60536d5334 Fixed typos 2015-08-03 21:06:56 +01:00
Graham Campbell
ef3c32c5e9 Updated the readme 2015-08-03 18:43:55 +01:00
Graham Campbell
11cf7ef2c8 Merge pull request #865 from n0mer/patch-1
doc update - how to install Predis dependency
2015-08-03 18:42:10 +01:00
Graham Campbell
ca367ff151 Removed duplicate service provider entry 2015-08-03 18:40:46 +01:00
Nikolay Gorylenko
06ecb4b9fb Update README.md 2015-08-03 17:32:51 +02:00
Nikolay Gorylenko
122138402b doc update - how to install Predis dependency 2015-08-03 16:52:38 +02:00
Graham Campbell
14ec134ac1 Updated dependencies 2015-08-03 14:46:03 +01:00
Graham Campbell
ea0a8dfcff Updated dependencies 2015-08-03 14:28:25 +01:00
Graham Campbell
6cd10581e4 Removed incorrect php-cs-fixer config 2015-08-03 14:26:15 +01:00
Graham Campbell
90baf18724 Backport all fixes from the master to 1.1 2015-08-03 14:23:46 +01:00
Graham Campbell
5bdbc87bf2 Merge pull request #863 from cachethq/1.1-throttling
Fixed login throttling
2015-08-03 14:16:21 +01:00
Graham Campbell
60c7235d94 Merge pull request #864 from n0mer/patch-1
make 'cron' available in docker container
2015-08-03 13:53:26 +01:00
Nikolay Gorylenko
2c8cd19137 make 'cron' available in docker container 2015-08-03 14:47:06 +02:00
Graham Campbell
c1d53a7b42 Fixed login throttling 2015-08-03 13:37:16 +01:00
James Brooks
22b0e105ee Fix showing of verified subscribers when they're not. Fixes #855 2015-08-03 12:37:49 +01:00
James Brooks
c7b55401d4 Casts the subscriber 2015-08-03 12:37:49 +01:00
James Brooks
167b90265f Remove deleted_at as a date field 2015-08-03 12:37:48 +01:00
Graham Campbell
bb71d0175f Merge pull request #861 from n0mer/1.1
do not evaluate LOGGING_MODE and APP_LOCALE during build phase
2015-08-03 12:37:32 +01:00
Nikolay Gorylenko
f964c03072 ≈do not evaluate LOGGING_MODE and APP_LOCALE during build phase; fix path for contab 2015-08-03 11:32:30 +02:00
Graham Campbell
46c43a8b82 Merge pull request #854 from n0mer/1.1
cron tweaks
2015-08-02 22:02:20 +01:00
Nikolay Gorylenko
ee7a0ec5f2 proper command to add file 2015-08-02 12:58:28 +02:00
Nikolay Gorylenko
427c8d24a5 add user to crontab 2015-08-02 12:57:12 +02:00
Nikolay Gorylenko
60e6d99b95 do not daemonize cron 2015-08-02 12:49:15 +02:00
James Brooks
18db70b9cd Merge pull request #853 from n0mer/1.1
add cron config
2015-08-02 11:06:46 +01:00
Nikolay Gorylenko
3a73a9be5c add cron config 2015-08-02 12:04:10 +02:00
James Brooks
fb933720fc Merge pull request #852 from n0mer/1.1
externalize logging mode and app locale
2015-08-02 11:04:07 +01:00
Nikolay Gorylenko
a4ce37f29a add cron to supervisor 2015-08-02 11:55:44 +02:00
Nikolay Gorylenko
4f3664b3e0 externalize logging mode and app locale 2015-08-02 11:15:49 +02:00
Graham Campbell
c46c255722 Merge pull request #847 from cachethq/eager-load-metric-points
Eager load the metric points.
2015-08-01 21:01:10 +01:00
James Brooks
971a422258 Fix docblock 2015-08-01 20:41:57 +01:00
James Brooks
b6de8bf258 Eager load the metric points. 2015-08-01 20:16:58 +01:00
James Brooks
573a301957 Merge pull request #846 from cachethq/unsubscribe-fix
Fix the token sent to unsubscribe
2015-08-01 20:11:51 +01:00
Joseph Cohen
d8323f126c Fix the token sent to unsubscribe 2015-08-01 14:08:14 -05:00
James Brooks
e6db90a798 Merge pull request #844 from cachethq/tracking
Removed tracking
2015-08-01 19:16:18 +01:00
Graham Campbell
9d9bec812d Updated lock file 2015-08-01 17:14:20 +01:00
Graham Campbell
c9b3760a4d CS fix 2015-08-01 17:09:51 +01:00
Graham Campbell
fb127fb861 Removed tracking 2015-08-01 17:07:06 +01:00
Graham Campbell
2425682381 Removed other areas where the word status is appended 2015-08-01 16:45:58 +01:00
Graham Campbell
da1c999ca6 Merge pull request #840 from 5apps/do_not_append_status_to_app_name
Do not append "Status" to the site name
2015-08-01 16:44:35 +01:00
Graham Campbell
79aa78cff5 Fixed segment references 2015-08-01 16:37:27 +01:00
Graham Campbell
4438142348 Updated dependencies 2015-08-01 12:29:09 +01:00
Graham Campbell
e917e338cd Rebuilt css 2015-08-01 12:27:16 +01:00
James Brooks
da22fa208a Merge pull request #842 from n0mer/patch-1
get rid of hard-coded 'file' cache driver
2015-07-31 20:51:45 +01:00
Nikolay Gorylenko
2cb1d9e07d get rid of hard-coded 'file' cache driver 2015-07-31 12:14:25 +02:00
Greg Karékinian
68c458227f Do not append "Status" to the site name
Currently the title of the index is the site name set in the settings is
appended with "Status". This is confusing because the RSS feeds show
the site name without it (and you probably want to write "Status" in the site
name yourself anyway).
2015-07-31 10:08:37 +02:00
James Brooks
043690764d Merge pull request #831 from n0mer/master
#805 for setup UI
2015-07-29 11:05:28 +01:00
James Brooks
845d9e1e14 Remove Cachet logo from the sidebar for now. Closes #830 2015-07-28 22:19:01 +01:00
Nikolay Gorylenko
68572db6d2 do not ignore IntelliJ files 2015-07-28 22:55:08 +02:00
Nikolay Gorylenko
5d7b05d857 ignore IntelliJ files 2015-07-28 22:29:43 +02:00
Nikolay Gorylenko
9eb65eba3b add 'redis' and 'memcached' to setup step #1 2015-07-28 22:25:59 +02:00
James Brooks
17492b0dcf Merge pull request #829 from n0mer/master
cfg for #826 - typo fix
2015-07-28 19:19:52 +01:00
Nikolay Gorylenko
0f8773a547 cfg for #826 - typo fix 2015-07-28 20:01:16 +02:00
James Brooks
45f376e564 Added a way to hide the dashboard button from the footer (default) 2015-07-28 16:19:47 +01:00
James Brooks
3a44e4a809 Fixes #828 - Don't call format on a formatted string 2015-07-28 16:09:35 +01:00
James Brooks
fea555f2b0 Merge pull request #827 from n0mer/master
cfg for #826
2015-07-28 12:00:28 +01:00
Nikolay Gorylenko
9094f37156 cfg for #826 2015-07-28 12:58:22 +02:00
James Brooks
0e502ed53b Default to production 2015-07-27 22:28:52 +01:00
Graham Campbell
7f0c2a772d Don't encode the metric name either 2015-07-27 19:37:59 +01:00
James Brooks
e06688aee5 Fixes #822 - Don't encode entities in metric tooltips 2015-07-27 19:31:37 +01:00
Graham Campbell
bfe2b6ca48 Elixir fixes 2015-07-26 22:56:45 +01:00
Graham Campbell
7e663d7a76 Updated dependencies 2015-07-26 22:56:29 +01:00
Graham Campbell
65fe410a93 Fixed the default debug setting 2015-07-26 10:26:13 +01:00
James Brooks
c747f11f3c Merge pull request #818 from cachethq/elixir-three
Elixir 3
2015-07-25 19:20:03 +01:00
James Brooks
9065b7dccc Re-compile assets with Elixir 3 2015-07-25 19:17:37 +01:00
James Brooks
7727dbf33b Upgrade to Elixir 3 - closes #817 2015-07-25 19:17:30 +01:00
Graham Campbell
2868f9e052 Rebuilt css 2015-07-25 16:06:35 +01:00
Graham Campbell
aab2b1fe6e Updated dependencies 2015-07-25 16:06:30 +01:00
Graham Campbell
1e4a8c8143 Added emoji parsing support 2015-07-25 16:02:35 +01:00
Graham Campbell
e002d596b1 Updated markdown package 2015-07-25 15:56:03 +01:00
Graham Campbell
1e3e1df616 Removed overkill test 2015-07-25 15:48:10 +01:00
Graham Campbell
6e3d1af85a Updated lock file 2015-07-25 13:31:03 +01:00
Graham Campbell
e91cf591ea Updated exceptions package 2015-07-25 13:30:58 +01:00
Graham Campbell
14bbe69509 Tweaked dev dependencies 2015-07-25 13:24:05 +01:00
James Brooks
c328575417 Merge pull request #802 from cachethq/subscriber-api
Subscriber API
2015-07-24 20:44:59 +01:00
James Brooks
ecb3a4e1d9 Remove unused import 2015-07-24 14:37:06 +01:00
James Brooks
71f5de8726 Introduce the Subscriber API. Closes #787 2015-07-24 14:35:31 +01:00
James Brooks
38257c6ae6 Merge pull request #814 from andygrunwald/composer-vagrant-note
Add small note to README that a composer install needs to be executed before a vagrant up
2015-07-24 14:27:10 +01:00
Graham Campbell
6802609ce6 Removed old package 2015-07-24 14:15:35 +01:00
Graham Campbell
476adef1b0 Fixed cipher 2015-07-24 14:13:48 +01:00
Andy Grunwald
3a83110f50 Add small note to README that a composer install needs to be executed before a vagrant up 2015-07-24 14:53:36 +02:00
Graham Campbell
8c4832343d Added missing config in the tests 2015-07-24 13:53:31 +01:00
James Brooks
a0d354c3e9 Configure Redis through environment variables. Closes #805 2015-07-23 21:47:49 +01:00
James Brooks
02cb04d36f Catch generic exception to prevent Segment from breaking everything 2015-07-23 21:37:32 +01:00
Graham Campbell
07861dd245 Updated dependencies 2015-07-23 17:08:56 +01:00
Graham Campbell
14ac707d76 Rebuilt assets 2015-07-23 17:07:50 +01:00
James Brooks
0fba574f5b Update dependencies 2015-07-14 13:59:19 +01:00
James Brooks
71c30fb0bd Update email template design. 2015-07-14 13:59:15 +01:00
James Brooks
bf77fbdd33 Merge pull request #800 from cachethq/email-link
Make subscriber verify link clickable
2015-07-11 16:17:20 +01:00
James Brooks
6336bd8905 Update dependencies 2015-07-11 16:17:08 +01:00
James Brooks
dbbf4a093e Fix formatting of Blade 2015-07-11 16:15:48 +01:00
Joseph Cohen
5190578da9 Make subscriber link clickable 2015-07-10 13:08:35 -05:00
James Brooks
c5f3655d49 Merge pull request #782 from chaseconey/dashboard-sidebar-css-fix-v2
Dashboard - Active Menu Item CSS Fix v2
2015-07-09 14:59:40 +01:00
Chase Coney
721df30642 Fix sidebar formatting 2015-07-09 08:53:02 -05:00
Chase Coney
b79c8902fc Fix sidebar styling. Escape classes input 2015-07-09 08:49:52 -05:00
Chase Coney
bcc72d224f Fixes the set_active menu helper to no longer double quote class name 2015-07-09 08:07:30 -05:00
James Brooks
679005fe3f Merge pull request #776 from chaseconey/subscriber-list-759
Subscriber Administration
2015-07-09 09:18:39 +01:00
James Brooks
4990868d9a Merge pull request #779 from chaseconey/add-vagrant-homestead-support
Add support for Vagrant/Homestead
2015-07-09 07:01:29 +01:00
James Brooks
a7a4fe03e4 Merge pull request #792 from rtrauntvein/patch-1
fixing codestyle docker entrypoint.sh
2015-07-09 06:58:29 +01:00
Ryan Trauntvein
c2678ea89c fixing codestyle docker entrypoint.sh 2015-07-08 20:15:30 -07:00
Chase Coney
f1bbf0200c Use specific version for laravel/homestead 2015-07-08 17:04:49 -05:00
Chase Coney
1a5155dbc5 Add support for Vagrant/Homestead 2015-07-08 17:02:52 -05:00
Chase Coney
7e14d6d25f Fixes #759. First pass at subscriber administration 2015-07-08 16:43:41 -05:00
Graham Campbell
b003a7aa1c Updated flysystem 2015-07-08 21:59:04 +01:00
James Brooks
2c5549120b Merge pull request #788 from rtrauntvein/new-docker-env
Use the Cachet .env file inside of docker image
2015-07-07 22:11:59 +01:00
Graham Campbell
6a29b306e2 Tweak scripts 2015-07-07 11:26:21 +01:00
Graham Campbell
f01849f758 Updated lock file 2015-07-07 10:58:45 +01:00
Graham Campbell
f592aa08c9 Bumped branch alias 2015-07-07 10:57:36 +01:00
Graham Campbell
691e6fffe7 Updated scripts 2015-07-07 10:57:29 +01:00
Ryan Trauntvein
dbda00cef8 Use .env file with docker image 2015-07-06 23:59:08 -07:00
Graham Campbell
408141dd8b Fixed typos 2015-07-06 19:22:49 +01:00
Graham Campbell
9b43b42e27 Removed extra HQ 2015-07-06 18:46:27 +01:00
Graham Campbell
83955fcff5 CS fix 2015-07-06 18:26:21 +01:00
Graham Campbell
bf05197c4f Cleanup exception handling
You're going to love this @joecohens and @jbrooksuk :)
2015-07-06 18:21:23 +01:00
Graham Campbell
a72543daa2 Updated dependencies 2015-07-06 18:19:27 +01:00
Graham Campbell
cbf888d7b7 We definitely don't want the symfony level here 2015-07-06 17:47:46 +01:00
Graham Campbell
0a321bffd8 Updated copyright information 2015-07-06 17:37:01 +01:00
Graham Campbell
f74f44048d Fixes 2015-07-05 15:40:48 +01:00
Graham Campbell
78567f865a Updated trusted proxies 2015-07-05 12:54:45 +01:00
Graham Campbell
de9240d295 Updated dependencies 2015-07-05 11:52:03 +01:00
Graham Campbell
a3235f78d0 Updated scripts 2015-07-05 11:52:03 +01:00
James Brooks
3da8f3065c Added array to cache drivers 2015-07-04 22:19:24 +01:00
Graham Campbell
39091b51b5 Fix 2015-07-04 21:49:09 +01:00
James Brooks
e250d5e3fe Don't optimize any files 2015-07-04 21:46:12 +01:00
James Brooks
8ed0f17761 Remove commented out sidebar item 2015-07-03 10:33:32 +01:00
James Brooks
92caf08d1d Merge pull request #781 from chaseconey/sidebar-css-active-fix
Dashboard - Active Menu Item CSS Fix
2015-07-02 19:27:09 +01:00
James Brooks
1e6db61066 Re-compile without duplicate ionicons css? 2015-07-02 19:20:55 +01:00
Chase Coney
13e5ee548d Fixes the set_active menu helper to no longer double quote class name 2015-07-02 13:20:51 -05:00
Graham Campbell
3d328663d5 Updated dependencies 2015-07-02 17:23:32 +01:00
James Brooks
fafcc8880b Fix CS 2015-07-02 16:46:14 +01:00
James Brooks
7a283dceb7 $pageTitle needs to be snake_case too 2015-07-02 16:40:38 +01:00
James Brooks
c1a0fc10ae Use snake_case in views. Closes #778 2015-07-02 16:37:38 +01:00
James Brooks
13180cf77d Remove Piwik from settings seeder 2015-07-01 21:44:58 +01:00
James Brooks
903da245ef Fix Blade standards 2015-07-01 21:22:00 +01:00
James Brooks
939766bf7d Merge pull request #775 from chaseconey/fix-storage-engine-768
Set default database engine in migrations
2015-06-30 18:48:40 +01:00
Chase Coney
977cac091c Fix spacing issue. 2015-06-30 11:35:34 -05:00
Chase Coney
04161678b6 Fixes 768. php artisan migrate will work regardless of mysql version or default_database_engine. 2015-06-30 09:53:29 -05:00
Graham Campbell
793564e0c0 Updated dependencies 2015-06-27 15:07:31 +01:00
James Brooks
ea89254bf6 Fix transparency and algorithm for calculating severity icon 2015-06-27 14:03:24 +01:00
James Brooks
54011d7635 Update alert icons to match logo, with colours 2015-06-27 13:40:24 +01:00
James Brooks
62a71554c6 Merge pull request #752 from DivineOmega/dynamic_favicon
Dynamic favicon
2015-06-27 13:37:46 +01:00
James Brooks
e92dd0151a Update to Bootstrap 3.3.5 2015-06-27 09:58:55 +01:00
Graham Campbell
0a2f7659aa Updated dependencies 2015-06-26 00:41:16 +01:00
Graham Campbell
c0f19093e4 Updated dependencies 2015-06-25 14:51:14 +01:00
James Brooks
e858a288a6 Replace Gitter badge with CrowdIn % 2015-06-25 14:33:57 +01:00
James Brooks
d20f2cbbc8 Don't use teal for break element 2015-06-25 14:25:03 +01:00
James Brooks
902d7bd01b Fix #765 2015-06-25 08:45:01 +01:00
Graham Campbell
19d780325e Removed old config 2015-06-24 21:36:55 +01:00
Graham Campbell
b6a6acec4d Updated dependencies 2015-06-24 21:16:45 +01:00
Graham Campbell
e28a08f6bb Updated assets 2015-06-24 20:37:22 +01:00
Graham Campbell
0d8a3b4efc Updated dependencies 2015-06-24 20:37:13 +01:00
Graham Campbell
7db305edcc Cleanup tests 2015-06-24 20:16:46 +01:00
James Brooks
74ceb9885b Merge pull request #764 from cachethq/update-logo
Update logo to drop the HQ
2015-06-24 20:04:19 +01:00
James Brooks
d6617b6971 Fix logo proportions 2015-06-24 20:03:22 +01:00
James Brooks
c28ba2dfb8 Update dependencies 2015-06-24 19:58:57 +01:00
James Brooks
e794aedb3a Update logo to drop the HQ 2015-06-24 19:58:47 +01:00
James Brooks
2fa2ff9070 Fix CS on language files and add copyright header 2015-06-23 15:46:37 +01:00
Graham Campbell
0f187b323b Fixed travis file 2015-06-23 15:38:44 +01:00
James Brooks
00a480b98b Remove PHP7 tests as it's disabled in composer 2015-06-23 15:38:03 +01:00
James Brooks
69f213a4dc Merge pull request #760 from wfjsw/master
Update Chinese lang. Closes #758
2015-06-23 15:37:13 +01:00
jsw
cef5c9b1e2 Update Chinese lang. Closes #758 2015-06-23 22:00:05 +08:00
DivineOmega
0ca1668518 Initial dynamic favicon code
Syntax and logic fixes

New favicons

Contribution Guidelines

Removed trailing spaces

Style tweaks

Comma

Suggested code changes

Changed high and medium alert icons to be exclamation marks protruding through a circle

Moved favicon logic to IndexComposer

Style fixes

Removed whitespace
2015-06-23 14:41:41 +01:00
James Brooks
814a6cf30b Added PHP 7 back to test suite
Allow it to fail, instead of HHVM
2015-06-23 08:52:32 +01:00
James Brooks
b0d1eaafc2 Allow HHVM to fail, also fast finish 2015-06-23 08:50:36 +01:00
James Brooks
e68467a308 Clean the value on saving of the setting 2015-06-23 08:11:39 +01:00
James Brooks
0c940adc56 Merge pull request #751 from ldidry/fix-piwik
Fix piwik missing slash problem
2015-06-23 08:09:37 +01:00
James Brooks
96dfd5d057 Merge pull request #757 from alexxwiz/master
Russian translation
2015-06-23 07:18:20 +01:00
Alexey Vasilyev
91dfa822bc Russian translation fixes 2015-06-22 23:29:27 +03:00
Alexey Vasilyev
3c5a5b49f1 Style guide fixes. 2015-06-22 18:06:07 +03:00
Alexey Vasilyev
c12d901147 Style guide fixes 2015-06-22 18:02:56 +03:00
Alexey Vasilyev
60dac4664b Russian translation 2015-06-22 17:56:41 +03:00
James Brooks
b7dc6ab503 Merge pull request #753 from fabianlaule/login-screen-fix
Fix floating of buttons on login screen & made border radius equal
2015-06-21 20:20:45 +01:00
Fabian Laule
d207a2eeeb Fix floating of buttons on login screen & made border radius equal 2015-06-21 16:39:04 +02:00
James Brooks
986fb4c588 Fix CS 2015-06-20 11:58:47 +01:00
James Brooks
5b1c7a69dd Doh. Factories are dev only. 2015-06-20 11:57:14 +01:00
James Brooks
f7b53c06f6 Improve the MetricPointSeeder show actual metrics! 2015-06-20 11:54:42 +01:00
Luc Didry
f9d831bf8a Fix piwik missing slash problem 2015-06-19 23:34:49 +02:00
James Brooks
dc85aa79c8 Merge pull request #749 from ldidry/dont-html-escape-stylesheet
Don't HTML escape custom stylesheet
2015-06-19 22:26:26 +01:00
Luc Didry
261b38b308 Don't HTML escape custom stylesheet
If you HTML escape the custom stylesheet, you can't have quotes in it.
You need quotes if you want to add something with url('foo') (in a
background-image by exemple).
2015-06-19 23:07:37 +02:00
299 changed files with 2679 additions and 2081 deletions

View File

@@ -1 +0,0 @@
.git

View File

@@ -1,12 +1,12 @@
APP_ENV=local
APP_DEBUG=true
APP_ENV=production
APP_DEBUG=false
APP_URL=http://localhost
APP_KEY=SomeRandomString
DB_DRIVER=sqlite
DB_DRIVER=mysql
DB_HOST=localhost
DB_DATABASE=cachet
DB_USERNAME=user
DB_USERNAME=homestead
DB_PASSWORD=secret
CACHE_DRIVER=file
@@ -20,3 +20,7 @@ MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ADDRESS=null
MAIL_NAME=null
REDIS_HOST=null
REDIS_DATABASE=null
REDIS_PORT=null

View File

@@ -2,16 +2,15 @@
## Creating issues
Issues should be made by using the [issue tracker](https://github.com/cachethq/Cachet/issues).
Feature requests and bug reports should be made by using the [issue tracker](https://github.com/cachethq/Cachet/issues). Support questions should be directed to our support email; [support@alt-three.com](mailto:support@alt-three.com?subject=Cachet Support).
Things to remember:
- Be descriptive
- Be respectful of others
**Always be respectful.** Organization members reserve the right to lock topics if they feel necessary.
## Languages
When needing to add labels, placeholders or general text, you **must not** write directly into the source file, rather make use of the `./app/lang/` directory. Always provide the English translation and copy your English string to all other languages - making sure that the indentation and alignment of the arrays are updated.
When needing to add labels, placeholders or general text, you **must not** write directly into the source file, rather make use of the `./resources/lang/` directory.
Always provide the English translation and copy your English string to all other languages - making sure that the indentation and alignment of the arrays are updated.
## Coding Standards
@@ -20,9 +19,9 @@ Please follow existing coding standards:
```php
<?php
namespace Foo\Bar\Controller;
namespace CachetHQ\Cachet\Controller;
use Foo\Bar\Bar;
use CachetHQ\Cachet\Bar;
class Foo extends Bar
{
@@ -50,14 +49,13 @@ class Foo extends Bar
}
```
- Braces on a new line following: `namespace`, `use`, `function` and `class`.
- Line lengths have a soft 80 limit and hard 120 length.
- PHP constants should be in lowercase; `true`, `false` and `null`.
- Defined constants should always be in uppercase.
- Never leave trailing spaces at the end of a line.
- Files should end with one blank line.
- Do not use `# Bash` style comments.
- Always add or update Docblocs to functions.
- If your pull request consists of more than two commits, you **must** squash them into one.
- We use [StyleCI](https://styleci.io) to automatically check code standards in Pull Requests. If your PR fails the CI check, then apply the supplied patch and re-push.
If you're still unsure, then take a look at existing code.
@@ -75,8 +73,6 @@ If you're not particularly fond of the command line, you can get one of GitHub's
If you're feeling adventurous, you can become a Git & GitHub master with the [Git Path on Code School](https://www.codeschool.com/paths/git).
There is always the Cachet Gitter chat to ask any questions you may have:
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/cachethq/Cachet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
## .editorconfig
You should also make use of the [.editorconfig](/.editorconfig) file found within the root of the repository. It'll make sure that your editor is setup with the same file settings.

View File

@@ -1,42 +0,0 @@
FROM debian:jessie
ENV DB_DRIVER=mysql \
ENV=production \
DB_DATABASE=cachet \
DB_HOST= \
DB_USERNAME= \
DB_PASSWORD= \
DEBIAN_FRONTEND=noninteractive
COPY . /var/www/html/
WORKDIR /var/www/html/
# Using nodesource and debian jessie packages instead of compiling from scratch
RUN echo "APT::Install-Recommends \"0\";" >> /etc/apt/apt.conf.d/02recommends && \
echo "APT::Install-Suggests \"0\";" >> /etc/apt/apt.conf.d/02recommends && \
apt-get -qq update && \
apt-get -qq install \
ca-certificates nginx php5-fpm=5.* php5-curl php5-readline php5-mcrypt php5-mysql php5-apcu php5-cli \
git sqlite libsqlite3-dev curl supervisor php5-pgsql && \
apt-get clean && apt-get autoremove -qq && \
rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/* && \
chown -R www-data /var/www/html
# Hardcode the Illuminate key in config/app.php. If you want security, feel free
# to override the key in your own container with a 'php artisan key:generate' :)
RUN sed -i "s/'key' => '\w.*/'key' => 'f20d3e5ae02125a94bd60203a4edfbde',/" config/app.php && \
grep key config/app.php
# copy the various nginx and supervisor conf (to handle both fpm and nginx)
RUN sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf ;\
echo "daemon off;" >> /etc/nginx/nginx.conf ;\
mv /var/www/html/docker/php-fpm-pool.conf /etc/php5/fpm/pool.d/www.conf ;\
rm -f /etc/nginx/sites-enabled/* && rm -f /etc/nginx/conf.d/* && mv /var/www/html/docker/nginx-site.conf /etc/nginx/conf.d/default.conf
RUN curl -sS https://getcomposer.org/installer | php && php composer.phar install --no-dev -o
COPY docker/supervisord.conf /etc/supervisor/supervisord.conf
EXPOSE 8000
CMD ["/usr/bin/supervisord"]

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014-2015 Cachet HQ.
Copyright (c) 2015 Alt Three Services Limited.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View File

@@ -4,7 +4,7 @@
[![Build Status](https://img.shields.io/travis/cachethq/Cachet.svg?style=flat-square)](https://travis-ci.org/cachethq/Cachet)
[![Quality Score](https://img.shields.io/scrutinizer/g/cachethq/Cachet.svg?style=flat-square)](https://scrutinizer-ci.com/g/cachethq/Cachet)
[![Software License](https://img.shields.io/badge/license-BSD3-brightgreen.svg?style=flat-square)](LICENSE)
[![Gitter](https://img.shields.io/badge/gitter-join%20chat-brightgreen.svg?style=flat-square)](https://gitter.im/cachethq/Cachet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Crowdin](https://d322cqt584bo4o.cloudfront.net/cachet/localized.png)](http://translate.cachethq.io/project/cachet)
![Screenshot](https://cachethq.io/img/main-interface.jpg)
@@ -28,7 +28,7 @@
### Development Requirements
The following extra dependencies are required to develop Cachet:
Theses extra dependencies are required to develop Cachet:
- Node.js
- Bower
@@ -38,6 +38,10 @@ The following extra dependencies are required to develop Cachet:
You can now find our documentation at [https://docs.cachethq.io](https://docs.cachethq.io).
- [Installing Cachet](https://docs.cachethq.io/docs/installing-cachet)
- [Getting started with Docker](https://docs.cachethq.io/docs/get-started-with-docker)
- [Getting started with Vagrant](https://docs.cachethq.io/docs/get-started-with-vagrant)
### Demo Account
To test out the demo, you may login to the [Dashboard](https://demo.cachethq.io/dashboard) with the following:
@@ -47,70 +51,6 @@ To test out the demo, you may login to the [Dashboard](https://demo.cachethq.io/
The demo is reset every half hour.
## What Cachet is not
Here is a list of things that Cachet is not or does not do:
1. It does not monitor your services. It works only as a way to display the status of your services. *However, Cachet is able to receive updates from third-party services via its API.*
2. It does not work on a plugin system. There are no monitoring services to extend.
3. It's not a Twitter clone.
## Quickstart with Docker
Run a DB container (you can either pass in environment variables for the DB, or mount a config with `-v /my/database.php:/var/www/html/app/config/database.php`):
```bash
$ export DB_USERNAME=cachet
$ export DB_PASSWORD=cachet
$ export DB_ROOT_PASSWORD=cachet
$ export DB_DATABASE=cachet
$ docker run --name mysql -e MYSQL_USER=$DB_USERNAME -e MYSQL_PASSWORD=$DB_PASSWORD -e MYSQL_ROOT_PASSWORD=$DB_ROOT_PASSWORD -e MYSQL_DATABASE=$DB_DATABASE -d mysql
```
Initialize the DB if you haven't yet:
```bash
$ docker run --rm --link mysql:mysql -e DB_HOST=mysql -e DB_DATABASE=$DB_DATABASE -e DB_USERNAME=$DB_USERNAME -e DB_PASSWORD=$DB_PASSWORD cachethq/cachet:latest php artisan migrate --force
```
Run Cachet:
```bash
$ docker run -d --name cachet --link mysql:mysql -p 80:8000 -e DB_HOST=mysql -e DB_DATABASE=$DB_DATABASE -e DB_USERNAME=$DB_USERNAME -e DB_PASSWORD=$DB_PASSWORD cachethq/cachet:latest
```
Now go to `http://<ipdockerisboundto>/setup` and have fun!
Note: When running in production you should ensure that you enable SSL.
This is commonly achieved by running Nginx with your certificates on your Docker host, service or load balancers in-front of the running container, or by adding your custom SSL certificates and configuration to the supplied Nginx configuration.
### docker-compose
Quickly launch Cachet and MySQL docker images with [docker-compose](https://docs.docker.com/compose/)
```bash
git clone https://github.com/cachethq/Cachet.git
cd Cachet
docker-compose build
docker-compose up
```
To initialize the database, utilize [docker exec](https://docs.docker.com/reference/commandline/cli/#exec):
```bash
docker exec -it cachet_cachet_1 php artisan migrate --force
```
Continue to `http://<ipdockerisboundto>/setup` to configure Cachet.
## Addons
- [cachet-monitor](https://github.com/castawaylabs/cachet-monitor) - For URL monitoring. Automatic incident updates.
- [sensu-cachet](https://github.com/bimlendu/sensu-cachethq) - Sensu handler for updating CachetHQ.
## Read more about Cachet
For more information on why I started developing Cachet, check out my [Cachet articles on my blog](https://james-brooks.uk/tag/cachet/?utm_source=github&utm_medium=readme&utm_campaign=github-cachet).
## Translations
A special thank you to our [translators](https://crowdin.com/project/cachet/activity_stream), who have allowed us to share Cachet with the world. If you'd like to contribute translations, please check out our [CrowdIn project](https://crowdin.com/project/cachet).

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -28,6 +28,7 @@ class IndexComposer
$withData = [
'systemStatus' => 'danger',
'systemMessage' => trans('cachet.service.bad'),
'favicon' => 'favicon-high-alert',
];
if (Component::notStatus(1)->count() === 0) {
@@ -39,8 +40,13 @@ class IndexComposer
$withData = [
'systemStatus' => 'success',
'systemMessage' => trans('cachet.service.good'),
'favicon' => 'favicon',
];
}
} else {
if (Component::whereIn('status', [2, 3])->count() > 0) {
$withData['favicon'] = 'favicon-medium-alert';
}
}
$view->with($withData);

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -39,12 +39,13 @@ class RedirectDisplayer implements DisplayerInterface
* Get the error response associated with the given exception.
*
* @param \Exception $exception
* @param string $id
* @param int $code
* @param string[] $headers
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function display(Exception $exception, $code, array $headers)
public function display(Exception $exception, $id, $code, array $headers)
{
return redirect()->guest('auth/login');
}
@@ -62,13 +63,14 @@ class RedirectDisplayer implements DisplayerInterface
/**
* Can we display the exception?
*
* @param \Exception $exception
* @param \Exception $original
* @param \Exception $transformed
*
* @return bool
*/
public function canDisplay(Exception $exception)
public function canDisplay(Exception $original, Exception $transformed)
{
$redirect = $exception instanceof HttpExceptionInterface && $exception->getStatusCode() === 401;
$redirect = $transformed instanceof HttpExceptionInterface && $transformed->getStatusCode() === 401;
return $redirect && !$this->request->is('api*');
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -37,11 +37,12 @@ class ApiFilter
* Filter and return the displayers.
*
* @param \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[] $displayers
* @param \Exception $exception
* @param \Exception $original
* @param \Exception $transformed
*
* @return \GrahamCampbell\Exceptions\Displayers\DisplayerInterface[]
*/
public function filter(array $displayers, Exception $exception)
public function filter(array $displayers, Exception $original, Exception $transformed)
{
if ($this->request->is('api*')) {
foreach ($displayers as $index => $displayer) {

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -11,11 +11,8 @@
namespace CachetHQ\Cachet\Exceptions;
use Exception;
use GrahamCampbell\Exceptions\ExceptionHandler;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Support\Facades\Response;
use Symfony\Component\HttpKernel\Exception\HttpNotFoundException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class Handler extends ExceptionHandler
{
@@ -25,23 +22,6 @@ class Handler extends ExceptionHandler
* @var string[]
*/
protected $dontReport = [
HttpNotFoundException::class,
NotFoundHttpException::class,
];
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($e instanceof ModelNotFoundException) {
$e = new HttpNotFoundException('Resource not found');
}
return parent::render($request, $e);
}
}

View File

@@ -0,0 +1,41 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Exceptions\Transformers;
use Exception;
use GrahamCampbell\Exceptions\Transformers\TransformerInterface;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
* This is the model not found transformer class.
*
* @author Graham Campbell <graham@alt-three.com>
*/
class ModelNotFoundTransformer implements TransformerInterface
{
/**
* Transform the provided exception.
*
* @param \Exception $exception
*
* @return \Exception
*/
public function transform(Exception $exception)
{
if ($exception instanceof ModelNotFoundException) {
$exception = new NotFoundHttpException('Resource not found');
}
return $exception;
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -73,7 +73,7 @@ class SendIncidentEmailNotificationHandler
'htmlContent' => $data->formattedMessage,
'textContent' => $data->message,
'token' => $subscriber->token,
'unsubscribeLink' => route('unsubscribe', ['code' => $subscriber->token]),
'unsubscribeLink' => route('unsubscribe', ['code' => $subscriber->verify_code]),
'appUrl' => env('APP_URL'),
];

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -71,7 +71,7 @@ class SendMaintenanceEmailNotificationHandler
'htmlContent' => $data->formattedMessage,
'textContent' => $data->message,
'token' => $subscriber->token,
'unsubscribeLink' => route('unsubscribe', ['code' => $subscriber->token]),
'unsubscribeLink' => route('unsubscribe', ['code' => $subscriber->verify_code]),
'appUrl' => env('APP_URL'),
];

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -41,8 +41,8 @@ class ComponentController extends AbstractController
];
View::share([
'subMenu' => $this->subMenu,
'subTitle' => trans_choice('dashboard.components.components', 2),
'sub_menu' => $this->subMenu,
'sub_title' => trans_choice('dashboard.components.components', 2),
]);
}
@@ -58,9 +58,9 @@ class ComponentController extends AbstractController
$this->subMenu['components']['active'] = true;
return View::make('dashboard.components.index')->with([
'pageTitle' => trans_choice('dashboard.components.components', 2).' - '.trans('dashboard.dashboard'),
'page_title' => trans_choice('dashboard.components.components', 2).' - '.trans('dashboard.dashboard'),
'components' => $components,
'subMenu' => $this->subMenu,
'sub_menu' => $this->subMenu,
]);
}
@@ -74,9 +74,9 @@ class ComponentController extends AbstractController
$this->subMenu['groups']['active'] = true;
return View::make('dashboard.components.groups.index')->with([
'pageTitle' => trans_choice('dashboard.components.groups.groups', 2).' - '.trans('dashboard.dashboard'),
'groups' => ComponentGroup::orderBy('order')->get(),
'subMenu' => $this->subMenu,
'page_title' => trans_choice('dashboard.components.groups.groups', 2).' - '.trans('dashboard.dashboard'),
'groups' => ComponentGroup::orderBy('order')->get(),
'sub_menu' => $this->subMenu,
]);
}
@@ -99,9 +99,9 @@ class ComponentController extends AbstractController
);
return View::make('dashboard.components.edit')->with([
'pageTitle' => $pageTitle,
'component' => $component,
'groups' => $groups,
'page_title' => $pageTitle,
'component' => $component,
'groups' => $groups,
]);
}
@@ -120,11 +120,6 @@ class ComponentController extends AbstractController
$component->update($_component);
if (!$component->isValid()) {
segment_track('Dashboard', [
'event' => 'Edit Component',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
@@ -134,11 +129,6 @@ class ComponentController extends AbstractController
->with('errors', $component->getErrors());
}
segment_track('Dashboard', [
'event' => 'Edit Component',
'success' => true,
]);
// The component was added successfully, so now let's deal with the tags.
$tags = preg_split('/ ?, ?/', $tags);
@@ -170,8 +160,8 @@ class ComponentController extends AbstractController
$groups = ComponentGroup::all();
return View::make('dashboard.components.add')->with([
'pageTitle' => trans('dashboard.components.add.title').' - '.trans('dashboard.dashboard'),
'groups' => $groups,
'page_title' => trans('dashboard.components.add.title').' - '.trans('dashboard.dashboard'),
'groups' => $groups,
]);
}
@@ -189,11 +179,6 @@ class ComponentController extends AbstractController
$component = Component::create($_component);
if (!$component->isValid()) {
segment_track('Dashboard', [
'event' => 'Created Component',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
@@ -203,11 +188,6 @@ class ComponentController extends AbstractController
->with('errors', $component->getErrors());
}
segment_track('Dashboard', [
'event' => 'Created Component',
'success' => true,
]);
// The component was added successfully, so now let's deal with the tags.
$tags = preg_split('/ ?, ?/', $tags);
@@ -238,10 +218,6 @@ class ComponentController extends AbstractController
*/
public function deleteComponentAction(Component $component)
{
segment_track('Dashboard', [
'event' => 'Deleted Component',
]);
$component->delete();
return Redirect::back();
@@ -256,10 +232,6 @@ class ComponentController extends AbstractController
*/
public function deleteComponentGroupAction(ComponentGroup $group)
{
segment_track('Dashboard', [
'event' => 'Deleted Component Group',
]);
$group->components->map(function ($component) {
$component->update([
'group_id' => 0,
@@ -279,7 +251,7 @@ class ComponentController extends AbstractController
public function showAddComponentGroup()
{
return View::make('dashboard.components.groups.add')->with([
'pageTitle' => trans('dashboard.components.groups.add.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.components.groups.add.title').' - '.trans('dashboard.dashboard'),
]);
}
@@ -293,8 +265,8 @@ class ComponentController extends AbstractController
public function showEditComponentGroup(ComponentGroup $group)
{
return View::make('dashboard.components.groups.edit')->with([
'pageTitle' => trans('dashboard.components.groups.edit.title').' - '.trans('dashboard.dashboard'),
'group' => $group,
'page_title' => trans('dashboard.components.groups.edit.title').' - '.trans('dashboard.dashboard'),
'group' => $group,
]);
}
@@ -308,11 +280,6 @@ class ComponentController extends AbstractController
$group = ComponentGroup::create(Binput::get('group'));
if (!$group->isValid()) {
segment_track('Dashboard', [
'event' => 'Created Component Group',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
@@ -322,11 +289,6 @@ class ComponentController extends AbstractController
->with('errors', $group->getErrors());
}
segment_track('Dashboard', [
'event' => 'Created Component Group',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
@@ -349,11 +311,6 @@ class ComponentController extends AbstractController
$group->update($groupData);
if (!$group->isValid()) {
segment_track('Dashboard', [
'event' => 'Edit Component Group',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
@@ -363,11 +320,6 @@ class ComponentController extends AbstractController
->with('errors', $group->getErrors());
}
segment_track('Dashboard', [
'event' => 'Edit Component Group',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -26,8 +26,6 @@ class DashboardController extends AbstractController
{
$components = Component::orderBy('order')->get();
segment_page('Dashboard');
return View::make('dashboard.index')->with([
'components' => $components,
]);
@@ -41,7 +39,7 @@ class DashboardController extends AbstractController
public function showNotifications()
{
return View::make('dashboard.notifications.index')->with([
'pageTitle' => trans('dashboard.notifications.notifications').' '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.notifications.notifications').' '.trans('dashboard.dashboard'),
]);
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -55,8 +55,8 @@ class IncidentController extends AbstractController
],
];
View::share('subMenu', $this->subMenu);
View::share('subTitle', trans('dashboard.incidents.title'));
View::share('sub_menu', $this->subMenu);
View::share('sub_title', trans('dashboard.incidents.title'));
}
/**
@@ -69,8 +69,8 @@ class IncidentController extends AbstractController
$incidents = Incident::notScheduled()->orderBy('created_at', 'desc')->get();
return View::make('dashboard.incidents.index')->with([
'pageTitle' => trans('dashboard.incidents.incidents').' - '.trans('dashboard.dashboard'),
'incidents' => $incidents,
'page_title' => trans('dashboard.incidents.incidents').' - '.trans('dashboard.dashboard'),
'incidents' => $incidents,
]);
}
@@ -85,7 +85,7 @@ class IncidentController extends AbstractController
$componentsOutGroups = Component::where('group_id', 0)->get();
return View::make('dashboard.incidents.add')->with([
'pageTitle' => trans('dashboard.incidents.add.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.incidents.add.title').' - '.trans('dashboard.dashboard'),
'componentsInGroups' => $componentsInGroups,
'componentsOutGroups' => $componentsOutGroups,
'incidentTemplates' => IncidentTemplate::all(),
@@ -100,7 +100,7 @@ class IncidentController extends AbstractController
public function showTemplates()
{
return View::make('dashboard.incidents.templates.index')->with([
'pageTitle' => trans('dashboard.incidents.templates.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.incidents.templates.title').' - '.trans('dashboard.dashboard'),
'incidentTemplates' => IncidentTemplate::all(),
]);
}
@@ -126,11 +126,6 @@ class IncidentController extends AbstractController
$incident = Incident::create($incidentData);
if (!$incident->isValid()) {
segment_track('Dashboard', [
'event' => 'Created Incident',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
@@ -147,11 +142,6 @@ class IncidentController extends AbstractController
]);
}
segment_track('Dashboard', [
'event' => 'Created Incident',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
@@ -178,7 +168,7 @@ class IncidentController extends AbstractController
public function showAddIncidentTemplate()
{
return View::make('dashboard.incidents.templates.add')->with([
'pageTitle' => trans('dashboard.incidents.templates.add.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.incidents.templates.add.title').' - '.trans('dashboard.dashboard'),
]);
}
@@ -192,8 +182,8 @@ class IncidentController extends AbstractController
public function showEditTemplateAction(IncidentTemplate $template)
{
return View::make('dashboard.incidents.templates.edit')->with([
'pageTitle' => trans('dashboard.incidents.templates.edit.title').' - '.trans('dashboard.dashboard'),
'template' => $template,
'page_title' => trans('dashboard.incidents.templates.edit.title').' - '.trans('dashboard.dashboard'),
'template' => $template,
]);
}
@@ -206,10 +196,6 @@ class IncidentController extends AbstractController
*/
public function deleteTemplateAction(IncidentTemplate $template)
{
segment_track('Dashboard', [
'event' => 'Deleted Incident Template',
]);
$template->delete();
return Redirect::back();
@@ -226,25 +212,15 @@ class IncidentController extends AbstractController
$template = IncidentTemplate::create($_template);
if (!$template->isValid()) {
segment_track('Dashboard', [
'event' => 'Created Incident Template',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
trans('dashboard.notifications.whoops'),
trans('dashboard.incidents.templates.add.failure')
))
->with('errors', $template->getErrors());
}
segment_track('Dashboard', [
'event' => 'Created Incident Template',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
@@ -263,10 +239,6 @@ class IncidentController extends AbstractController
*/
public function deleteIncidentAction(Incident $incident)
{
segment_track('Dashboard', [
'event' => 'Deleted Incident',
]);
$incident->delete();
return Redirect::back();
@@ -285,7 +257,7 @@ class IncidentController extends AbstractController
$componentsOutGroups = Component::where('group_id', 0)->get();
return View::make('dashboard.incidents.edit')->with([
'pageTitle' => trans('dashboard.incidents.edit.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.incidents.edit.title').' - '.trans('dashboard.dashboard'),
'incident' => $incident,
'componentsInGroups' => $componentsInGroups,
'componentsOutGroups' => $componentsOutGroups,
@@ -314,15 +286,10 @@ class IncidentController extends AbstractController
$incident->update($incidentData);
if (!$incident->isValid()) {
segment_track('Dashboard', [
'event' => 'Edited Incident',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
trans('dashboard.notifications.whoops'),
trans('dashboard.incidents.templates.edit.failure')
))
->with('errors', $incident->getErrors());
@@ -335,11 +302,6 @@ class IncidentController extends AbstractController
]);
}
segment_track('Dashboard', [
'event' => 'Edited Incident',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
@@ -358,10 +320,6 @@ class IncidentController extends AbstractController
*/
public function editTemplateAction(IncidentTemplate $template)
{
segment_track('Dashboard', [
'event' => 'Edited Incident Template',
]);
$template->update(Binput::get('template'));
return Redirect::back()->with('updatedTemplate', $template);

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -30,8 +30,8 @@ class MetricController extends AbstractController
$metrics = Metric::orderBy('created_at', 'desc')->get();
return View::make('dashboard.metrics.index')->with([
'pageTitle' => trans('dashboard.metrics.metrics').' - '.trans('dashboard.dashboard'),
'metrics' => $metrics,
'page_title' => trans('dashboard.metrics.metrics').' - '.trans('dashboard.dashboard'),
'metrics' => $metrics,
]);
}
@@ -43,7 +43,7 @@ class MetricController extends AbstractController
public function showAddMetric()
{
return View::make('dashboard.metrics.add')->with([
'pageTitle' => trans('dashboard.metrics.add.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.metrics.add.title').' - '.trans('dashboard.dashboard'),
'metricMetricPoints' => MetricPoint::all(),
]);
}
@@ -56,7 +56,7 @@ class MetricController extends AbstractController
public function showMetricPoints()
{
return View::make('dashboard.metrics.points.index')->with([
'pageTitle' => trans('dashboard.metrics.points.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.metrics.points.title').' - '.trans('dashboard.dashboard'),
'metricMetricPoints' => MetricPoint::all(),
]);
}
@@ -72,11 +72,6 @@ class MetricController extends AbstractController
$metric = Metric::create($metricData);
if (!$metric->isValid()) {
segment_track('Dashboard', [
'event' => 'Created Metric',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
@@ -86,11 +81,6 @@ class MetricController extends AbstractController
->with('errors', $metric->getErrors());
}
segment_track('Dashboard', [
'event' => 'Created Metric',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
@@ -108,7 +98,7 @@ class MetricController extends AbstractController
public function showAddMetricPoint()
{
return View::make('dashboard.metrics.points.add')->with([
'pageTitle' => trans('dashboard.metrics.points.add.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.metrics.points.add.title').' - '.trans('dashboard.dashboard'),
]);
}
@@ -126,7 +116,7 @@ class MetricController extends AbstractController
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
trans('dashboard.notifications.whoops'),
trans('dashboard.metrics.points.add.failure')
))
->with('errors', $point->getErrors());
@@ -165,8 +155,8 @@ class MetricController extends AbstractController
public function showEditMetricAction(Metric $metric)
{
return View::make('dashboard.metrics.edit')->with([
'pageTitle' => trans('dashboard.metrics.edit.title').' - '.trans('dashboard.dashboard'),
'metric' => $metric,
'page_title' => trans('dashboard.metrics.edit.title').' - '.trans('dashboard.dashboard'),
'metric' => $metric,
]);
}
@@ -183,24 +173,14 @@ class MetricController extends AbstractController
$metric->update($metricData);
if (!$metric->isValid()) {
segment_track('Dashboard', [
'event' => 'Edited Metric',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'<strong>%s</strong>',
trans('dashboard.notifications.awesome')
trans('dashboard.notifications.whoops')
))
->with('errors', $metric->getErrors());
}
segment_track('Dashboard', [
'event' => 'Edited Metric',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -55,8 +55,8 @@ class ScheduleController extends AbstractController
],
];
View::share('subMenu', $this->subMenu);
View::share('subTitle', trans('dashboard.incidents.title'));
View::share('sub_menu', $this->subMenu);
View::share('sub_title', trans('dashboard.incidents.title'));
}
/**
@@ -113,11 +113,6 @@ class ScheduleController extends AbstractController
$incident = Incident::create($scheduleData);
if (!$incident->isValid()) {
segment_track('Dashboard', [
'event' => 'Created Scheduled Maintenance',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('success', sprintf(
'%s %s',
@@ -127,11 +122,6 @@ class ScheduleController extends AbstractController
->with('errors', $incident->getErrors());
}
segment_track('Dashboard', [
'event' => 'Created Scheduled Maintenance',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
@@ -197,11 +187,6 @@ class ScheduleController extends AbstractController
$schedule->update($scheduleData);
if (!$schedule->isValid()) {
segment_track('Dashboard', [
'event' => 'Edited Schedule',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
@@ -211,11 +196,6 @@ class ScheduleController extends AbstractController
->with('errors', $schedule->getErrors());
}
segment_track('Dashboard', [
'event' => 'Edited Schedule',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
@@ -234,10 +214,6 @@ class ScheduleController extends AbstractController
*/
public function deleteScheduleAction(Incident $schedule)
{
segment_track('Dashboard', [
'event' => 'Deleted Schedule',
]);
$schedule->delete();
return Redirect::back()->with('warning', sprintf(

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -54,9 +54,9 @@ class SettingsController extends AbstractController
],
];
View::share('subTitle', $this->subTitle);
View::share('sub_title', $this->subTitle);
View::share('subMenu', $this->subMenu);
View::share('sub_menu', $this->subMenu);
}
/**
@@ -69,8 +69,8 @@ class SettingsController extends AbstractController
$this->subMenu['setup']['active'] = true;
return View::make('dashboard.settings.app-setup')->with([
'pageTitle' => 'Application Setup - Dashboard',
'subMenu' => $this->subMenu,
'page_title' => 'Application Setup - Dashboard',
'sub_menu' => $this->subMenu,
]);
}
@@ -84,8 +84,8 @@ class SettingsController extends AbstractController
$this->subMenu['theme']['active'] = true;
return View::make('dashboard.settings.theme')->with([
'pageTitle' => 'Theme - Dashboard',
'subMenu' => $this->subMenu,
'page_title' => 'Theme - Dashboard',
'sub_menu' => $this->subMenu,
]);
}
@@ -101,8 +101,8 @@ class SettingsController extends AbstractController
$unsecureUsers = User::whereNull('google_2fa_secret')->orWhere('google_2fa_secret', '')->get();
return View::make('dashboard.settings.security')->with([
'pageTitle' => 'Security - Dashboard',
'subMenu' => $this->subMenu,
'page_title' => 'Security - Dashboard',
'sub_menu' => $this->subMenu,
'unsecureUsers' => $unsecureUsers,
]);
}
@@ -117,8 +117,8 @@ class SettingsController extends AbstractController
$this->subMenu['stylesheet']['active'] = true;
return View::make('dashboard.settings.stylesheet')->with([
'pageTitle' => 'Stylesheet - Dashboard',
'subMenu' => $this->subMenu,
'page_title' => 'Stylesheet - Dashboard',
'sub_menu' => $this->subMenu,
]);
}
@@ -172,6 +172,10 @@ class SettingsController extends AbstractController
try {
foreach (Binput::except(['app_banner', 'remove_banner']) as $settingName => $settingValue) {
if ($settingName === 'app_analytics_pi_url') {
$settingValue = rtrim($settingValue, '/');
}
Setting::firstOrCreate([
'name' => $settingName,
])->update([

View File

@@ -0,0 +1,104 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Http\Controllers\Admin;
use CachetHQ\Cachet\Events\CustomerHasSubscribedEvent;
use CachetHQ\Cachet\Http\Controllers\AbstractController;
use CachetHQ\Cachet\Models\Subscriber;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\View;
class SubscriberController extends AbstractController
{
/**
* Shows the subscribers view.
*
* @return \Illuminate\View\View
*/
public function showSubscribers()
{
$subscribers = Subscriber::all();
return View::make('dashboard.subscribers.index')
->with([
'page_title' => trans('dashboard.subscribers.subscribers').' - '.trans('dashboard.dashboard'),
'subscribers' => $subscribers,
]);
}
/**
* Shows the add subscriber view.
*
* @return \Illuminate\View\View
*/
public function showAddSubscriber()
{
return View::make('dashboard.subscribers.add')
->with([
'page_title' => trans('dashboard.subscribers.add.title').' - '.trans('dashboard.dashboard'),
'incidentTemplates' => Subscriber::all(),
]);
}
/**
* Creates a new subscriber.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function createSubscriberAction()
{
$email = Binput::get('email');
$subscriber = Subscriber::create([
'email' => $email,
]);
if (!$subscriber->isValid()) {
return Redirect::back()
->withInput(Binput::all())
->with('title', sprintf(
'%s %s',
trans('dashboard.notifications.whoops'),
trans('dashboard.subscribers.add.failure')
))
->with('errors', $subscriber->getErrors());
}
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
trans('dashboard.subscribers.add.success')
);
event(new CustomerHasSubscribedEvent($subscriber));
return Redirect::back()
->with('success', $successMsg);
}
/**
* Deletes a subscriber.
*
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
*
* @throws \Exception
*
* @return \Illuminate\Http\RedirectResponse
*/
public function deleteSubscriberAction(Subscriber $subscriber)
{
$subscriber->delete();
return Redirect::back();
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -29,7 +29,7 @@ class TeamController extends AbstractController
$team = User::all();
return View::make('dashboard.team.index')->with([
'pageTitle' => trans('dashboard.team.team').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.team.team').' - '.trans('dashboard.dashboard'),
'teamMembers' => $team,
]);
}
@@ -42,8 +42,8 @@ class TeamController extends AbstractController
public function showTeamMemberView(User $user)
{
return View::make('dashboard.team.edit')->with([
'pageTitle' => trans('dashboard.team.edit.title').' - '.trans('dashboard.dashboard'),
'user' => $user,
'page_title' => trans('dashboard.team.edit.title').' - '.trans('dashboard.dashboard'),
'user' => $user,
]);
}
@@ -55,7 +55,7 @@ class TeamController extends AbstractController
public function showAddTeamMemberView()
{
return View::make('dashboard.team.add')->with([
'pageTitle' => trans('dashboard.team.add.title').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.team.add.title').' - '.trans('dashboard.dashboard'),
]);
}
@@ -69,11 +69,6 @@ class TeamController extends AbstractController
$user = User::create(Binput::all());
if (!$user->isValid()) {
segment_track('Dashboard', [
'event' => 'Added User',
'success' => false,
]);
return Redirect::back()->withInput(Binput::except('password'))
->with('title', sprintf(
'%s %s',
@@ -83,11 +78,6 @@ class TeamController extends AbstractController
->with('errors', $user->getErrors());
}
segment_track('Dashboard', [
'event' => 'Added User',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),
@@ -117,11 +107,6 @@ class TeamController extends AbstractController
$user->update($items);
if (!$user->isValid()) {
segment_track('Dashboard', [
'event' => 'Updated User',
'success' => false,
]);
return Redirect::back()->withInput(Binput::except('password'))
->with('title', sprintf(
'%s %s',
@@ -131,11 +116,6 @@ class TeamController extends AbstractController
->with('errors', $user->getErrors());
}
segment_track('Dashboard', [
'event' => 'Updated User',
'success' => true,
]);
$successMsg = sprintf(
'%s %s',
trans('dashboard.notifications.awesome'),

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -29,7 +29,7 @@ class UserController extends AbstractController
public function showUser()
{
return View::make('dashboard.user.index')->with([
'pageTitle' => trans('dashboard.team.profile').' - '.trans('dashboard.dashboard'),
'page_title' => trans('dashboard.team.profile').' - '.trans('dashboard.dashboard'),
]);
}
@@ -48,18 +48,8 @@ class UserController extends AbstractController
// Let's enable/disable auth
if ($enable2FA && !Auth::user()->hasTwoFactor) {
$items['google_2fa_secret'] = Google2FA::generateSecretKey();
segment_track('User Management', [
'event' => 'enabled_two_factor',
'value' => true,
]);
} elseif (!$enable2FA) {
$items['google_2fa_secret'] = '';
segment_track('User Management', [
'event' => 'enabled_two_factor',
'value' => false,
]);
}
if (trim($passwordChange) === '') {
@@ -95,10 +85,6 @@ class UserController extends AbstractController
*/
public function regenerateApiKey(User $user)
{
segment_track('User Management', [
'event' => 'regenrated_api_token',
]);
$user->api_key = User::generateApiKey();
$user->save();

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -159,7 +159,15 @@ abstract class AbstractApiController extends BaseController
],
];
return $this->setMetaData($pagination)->setData(AutoPresenter::decorate($paginator->getCollection()))->respond();
$items = $paginator->getCollection();
if ($sortBy = $request->get('sort')) {
$direction = $request->has('order') && $request->get('order') == 'desc';
$items = $items->sortBy($sortBy, SORT_REGULAR, $direction);
}
return $this->setMetaData($pagination)->setData(AutoPresenter::decorate($items->values()->all()))->respond();
}
/**

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -63,6 +63,10 @@ class IncidentController extends AbstractApiController
{
$incidentData = Binput::all();
if (!array_has($incidentData, 'visible')) {
$incidentData['visible'] = 1;
}
try {
$incident = Incident::create($incidentData);
} catch (Exception $e) {

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -0,0 +1,77 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Http\Controllers\Api;
use CachetHQ\Cachet\Events\CustomerHasSubscribedEvent;
use CachetHQ\Cachet\Models\Subscriber;
use Exception;
use GrahamCampbell\Binput\Facades\Binput;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
class SubscriberController extends AbstractApiController
{
/**
* Get all subscribers.
*
* @param \Symfony\Component\HttpFoundation\Request $request
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getSubscribers(Request $request)
{
$subscribers = Subscriber::paginate(Binput::get('per_page', 20));
return $this->paginator($subscribers, $request);
}
/**
* Create a new subscriber.
*
* @return \CachetHQ\Cachet\Models\Subscriber
*/
public function postSubscribers()
{
$subscriberData = Binput::except('verify');
try {
$subscriber = Subscriber::create($subscriberData);
} catch (Exception $e) {
throw new BadRequestHttpException();
}
if ($subscriber->isValid()) {
// If we're auto-verifying the subscriber, don't bother with this event.
if (!(Binput::get('verify'))) {
event(new CustomerHasSubscribedEvent($subscriber));
}
return $this->item($subscriber);
}
throw new BadRequestHttpException();
}
/**
* Delete a subscriber.
*
* @param \CachetHQ\Cachet\Models\Subscriber $subscriber
*
* @return \Illuminate\Http\JsonResponse
*/
public function deleteSubscriber(Subscriber $subscriber)
{
$subscriber->delete();
return $this->noContent();
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -12,7 +12,6 @@
namespace CachetHQ\Cachet\Http\Controllers;
use GrahamCampbell\Binput\Facades\Binput;
use GrahamCampbell\Throttle\Facades\Throttle;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Request;
@@ -33,7 +32,7 @@ class AuthController extends AbstractController
public function showLogin()
{
return View::make('auth.login')->with([
'pageTitle' => trans('dashboard.login.login'),
'page_title' => trans('dashboard.login.login'),
]);
}
@@ -57,16 +56,12 @@ class AuthController extends AbstractController
return Redirect::route('two-factor');
}
// We probably wan't to add support for "Remember me" here.
// We probably want to add support for "Remember me" here.
Auth::attempt(Binput::only(['email', 'password']));
segment_track('Logged In');
return Redirect::intended('dashboard');
}
Throttle::hit(Request::instance(), 10, 10);
return Redirect::back()
->withInput(Binput::except('password'))
->with('error', trans('forms.login.invalid'));
@@ -122,8 +117,6 @@ class AuthController extends AbstractController
{
Auth::logout();
segment_track('Logged Out');
return Redirect::to('/');
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -35,18 +35,12 @@ class HomeController extends AbstractController
$today = Date::now();
$startDate = Date::now();
segment_page('Status Page');
// Check if we have another starting date
if (Binput::has('start_date')) {
try {
// If date provided is valid
$oldDate = Date::createFromFormat('Y-m-d', Binput::get('start_date'));
segment_track('Status Page', [
'start_date' => $oldDate->format('Y-m-d'),
]);
// If trying to get a future date fallback to today
if ($today->gt($oldDate)) {
$startDate = $oldDate;
@@ -71,7 +65,13 @@ class HomeController extends AbstractController
$allIncidents = Incident::notScheduled()->where('visible', '>=', $incidentVisiblity)->whereBetween('created_at', [
$startDate->copy()->subDays($daysToShow)->format('Y-m-d').' 00:00:00',
$startDate->format('Y-m-d').' 23:59:59',
])->orderBy('created_at', 'desc')->get()->groupBy(function (Incident $incident) use ($dateTimeZone) {
])->orderBy('scheduled_at', 'desc')->orderBy('created_at', 'desc')->get()->groupBy(function (Incident $incident) use ($dateTimeZone) {
// If it's scheduled, get the scheduled at date.
if ($incident->is_scheduled) {
return (new Date($incident->scheduled_at))
->setTimezone($dateTimeZone)->toDateString();
}
return (new Date($incident->created_at))
->setTimezone($dateTimeZone)->toDateString();
});
@@ -112,7 +112,7 @@ class HomeController extends AbstractController
'canPageBackward' => $canPageBackward,
'previousDate' => $startDate->copy()->subDays($daysToShow)->toDateString(),
'nextDate' => $startDate->copy()->addDays($daysToShow)->toDateString(),
'pageTitle' => Setting::get('app_name').' Status',
'page_title' => Setting::get('app_name'),
]);
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -31,9 +31,12 @@ class SetupController extends AbstractController
* @var string[]
*/
protected $cacheDrivers = [
'apc' => 'APC(u)',
'file' => 'File',
'database' => 'Database',
'apc' => 'APC(u)',
'array' => 'Array',
'file' => 'File',
'database' => 'Database',
'memcached' => 'Memcached',
'redis' => 'Redis',
];
/**
@@ -51,15 +54,13 @@ class SetupController extends AbstractController
*/
public function getIndex()
{
segment_page('Setup');
// If we've copied the .env.example file, then we should try and reset it ready for Segment to kick in.
// If we've copied the .env.example file, then we should try and reset it.
if (getenv('APP_KEY') === 'SomeRandomString') {
$this->keyGenerate();
}
return View::make('setup')->with([
'pageTitle' => trans('setup.setup'),
'page_title' => trans('setup.setup'),
'cacheDrivers' => $this->cacheDrivers,
'appUrl' => Request::root(),
]);
@@ -80,19 +81,8 @@ class SetupController extends AbstractController
]);
if ($v->passes()) {
segment_track('Setup', [
'event' => 'Step 1',
'success' => true,
]);
return Response::json(['status' => 1]);
} else {
// No good, let's try that again.
segment_track('Setup', [
'event' => 'Step 1',
'success' => false,
]);
return Response::json(['errors' => $v->messages()], 400);
}
}
@@ -117,19 +107,8 @@ class SetupController extends AbstractController
]);
if ($v->passes()) {
segment_track('Setup', [
'event' => 'Step 2',
'success' => true,
]);
return Response::json(['status' => 1]);
} else {
// No good, let's try that again.
segment_track('Setup', [
'event' => 'Step 2',
'success' => false,
]);
return Response::json(['errors' => $v->messages()], 400);
}
}
@@ -187,25 +166,12 @@ class SetupController extends AbstractController
Session::flash('setup.done', true);
segment_track('Setup', [
'event' => 'Step 3',
'success' => true,
'cache_driver' => $envData['cache_driver'],
'session_driver' => $envData['session_driver'],
]);
if (Request::ajax()) {
return Response::json(['status' => 1]);
}
return Redirect::to('dashboard');
} else {
segment_track('Setup', [
'event' => 'Step 3',
'success' => false,
]);
// No good, let's try that again.
if (Request::ajax()) {
return Response::json(['errors' => $v->messages()], 400);
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -31,8 +31,8 @@ class SubscribeController extends AbstractController
public function showSubscribe()
{
return View::make('subscribe', [
'pageTitle' => Setting::get('app_name'),
'aboutApp' => Markdown::convertToHtml(Setting::get('app_about')),
'page_title' => Setting::get('app_name'),
'aboutApp' => Markdown::convertToHtml(Setting::get('app_about')),
]);
}
@@ -46,11 +46,6 @@ class SubscribeController extends AbstractController
$subscriber = Subscriber::create(['email' => Binput::get('email')]);
if (!$subscriber->isValid()) {
segment_track('Subscribers', [
'event' => 'Customer Subscribed',
'success' => false,
]);
return Redirect::back()->withInput(Binput::all())
->with('title', sprintf(
'<strong>%s</strong> %s',
@@ -60,11 +55,6 @@ class SubscribeController extends AbstractController
->with('errors', $subscriber->getErrors());
}
segment_track('Subscribers', [
'event' => 'Customer Subscribed',
'success' => true,
]);
$successMsg = sprintf(
'<strong>%s</strong> %s',
trans('dashboard.notifications.awesome'),
@@ -98,11 +88,6 @@ class SubscribeController extends AbstractController
$subscriber->verified_at = Carbon::now();
$subscriber->save();
segment_track('Subscribers', [
'event' => 'Customer Email Verified',
'success' => true,
]);
$successMsg = sprintf(
'<strong>%s</strong> %s',
trans('dashboard.notifications.awesome'),
@@ -133,11 +118,6 @@ class SubscribeController extends AbstractController
$subscriber->delete();
segment_track('Subscribers', [
'event' => 'Customer Unsubscribed',
'success' => true,
]);
$successMsg = sprintf(
'<strong>%s</strong> %s',
trans('dashboard.notifications.awesome'),

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -35,16 +35,16 @@ class Kernel extends HttpKernel
* @var array
*/
protected $routeMiddleware = [
'auth' => 'CachetHQ\Cachet\Http\Middleware\Authenticate',
'auth.api' => 'CachetHQ\Cachet\Http\Middleware\ApiAuthenticate',
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'CachetHQ\Cachet\Http\Middleware\RedirectIfAuthenticated',
'csrf' => 'Illuminate\Foundation\Http\Middleware\VerifyCsrfToken',
'admin' => 'CachetHQ\Cachet\Http\Middleware\Admin',
'login.throttling' => 'CachetHQ\Cachet\Http\Middleware\LoginThrottling',
'app.isSetup' => 'CachetHQ\Cachet\Http\Middleware\AppIsSetup',
'app.hasSetting' => 'CachetHQ\Cachet\Http\Middleware\HasSetting',
'app.subscribers' => 'CachetHQ\Cachet\Http\Middleware\SubscribersConfigured',
'accept' => 'CachetHQ\Cachet\Http\Middleware\Acceptable',
'auth' => 'CachetHQ\Cachet\Http\Middleware\Authenticate',
'auth.api' => 'CachetHQ\Cachet\Http\Middleware\ApiAuthenticate',
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'CachetHQ\Cachet\Http\Middleware\RedirectIfAuthenticated',
'csrf' => 'Illuminate\Foundation\Http\Middleware\VerifyCsrfToken',
'admin' => 'CachetHQ\Cachet\Http\Middleware\Admin',
'throttling' => 'GrahamCampbell\Throttle\Http\Middleware\ThrottleMiddleware',
'app.isSetup' => 'CachetHQ\Cachet\Http\Middleware\AppIsSetup',
'app.hasSetting' => 'CachetHQ\Cachet\Http\Middleware\HasSetting',
'app.subscribers' => 'CachetHQ\Cachet\Http\Middleware\SubscribersConfigured',
'accept' => 'CachetHQ\Cachet\Http\Middleware\Acceptable',
];
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -1,44 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Http\Middleware;
use Closure;
use GrahamCampbell\Throttle\Facades\Throttle;
use Illuminate\Support\Facades\Redirect;
class LoginThrottling
{
/**
* Run the login throttling middleware.
*
* We're verifying that the user is not attempting to brute force Cachet's
* login system. If the user has reached the rate limit, then we're sending
* them away, otherwise, we do nothing, and allow them to continue.
*
* Note that this filter is not responsible for incrementing the hit count.
* Another part of Cachet will increment the hit count for the given route
* only if validation passes, and the user did not successfully login.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle($request, Closure $next)
{
if (!Throttle::check($request, 10, 10)) {
return Redirect::back()->with('error', 'You have made too many login requests.');
}
return $next($request);
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -11,7 +11,6 @@
namespace CachetHQ\Cachet\Http\Middleware;
use CachetHQ\Cachet\Facades\Setting;
use Closure;
use Illuminate\Support\Facades\Redirect;
@@ -27,11 +26,7 @@ class SubscribersConfigured
*/
public function handle($request, Closure $next)
{
$isEnabled = Setting::get('enable_subscribers', false);
$mailAddress = env('MAIL_ADDRESS', false);
$mailFrom = env('MAIL_NAME', false);
if (!($isEnabled && $mailAddress && $mailFrom)) {
if (!subscribers_enabled()) {
return Redirect::route('status-page');
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -121,6 +121,22 @@ class AdminRoutes
$router->delete('{incident_template}/delete', 'IncidentController@deleteTemplateAction');
});
// Subscribers
$router->group(['prefix' => 'subscribers'], function ($router) {
$router->get('/', [
'as' => 'dashboard.subscribers',
'uses' => 'SubscriberController@showSubscribers',
]);
$router->get('add', [
'as' => 'dashboard.subscribers.add',
'uses' => 'SubscriberController@showAddSubscriber',
]);
$router->post('add', 'SubscriberController@createSubscriberAction');
$router->delete('{subscriber}/delete', 'SubscriberController@deleteSubscriberAction');
});
// Metrics
$router->group(['prefix' => 'metrics'], function ($router) {
$router->get('/', [

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -45,10 +45,13 @@ class ApiRoutes
// Api protected
$router->group(['middleware' => 'auth.api'], function ($router) {
$router->get('subscribers', 'SubscriberController@getSubscribers');
$router->post('components', 'ComponentController@postComponents');
$router->post('incidents', 'IncidentController@postIncidents');
$router->post('metrics', 'MetricController@postMetrics');
$router->post('metrics/{metric}/points', 'MetricPointController@postMetricPoints');
$router->post('subscribers', 'SubscriberController@postSubscribers');
$router->put('components/{component}', 'ComponentController@putComponent');
$router->put('incidents/{incident}', 'IncidentController@putIncident');
@@ -59,6 +62,7 @@ class ApiRoutes
$router->delete('incidents/{incident}', 'IncidentController@deleteIncident');
$router->delete('metrics/{metric}', 'MetricController@deleteMetric');
$router->delete('metrics/{metric}/points/{metric_point}', 'MetricPointController@deleteMetricPoint');
$router->delete('subscribers/{subscriber}', 'SubscriberController@deleteSubscriber');
});
});
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -32,8 +32,8 @@ class AuthRoutes
]);
$router->post('login', [
'middleware' => ['guest', 'csrf', 'login.throttling'],
'as' => 'logout',
'middleware' => ['guest', 'csrf', 'throttling:10,10'],
'as' => 'login',
'uses' => 'AuthController@postLogin',
]);

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -31,25 +31,6 @@ class StatusPageRoutes
$router->get('/atom/{component_group?}', 'AtomController@feedAction');
$router->get('/rss/{component_group?}', 'RssController@feedAction');
$router->group(['middleware' => 'app.subscribers'], function ($router) {
$router->get('subscribe', [
'as' => 'subscribe-page',
'uses' => 'SubscribeController@showSubscribe',
]);
$router->post('subscribe', [
'as' => 'subscribe',
'uses' => 'SubscribeController@postSubscribe',
]);
$router->get('subscribe/verify/{code}', [
'as' => 'subscribe-verify',
'uses' => 'SubscribeController@getVerify',
]);
$router->get('unsubscribe/{code}', [
'as' => 'unsubscribe',
'uses' => 'SubscribeController@getUnsubscribe',
]);
});
});
}
}

View File

@@ -0,0 +1,49 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Http\Routes;
use Illuminate\Contracts\Routing\Registrar;
class SubscribeRoutes
{
/**
* Define the subscribe routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*/
public function map(Registrar $router)
{
$router->group(['middleware' => 'app.hasSetting', 'setting' => 'app_name'], function ($router) {
$router->group(['middleware' => 'app.subscribers'], function ($router) {
$router->get('subscribe', [
'as' => 'subscribe-page',
'uses' => 'SubscribeController@showSubscribe',
]);
$router->post('subscribe', [
'as' => 'subscribe',
'uses' => 'SubscribeController@postSubscribe',
]);
$router->get('subscribe/verify/{code}', [
'as' => 'subscribe-verify',
'uses' => 'SubscribeController@getVerify',
]);
$router->get('unsubscribe/{code}', [
'as' => 'unsubscribe',
'uses' => 'SubscribeController@getUnsubscribe',
]);
});
});
}
}

View File

@@ -3,15 +3,13 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use CachetHQ\Cachet\Facades\Setting;
use CachetHQ\Segment\Facades\Segment;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Request;
use Jenssegers\Date\Date;
@@ -32,113 +30,12 @@ if (!function_exists('set_active')) {
$classes[] = $active;
}
$class = implode(' ', $classes);
$class = e(implode(' ', $classes));
return empty($classes) ? '' : "class=\"{$class}\"";
}
}
if (!function_exists('segment_identify')) {
/**
* Identifies the user for Segment.com.
*
* @return bool
*/
function segment_identify()
{
if (Config::get('segment.write_key')) {
try {
if (Setting::get('app_track')) {
return Segment::identify([
'anonymousId' => Config::get('app.key'),
'context' => [
'locale' => Config::get('app.locale'),
'timezone' => Setting::get('app_timezone'),
'DB_DRIVER' => getenv('DB_DRIVER'),
'CACHE_DRIVER' => getenv('CACHE_DRIVER'),
'SESSION_DRIVER' => getenv('SESSION_DRIVER'),
],
]);
} else {
return false;
}
} catch (QueryException $e) {
return false;
}
}
}
}
if (!function_exists('segment_track')) {
/**
* Tracks events in Segment.com.
*
* @param string $event
* @param array $properties
*
* @return bool
*/
function segment_track($event, array $properties = [])
{
if (Config::get('segment.write_key')) {
try {
if (Setting::get('app_track')) {
return Segment::track([
'anonymousId' => Config::get('app.key'),
'event' => $event,
'properties' => $properties,
'context' => [
'locale' => Config::get('app.locale'),
'timezone' => Setting::get('app_timezone'),
'DB_DRIVER' => getenv('DB_DRIVER'),
'CACHE_DRIVER' => getenv('CACHE_DRIVER'),
'SESSION_DRIVER' => getenv('SESSION_DRIVER'),
],
]);
} else {
return false;
}
} catch (QueryException $e) {
return false;
}
}
}
}
if (!function_exists('segment_page')) {
/**
* Tracks pages in Segment.com.
*
* @param string $page
*
* @return bool
*/
function segment_page($page)
{
if (Config::get('segment.write_key')) {
try {
if (Setting::get('app_track')) {
return Segment::page([
'anonymousId' => Config::get('app.key'),
'name' => $page,
'context' => [
'locale' => Config::get('app.locale'),
'timezone' => Setting::get('app_timezone'),
'DB_DRIVER' => getenv('DB_DRIVER'),
'CACHE_DRIVER' => getenv('CACHE_DRIVER'),
'SESSION_DRIVER' => getenv('SESSION_DRIVER'),
],
]);
} else {
return false;
}
} catch (QueryException $e) {
return false;
}
}
}
}
if (!function_exists('formatted_date')) {
/**
* Formats a date with the user timezone and the selected format.
@@ -154,3 +51,19 @@ if (!function_exists('formatted_date')) {
return (new Date($date))->format($dateFormat);
}
}
if (!function_exists('subscribers_enabled')) {
/**
* Is the subscriber functionality enabled and configured.
*
* @return bool
*/
function subscribers_enabled()
{
$isEnabled = Setting::get('enable_subscribers', false);
$mailAddress = env('MAIL_ADDRESS', false);
$mailFrom = env('MAIL_NAME', false);
return $isEnabled && $mailAddress && $mailFrom;
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -141,7 +141,7 @@ class Incident extends Model implements HasPresenter
*/
public function getIsScheduledAttribute()
{
return $this->getOriginal('scheduled_at');
return $this->getOriginal('scheduled_at') !== null;
}
/**

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -59,6 +59,13 @@ class Metric extends Model implements HasPresenter
*/
protected $fillable = ['name', 'suffix', 'description', 'display_chart', 'default_value', 'calc_type'];
/**
* The relations to eager load on every query.
*
* @var string[]
*/
protected $with = ['points'];
/**
* Metrics contain many metric points.
*

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -11,13 +11,14 @@
namespace CachetHQ\Cachet\Models;
use CachetHQ\Cachet\Presenters\SubscriberPresenter;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use McCool\LaravelAutoPresenter\HasPresenter;
use Watson\Validating\ValidatingTrait;
class Subscriber extends Model
class Subscriber extends Model implements HasPresenter
{
use SoftDeletes, ValidatingTrait;
use ValidatingTrait;
/**
* The validation rules.
@@ -40,7 +41,17 @@ class Subscriber extends Model
*
* @var array
*/
protected $dates = ['deleted_at', 'verified_at'];
protected $dates = ['verified_at'];
/**
* The attributes that should be casted to native types.
*
* @var string[]
*/
protected $casts = [
'email' => 'string',
'verify_code' => 'string',
];
/**
* Overrides the models boot method.
@@ -75,4 +86,14 @@ class Subscriber extends Model
{
return str_random(42);
}
/**
* Get the presenter class.
*
* @return string
*/
public function getPresenterClass()
{
return SubscriberPresenter::class;
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -25,8 +25,9 @@ class ComponentPresenter extends AbstractPresenter
public function toArray()
{
return array_merge($this->wrappedObject->toArray(), [
'created_at' => $this->created_at(),
'updated_at' => $this->updated_at(),
'created_at' => $this->created_at(),
'updated_at' => $this->updated_at(),
'status_name' => $this->wrappedObject->humanStatus,
]);
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -129,6 +129,34 @@ class IncidentPresenter extends AbstractPresenter
return $this->wrappedObject->scheduled_at->setTimezone($this->setting->get('app_timezone'))->format('d/m/Y H:i');
}
/**
* Returns a formatted timestamp for use within the timeline.
*
* @return string
*/
public function timestamp_formatted()
{
if ($this->wrappedObject->is_scheduled) {
return $this->scheduled_at_formatted;
} else {
return $this->created_at_formatted;
}
}
/**
* Return the iso timestamp for use within the timeline.
*
* @return string
*/
public function timestamp_iso()
{
if ($this->wrappedObject->is_scheduled) {
return $this->scheduled_at_iso;
} else {
return $this->created_at_iso;
}
}
/**
* Present the status with an icon.
*

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -0,0 +1,33 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Presenters;
use CachetHQ\Cachet\Presenters\Traits\TimestampsTrait;
class SubscriberPresenter extends AbstractPresenter
{
use TimestampsTrait;
/**
* Convert the presenter instance to an array.
*
* @return string[]
*/
public function toArray()
{
return array_merge($this->wrappedObject->toArray(), [
'created_at' => $this->created_at(),
'updated_at' => $this->updated_at(),
'verified_at' => $this->verified_at(),
]);
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -47,4 +47,15 @@ trait TimestampsTrait
return (new Date($this->wrappedObject->deleted_at))
->setTimezone($this->setting->get('app_timezone'))->toDateTimeString();
}
/**
* Present formatted date time.
*
* @return string
*/
public function verified_at()
{
return (new Date($this->wrappedObject->verified_at))
->setTimezone($this->setting->get('app_timezone'))->toDateTimeString();
}
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -31,12 +31,6 @@ class ConfigServiceProvider extends ServiceProvider
$appDomain = Setting::get('app_domain');
$appLocale = Setting::get('app_locale');
// Set the Segment.com settings.
if (Setting::get('app_track')) {
$segmentRepository = $this->app->make('CachetHQ\Cachet\Segment\RepositoryInterface');
$this->app->config->set('segment.write_key', $segmentRepository->fetch());
}
// Setup Cors.
$allowedOrigins = $this->app->config->get('cors.defaults.allowedOrigins');
$allowedOrigins[] = Setting::get('app_domain');

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -49,6 +49,7 @@ class RouteServiceProvider extends ServiceProvider
$this->app->router->model('metric', 'CachetHQ\Cachet\Models\Metric');
$this->app->router->model('metric_point', 'CachetHQ\Cachet\Models\MetricPoint');
$this->app->router->model('setting', 'CachetHQ\Cachet\Models\Setting');
$this->app->router->model('subscriber', 'CachetHQ\Cachet\Models\Subscriber');
$this->app->router->model('user', 'CachetHQ\Cachet\Models\User');
}

View File

@@ -1,34 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Providers;
use CachetHQ\Cachet\Segment\CacheRepository;
use CachetHQ\Cachet\Segment\HttpRepository;
use GuzzleHttp\Client;
use Illuminate\Support\ServiceProvider;
class SegmentServiceProvider extends ServiceProvider
{
/**
* Register the service provider.
*/
public function register()
{
$this->app->singleton('CachetHQ\Cachet\Segment\RepositoryInterface', function () {
$url = 'https://gist.githubusercontent.com/jbrooksuk/5de24bc1cf90fb1a3d57/raw/cachet.json';
$guzzleClient = new Client();
$client = new HttpRepository($guzzleClient, $url);
return new CacheRepository($client);
});
}
}

View File

@@ -1,74 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Segment;
use CachetHQ\Cachet\Facades\Setting;
use CachetHQ\Cachet\Models\Setting as SettingModel;
use Carbon\Carbon;
use Illuminate\Database\QueryException;
class CacheRepository implements RepositoryInterface
{
/**
* The underlying segment repository instance.
*
* @var \CachetHQ\Cachet\Segment\RepositoryInterface
*/
protected $repository;
/**
* Create a new segment cache repository instance.
*
* @param \CachetHQ\Cachet\Segment\RepositoryInterface $repository
*/
public function __construct(RepositoryInterface $repository)
{
$this->repository = $repository;
}
/**
* Returns the segment write key.
*
* @return string
*/
public function fetch()
{
$writeKey = null;
try {
// Firstly, does the setting exist?
if (null === ($writeKey = Setting::get('segment_write_key'))) {
// No, let's go fetch it.
$writeKey = $this->repository->fetch();
Setting::set('segment_write_key', $writeKey);
} else {
// It does, but how old is it?
$setting = SettingModel::where('name', 'segment_write_key')->first();
// It's older than an hour, let's refresh
if ($setting->updated_at->lt(Carbon::now()->subHour())) {
$writeKey = $this->repository->fetch();
// Update the setting. This is done manual to make sure updated_at is overwritten.
$setting->value = $writeKey;
$setting->updated_at = Carbon::now();
$setting->save();
}
}
} catch (QueryException $e) {
// Just return it until we're setup.
$writeKey = $this->repository->fetch();
}
return $writeKey;
}
}

View File

@@ -1,57 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Segment;
use GuzzleHttp\ClientInterface;
class HttpRepository implements RepositoryInterface
{
/**
* The guzzle client instance.
*
* @var \GuzzleHttp\ClientInterface
*/
protected $client;
/**
* The url to use.
*
* @var string
*/
protected $url;
/**
* Create a new segment http repository instance.
*
* @param \GuzzleHttp\ClientInterface $client
* @param string $url
*/
public function __construct(ClientInterface $client, $url)
{
$this->client = $client;
$this->url = $url;
}
/**
* Returns the segment write key.
*
* @return string
*/
public function fetch()
{
$response = $this->client->get($this->url);
$body = json_decode($response->getBody());
return $body->segment_write_key;
}
}

View File

@@ -1,22 +0,0 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Cachet\Segment;
interface RepositoryInterface
{
/**
* Returns the segment write key.
*
* @return string
*/
public function fetch();
}

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Cachet.
*
* (c) Cachet HQ <support@cachethq.io>
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.

0
bootstrap/cache/.gitignore vendored Normal file → Executable file
View File

View File

@@ -7,38 +7,39 @@
"authors": [
{
"name": "James Brooks",
"email": "james@cachethq.io"
"email": "james@alt-three.com"
},
{
"name": "Graham Campbell",
"email": "graham@cachethq.io"
"email": "graham@alt-three.com"
},
{
"name": "Joseph Cohen",
"email": "joe@cachethq.io"
"email": "joe@alt-three.com"
}
],
"require": {
"php": "^5.5.9",
"laravel/framework": "~5.1.3",
"cachethq/segment": "^2.1",
"laravel/framework": "~5.1.16",
"alt-three/emoji": "^1.2",
"barryvdh/laravel-cors": "^0.5",
"doctrine/dbal": "^2.5",
"fideloper/proxy": "^3.0",
"graham-campbell/binput": "^3.1",
"graham-campbell/markdown": "^3.1",
"graham-campbell/throttle": "^4.0",
"graham-campbell/exceptions": "^3.0",
"guzzlehttp/guzzle": "^6.0",
"graham-campbell/binput": "^3.2",
"graham-campbell/markdown": "^4.0",
"graham-campbell/throttle": "^4.1",
"graham-campbell/exceptions": "^4.0",
"guzzlehttp/guzzle": "^6.0.2",
"jenssegers/date": "^3.0",
"mccool/laravel-auto-presenter": "^3.0",
"mccool/laravel-auto-presenter": "^3.1",
"pragmarx/google2fa": "^0.5",
"roumen/feed": "^2.9",
"watson/validating": "^1.0",
"barryvdh/laravel-cors": "^0.5"
"watson/validating": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^4.6",
"fzaninotto/faker": "^1.5"
"fzaninotto/faker": "^1.5",
"mockery/mockery": "^0.9.4",
"phpunit/phpunit": "^4.7.6"
},
"autoload": {
"classmap": [
@@ -57,16 +58,22 @@
}
},
"scripts": {
"pre-install-cmd": [
"rm -f compiled.php config.php routes.php services.json"
],
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize",
"php artisan optimize --force",
"php artisan config:cache",
"php artisan route:cache",
"chmod -R 755 storage"
],
"pre-update-cmd": [
"php artisan clear-compiled"
"rm -f compiled.php config.php routes.php services.json"
],
"post-update-cmd": [
"php artisan optimize",
"php artisan optimize --force",
"php artisan config:cache",
"php artisan route:cache",
"chmod -R 755 storage"
],
"post-create-project-cmd": [
@@ -79,7 +86,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "1.2-dev"
}
},
"minimum-stability": "dev",

961
composer.lock generated

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More