Drop go rice and switch to go 1.17
This commit is contained in:
1 parent
c4b4430387
commit
77d21734c3
7 files changed
+814
-439
No files matched your search
+1
-3
@@ -1,15 +1,13 @@
|
||||
# Go base image
|
||||
FROM golang:1.17-alpine as builder
|
||||
|
||||
RUN go get github.com/GeertJohan/go.rice && go get github.com/GeertJohan/go.rice/rice
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go install
|
||||
|
||||
RUN rice embed-go && go build
|
||||
RUN go build
|
||||
|
||||
FROM alpine:3.14
|
||||
|
||||
|
||||
@@ -35,11 +35,9 @@ There are no other dependencies. Simply download the binary and run it!
|
||||
|
||||
1. `$ git clone https://github.com/bumi/lnme.git && cd lnme`
|
||||
2. `$ go install`
|
||||
3. `$ rice embed-go && go build`
|
||||
3. `$ go build`
|
||||
4. `$ ./lnme`
|
||||
|
||||
Note: You must have [go.rice installed](https://github.com/GeertJohan/go.rice#installation)
|
||||
|
||||
### Running in Docker
|
||||
|
||||
LnMe is now available in docker too.
|
||||
|
||||
@@ -1,17 +1,146 @@
|
||||
// +heroku goVersion 1.15
|
||||
// +heroku goVersion 1.17
|
||||
module github.com/bumi/lnme
|
||||
|
||||
go 1.15
|
||||
go 1.17
|
||||
|
||||
// https://github.com/lightningnetwork/lnd/issues/5624#issuecomment-897512230
|
||||
replace go.etcd.io/etcd => go.etcd.io/etcd v0.5.0-alpha.5.0.20201125193152-8a03d2e9614b
|
||||
require (
|
||||
github.com/GeertJohan/go.rice v1.0.2
|
||||
github.com/cretz/bine v0.2.0
|
||||
github.com/didip/tollbooth/v6 v6.1.1
|
||||
github.com/knadh/koanf v1.2.1
|
||||
github.com/labstack/echo/v4 v4.5.0
|
||||
github.com/lightningnetwork/lnd v0.13.1-beta
|
||||
google.golang.org/grpc v1.40.0
|
||||
github.com/knadh/koanf v1.4.0
|
||||
github.com/labstack/echo/v4 v4.6.3
|
||||
github.com/lightningnetwork/lnd v0.14.1-beta
|
||||
google.golang.org/grpc v1.44.0
|
||||
gopkg.in/macaroon.v2 v2.1.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
|
||||
github.com/aead/siphash v1.0.1 // indirect
|
||||
github.com/andybalholm/brotli v1.0.3 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
github.com/btcsuite/btcd v0.22.0-beta.0.20211005184431-e3449998be39 // indirect
|
||||
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect
|
||||
github.com/btcsuite/btcutil v1.0.3-0.20210527170813-e2ba6805a890 // indirect
|
||||
github.com/btcsuite/btcutil/psbt v1.0.3-0.20210527170813-e2ba6805a890 // indirect
|
||||
github.com/btcsuite/btcwallet v0.13.0 // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txauthor v1.1.0 // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txrules v1.1.0 // indirect
|
||||
github.com/btcsuite/btcwallet/wallet/txsizes v1.1.0 // indirect
|
||||
github.com/btcsuite/btcwallet/walletdb v1.3.6-0.20210803004036-eebed51155ec // indirect
|
||||
github.com/btcsuite/btcwallet/wtxmgr v1.3.1-0.20210822222949-9b5a201c344c // indirect
|
||||
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
|
||||
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.1.1 // indirect
|
||||
github.com/coreos/go-semver v0.3.0 // indirect
|
||||
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/decred/dcrd/lru v1.0.0 // indirect
|
||||
github.com/dsnet/compress v0.0.1 // indirect
|
||||
github.com/dustin/go-humanize v1.0.0 // indirect
|
||||
github.com/fergusstrange/embedded-postgres v1.10.0 // indirect
|
||||
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
|
||||
github.com/fsnotify/fsnotify v1.4.9 // indirect
|
||||
github.com/go-errors/errors v1.0.1 // indirect
|
||||
github.com/go-pkgz/expirable-cache v0.0.3 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/btree v1.0.1 // indirect
|
||||
github.com/gorilla/websocket v1.4.2 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
|
||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 // indirect
|
||||
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
|
||||
github.com/jackc/pgconn v1.10.0 // indirect
|
||||
github.com/jackc/pgio v1.0.0 // indirect
|
||||
github.com/jackc/pgpassfile v1.0.0 // indirect
|
||||
github.com/jackc/pgproto3/v2 v2.1.1 // indirect
|
||||
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
|
||||
github.com/jackc/pgtype v1.8.1 // indirect
|
||||
github.com/jackc/pgx/v4 v4.13.0 // indirect
|
||||
github.com/jonboulle/clockwork v0.2.2 // indirect
|
||||
github.com/jrick/logrotate v1.0.0 // indirect
|
||||
github.com/json-iterator/go v1.1.11 // indirect
|
||||
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 // indirect
|
||||
github.com/kkdai/bstream v1.0.0 // indirect
|
||||
github.com/klauspost/compress v1.13.6 // indirect
|
||||
github.com/klauspost/pgzip v1.2.5 // indirect
|
||||
github.com/labstack/gommon v0.3.1 // indirect
|
||||
github.com/lib/pq v1.10.3 // indirect
|
||||
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
|
||||
github.com/lightninglabs/neutrino v0.13.0 // indirect
|
||||
github.com/lightningnetwork/lightning-onion v1.0.2-0.20210520211913-522b799e65b1 // indirect
|
||||
github.com/lightningnetwork/lnd/clock v1.1.0 // indirect
|
||||
github.com/lightningnetwork/lnd/healthcheck v1.2.0 // indirect
|
||||
github.com/lightningnetwork/lnd/kvdb v1.2.1 // indirect
|
||||
github.com/lightningnetwork/lnd/queue v1.1.0 // indirect
|
||||
github.com/lightningnetwork/lnd/ticker v1.1.0 // indirect
|
||||
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 // indirect
|
||||
github.com/mattn/go-colorable v0.1.11 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
|
||||
github.com/mholt/archiver/v3 v3.5.0 // indirect
|
||||
github.com/miekg/dns v1.1.43 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/mapstructure v1.4.1 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.1 // indirect
|
||||
github.com/nwaples/rardecode v1.1.2 // indirect
|
||||
github.com/pelletier/go-toml v1.7.0 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.8 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/prometheus/client_golang v1.11.0 // indirect
|
||||
github.com/prometheus/client_model v0.2.0 // indirect
|
||||
github.com/prometheus/common v0.26.0 // indirect
|
||||
github.com/prometheus/procfs v0.6.0 // indirect
|
||||
github.com/rogpeppe/fastuuid v1.2.0 // indirect
|
||||
github.com/sirupsen/logrus v1.7.0 // indirect
|
||||
github.com/soheilhy/cmux v0.1.5 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/stretchr/testify v1.7.0 // indirect
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
|
||||
github.com/ulikunitz/xz v0.5.10 // indirect
|
||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||
github.com/valyala/fasttemplate v1.2.1 // indirect
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
|
||||
go.etcd.io/bbolt v1.3.6 // indirect
|
||||
go.etcd.io/etcd/api/v3 v3.5.0 // indirect
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0 // indirect
|
||||
go.etcd.io/etcd/client/v2 v2.305.0 // indirect
|
||||
go.etcd.io/etcd/client/v3 v3.5.0 // indirect
|
||||
go.etcd.io/etcd/pkg/v3 v3.5.0 // indirect
|
||||
go.etcd.io/etcd/raft/v3 v3.5.0 // indirect
|
||||
go.etcd.io/etcd/server/v3 v3.5.0 // indirect
|
||||
go.opentelemetry.io/contrib v0.20.0 // indirect
|
||||
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/exporters/otlp v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/export/metric v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/sdk/metric v0.20.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v0.20.0 // indirect
|
||||
go.opentelemetry.io/proto/otlp v0.7.0 // indirect
|
||||
go.uber.org/atomic v1.7.0 // indirect
|
||||
go.uber.org/multierr v1.6.0 // indirect
|
||||
go.uber.org/zap v1.17.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
|
||||
golang.org/x/net v0.0.0-20210913180222-943fd674d43e // indirect
|
||||
golang.org/x/sys v0.0.0-20211103235746-7861aae1554b // indirect
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
|
||||
google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced // indirect
|
||||
google.golang.org/protobuf v1.26.0 // indirect
|
||||
gopkg.in/errgo.v1 v1.0.1 // indirect
|
||||
gopkg.in/macaroon-bakery.v2 v2.0.1 // indirect
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
sigs.k8s.io/yaml v1.2.0 // indirect
|
||||
)
|
||||
@@ -173,7 +173,10 @@ func NewLNDclient(lndOptions LNDoptions) (LNDclient, error) {
|
||||
if err := mac.UnmarshalBinary(macaroonData); err != nil {
|
||||
return result, err
|
||||
}
|
||||
macCred := macaroons.NewMacaroonCredential(mac)
|
||||
macCred, err := macaroons.NewMacaroonCredential(mac)
|
||||
if err != nil {
|
||||
return result, err
|
||||
}
|
||||
opts = append(opts, grpc.WithPerRPCCredentials(macCred))
|
||||
|
||||
conn, err := grpc.Dial(lndOptions.Address, opts...)
|
||||
|
||||
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"embed"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
@@ -10,7 +11,6 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
"github.com/bumi/lnme/ln"
|
||||
"github.com/bumi/lnme/lnurl"
|
||||
"github.com/didip/tollbooth/v6"
|
||||
@@ -47,6 +47,12 @@ type Invoice struct {
|
||||
Memo string `json:"memo"`
|
||||
}
|
||||
|
||||
//go:embed files/assets
|
||||
var embeddedAssets embed.FS
|
||||
|
||||
//go:embed files/root/index.html
|
||||
var indexPage string
|
||||
|
||||
func main() {
|
||||
cfg := LoadConfig()
|
||||
|
||||
@@ -57,19 +63,13 @@ func main() {
|
||||
e.Static("/", cfg.String("static-path"))
|
||||
// Serve default page
|
||||
} else if !cfg.Bool("disable-website") {
|
||||
rootBox := rice.MustFindBox("files/root")
|
||||
indexPage, err := rootBox.String("index.html")
|
||||
if err == nil {
|
||||
stdOutLogger.Print("Running embedded page")
|
||||
e.GET("/", func(c echo.Context) error {
|
||||
return c.HTML(200, indexPage)
|
||||
})
|
||||
} else {
|
||||
stdOutLogger.Printf("Failed to run embedded website: %s", err)
|
||||
}
|
||||
stdOutLogger.Print("Running embedded page")
|
||||
e.GET("/", func(c echo.Context) error {
|
||||
return c.HTML(200, string(indexPage))
|
||||
})
|
||||
}
|
||||
// Embed static files and serve those on /lnme (e.g. /lnme/lnme.js)
|
||||
assetHandler := http.FileServer(rice.MustFindBox("files/assets").HTTPBox())
|
||||
assetHandler := http.FileServer(http.FS(embeddedAssets))
|
||||
e.GET("/lnme/*", echo.WrapHandler(http.StripPrefix("/lnme/", assetHandler)))
|
||||
|
||||
// CORS settings
|
||||
|
||||
-104
@@ -1,104 +0,0 @@
|
||||
// Code generated by rice embed-go; DO NOT EDIT.
|
||||
package main
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/GeertJohan/go.rice/embedded"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
// define files
|
||||
file2 := &embedded.EmbeddedFile{
|
||||
Filename: "index.html",
|
||||
FileModTime: time.Unix(1638532473, 0),
|
||||
|
||||
Content: string("<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n\n <meta property=\"og:site_name\" content=\"\">\n <meta property=\"og:description\" content=\"\">\n\n <meta property=\"og:image\" content=\"/lnme/icon.svg\">\n\n <title>Send me some Sats</title>\n <style>\n html {\n width: 100%;\n height: 100%;\n font-size: 1vw;\n }\n body {\n background-image: linear-gradient(60deg, #3d3393 0%, #2b76b9 37%, #2cacd1 65%, #35eb93 100%);\n font-family: \"Lucida Sans Unicode\", \"Lucida Grande\", sans-serif;\n }\n .wrapper {\n font-weight: 400;\n line-height: 1.25;\n margin-bottom: 1rem;\n font-size: 4em;\n color: #fff;\n width: 640px;\n margin: 1em auto;\n text-align: center;\n }\n .note {\n font-size: 0.2em;\n }\n .wrapper h1 {\n font-weight: 700;\n }\n .wrapper h2 {\n font-weight: 400;\n }\n .wrapper a, .wrapper a:visited, .wrapper a:active {\n color: #fff;\n text-decoration:none;\n }\n .wrapper p {\n margin: 0.5em 0;\n }\n input, input:focus {\n outline: none;\n background-color: transparent;\n font-size: 1em;\n font-weight: 700;\n border: none;\n border-bottom: 1px solid #fff;\n text-align: center;\n color: #fff;\n }\n ::placeholder {\n color: #fff;\n opacity: 0.2;\n }\n input[type=number] {\n -moz-appearance: textfield;\n }\n input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n input.amount {\n width: 300px;\n }\n input.memo {\n width: 100%;\n }\n button {\n color: #fff;\n font-weight: 400;\n font-size: 0.5em;\n line-height: 1.5;\n font-weight: 400;\n width: 100%;\n cursor: pointer;\n border: none;\n border-radius: 30px;\n background-color: #2b76b9;\n }\n h2.lnme-value, h1.lnme-memo {\n font-size: 2em;\n font-weight: 400;\n }\n\n .lnme-wrapper {\n margin-top: 1em;\n font-size: 0.5em;\n width: 100%;\n white-space: nowrap;\n }\n .lnme-qrcode > canvas {\n border: 5px solid #fff;\n background: #fff;\n }\n .lnme-details {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n .lnme-link {\n text-overflow: ellipsis;\n overflow: hidden;\n }\n .lnme-copy {\n cursor: pointer;\n }\n </style>\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/lnme/favicon.svg\" />\n </head>\n <body>\n <div class=\"wrapper\">\n <div class=\"form\" id=\"form\">\n <p>\n Send me<br>\n <input type=\"number\" placeholder=\"10000\" class=\"amount\" id=\"amount\" autofocus=\"true\" autocomplete=\"off\" min=\"100\"> Sats\n <br>\n for\n <br>\n <input type=\"text\" class=\"memo\" id=\"memo\" placeholder=\"message\" autocomplete=\"off\">\n </p>\n\n <button id=\"send-button\">⚡ Send ⚡</button>\n\n <p id=\"onchain\" class=\"note\">\n <a href=\"#\" id=\"get-new-address\" class=\"onchain\">Prefer onchain Bitcoin? Click here!</a>\n </p>\n\n <div id=\"lnme-wrapper\" class=\"lnme-wrapper\" style=\"display:none\">\n <div class=\"lnme-qrcode\"></div>\n <div class=\"lnme-details\">\n <a href=\"#\" class=\"lnme-link\"><span class=\"lnme-payment-request\"></span></a>\n <div class=\"lnme-copy\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"feather feather-copy\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"></path></svg>\n </div>\n </div>\n </div>\n\n <div id=\"loader\" style=\"display:none\">\n <svg version=\"1.1\" id=\"loader-1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"40px\" height=\"40px\" viewBox=\"0 0 50 50\" style=\"enable-background:new 0 0 50 50;\" xml:space=\"preserve\">\n <path fill=\"#000\" d=\"M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z\">\n <animateTransform attributeType=\"xml\" attributeName=\"transform\" type=\"rotate\" from=\"0 25 25\" to=\"360 25 25\" dur=\"0.6s\" repeatCount=\"indefinite\"/>\n </path>\n </svg>\n </div>Line truncated
|
||||
}
|
||||
|
||||
// define dirs
|
||||
dir1 := &embedded.EmbeddedDir{
|
||||
Filename: "",
|
||||
DirModTime: time.Unix(1637488994, 0),
|
||||
ChildFiles: []*embedded.EmbeddedFile{
|
||||
file2, // "index.html"
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
// link ChildDirs
|
||||
dir1.ChildDirs = []*embedded.EmbeddedDir{}
|
||||
|
||||
// register embeddedBox
|
||||
embedded.RegisterEmbeddedBox(`files/root`, &embedded.EmbeddedBox{
|
||||
Name: `files/root`,
|
||||
Time: time.Unix(1637488994, 0),
|
||||
Dirs: map[string]*embedded.EmbeddedDir{
|
||||
"": dir1,
|
||||
},
|
||||
Files: map[string]*embedded.EmbeddedFile{
|
||||
"index.html": file2,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
// define files
|
||||
file4 := &embedded.EmbeddedFile{
|
||||
Filename: "favicon.svg",
|
||||
FileModTime: time.Unix(1637526634, 0),
|
||||
|
||||
Content: string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"1024px\" height=\"1024px\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <title>lnme-icon-no-padding</title>\n <defs>\n <linearGradient x1=\"50%\" y1=\"0%\" x2=\"50%\" y2=\"100%\" id=\"linearGradient-1\">\n <stop stop-color=\"#FFA500\" offset=\"0%\"></stop>\n <stop stop-color=\"#FFE300\" offset=\"100%\"></stop>\n </linearGradient>\n <linearGradient x1=\"50%\" y1=\"0%\" x2=\"50%\" y2=\"100%\" id=\"linearGradient-2\">\n <stop stop-color=\"#FFE300\" offset=\"0%\"></stop>\n <stop stop-color=\"#FFA500\" offset=\"100%\"></stop>\n </linearGradient>\n </defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g id=\"lnme-icon-no-padding\" transform=\"translate(0.000000, -0.460904)\">\n <polygon id=\"Path1\" fill=\"url(#linearGradient-1)\" points=\"439.147203 0 192.83828 475.102188 823.013089 475.102188 909.205258 386.884293 491.070577 386.884293 737.132519 0.460904\"></polygon>\n <polygon id=\"Path2\" fill=\"url(#linearGradient-2)\" points=\"115.14578 615.666174 528.131075 615.666174 327.461698 1024 793.918502 509.464888 174.115801 509.464888\"></polygon>\n </g>\n </g>\n</svg>"),
|
||||
}
|
||||
file5 := &embedded.EmbeddedFile{
|
||||
Filename: "icon.svg",
|
||||
FileModTime: time.Unix(1638532495, 0),
|
||||
|
||||
Content: string("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"1024px\" height=\"1024px\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <title>lnme-icon-rect</title>\n <defs>\n <linearGradient x1=\"0%\" y1=\"64.5790537%\" x2=\"100%\" y2=\"64.5790537%\" id=\"linearGradient-1\">\n <stop stop-color=\"#3D3393\" offset=\"0%\"></stop>\n <stop stop-color=\"#2B76B9\" offset=\"24.6013508%\"></stop>\n <stop stop-color=\"#2CACD1\" offset=\"67.981896%\"></stop>\n <stop stop-color=\"#35EB93\" offset=\"100%\"></stop>\n </linearGradient>\n <linearGradient x1=\"50%\" y1=\"0%\" x2=\"50%\" y2=\"100%\" id=\"linearGradient-2\">\n <stop stop-color=\"#FFA500\" offset=\"0%\"></stop>\n <stop stop-color=\"#FFE300\" offset=\"100%\"></stop>\n </linearGradient>\n <linearGradient x1=\"50%\" y1=\"0%\" x2=\"50%\" y2=\"100%\" id=\"linearGradient-3\">\n <stop stop-color=\"#FFE300\" offset=\"0%\"></stop>\n <stop stop-color=\"#FFA500\" offset=\"100%\"></stop>\n </linearGradient>\n </defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g id=\"lnme-icon-rect\">\n <rect id=\"Background\" fill=\"url(#linearGradient-1)\" x=\"0\" y=\"0\" width=\"1024\" height=\"1024\"></rect>\n <polygon id=\"Path1\" fill=\"url(#linearGradient-2)\" points=\"456 91.539096 254.655336 479.91029 769.790288 479.91029 840.247879 407.796774 498.444643 407.796774 698.541282 95.539096\"></polygon>\n <polygon id=\"Path2\" fill=\"url(#linearGradient-3)\" points=\"191.14578 594.813998 528.739662 594.813998 364.70294 928.605547 746.006985 508 239.350688 508\"></polygon>\n </g>\n </g>\n</svg>"),
|
||||
}
|
||||
file6 := &embedded.EmbeddedFile{
|
||||
Filename: "lnme.css",
|
||||
FileModTime: time.Unix(1637488994, 0),
|
||||
|
||||
Content: string("@keyframes slideIn{0%{opacity:0;transform:scale(.85)}70%{opacity:1;transform:scale(1.03)}100%{transform:scale(1)}}@keyframes slideOut{from{opacity:1}to{opacity:0}}@keyframes rotate{from{transform:rotate(0)}to{transform:rotate(180deg)}}.jPopup{position:absolute;top:0;right:0;bottom:0;left:0;z-index:9999;max-width:100%;padding:50px 15px 15px;box-sizing:border-box}.jPopup:after{content:'';position:fixed;top:0;right:0;bottom:0;left:0;z-index:9998;background:#fff}.jPopup>.jCloseBtn{position:absolute;right:1rem;top:1rem;z-index:9999;outline:0;border:0;box-sizing:border-box;cursor:pointer;width:5rem;height:5rem;background:#f2f2f2;border-radius:50%}.jPopup>.jCloseBtn>.graphicIcon{width:2rem;height:2rem;position:relative;margin:0 auto}.jPopup>.jCloseBtn>.graphicIcon:after,.jPopup>.jCloseBtn>.graphicIcon:before{position:absolute;left:.9rem;content:'';height:2rem;width:.3rem;background-color:#adadad;border-radius:.5rem}.jPopup>.jCloseBtn>.graphicIcon:before{-ms-transform:rotate(45deg);transform:rotate(45deg)}.jPopup>.jCloseBtn>.graphicIcon:after{-ms-transform:rotate(-45deg);transform:rotate(-45deg)}.jPopup>.jCloseBtn:hover>.graphicIcon{animation:rotate 250ms ease-in}.jPopup>.jCloseBtn:active{-ms-transform:scale(.95);transform:scale(.95)}.jPopup>.content{top:50%;left:1.5rem;right:1.5rem;position:absolute;z-index:9999;-ms-transform:translateY(-50%);transform:translateY(-50%)}@media screen and (min-width:680px){.jPopup{padding:8rem 3rem 3rem}.jPopup>.jCloseBtn{width:6rem;height:6rem;right:2rem;top:2rem}.jPopup>.jCloseBtn:after{content:'(esc)';position:absolute;top:6.5rem;left:50%;font-size:1.1rem;-ms-transform:translateX(-50%);transform:translateX(-50%);color:#adadad;pointer-events:none}.jPopup>.jCloseBtn>.graphicIcon{width:3rem;height:3rem}.jPopup>.jCloseBtn>.graphicIcon:after,.jPopup>.jCloseBtn>.graphicIcon:before{left:1.4rem;height:3rem}.jPopup>.content{left:3rem;right:3rem}}.jPopupOpen,.jPopupOpen body{overflow:hidden}.jPopupOpen .jPopup{animation:slideIn .5s cubic-bezier(.34,.34,.26,.99)}.jPopupClosed .jPopup{animation:slideOut 250ms ease-in}\n\n.jPopup > .jCloseBtn {\n z-index:10000;\n}\n\n.jPopup .lnme-payment-request {\n width: 220px;\n margin: 0 auto;\n text-align: center;\n}\n.jPopup .lnme-payment-request h1, .jPopup .lnme-payment-request h2 {\n text-align: center;\n}\n\n.jPopup .lnme-details {\n width: 200px;\n overflow: hidden;\n}\n\n.jPopup .lnme-copy {\n cursor: pointer;\n display: inline;\n}\n"),
|
||||
}
|
||||
file7 := &embedded.EmbeddedFile{
|
||||
Filename: "lnme.js",
|
||||
FileModTime: time.Unix(1637701040, 0),
|
||||
|
||||
Content: string("'use strict';\n/*! https://github.com/robiveli/jpopup */\n!function(e,n){void 0===e&&void 0!==window&&(e=window),\"function\"==typeof define&&define.amd?define([],function(){return e.jPopup=n()}):\"object\"==typeof module&&module.exports?module.exports=n():e.jPopup=n()}(this,function(){\"use strict\";var n,o,t=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:\"\";1==(n=0!=e.shouldSetHash)&&(o=void 0!==e.hashtagValue?e.hashtagValue:\"#popup\"),i(e.content).then(a).then(1==n&&s(!0))},i=function(e){return u.classList.add(\"jPopupOpen\"),Promise.resolve(document.body.insertAdjacentHTML(\"beforeend\",'<div class=\"jPopup\">\\n <button type=\"button\" class=\"jCloseBtn\">\\n <div class=\"graphicIcon\"></div>\\n </button>\\n <div class=\"content\">'.concat(e,\"</div>\\n </div>\")))},s=function(e){1==e?window.location.hash=o:window.history.back()},d=function(e){27==e.keyCode&&t.prototype.close(!0)},c=function(){window.location.hash!==o&&t.prototype.close(!1)},a=function(){document.getElementsByClassName(\"jCloseBtn\")[0].addEventListener(\"click\",function(){t.prototype.close(!0)}),window.addEventListener(\"keydown\",d),1==n&&window.addEventListener(\"hashchange\",c)},u=document.querySelector(\"html\");return t.prototype={close:function(e){u.classList.add(\"jPopupClosed\"),1==n&&(e&&s(!1),window.removeEventListener(\"hashchange\",c)),window.removeEventListener(\"keydown\",d),document.getElementsByClassName(\"jPopup\")[0].addEventListener(\"animationend\",function(e){e.target.parentNode.removeChild(this),u.classList.remove(\"jPopupClosed\"),u.classList.remove(\"jPopupOpen\")})},open:function(e){t(e)}},t});\n\n/*\n https://github.com/nimiq/qr-creator\n jquery-qrcode v0.14.0 - https://larsjung.de/jquery-qrcode/ */\n'use strict';let G=null;class H{}H.render=function(w,B){G(w,B)};self.QrCreator=H;\n(function(w){function B(t,c,a,e){var b={},h=w(a,c);h.u(t);h.J();e=e||0;var r=h.h(),d=h.h()+2*e;b.text=t;b.level=c;b.version=a;b.O=d;b.a=function(b,a){b-=e;a-=e;return 0>b||b>=r||0>a||a>=r?!1:h.a(b,a)};return b}function C(t,c,a,e,b,h,r,d,g,x){function u(b,a,f,c,d,r,g){b?(t.lineTo(a+r,f+g),t.arcTo(a,f,c,d,h)):t.lineTo(a,f)}r?t.moveTo(c+h,a):t.moveTo(c,a);u(d,e,a,e,b,-h,0);u(g,e,b,c,b,0,-h);u(x,c,b,c,a,h,0);u(r,c,a,e,a,0,h)}function z(t,c,a,e,b,h,r,d,g,x){function u(b,a,c,d){t.moveTo(b+c,a);t.lineTo(b,\na);t.lineTo(b,a+d);t.arcTo(b,a,b+c,a,h)}r&&u(c,a,h,h);d&&u(e,a,-h,h);g&&u(e,b,-h,-h);x&&u(c,b,h,-h)}function A(t,c){var a=c.fill;if(\"string\"===typeof a)t.fillStyle=a;else{var e=a.type,b=a.colorStops;a=a.position.map((b)=>Math.round(b*c.size));if(\"linear-gradient\"===e)var h=t.createLinearGradient.apply(t,a);else if(\"radial-gradient\"===e)h=t.createRadialGradient.apply(t,a);else throw Error(\"Unsupported fill\");b.forEach(([b,a])=>{h.addColorStop(b,a)});t.fillStyle=h}}function y(t,c){a:{var a=c.text,e=\nc.v,b=c.N,h=c.K,r=c.P;b=Math.max(1,b||1);for(h=Math.min(40,h||40);b<=h;b+=1)try{var d=B(a,e,b,r);break a}catch(J){}d=void 0}if(!d)return null;a=t.getContext(\"2d\");c.background&&(a.fillStyle=c.background,a.fillRect(c.left,c.top,c.size,c.size));e=d.O;h=c.size/e;a.beginPath();for(r=0;r<e;r+=1)for(b=0;b<e;b+=1){var g=a,x=c.left+b*h,u=c.top+r*h,p=r,q=b,f=d.a,k=x+h,m=u+h,D=p-1,E=p+1,n=q-1,l=q+1,y=Math.floor(Math.min(.5,Math.max(0,c.R))*h),v=f(p,q),I=f(D,n),w=f(D,q);D=f(D,l);var F=f(p,l);l=f(E,l);q=f(E,\nq);E=f(E,n);p=f(p,n);x=Math.round(x);u=Math.round(u);k=Math.round(k);m=Math.round(m);v?C(g,x,u,k,m,y,!w&&!p,!w&&!F,!q&&!F,!q&&!p):z(g,x,u,k,m,y,w&&p&&I,w&&F&&D,q&&F&&l,q&&p&&E)}A(a,c);a.fill();return t}var v={minVersion:1,maxVersion:40,ecLevel:\"L\",left:0,top:0,size:200,fill:\"#000\",background:null,text:\"no text\",radius:.5,quiet:0};G=function(t,c){var a={};Object.assign(a,v,t);a.N=a.minVersion;a.K=a.maxVersion;a.v=a.ecLevel;a.left=a.left;a.top=a.top;a.size=a.size;a.fill=a.fill;a.background=a.background;\na.text=a.text;a.R=a.radius;a.P=a.quiet;if(c instanceof HTMLCanvasElement){if(c.width!==a.size||c.height!==a.size)c.width=a.size,c.height=a.size;c.getContext(\"2d\").clearRect(0,0,c.width,c.height);y(c,a)}else t=document.createElement(\"canvas\"),t.width=a.size,t.height=a.size,a=y(t,a),c.appendChild(a)}})(function(){function w(c){var a=C.s(c);return{S:function(){return 4},b:function(){return a.length},write:function(c){for(var b=0;b<a.length;b+=1)c.put(a[b],8)}}}function B(){var c=[],a=0,e={B:function(){return c},\nc:function(b){return 1==(c[Math.floor(b/8)]>>>7-b%8&1)},put:function(b,h){for(var a=0;a<h;a+=1)e.m(1==(b>>>h-a-1&1))},f:function(){return a},m:function(b){var h=Math.floor(a/8);c.length<=h&&c.push(0);b&&(c[h]|=128>>>a%8);a+=1}};return e}function C(c,a){function e(b,h){for(var a=-1;7>=a;a+=1)if(!(-1>=b+a||d<=b+a))for(var c=-1;7>=c;c+=1)-1>=h+c||d<=h+c||(r[b+a][h+c]=0<=a&&6>=a&&(0==c||6==c)||0<=c&&6>=c&&(0==a||6==a)||2<=a&&4>=a&&2<=c&&4>=c?!0:!1)}function b(b,a){for(var f=d=4*c+17,k=Array(f),m=0;m<\nf;m+=Line truncated
|
||||
}
|
||||
|
||||
// define dirs
|
||||
dir3 := &embedded.EmbeddedDir{
|
||||
Filename: "",
|
||||
DirModTime: time.Unix(1638532495, 0),
|
||||
ChildFiles: []*embedded.EmbeddedFile{
|
||||
file4, // "favicon.svg"
|
||||
file5, // "icon.svg"
|
||||
file6, // "lnme.css"
|
||||
file7, // "lnme.js"
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
// link ChildDirs
|
||||
dir3.ChildDirs = []*embedded.EmbeddedDir{}
|
||||
|
||||
// register embeddedBox
|
||||
embedded.RegisterEmbeddedBox(`files/assets`, &embedded.EmbeddedBox{
|
||||
Name: `files/assets`,
|
||||
Time: time.Unix(1638532495, 0),
|
||||
Dirs: map[string]*embedded.EmbeddedDir{
|
||||
"": dir3,
|
||||
},
|
||||
Files: map[string]*embedded.EmbeddedFile{
|
||||
"favicon.svg": file4,
|
||||
"icon.svg": file5,
|
||||
"lnme.css": file6,
|
||||
"lnme.js": file7,
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user