Skip to content

Commit

Permalink
CONF up1 common
Browse files Browse the repository at this point in the history
  • Loading branch information
prigaux committed Nov 25, 2024
1 parent a0bf166 commit c6bf3ed
Show file tree
Hide file tree
Showing 9 changed files with 676 additions and 23 deletions.
5 changes: 4 additions & 1 deletion app/src/controllers/CompareUsers.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<div>
<p><b>{{homonyme.mail || homonyme.uid || homonyme.supannMailPerso || homonyme.barcode}}</b> <span v-html="homonyme.global_main_profile.description"></span></p>
<p><b>
<a v-if="homonyme.uid" :href="'https://userinfo.univ-paris1.fr/#' + (homonyme.mail || homonyme.uid)">{{homonyme.mail || homonyme.uid}}</a>
<span v-else>{{homonyme.supannMailPerso || homonyme.barcode}}</span>
</b> <span v-html="homonyme.global_main_profile.description"></span></p>

<table class="table table-bordered">
<tbody>
Expand Down
2 changes: 1 addition & 1 deletion app/src/controllers/StepV.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</div>

<div v-if="v_ldap && v_ldap.global_main_profile && !(v.global_main_profile && v.global_main_profile.description === v_ldap.global_main_profile.description) && !merged_homonyms.some(h => h.uid === v_ldap.uid)" class="alert alert-info">
La demande concerne le compte existant « {{v_ldap.uid}} »
La demande concerne le compte existant « <a style="text-decoration: underline;" :href="'https://userinfo.univ-paris1.fr/#' + v_ldap.uid">{{v_ldap.uid}}</a> »
({{v_ldap.givenName}} {{v_ldap.sn}} <span v-html="v_ldap.global_main_profile.description"></span>)
</div>

Expand Down
11 changes: 8 additions & 3 deletions app/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ export let router;

