diff --git a/config.go b/config.go index fbd480a..7c6e429 100644 --- a/config.go +++ b/config.go @@ -47,6 +47,7 @@ type config struct { WalletPass string `long:"walletpass" ini-name:"walletpass" description:"Password for dcrwallet RPC connections."` WalletCert string `long:"walletcert" ini-name:"walletcert" description:"The dcrwallet RPC certificate file."` WebServerDebug bool `long:"webserverdebug" ini-name:"webserverdebug" description:"Enable web server debug mode (verbose logging to terminal and live-reloading templates)."` + SupportEmail string `long:"supportemail" ini-name:"supportemail" description:"Email address for users in need of support."` dbPath string netParams *netParams @@ -240,6 +241,11 @@ func loadConfig() (*config, error) { cfg.netParams = &simNetParams } + // Ensure the support email address is set. + if cfg.SupportEmail == "" { + return nil, errors.New("the supportemail option is not set") + } + // Ensure the dcrd RPC username is set. if cfg.DcrdUser == "" { return nil, errors.New("the dcrduser option is not set") diff --git a/go.sum b/go.sum index 3270595..cff4165 100644 --- a/go.sum +++ b/go.sum @@ -5,11 +5,14 @@ decred.org/dcrwallet v1.2.3-0.20200519180100-f1aa4c354e05/go.mod h1:V6pzOHJuuWZa github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dchest/siphash v1.2.1 h1:4cLinnzVJDKxTCl9B01807Yiy+W7ZzVHj/KIroQRvT4= github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= @@ -22,11 +25,13 @@ github.com/decred/dcrd/blockchain/stake/v3 v3.0.0-20200215031403-6b2ce76f0986/go github.com/decred/dcrd/blockchain/stake/v3 v3.0.0-20200311044114-143c1884e4c8/go.mod h1:4zE60yDWlfCDtmqnyP5o1k1K0oyhNn3Tvqo6F93/+RU= github.com/decred/dcrd/blockchain/stake/v3 v3.0.0-20200527025017-6fc98347d984 h1:M1riYBPET8iUKQ0RyJuVS9TofzVPzQhYPOwb14YL9T8= github.com/decred/dcrd/blockchain/stake/v3 v3.0.0-20200527025017-6fc98347d984/go.mod h1:4zE60yDWlfCDtmqnyP5o1k1K0oyhNn3Tvqo6F93/+RU= +github.com/decred/dcrd/blockchain/standalone v1.1.0 h1:yclvVGEY09Gf8A4GSAo+NCtL1dW2TYJ4OKp4+g0ICI0= github.com/decred/dcrd/blockchain/standalone v1.1.0/go.mod h1:6K8ZgzlWM1Kz2TwXbrtiAvfvIwfAmlzrtpA7CVPCUPE= github.com/decred/dcrd/blockchain/v3 v3.0.0-20200311044114-143c1884e4c8/go.mod h1:R9rIXU8kEJVC9Z4LAlh9bo9hiT3a+ihys3mCrz4PVao= github.com/decred/dcrd/certgen v1.1.0/go.mod h1:ivkPLChfjdAgFh7ZQOtl6kJRqVkfrCq67dlq3AbZBQE= github.com/decred/dcrd/chaincfg/chainhash v1.0.2 h1:rt5Vlq/jM3ZawwiacWjPa+smINyLRN07EO0cNBV6DGU= github.com/decred/dcrd/chaincfg/chainhash v1.0.2/go.mod h1:BpbrGgrPTr3YJYRN3Bm+D9NuaFd+zGyNeIKgrhCXK60= +github.com/decred/dcrd/chaincfg/v2 v2.3.0 h1:ItmU+7DeUtyiabrcW+16MJFgY/BBeeYaPfkBLrFLyjo= github.com/decred/dcrd/chaincfg/v2 v2.3.0/go.mod h1:7qUJTvn+y/kswSRZ4sT2+EmvlDTDyy2InvNFtX/hxk0= github.com/decred/dcrd/chaincfg/v3 v3.0.0-20200214194519-928737b3e580/go.mod h1:v4oyBPQ/ZstYCV7+B0y6HogFByW76xTjr+72fOm66Y8= github.com/decred/dcrd/chaincfg/v3 v3.0.0-20200215015031-3283587e6add/go.mod h1:v4oyBPQ/ZstYCV7+B0y6HogFByW76xTjr+72fOm66Y8= @@ -46,6 +51,7 @@ github.com/decred/dcrd/dcrec v1.0.0 h1:W+z6Es+Rai3MXYVoPAxYr5U1DGis0Co33scJ6uH2J github.com/decred/dcrd/dcrec v1.0.0/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0 h1:E5KszxGgpjpmW8vN811G6rBAZg0/S/DftdGqN4FW5x4= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= +github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0 h1:3GIJYXQDAKpLEFriGFN8SbSffak10UXHGdIcFaMPykY= github.com/decred/dcrd/dcrec/secp256k1/v2 v2.0.0/go.mod h1:3s92l0paYkZoIHuj4X93Teg/HB7eGM9x/zokGw+u4mY= github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200214194519-928737b3e580/go.mod h1:Ej0/gOv8NpFfaczyXGndw7eRMJFVhmY2faSeyxztSUw= github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200215015031-3283587e6add/go.mod h1:Ej0/gOv8NpFfaczyXGndw7eRMJFVhmY2faSeyxztSUw= @@ -55,6 +61,7 @@ github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200421213827-b60c60ffe98b h1: github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.0-20200421213827-b60c60ffe98b/go.mod h1:J70FGZSbzsjecRTiTzER+3f1KZLNaXkuv+yeFTKoxM8= github.com/decred/dcrd/dcrjson/v3 v3.0.1 h1:b9cpplNJG+nutE2jS8K/BtSGIJihEQHhFjFAsvJF/iI= github.com/decred/dcrd/dcrjson/v3 v3.0.1/go.mod h1:fnTHev/ABGp8IxFudDhjGi9ghLiXRff1qZz/wvq12Mg= +github.com/decred/dcrd/dcrutil/v2 v2.0.1 h1:aL+c7o7Q66HV1gIif+XkNYo9DeorN3l01Vns8mh0mqs= github.com/decred/dcrd/dcrutil/v2 v2.0.1/go.mod h1:JdEgF6eh0TTohPeiqDxqDSikTSvAczq0J7tFMyyeD+k= github.com/decred/dcrd/dcrutil/v3 v3.0.0-20200215015031-3283587e6add/go.mod h1:CibwaHcCfz1sedFseBYKt+1hSbqnWC4Oe95DM8dAOlA= github.com/decred/dcrd/dcrutil/v3 v3.0.0-20200215023918-6247af01d5e3/go.mod h1:48ZLpNNrRIYfqYxmvzMgOZrnTZUU3aTJveWtamCkOxo= @@ -84,11 +91,13 @@ github.com/decred/slog v1.0.0 h1:Dl+W8O6/JH6n2xIFN2p3DNjCmjYwvrXsjlSJTQQ4MhE= github.com/decred/slog v1.0.0/go.mod h1:zR98rEZHSnbZ4WHZtO0iqmSZjDLKhkXfrPTZQKtAonQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= @@ -106,6 +115,7 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -116,19 +126,26 @@ github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlT github.com/jrick/wsrpc/v2 v2.3.2/go.mod h1:XPYs8BnRWl99lCvXRM5SLpZmTPqWpSOPkDIqYTwDPfU= github.com/jrick/wsrpc/v2 v2.3.3 h1:cGM2YUPrG8crjXFWw3b6IMcwqYHJMkteLqEb/WlDSP4= github.com/jrick/wsrpc/v2 v2.3.3/go.mod h1:XPYs8BnRWl99lCvXRM5SLpZmTPqWpSOPkDIqYTwDPfU= +github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.1 h1:PZSj/UFNaVp3KxrzHOcS7oyuWA7LoOY/77yCTEFu21U= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= @@ -149,6 +166,7 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 h1:fHDIZ2oxGnUZRN6WgWFCbYBjH9uqVPRCUVUDhs0wnbA= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -164,6 +182,7 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -179,8 +198,11 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/main.go b/main.go index 6642660..540e69d 100644 --- a/main.go +++ b/main.go @@ -116,6 +116,7 @@ func run(ctx context.Context) error { VSPFee: cfg.VSPFee, NetParams: cfg.netParams.Params, FeeAddressExpiration: defaultFeeAddressExpiration, + SupportEmail: cfg.SupportEmail, } err = webapi.Start(ctx, shutdownRequestChannel, &shutdownWg, cfg.Listen, db, dcrdConnect, walletConnect, cfg.WebServerDebug, cfg.FeeXPub, apiCfg) diff --git a/webapi/public/css/fonts.css b/webapi/public/css/fonts.css new file mode 100644 index 0000000..ae2c71c --- /dev/null +++ b/webapi/public/css/fonts.css @@ -0,0 +1,63 @@ +@font-face { + font-family: "vspd-code"; + src: + url("/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf.woff2") format("woff2"), + url("/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf.woff") format("woff"), + url("/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf") format("truetype"), + url("/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.eot") format("embedded-opentype"); + font-display: swap; +} + +@font-face { + font-family: "vspd"; + src: + url("/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf.woff2") format("woff2"), + url("/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf.woff") format("woff"), + url("/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf") format("truetype"), + url("/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.eot") format("embedded-opentype"); + font-display: swap; +} + +@font-face { + font-family: "vspd"; + src: + url("/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf.woff2") format("woff2"), + url("/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf.woff") format("woff"), + url("/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf") format("truetype"), + url("/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.eot") format("embedded-opentype"); + font-weight: bold; + font-display: swap; +} + +@font-face { + font-family: "vspd"; + src: + url("/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf.woff2") format("woff2"), + url("/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf.woff") format("woff"), + url("/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf") format("truetype"), + url("/public/css/fonts/SourceSansPro-It/SourceSansPro-It.eot") format("embedded-opentype"); + font-style: italic; + font-display: swap; +} + +@font-face { + font-family: "vspd"; + src: + url("/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf.woff2") format("woff2"), + url("/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf.woff") format("woff"), + url("/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf") format("truetype"), + url("/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.eot") format("embedded-opentype"); + font-style: italic; + font-weight: bold; + font-display: swap; +} + +html, body { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: "vspd", "Verdana", "sans-serif" !important; +} + +pre, code { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: "vspd-code", "Courier New", "monospace" !important; +} diff --git a/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.eot b/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.eot new file mode 100644 index 0000000..09e9473 Binary files /dev/null and b/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.eot differ diff --git a/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf b/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf new file mode 100644 index 0000000..b2cff92 Binary files /dev/null and b/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf differ diff --git a/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf.woff b/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf.woff new file mode 100644 index 0000000..0af792a Binary files /dev/null and b/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf.woff differ diff --git a/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf.woff2 b/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf.woff2 new file mode 100644 index 0000000..18d2199 Binary files /dev/null and b/webapi/public/css/fonts/SourceCodePro-Regular/SourceCodePro-Regular.ttf.woff2 differ diff --git a/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.eot b/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.eot new file mode 100644 index 0000000..55ad856 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.eot differ diff --git a/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf b/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf new file mode 100644 index 0000000..82e8762 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf differ diff --git a/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf.woff b/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf.woff new file mode 100644 index 0000000..4d54bc9 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf.woff differ diff --git a/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf.woff2 b/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf.woff2 new file mode 100644 index 0000000..a008526 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-It/SourceSansPro-It.ttf.woff2 differ diff --git a/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.eot b/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.eot new file mode 100644 index 0000000..ba7f8d9 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.eot differ diff --git a/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf b/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf new file mode 100644 index 0000000..278ad8a Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf differ diff --git a/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf.woff b/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf.woff new file mode 100644 index 0000000..460ab12 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf.woff differ diff --git a/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf.woff2 b/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf.woff2 new file mode 100644 index 0000000..0dd3464 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-Regular/SourceSansPro-Regular.ttf.woff2 differ diff --git a/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.eot b/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.eot new file mode 100644 index 0000000..2f7a52c Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.eot differ diff --git a/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf b/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf new file mode 100644 index 0000000..ac3e0d1 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf differ diff --git a/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf.woff b/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf.woff new file mode 100644 index 0000000..4337963 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf.woff differ diff --git a/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf.woff2 b/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf.woff2 new file mode 100644 index 0000000..2526d2e Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-Semibold/SourceSansPro-Semibold.ttf.woff2 differ diff --git a/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.eot b/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.eot new file mode 100644 index 0000000..d8504fe Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.eot differ diff --git a/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf b/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf new file mode 100644 index 0000000..b0737bb Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf differ diff --git a/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf.woff b/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf.woff new file mode 100644 index 0000000..232c204 Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf.woff differ diff --git a/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf.woff2 b/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf.woff2 new file mode 100644 index 0000000..606935a Binary files /dev/null and b/webapi/public/css/fonts/SourceSansPro-SemiboldIt/SourceSansPro-SemiboldIt.ttf.woff2 differ diff --git a/webapi/public/images/favicon/apple-touch-icon-114x114.png b/webapi/public/images/favicon/apple-touch-icon-114x114.png new file mode 100644 index 0000000..e1288b3 Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-114x114.png differ diff --git a/webapi/public/images/favicon/apple-touch-icon-120x120.png b/webapi/public/images/favicon/apple-touch-icon-120x120.png new file mode 100644 index 0000000..d5c6bf7 Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-120x120.png differ diff --git a/webapi/public/images/favicon/apple-touch-icon-144x144.png b/webapi/public/images/favicon/apple-touch-icon-144x144.png new file mode 100644 index 0000000..3be6c4b Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-144x144.png differ diff --git a/webapi/public/images/favicon/apple-touch-icon-152x152.png b/webapi/public/images/favicon/apple-touch-icon-152x152.png new file mode 100644 index 0000000..801832b Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-152x152.png differ diff --git a/webapi/public/images/favicon/apple-touch-icon-180x180.png b/webapi/public/images/favicon/apple-touch-icon-180x180.png new file mode 100644 index 0000000..14192bf Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-180x180.png differ diff --git a/webapi/public/images/favicon/apple-touch-icon-57x57.png b/webapi/public/images/favicon/apple-touch-icon-57x57.png new file mode 100644 index 0000000..060b4bb Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-57x57.png differ diff --git a/webapi/public/images/favicon/apple-touch-icon-60x60.png b/webapi/public/images/favicon/apple-touch-icon-60x60.png new file mode 100644 index 0000000..82bccf2 Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-60x60.png differ diff --git a/webapi/public/images/favicon/apple-touch-icon-72x72.png b/webapi/public/images/favicon/apple-touch-icon-72x72.png new file mode 100644 index 0000000..510765c Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-72x72.png differ diff --git a/webapi/public/images/favicon/apple-touch-icon-76x76.png b/webapi/public/images/favicon/apple-touch-icon-76x76.png new file mode 100644 index 0000000..472f5b4 Binary files /dev/null and b/webapi/public/images/favicon/apple-touch-icon-76x76.png differ diff --git a/webapi/public/images/favicon/browserconfig.xml b/webapi/public/images/favicon/browserconfig.xml new file mode 100644 index 0000000..84beb59 --- /dev/null +++ b/webapi/public/images/favicon/browserconfig.xml @@ -0,0 +1,12 @@ + + + + + + + + + #091440 + + + diff --git a/webapi/public/images/favicon/favicon-16x16.png b/webapi/public/images/favicon/favicon-16x16.png new file mode 100644 index 0000000..3164e04 Binary files /dev/null and b/webapi/public/images/favicon/favicon-16x16.png differ diff --git a/webapi/public/images/favicon/favicon-32x32.png b/webapi/public/images/favicon/favicon-32x32.png new file mode 100644 index 0000000..c198a64 Binary files /dev/null and b/webapi/public/images/favicon/favicon-32x32.png differ diff --git a/webapi/public/images/favicon/favicon.ico b/webapi/public/images/favicon/favicon.ico new file mode 100644 index 0000000..5ecdd5e Binary files /dev/null and b/webapi/public/images/favicon/favicon.ico differ diff --git a/webapi/public/images/favicon/ic_launcher_hdpi.png b/webapi/public/images/favicon/ic_launcher_hdpi.png new file mode 100644 index 0000000..0288fb8 Binary files /dev/null and b/webapi/public/images/favicon/ic_launcher_hdpi.png differ diff --git a/webapi/public/images/favicon/ic_launcher_mdpi.png b/webapi/public/images/favicon/ic_launcher_mdpi.png new file mode 100644 index 0000000..5502a35 Binary files /dev/null and b/webapi/public/images/favicon/ic_launcher_mdpi.png differ diff --git a/webapi/public/images/favicon/ic_launcher_xhdpi.png b/webapi/public/images/favicon/ic_launcher_xhdpi.png new file mode 100644 index 0000000..531c198 Binary files /dev/null and b/webapi/public/images/favicon/ic_launcher_xhdpi.png differ diff --git a/webapi/public/images/favicon/ic_launcher_xxhdpi.png b/webapi/public/images/favicon/ic_launcher_xxhdpi.png new file mode 100644 index 0000000..7b39c79 Binary files /dev/null and b/webapi/public/images/favicon/ic_launcher_xxhdpi.png differ diff --git a/webapi/public/images/favicon/ic_launcher_xxxhdpi.png b/webapi/public/images/favicon/ic_launcher_xxxhdpi.png new file mode 100644 index 0000000..043cf2c Binary files /dev/null and b/webapi/public/images/favicon/ic_launcher_xxxhdpi.png differ diff --git a/webapi/public/images/favicon/manifest.json b/webapi/public/images/favicon/manifest.json new file mode 100644 index 0000000..ccb8d31 --- /dev/null +++ b/webapi/public/images/favicon/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "Decred", + "short_name": "Decred", + "icons": [ + { + "src": "/public/images/favicon/ic_launcher_mdpi.png?v=vMddPLeYWy", + "sizes": "48x48", + "type": "image/png" + }, + { + "src": "/public/images/favicon/ic_launcher_hdpi.png?v=vMddPLeYWy", + "sizes": "72x72", + "type": "image/png" + }, + { + "src": "/public/images/favicon/ic_launcher_xhdpi.png?v=vMddPLeYWy", + "sizes": "96x96", + "type": "image/png" + }, + { + "src": "/public/images/favicon/ic_launcher_xxhdpi.png?v=vMddPLeYWy", + "sizes": "144x144", + "type": "image/png" + }, + { + "src": "/public/images/favicon/ic_launcher_xxxhdpi.png?v=vMddPLeYWy", + "sizes": "192x192", + "type": "image/png" + } + ], + "theme_color": "#091440", + "background_color": "#091440", + "start_url": "/", + "display": "browser" +} diff --git a/webapi/public/images/favicon/mstile-144x144.png b/webapi/public/images/favicon/mstile-144x144.png new file mode 100644 index 0000000..5c80aa2 Binary files /dev/null and b/webapi/public/images/favicon/mstile-144x144.png differ diff --git a/webapi/public/images/favicon/mstile-150x150.png b/webapi/public/images/favicon/mstile-150x150.png new file mode 100644 index 0000000..61469fd Binary files /dev/null and b/webapi/public/images/favicon/mstile-150x150.png differ diff --git a/webapi/public/images/favicon/mstile-310x150.png b/webapi/public/images/favicon/mstile-310x150.png new file mode 100644 index 0000000..86a62ce Binary files /dev/null and b/webapi/public/images/favicon/mstile-310x150.png differ diff --git a/webapi/public/images/favicon/mstile-310x310.png b/webapi/public/images/favicon/mstile-310x310.png new file mode 100644 index 0000000..6493a1b Binary files /dev/null and b/webapi/public/images/favicon/mstile-310x310.png differ diff --git a/webapi/public/images/favicon/mstile-70x70.png b/webapi/public/images/favicon/mstile-70x70.png new file mode 100644 index 0000000..4e9cd66 Binary files /dev/null and b/webapi/public/images/favicon/mstile-70x70.png differ diff --git a/webapi/public/images/favicon/safari-pinned-tab.svg b/webapi/public/images/favicon/safari-pinned-tab.svg new file mode 100644 index 0000000..8c114d2 --- /dev/null +++ b/webapi/public/images/favicon/safari-pinned-tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webapi/templates/homepage.html b/webapi/templates/homepage.html index 47caa4c..be2054d 100644 --- a/webapi/templates/homepage.html +++ b/webapi/templates/homepage.html @@ -1,21 +1,53 @@ - + - - - + + dcrwages + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -

{{ .Message }}

+ +
Total tickets:{{ .TotalTickets }}
FeePaid tickets:{{ .FeePaidTickets }}
VSP Fee:{{ .VSPFee }}
Network:{{ .Network }}
Support:{{ .SupportEmail }}
Pubkey:{{ printf "%x" .PubKey }}

Last updated: {{.UpdateTime}}

diff --git a/webapi/webapi.go b/webapi/webapi.go index 29d7f4e..9dc6dc3 100644 --- a/webapi/webapi.go +++ b/webapi/webapi.go @@ -23,6 +23,7 @@ type Config struct { NetParams *chaincfg.Params FeeAccountName string FeeAddressExpiration time.Duration + SupportEmail string } const ( @@ -33,7 +34,17 @@ const ( relayFee = 0.0001 ) -var homepageData *gin.H +type vspStats struct { + PubKey []byte + TotalTickets int + FeePaidTickets int + VSPFee float64 + Network string + UpdateTime string + SupportEmail string +} + +var stats *vspStats var cfg Config var db *database.VspDatabase @@ -55,7 +66,7 @@ func Start(ctx context.Context, requestShutdownChan chan struct{}, shutdownWg *s } // Populate template data before starting webserver. - homepageData, err = updateHomepageData(vdb, config) + stats, err = updateVSPStats(vdb, config) if err != nil { return fmt.Errorf("could not initialize homepage data: %v", err) } @@ -132,7 +143,7 @@ func Start(ctx context.Context, requestShutdownChan chan struct{}, shutdownWg *s shutdownWg.Done() return case <-ticker.C: - homepageData, err = updateHomepageData(db, cfg) + stats, err = updateVSPStats(db, cfg) if err != nil { log.Errorf("Failed to update homepage data: %v", err) } @@ -195,23 +206,24 @@ func router(debugMode bool) *gin.Engine { return router } -func updateHomepageData(db *database.VspDatabase, cfg Config) (*gin.H, error) { +func updateVSPStats(db *database.VspDatabase, cfg Config) (*vspStats, error) { total, feePaid, err := db.CountTickets() if err != nil { return nil, err } - return &gin.H{ - "Message": "Welcome to dcrvsp!", - "TotalTickets": total, - "FeePaidTickets": feePaid, - "VSPFee": cfg.VSPFee, - "Network": cfg.NetParams.Name, - "UpdateTime": time.Now().Format("Mon Jan _2 15:04:05 2006"), + return &vspStats{ + PubKey: signPubKey, + TotalTickets: total, + FeePaidTickets: feePaid, + VSPFee: cfg.VSPFee, + Network: cfg.NetParams.Name, + UpdateTime: time.Now().Format("Mon Jan _2 15:04:05 2006"), + SupportEmail: cfg.SupportEmail, }, nil } func homepage(c *gin.Context) { - c.HTML(http.StatusOK, "homepage.html", homepageData) + c.HTML(http.StatusOK, "homepage.html", stats) } func sendJSONResponse(resp interface{}, c *gin.Context) {