diff --git a/.env b/.env index b78dffa..5f3ee44 100644 --- a/.env +++ b/.env @@ -1,44 +1,45 @@ -APP_NAME="LittleLink Custom" -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL= +#App Settings=Changes settings regarding your LittleLink Custom installation. You probably only want to change the App Name setting. +#=App_Name changes the displayed name for the App in the title, for example. +App_Name="LittleLink Custom" +App_Key=base64:khLI7djHyA97qfrA+rfz1YUFukELiN6Bk9gQ19+9zwk= +App_URL= -LOG_CHANNEL=stack -LOG_LEVEL=debug -DB_CONNECTION=sqlite +#Debug Settings=Changes if your page should display a full error description instead of a generic error 500 +#=App_debug either true or false. You might want to change this to false after you're done installing, but it's very useful for troubleshooting. +App_debug=true +#=App_env either local or production. Change this to production if you set the value above to false +App_env=local +Log_channel=stack +Log_level=debug -BROADCAST_DRIVER=log -CACHE_DRIVER=file -QUEUE_CONNECTION=sync -SESSION_DRIVER=file -SESSION_LIFETIME=120 -MEMCACHED_HOST=127.0.0.1 +#Database Settings=Should be left alone. If you wish to use mysql you'd have to seed the database again. +DB_connection=sqlite -REDIS_HOST=127.0.0.1 -REDIS_PASSWORD=null -REDIS_PORT=6379 -MAIL_MAILER=smtp -MAIL_HOST=mailhog -MAIL_PORT=1025 -MAIL_USERNAME=null -MAIL_PASSWORD=null -MAIL_ENCRYPTION=null -MAIL_FROM_ADDRESS=null -MAIL_FROM_NAME="${APP_NAME}" +#Mail Settings=LittleLink Custom comes with a free to use built-in SMTP server for sending mail. You can leave this setting as is, if you wish to use this service please read our terms and conditions at llc-mail.tru.io. If you do not wish to use the built-in SMTP server, change the setting below +#=Mail_mailer either smtp or built-in. Make sure to change this setting if you want to add a custom SMTP server. +Mail_mailer=built-in +Mail_host= +Mail_port= +Mail_username= +Mail_password= +Mail_encryption= +Mail_from_address= +Mail_from_name="${app_name}" -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= -AWS_DEFAULT_REGION=us-east-1 -AWS_BUCKET= -PUSHER_APP_ID= -PUSHER_APP_KEY= -PUSHER_APP_SECRET= -PUSHER_APP_CLUSTER=mt1 +#Cache Settings=Completely optional +Memcached_host=127.0.0.1 +Redis_host=127.0.0.1 +Redis_password=null +Redis_port=6379 -MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" -MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + +#Miscellaneous Settings=Should be left alone if you don't know what you're doing. +Broadcast_driver=log +Cache_driver=file +Queue_connection=sync +Session_driver=file +Session_lifetime=120 \ No newline at end of file diff --git a/composer.json b/composer.json index 6c36ebc..ce1227d 100755 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ "php": "^7.3|^8.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", + "geo-sot/laravel-env-editor": "^1.1", "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^8.12", "laravel/tinker": "^2.5" @@ -58,4 +59,3 @@ "minimum-stability": "dev", "prefer-stable": true } - diff --git a/composer.lock b/composer.lock index 31b888f..8ecc3cd 100755 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0ad35353a22e3d26fcc6897fcc5dc893", + "content-hash": "90a7893b152b65a22c6ed40595cd35c0", "packages": [ { "name": "asm89/stack-cors", @@ -557,6 +557,68 @@ ], "time": "2021-04-26T11:24:25+00:00" }, + { + "name": "geo-sot/laravel-env-editor", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/GeoSot/Laravel-EnvEditor.git", + "reference": "d519594fcbc5dd9d35d47d56a96aae17f12c685f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GeoSot/Laravel-EnvEditor/zipball/d519594fcbc5dd9d35d47d56a96aae17f12c685f", + "reference": "d519594fcbc5dd9d35d47d56a96aae17f12c685f", + "shasum": "" + }, + "require": { + "laravel/framework": ">=8", + "php": ">=7.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.4", + "nunomaduro/larastan": "^1.0", + "orchestra/testbench": "^6" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "GeoSot\\EnvEditor\\ServiceProvider" + ], + "aliases": { + "EnvEditor": "GeoSot\\EnvEditor\\Facades\\EnvEditor" + } + } + }, + "autoload": { + "psr-4": { + "GeoSot\\EnvEditor\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Geo Sot", + "email": "geo.sotis@gmail.com" + } + ], + "description": "A laravel Package that supports .Env File, editing and backup ", + "keywords": [ + "EnvEditor", + "geo-sot", + "laravel", + "laravel-env-editor" + ], + "support": { + "issues": "https://github.com/GeoSot/Laravel-EnvEditor/issues", + "source": "https://github.com/GeoSot/Laravel-EnvEditor/tree/v1.1.0" + }, + "time": "2022-01-25T17:13:30+00:00" + }, { "name": "graham-campbell/result-type", "version": "v1.0.1", @@ -7457,5 +7519,5 @@ "php": "^7.3|^8.0" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.2.0" } diff --git a/config/env-editor.php b/config/env-editor.php new file mode 100644 index 0000000..e56a16c --- /dev/null +++ b/config/env-editor.php @@ -0,0 +1,46 @@ + [ + // .env file directory + 'env' => base_path(), + //backup files directory + 'backupDirectory' => 'backups', + ], + // .env file name + 'envFileName' => '.env', + + /* + |-------------------------------------------------------------------------- + | Routes group config + |-------------------------------------------------------------------------- + | + */ + 'route' => [ + // Prefix url for route Group + 'prefix' => 'env-editor', + // Routes base name + 'name' => 'env-editor', + // Middleware(s) applied on route Group + 'middleware' => ['web', 'admin'], + ], + + /* ------------------------------------------------------------------------------------------------ + | Time Format for Views and parsed backups + | ------------------------------------------------------------------------------------------------ + */ + 'timeFormat' => 'd/m/Y H:i:s', + + /* ------------------------------------------------------------------------------------------------ + | Set Views options + | ------------------------------------------------------------------------------------------------ + | Here you can set The "extends" blade of index.blade.php + */ + 'layout' => 'env-editor::layout', + +]; diff --git a/resources/lang/vendor/env-editor/en/env-editor.php b/resources/lang/vendor/env-editor/en/env-editor.php new file mode 100644 index 0000000..1c5e86b --- /dev/null +++ b/resources/lang/vendor/env-editor/en/env-editor.php @@ -0,0 +1,89 @@ + '.env Editor', + 'controllerMessages' => [ + 'backupWasCreated' => 'A new backup was created', + 'fileWasRestored' => 'The backup file ":name", was restored as default .env', + 'fileWasDeleted' => 'The backup file ":name", was deleted', + 'currentEnvWasReplacedByTheUploadedFile' => 'File was uploaded and become the new .env file', + 'uploadedFileSavedAsBackup' => 'File was uploaded as backup with the name ":name"', + 'keyWasAdded' => 'Key ":name" was added', + 'keyWasEdited' => 'Key ":name" has ben updated', + 'keyWasDeleted' => 'Key ":name" was Deleted', + ], + 'views' => [ + 'tabTitles' => [ + 'upload' => 'Upload', + 'backup' => 'Backups', + 'currentEnv' => 'Current .env', + ], + 'currentEnv' => [ + 'title' => 'Current .env file Content', + 'tableTitles' => [ + 'key' => 'Key', + 'value' => 'Value', + 'actions' => 'Actions', + ], + 'btn' => [ + 'edit' => 'Edit File', + 'delete' => 'Delete Key', + 'addAfterKey' => 'Add new key after this key', + 'addNewKey' => 'Add New key', + 'deleteConfigCache' => 'Clear config cache', + 'deleteConfigCacheDesc' => 'On production environments changed values may not applied immediately cause of cached config. So you may try to un-cache it', + ], + 'modal' => [ + 'title' => [ + 'new' => 'New Key', + 'edit' => 'Edit Key', + 'delete' => 'Delete Key', + ], + 'input' => [ + 'key' => 'Key', + 'value' => 'Value', + ], + 'btn' => [ + 'close' => 'Close', + 'new' => 'Add Key', + 'edit' => 'Update Key', + 'delete' => 'Delete Key', + ], + ], + + ], + 'upload' => [ + 'title' => 'Here You can upload a new ".env" file as a backup or to replace the current ".env"', + 'selectFilePrompt' => 'Select File', + 'btn' => [ + 'clearFile' => 'Cancel', + 'uploadAsBackup' => 'Upload as backup', + 'uploadAndReplace' => 'Upload and replace current .env', + ], + ], + 'backup' => [ + 'title' => 'Here you can see a list of saved backup files (if you have), you can create a new one, or download the .env file', + 'tableTitles' => [ + 'filename' => 'File Name', + 'created_at' => 'Creation Date', + 'actions' => 'Actions', + ], + 'noBackUpItems' => 'There are no backups on your chosen directory.
You can make your first backup by pressing the "Get a new BackUp" button', + 'btn' => [ + 'backUpCurrentEnv' => 'Get a new BackUp', + 'downloadCurrentEnv' => 'Download current .env', + 'download' => 'Download File', + 'delete' => 'Delete File', + 'restore' => 'Restore File', + 'viewContent' => 'View file Contents', + ], + ], + ], + 'exceptions' => [ + 'fileNotExists' => 'File ":name" does not Exists !!!', + 'keyAlreadyExists' => 'Key ":name" already Exists !!!', + 'keyNotExists' => 'Key ":name" does not Exists !!!', + 'provideFileName' => 'You have to provide a FileName !!!', + ], + +]; diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index ae22dc8..dc7832d 100755 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -74,6 +74,9 @@