47
README.md
47
README.md
@ -174,3 +174,50 @@ WantedBy=multi-user.target
|
|||||||
- and another
|
- and another
|
||||||
- Username: `shyshkin.art`
|
- Username: `shyshkin.art`
|
||||||
- Password: `5C<"0dVx=>`
|
- Password: `5C<"0dVx=>`
|
||||||
|
|
||||||
|
#### 33 deploy frontend into s3 bucket
|
||||||
|
|
||||||
|
1. S3 console
|
||||||
|
- Create bucket: `portal.shyshkin.net`
|
||||||
|
2. Build Angular app
|
||||||
|
- create `environment.test.ts`
|
||||||
|
- modify `angular.json`
|
||||||
|
- `ng build -c test`
|
||||||
|
3. Copy files from `dist/support-portal-frontend` to the bucket
|
||||||
|
4. Static website hosting
|
||||||
|
- Enable
|
||||||
|
- index.html
|
||||||
|
5. Allow public access
|
||||||
|
- `Block public access (bucket settings)` - All OFF
|
||||||
|
6. Edit bucket policy
|
||||||
|
- `{`
|
||||||
|
- ` "Version": "2012-10-17",`
|
||||||
|
- ` "Statement": [`
|
||||||
|
- ` {`
|
||||||
|
- ` "Sid": "PublicRead",`
|
||||||
|
- ` "Effect": "Allow",`
|
||||||
|
- ` "Principal": "*",`
|
||||||
|
- ` "Action": [`
|
||||||
|
- ` "s3:GetObject",`
|
||||||
|
- ` "s3:GetObjectVersion"`
|
||||||
|
- ` ],`
|
||||||
|
- ` "Resource": "arn:aws:s3:::portal.shyshkin.net/*"`
|
||||||
|
- ` }`
|
||||||
|
- ` ]`
|
||||||
|
- `}`
|
||||||
|
7. Visit `http://portal.shyshkin.net.s3-website.eu-north-1.amazonaws.com`
|
||||||
|
8. Make an Alias to Website
|
||||||
|
- Route 53 console
|
||||||
|
- Hosted zone: shyshkin.net
|
||||||
|
- Add record
|
||||||
|
- Name: portal
|
||||||
|
- Record Type: A
|
||||||
|
- Routing policy: Simple routing
|
||||||
|
- Alias: true
|
||||||
|
- Alias to S3 website endpoint
|
||||||
|
- Stockholm
|
||||||
|
- s3-website.eu-north-1.amazonaws.com
|
||||||
|
9. Tune CORS for backend
|
||||||
|
- add `http://portal.shyshkin.net`
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ spring:
|
|||||||
app:
|
app:
|
||||||
public-urls: /user/login,/user/register,/user/*/image/**,/user/image/**
|
public-urls: /user/login,/user/register,/user/*/image/**,/user/image/**
|
||||||
cors:
|
cors:
|
||||||
allowed-origins: http://localhost:4200,https://localhost:4200,http://art-support-portal.s3-website.eu-north-1.amazonaws.com
|
allowed-origins: http://localhost:4200,https://localhost:4200,http://art-support-portal.s3-website.eu-north-1.amazonaws.com,http://portal.shyshkin.net
|
||||||
jwt:
|
jwt:
|
||||||
secret: VeRy_5ecretP@55W0rd!
|
secret: VeRy_5ecretP@55W0rd!
|
||||||
# secret: ${random.value} #Does not work - every time generates new value
|
# secret: ${random.value} #Does not work - every time generates new value
|
||||||
@ -80,7 +80,7 @@ app:
|
|||||||
from: d.art.shishkin@gmail.com
|
from: d.art.shishkin@gmail.com
|
||||||
carbon-copy: d.art.shishkin@gmail.com
|
carbon-copy: d.art.shishkin@gmail.com
|
||||||
cors:
|
cors:
|
||||||
allowed-origins: http://localhost:4200,http://art-support-portal.s3-website.eu-north-1.amazonaws.com,http://support-portal.shyshkin.net
|
allowed-origins: http://localhost:4200,http://art-support-portal.s3-website.eu-north-1.amazonaws.com,http://support-portal.shyshkin.net,http://portal.shyshkin.net
|
||||||
server:
|
server:
|
||||||
port: 5000
|
port: 5000
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
@ -56,6 +56,27 @@
|
|||||||
],
|
],
|
||||||
"outputHashing": "all"
|
"outputHashing": "all"
|
||||||
},
|
},
|
||||||
|
"test": {
|
||||||
|
"budgets": [
|
||||||
|
{
|
||||||
|
"type": "initial",
|
||||||
|
"maximumWarning": "500kb",
|
||||||
|
"maximumError": "1mb"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "anyComponentStyle",
|
||||||
|
"maximumWarning": "2kb",
|
||||||
|
"maximumError": "4kb"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.test.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"outputHashing": "all"
|
||||||
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"buildOptimizer": false,
|
"buildOptimizer": false,
|
||||||
"optimization": false,
|
"optimization": false,
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
export const environment = {
|
||||||
|
production: false,
|
||||||
|
apiUrl: 'http://localhost:8080',
|
||||||
|
publicUrls: ['/user/login', '/user/register', '/user/*/image/**', '/user/image/**']
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user