Skip to content

Commit

Permalink
1.11.1 hotfix (#1886)
Browse files Browse the repository at this point in the history
* Update CHANGELOG.md

* Update TERMS_AND_CONDITIONS.md

* Update TERMS_AND_CONDITIONS.md

* Adding script to clear pro config

* Fixed #1863

* Closes caprover/caprover-pro#3

* Updated the changelog

* Fixed #1859

* updated the changelogs

* Fixed #1871

* Upped version - ready for hotfix
  • Loading branch information
githubsaturn committed Sep 17, 2023
1 parent a7c434e commit b7c114e
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## [Next Version - available as `edge`]

- Fixed: Malformatted SSH issue [Issue-1863](https://github.com/caprover/caprover/issues/1863)
- Fixed: Cannot save due to undefined property [Issue-1871](https://github.com/caprover/caprover/issues/1871)
- New/Experimental: Added a helper script for disabling the OTP
- Improved: Locking the nginx version to avoid unstable deployments and upgrades

## [1.11.1] - 2023-08-27

- Improved: Pulling the new image before attempt to upgrade the CapRover engine to improve reliability of upgrades
- Improved: Allowed custom git usernames [PR-1254](https://github.com/caprover/caprover/pull/1254)
- Improved: Enabled gzip for the dashboard for a faster load
Expand Down
2 changes: 1 addition & 1 deletion TERMS_AND_CONDITIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CapRover developers will do their best to ensure that CapRover remains functiona

### Analytics

CapRover has built in anonymous usage analytics starting v1.11. CapRover **never** sends any private data, such as env vars, private images, etc. This anonymous information is only used to understand usage patterns of CapRover and optimize the experience for the users. For example, in the future, we will have the possibility to add download counts to one click apps. If you wish to disable anonymous analytics, you can do so by passing an env variable CAPROVER_DISABLE_ANALYTICS=true to CapRover service. In the future, we will use this information to find out which one click apps are popular, whether or not we should focus on supporting multiple nodes (percentage of single node vs multi node), whether or not we should invest in supporting multi CPU clusters, and etc.
CapRover has built in anonymous usage analytics starting v1.11. CapRover **never** sends any private data, such as env vars, private images, etc. This anonymous information is only used to understand usage patterns of CapRover and optimize the experience for the users. For example, in the future, we will have the possibility to add download counts to one click apps. If you wish to disable anonymous analytics, you can do so by passing an env variable CAPROVER_DISABLE_ANALYTICS=true to CapRover service. You can add this to the installation line, or use `docker service update --env-add CAPROVER_DISABLE_ANALYTICS=true captain-captain` for an existing service. In the future, we will use this information to find out which one click apps are popular, whether or not we should focus on supporting multiple nodes (percentage of single node vs multi node), whether or not we should invest in supporting multi CPU clusters, and etc. Here is [the link](https://github.com/caprover/caprover/blob/master/src/user/events/emitter/AnalyticsLogger.ts#L22-L25) to all analytics events that CapRover collects.

### Future changes

Expand Down
2 changes: 1 addition & 1 deletion dev-scripts/build_and_push_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ echo $IMAGE_NAME:$CAPROVER_VERSION
echo "**************************************"
echo "**************************************"

FRONTEND_COMMIT_HASH=36b569a0e9f9170ea10c80c989119ac880db807b
FRONTEND_COMMIT_HASH=d22029558a22b5f072d182965ad4495266bada67

## Building frontend app
ORIG_DIR=$(pwd)
Expand Down
16 changes: 16 additions & 0 deletions dev-scripts/clear-pro-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*jshint esversion: 6 */

const fs = require('fs-extra')
const CONFIG_FILE_PATH = '/captain/data/config-captain.json'

const fileContent = JSON.parse(
fs.readFileSync(CONFIG_FILE_PATH, {
encoding: 'utf-8',
})
)

fs.writeFileSync(CONFIG_FILE_PATH + '.backup', JSON.stringify(fileContent))

fileContent.pro = {}

fs.writeFileSync(CONFIG_FILE_PATH, JSON.stringify(fileContent))
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"disable-otp": "node ./built/scripts/disable-otp.js",
"dev": "npm run build && sudo ./dev-scripts/dev-reset-service.sh",
"clean": "npm run build && sudo ./dev-scripts/dev-clean-run-as-dev.sh",
"lint": "eslint -c .eslintrc.js --ext .ts ./src",
Expand Down
6 changes: 6 additions & 0 deletions src/scripts/disable-otp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import DataStoreProvider from '../datastore/DataStoreProvider'

DataStoreProvider.getDataStore('captain')
.getProDataStore()
.setOtpEnabled(false)
.catch((err) => console.log(err))
2 changes: 2 additions & 0 deletions src/user/Authenticator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ class Authenticator {
captainSalt,
namespace
)
} else {
throw new Error('Salt is not set! Cannot create authenticator')
}
}

Expand Down
1 change: 1 addition & 0 deletions src/user/pro/ProManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export default class ProManager {
return {
isSubscribed: !!apiKey,
isFeatureFlagEnabled:
!!EnvVars.CAPTAIN_IS_DEBUG || //
!!apiKey || // if API key is there, assume feature flag is enabled
!!EnvVars.FORCE_ENABLE_PRO || //
(flags && flags[FeatureFlags.IS_PRO_ENABLED]),
Expand Down
4 changes: 2 additions & 2 deletions src/utils/CaptainConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CONSTANT_FILE_OVERRIDE_USER =
const configs = {
publishedNameOnDockerHub: 'caprover/caprover',

version: '1.11.0',
version: '1.11.1',

defaultMaxLogSize: '512m',

Expand All @@ -41,7 +41,7 @@ const configs = {

appPlaceholderImageName: 'caprover/caprover-placeholder-app:latest',

nginxImageName: 'nginx:1',
nginxImageName: 'nginx:1.24',

defaultEmail: '[email protected]',

Expand Down
2 changes: 1 addition & 1 deletion src/utils/GitHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class GitHelper {
/(?<domain>[^\s\/\?#:]+)/,
/(?::(?<port>[0-9]{1,5}))?/,
/(?:[\/:](?<owner>[^\s\/\?#:]+))?/,
/(?:[\/:](?<repo>(?:[^\s\/\?#:.]|\.(?!git\/?\s*$))+))/,
/(?:[\/:](?<repo>(?:[^\s\?#:.]|\.(?!git\/?\s*$))+))/,
/(?:.git)?\/?\s*$/,
]
.map((r) => r.source)
Expand Down
15 changes: 7 additions & 8 deletions tests/GitHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ test('Testing - sanitizeRepoPathSsh', () => {
).toBe('ssh://[email protected]:22/username/repository.git')
})

test('Testing - sanitizeRepoPathSsh', () => {
expect(
GitHelper.sanitizeRepoPathSsh(' [email protected]/test1/test2/test3.git')
.repoPath
).toBe('ssh://[email protected]:22/test1/test2/test3.git')
})

test('Testing - sanitizeRepoPathSsh - port', () => {
expect(
GitHelper.sanitizeRepoPathSsh(
Expand Down Expand Up @@ -118,14 +125,6 @@ test('Testing - sanitizeRepoPathSsh - no owner', () => {
).toBe('ssh://[email protected]:22/repository.git')
})

test('Testing - sanitizeRepoPathSsh - invalid url', () => {
expect(() =>
GitHelper.sanitizeRepoPathSsh(
' git:[email protected]/owner/repository.git/ '
)
).toThrow(Error)
})

test('Testing - getDomainFromSanitizedSshRepoPath - pure', () => {
expect(
GitHelper.getDomainFromSanitizedSshRepoPath(
Expand Down

0 comments on commit b7c114e

Please sign in to comment.