From 3680e04817480e0e007797f30973e402eefa70f5 Mon Sep 17 00:00:00 2001 From: akemidx Date: Mon, 18 Mar 2024 18:29:59 -0400 Subject: [PATCH 1/7] migration to set legacy locations to an standardized format --- ...4_03_18_221612_update_legacy_locations.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 database/migrations/2024_03_18_221612_update_legacy_locations.php diff --git a/database/migrations/2024_03_18_221612_update_legacy_locations.php b/database/migrations/2024_03_18_221612_update_legacy_locations.php new file mode 100644 index 000000000..718022abd --- /dev/null +++ b/database/migrations/2024_03_18_221612_update_legacy_locations.php @@ -0,0 +1,36 @@ +string('locale', 5)->nullable()->default(config('app.fallback_locale'))->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + Schema::table('users', function (Blueprint $table) { + // + $table->string('locale', 10)->nullable()->default(config('app.locale'))->change(); + }); + } +} From dc297176232f3374db27ff852d3696480f1d74b2 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 19 Mar 2024 15:51:05 -0400 Subject: [PATCH 2/7] fixing default --- .../migrations/2024_03_18_221612_update_legacy_locations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2024_03_18_221612_update_legacy_locations.php b/database/migrations/2024_03_18_221612_update_legacy_locations.php index 718022abd..82cbc2745 100644 --- a/database/migrations/2024_03_18_221612_update_legacy_locations.php +++ b/database/migrations/2024_03_18_221612_update_legacy_locations.php @@ -16,7 +16,7 @@ class UpdateLegacyLocations extends Migration // Schema::table('users', function (Blueprint $table) { // - $table->string('locale', 5)->nullable()->default(config('app.fallback_locale'))->change(); + $table->string('locale', 10)->nullable()->default('en-US')->change(); }); } From 8640cad0333ca3d4c140d36076e73439ae44baf0 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 19 Mar 2024 16:11:32 -0400 Subject: [PATCH 3/7] was using lcoations and not locale. fixed --- ...locations.php => 2024_03_18_221612_update_legacy_locale.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename database/migrations/{2024_03_18_221612_update_legacy_locations.php => 2024_03_18_221612_update_legacy_locale.php} (94%) diff --git a/database/migrations/2024_03_18_221612_update_legacy_locations.php b/database/migrations/2024_03_18_221612_update_legacy_locale.php similarity index 94% rename from database/migrations/2024_03_18_221612_update_legacy_locations.php rename to database/migrations/2024_03_18_221612_update_legacy_locale.php index 82cbc2745..5e86bacca 100644 --- a/database/migrations/2024_03_18_221612_update_legacy_locations.php +++ b/database/migrations/2024_03_18_221612_update_legacy_locale.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class UpdateLegacyLocations extends Migration +class UpdateLegacyLocale extends Migration { /** * Run the migrations. From b124b9af4d8a2e68851fde9f3b48f4a760e039b9 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 26 Mar 2024 16:50:39 -0400 Subject: [PATCH 4/7] adding in change to settings table --- .../2024_03_18_221612_update_legacy_locale.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/database/migrations/2024_03_18_221612_update_legacy_locale.php b/database/migrations/2024_03_18_221612_update_legacy_locale.php index 5e86bacca..dc81207b1 100644 --- a/database/migrations/2024_03_18_221612_update_legacy_locale.php +++ b/database/migrations/2024_03_18_221612_update_legacy_locale.php @@ -18,6 +18,13 @@ class UpdateLegacyLocale extends Migration // $table->string('locale', 10)->nullable()->default('en-US')->change(); }); + + Schema::table('settings', function (Blueprint $table) { + // + $table->string('locale', 10)->nullable()->default('en-US')->change(); + }); + + } /** @@ -32,5 +39,9 @@ class UpdateLegacyLocale extends Migration // $table->string('locale', 10)->nullable()->default(config('app.locale'))->change(); }); + Schema::table('settings', function (Blueprint $table) { + // + $table->string('locale', 10)->nullable()->default(config('app.locale'))->change(); + }); } } From b45de3e17f46154601232f07558a5386d72231aa Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 28 Mar 2024 17:41:46 +0000 Subject: [PATCH 5/7] Update README.md Added alert notations --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d237a6856..6fcba1cf6 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,9 @@ For help using Snipe-IT, check out the [user's manual](https://snipe-it.readme.i Feel free to check out the [GitHub Issues for this project](https://github.com/snipe/snipe-it/issues) to open a bug report or see what open issues you can help with. Please search through existing issues (open *and* closed) to see if your question has already been answered before opening a new issue. -**PLEASE see the [Getting Help Guidelines](https://snipe-it.readme.io/docs/getting-help) and [Common Issues](https://snipe-it.readme.io/docs/common-issues) before opening a ticket, and be sure to complete all of the questions in the Github Issue template to help us to help you as quickly as possible.** - +> [!IMPORTANT] +> **PLEASE see the [Getting Help Guidelines](https://snipe-it.readme.io/docs/getting-help) and [Common Issues](https://snipe-it.readme.io/docs/common-issues) before opening a ticket, and be sure to complete all of the questions in the Github Issue template to help us to help you as quickly as possible.** +> ----- ### Upgrading @@ -57,6 +58,9 @@ Please see the [translations documentation](https://snipe-it.readme.io/docs/tran Since the release of the JSON REST API, several third-party developers have been developing modules and libraries to work with Snipe-IT. +> [!NOTE] +> As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :) + - [Python Module](https://github.com/jbloomer/SnipeIT-PythonAPI) by [@jbloomer](https://github.com/jbloomer) - [SnipeSharp - .NET module in C#](https://github.com/barrycarey/SnipeSharp) by [@barrycarey](https://github.com/barrycarey) - [InQRy -unmaintained-](https://github.com/Microsoft/InQRy) by [@Microsoft](https://github.com/Microsoft) @@ -73,8 +77,6 @@ Since the release of the JSON REST API, several third-party developers have been - [UniFi to Snipe-IT](https://github.com/RodneyLeeBrands/UnifiSnipeSync) by [@karpadiem](https://github.com/karpadiem) - Python script that synchronizes UniFi devices with Snipe-IT. - [Kandji2Snipe](https://github.com/grokability/kandji2snipe) by [@briangoldstein](https://github.com/briangoldstein) - Python script that synchronizes Kandji with Snipe-IT. - [SnipeAgent](https://github.com/ReticentRobot/SnipeAgent) by @ReticentRobot - Windows agent for Snipe-IT - -As these were created by third-parties, Snipe-IT cannot provide support for these project, and you should contact the developers directly if you need assistance. Additionally, Snipe-IT makes no guarantees as to the reliability, accuracy or maintainability of these libraries. Use at your own risk. :) ----- @@ -92,4 +94,5 @@ The ERD is available [online here](https://drawsql.app/templates/snipe-it). ### Security -To report a security vulnerability, please email security@snipeitapp.com instead of using the issue tracker. +> [!IMPORTANT] +> **To report a security vulnerability, please email security@snipeitapp.com instead of using the issue tracker.** From 2b4886f37fe1458fe9b33a6c093d1f3b3a2a0a97 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 28 Mar 2024 17:43:18 +0000 Subject: [PATCH 6/7] Commented out Heroic deploy for now --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6fcba1cf6..b271d88c2 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ It is built on [Laravel 8](http://laravel.com). Snipe-IT is actively developed and we [release quite frequently](https://github.com/snipe/snipe-it/releases). ([Check out the live demo here](https://snipeitapp.com/demo/).) -__This is web-based software__. This means there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows, and we have a [Docker image](https://snipe-it.readme.io/docs/docker) available if that's what you're into. +> [!TIP] +> __This is web-based software__. This means there is no executable file (aka no .exe files), and it must be run on a web server and accessed through a web browser. It runs on any Mac OSX, flavor of Linux, as well as Windows, and we have a [Docker image](https://snipe-it.readme.io/docs/docker) available if that's what you're into. ----- @@ -21,7 +22,7 @@ For instructions on installing and configuring Snipe-IT on your server, check ou If you're having trouble with the installation, please check the [Common Issues](https://snipe-it.readme.io/docs/common-issues) and [Getting Help](https://snipe-it.readme.io/docs/getting-help) documentation, and search this repository's open *and* closed issues for help. -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) + ----- ### User's Manual From f42e5d5292869e9d457a355fbd1db7dbe1d8c29e Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 28 Mar 2024 21:58:49 +0000 Subject: [PATCH 7/7] Reverting the store/update asset API responses for now This currently breaks the Jamf integration - need a better longer term plan. Signed-off-by: snipe --- app/Http/Controllers/Api/AssetsController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 2ac2df3da..92f1038cb 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -619,6 +619,8 @@ class AssetsController extends Controller $asset->image = $asset->getImageUrl(); } + return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.create.success'))); + return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset), trans('admin/hardware/message.create.success'))); } @@ -707,6 +709,7 @@ class AssetsController extends Controller $asset->image = $asset->getImageUrl(); } + return response()->json(Helper::formatStandardApiResponse('success', $asset, trans('admin/hardware/message.update.success'))); return response()->json(Helper::formatStandardApiResponse('success', (new AssetsTransformer)->transformAsset($asset), trans('admin/hardware/message.update.success'))); }