Skip to content

Commit

Permalink
fix: Fix DOI url
Browse files Browse the repository at this point in the history
  • Loading branch information
drorganvidez committed Mar 22, 2024
1 parent c66b6ba commit 847d26b
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 20 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Create an `.env` file in the root of the project with this information. It is im

```
FLASK_APP_NAME=UVLHUB.IO
FLASK_SERVER_NAME=localhost
DOMAIN=localhost
MARIADB_HOSTNAME=db
MARIADB_PORT=3306
Expand Down
3 changes: 0 additions & 3 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ def create_app(config_name=None):
# Uploads feature models configuration
app.config['UPLOAD_FOLDER'] = os.path.join(app.root_path, 'uploads')

# Server name
app.config['SERVER_NAME'] = os.getenv('FLASK_SERVER_NAME', 'localhost')

# Initialize SQLAlchemy and Migrate with the app
db.init_app(app)
migrate.init_app(app, db)
Expand Down
2 changes: 1 addition & 1 deletion app/blueprints/dataset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def get_file_total_size_for_human(self):

def get_uvlhub_doi(self):
domain = os.getenv('DOMAIN', 'localhost')
return f'http://doi.{domain}/{self.ds_meta_data.dataset_doi}'
return f'http://{domain}/doi/{self.ds_meta_data.dataset_doi}'

def to_dict(self):
return {
Expand Down
2 changes: 1 addition & 1 deletion app/blueprints/dataset/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ def _create_feature_models(dataset: DataSet, models: dict, user: User) -> List[F
return feature_models


@dataset_bp.route('/<path:doi>/', subdomain='doi', methods=['GET'])
@dataset_bp.route('/doi/<path:doi>/', methods=['GET'])
def subdomain_index(doi):
# Busca el dataset por DOI
ds_meta_data = DSMetaData.query.filter_by(dataset_doi=doi).first()
Expand Down
15 changes: 1 addition & 14 deletions nginx/nginx.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ http {
}
}

server {
listen 80;
server_name doi.uvlhub.io;

location / {
proxy_pass http://web;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

server {
listen 443 ssl;

Expand All @@ -46,7 +33,7 @@ http {

# Set proxy headers
proxy_pass http://web;
proxy_set_header Host $host;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
Expand Down

0 comments on commit 847d26b

Please sign in to comment.