Difference between revisions of "IGNFileFormat"

From The Battle for Wesnoth Wiki
m (How does this work?: Typo)
(Default blacklist is used for access to all files)
 
(14 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== .ign files ==
+
__NOTOC__
 +
When you upload an add-on, some files and directories are ignored and not uploaded.
  
=== What is an .ign file? ===
+
If you would prefer to have more control over which files and directories should be ignored, you should provide a <b>_server.ign</b> file containing a list of filter patterns. Each file or directory matching any entry of the _server.ign file will not be included when uploaded to the add-ons server.
When you upload an addon, some files/directory are ignored and not uploaded.
 
If you want to configure more closely which files/directories should be ignored, you need an .ign file.
 
  
=== What goes into an .ign file? ===
+
{{DevFeature1.13|12}} The engine blocks WML and Lua from accessing any file that matches the built-in list. This was added as a security feature to block access to .git directories, disregards any _server.ign file, and is likely to change during the 1.19 dev cycle (see discussion in [https://github.com/wesnoth/wesnoth/pull/9325 PR 9325]).
The file format is one entry per line.
 
* ''*'' and ''?'' wildcards are supported (? mean any character, * mean any number of any character)
 
* Directories are identified by a trailing ''/''
 
  
=== Where do I put the .ign file? ===
+
== Where do I put the file, and what goes in it? ==
2 Solutions :
 
* put ''campaignname''.ign next to the ''campaignname''.pbl and ''campaignname''.cfg (old style)
 
* put a _server.ign next into the campaign directory (new style)
 
  
=== How does this work? ===
+
The file should be placed within the root level of your add-on (<i>data/add-ons/addon_name/_server.ign</i>).
If there is no file, the default filter as of Wesnoth 1.10 is:
 
  
  .*
+
A specific format is required:
  .*/
+
 
  __MACOSX
+
* {{DevFeature1.13|0}}: Blank lines and lines beginning with '<code># </code>' (space required) are ignored.
 +
* Each line should contain exactly one pattern.
 +
* <code>*</code> and <code>?</code> wildcards are supported (<code>?</code> stands for any single character, <code>*</code> stands for any number of any characters).
 +
* {{DevFeature1.13|12}}: <code>+</code> wildcards are also supported: it stands for one or more characters.
 +
* Patterns with a trailing forward slash '<code>/</code>' will match directories; the rest only match files.
 +
 
 +
==== Default values ====
 +
 
 +
If there is no custom _server.ign file present, a default filter will be used instead, which is as follows:
 +
 
 +
  .+
 +
  .+/
 +
  __MACOSX/
 
  #*#
 
  #*#
 
  *~
 
  *~
Line 37: Line 41:
 
  *.vbs
 
  *.vbs
 
  *.o
 
  *.o
 +
*.ini  {{DevFeature1.13|12}}
 
  Thumbs.db
 
  Thumbs.db
 
  *.wesnoth
 
  *.wesnoth
 
  *.project
 
  *.project
  
If there is an .ign file the filter is the content of the file. Each file or directory matching any entry of the .ign file will not be uploaded to the add-ons server.
+
If you create a custom _server.ign, you should add these entries to it.
 +
 
 +
== See Also ==
 +
 
 +
* [[PblWML]]
  
 
[[Category:Create]]
 
[[Category:Create]]

Latest revision as of 09:48, 14 September 2024

When you upload an add-on, some files and directories are ignored and not uploaded.

If you would prefer to have more control over which files and directories should be ignored, you should provide a _server.ign file containing a list of filter patterns. Each file or directory matching any entry of the _server.ign file will not be included when uploaded to the add-ons server.

(Version 1.13.12 and later only) The engine blocks WML and Lua from accessing any file that matches the built-in list. This was added as a security feature to block access to .git directories, disregards any _server.ign file, and is likely to change during the 1.19 dev cycle (see discussion in PR 9325).

Where do I put the file, and what goes in it?

The file should be placed within the root level of your add-on (data/add-ons/addon_name/_server.ign).

A specific format is required:

  • (Version 1.13.0 and later only): Blank lines and lines beginning with '# ' (space required) are ignored.
  • Each line should contain exactly one pattern.
  • * and ? wildcards are supported (? stands for any single character, * stands for any number of any characters).
  • (Version 1.13.12 and later only): + wildcards are also supported: it stands for one or more characters.
  • Patterns with a trailing forward slash '/' will match directories; the rest only match files.

Default values

If there is no custom _server.ign file present, a default filter will be used instead, which is as follows:

.+
.+/
__MACOSX/
#*#
*~
*-bak
*.swp
*.pbl
*.ign
_info.cfg
*.exe
*.bat
*.cmd
*.com
*.scr
*.sh
*.js
*.vbs
*.o
*.ini  (Version 1.13.12 and later only)
Thumbs.db
*.wesnoth
*.project

If you create a custom _server.ign, you should add these entries to it.

See Also

This page was last edited on 14 September 2024, at 09:48.