How to build authenticationendpoint and accountrecoveryendpoint in <apim-home>/repository/deployment/server/webapps - wso2-api-manager

I have deployed WSO2 API manager4.0.0 All-in-one on the vm. I found some wars and folders but i don't know where were they from, like authenticationendpoint and accountrecoveryendpoint, How to build them and which tag should I use ?

The accountrecoveryendpoint and authenticationendpoint webapps are obtained from the identity-apps repo [1]. The identity-apps version used in API-M 4.0.0 is 1.0.558 [2].
The accountrecoveryendpoint webapp can be obtained by building the recovery-portal directory [3] and the authenticationendpoint webapp can be obtained by building the authentication-portal directory [4].
[1] https://github.com/wso2/identity-apps
[2] https://github.com/wso2/product-apim/blob/v4.0.0/pom.xml#L1312
[3] https://github.com/wso2/identity-apps/tree/v1.0.558/apps/recovery-portal
[4] https://github.com/wso2/identity-apps/tree/v1.0.558/apps/authentication-portal

Related

Azure DevOps Project pipeline not able to access NuGet package from Artifact Feed in different Collection

Our organization has two separate collections
Application Development
Foobar Inc (Project)
Repo / Build pipeline (Pipeline)
External Applications (Collection)
External Applications (Project)
Artifacts
XYZ_SharedPackages (Nuget feed)
When I run the restore command for a project in Appliction Development for the Foobar Inc project I get
"C:\agent\_work\76\s\Foobar_Inc\Foobar_IncUI\Foobar_IncUI.csproj" (Restore target) (1) ->
(Restore target) ->
C:\Program Files\dotnet\sdk\6.0.200\NuGet.targets(130,5): error : Unable to load the service index for source
http://svp042iis/tfs/Application%20Development/_packaging/XYZ_SharedPackages/nuget/v3/index.json.
[C:\agent\_work\76\s\Foobar_Inc\Foobar_IncUI\Foobar_IncUI.csproj]
C:\Program Files\dotnet\sdk\6.0.200\NuGet.targets(130,5): error : Response status code does not indicate
success: 404 (Not Found - The feed with ID 'XYZ_SharedPackages' doesn't exist. (DevOps Activity ID: 5C76EC84-96B7-4125-BA30-296CF33B1754)).
[C:\agent\_work\76\s\Foobar_Inc\Foobar_IncUI\Foobar_IncUI.csproj]
The 404 error is coming from the source not existing, however I selected that feed by going into the restore command and selecting that option under feeds to use. My question is, does anyone know if it's possible to share across collections in dev ops.
If your two organziations are NOT in same AAD, you can follow below methods:
Method1:
You can use a NuGet authenticate task and a powershell task to run the nuget install command in the pipeline with the Feed URL of the target feed.
Create a Nuget Service connection to the target organization.
Target feed URL:https://pkgs.dev.azure.com/{orgname}/_packaging/{feedname}/nuget/v3/index.json, The password is PAT.
2.Add NuGet authenticate task before your restore.
Use the powershell task in line script.The in line script :
nuget install {package name} -version {package version} -Source https://pkgs.dev.azure.com/{orgname}/_packaging/{feedname}/nuget/v3/index.json.
It will restore the package successfully.
Method 2:
Directly use a powershell task with inline script:
nuget install {package name} -version {package version} -Source https://pkgs.dev.azure.com/{orgname}/_packaging/{feedname}/nuget/v3/index.json.
The two Environment Variables needs to be set:
• NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED=true
• VSS_NUGET_EXTERNAL_FEED_ENDPOINTS= {"endpointCredentials": [{"endpoint":"https://pkgs.dev.azure.com/{orgname}/_packaging/{feedname}/nuget/v3/index.json", "username":"optional", "password":"$(PAT)"}]}
If your two organizations are in same AAD, you can follow below steps:
Please check the permissions in Feed Settings -> Views. Then change the access permissions for Local view in more options-> edit, choose “All feeds and people in organizations associated with my Azure Active.
Setup upstream resource :
On the upstream feed, add project collection build service account as contributor or collab or owner role.

Nuxt3 deployment with Cloudflare pages failed

I have successfully compiled my nuxt3 project locally. But the deployment is not working with cloud flare page
00:14:35.140 Executing user command: npm run generate
00:14:35.613
00:14:35.613 > generate
00:14:35.613 > nuxt generate
00:14:35.614
00:14:35.725 Nuxt CLI v3.0.0-rc.3-27567768.c1f728e
00:14:38.919 ✔ Using ~/components/content for components in Markdown
00:14:43.437 ℹ Vite client warmed up in 3072ms
00:14:44.646 ℹ Client built in 4280ms
00:14:44.681 ℹ Building server...
00:14:47.053 ✔ Server built in 2373ms
00:14:47.249 ✔ Generated public dist
00:14:47.249 ℹ Initializing prerenderer
00:14:50.871 ℹ Prerendering 4 initial routes with crawler
00:14:50.891 ├─ / (20ms)
00:14:50.894 ├─ /200 (3ms)
00:14:50.897 ├─ /404 (3ms)
00:14:50.958 ├─ /api/_content/cache (61ms)
00:14:50.971 ✔ You can now deploy .output/public to any static hosting!
00:14:51.017 Finished
00:14:51.018 Note: No functions dir at /functions found. Skipping.
00:14:51.018 Validating asset output directory
00:14:51.018 Error: Output directory ".output/public" not found.
00:14:52.095 Failed: build output directory not found
This is failed with "Error: Output directory ".output/public" not found." but actually the directory is generated few lines before. Any clue to resolve this problem?
I worked around the problem with:
Adding Nitro output config [1] [2] to nuxt.config.ts:
export default defineNuxtConfig({
"nitro": {
"output": {
dir: 'output',
serverDir: 'output/server',
publicDir: 'output/public'
}
}
})
In Cloudflare Pages, setting build output directory to: server/output/public.
I think the issue is caused by the default deployment script at CloudFlare side, checking the existence of .output, but not being able to see "hidden" (starting with dot) folders.
17:27:08.682 Validating asset output directory
17:27:08.682 Error: Output directory ".output/public" not found.
Edit (2022-07-10) found a cleaner way:
add "target" : "static" to nuxt.config.ts
Use as CloudFlare Pages build command: ./node_modules/.bin/nuxt generate
Set CloudFlare Pages build output directory to dist
I also had this issue, after testings, this is what i found.
The documentation says Use the nuxi generate command to build your application. (https://v3.nuxtjs.org/getting-started/deployment#static-hosting).
Configure Node Version
First, i'll add an .nvmrc file at the root of the project, so that Cloudflare doesn't use its default 12.18.0 version on deploy.
The content of the file is :
16
sources:
nuxt 3 prerequisites : https://v3.nuxtjs.org/getting-started/installation/#prerequisites
Node version on Cloudflare Pages : https://developers.cloudflare.com/pages/platform/build-configuration/#language-support-and-tools
Configure the Cloudflare Page
Then i'm adding the configuration in the cloudflare interface with following :
Build command: npx nuxi generate
Build output directory: /.output/public
Root directory: /
🚀
Going further
Actually, it shouldn't be a problem to deploy easily on CF Pages: the team has added a cloudflare_pages preset right into nitro, the server library behind nuxt 3. https://nitro.unjs.io/deploy/providers/cloudflare#cloudflare-pages
I wasn't able to make this preset work for now, i'll update my answer when this has changed :)

How to config in step 4 in a Distributed API-M Deployment with Traffic Manager Separation

I have deployed tm , cp , gw at 3 vms for wso2 apimanager, but how to config deployment.toml in a distribution deployment with tm separation? I don't know what should i do in step4 from here
You have to follow the same steps with the traffic-manager separation as well. There's a separate doc for traffic-manager separated pattern[1]. You can refer that during the setup.
[1]- https://apim.docs.wso2.com/en/latest/install-and-setup/setup/distributed-deployment/deploying-wso2-api-m-in-a-distributed-setup-with-tm-separated/

Symfony console output creates extra unwanted characters

i got this weird error, where every output in the console with symfony creates some extra characters. The following is the output after a basic symfony in the console.
$ symfony
←[32mSymfony CLI←[39m version ←[33mv4.22.0←[39m (c) 2017-2021 Symfony SAS
Symfony CLI helps developers manage projects, from local code to remote infrastructure
These are common commands used in various situations:
←[33mWork on a project locally←[39m
←[32mnew←[39m Create a new Symfony project
←[32mserve←[39m Run a local web server
←[32mserver:stop←[39m Stop the local web server
←[32msecurity:check←[39m Check security issues in project dependencies
←[32mcomposer←[39m Runs Composer without memory limit
←[32mconsole←[39m Runs the Symfony Console (bin/console) for current project
←[32mphp, pecl, pear, php-fpm, php-cgi, php-config, phpdbg, phpize←[39m Runs the named binary using the configured PHP version
←[33mManage a project on Cloud←[39m
←[32mlogin←[39m Log in with your SymfonyConnect account
←[32minit←[39m Initialize a new project using templates
←[32mlink←[39m Link current git repository to a SymfonyCloud project
←[32mprojects←[39m List active projects
←[32menvs←[39m List environments
←[32menv:create←[39m Create an environment
←[32mtunnel:open←[39m Open SSH tunnels to the app's services
←[32mssh←[39m Open an SSH connection to the app container
←[32mdeploy←[39m Deploy an environment
←[32mdomains←[39m List domains
←[32mvars←[39m List variables
←[32muser:add←[39m Add a user to the project
Show all commands with ←[32msymfony.exe help←[39m,
Get help for a specific command with ←[32msymfony.exe help COMMAND←[39m.
As you can see, I get this ←[33m here and there. Any help is gratefully accepted. Please let me know if you need any additional information from me.
$ bin/console --version
Symfony 5.2.1 (env: dev, debug: true)

Blogdown new post addin creates but not loads new file

Context
After installed (see previous post) and configured my personal Hugo website for a multilingual setup (by directories), I wanted to start creating content. Ideally, I wanted to use blogdown in RStudio, via the addins. The website uses the Academic theme, rebranded now as Wowchemy.
The content directory tree is as follows:
content
|
├── en
├── authors
├── files (for static files)
├── home (homepage widgets)
├── post
├── project
└── resources
|
└── hu
├── authors
├── files (for static files)
├── home (homepage widgets)
├── post
├── project
└── resources
Multilingual setup references:
Hugo Multilingual Part 1: Content translation - general overview, with managing content translations by directories and page bundles
Start a Multi Language Blog with Hugo on Github Pages - for basic config.toml settings and highlighting the use of partials
Light/Dark/Automatic translation - for getting to know how to make modification in interface translations (although do not know how to share it with the themes repo)
How can I add credits by the end of the page? - for translating the footers of the webpages (which is not a content and can not be set in any config file), through partials.
Problem
When I use the new post addin in RStudio, the file is created in place, but does not open automatically for editing. The English and Hungarian language setting both works the same way.
> blogdown:::new_post_addin()
Listening on http://127.0.0.1:6918
C:\Users\HP\Documents\R\website\content\en\post\2020-11-04-how-this-site-was-created\index.en.md created
Warning in file(con, "r") :
cannot open file 'content/post/2020-11-04-how-this-site-was-created/index.en.md': No such file or directory
Warning: Error in file: cannot open the connection
91: file
90: readLines
87: hugo_convert_one
86: new_content
85: blogdown::new_post
84: observeEventHandler
13: shiny::runApp
12: shiny::runGadget
11: eval
10: eval
4: eval
3: eval
2: sys.source
1: blogdown:::new_post_addin
Question
How can this be resolved? As far as I see, something has to be with the file path after creating the file, because the file is created in the right place.
Configuration
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Hungarian_Hungary.1250 LC_CTYPE=Hungarian_Hungary.1250
[3] LC_MONETARY=Hungarian_Hungary.1250 LC_NUMERIC=C
[5] LC_TIME=Hungarian_Hungary.1250
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_1.5.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 bookdown_0.21 crayon_1.3.4 digest_0.6.26 later_1.1.0.1
[6] mime_0.9 R6_2.4.1 jsonlite_1.7.1 xtable_1.8-4 magrittr_1.5
[11] evaluate_0.14 blogdown_0.21 rlang_0.4.8 rstudioapi_0.11 miniUI_0.1.1.1
[16] promises_1.1.1 rmarkdown_2.4 tools_4.0.3 tinytex_0.26 fastmap_1.0.1
[21] httpuv_1.5.4 xfun_0.18 yaml_2.2.1 compiler_4.0.3 htmltools_0.5.0
[26] knitr_1.30
I am not good at using the debug tools, so just stepped through the code. (Appreciate the suggestion of good tutorials!)
First things first: When in Doubt, Try to Upgrade Your Software Packages This is the blogdown package creator's advice. Checked.
Launching the addin, blogdown:::new_post_addin is called.
This calls new_post.R. The source code can be find at: https://github.com/rstudio/blogdown/blob/master/inst/scripts/new_post.R
blogdown::new_post() is called at the end, with file parameter from the updated input text field, which is in the case of the question: "post\2020-11-04-how-this-site-was-created\index.en.md"
new_post() function (in hugo.R) calls new_content() with the third argument, open = FALSE, which means it will not open the file, just overwrite the value of the file variable (the path hereafter). At the end of new_post() the file should be opened: this is where the error occurs (by trying to open the file at the wrong place, a wrong path). This means that something bad has to happen in new_content().
new_content() modify the path with content_file(). Also this is the step, where the file is actually created.
content_file() modify the path by adding a prefix to it generated by get_config().
get_config() tries to extract the value of a field in the configuration, in the case of Hugo: try to find contentDir. If this results in NULL (there's no such list item), then see the other possibility and lastly return the default value (which is in the case of Hugo: content). And that's it! RStudio tries to open a file in the content directory, not in a language subdirectory!
That means that the last option is returned in the row of %n% (which is imported from knitr and stands for: if (is.null(x)) y else x). That means that the previous arguments returned NULL, which means contentDir cannot be found in config variable. The default value of config is set by config = load_config(). This uses find_config() to find the config file to parse.
find_config() uses config_files() to set the value in case of Hugo: c('config.toml', 'config.yaml'). But my setting is in a subdirectory: in the /config/default_/languages.toml file! Oh, another Academic theme woe...
To conclude this: blogdown is currently loads only the config.toml in the root directory to check the contentDir value. The Academic, now Wowchemy Hugo theme however keep config files in the /config/default_/ directory also, where the languages.toml contains the needed value.
To keep or not to keep Academic theme? Stick with blogdown or not? Maybe the config files should be merged into one config.toml, but couldn't find hint or examples for Academic on the web.
Edit: OK, the root of the problem has been found, but the actual error which raised the error message is in connection with hugo_convert_one(), as the traceback suggests in the question. This was the first (and last) try to open the file of the wrong path.

Resources