Compare commits
6 Commits
7774910292
...
b1c45a4ab3
Author | SHA1 | Date | |
---|---|---|---|
|
b1c45a4ab3 | ||
|
0fb2e95729 | ||
|
70fbe48e42 | ||
|
75232ba5fa | ||
|
a28d690f28 | ||
|
b477f23aac |
27
awards.csv
27
awards.csv
@ -33,17 +33,20 @@ SouthKoreaLN,pr,#1015,#1010,good-first-issue,,,,20k,south_korea_ln@stacker.news,
|
|||||||
SatsAllDay,issue,#1015,#1010,good-first-issue,,,,20k,weareallsatoshi@getalby.com,2024-04-04
|
SatsAllDay,issue,#1015,#1010,good-first-issue,,,,20k,weareallsatoshi@getalby.com,2024-04-04
|
||||||
jp30566347,pr,#991,#718,good-first-issue,,,,20k,jpmelanson@getalby.com,2024-04-04
|
jp30566347,pr,#991,#718,good-first-issue,,,,20k,jpmelanson@getalby.com,2024-04-04
|
||||||
benalleng,helpfulness,#1015,#1010,good-first-issue,,,,2k,BenAllenG@stacker.news,2024-04-04
|
benalleng,helpfulness,#1015,#1010,good-first-issue,,,,2k,BenAllenG@stacker.news,2024-04-04
|
||||||
felipebueno,pr,#1012,,,,,,20k,felipe@stacker.news,2024-04-24
|
felipebueno,pr,#1012,,,,,,20k,felipe@stacker.news,2024-04-04
|
||||||
abhiShandy,helpfulness,#1018,#1006,good-first-issue,,,identified problem,2k,bolt11,2024-04-24
|
abhiShandy,helpfulness,#1018,#1006,good-first-issue,,,identified problem,2k,bolt11,2024-04-04
|
||||||
benalleng,issue,#1018,#1006,good-first-issue,,,,2k,BenAllenG@stacker.news,???
|
benalleng,issue,#1018,#1006,good-first-issue,,,,2k,???,???
|
||||||
benalleng,issue,#1011,#993,easy,high,,,20k,BenAllenG@stacker.news,???
|
benalleng,issue,#1011,#993,easy,high,,,20k,???,???
|
||||||
benalleng,pr,#1011,#993,easy,high,,tortured them,200k,BenAllenG@stacker.news,???
|
benalleng,pr,#1011,#993,easy,high,,tortured them,200k,???,???
|
||||||
abhiShandy,pr,#1031,#908,good-first-issue,,1,,18k,???,???
|
abhiShandy,pr,#1031,#908,good-first-issue,,1,,18k,abhishandy@stacker.news,2024-04-12
|
||||||
SatsAllDay,issue,#1031,#908,good-first-issue,,1,,1.8k,???,???
|
SatsAllDay,issue,#1031,#908,good-first-issue,,1,,1.8k,weareallsatoshi@getalby.com,2024-04-12
|
||||||
SatsAllDay,pr,#1034,#934,medium,,,,250k,???,???
|
SatsAllDay,pr,#1034,#934,medium,,,,250k,weareallsatoshi@getalby.com,2024-04-12
|
||||||
SatsAllDay,issue,#1034,#934,medium,,,,25k,???,???
|
SatsAllDay,issue,#1034,#934,medium,,,,25k,weareallsatoshi@getalby.com,2024-04-12
|
||||||
benalleng,pr,#1037,#1036,easy,,1,,90k,???,???
|
benalleng,pr,#1037,#1036,easy,,1,,90k,???,???
|
||||||
SatsAllDay,pr,#1038,#1033,easy,,,,100k,???,???
|
SatsAllDay,pr,#1038,#1033,easy,,,,100k,weareallsatoshi@getalby.com,2024-04-12
|
||||||
SatsAllDay,issue,#1038,#1033,easy,,,,10k,???,???
|
SatsAllDay,issue,#1038,#1033,easy,,,,10k,weareallsatoshi@getalby.com,2024-04-12
|
||||||
felipebueno,pr,#1043,,easy,,,,100k,???,???
|
felipebueno,pr,#1043,,easy,,,,100k,felipe@stacker.news,2024-04-12
|
||||||
benalleng,pr,#1050,,good-first-issue,,,,20k,???,???
|
benalleng,pr,#1050,,good-first-issue,,,,20k,???,???
|
||||||
|
jp30566347,pr,#1055,#771,medium,,,extra mile,300k,jpmelanson@getalby.com,2024-04-12
|
||||||
|
benalleng,helpfulness,#1063,202,medium,,,did much of the legwork in another pr,100k,???,???
|
||||||
|
benalleng,code review,#1063,202,medium,,,,25k,???,???
|
||||||
|
|
5
chat-web/Dockerfile
Normal file
5
chat-web/Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# use vectorim/element-web as base but copy config.json to /app/config.json
|
||||||
|
|
||||||
|
FROM vectorim/element-web:latest
|
||||||
|
|
||||||
|
COPY config.json /app/config.json
|
41
chat-web/config.json
Normal file
41
chat-web/config.json
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"default_server_name": "https://sndev.team",
|
||||||
|
"default_server_config": {
|
||||||
|
"m.homeserver": {
|
||||||
|
"base_url": "https://sndev.team"
|
||||||
|
},
|
||||||
|
"m.identity_server": {
|
||||||
|
"base_url": "https://sndev.team"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"brand": "chat.sndev.team",
|
||||||
|
"permalink_prefix": "https://chat.sndev.team",
|
||||||
|
"show_labs_settings": false,
|
||||||
|
"mobile_guide_toast": false,
|
||||||
|
"default_country_code": "US",
|
||||||
|
"disable_3pid_login": true,
|
||||||
|
"disable_custom_urls": true,
|
||||||
|
"disable_guests": true,
|
||||||
|
"disable_login_language_selector": true,
|
||||||
|
"room_directory": {
|
||||||
|
"servers": ["sndev.team"]
|
||||||
|
},
|
||||||
|
"enable_presence_by_hs_url": {
|
||||||
|
"https://matrix.org": false,
|
||||||
|
"https://matrix-client.matrix.org": false
|
||||||
|
},
|
||||||
|
"terms_and_conditions_links": [
|
||||||
|
{
|
||||||
|
"url": "https://element.io/privacy",
|
||||||
|
"text": "Privacy Policy"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://element.io/cookie-policy",
|
||||||
|
"text": "Cookie Policy"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"privacy_policy_url": "https://element.io/cookie-policy",
|
||||||
|
"setting_defaults": {
|
||||||
|
"RustCrypto.staged_rollout_percent": 10
|
||||||
|
}
|
||||||
|
}
|
114
components/long-pressable.js
Normal file
114
components/long-pressable.js
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import PropType from 'prop-types'
|
||||||
|
|
||||||
|
function eventToPosition (event) {
|
||||||
|
return {
|
||||||
|
x: event.clientX,
|
||||||
|
y: event.clientY
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function distance (pointA, pointB) {
|
||||||
|
return Math.sqrt(
|
||||||
|
Math.pow(pointB.x - pointA.x, 2) + Math.pow(pointB.y - pointA.y, 2)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default class LongPressable extends React.PureComponent {
|
||||||
|
static propTypes = {
|
||||||
|
onLongPress: PropType.func.isRequired,
|
||||||
|
onShortPress: PropType.func,
|
||||||
|
longPressTime: PropType.number,
|
||||||
|
primaryMouseButtonOnly: PropType.bool,
|
||||||
|
// Maximum distance (pixels) user is allowed to drag before
|
||||||
|
// click is canceled
|
||||||
|
dragThreshold: PropType.number,
|
||||||
|
children: PropType.node
|
||||||
|
}
|
||||||
|
|
||||||
|
static defaultProps = {
|
||||||
|
longPressTime: 500,
|
||||||
|
primaryMouseButtonOnly: true,
|
||||||
|
dragThreshold: 100
|
||||||
|
}
|
||||||
|
|
||||||
|
isLongPressing = false
|
||||||
|
startingPosition = { x: 0, y: 0 }
|
||||||
|
|
||||||
|
componentWillUnmount () {
|
||||||
|
this.clearTimeout()
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout = () => {
|
||||||
|
if (this.timerID) {
|
||||||
|
clearTimeout(this.timerID)
|
||||||
|
this.timerID = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handlePointerUp = (e) => {
|
||||||
|
if (this.timerID) {
|
||||||
|
this.cancelLongPress()
|
||||||
|
}
|
||||||
|
|
||||||
|
const mousePosition = eventToPosition(e)
|
||||||
|
|
||||||
|
if (!this.isLongPressing &&
|
||||||
|
!this.exceedDragThreshold(mousePosition)) {
|
||||||
|
this.props.onShortPress(e)
|
||||||
|
} else {
|
||||||
|
this.isLongPressing = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handlePointerDown = (e) => {
|
||||||
|
if (this.props.primaryMouseButtonOnly) {
|
||||||
|
if (e.pointerType === 'mouse' && e.button !== 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// re-initialize long press
|
||||||
|
this.isLongPressing = false
|
||||||
|
this.startingPosition = eventToPosition(e)
|
||||||
|
|
||||||
|
this.timerID = setTimeout(() => {
|
||||||
|
this.isLongPressing = true
|
||||||
|
this.props.onLongPress(e)
|
||||||
|
}, this.props.longPressTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
handlePointerMove = (e) => {
|
||||||
|
const mousePosition = eventToPosition(e)
|
||||||
|
if (this.timerID && this.exceedDragThreshold(mousePosition)) {
|
||||||
|
this.cancelLongPress()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handlePointerLeave = () => {
|
||||||
|
if (this.timerID) {
|
||||||
|
this.cancelLongPress()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cancelLongPress () {
|
||||||
|
this.clearTimeout()
|
||||||
|
}
|
||||||
|
|
||||||
|
exceedDragThreshold (point) {
|
||||||
|
return distance(this.startingPosition, point) > this.props.dragThreshold
|
||||||
|
}
|
||||||
|
|
||||||
|
render () {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
onPointerUp={this.handlePointerUp}
|
||||||
|
onPointerDown={this.handlePointerDown}
|
||||||
|
onPointerMove={this.handlePointerMove}
|
||||||
|
onPointerLeave={this.handlePointerLeave}
|
||||||
|
>
|
||||||
|
{this.props.children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,6 @@ import ItemJob from './item-job'
|
|||||||
import { NOTIFICATIONS } from '@/fragments/notifications'
|
import { NOTIFICATIONS } from '@/fragments/notifications'
|
||||||
import MoreFooter from './more-footer'
|
import MoreFooter from './more-footer'
|
||||||
import Invite from './invite'
|
import Invite from './invite'
|
||||||
import { ignoreClick } from '@/lib/clicks'
|
|
||||||
import { dayMonthYear, timeSince } from '@/lib/time'
|
import { dayMonthYear, timeSince } from '@/lib/time'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import Check from '@/svgs/check-double-line.svg'
|
import Check from '@/svgs/check-double-line.svg'
|
||||||
@ -62,21 +61,23 @@ function NotificationLayout ({ children, nid, href, as, fresh }) {
|
|||||||
if (!href) return <div className={fresh ? styles.fresh : ''}>{children}</div>
|
if (!href) return <div className={fresh ? styles.fresh : ''}>{children}</div>
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={
|
className={`position-relative clickToContext ${styles.notificationLayout} ${fresh ? styles.fresh : ''} ${router?.query?.nid === nid ? 'outline-it' : ''}`}
|
||||||
`clickToContext ${fresh ? styles.fresh : ''} ${router?.query?.nid === nid ? 'outline-it' : ''}`
|
|
||||||
}
|
|
||||||
onClick={async (e) => {
|
|
||||||
if (ignoreClick(e)) return
|
|
||||||
nid && await router.replace({
|
|
||||||
pathname: router.pathname,
|
|
||||||
query: {
|
|
||||||
...router.query,
|
|
||||||
nid
|
|
||||||
}
|
|
||||||
}, router.asPath, { ...router.options, shallow: true })
|
|
||||||
router.push(href, as)
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
|
<Link
|
||||||
|
className={styles.linkBox}
|
||||||
|
onClick={async (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
nid && await router.replace({
|
||||||
|
pathname: router.pathname,
|
||||||
|
query: {
|
||||||
|
...router.query,
|
||||||
|
nid
|
||||||
|
}
|
||||||
|
}, router.asPath, { ...router.options, shallow: true })
|
||||||
|
router.push(href, as)
|
||||||
|
}}
|
||||||
|
href={typeof href === 'string' ? href : href.query.commentId ? as + '?commentId=' + href.query.commentId : as}
|
||||||
|
/>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -26,4 +26,31 @@
|
|||||||
|
|
||||||
.subFormGroup > div {
|
.subFormGroup > div {
|
||||||
margin-right: 0 !important;
|
margin-right: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.linkBox {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.linkBox ~ * {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notificationLayout > * {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notificationLayout :global(.upvoteParent),
|
||||||
|
.notificationLayout :global(.pointer),
|
||||||
|
.notificationLayout a,
|
||||||
|
.notificationLayout form,
|
||||||
|
.notificationLayout textarea,
|
||||||
|
.notificationLayout button,
|
||||||
|
.notificationLayout input,
|
||||||
|
.notificationLayout iframe {
|
||||||
|
pointer-events: auto !important;
|
||||||
}
|
}
|
@ -6,7 +6,7 @@ import ItemAct, { useAct, useZap } from './item-act'
|
|||||||
import { useMe } from './me'
|
import { useMe } from './me'
|
||||||
import getColor from '@/lib/rainbow'
|
import getColor from '@/lib/rainbow'
|
||||||
import { useCallback, useMemo, useRef, useState } from 'react'
|
import { useCallback, useMemo, useRef, useState } from 'react'
|
||||||
import LongPressable from 'react-longpressable'
|
import LongPressable from './long-pressable'
|
||||||
import Overlay from 'react-bootstrap/Overlay'
|
import Overlay from 'react-bootstrap/Overlay'
|
||||||
import Popover from 'react-bootstrap/Popover'
|
import Popover from 'react-bootstrap/Popover'
|
||||||
import { useShowModal } from './modal'
|
import { useShowModal } from './modal'
|
||||||
@ -142,43 +142,48 @@ export default function UpVote ({ item, className }) {
|
|||||||
getColor(meSats), getColor(meSats + sats)]
|
getColor(meSats), getColor(meSats + sats)]
|
||||||
}, [item?.meSats, item?.meAnonSats, me?.privates?.tipDefault, me?.privates?.turboDefault])
|
}, [item?.meSats, item?.meAnonSats, me?.privates?.tipDefault, me?.privates?.turboDefault])
|
||||||
|
|
||||||
|
const handleModalClosed = () => {
|
||||||
|
setHover(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleLongPress = (e) => {
|
||||||
|
if (!item) return
|
||||||
|
|
||||||
|
// we can't tip ourselves
|
||||||
|
if (disabled) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
setTipShow(false)
|
||||||
|
showModal(onClose =>
|
||||||
|
<ItemAct onClose={onClose} itemId={item.id} />, { onClose: handleModalClosed })
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleShortPress = () => {
|
||||||
|
if (me) {
|
||||||
|
if (!item) return
|
||||||
|
|
||||||
|
// we can't tip ourselves
|
||||||
|
if (disabled) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (meSats) {
|
||||||
|
setVoteShow(false)
|
||||||
|
} else {
|
||||||
|
setTipShow(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
zap({ item, me })
|
||||||
|
} else {
|
||||||
|
showModal(onClose => <ItemAct onClose={onClose} itemId={item.id} act={act} />, { onClose: handleModalClosed })
|
||||||
|
}
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div ref={ref} className='upvoteParent'>
|
<div ref={ref} className='upvoteParent'>
|
||||||
<LongPressable
|
<LongPressable
|
||||||
onLongPress={
|
onLongPress={handleLongPress}
|
||||||
async (e) => {
|
onShortPress={handleShortPress}
|
||||||
if (!item) return
|
|
||||||
|
|
||||||
// we can't tip ourselves
|
|
||||||
if (disabled) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
setTipShow(false)
|
|
||||||
showModal(onClose =>
|
|
||||||
<ItemAct onClose={onClose} itemId={item.id} />)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onShortPress={
|
|
||||||
me
|
|
||||||
? async (e) => {
|
|
||||||
if (!item) return
|
|
||||||
|
|
||||||
// we can't tip ourselves
|
|
||||||
if (disabled) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (meSats) {
|
|
||||||
setVoteShow(false)
|
|
||||||
} else {
|
|
||||||
setTipShow(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
zap({ item, me })
|
|
||||||
}
|
|
||||||
: () => showModal(onClose => <ItemAct onClose={onClose} itemId={item.id} act={act} />)
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<ActionTooltip notForm disable={disabled} overlayText={overlayText}>
|
<ActionTooltip notForm disable={disabled} overlayText={overlayText}>
|
||||||
<div
|
<div
|
||||||
|
53
copilot/chat-web/manifest.yml
Normal file
53
copilot/chat-web/manifest.yml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# The manifest for the "chat-web" service.
|
||||||
|
# Read the full specification for the "Load Balanced Web Service" type at:
|
||||||
|
# https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/
|
||||||
|
|
||||||
|
# Your service name will be used in naming your resources like log groups, ECS services, etc.
|
||||||
|
name: chat-web
|
||||||
|
type: Load Balanced Web Service
|
||||||
|
|
||||||
|
# Distribute traffic to your service.
|
||||||
|
http:
|
||||||
|
# Requests to this path will be forwarded to your service.
|
||||||
|
# To match all requests you can use the "/" path.
|
||||||
|
path: 'chat-web'
|
||||||
|
# You can specify a custom health check path. The default is "/".
|
||||||
|
healthcheck: '/'
|
||||||
|
|
||||||
|
# Configuration for your containers and service.
|
||||||
|
image:
|
||||||
|
build: ./chat-web/Dockerfile
|
||||||
|
# args:
|
||||||
|
# - USE_CUSTOM_SDKS: true
|
||||||
|
# - REACT_SDK_REPO: https://github.com/matrix-org/matrix-react-sdk.git
|
||||||
|
# - REACT_SDK_BRANCH: develop
|
||||||
|
# - JS_SDK_REPO: https://github.com/matrix-org/matrix-js-sdk.git
|
||||||
|
# - JS_SDK_BRANCH: develop
|
||||||
|
# Port exposed through your container to route traffic to it.
|
||||||
|
port: 80
|
||||||
|
|
||||||
|
cpu: 256 # Number of CPU units for the task.
|
||||||
|
memory: 512 # Amount of memory in MiB used by the task.
|
||||||
|
count: 1 # Number of tasks that should be running in your service.
|
||||||
|
exec: true # Enable running commands in your container.
|
||||||
|
platform: linux/x86_64
|
||||||
|
network:
|
||||||
|
connect: true # Enable Service Connect for intra-environment traffic between services.
|
||||||
|
|
||||||
|
# storage:
|
||||||
|
# readonly_fs: true # Limit to read-only access to mounted root filesystems.
|
||||||
|
|
||||||
|
# Optional fields for more advanced use-cases.
|
||||||
|
#
|
||||||
|
#variables: # Pass environment variables as key value pairs.
|
||||||
|
# LOG_LEVEL: info
|
||||||
|
|
||||||
|
#secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
|
||||||
|
# GITHUB_TOKEN: GITHUB_TOKEN # The key is the name of the environment variable, the value is the name of the SSM parameter.
|
||||||
|
|
||||||
|
# You can override any of the values defined above by environment.
|
||||||
|
#environments:
|
||||||
|
# test:
|
||||||
|
# count: 2 # Number of tasks to run for the "test" environment.
|
||||||
|
# deployment: # The deployment strategy for the "test" environment.
|
||||||
|
# rolling: 'recreate' # Stops existing tasks before new ones are started for faster deployments.
|
52
copilot/chat/manifest.yml
Normal file
52
copilot/chat/manifest.yml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# The manifest for the "chat" service.
|
||||||
|
# Read the full specification for the "Load Balanced Web Service" type at:
|
||||||
|
# https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/
|
||||||
|
|
||||||
|
# Your service name will be used in naming your resources like log groups, ECS services, etc.
|
||||||
|
name: chat
|
||||||
|
type: Load Balanced Web Service
|
||||||
|
|
||||||
|
# Distribute traffic to your service.
|
||||||
|
http:
|
||||||
|
# Requests to this path will be forwarded to your service.
|
||||||
|
# To match all requests you can use the "/" path.
|
||||||
|
path: '/'
|
||||||
|
# You can specify a custom health check path. The default is "/".
|
||||||
|
healthcheck: '/health'
|
||||||
|
|
||||||
|
# Configuration for your containers and service.
|
||||||
|
image:
|
||||||
|
location: matrixdotorg/synapse
|
||||||
|
# Port exposed through your container to route traffic to it.
|
||||||
|
port: 8008
|
||||||
|
|
||||||
|
cpu: 2048 # Number of CPU units for the task.
|
||||||
|
memory: 4096 # Amount of memory in MiB used by the task.
|
||||||
|
count: 1 # Number of tasks that should be running in your service.
|
||||||
|
exec: true # Enable running commands in your container.
|
||||||
|
network:
|
||||||
|
connect: true # Enable Service Connect for intra-environment traffic between services.
|
||||||
|
|
||||||
|
storage:
|
||||||
|
volumes:
|
||||||
|
efs:
|
||||||
|
path: /var/lib/efs/
|
||||||
|
read_only: false
|
||||||
|
efs:
|
||||||
|
id: fs-0b9130403869b3430
|
||||||
|
auth:
|
||||||
|
iam: true
|
||||||
|
access_point_id: fsap-06cd2e16280eb6c27
|
||||||
|
|
||||||
|
# storage:
|
||||||
|
# readonly_fs: true # Limit to read-only access to mounted root filesystems.
|
||||||
|
|
||||||
|
# Optional fields for more advanced use-cases.
|
||||||
|
#
|
||||||
|
variables: # Pass environment variables as key value pairs.
|
||||||
|
SYNAPSE_SERVER_NAME: sndev.team
|
||||||
|
SYNAPSE_REPORT_STATS: no
|
||||||
|
SYNAPSE_CONFIG_DIR: /var/lib/efs/matrix
|
||||||
|
SYNAPSE_DATA_DIR: /var/lib/efs/matrix
|
||||||
|
UID: 991
|
||||||
|
GID: 991
|
3
copilot/environments/addons/addons.parameters.yml
Normal file
3
copilot/environments/addons/addons.parameters.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Parameters:
|
||||||
|
VPCID: !Ref VPC
|
||||||
|
PrivateSubnets: !Join [ ',', [ !Ref PrivateSubnet1, !Ref PrivateSubnet2 ] ]
|
154
copilot/environments/addons/chat.yml
Normal file
154
copilot/environments/addons/chat.yml
Normal file
@ -0,0 +1,154 @@
|
|||||||
|
Parameters:
|
||||||
|
App:
|
||||||
|
Type: String
|
||||||
|
Description: Your application's name.
|
||||||
|
Env:
|
||||||
|
Type: String
|
||||||
|
Description: The name of the environment being deployed.
|
||||||
|
# Customize your Aurora Serverless cluster by setting the default value of the following parameters.
|
||||||
|
chatDBName:
|
||||||
|
Type: String
|
||||||
|
Description: The name of the initial database to be created in the Aurora Serverless v2 cluster.
|
||||||
|
Default: chat
|
||||||
|
# Cannot have special characters
|
||||||
|
# Naming constraints: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html#RDS_Limits.Constraints
|
||||||
|
VPCID:
|
||||||
|
Type: String
|
||||||
|
Description: The ID of the VPC in which to create the Aurora Serverless v2 cluster.
|
||||||
|
Default: ""
|
||||||
|
PrivateSubnets:
|
||||||
|
Type: String
|
||||||
|
Description: The IDs of the private subnets in which to create the Aurora Serverless v2 cluster.
|
||||||
|
Default: ""
|
||||||
|
|
||||||
|
Conditions:
|
||||||
|
IsSNDevEnv: !Equals [ !Ref Env, "sndev" ]
|
||||||
|
|
||||||
|
Mappings:
|
||||||
|
chatEnvScalingConfigurationMap:
|
||||||
|
All:
|
||||||
|
"DBMinCapacity": 0.5 # AllowedValues: from 0.5 through 128
|
||||||
|
"DBMaxCapacity": 8 # AllowedValues: from 0.5 through 128
|
||||||
|
|
||||||
|
Resources:
|
||||||
|
chatDBSubnetGroup:
|
||||||
|
Type: 'AWS::RDS::DBSubnetGroup'
|
||||||
|
Properties:
|
||||||
|
DBSubnetGroupDescription: Group of private subnets for Aurora Serverless v2 cluster.
|
||||||
|
SubnetIds:
|
||||||
|
!Split [',', !Ref PrivateSubnets]
|
||||||
|
|
||||||
|
chatWorkloadSecurityGroup:
|
||||||
|
Metadata:
|
||||||
|
'aws:copilot:description': 'A security group for one or more workloads to access the Aurora Serverless v2 cluster chat'
|
||||||
|
Type: 'AWS::EC2::SecurityGroup'
|
||||||
|
Properties:
|
||||||
|
GroupDescription: 'The Security Group to access Aurora Serverless v2 cluster chat.'
|
||||||
|
VpcId: !Ref VPCID
|
||||||
|
Tags:
|
||||||
|
- Key: Name
|
||||||
|
Value: !Sub 'copilot-${App}-${Env}-Aurora'
|
||||||
|
|
||||||
|
chatDBClusterSecurityGroup:
|
||||||
|
Metadata:
|
||||||
|
'aws:copilot:description': 'A security group for your Aurora Serverless v2 cluster chat'
|
||||||
|
Type: AWS::EC2::SecurityGroup
|
||||||
|
Properties:
|
||||||
|
GroupDescription: The Security Group for the Aurora Serverless v2 cluster.
|
||||||
|
VpcId: !Ref VPCID
|
||||||
|
SecurityGroupIngress:
|
||||||
|
- IpProtocol: tcp
|
||||||
|
FromPort: 5432
|
||||||
|
ToPort: 5432
|
||||||
|
SourceSecurityGroupId: { 'Fn::ImportValue': !Sub '${App}-${Env}-EnvironmentSecurityGroup' }
|
||||||
|
Description: 'Access to environment security group'
|
||||||
|
Tags:
|
||||||
|
- Key: Name
|
||||||
|
Value: !Sub 'copilot-${App}-${Env}-Aurora'
|
||||||
|
|
||||||
|
chatDBClusterSecurityGroupIngressFromWorkload:
|
||||||
|
Type: AWS::EC2::SecurityGroupIngress
|
||||||
|
Properties:
|
||||||
|
Description: Ingress from one or more workloads in the environment.
|
||||||
|
GroupId: !Ref chatDBClusterSecurityGroup
|
||||||
|
IpProtocol: tcp
|
||||||
|
ToPort: 5432
|
||||||
|
FromPort: 5432
|
||||||
|
SourceSecurityGroupId: !Ref chatWorkloadSecurityGroup
|
||||||
|
|
||||||
|
chatAuroraSecret:
|
||||||
|
Metadata:
|
||||||
|
'aws:copilot:description': 'A Secrets Manager secret to store your DB credentials'
|
||||||
|
Type: AWS::SecretsManager::Secret
|
||||||
|
Properties:
|
||||||
|
Description: !Sub Aurora main user secret for ${AWS::StackName}
|
||||||
|
GenerateSecretString:
|
||||||
|
SecretStringTemplate: '{"username": "postgres"}'
|
||||||
|
GenerateStringKey: "password"
|
||||||
|
ExcludePunctuation: true
|
||||||
|
IncludeSpace: false
|
||||||
|
PasswordLength: 16
|
||||||
|
chatDBClusterParameterGroup:
|
||||||
|
Metadata:
|
||||||
|
'aws:copilot:description': 'A DB parameter group for engine configuration values'
|
||||||
|
Type: 'AWS::RDS::DBClusterParameterGroup'
|
||||||
|
Properties:
|
||||||
|
Description: !Ref 'AWS::StackName'
|
||||||
|
Family: 'aurora-postgresql16'
|
||||||
|
Parameters:
|
||||||
|
client_encoding: 'UTF8'
|
||||||
|
|
||||||
|
chatDBCluster:
|
||||||
|
Metadata:
|
||||||
|
'aws:copilot:description': 'The chat Aurora Serverless v2 database cluster'
|
||||||
|
Type: 'AWS::RDS::DBCluster'
|
||||||
|
Properties:
|
||||||
|
MasterUsername:
|
||||||
|
!Join [ "", [ '{{resolve:secretsmanager:', !Ref chatAuroraSecret, ":SecretString:username}}" ]]
|
||||||
|
MasterUserPassword:
|
||||||
|
!Join [ "", [ '{{resolve:secretsmanager:', !Ref chatAuroraSecret, ":SecretString:password}}" ]]
|
||||||
|
DatabaseName: !Ref chatDBName
|
||||||
|
Engine: 'aurora-postgresql'
|
||||||
|
EngineVersion: '16.1'
|
||||||
|
DBClusterParameterGroupName: !Ref chatDBClusterParameterGroup
|
||||||
|
DBSubnetGroupName: !Ref chatDBSubnetGroup
|
||||||
|
Port: 5432
|
||||||
|
VpcSecurityGroupIds:
|
||||||
|
- !Ref chatDBClusterSecurityGroup
|
||||||
|
ServerlessV2ScalingConfiguration:
|
||||||
|
# Replace "All" below with "!Ref Env" to set different autoscaling limits per environment.
|
||||||
|
MinCapacity: !FindInMap [chatEnvScalingConfigurationMap, All, DBMinCapacity]
|
||||||
|
MaxCapacity: !FindInMap [chatEnvScalingConfigurationMap, All, DBMaxCapacity]
|
||||||
|
|
||||||
|
chatDBWriterInstance:
|
||||||
|
Metadata:
|
||||||
|
'aws:copilot:description': 'The chat Aurora Serverless v2 writer instance'
|
||||||
|
Type: 'AWS::RDS::DBInstance'
|
||||||
|
Properties:
|
||||||
|
DBClusterIdentifier: !Ref chatDBCluster
|
||||||
|
DBInstanceClass: db.serverless
|
||||||
|
Engine: 'aurora-postgresql'
|
||||||
|
PromotionTier: 1
|
||||||
|
AvailabilityZone: !Select
|
||||||
|
- 0
|
||||||
|
- !GetAZs
|
||||||
|
Ref: AWS::Region
|
||||||
|
|
||||||
|
chatSecretAuroraClusterAttachment:
|
||||||
|
Type: AWS::SecretsManager::SecretTargetAttachment
|
||||||
|
Properties:
|
||||||
|
SecretId: !Ref chatAuroraSecret
|
||||||
|
TargetId: !Ref chatDBCluster
|
||||||
|
TargetType: AWS::RDS::DBCluster
|
||||||
|
|
||||||
|
Outputs:
|
||||||
|
chatSecret:
|
||||||
|
Description: "The JSON secret that holds the database username and password. Fields are 'host', 'port', 'dbname', 'username', 'password', 'dbClusterIdentifier' and 'engine'"
|
||||||
|
Value: !Ref chatAuroraSecret
|
||||||
|
Export:
|
||||||
|
Name: !Sub ${App}-${Env}-chatAuroraSecret
|
||||||
|
chatSecurityGroup:
|
||||||
|
Description: "The security group to attach to the workload."
|
||||||
|
Value: !Ref chatWorkloadSecurityGroup
|
||||||
|
Export:
|
||||||
|
Name: !Sub ${App}-${Env}-chatSecurityGroup
|
@ -18,4 +18,4 @@ type: Environment
|
|||||||
|
|
||||||
# Configure observability for your environment resources.
|
# Configure observability for your environment resources.
|
||||||
observability:
|
observability:
|
||||||
container_insights: false
|
container_insights: true
|
||||||
|
21
copilot/environments/sndev/manifest.yml
Normal file
21
copilot/environments/sndev/manifest.yml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# The manifest for the "sndev" environment.
|
||||||
|
# Read the full specification for the "Environment" type at:
|
||||||
|
# https://aws.github.io/copilot-cli/docs/manifest/environment/
|
||||||
|
|
||||||
|
# Your environment name will be used in naming your resources like VPC, cluster, etc.
|
||||||
|
name: sndev
|
||||||
|
type: Environment
|
||||||
|
|
||||||
|
# Import your own VPC and subnets or configure how they should be created.
|
||||||
|
# network:
|
||||||
|
# vpc:
|
||||||
|
# id:
|
||||||
|
|
||||||
|
# Configure the load balancers in your environment, once created.
|
||||||
|
# http:
|
||||||
|
# public:
|
||||||
|
# private:
|
||||||
|
|
||||||
|
# Configure observability for your environment resources.
|
||||||
|
observability:
|
||||||
|
container_insights: true
|
55
copilot/exec/manifest.yml
Normal file
55
copilot/exec/manifest.yml
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
# The manifest for the "exec" service.
|
||||||
|
# Read the full specification for the "Load Balanced Web Service" type at:
|
||||||
|
# https://aws.github.io/copilot-cli/docs/manifest/lb-web-service/
|
||||||
|
|
||||||
|
# Your service name will be used in naming your resources like log groups, ECS services, etc.
|
||||||
|
name: exec
|
||||||
|
type: Load Balanced Web Service
|
||||||
|
|
||||||
|
# Distribute traffic to your service.
|
||||||
|
http:
|
||||||
|
# Requests to this path will be forwarded to your service.
|
||||||
|
# To match all requests you can use the "/" path.
|
||||||
|
path: 'exec'
|
||||||
|
# You can specify a custom health check path. The default is "/".
|
||||||
|
# healthcheck: '/'
|
||||||
|
|
||||||
|
# Configuration for your containers and service.
|
||||||
|
image:
|
||||||
|
location: amazon/amazon-ecs-sample
|
||||||
|
# Port exposed through your container to route traffic to it.
|
||||||
|
port: 80
|
||||||
|
|
||||||
|
storage:
|
||||||
|
volumes:
|
||||||
|
efs:
|
||||||
|
path: /var/lib/efs/
|
||||||
|
read_only: false
|
||||||
|
efs:
|
||||||
|
uid: 991
|
||||||
|
gid: 991
|
||||||
|
|
||||||
|
cpu: 256 # Number of CPU units for the task.
|
||||||
|
memory: 512 # Amount of memory in MiB used by the task.
|
||||||
|
count: 1 # Number of tasks that should be running in your service.
|
||||||
|
exec: true # Enable running commands in your container.
|
||||||
|
network:
|
||||||
|
connect: true # Enable Service Connect for intra-environment traffic between services.
|
||||||
|
|
||||||
|
# storage:
|
||||||
|
# readonly_fs: true # Limit to read-only access to mounted root filesystems.
|
||||||
|
|
||||||
|
# Optional fields for more advanced use-cases.
|
||||||
|
#
|
||||||
|
#variables: # Pass environment variables as key value pairs.
|
||||||
|
# LOG_LEVEL: info
|
||||||
|
|
||||||
|
#secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
|
||||||
|
# GITHUB_TOKEN: GITHUB_TOKEN # The key is the name of the environment variable, the value is the name of the SSM parameter.
|
||||||
|
|
||||||
|
# You can override any of the values defined above by environment.
|
||||||
|
#environments:
|
||||||
|
# test:
|
||||||
|
# count: 2 # Number of tasks to run for the "test" environment.
|
||||||
|
# deployment: # The deployment strategy for the "test" environment.
|
||||||
|
# rolling: 'recreate' # Stops existing tasks before new ones are started for faster deployments.
|
53
copilot/synapse-generate/manifest.yml
Normal file
53
copilot/synapse-generate/manifest.yml
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# The manifest for the "synapse-generate" job.
|
||||||
|
# Read the full specification for the "Scheduled Job" type at:
|
||||||
|
# https://aws.github.io/copilot-cli/docs/manifest/scheduled-job/
|
||||||
|
|
||||||
|
# Your job name will be used in naming your resources like log groups, ECS Tasks, etc.
|
||||||
|
name: synapse-generate
|
||||||
|
type: Scheduled Job
|
||||||
|
|
||||||
|
# Trigger for your task.
|
||||||
|
on:
|
||||||
|
# The scheduled trigger for your job. You can specify a Unix cron schedule or keyword (@weekly) or a rate (@every 1h30m)
|
||||||
|
# AWS Schedule Expressions are also accepted: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html
|
||||||
|
schedule: "none"
|
||||||
|
#retries: 3 # Optional. The number of times to retry the job before failing.
|
||||||
|
#timeout: 1h30m # Optional. The timeout after which to stop the job if it's still running. You can use the units (h, m, s).
|
||||||
|
|
||||||
|
# Configuration for your container and task.
|
||||||
|
image:
|
||||||
|
location: matrixdotorg/synapse:latest
|
||||||
|
command: generate
|
||||||
|
|
||||||
|
cpu: 256 # Number of CPU units for the task.
|
||||||
|
memory: 512 # Amount of memory in MiB used by the task.
|
||||||
|
|
||||||
|
storage:
|
||||||
|
volumes:
|
||||||
|
efs:
|
||||||
|
path: /var/lib/efs/
|
||||||
|
read_only: false
|
||||||
|
efs:
|
||||||
|
id: fs-0b9130403869b3430
|
||||||
|
auth:
|
||||||
|
iam: true
|
||||||
|
access_point_id: fsap-06cd2e16280eb6c27
|
||||||
|
|
||||||
|
# Optional fields for more advanced use-cases.
|
||||||
|
#
|
||||||
|
variables: # Pass environment variables as key value pairs.
|
||||||
|
SYNAPSE_SERVER_NAME: sndev.team
|
||||||
|
SYNAPSE_REPORT_STATS: no
|
||||||
|
SYNAPSE_CONFIG_DIR: /var/lib/efs/matrix
|
||||||
|
SYNAPSE_DATA_DIR: /var/lib/efs/matrix
|
||||||
|
UID: 991
|
||||||
|
GID: 991
|
||||||
|
|
||||||
|
|
||||||
|
#secrets: # Pass secrets from AWS Systems Manager (SSM) Parameter Store.
|
||||||
|
# GITHUB_TOKEN: GITHUB_TOKEN # The key is the name of the environment variable, the value is the name of the SSM parameter.
|
||||||
|
|
||||||
|
# You can override any of the values defined above by environment.
|
||||||
|
#environments:
|
||||||
|
# prod:
|
||||||
|
# cpu: 2048 # Larger CPU value for prod environment.
|
10
package-lock.json
generated
10
package-lock.json
generated
@ -69,7 +69,6 @@
|
|||||||
"react-datepicker": "^4.20.0",
|
"react-datepicker": "^4.20.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-ios-pwa-prompt": "^1.8.4",
|
"react-ios-pwa-prompt": "^1.8.4",
|
||||||
"react-longpressable": "^1.1.1",
|
|
||||||
"react-markdown": "^9.0.1",
|
"react-markdown": "^9.0.1",
|
||||||
"react-string-replace": "^1.1.1",
|
"react-string-replace": "^1.1.1",
|
||||||
"react-syntax-highlighter": "^15.5.0",
|
"react-syntax-highlighter": "^15.5.0",
|
||||||
@ -16164,15 +16163,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
|
||||||
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
|
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
|
||||||
},
|
},
|
||||||
"node_modules/react-longpressable": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/react-longpressable/-/react-longpressable-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-Q8S7CzZVNmP123tHrMp0U0+/fgDEZCi5CpOGkabz3a2zQ0aek5IAizetxtxBAt1hQHHaAYynPHhtcSkLIkqEzQ==",
|
|
||||||
"peerDependencies": {
|
|
||||||
"prop-types": "^15.6.1",
|
|
||||||
"react": "^16.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/react-markdown": {
|
"node_modules/react-markdown": {
|
||||||
"version": "9.0.1",
|
"version": "9.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-9.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-9.0.1.tgz",
|
||||||
|
@ -74,7 +74,6 @@
|
|||||||
"react-datepicker": "^4.20.0",
|
"react-datepicker": "^4.20.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-ios-pwa-prompt": "^1.8.4",
|
"react-ios-pwa-prompt": "^1.8.4",
|
||||||
"react-longpressable": "^1.1.1",
|
|
||||||
"react-markdown": "^9.0.1",
|
"react-markdown": "^9.0.1",
|
||||||
"react-string-replace": "^1.1.1",
|
"react-string-replace": "^1.1.1",
|
||||||
"react-syntax-highlighter": "^15.5.0",
|
"react-syntax-highlighter": "^15.5.0",
|
||||||
@ -121,4 +120,4 @@
|
|||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"standard": "^17.1.0"
|
"standard": "^17.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user