-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
WIP: HTML5 Push Notifications #10884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
97adb3d
d8924ad
4d37536
bd138af
c92df3c
eb1251a
2adca5b
1334af0
58106e0
f994d68
0946969
da2323a
760262f
7d0fd8c
4aada2e
e82a5a9
c25003b
832fbbd
5265790
cd809b1
5dafc6c
1726fac
f873c5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,7 +131,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. | |
- `REACTIONS`: All available reactions. Allow users react with different emoji's. | ||
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used. | ||
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page. | ||
- `USE_SERVICE_WORKER`: **true**: Whether to enable a Service Worker to cache frontend assets. | ||
- `USE_SERVICE_WORKER`: **true**: Whether to enable a Service Worker to cache frontend assets and enable push notifications on supported browsers. | ||
|
||
### UI - Admin (`ui.admin`) | ||
|
||
|
@@ -289,6 +289,8 @@ set name for unique queues. Individual queues will default to | |
|
||
- `INSTALL_LOCK`: **false**: Disallow access to the install page. | ||
- `SECRET_KEY`: **\<random at every install\>**: Global secret key. This should be changed. | ||
- `WEB_PUSH_PUBLIC_KEY`: **\<random at every install\>**: VAPID key pair used for Web Push notifications | ||
- `WEB_PUSH_PRIVATE_KEY`: **\<random at every install\>**: VAPID key pair used for Web Push notifications | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the codebase I've tried to be consistent with 'Web Push', but I could change the user-facing config quite easily |
||
- `LOGIN_REMEMBER_DAYS`: **7**: Cookie lifetime, in days. | ||
- `COOKIE_USERNAME`: **gitea\_awesome**: Name of the cookie used to store the current username. | ||
- `COOKIE_REMEMBER_NAME`: **gitea\_incredible**: Name of cookie used to store authentication | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2020 The Gitea Authors. All rights reserved. | ||
// Use of this source code is governed by a MIT-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package migrations | ||
|
||
import ( | ||
"code.gitea.io/gitea/modules/timeutil" | ||
"xorm.io/xorm" | ||
) | ||
|
||
func addWebPushSubcriptionTable(x *xorm.Engine) error { | ||
type WebPushSubscription struct { | ||
ID int64 `xorm:"pk autoincr"` | ||
UserID int64 `xorm:"INDEX"` | ||
|
||
Endpoint string `xorm:"UNIQUE"` | ||
Auth string | ||
P256DH string | ||
|
||
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` | ||
} | ||
return x.Sync2(new(WebPushSubscription)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't piggy-back on the service-worker pref, these are two distinct features. Add a new one, like
USE_PUSH_NOTIFICATIONS
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True - I'll pop a note saying the service worker is required as well.