Commit Graph

44 Commits

Author SHA1 Message Date
Matthew Penner
be543ce3e0
parser(ini): allow setting the section name
In an egg replacer putting `[]` will cause it to not be split at the first dot.

Before this change putting `"find": { "/Script/Engine.GameSession.MaxPlayers": "<DATA>" }`
would make the section name `/Script/Engine` and the key `GameSession.MaxPlayers`.  After
this change, the same behavior occurs, but if you wrap the key in `[]` it will set the
section name properly, for example `"find": { "[/Script/Engine.GameSession].MaxPlayers": "<DATA>" }`
would make the sesion name `/Script/Engine.GameSession` and the key `MaxPlayers`.

Closes https://github.com/pterodactyl/panel/issues/2533
2021-11-04 13:24:12 -06:00
Matthew Penner
d4a8f25cc6
parser: bug fixes (#102)
* parser: remove unnecessary type convertions
* parser: properly pass number and boolean values
* parser: set values if they don't exist
2021-08-24 17:05:02 -06:00
Matthew Penner
3c54c1f840 break everything
- upgrade dependencies
- run gofmt and goimports to organize code
- fix typos
- other small tweaks
2021-08-02 15:07:00 -06:00
Dane Everitt
8dfd494eaf Better explain what is happening in this file 2021-04-03 14:16:00 -07:00
Dane Everitt
2e0496c1f9 Add note about handling of UTF-8 sequences in properties files. 2021-04-03 14:02:37 -07:00
Dane Everitt
f85ee1aa73 cleanup 2021-04-03 13:20:07 -07:00
Jakob Schrettenbrunner
648072436f organize imports with gopls format 2021-01-10 01:22:39 +00:00
Matthew Penner
a4c8b8714b Bump all dependencies 2020-12-27 11:49:08 -07:00
Dane Everitt
59a111de39
Invite our lord and savior emperror back to the table 2020-12-15 21:56:53 -08:00
Matthew Penner
de51fd1c51
Error handling improvements (#71)
* Remove `emperror.dev/errors`, remove all `errors#Wrap` and `errors#WithStack` calls
* Improve logging in `server/backup.go`
2020-11-28 16:57:10 -07:00
Dane Everitt
be9d1a3986
Replace error handling package with emperror; add better reporting for errors escaping server root 2020-11-08 13:52:20 -08:00
Dane Everitt
f67889c2ca
Remove unused code 2020-11-01 13:17:17 -08:00
Dane Everitt
7f4771068f
Code cleanup 2020-10-11 15:27:27 -07:00
Michael Parker
4c9aaeb769
fix file parsing
resolves #2393

loads, edits, and re-writes the file instead of inline edits that seem to break.

This inefficient but it works in my testing.
2020-10-07 18:41:05 -04:00
Dane Everitt
a20861fa8e
Write newline when editing files using the text parser; closes pterodactyl/panel#2393 2020-09-26 16:12:21 -07:00
Dane Everitt
f0a4efb242
Attempt to create directory structure for config file if missing 2020-09-22 21:01:50 -07:00
Dane Everitt
342c3ea565
Do not panic if there is no text on the line; closes pterodactyl/panel#2369 2020-09-22 21:01:32 -07:00
Dane Everitt
cff705f807
Support arrays within JSON and YAML documents better; closes pterodactyl/panel#1992 2020-09-09 20:27:41 -07:00
Dane Everitt
c19fc25882
Try to parse arrays more correctly; not quite working just yet but the concept seems to work 2020-09-07 17:27:23 -07:00
Dane Everitt
fff9a89ebb
Correctly detect not exist error 2020-09-07 15:57:11 -07:00
Matthew Penner
d50f9a83b6 Fix #2308 2020-09-05 14:50:03 -06:00
Matthew Penner
7ba32aca84 Fix some typos and run gofmt on all .go files 2020-09-05 13:08:40 -06:00
Dane Everitt
41765136c2
Don't mangle the spaces when editing properties files; closes pterodactyl/panel#2041 (again) 2020-08-06 21:10:01 -07:00
Dane Everitt
2dad3102e0
Fix saving of ini configuration files to the disk 2020-06-29 20:21:41 -07:00
Dane Everitt
b33f14ddd9
Correctly handle replacements with escaped values; closes #2041 2020-06-29 20:08:36 -07:00
Dane Everitt
198a22f446
Replace even more zap occurences 2020-06-13 10:26:35 -07:00
Dane Everitt
bd063682dc
Better match handling I think? 2020-05-17 18:22:06 -07:00
Dane Everitt
c802a3397e
Fix warnings about configuration values; should always use the snake case since we're using a marshaled value 2020-05-17 17:25:53 -07:00
Dane Everitt
64cad5c35d
Don't blow up when working with bad egg configurations; avoids boot crash; closes pterodactyl/panel#2035 2020-05-17 15:57:59 -07:00
Dane Everitt
46056dbce9
Fix truncation when saving file changes; closes pterodactyl/panel#1956 2020-04-25 13:12:17 -07:00
Dane Everitt
137b6cddae
Better parsing of regex replacements 2020-04-12 15:57:07 -07:00
Dane Everitt
9de094f078
Fix support for configuration files with more complex cases 2020-04-12 12:22:37 -07:00
Dane Everitt
a4c9562e42
Dump the actual type, not the numeric equivalent 2020-04-11 18:35:20 -07:00
Dane Everitt
21d8384848
Create the config file if it is missing for the server, then try again 2019-12-07 16:48:26 -08:00
Dane Everitt
e1435bfe8f
[#3896bk] Better support for XML documents 2019-12-01 15:40:08 -08:00
Dane Everitt
35cdff904f
[#3896bk] Support using configuration param inline with other values 2019-12-01 15:27:53 -08:00
Dane Everitt
1be21b7078
[#3896bk] Support parsing XML files 2019-12-01 15:04:03 -08:00
Dane Everitt
6e9606bc89
[#3896bk] Add support for ini file parsing 2019-12-01 12:53:47 -08:00
Dane Everitt
86b909550c
[#3896bk] Migrate helper functions out of main file for readability 2019-12-01 12:25:16 -08:00
Dane Everitt
07785194c4
[#3896bk] Ensure the data types are maintained correctly 2019-12-01 12:18:41 -08:00
Dane Everitt
1a4bdc87c9
[#3896bk] Support wildcards in yaml/json configs 2019-12-01 11:54:33 -08:00
Dane Everitt
cae0c70b0f
[#3896bk] Fix handling of YAML/JSON when parsing configuration files 2019-12-01 11:19:49 -08:00
Dane Everitt
0e51db1c03
[#3896bk] Add plaintext and basic yaml matching support 2019-11-30 22:24:44 -08:00
Dane Everitt
1003abaa63
[#3896bk] Configure base support for properties file parsing 2019-11-30 18:07:05 -08:00