Merge pull request #177 from laodc/master
Added SERVER_(SUB)VERSION to banner variables
This commit is contained in:
commit
9ec2f22306
@ -116,8 +116,10 @@ These environment variables are optional:
|
||||
You can place several meta-variables in your banner file, which will be
|
||||
replaced before serving to a client.
|
||||
|
||||
+ **$VERSION** is replaced with the ElectrumX version you are
|
||||
runnning, such as *ElectrumX 0.9.22*.
|
||||
+ **$SERVER_VERSION** is replaced with the ElectrumX version you are
|
||||
runnning, such as *1.0.10*.
|
||||
+ **$SERVER_SUBVERSION** is replaced with the ElectrumX user agent
|
||||
string. For example, `ElectrumX 1.0.10`.
|
||||
+ **$DAEMON_VERSION** is replaced with the daemon's version as a
|
||||
dot-separated string. For example *0.12.1*.
|
||||
+ **$DAEMON_SUBVERSION** is replaced with the daemon's user agent
|
||||
|
||||
@ -288,8 +288,11 @@ class ElectrumX(SessionBase):
|
||||
minor, revision = divmod(minor, 10000)
|
||||
revision //= 100
|
||||
daemon_version = '{:d}.{:d}.{:d}'.format(major, minor, revision)
|
||||
server_version = version.VERSION.split()[-1]
|
||||
for pair in [
|
||||
('$VERSION', version.VERSION),
|
||||
('$VERSION', version.VERSION), # legacy
|
||||
('$SERVER_VERSION', server_version),
|
||||
('$SERVER_SUBVERSION', version.VERSION),
|
||||
('$DAEMON_VERSION', daemon_version),
|
||||
('$DAEMON_SUBVERSION', network_info['subversion']),
|
||||
('$DONATION_ADDRESS', self.env.donation_address),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user