const _routes = {
'/playground': () => import('./controllers/Playground.vue'),
'/login/:kind?': { render(_h) { router.replace(this.$route.query.then) } }, // TODO, use vue-router redirect
'/login/:kind?': { render(_h) {
const then = this.$route.query.then;
if ("reload_to_test" in this.$route.query)
document.location.href = conf.base_pathname + "test/#" + then;
else
router.replace(then) // TODO, use vue-router redirect
} },
'/steps/:kind?': ModerateList,
'/:stepName/:wanted_id?': Step,
'/': { template: template_welcome },
Expand All @@ -29,8 +35,7 @@ const opts = {
routes,
};

declare var process;
if (process.env.NODE_ENV === 'production') {
if (!conf.base_pathname.match(/\/test\/$/)) {
opts.mode = 'history';
}

Expand Down
9 changes: 7 additions & 2 deletions app/src/services/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export interface InitialSteps {

import conf from '../conf';

const api_url = conf.base_pathname + 'api';
const non_test_base_pathname = conf.base_pathname.replace(/\/test\/$/, '/');
const api_url = non_test_base_pathname + 'api';

export function eachAttrs(attrs: StepAttrsOption, oneOfTraversal: 'always' | 'never', f: (opts: StepAttrOption, key: string, attrs: StepAttrsOption) => void) {
function rec_mpp(mpp: Mpp) {
Expand Down Expand Up @@ -141,7 +142,11 @@ function _handleErr(err : AxiosError, $scope = null, redirect = false) {
console.log("must relog", resp.headers.toString());
restarting = true;
const type = resp.data && resp.data.authenticate && resp.data.authenticate.type || $scope.$route.query.idp || 'local';
const location = conf.base_pathname + 'login/' + type + '?then=' + encodeURIComponent($scope.$route.fullPath);
const need_reload_to_test = type === 'cas_with_pgt' && conf.base_pathname !== non_test_base_pathname;
const location =
(need_reload_to_test ? non_test_base_pathname : conf.base_pathname) +
'login/' + type + '?then=' + encodeURIComponent($scope.$route.fullPath) +
(need_reload_to_test ? "&reload_to_test" : '');
document.location.href = resp.data?.authenticate?.need_relog_local ? `/Shibboleth.sso/Logout?return=${encodeURIComponent(location)}` : location
return Promise.reject("logging...");
} else if (resp.status === 401) {
Expand Down
45 changes: 30 additions & 15 deletions server/conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { sameKeyNameChoices } from './helpers';
import * as grouped_calls from './helper_grouped_calls';
import shared_conf from '../shared/conf';

const ldap_base = "dc=univ,dc=fr";
const ldap_base = "dc=univ-paris1,dc=fr";
const ldap_main = {
uri: ['ldap://ldap-test.univ.fr'],
uri: ['ldap://ldap-pmf2.univ-paris1.fr', 'ldap://ldap-pth2.univ-paris1.fr', 'ldap://ldap-pth1.univ-paris1.fr'],

// empty for anonymous bind:
dn: 'cn=comptex,ou=admin,' + ldap_base,
Expand All @@ -27,23 +27,24 @@ const ldap_main = {
base_rolesGeneriques: "ou=supannRoleGenerique,ou=tables," + ldap_base,
base_etablissements: "ou=supannEtablissement,ou=tables," + ldap_base,

uid_to_eppn: "@univ.fr",
uid_to_eppn: "@univ-paris1.fr",
};

const internal_organizations = [
'{UAI}0751717J', // Univ Paris 1
'{UAI}0752719Y', // SCD
'{UAI}0753364Z', // IAE
];

const conf = {
maxLiveModerators: 100,

mainUrl: 'https://comptex.univ.fr' + shared_conf.base_pathname.replace(/\/$/, ''),
mainUrl: 'https://comptex.univ-paris1.fr' + shared_conf.base_pathname.replace(/\/$/, ''),

mail: {
from: 'Assistance <assistance@univ.fr>',
intercept: 'Admin <[email protected]>',
transport: sendmailTransport({}),
from: 'DSIUN Université Paris 1 Panthéon-Sorbonne <no-reply@univ-paris1.fr>',
intercept: '', //'Admin <[email protected]>',
transport: sendmailTransport({ path: '/usr/sbin/sendmail' }), // give sendmail with full path (since PATH may not have /usr/sbin/)
},

sv_ttl_days: 1/*year*/ * 365, // auto-purge after xxx days unmodified
Expand All @@ -53,15 +54,15 @@ const conf = {
},

esup_activ_bo: {
url: "http://xxxx.univ.fr:8080/esup-activ-bo/",
url: "http://marmite.univ-paris1.fr:8080/esup-activ-bo/",
},

esupUserApps: {
url: '', //'https://ent.univ.fr/EsupUserApps',
url: 'https://ent.univ-paris1.fr/EsupUserApps',
},

ldap: {
shibIdentityProvider: 'https://idp.univ.fr',
shibIdentityProvider: 'urn:mace:cru.fr:federation:univ-paris1.fr',

...ldap_main,

Expand Down Expand Up @@ -152,10 +153,13 @@ const conf = {
supannCodeINE: '',

termsOfUse: [''],
supannConsentement: [''],
supannListeRouge: '',

comment: '', demandeUrl: '',
up1Profile: [] as any[],
'{SMSU}CG': '', '{PHOTO}PUBLIC': '', '{PHOTO}INTRANET': '', '{PHOTO}STUDENT': '',
'{SMSU}CG': '', '{PAGER}DISPLAY.FACULTY': '', '{PHOTO}PUBLIC': '', '{PHOTO}INTRANET': '', '{PHOTO}STUDENT': '',
'{APPLI:OFFICE365}CGU': '',
},

attrs : {
Expand All @@ -166,6 +170,8 @@ const conf = {
altGivenName: { ldapAttr: 'up1AltGivenName' },
floorNumber: { ldapAttr: 'up1FloorNumber' },
roomAccess: { ldapAttr: 'up1RoomAccess' },
comment: { ldapAttr: 'info;x-demande' },
demandeUrl: { ldapAttr: 'labeledURI', convert: ldap_convert.withSuffixEtiquette(' {DEMANDE}') },
up1Profile: { convert: ldap_convert.up1Profile },
global_profilename: { ldapAttr: 'up1Profile', convert: ldap_convert.up1Profile_field('up1Source') },
profilename: { ldapAttr: 'up1Source', ldapAttrJson: 'profilename' },
Expand All @@ -188,17 +194,25 @@ const conf = {
global_siham: { ldapAttr: 'supannRefId', convert: ldap_convert.withEtiquette("{SIHAM}") },
jpegPhoto: { ldapAttr: 'jpegPhoto;base64' },
termsOfUse: { ldapAttr: 'up1TermsOfUse' },
..._.fromPairs(['{SMSU}CG', '{PHOTO}PUBLIC', '{PHOTO}INTRANET', '{PHOTO}STUDENT'].map(value =>
..._.fromPairs(['{SMSU}CG', '{PAGER}DISPLAY.FACULTY', '{PHOTO}PUBLIC', '{PHOTO}INTRANET', '{PHOTO}STUDENT'].map(value =>
[ value, { ldapAttr: 'up1TermsOfUse', convert: ldap_convert.has_value(value) } ]
)),
..._.fromPairs(['{APPLI:OFFICE365}CGU'].map(value =>
[ value, { ldapAttr: 'supannConsentement', convert: ldap_convert.has_value(value) } ]
)),
},
supannCiviliteChoices: sameKeyNameChoices([ 'M.', 'Mme' ]),

mail_domains: [
'univ-paris1.fr',
'etu.univ-paris1.fr',
'malix.univ-paris1.fr',
'anciens.univ-paris1.fr',
'bis-sorbonne.fr',
] as string[],

homonymes_preferStudent: (profilename: string) => !!(profilename || '').match(/^\{COMPTEX\}learner\./),
homonymes_restriction: '(objectClass=inetOrgPerson)',
homonymes_preferStudent: (profilename: string) => !!(profilename || '').match(/^\{COMPTEX:FC\}learner\./),
homonymes_restriction: '(&(objectClass=inetOrgPerson)(!(shadowFlag=2))(!(shadowFlag=8)))' // ignore dupes/deceased
},

group_cn_to_memberOf: (cn: string) => (
Expand Down Expand Up @@ -232,6 +246,7 @@ const conf = {
sn: 'sn',
givenName: 'givenName',
displayName: 'displayName',
supannEtablissement: 'supannEtablissement',
},
},

Expand All @@ -256,7 +271,7 @@ const conf = {
path: "/tmp"
} as session_file_store.Options,

trust_proxy: ['loopback'],
trust_proxy: ['loopback', /*ent-front*/ '193.55.96.44', '2001:660:3305::44'],

cas: {
ssoBaseURL: '', //'https://cas.univ.fr/cas/',
Expand Down
Loading

0 comments on commit c6bf3ed

Please sign in to comment.