Change public_url config field name to base_url

This commit is contained in:
Alice Gaudon 2020-07-24 12:59:44 +02:00
parent 7f398c1d4e
commit 7a1656ea7f
5 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ export default {
},
log_level: "DEV",
db_log_level: "ERROR",
public_url: "http://localhost:4899",
base_url: "http://localhost:4899",
public_websocket_url: "ws://localhost:4899",
port: 4899,
gitlab_webhook_token: 'default',

View File

@ -1,7 +1,7 @@
export default {
log_level: "DEBUG",
db_log_level: "ERROR",
public_url: "https://watch-my.stream",
base_url: "https://watch-my.stream",
public_websocket_url: "wss://watch-my.stream",
session: {
cookie: {

View File

@ -34,7 +34,7 @@ export default abstract class Controller {
}
const queryStr = querystring.stringify(query);
return `${absolute ? config.get<string>('public_url') : ''}${path}` + (queryStr.length > 0 ? '?' + queryStr : '');
return `${absolute ? config.get<string>('base_url') : ''}${path}` + (queryStr.length > 0 ? '?' + queryStr : '');
}
private readonly router: Router = express.Router();

View File

@ -97,7 +97,7 @@ export default class Mail {
// Set data
this.data.mail_subject = this.options.subject;
this.data.mail_to = this.options.to;
this.data.mail_link = config.get<string>('public_url') + Controller.route('mail', [this.template.template], this.data);
this.data.mail_link = config.get<string>('base_url') + Controller.route('mail', [this.template.template], this.data);
this.data.app = config.get('app');
// Log

View File

@ -56,7 +56,7 @@ export default abstract class AuthGuard<P extends AuthProof> {
if (User.isApprovalMode()) {
await new Mail(PENDING_ACCOUNT_REVIEW_MAIL_TEMPLATE, {
username: user!.name,
link: Controller.route('accounts-approval'),
link: config.get<string>('base_url') + Controller.route('accounts-approval'),
}).send(config.get<string>('app.contact_email'));
}
} else {