-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add URL_REGEX option * Verify URL on link update * Edit release script to not include version header * Update docker-compose.yml env variables
- Loading branch information
1 parent
ea03c09
commit edca8ab
Showing
9 changed files
with
148 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,31 @@ | ||
DB_HOST=localhost | ||
DB_PORT=27017 | ||
|
||
DB_PASSWORD= | ||
DB_USER= | ||
|
||
JWT_KEY= | ||
|
||
URL_LENGTH=8 | ||
URL_SET=standard | ||
URL_ONLY_UNIQUE=false | ||
|
||
NODE_ENV=production | ||
|
||
HOME_REDIRECT=/dash/overview | ||
FORCE_FRONTEND_REDIRECT=false | ||
ENABLE_REGISTRATION=false | ||
DOMAIN=http://example.com | ||
DEMO=false | ||
|
||
USE_HTTPS=true | ||
CORS=* | ||
|
||
UMAMI_SITEID= | ||
UMAMI_URL= | ||
|
||
BACKUP=true | ||
BACKUP_SCHEDULE=* * * * * | ||
BACKUP_COUNT=5 | ||
DB_HOST=localhost | ||
DB_PORT=27017 | ||
|
||
DB_PASSWORD= | ||
DB_USER= | ||
|
||
JWT_KEY= | ||
|
||
URL_LENGTH=8 | ||
URL_SET=standard | ||
URL_ONLY_UNIQUE=false | ||
|
||
NODE_ENV=production | ||
|
||
HOME_REDIRECT=/dash/overview | ||
FORCE_FRONTEND_REDIRECT=false | ||
ENABLE_REGISTRATION=false | ||
DOMAIN=http://example.com | ||
DEMO=false | ||
|
||
USE_HTTPS=true | ||
CORS=* | ||
|
||
UMAMI_SITEID= | ||
UMAMI_URL= | ||
|
||
BACKUP=true | ||
BACKUP_SCHEDULE=* * * * * | ||
BACKUP_COUNT=5 | ||
|
||
URL_REGEX="https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.5.4 | ||
1.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,47 @@ | ||
version: "3" | ||
services: | ||
lynx-db: | ||
image: mongo | ||
restart: always | ||
container_name: lynx-db | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=user | ||
- MONGO_INITDB_ROOT_PASSWORD=paswd | ||
volumes: | ||
- ./db:/data/db | ||
ports: | ||
- 27017:27017 | ||
|
||
lynx: | ||
image: jackbailey/lynx | ||
build: | ||
context: . | ||
restart: always | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- lynx-db | ||
volumes: | ||
- ./backups:/app/backups | ||
environment: | ||
- NODE_ENV=production | ||
- DB_USER=user | ||
- DB_PASSWORD=paswd | ||
- JWT_KEY=1234567890 | ||
- URL_LENGTH=8 | ||
- URL_SET=standard | ||
- URL_ONLY_UNIQUE=false | ||
- HOME_REDIRECT=/dash/overview | ||
- FORCE_FRONTEND_REDIRECT=false | ||
- ENABLE_REGISTRATION=false # First registration will always be allowed | ||
- DOMAIN=http://example.com | ||
- DEMO=false | ||
- USE_HTTPS=false | ||
- BACKUP=true | ||
- BACKUP_SCHEDULE=* * * * * # Use crontab.guru to create | ||
- BACKUP_COUNT=5 # A count of 1 will make a backup file called backup.json | ||
|
||
## DO NOT CHANGE THESE: | ||
- DB_HOST=lynx-db | ||
- DB_PORT=27017 | ||
version: "3" | ||
services: | ||
lynx-db: | ||
image: mongo | ||
restart: always | ||
container_name: lynx-db | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=user | ||
- MONGO_INITDB_ROOT_PASSWORD=paswd | ||
volumes: | ||
- ./db:/data/db | ||
ports: | ||
- 27017:27017 | ||
|
||
lynx: | ||
image: jackbailey/lynx | ||
build: | ||
context: . | ||
restart: always | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- lynx-db | ||
volumes: | ||
- ./backups:/app/backups | ||
environment: | ||
- NODE_ENV=production | ||
- DB_USER=user | ||
- DB_PASSWORD=paswd | ||
- JWT_KEY=1234567890 | ||
- URL_LENGTH=8 | ||
- URL_SET=standard | ||
- URL_ONLY_UNIQUE=false | ||
- HOME_REDIRECT=/dash/overview | ||
- FORCE_FRONTEND_REDIRECT=false | ||
- ENABLE_REGISTRATION=false # First registration will always be allowed | ||
- DOMAIN=http://example.com | ||
- DEMO=false | ||
- USE_HTTPS=false | ||
- BACKUP=true | ||
- BACKUP_SCHEDULE=* * * * * # Use crontab.guru to create | ||
- BACKUP_COUNT=5 # A count of 1 will make a backup file called backup.json | ||
- URL_REGEX=https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) # Don't use quotation marks | ||
|
||
## DO NOT CHANGE THESE: | ||
- DB_HOST=lynx-db | ||
- DB_PORT=27017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
version: "3" | ||
services: | ||
db: | ||
image: mongo | ||
restart: always | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME= | ||
- MONGO_INITDB_ROOT_PASSWORD= | ||
volumes: | ||
- ./db:/data/db | ||
|
||
lynx: | ||
image: jackbailey/lynx:1 | ||
restart: always | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- db | ||
volumes: | ||
- ./backups:/app/backups | ||
environment: | ||
- NODE_ENV=production | ||
- DB_USER= | ||
- DB_PASSWORD= | ||
- JWT_KEY= | ||
- URL_LENGTH=8 | ||
- URL_SET=standard | ||
- URL_ONLY_UNIQUE=false | ||
- HOME_REDIRECT=/dash/overview | ||
- FORCE_FRONTEND_REDIRECT=false | ||
- ENABLE_REGISTRATION=false # First registration will always be allowed | ||
- DOMAIN=http://example.com | ||
- DEMO=false | ||
- USE_HTTPS=true | ||
- CORS=* | ||
- BACKUP=true | ||
- BACKUP_SCHEDULE=* * * * * # Use crontab.guru to create | ||
- BACKUP_COUNT=5 # A count of 1 will make a backup file called backup.json | ||
|
||
## DO NOT CHANGE THESE: | ||
- DB_HOST=db | ||
- DB_PORT=27017 | ||
version: "3" | ||
services: | ||
db: | ||
image: mongo | ||
restart: always | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME= | ||
- MONGO_INITDB_ROOT_PASSWORD= | ||
volumes: | ||
- ./db:/data/db | ||
|
||
lynx: | ||
image: jackbailey/lynx:1 | ||
restart: always | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- db | ||
volumes: | ||
- ./backups:/app/backups | ||
environment: | ||
- NODE_ENV=production | ||
- DB_USER= | ||
- DB_PASSWORD= | ||
- JWT_KEY= | ||
- URL_LENGTH=8 | ||
- URL_SET=standard | ||
- URL_ONLY_UNIQUE=false | ||
- HOME_REDIRECT=/dash/overview | ||
- FORCE_FRONTEND_REDIRECT=false | ||
- ENABLE_REGISTRATION=false # First registration will always be allowed | ||
- DOMAIN=http://example.com | ||
- DEMO=false | ||
- USE_HTTPS=true | ||
- CORS=* | ||
- BACKUP=true | ||
- BACKUP_SCHEDULE=* * * * * # Use crontab.guru to create | ||
- BACKUP_COUNT=5 # A count of 1 will make a backup file called backup.json | ||
- URL_REGEX=https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) # Don't use quotation marks | ||
|
||
## DO NOT CHANGE THESE: | ||
- DB_HOST=db | ||
- DB_PORT=27017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
module.exports = (url) => { | ||
return /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/.test(url); | ||
}; | ||
module.exports = (url) => { | ||
let regex = new RegExp( | ||
process.env.URL_REGEX || "https?://(www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)" | ||
); | ||
return regex.test(url); | ||
}; |