* Change regex and the error message
* few changes see ^^^ GH comment
if it doesn't pass the RegEx `[a-zA-Z0-9_\.]*` then:
- if on Linux and contains a "-" anywhere, not allowed
- if it contains a space or starts with a "-", not allowed
- if the top two don't trigger, then `confirm()` with the user.
* black why
* 3.3.9
* fk
* ty aika
* review :aha:
* oopsie
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* this is just vexed tries and jack fixes
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* quite sad really
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* passing loop to certain things was deprecated. additionally, `asyncio.get_event_loop()` is being deprecated
* awesome, checks are functioning as intended
* fun with fixtures
* we can just stop misuing that anyhow
* Update redbot/pytest/downloader.py
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* Be quieter in expected cases
* lets put this in the log file
* inline description use because setuptools entrypoint scripts are dumb
* Another setuptools entrypoint related issue
* maybe don't crash the bot on tasks
* improve the handling a bit more + document some of the lower level bits from the perspective of 'why?'
* Adding myself to codeowners on this one
* Let's not clobber our exit code
* And, there we go
* finish that thought
* right, I bumped the python version for (part of) this
* Update redbot/__main__.py
Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
* Okay, we should be good now
* correct exit code enum use
* cosmetic
* minor fix for linux and ctrl+c
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
* enhance(setup): use instance name in default data path
* chore(changelog): add towncrier entries
* enhance(setup): tell user that instance name is case-sensitive
- ``redbot-setup delete`` no longer errors about "unexpected keyword argument" (fix#2955)
- ``redbot-setup delete`` no longer prompts about backup when user passes ``--no-prompt`` option (fix#2956)
- ``--[no-]backup``, ``--[no-]drop-db`` and ``--[no-]remove-datapath`` in ``redbot-setup delete`` command are now on/off flags. ``--no-prompt`` was changed to flag too, but it doesn't have ``--prompt`` equivalent as there's no much point in having it
- ``redbot-setup`` now uses `click.confirm` for confirmation prompts and thy now also have default values for user convenience
* PostgreSQL driver and general drivers cleanup
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Make tests pass
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Add black --target-version flag in make.bat
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Rewrite postgres driver
Most of the logic is now in PL/pgSQL.
This completely avoids the use of Python f-strings to format identifiers into queries. Although an SQL-injection attack would have been impossible anyway (only the owner would have ever had the ability to do that), using PostgreSQL's format() is more reliable for unusual identifiers. Performance-wise, I'm not sure whether this is an improvement, but I highly doubt that it's worse.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Reformat
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix PostgresDriver.delete_all_data()
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Clean up PL/pgSQL code
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* More PL/pgSQL cleanup
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* PL/pgSQL function optimisations
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Ensure compatibility with PostgreSQL 10 and below
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* More/better docstrings for PG functions
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix typo in docstring
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Return correct value on toggle()
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Use composite type for PG function parameters
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix JSON driver's Config.clear_all()
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Correct description for Mongo tox recipe
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Fix linting errors
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Update dep specification after merging bumpdeps
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Add towncrier entries
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Update from merge
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Mention [postgres] extra in install docs
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Support more connection options and use better defaults
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Actually pass PG env vars in tox
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Replace event trigger with manual DELETE queries
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
Loading repos is already done in initialize() method.
This could actually turn out badly
if both
of git processes would touch the same repo at the same time.
This also fixes create_backup in
setup.py - now it properly generates repos.json
* same stuff, but with some more spurious error supression
* fix issue in permissions found in this
* fix a few more spurious errors
* fix another issue
* semi-spurious error fixes
* .
* formatting
* move this to properly log
* distutils import + virtualenv
* more fixes
* swap to click for setup
* Initial changes
* expose some stuff to allow for per-driver optimizations
* overwrite base config
* add red log
* add one print juuuust in case
* fix this
* thanks kowlin
* damn
* oops
* fix thing
* partial commit
* Working mongo -> json conversion, it sucks tho
* remove unused line
* Wrote initial optimized json importer
* optimized json importer
* remove useless line
* update mongo to json converter
* lets try writing the correct entry
* oops
* style fix
* add some garbage data filters going from old mongo to json
* ignore garbage data in mongov2 conversions
* simplify code a bit and add a completion message
* missed one
* Update pipfile lock
* Lock click version
* modify config to use identifier data class and update json driver
* move identifier data attributes into read only properties
* Update mongo get and set methods
* Update get/set to use UUID separately, make clear work
* Remove not implemented and fix get_raw
* Update remaining untouched get/set/clear
* Fix get_raw
* Finally fix get_raw and set_raw
* style
* This is better
* Sorry guys
* Update get behavior to handle "all" calls as expected
* style again
* Why do you do this to me
* style once more
* Update mongo schema
* [V3 Core] Enhance [p]backup to exclude some files
* Backup the repo list too
* Lol Sinbad's pre-commit hook
* Add option of sending the backup to the owner via DM
* Drop an unnecessary config object in RepoManager
* Move the backup functionality in redbot-setup to the new stuff
* More work on implementation, including backing up the instance data
* [V3 Launcher] Reinstall Red option
* [V3 Setup] Divided remove_instance function
* Removing changes from another PR
* Indent fails fix
* use remove_instance_interaction for --delete
* Fix some issues with remove_instance
removed `index: int` because what's being passed there is a string
data -> instance_data
* bug fixes, working version
* [V3 Instance setup] import backup support for instances using Mongo
* remove_instance is now a coroutine + remove NIE
* move Mongo import down
* move another import
* [V3 Instance Setup] start work on storage swapping
* This should do the trick for Mongo -> JSON
* Fix typo
* Fix a few more typos
* resolve the data path
* Upsert the imported data
* need a list of the documents
* to_list is a coro
* For Linux service users,
use `appdirs.AppDirs().site_data_dir`
instead of `appdirs.AppDirs().user_config_dir
* somewhat important for this to be changed consistently
* need to import os to use it
* travis doesn't like how I was checking in config_dir had been set.
* Basic Mongo Driver
* Update docstrings
* WIP motor support
* Use motor
* Update docs, add selective importer
* Make use of selective importer
* Fix docs
* Fix config storage location for JSON
* Add delimiters in the drivers doc section
* Make async things async
* Add basic config information for mongo driver
* get info from basic setup into config
* IT WORKS
* Add dependency for RJM's PR.
Ya'll are gonna hate me.
* Initial modifications
* Add initial setup.py
* working setup py help
* Modify setup file to package stuff
* Move a bunch of shit and fix imports
* Fix or skip tests
* Must add init files for find_packages to work
* Move main to scripts folder and rename
* Add shebangs
* Copy over translation files
* WORKING PIP INSTALL
* add dependency information
* Hardcoded version for now, will need to figure out a better way to do this
* OKAY ITS FINALLY FUCKING WORKING
* Add this guy
* Fix stuff
* Change readme to rst
* Remove double sentry opt in
* Oopsie
* Fix this thing
* Aaaand fix test
* Aaaand fix test
* Fix core cog importing and default cog install path
* Adjust readme
* change instance name from optional to required
* Ayyy let's do more dependency injection