Append /v2 to module
This commit is contained in:
		
							parent
							
								
									abe7275f0c
								
							
						
					
					
						commit
						668c472ee6
					
				
					 63 changed files with 116 additions and 116 deletions
				
			
		| 
						 | 
				
			
			@ -4,7 +4,7 @@ import (
 | 
			
		|||
	"encoding/json"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"regexp"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"unicode/utf8"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,7 +5,7 @@ import (
 | 
			
		|||
	"net/netip"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Defines default config settings (excluding limits, see below)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,8 @@
 | 
			
		|||
package server_test
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/server"
 | 
			
		||||
	"github.com/stretchr/testify/assert"
 | 
			
		||||
	"heckel.io/ntfy/server"
 | 
			
		||||
	"testing"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ package server
 | 
			
		|||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"net/http"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,8 +3,8 @@ package server
 | 
			
		|||
import (
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"os"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,8 +3,8 @@ package server
 | 
			
		|||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/stretchr/testify/require"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"os"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"testing"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,10 +2,10 @@ package server
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/emersion/go-smtp"
 | 
			
		||||
	"github.com/gorilla/websocket"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"unicode/utf8"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -9,9 +9,9 @@ import (
 | 
			
		|||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	_ "github.com/mattn/go-sqlite3" // SQLite driver
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -26,13 +26,13 @@ import (
 | 
			
		|||
	"time"
 | 
			
		||||
	"unicode/utf8"
 | 
			
		||||
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/emersion/go-smtp"
 | 
			
		||||
	"github.com/gorilla/websocket"
 | 
			
		||||
	"github.com/prometheus/client_golang/prometheus/promhttp"
 | 
			
		||||
	"golang.org/x/sync/errgroup"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Server is the main server, providing the UI and API for ntfy
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,9 +2,9 @@ package server
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/netip"
 | 
			
		||||
	"strings"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,10 +2,10 @@ package server
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/stretchr/testify/require"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/netip"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
package server
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"net/http"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,9 @@
 | 
			
		|||
package server
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/stretchr/testify/require"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"sync/atomic"
 | 
			
		||||
	"testing"
 | 
			
		||||
	"time"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,9 +7,9 @@ import (
 | 
			
		|||
	firebase "firebase.google.com/go/v4"
 | 
			
		||||
	"firebase.google.com/go/v4/messaging"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"google.golang.org/api/option"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,7 @@ import (
 | 
			
		|||
	"encoding/json"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"net/netip"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"sync"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,8 +1,8 @@
 | 
			
		|||
package server
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,7 +4,7 @@ import (
 | 
			
		|||
	"bytes"
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"strings"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ package server
 | 
			
		|||
import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type contextKey int
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,6 +4,9 @@ import (
 | 
			
		|||
	"bytes"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/stripe/stripe-go/v74"
 | 
			
		||||
	portalsession "github.com/stripe/stripe-go/v74/billingportal/session"
 | 
			
		||||
	"github.com/stripe/stripe-go/v74/checkout/session"
 | 
			
		||||
| 
						 | 
				
			
			@ -11,9 +14,6 @@ import (
 | 
			
		|||
	"github.com/stripe/stripe-go/v74/price"
 | 
			
		||||
	"github.com/stripe/stripe-go/v74/subscription"
 | 
			
		||||
	"github.com/stripe/stripe-go/v74/webhook"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/netip"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,12 +2,12 @@ package server
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/stretchr/testify/mock"
 | 
			
		||||
	"github.com/stretchr/testify/require"
 | 
			
		||||
	"github.com/stripe/stripe-go/v74"
 | 
			
		||||
	"golang.org/x/time/rate"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/netip"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -6,8 +6,8 @@ import (
 | 
			
		|||
	"encoding/base64"
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"golang.org/x/crypto/bcrypt"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"io"
 | 
			
		||||
	"math/rand"
 | 
			
		||||
	"net/http"
 | 
			
		||||
| 
						 | 
				
			
			@ -22,10 +22,10 @@ import (
 | 
			
		|||
	"testing"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/SherClockHolmes/webpush-go"
 | 
			
		||||
	"github.com/stretchr/testify/require"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func TestMain(m *testing.M) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,9 +4,9 @@ import (
 | 
			
		|||
	"bytes"
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,9 +1,9 @@
 | 
			
		|||
package server
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/stretchr/testify/require"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/http/httptest"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,9 +7,9 @@ import (
 | 
			
		|||
	"regexp"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"github.com/SherClockHolmes/webpush-go"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,9 +3,9 @@ package server
 | 
			
		|||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"github.com/stretchr/testify/require"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/http/httptest"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,8 +11,8 @@ import (
 | 
			
		|||
	"sync"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type mailer interface {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,8 +5,8 @@ import (
 | 
			
		|||
	"sync"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -5,10 +5,10 @@ import (
 | 
			
		|||
	"net/netip"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// List of possible events
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ package server
 | 
			
		|||
import (
 | 
			
		||||
	"context"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"io"
 | 
			
		||||
	"mime"
 | 
			
		||||
	"net/http"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,14 +2,14 @@ package server
 | 
			
		|||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"heckel.io/ntfy/log"
 | 
			
		||||
	"heckel.io/ntfy/user"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/log"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/user"
 | 
			
		||||
	"net/netip"
 | 
			
		||||
	"sync"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"golang.org/x/time/rate"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ package server
 | 
			
		|||
import (
 | 
			
		||||
	"database/sql"
 | 
			
		||||
	"errors"
 | 
			
		||||
	"heckel.io/ntfy/util"
 | 
			
		||||
	"git.zio.sh/astra/ntfy/v2/util"
 | 
			
		||||
	"net/netip"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue