Skip to content
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

Fix/e2e #502

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9bfb0ac
Merge pull request #12 from ProxeusApp/preprod
tafonina Jun 9, 2023
9d3d6a2
fix web3.fromAscii to web3.utils.asciiToHex method in document floe
Jun 13, 2023
029ab3e
Merge pull request #14 from sprotest/feature/fix-web3-method-fromAscii
tafonina Jun 13, 2023
028563a
replace web3 to this.wallet.proxeusFS.web3 as metamask no longer inje…
Jun 13, 2023
b069463
Merge pull request #15 from sprotest/feature/fix-web3-method-fromAscii
tafonina Jun 13, 2023
a5e9d02
Merge pull request #16 from ProxeusApp/preprod
tafonina Oct 19, 2023
26ef319
remove outdated methods of old smart contract
slavas490 Oct 24, 2023
6b2c7fc
add public urls in case user doesnt have metamask
Oct 24, 2023
7bff03b
Merge pull request #18 from sprotest/feature/remove-old-smartcontract…
slavas490 Oct 24, 2023
614e5a9
Merge branch 'develop' into feature/verify-doc
tafonina Oct 27, 2023
3710bb3
Merge pull request #19 from sprotest/feature/verify-doc
tafonina Oct 27, 2023
18b6f1c
fix js frontend typos
slavas490 Nov 1, 2023
29e1324
use public url only if user doesnt have metamask installed
Nov 2, 2023
be08fea
Merge branch 'feature/verify-doc' of github.com:sprotest/proxeus-core…
Nov 2, 2023
e164676
use public url only if user doesnt have metamask installed
Nov 2, 2023
d700aa2
Merge branch 'develop' into feature/verify-doc
tafonina Nov 2, 2023
88dd2fd
Merge pull request #20 from sprotest/feature/verify-doc
tafonina Nov 2, 2023
f3ecefe
add wrong metamask network selected issue handler
slavas490 Nov 2, 2023
4a98f86
fix user validation network screen
slavas490 Nov 2, 2023
1d8af13
remove unnecessary html code from VerificationFileEntry component
slavas490 Nov 2, 2023
e11d139
fix invalid character, updates in BN lib
Nov 3, 2023
b8056f0
fix invalid character, updates in BN lib
Nov 3, 2023
e1ac271
fix invalid character, updates in BN lib, revert to string and number…
Nov 3, 2023
11f7378
Merge pull request #21 from sprotest/feature/fix-invalid-charachter
tafonina Nov 3, 2023
458c0c1
remove delete buttons for form inputs
slavas490 Nov 13, 2023
cc08ea4
remove skipValidateFor date entry
slavas490 Nov 14, 2023
6065564
Merge pull request #22 from sprotest/feature/delete_property
slavas490 Nov 14, 2023
0a4489f
fix frontend error message for file not found
slavas490 Nov 16, 2023
968c255
Merge pull request #23 from sprotest/fix/file-validation
tafonina Nov 17, 2023
a2db174
update digitalocean deployment script
slavas490 Nov 22, 2023
c8fec16
Merge pull request #24 from sprotest/feature/droplet-support
tafonina Nov 23, 2023
4fafb6f
Merge branch 'preprod' into develop
tafonina Nov 30, 2023
ad9ed28
fix document name max length at 80 symbols
slavas490 Dec 7, 2023
e8dcae7
fix signup with metamask
slavas490 Dec 11, 2023
54631b7
fix restore-demo.sh file
slavas490 Dec 11, 2023
f9dac47
WIP: initial commit
slavas490 Jan 16, 2024
c2744dd
update baseApp.js
slavas490 Jan 17, 2024
9e8a9e1
Merge pull request #25 from sprotest/feature/dynamic-config
slavas490 Jan 17, 2024
45aac19
Revert "fix restore-demo.sh file"
slavas490 Jan 31, 2024
d36bc1b
revert dynamic-config
slavas490 Jan 31, 2024
02e2562
fix e2e test cases
slavas490 Jan 31, 2024
b7eaeca
remove waitforproxeus Makefile commang
slavas490 Feb 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/restore-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ destinationDataDir="/data/hosted/"

echo "Removing $destinationDataDir"

rm -R ${destinationDataDir}
rm -R ${destinationDataDir}*

echo "Resetting to initial status from $originDataDir.."
cp -R ${originDataDir} ${destinationDataDir}
Expand Down
31 changes: 22 additions & 9 deletions deploy/digitalocean/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,28 @@ This script is maintained for the community by Proxeus Association

## Instructions

1. Create fresh DO droplet with Ubuntu v.20+ with any basic Provision configuration
2. You will need to have your API keys for Infura and Sparkpost handy - see the root README for further details.
3. add executive permission for deploy.sh ( chmod +x deploy.sh )
4. run $PWD/proxeus-core/deploy/digitalocean/deploy.sh
5. It takes a few minutes for the server to boot and install, then you should be able to open `http://<your DO's IP address or domain>:1323/init`
6. A configuration screen will be shown where you can set up an admin account and check settings.

Once your server is running, visit the [User Handbook](https://github.com/ProxeusApp/community/blob/master/handbook/handbook.md) to get started.
1. Create fresh DO droplet with Ubuntu v.20+ with any basic Provision configuration. [Here](https://docs.digitalocean.com/products/droplets/getting-started/recommended-droplet-setup) you can find some help how to set up a production-ready droplet.
2. Make sure your API keys for Infura and Sparkpost.
3. Get the deployment script and make it executable:
```bash
wget https://raw.githubusercontent.com/ProxeusApp/proxeus-core/main/deploy/digitalocean/deploy.sh && chmod +x deploy.sh
```
4. Enter all the necessary variables, where **FQDN** - domain name for the future server, **INFURA** - your Infura API key, **SPARKPOST** - your SparkPost API key, **ADMINEMAIL** - admin email (in format like [email protected]). It can be done by editing the script file directly or by shell "export" command:
```bash
export FQDN=[value]
export INFURA=[value]
export SPARKPOST=[value]
export ADMINEMAIL=[value]
```
5. Run deployment process (go through it carefully, it may ask you any additional confirmation):
```bash
./deploy.sh
```
7. It takes a few minutes for the server to boot and install, then you should be able to open `http://<your DO's IP address or domain>:1323/init`
8. A configuration screen will be shown where you can set up an admin account and check settings.

Once your server is running, visit the [User Handbook](https://doc.proxeus.org/#/handbook) to get started.

To view the logs connect to your droplet using an SSH client program. Then paste this into the console to see the logs being updated in real time:

`cd /srv/proxeus && docker-compose logs -f`
`cd /srv/proxeus && docker-compose logs -f`
12 changes: 9 additions & 3 deletions deploy/digitalocean/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
#!/bin/bash
#specify values for local variables

# Specify values for local variables
#FQDN=<value>
#INFURA=<value>
#SPARKPOST=<value>
#ADMINEMAIL=<value>


## Performing the installation
exec 1> >(tee -a "/var/log/stackscript.log") 2>&1
function log {
echo "### $1 -- `date '+%D %T'`"
}

log "Configuring System Updates"
apt-get -o Acquire::ForceIPv4=true update -y
DEBIAN_FRONTEND=noninteractive apt-get -y -o DPkg::options::="--force-confdef" -o DPkg::options::="--force-confold" install grub-pc
Expand Down Expand Up @@ -109,11 +115,11 @@ cd /srv/proxeus
# make init server-docker

log "Starting cloud deployment via docker-compose"
docker-compose --env-file .env -f docker-compose.yml -f docker-compose-cloud.override.yml up -d &
docker-compose --env-file .env -f docker-compose.yml -f docker-compose-cloud.override.yml up -d >/dev/null 2>&1

# Open http://$FQDN:1323/init to configure your server
log "After a minute, open: http://$FQDN:1323/init"

## ----------------------------------------------

echo "Installation complete!"
echo "Installation complete!"
2 changes: 1 addition & 1 deletion service/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (me *DefaultDocumentService) Edit(auth model.Auth, userId string, formInput
if !ok {
return ErrUnableToEdit
}
if len(fName) >= 80 || !filenameRegex.MatchString(fName) {
if len(fName) > 80 || !filenameRegex.MatchString(fName) {
return ErrUnableToEdit
}
usrDataItem, err := userDataDB().Get(auth, userId)
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/cypress/integration/0_powerup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ describe(`Power up on ${url}`, () => {

it('should bring to home page after saving with default values', () => {
cy.get('button.btn-primary').eq(2).click()

cy.location('pathname', {
timeout: 60000
}).should('eq', '/');
})

})
})
10 changes: 8 additions & 2 deletions ui/core/src/DocumentApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,19 @@ export default {
color: $primary;
}

body {
overflow: hidden;
}

.navbar h1 {
margin-bottom: 0;
}

.app-main {
@media (max-width: 767px) {
max-width: 100% !important;
max-width: calc(100% - 265px);

@media (max-width: 979px) {
max-width: calc(100% - 80px);
}
}

Expand Down
68 changes: 34 additions & 34 deletions ui/core/src/baseApp.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import WalletInterface from './libs/WalletAdapter'

export default {
data () {
data() {
return {
me: null,
meta: null,
Expand All @@ -16,7 +16,7 @@ export default {
}
},
methods: {
makeURL (uri) {
makeURL(uri) {
let origin = location.origin
if (/.*\/$/.test(origin)) {
origin = origin.substring(0, origin.length - 1)
Expand All @@ -26,7 +26,7 @@ export default {
}
return origin + uri
},
isLangAvailable (lang) {
isLangAvailable(lang) {
if (this.meta && this.meta.activeLangs) {
for (let i = 0; i < this.meta.activeLangs.length; i++) {
if (this.meta.activeLangs[i] &&
Expand All @@ -37,37 +37,37 @@ export default {
}
return false
},
userIsRoot () {
userIsRoot() {
if (this.me) {
return this.me.role === 100
}
return false
},
userIsSuperAdmin () {
userIsSuperAdmin() {
if (this.me) {
return this.me.role > 10
}
return false
},
userIsAdminOrHigher () {
userIsAdminOrHigher() {
if (this.me) {
return this.me.role >= 10
}
return false
},
userIsCreatorOrHigher () {
userIsCreatorOrHigher() {
if (this.me) {
return this.me.role >= 7
}
return false
},
userIsUserOrHigher () {
userIsUserOrHigher() {
if (this.me) {
return this.me.role >= 5
}
return false
},
amIWriteGrantedFor (item) {
amIWriteGrantedFor(item) {
try {
// check authority
if (this.me.role >= 100) {
Expand Down Expand Up @@ -110,7 +110,7 @@ export default {
} catch (e) {}
return false
},
handleError (o) {
handleError(o) {
if (this.isConToServerLostError(o)) {
// couldn't reach the server
if (!this.intervalID) {
Expand All @@ -119,15 +119,15 @@ export default {
}
}
},
isConToServerLostError (o) {
isConToServerLostError(o) {
let txt = ''
try {
txt = o.data || o.request.response || o.request.responseText
} catch (e) {}
return (o.request && !o.response) ||
(window.webpackHotUpdate && /^.*\(ECONNREFUSED\)\.$/m.test(txt))
},
pingService () {
pingService() {
console.log('pingService')
axios.get('/api/config').then((r) => {
if (r.data) {
Expand All @@ -142,10 +142,10 @@ export default {
this.handleError(err)
})
},
getSelectedLang () {
getSelectedLang() {
return this.$cookie.get('lang') || this.fallbackLang()
},
setSelectedLang (lang) {
setSelectedLang(lang) {
if (lang) {
this.$cookie.set('lang', lang, {
expires: '1Y'
Expand All @@ -156,16 +156,16 @@ export default {
this.$i18n.set(this.fallbackLang())
}
},
checkUserHasSession () {
checkUserHasSession() {
return !!localStorage.getItem('userhassession')
},
initUserHasSession () {
initUserHasSession() {
localStorage.setItem('userhassession', true)
},
deleteUserHasSession () {
deleteUserHasSession() {
localStorage.removeItem('userhassession')
},
loadMe (clb) {
loadMe(clb) {
if (!this.checkUserHasSession()) {
return
}
Expand All @@ -185,7 +185,7 @@ export default {
this.handleError(err)
})
},
loadLastExportResults (clb, delParams) {
loadLastExportResults(clb, delParams) {
let url = '/api/export/results'
if (delParams) {
url += '?' + delParams
Expand All @@ -204,7 +204,7 @@ export default {
this.handleError(err)
})
},
loadLastImportResults (clb, delParams) {
loadLastImportResults(clb, delParams) {
let url = '/api/import/results'
if (delParams) {
url += '?' + delParams
Expand All @@ -223,7 +223,7 @@ export default {
this.handleError(err)
})
},
exportData (params, cb, url, name) {
exportData(params, cb, url, name) {
if (!url) {
url = '/api/export?include=' + params
} else {
Expand Down Expand Up @@ -278,7 +278,7 @@ export default {
})
})
},
importData (file, skipExisting, cb) {
importData(file, skipExisting, cb) {
if (!file) {
return
}
Expand Down Expand Up @@ -316,10 +316,10 @@ export default {
this.handleError(err)
})
},
async validateSessionCookie () {
async validateSessionCookie() {
return axios.get('/api/session/validate')
},
loadMeta (clb) {
loadMeta(clb) {
axios.get('/api/i18n/meta').then((response) => {
this.meta = response.data
if (this.meta && this.meta.langFallback) {
Expand All @@ -338,7 +338,7 @@ export default {
this.handleError(err)
})
},
updateLangLabel () {
updateLangLabel() {
if (this.meta && this.meta.activeLangs) {
for (let i = 0; i < this.meta.activeLangs.length; i++) {
this.meta.activeLangs[i].label = this.$t(
Expand All @@ -347,13 +347,13 @@ export default {
return this.meta.activeLangs
}
},
fallbackLang () {
fallbackLang() {
if (this.meta) {
return this.meta.langFallback
}
return null
},
getSelectedLangIndex () {
getSelectedLangIndex() {
if (this.meta && this.meta.activeLangs) {
for (let i = 0; i < this.meta.activeLangs.length; i++) {
if (this.meta.activeLangs[i].Code === this.getSelectedLang()) {
Expand All @@ -363,7 +363,7 @@ export default {
}
return null
},
reloadI18n () {
reloadI18n() {
axios.get('/api/i18n/all').then(
(response) => {
this.$i18n.add(this.getSelectedLang(), response.data)
Expand All @@ -374,7 +374,7 @@ export default {
this.handleError(err)
})
},
loadConfig () {
loadConfig() {
axios.get('/api/config').then(r => {
if (r.data) {
this.setConfig(r.data)
Expand All @@ -383,7 +383,7 @@ export default {
this.handleError(err)
})
},
async setConfig (d) {
async setConfig(d) {
if (d.blockchainNet) {
this.blockchainNet = d.blockchainNet
}
Expand All @@ -399,7 +399,7 @@ export default {
await this.wallet.validateUserNetwork(() => this.$root.$emit('service-off'), () => this.$root.$emit('service-on'))
}
},
acknowledgeFirstLogin () {
acknowledgeFirstLogin() {
// Show the following overlays starting now (they can be delayed)
localStorage.setItem('showFirstLoginMessageOn-documents', new Date())
if (this.userIsCreatorOrHigher()) {
Expand All @@ -409,13 +409,13 @@ export default {
},
computed: {
app: {
get () {
get() {
return this.$root.$children[0]
},
set (a) {}
set(a) {}
}
},
created () {
created() {
const tmpLangToPreventFromWarnings = 'en'
this.$i18n.fallback(tmpLangToPreventFromWarnings)
this.$i18n.set(tmpLangToPreventFromWarnings)
Expand Down
Loading